@nocobase/app 2.1.0-beta.40 → 2.1.0-beta.42
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.
- package/dist/client/assets/{index-2f950934.js → index-d8e97233.js} +5 -5
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.tpl +1 -1
- package/dist/client/v2/assets/{index-6eee200a.js → index-48dce4e9.js} +100 -100
- package/dist/client/v2/index.html +1 -1
- package/package.json +7 -7
- /package/dist/client/assets/{index-2f950934.js.LICENSE.txt → index-d8e97233.js.LICENSE.txt} +0 -0
- /package/dist/client/v2/assets/{index-6eee200a.js.LICENSE.txt → index-48dce4e9.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! For license information please see index-
|
|
1
|
+
/*! For license information please see index-d8e97233.js.LICENSE.txt */
|
|
2
2
|
(globalThis.webpackChunknocobase=globalThis.webpackChunknocobase||[]).push([["8410"],{65359(e,t,l){var n={"./en-nz":["35571","8878"],"./bi.js":["95944","8878"],"./id.js":["87420","8878"],"./km":["36101","8878"],"./he.js":["92010","8878"],"./me":["80623","8878"],"./tk":["62544","8878"],"./ko.js":["88003","8878"],"./tet.js":["18928","8878"],"./es-do":["61219","8878"],"./ku":["16605","8878"],"./hr":["15811","8878"],"./zh-tw.js":["31349","8878"],"./hy-am":["94309","8878"],"./am.js":["4736","8878"],"./en-in":["60912","8878"],"./de-at":["32878","8878"],"./pt-br":["92218","8878"],"./ar-iq.js":["13309","8878"],"./en-sg":["12673","8878"],"./zh":["56007","8878"],"./en-il.js":["97690","8878"],"./lo":["73860","8878"],"./tlh":["60321","8878"],"./mi.js":["32739","8878"],"./el":["54072","8878"],"./ur.js":["51750","8878"],"./sq":["95977","8878"],"./pa-in.js":["39252","8878"],"./ar-kw.js":["79865","8878"],"./fr-ca.js":["86290","8878"],"./de-ch.js":["13672","8878"],"./ru":["62796","8878"],"./eo.js":["33713","8878"],"./nb":["7205","8878"],"./br":["72745","8878"],"./fo":["17674","8878"],"./zh.js":["56007","8878"],"./vi":["96098","8878"],"./fr-ch.js":["73433","8878"],"./ms-my":["26400","8878"],"./es-pr":["3532","8878"],"./bo.js":["59294","8878"],"./ht.js":["8809","8878"],"./lo.js":["73860","8878"],"./my.js":["46803","8878"],"./et":["4288","8878"],"./br.js":["72745","8878"],"./gu":["57409","8878"],"./it-ch":["19286","8878"],"./sv-fi":["9160","8878"],"./ne.js":["40880","8878"],"./zh-cn.js":["16033"],"./gom-latn.js":["78660","8878"],"./bg.js":["39990","8878"],"./mr.js":["46462","8878"],"./cv.js":["4780","8878"],"./lt.js":["34485","8878"],"./pt":["72369","8878"],"./th.js":["47081","8878"],"./cs.js":["9751","8878"],"./es.js":["47317","8878"],"./bn.js":["92509","8878"],"./ar-tn":["54405","8878"],"./mi":["32739","8878"],"./sr.js":["45616","8878"],"./tr":["4895","8878"],"./bn-bd":["64608","8878"],"./fa.js":["90292","8878"],"./it":["33900","8878"],"./nl":["69423","8878"],"./zh-hk":["87741","8878"],"./fo.js":["17674","8878"],"./bs.js":["25530","8878"],"./ja.js":["50952","8878"],"./my":["46803","8878"],"./es-do.js":["61219","8878"],"./gl":["33562","8878"],"./nl-be.js":["60465","8878"],"./en-ca.js":["21995","8878"],"./tzm-latn.js":["58804","8878"],"./types.d.ts":["69224","8878"],"./ru.js":["62796","8878"],"./sq.js":["95977","8878"],"./cv":["4780","8878"],"./km.js":["36101","8878"],"./fa":["90292","8878"],"./cs":["9751","8878"],"./ms":["79677","8878"],"./types.d":["69224","8878"],"./ca":["25993","8878"],"./tr.js":["4895","8878"],"./x-pseudo":["5760","8878"],"./tzm-latn":["58804","8878"],"./kn":["6364","8878"],"./jv":["77741","8878"],"./ms-my.js":["26400","8878"],"./ht":["8809","8878"],"./be":["51532","8878"],"./gd":["68418","8878"],"./en-au":["59881","8878"],"./ka":["46481","8878"],"./ka.js":["46481","8878"],"./ur":["51750","8878"],"./sv.js":["21340","8878"],"./zh-cn":["16033"],"./pl.js":["63225","8878"],"./hi":["52830","8878"],"./ug-cn":["79911","8878"],"./ar-kw":["79865","8878"],"./dv.js":["82187","8878"],"./id":["87420","8878"],"./dv":["82187","8878"],"./vi.js":["96098","8878"],"./de-ch":["13672","8878"],"./en-in.js":["60912","8878"],"./es-pr.js":["3532","8878"],"./es-us.js":["32498","8878"],"./ar-iq":["13309","8878"],"./fi.js":["89964","8878"],"./ca.js":["25993","8878"],"./ms.js":["79677","8878"],"./zh-tw":["31349","8878"],"./bs":["25530","8878"],"./rw.js":["35414","8878"],"./fy":["59836","8878"],"./uz-latn":["80950","8878"],"./mt.js":["99464","8878"],"./fr.js":["813","8878"],"./hu":["38298","8878"],"./lv.js":["76467","8878"],"./sr-cyrl.js":["27439","8878"],"./tzl":["3187","8878"],"./mn":["12698","8878"],"./pa-in":["39252","8878"],"./nl-be":["60465","8878"],"./kk":["11335","8878"],"./en-tt":["2619","8878"],"./ar-ly.js":["85592","8878"],"./hr.js":["15811","8878"],"./kk.js":["11335","8878"],"./ar":["2338","8878"],"./ar-dz.js":["48361","8878"],"./ar-sa":["40539","8878"],"./nl.js":["69423","8878"],"./cy":["95681","8878"],"./en-ie":["17329","8878"],"./lb.js":["88615","8878"],"./ar-ly":["85592","8878"],"./de.js":["50494","8878"],"./am":["4736","8878"],"./lv":["76467","8878"],"./tg":["15012","8878"],"./de-at.js":["32878","8878"],"./sl":["39998","8878"],"./tg.js":["15012","8878"],"./ky.js":["34457","8878"],"./kn.js":["6364","8878"],"./bo":["59294","8878"],"./da":["42706","8878"],"./ss.js":["52487","8878"],"./uz":["54734","8878"],"./fr-ch":["73433","8878"],"./sk":["46847","8878"],"./hu.js":["38298","8878"],"./sr":["45616","8878"],"./he":["92010","8878"],"./uk.js":["34173","8878"],"./es-mx":["64719","8878"],"./se.js":["55285","8878"],"./oc-lnc":["70225","8878"],"./pt-br.js":["92218","8878"],"./rw":["35414","8878"],"./ar-sa.js":["40539","8878"],"./nb.js":["7205","8878"],"./fr-ca":["86290","8878"],"./hi.js":["52830","8878"],"./gl.js":["33562","8878"],"./en-ie.js":["17329","8878"],"./me.js":["80623","8878"],"./fy.js":["59836","8878"],"./ar.js":["2338","8878"],"./az":["51130","8878"],"./lt":["34485","8878"],"./en":["65826","8878"],"./ro.js":["24334","8878"],"./sw":["2979","8878"],"./te.js":["87406","8878"],"./tl-ph.js":["78142","8878"],"./es-mx.js":["64719","8878"],"./ky":["34457","8878"],"./it.js":["33900","8878"],"./zh-hk.js":["87741","8878"],"./da.js":["42706","8878"],"./te":["87406","8878"],"./mt":["99464","8878"],"./lb":["88615","8878"],"./uz-latn.js":["80950","8878"],"./ml.js":["75376","8878"],"./en-sg.js":["12673","8878"],"./uz.js":["54734","8878"],"./tzm.js":["95084","8878"],"./tet":["18928","8878"],"./oc-lnc.js":["70225","8878"],"./az.js":["51130","8878"],"./en-au.js":["59881","8878"],"./fr":["813","8878"],"./gd.js":["68418","8878"],"./yo.js":["87933","8878"],"./nn":["23473","8878"],"./bm":["71092","8878"],"./index.d.ts":["41213","8878"],"./sw.js":["2979","8878"],"./af":["65662","8878"],"./en-il":["97690","8878"],"./eu":["94007","8878"],"./et.js":["4288","8878"],"./rn":["34509","8878"],"./se":["55285","8878"],"./sv-fi.js":["9160","8878"],"./gu.js":["57409","8878"],"./gom-latn":["78660","8878"],"./pl":["63225","8878"],"./ar-dz":["48361","8878"],"./ar-ma":["81289","8878"],"./eu.js":["94007","8878"],"./ss":["52487","8878"],"./tk.js":["62544","8878"],"./es-us":["32498","8878"],"./bi":["95944","8878"],"./ug-cn.js":["79911","8878"],"./mn.js":["12698","8878"],"./pt.js":["72369","8878"],"./cy.js":["95681","8878"],"./mr":["46462","8878"],"./ga.js":["54061","8878"],"./ko":["88003","8878"],"./ku.js":["16605","8878"],"./af.js":["65662","8878"],"./hy-am.js":["94309","8878"],"./es":["47317","8878"],"./ml":["75376","8878"],"./en-ca":["21995","8878"],"./bn":["92509","8878"],"./ga":["54061","8878"],"./is.js":["15513","8878"],"./sd.js":["63222","8878"],"./sl.js":["39998","8878"],"./tlh.js":["60321","8878"],"./tl-ph":["78142","8878"],"./uk":["34173","8878"],"./x-pseudo.js":["5760","8878"],"./is":["15513","8878"],"./jv.js":["77741","8878"],"./el.js":["54072","8878"],"./fi":["89964","8878"],"./bn-bd.js":["64608","8878"],"./en-gb":["72026","8878"],"./en-gb.js":["72026","8878"],"./mk":["75877","8878"],"./ne":["40880","8878"],"./ro":["24334","8878"],"./mk.js":["75877","8878"],"./si":["65665","8878"],"./tzm":["95084","8878"],"./be.js":["51532","8878"],"./de":["50494","8878"],"./rn.js":["34509","8878"],"./si.js":["65665","8878"],"./yo":["87933","8878"],"./bg":["39990","8878"],"./en.js":["65826","8878"],"./sv":["21340","8878"],"./th":["47081","8878"],"./bm.js":["71092","8878"],"./nn.js":["23473","8878"],"./ar-ma.js":["81289","8878"],"./index.d":["41213","8878"],"./ja":["50952","8878"],"./ta.js":["77250","8878"],"./ar-tn.js":["54405","8878"],"./sd":["63222","8878"],"./sk.js":["46847","8878"],"./tzl.js":["3187","8878"],"./en-nz.js":["35571","8878"],"./eo":["33713","8878"],"./ta":["77250","8878"],"./en-tt.js":["2619","8878"],"./it-ch.js":["19286","8878"],"./sr-cyrl":["27439","8878"]};function o(e){if(!l.o(n,e))return Promise.resolve().then(function(){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=n[e],o=t[0];return Promise.all(t.slice(1).map(l.e)).then(function(){return l.t(o,23)})}o.keys=()=>Object.keys(n),o.id=65359,e.exports=o},35358(e,t,l){var n={"./af":"25177","./af.js":"25177","./ar":"61509","./ar-dz":"41488","./ar-dz.js":"41488","./ar-kw":"58676","./ar-kw.js":"58676","./ar-ly":"42353","./ar-ly.js":"42353","./ar-ma":"24496","./ar-ma.js":"24496","./ar-sa":"82682","./ar-sa.js":"82682","./ar-tn":"89756","./ar-tn.js":"89756","./ar.js":"61509","./az":"95533","./az.js":"95533","./be":"28959","./be.js":"28959","./bg":"47777","./bg.js":"47777","./bm":"54903","./bm.js":"54903","./bn":"61290","./bn-bd":"17357","./bn-bd.js":"17357","./bn.js":"61290","./bo":"31545","./bo.js":"31545","./br":"11470","./br.js":"11470","./bs":"44429","./bs.js":"44429","./ca":"7306","./ca.js":"7306","./cs":"56464","./cs.js":"56464","./cv":"73635","./cv.js":"73635","./cy":"64226","./cy.js":"64226","./da":"93601","./da.js":"93601","./de":"77853","./de-at":"26111","./de-at.js":"26111","./de-ch":"54697","./de-ch.js":"54697","./de.js":"77853","./dv":"60708","./dv.js":"60708","./el":"54691","./el.js":"54691","./en-au":"53872","./en-au.js":"53872","./en-ca":"28298","./en-ca.js":"28298","./en-gb":"56195","./en-gb.js":"56195","./en-ie":"66584","./en-ie.js":"66584","./en-il":"65543","./en-il.js":"65543","./en-in":"9033","./en-in.js":"9033","./en-nz":"79402","./en-nz.js":"79402","./en-sg":"43004","./en-sg.js":"43004","./eo":"32934","./eo.js":"32934","./es":"97650","./es-do":"20838","./es-do.js":"20838","./es-mx":"17730","./es-mx.js":"17730","./es-us":"56575","./es-us.js":"56575","./es.js":"97650","./et":"3035","./et.js":"3035","./eu":"3508","./eu.js":"3508","./fa":"119","./fa.js":"119","./fi":"90527","./fi.js":"90527","./fil":"95995","./fil.js":"95995","./fo":"52477","./fo.js":"52477","./fr":"85498","./fr-ca":"26435","./fr-ca.js":"26435","./fr-ch":"37892","./fr-ch.js":"37892","./fr.js":"85498","./fy":"37071","./fy.js":"37071","./ga":"41734","./ga.js":"41734","./gd":"70217","./gd.js":"70217","./gl":"77329","./gl.js":"77329","./gom-deva":"32124","./gom-deva.js":"32124","./gom-latn":"93383","./gom-latn.js":"93383","./gu":"95050","./gu.js":"95050","./he":"11713","./he.js":"11713","./hi":"43861","./hi.js":"43861","./hr":"26308","./hr.js":"26308","./hu":"90609","./hu.js":"90609","./hy-am":"17160","./hy-am.js":"17160","./id":"74063","./id.js":"74063","./is":"89374","./is.js":"89374","./it":"88383","./it-ch":"21827","./it-ch.js":"21827","./it.js":"88383","./ja":"23827","./ja.js":"23827","./jv":"89722","./jv.js":"89722","./ka":"41794","./ka.js":"41794","./kk":"27088","./kk.js":"27088","./km":"96870","./km.js":"96870","./kn":"84451","./kn.js":"84451","./ko":"63164","./ko.js":"63164","./ku":"98174","./ku.js":"98174","./ky":"78474","./ky.js":"78474","./lb":"79680","./lb.js":"79680","./lo":"15867","./lo.js":"15867","./lt":"45766","./lt.js":"45766","./lv":"69532","./lv.js":"69532","./me":"58076","./me.js":"58076","./mi":"41848","./mi.js":"41848","./mk":"30306","./mk.js":"30306","./ml":"73739","./ml.js":"73739","./mn":"99053","./mn.js":"99053","./mr":"86169","./mr.js":"86169","./ms":"73386","./ms-my":"92297","./ms-my.js":"92297","./ms.js":"73386","./mt":"77075","./mt.js":"77075","./my":"72264","./my.js":"72264","./nb":"22274","./nb.js":"22274","./ne":"8235","./ne.js":"8235","./nl":"92572","./nl-be":"43784","./nl-be.js":"43784","./nl.js":"92572","./nn":"54566","./nn.js":"54566","./oc-lnc":"69330","./oc-lnc.js":"69330","./pa-in":"29849","./pa-in.js":"29849","./pl":"94418","./pl.js":"94418","./pt":"79834","./pt-br":"48303","./pt-br.js":"48303","./pt.js":"79834","./ro":"24457","./ro.js":"24457","./ru":"82271","./ru.js":"82271","./sd":"1221","./sd.js":"1221","./se":"33478","./se.js":"33478","./si":"17538","./si.js":"17538","./sk":"5784","./sk.js":"5784","./sl":"46637","./sl.js":"46637","./sq":"86794","./sq.js":"86794","./sr":"45719","./sr-cyrl":"3322","./sr-cyrl.js":"3322","./sr.js":"45719","./ss":"56000","./ss.js":"56000","./sv":"41011","./sv.js":"41011","./sw":"40748","./sw.js":"40748","./ta":"11025","./ta.js":"11025","./te":"11885","./te.js":"11885","./tet":"28861","./tet.js":"28861","./tg":"86571","./tg.js":"86571","./th":"55802","./th.js":"55802","./tk":"59527","./tk.js":"59527","./tl-ph":"29231","./tl-ph.js":"29231","./tlh":"31052","./tlh.js":"31052","./tr":"85096","./tr.js":"85096","./tzl":"79846","./tzl.js":"79846","./tzm":"81765","./tzm-latn":"97711","./tzm-latn.js":"97711","./tzm.js":"81765","./ug-cn":"48414","./ug-cn.js":"48414","./uk":"16618","./uk.js":"16618","./ur":"57777","./ur.js":"57777","./uz":"57609","./uz-latn":"72475","./uz-latn.js":"72475","./uz.js":"57609","./vi":"21135","./vi.js":"21135","./x-pseudo":"64051","./x-pseudo.js":"64051","./yo":"82218","./yo.js":"82218","./zh-cn":"52648","./zh-cn.js":"52648","./zh-hk":"1632","./zh-hk.js":"1632","./zh-mo":"31541","./zh-mo.js":"31541","./zh-tw":"50304","./zh-tw.js":"50304"};function o(e){return l(r(e))}function r(e){if(!l.o(n,e)){var t=Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}o.keys=function(){return Object.keys(n)},o.resolve=r,e.exports=o,o.id=35358},65644(e,t,l){"use strict";let n,o;var r={};l.r(r),l.d(r,{APIClient:()=>N,Auth:()=>M,BaseStorage:()=>I,LocalStorage:()=>R,MemoryStorage:()=>T,SessionStorage:()=>E,getSubAppName:()=>D,hasHeaderValue:()=>j});var i={};l.r(i),l.d(i,{default:()=>rB,evaluators:()=>rN,getOptions:()=>rD});var a={};l.r(a),l.d(a,{array:()=>r8,bigField:()=>io,boolean:()=>ie,collection:()=>il,datetime:()=>r4,enumType:()=>r9,id:()=>r6,number:()=>r3,object:()=>r5,string:()=>r2,tableoid:()=>it,time:()=>r7});var s={};l.r(s),l.d(s,{connectFields:()=>pf,customizeFilterRender:()=>pP,defaultOperator:()=>px,operatorComponentProps:()=>pI});var d={};l.r(d),l.d(d,{ASSIGN_FIELD_VALUES_STEP_KEY:()=>dl.zL,ActionGroupModel:()=>az,ActionModel:()=>aW.S0,ActionSceneEnum:()=>aW.s5,ActionWithoutPermission:()=>aW._T,AddChildActionModel:()=>dR,AddNewActionModel:()=>sV,AssignFormGridModel:()=>d$,AssignFormItemModel:()=>d5,AssignFormModel:()=>dD,AssociateActionModel:()=>sQ,AssociationFieldGroupModel:()=>aH,AssociationFieldModel:()=>uu,BasePageTabModel:()=>sN,BlockGridModel:()=>sh,BlockModel:()=>sf.z,BlockSceneEnum:()=>sf.P,BulkDeleteActionModel:()=>sZ,CascadeSelectFieldModel:()=>h3,CascadeSelectInnerFieldModel:()=>h5,CascadeSelectListFieldModel:()=>h6,CheckboxFieldModel:()=>fk,CheckboxGroupFieldModel:()=>fA,ChildPageModel:()=>sj,ChildPageTabModel:()=>sB,ClickableFieldModel:()=>hU,CollectionActionGroupModel:()=>aK,CollectionActionModel:()=>sg.U,CollectionBlockModel:()=>sv.t,CollectionSelectorFieldModel:()=>fM,ColorFieldModel:()=>fR,CommonItemModel:()=>sy,CreateContent:()=>uT,CreateFormModel:()=>pR,CustomWidth:()=>p7,DataBlockModel:()=>sx.R,DateOnlyFieldModel:()=>fV,DateOnlyFilterFieldModel:()=>uK,DateOnlyPicker:()=>fL,DateTimeFilterFieldModel:()=>uV,DateTimeNoTzFieldModel:()=>fK,DateTimeNoTzFilterFieldModel:()=>uW,DateTimeNoTzPicker:()=>fz,DateTimeTzFieldModel:()=>fG,DateTimeTzFilterFieldModel:()=>uG,DateTimeTzPicker:()=>fH,DeleteActionModel:()=>s0,DetailsAssociationFieldGroupModel:()=>d4,DetailsBlockModel:()=>d7,DetailsCustomItemModel:()=>ut,DetailsGridModel:()=>ul,DetailsItemModel:()=>dW,DetailsJSFieldItemModel:()=>ua,DisassociateActionModel:()=>s1,DisplayCheckboxFieldModel:()=>vj,DisplayColorFieldModel:()=>g7,DisplayDateTimeFieldModel:()=>ve,DisplayEnumFieldModel:()=>vo,DisplayHtmlFieldModel:()=>vi,DisplayIconFieldModel:()=>va,DisplayJSONFieldModel:()=>vu,DisplayNumberFieldModel:()=>vb,DisplayPasswordFieldModel:()=>vw,DisplayPercentFieldModel:()=>vC,DisplaySubItemFieldModel:()=>g5,DisplaySubListFieldModel:()=>g9,DisplaySubTableFieldModel:()=>g8,DisplayTextFieldModel:()=>vF,DisplayTimeFieldModel:()=>vA,DisplayTitleFieldModel:()=>gQ,DisplayURLFieldModel:()=>vk,DividerItemModel:()=>gz,EditActionModel:()=>s2,EditFormContent:()=>fs,EditFormModel:()=>dH.EditFormModel,ExpandCollapseActionModel:()=>dM,FieldDeletePlaceholder:()=>p6,FieldModel:()=>sb.o,FieldModelSelect:()=>u6,FieldOperatorSelect:()=>cf,FilterActionModel:()=>s4,FilterBlockModel:()=>sS,FilterFormActionGroupModel:()=>cT,FilterFormActionModel:()=>cI,FilterFormBlockModel:()=>c0,FilterFormCollapseActionModel:()=>c4,FilterFormCustomFieldModel:()=>cS,FilterFormCustomItemModel:()=>cg,FilterFormCustomRecordSelectFieldModel:()=>cM,FilterFormFieldModel:()=>us,FilterFormGridModel:()=>ps,FilterFormItemModel:()=>pa,FilterFormJSActionModel:()=>pd,FilterFormRecordSelectFieldModel:()=>u_,FilterFormResetActionModel:()=>pu,FilterFormSubmitActionModel:()=>pc,FilterManager:()=>a8,FormActionGroupModel:()=>da,FormActionModel:()=>dr,FormAssociationFieldGroupModel:()=>pL,FormAssociationItemModel:()=>pW,FormBlockContent:()=>dN.JU,FormBlockModel:()=>dN.F4,FormComponent:()=>dN.s2,FormCustomItemModel:()=>pE,FormGridModel:()=>dB,FormItemModel:()=>dQ,FormJSFieldItemModel:()=>pN,FormModel:()=>dN.mO,FormSubmitActionModel:()=>di,GRID_FLOW_KEY:()=>sr,GRID_STEP:()=>si,GridModel:()=>ss,IconFieldModel:()=>fZ,InputFieldModel:()=>pS.m,InputNumberField:()=>f9,JSActionModel:()=>de,JSBlockModel:()=>pY,JSCollectionActionModel:()=>dt,JSColumnModel:()=>mV,JSEditableFieldModel:()=>gq,JSFieldModel:()=>gP,JSFormActionModel:()=>pD,JSItemActionModel:()=>dp,JSItemModel:()=>gY,JSRecordActionModel:()=>dm,JsonFieldModel:()=>f4,JsonInput:()=>f5,LinkActionModel:()=>dj,MainPageModel:()=>sT,MarkdownItemModel:()=>gG,NBColorPicker:()=>fT,NumberFieldModel:()=>f7,ObjectNester:()=>hj,PageModel:()=>sA,PageTabModel:()=>s$,PasswordFieldModel:()=>ge,PercentFieldModel:()=>go,PercentInput:()=>gn,PluginSettingsTopbarActionModel:()=>nL,PopupActionModel:()=>s_,PopupCollectionActionModel:()=>dh,PopupSubTableActionGroupModel:()=>fy,PopupSubTableActionsColumnModel:()=>fS,PopupSubTableEditActionModel:()=>fu,PopupSubTableFieldModel:()=>fg,PopupSubTableFormActionGroupModel:()=>du,PopupSubTableFormModel:()=>fw,PopupSubTableFormSubmitActionModel:()=>dd,PopupSubTableRemoveActionModel:()=>fv,QUICK_EDIT_FORM_MAX_HEIGHT:()=>p$,QUICK_EDIT_MARKDOWN_HEIGHT:()=>pO,QUICK_EDIT_POPOVER_MAX_HEIGHT:()=>pB,QuickEditFormModel:()=>p_,RadioGroupFieldModel:()=>gr,RecordActionGroupModel:()=>aU,RecordActionModel:()=>sL.L,RecordPickerContent:()=>m3,RecordPickerFieldModel:()=>m9,RecordSelectFieldModel:()=>uN,RefreshActionModel:()=>df,RichTextField:()=>gh,RichTextFieldModel:()=>gf,RootPageModel:()=>sO,RootPageTabModel:()=>sD,RouteModel:()=>ek,SelectFieldModel:()=>gy,SourceCascader:()=>cy,SubFormFieldModel:()=>hM,SubFormListFieldModel:()=>hT,SubPageModel:()=>sq,SubTableColumnModel:()=>hg,SubTableFieldModel:()=>hk,SubTableRecordAction:()=>fd,TableActionsColumnModel:()=>mi,TableAssociationFieldGroupModel:()=>ma,TableBlockModel:()=>mR,TableColumnModel:()=>me,TableCustomColumnModel:()=>mt,TableJSFieldItemModel:()=>m_,TableSelectModel:()=>mq,TextareaFieldModel:()=>gx,TimeFieldModel:()=>gF,TopbarActionModel:()=>nD,UIEditorTopbarActionModel:()=>n_,USER_CENTER_ACTION_ID:()=>nV,UnitConversion:()=>vS,UpdateRecordActionModel:()=>dS,UserCenterActionItemModel:()=>nX,UserCenterItemModel:()=>nY,UserCenterSelectItemModel:()=>nQ,UserCenterTextItemModel:()=>nJ,UserCenterTopbarActionModel:()=>n5,VariableFieldFormModel:()=>gk,ViewActionModel:()=>dw,applyAssociateAction:()=>sY,applyClickToOpenProps:()=>hV,applyClickToOpenSetting:()=>hK,applyDisassociateAction:()=>sG,buildDisplayPathFromValue:()=>hQ,buildRecordPickerParentItemContext:()=>m2,buildRecordPickerPopupContextInputArgs:()=>m5,collectAssociationHydrationCandidates:()=>uj,collectCascadeHydrationCandidate:()=>hJ,connectFields:()=>pf,createAssignFieldValuesStep:()=>dl.KW,createAssignFormSubModelOptions:()=>dl.nF,customizeFilterRender:()=>pP,defaultOperator:()=>px,findOptionPathByTk:()=>hZ,formatNumber:()=>vy,getAllDataModels:()=>aX,getAssignFieldValuesDefaultParams:()=>dl.Z1,getAssociationBlockResourceSettings:()=>sz,getAssociationSelectAssociatedRecordsFilter:()=>mO,getAssociationSelectForeignKeyFilter:()=>m$,getAssociationSelectorContextInputArgs:()=>sW,getAssociationTargetResourceSettings:()=>sU,getDefaultOperator:()=>aY,getDetailsItemValue:()=>dK,getDisplayNumber:()=>vx,getQuickEditFieldProps:()=>pq,getTopbarPluginSettingsItems:()=>nN,getValueWithIndex:()=>dz,injectRecordPickerPopupContext:()=>m8,isAssociationBlockContext:()=>sK,isFilterValueEmpty:()=>aJ,joinUrlSearch:()=>dF,markCascadeHydrationDone:()=>hX,mergeAssignFieldValues:()=>dl.GO,operatorComponentProps:()=>pI,recalculateGridSizes:()=>su,refreshClickToOpenRuntime:()=>hz,resolveAssignFieldValues:()=>dl.eu,resolveCustomFieldOperatorList:()=>cp,resolveDefaultCustomFieldOperator:()=>cm,toOperatorSelectOptions:()=>ch,transformNestedData:()=>hO,transformRowsToSingleColumn:()=>sd});var u={};l.r(u),l.d(u,{aclCheck:()=>ym,aclCheckRefresh:()=>yy,actionLinkageRules:()=>x7,afterSuccess:()=>ap,blockHeight:()=>y1,blockLinkageRules:()=>x9,confirm:()=>am,customVariable:()=>vH,dataLoadingMode:()=>yr,dataScope:()=>a_,dateRangeLimit:()=>yl,dateTimeFormat:()=>v7,detailsFieldLinkageRules:()=>bn,displayFieldComponent:()=>yu,fieldComponent:()=>yc,fieldLinkageRules:()=>bt,filterFormDefaultValues:()=>yJ,fixed:()=>yF,formAssignRules:()=>yG,layout:()=>ya,linkageAssignField:()=>x1,linkageRulesRefresh:()=>yX,linkageRunjs:()=>x8,linkageSetActionProps:()=>xK,linkageSetBlockProps:()=>xz,linkageSetDetailsFieldProps:()=>xG,linkageSetFieldProps:()=>xW,linkageSetMenuItemProps:()=>xU,menuLinkageRules:()=>be,navigateToURL:()=>vU,numberFormat:()=>ba,openView:()=>v$,overflowMode:()=>br,pattern:()=>yw,refreshTargetBlocks:()=>vQ,renderMode:()=>yi,required:()=>ys,runjs:()=>vO,setTargetDataScope:()=>v5,showMessage:()=>vL,showNotification:()=>vK,sortingRule:()=>yo,subFormFieldLinkageRules:()=>bl,subFormLinkageAssignField:()=>x2,subFormLinkageSetFieldProps:()=>xH,titleField:()=>v9,validation:()=>yC});var c={};l.r(c),l.d(c,{ACLContext:()=>no.w0,ACLRolesCheckProvider:()=>no.rR,ADMIN_LAYOUT_MODEL_UID:()=>tA,ADMIN_SETTINGS_KEY:()=>i2.w$,ADMIN_SETTINGS_LAYOUT_MODEL_UID:()=>nP.O,ADMIN_SETTINGS_PATH:()=>i2.wq,AIManager:()=>eg,APIClient:()=>O,ASSIGN_FIELD_VALUES_STEP_KEY:()=>dl.zL,ActionGroupModel:()=>az,ActionModel:()=>aW.S0,ActionSceneEnum:()=>aW.s5,ActionWithoutPermission:()=>aW._T,AddChildActionModel:()=>dR,AddNewActionModel:()=>sV,AdminLayoutComponent:()=>oA,AdminLayoutContent:()=>l9,AdminLayoutMenuItemModel:()=>lU,AdminLayoutMenuItemRenderer:()=>lh,AdminLayoutMenuModelRenderer:()=>lv,AdminLayoutModel:()=>oO,AdminLayoutRouteCoordinator:()=>tk,AdminSettingsLayout:()=>bX.AdminSettingsLayout,AdminSettingsLayoutModel:()=>bQ.C,AntdAppProvider:()=>eo,AppError:()=>ey.uV,AppMaintaining:()=>ey.be,AppMaintainingDialog:()=>ey.tp,AppNotFound:()=>ey.bM,AppSpin:()=>ey.gv,Application:()=>al,ApplicationContext:()=>an,ApplicationModel:()=>r0,AssignFormGridModel:()=>d$,AssignFormItemModel:()=>d5,AssignFormModel:()=>dD,AssociateActionModel:()=>sQ,AssociationFieldGroupModel:()=>aH,AssociationFieldModel:()=>uu,BaseApplication:()=>rX,BaseLayoutModel:()=>eH,BaseLayoutRouteCoordinator:()=>eR,BasePageTabModel:()=>sN,BlankComponent:()=>ey.ct,BlockGridModel:()=>sh,BlockModel:()=>sf.z,BlockSceneEnum:()=>sf.P,BulkDeleteActionModel:()=>sZ,CascadeSelectFieldModel:()=>h3,CascadeSelectInnerFieldModel:()=>h5,CascadeSelectListFieldModel:()=>h6,CheckboxFieldInterface:()=>SP,CheckboxFieldModel:()=>fk,CheckboxGroupFieldInterface:()=>Sj,CheckboxGroupFieldModel:()=>fA,ChildPageModel:()=>sj,ChildPageTabModel:()=>sB,ClickableFieldModel:()=>hU,CodeEditor:()=>s9.BY,CodeEditorExtension:()=>s9.o8,CollectionActionGroupModel:()=>aK,CollectionActionModel:()=>sg.U,CollectionBlockModel:()=>sv.t,CollectionFieldInterface:()=>SA,CollectionFieldInterfaceManager:()=>iV,CollectionFilter:()=>ey.px,CollectionSelect:()=>im,CollectionSelectFieldInterface:()=>SM,CollectionSelectorFieldModel:()=>fM,ColorFieldInterface:()=>SI,ColorFieldModel:()=>fR,CommonItemModel:()=>sy,CreateContent:()=>uT,CreateFormModel:()=>pR,CreatedAtFieldInterface:()=>ST,CreatedByFieldInterface:()=>SR,CurrentUserContext:()=>Si,CustomWidth:()=>p7,DEFAULT_DATA_SOURCE_KEY:()=>eJ.Ze,DEFAULT_PAGE_SIZE:()=>ey.yQ,DataBlockModel:()=>sx.R,DateFieldInterface:()=>wl,DateOnlyFieldModel:()=>fV,DateOnlyFilterFieldModel:()=>uK,DateOnlyPicker:()=>fL,DateTimeFilterFieldModel:()=>uV,DateTimeNoTzFieldModel:()=>fK,DateTimeNoTzFilterFieldModel:()=>uW,DateTimeNoTzPicker:()=>fz,DateTimeTzFieldModel:()=>fG,DateTimeTzFilterFieldModel:()=>uG,DateTimeTzPicker:()=>fH,DatetimeFieldInterface:()=>SE,DatetimeNoTzFieldInterface:()=>wn,DefaultToolsManager:()=>ef,DeleteActionModel:()=>s0,DetailsAssociationFieldGroupModel:()=>d4,DetailsBlockModel:()=>d7,DetailsCustomItemModel:()=>ut,DetailsGridModel:()=>ul,DetailsItemModel:()=>dW,DetailsJSFieldItemModel:()=>ua,DialogFormLayout:()=>ey.xg,DisassociateActionModel:()=>s1,DisplayCheckboxFieldModel:()=>vj,DisplayColorFieldModel:()=>g7,DisplayDateTimeFieldModel:()=>ve,DisplayEnumFieldModel:()=>vo,DisplayHtmlFieldModel:()=>vi,DisplayIconFieldModel:()=>va,DisplayJSONFieldModel:()=>vu,DisplayNumberFieldModel:()=>vb,DisplayPasswordFieldModel:()=>vw,DisplayPercentFieldModel:()=>vC,DisplaySubItemFieldModel:()=>g5,DisplaySubListFieldModel:()=>g9,DisplaySubTableFieldModel:()=>g8,DisplayTextFieldModel:()=>vF,DisplayTimeFieldModel:()=>vA,DisplayTitleFieldModel:()=>gQ,DisplayURLFieldModel:()=>vk,DividerItemModel:()=>gz,DragSortRowContext:()=>ey.c5,DrawerFormLayout:()=>ey.gh,EditActionModel:()=>s2,EditFormContent:()=>fs,EditFormModel:()=>dH.EditFormModel,EmailFieldInterface:()=>SN,EnvVariableInput:()=>ey.s9,ExpandCollapseActionModel:()=>dM,ExtendCollectionsProvider:()=>wa,FieldDeletePlaceholder:()=>p6,FieldFilterOperatorRegistry:()=>ir,FieldModel:()=>sb.o,FieldModelSelect:()=>u6,FieldOperatorSelect:()=>cf,FieldValidationConfigureRegistry:()=>i$,FileSizeInput:()=>ey.c,FilterActionModel:()=>s4,FilterBlockModel:()=>sS,FilterContent:()=>ah.oJ,FilterFormActionGroupModel:()=>cT,FilterFormActionModel:()=>cI,FilterFormBlockModel:()=>c0,FilterFormCollapseActionModel:()=>c4,FilterFormCustomFieldModel:()=>cS,FilterFormCustomItemModel:()=>cg,FilterFormCustomRecordSelectFieldModel:()=>cM,FilterFormFieldModel:()=>us,FilterFormGridModel:()=>ps,FilterFormItemModel:()=>pa,FilterFormJSActionModel:()=>pd,FilterFormRecordSelectFieldModel:()=>u_,FilterFormResetActionModel:()=>pu,FilterFormSubmitActionModel:()=>pc,FilterGroup:()=>ah.I8,FilterItem:()=>ah.qi,FilterManager:()=>a8,FlowModelRepository:()=>bp,FlowPage:()=>vT,FlowRoute:()=>oH,FormActionGroupModel:()=>da,FormActionModel:()=>dr,FormAssociationFieldGroupModel:()=>pL,FormAssociationItemModel:()=>pW,FormBlockContent:()=>dN.JU,FormBlockModel:()=>dN.F4,FormComponent:()=>dN.s2,FormCustomItemModel:()=>pE,FormGridModel:()=>dB,FormItemModel:()=>dQ,FormJSFieldItemModel:()=>pN,FormModel:()=>dN.mO,FormSubmitActionModel:()=>di,GRID_FLOW_KEY:()=>sr,GRID_STEP:()=>si,GlobalThemeProvider:()=>em,GridModel:()=>ss,HeaderContext:()=>lo,Icon:()=>ey.In,IconFieldInterface:()=>SD,IconFieldModel:()=>fZ,IdFieldInterface:()=>SB,InputFieldInterface:()=>Sq,InputFieldModel:()=>pS.m,InputNumberField:()=>f9,IntegerFieldInterface:()=>S_,InternalAdminSettingsLayout:()=>bX.InternalAdminSettingsLayout,JSActionModel:()=>de,JSBlockModel:()=>pY,JSCollectionActionModel:()=>dt,JSColumnModel:()=>mV,JSEditableFieldModel:()=>gq,JSFieldModel:()=>gP,JSFormActionModel:()=>pD,JSItemActionModel:()=>dp,JSItemModel:()=>gY,JSRecordActionModel:()=>dm,JsonFieldInterface:()=>SL,JsonFieldModel:()=>f4,JsonInput:()=>f5,JsonTextArea:()=>ey.V4,LayoutContent:()=>l7,LayoutContentRoute:()=>oY,LayoutManager:()=>ro,LayoutRoute:()=>o5,LinkActionModel:()=>dj,LinkageFilterItem:()=>ah.Ru,M2MFieldInterface:()=>SV,M2OFieldInterface:()=>Sz,MAX_MESSAGE_CHARS:()=>s9.hP,MENU_TYPE_OPTIONS:()=>lR,MainPageModel:()=>sT,MarkdownFieldInterface:()=>SK,MarkdownItemModel:()=>gG,MobileMenuControlContext:()=>ln,MockFlowModelRepository:()=>bc,MultipleSelectFieldInterface:()=>SU,NBColorPicker:()=>fT,NanoidFieldInterface:()=>we,NocoBaseBuildInPlugin:()=>Sp,NocoBaseBuildInPluginV2:()=>Sp,NumberFieldInterface:()=>SW,NumberFieldModel:()=>f7,O2MFieldInterface:()=>SG,OBOFieldInterface:()=>SH,OHOFieldInterface:()=>SY,ObjectNester:()=>hj,OptionsEditor:()=>iN,PAGE_SIZE_OPTIONS:()=>ey.xp,PLUGIN_MANAGER_SETTING_NAME:()=>nP.Bm,PageModel:()=>sA,PageTabModel:()=>s$,PasswordFieldInterface:()=>SJ,PasswordFieldModel:()=>ge,PasswordInput:()=>ey.yA,PercentFieldInterface:()=>SX,PercentFieldModel:()=>go,PercentInput:()=>gn,PhoneFieldInterface:()=>SQ,PinnedPluginListContext:()=>ni,PinnedPluginListLite:()=>n6,Plugin:()=>ad,PluginFlowEngine:()=>b1,PluginManager:()=>i1,PluginManagerPage:()=>bZ.PluginManagerPage,PluginSettingsManager:()=>i2.mz,PluginSettingsTopbarActionModel:()=>nL,PopupActionModel:()=>s_,PopupCollectionActionModel:()=>dh,PopupSubTableActionGroupModel:()=>fy,PopupSubTableActionsColumnModel:()=>fS,PopupSubTableEditActionModel:()=>fu,PopupSubTableFieldModel:()=>fg,PopupSubTableFormActionGroupModel:()=>du,PopupSubTableFormModel:()=>fw,PopupSubTableFormSubmitActionModel:()=>dd,PopupSubTableRemoveActionModel:()=>fv,PoweredBy:()=>ey.G5,QUICK_EDIT_FORM_MAX_HEIGHT:()=>p$,QUICK_EDIT_MARKDOWN_HEIGHT:()=>pO,QUICK_EDIT_POPOVER_MAX_HEIGHT:()=>pB,QuickEditFormModel:()=>p_,RadioGroupFieldInterface:()=>SZ,RadioGroupFieldModel:()=>gr,RangeValidationItems:()=>iB,RecordActionGroupModel:()=>aU,RecordActionModel:()=>sL.L,RecordPickerContent:()=>m3,RecordPickerFieldModel:()=>m9,RecordSelectFieldModel:()=>uN,RefreshActionModel:()=>df,RemoteFlowModelRenderer:()=>vR,RemoteSelect:()=>ey.lT,ResetThemeTokenAndKeepAlgorithm:()=>tR,RichTextField:()=>gh,RichTextFieldInterface:()=>S0,RichTextFieldModel:()=>gf,RootPageModel:()=>sO,RootPageTabModel:()=>sD,RouteModel:()=>ek,RouteRepository:()=>rr,RouterContextCleaner:()=>ey.PK,RouterManager:()=>i9,SNIPPET_PREFIX:()=>i2.tJ,SYSTEM_SETTINGS_SETTING_NAME:()=>nP.jm,SelectFieldInterface:()=>S1,SelectFieldModel:()=>gy,SkeletonFallback:()=>oZ,SnowflakeIdFieldInterface:()=>S2,SortHandle:()=>ey.vm,SortableRow:()=>ey.B7,SourceCascader:()=>cy,SubFormFieldModel:()=>hM,SubFormListFieldModel:()=>hT,SubPageModel:()=>sq,SubTableColumnModel:()=>hg,SubTableFieldModel:()=>hk,SubTableRecordAction:()=>fd,SwitchLanguage:()=>ey.rw,SystemSettingsPage:()=>b0.SystemSettingsPage,SystemSettingsSource:()=>ex.o,Table:()=>ey.XI,TableActionsColumnModel:()=>mi,TableAssociationFieldGroupModel:()=>ma,TableBlockModel:()=>mR,TableColumnModel:()=>me,TableCustomColumnModel:()=>mt,TableJSFieldItemModel:()=>m_,TableSelectModel:()=>mq,TableoidFieldInterface:()=>S8,TextAreaWithContextSelector:()=>ac.n,TextareaFieldInterface:()=>S5,TextareaFieldModel:()=>gx,TimeFieldInterface:()=>S4,TimeFieldModel:()=>gF,TopbarActionModel:()=>nD,UIEditorTopbarActionModel:()=>n_,USER_CENTER_ACTION_ID:()=>nV,UUIDFieldInterface:()=>S7,UnitConversion:()=>vS,UnixTimestampFieldInterface:()=>wt,UpdateRecordActionModel:()=>dS,UpdatedAtFieldInterface:()=>S3,UpdatedByFieldInterface:()=>S6,UrlFieldInterface:()=>S9,UserCenterActionItemModel:()=>nX,UserCenterItemModel:()=>nY,UserCenterSelectItemModel:()=>nQ,UserCenterTextItemModel:()=>nJ,UserCenterTopbarActionModel:()=>n5,VariableFieldFormModel:()=>gk,VariableFilterItem:()=>ah.Et,VariableInput:()=>ey.P8,VariableTextArea:()=>ey.hp,ViewActionModel:()=>dw,WebSocketClient:()=>ri,aclCheck:()=>ym,aclCheckRefresh:()=>yy,actionLinkageRules:()=>x7,addCustomAlgorithmToTheme:()=>eu,addFieldValidationConfiguresToGroup:()=>iL,afterSuccess:()=>ap,applyAssociateAction:()=>sY,applyClickToOpenProps:()=>hV,applyClickToOpenSetting:()=>hK,applyDisassociateAction:()=>sG,applyMobilePaginationProps:()=>dg.hO,array:()=>r8,bigField:()=>io,blockHeight:()=>y1,blockLinkageRules:()=>x9,boolean:()=>ie,buildDisplayPathFromValue:()=>hQ,buildInsertRouteSchema:()=>lz,buildLinkSettingSchema:()=>lM,buildMenuBasicSchema:()=>lE,buildMenuTitleWithIcon:()=>lx,buildRecordPickerParentItemContext:()=>m2,buildRecordPickerPopupContextInputArgs:()=>m5,buildV2SigninHref:()=>tr,collectAssociationHydrationCandidates:()=>uj,collectCascadeHydrationCandidate:()=>hJ,collection:()=>il,compatOldTheme:()=>es,configurePropertiesToItems:()=>iC,confirm:()=>am,connectFields:()=>pf,createAclSnippetAllow:()=>no.rN,createAssignFieldValuesStep:()=>dl.KW,createAssignFormSubModelOptions:()=>dl.nF,createCompactSimpleItemRender:()=>dg.hH,createDefaultCollectionBlockTitle:()=>dg.lr,createFilterable:()=>ic,createFormRegistry:()=>ey.oV,createInsertMenuStep:()=>lO,createMockClient:()=>as,createSettingsPathMap:()=>nP.nC,createTypedFilterable:()=>ip,customAlgorithm:()=>ed,customVariable:()=>vH,customizeFilterRender:()=>pP,dataLoadingMode:()=>yr,dataScope:()=>a_,dateRangeLimit:()=>yl,dateTimeFormat:()=>v7,dateTimeFormatConfigureItems:()=>iT,datetime:()=>r4,defaultOperator:()=>px,defaultTheme:()=>ea,detailsFieldLinkageRules:()=>bn,diagnoseRunJS:()=>s9.fL,dispatchEventDeep:()=>dg.Xi,displayFieldComponent:()=>yu,editMarkdownFlow:()=>gW,enumType:()=>r9,escapeHTML:()=>np.Z,evaluateFieldConfigureExpression:()=>iy,fieldComponent:()=>yc,fieldFilterOperatorPresets:()=>is,fieldFilterOperators:()=>ia,fieldLinkageRules:()=>bt,fieldValidationConfigureRegistry:()=>iO,filterFormDefaultValues:()=>yJ,filterOperatorRegistry:()=>ii,filterRenderableSettings:()=>nP.Ui,filterVisibleSettings:()=>nP.eD,findFirstAccessiblePageRoute:()=>tw,findFirstInternalSettingsPage:()=>nP.X2,findFirstV2LandingRoute:()=>tS,findNextSiblingRoute:()=>lL,findOptionPathByTk:()=>hZ,findPrevSiblingRoute:()=>l_,findSettingsByName:()=>nP.R0,fixed:()=>yF,formAssignRules:()=>yG,formatEnvPath:()=>ey.EM,formatNumber:()=>vy,formatRunJSPreviewMessage:()=>s9.by,formatVariablePath:()=>ey.X5,getAdminLayoutMenuInitializerButton:()=>ly,getAdminLayoutMenuMovePositionOptions:()=>lr,getAdminLayoutMenuVirtualPath:()=>tQ,getAdminLayoutModel:()=>oq,getAllDataModels:()=>aX,getAppVersionHTML:()=>np.p,getAssignFieldValuesDefaultParams:()=>dl.Z1,getAssociationBlockResourceSettings:()=>sz,getAssociationSelectAssociatedRecordsFilter:()=>mO,getAssociationSelectForeignKeyFilter:()=>m$,getAssociationSelectorContextInputArgs:()=>sW,getAssociationTargetResourceSettings:()=>sU,getCoreFieldConfigureState:()=>ij,getCurrentV2RedirectPath:()=>to,getDefaultOperator:()=>aY,getDefaultSettingsPath:()=>nP.C9,getDefaultV2AdminRedirectPath:()=>tn,getDetailsItemValue:()=>dK,getDisplayNumber:()=>vx,getLayoutContentRouteNames:()=>eO,getLayoutModel:()=>eG,getLayoutPageRouteName:()=>eN,getLayoutPageTabRouteName:()=>eD,getLayoutPageTabViewRouteName:()=>e$,getLayoutPageViewRouteName:()=>eB,getMenuCreationDefaultParams:()=>lT,getMenuCreationUiSchema:()=>lB,getMenuEditDefaultParams:()=>lD,getMenuItems:()=>nP.gL,getMobileCompactPaginationClassName:()=>dg.NY,getPinnedPluginListKeys:()=>nr,getQuickEditFieldProps:()=>pq,getSimpleModePaginationClassName:()=>dg.HZ,getTopbarPluginSettingsItems:()=>nN,getUniqueKeyFromCollection:()=>wo,getUnknownCountPaginationTotal:()=>dg.SM,getV2EffectiveBasePath:()=>e7,getValueWithIndex:()=>dz,hasIcon:()=>ey.cE,hasOwnSettingsPage:()=>nP.lv,icons:()=>ey.Pt,id:()=>r6,indexConfigureItems:()=>iI,injectRecordPickerPopupContext:()=>m8,insertRouteSchema:()=>lI,isAssociationBlockContext:()=>sK,isFilterValueEmpty:()=>aJ,isLayoutContentRouteName:()=>eq,isTitleField:()=>eJ.ji,isTitleFieldInterface:()=>eJ.w,isV2AdminRuntime:()=>tm,isV2MenuRoute:()=>tb,joinUrlSearch:()=>dF,languageCodes:()=>au.A,layout:()=>ya,linkageAssignField:()=>x1,linkageRulesRefresh:()=>yX,linkageRunjs:()=>x8,linkageSetActionProps:()=>xK,linkageSetBlockProps:()=>xz,linkageSetDetailsFieldProps:()=>xG,linkageSetFieldProps:()=>xW,linkageSetMenuItemProps:()=>xU,makeFormatVariablePath:()=>ey.nW,makeParseVariablePath:()=>ey.Dx,makeVariableRegExp:()=>ey.at,markCascadeHydrationDone:()=>hX,matchSettingsRoute:()=>nP.CM,matchesRoutePath:()=>lV,menuLinkageRules:()=>be,mergeAssignFieldValues:()=>dl.GO,mergePaginationClassName:()=>dg.M6,navigateToURL:()=>vU,normalizeAdminLayoutMenuLegacyVariables:()=>t2,normalizeCollectionTemplateField:()=>wr,normalizeCollectionTemplateFields:()=>wi,normalizeFilterableOperators:()=>iu,normalizeLayoutRoutePath:()=>rl,number:()=>r3,numberFormat:()=>ba,object:()=>r5,openAdminLayoutMenuLink:()=>t5,openView:()=>v$,openViewFlow:()=>eC,operatorComponentProps:()=>pI,overflowMode:()=>br,parseEnvPath:()=>ey.uO,parseVariablePath:()=>ey.h7,pattern:()=>yw,previewRunJS:()=>s9.zA,recalculateGridSizes:()=>su,reconcileAdminLayoutMenuItems:()=>la,redirectToV2Signin:()=>ti,refreshClickToOpenRuntime:()=>hz,refreshTargetBlocks:()=>vQ,registerFieldValidationConfigure:()=>iq,registerFieldValidationConfigureGroup:()=>i_,registerIcon:()=>ey.pU,registerIcons:()=>ey.K1,renderMode:()=>yi,replaceRouteParams:()=>nP.uT,required:()=>ys,resolveAdminLayoutMenuDragMoveOptions:()=>ls,resolveAdminLayoutMenuDragMoveOptionsFromEvent:()=>ld,resolveAdminLayoutMenuLink:()=>t8,resolveAdminRouteRuntimeTarget:()=>tF,resolveAssignFieldValues:()=>dl.eu,resolveCustomFieldOperatorList:()=>cp,resolveDefaultCustomFieldOperator:()=>cm,resolveDynamicNamePath:()=>ab.IJ,resolveFilterOperators:()=>id,resolveV2SigninRedirect:()=>ta,reverseFieldConfigureItem:()=>iE,reverseFieldConfigureItems:()=>iR,runCoreFieldConfigureEffects:()=>iM,runjs:()=>vO,setTargetDataScope:()=>v5,shouldRenderIconInTitle:()=>lf,showMessage:()=>vL,showNotification:()=>vK,sortTopLevelSettings:()=>nP.p$,sortingRule:()=>yo,string:()=>r2,subFormFieldLinkageRules:()=>bl,subFormLinkageAssignField:()=>x2,subFormLinkageSetFieldProps:()=>xH,tableoid:()=>it,time:()=>r7,titleField:()=>v9,toOperatorSelectOptions:()=>ch,toRouterNavigationPath:()=>th,toToolsMap:()=>ev,toTreeSelectItems:()=>lq,toViewStack:()=>eE,transformNestedData:()=>hO,transformRowsToSingleColumn:()=>sd,useACLContext:()=>no.bq,useACLRoleContext:()=>no.v6,useAclSnippets:()=>no.K3,useAdminLayoutRoutePage:()=>bJ,useApp:()=>ee.n,useApplications:()=>n9,useCurrentAppInfo:()=>nd.g,useCurrentRoleMode:()=>no.GL,useCurrentRoles:()=>Ss,useCurrentUserContext:()=>Sa,useFilterOptions:()=>ah.uw,useFilteredMetaTree:()=>ey.a7,useGlobalTheme:()=>ep,useLayoutRoutePage:()=>o_,useMobileLayout:()=>bY,usePlugin:()=>nu.n,useRoleRecheck:()=>no.N5,useRouter:()=>nc,useSystemSettings:()=>ex.e,useUIConfigurationPermissions:()=>no.uM,validation:()=>yC});var p={};l.r(p),l.d(p,{array:()=>FW,bigField:()=>F2,boolean:()=>FZ,collection:()=>F1,datetime:()=>FG,enumType:()=>FX,id:()=>FJ,number:()=>FY,object:()=>FH,string:()=>FU,tableoid:()=>F0,time:()=>FQ});var m={};l.r(m),l.d(m,{autoFill:()=>F6,autoIncrement:()=>F3,collectionDataSource:()=>ki,constraintsProps:()=>F7,dataSource:()=>kn,dateTimeProps:()=>kt,defaultProps:()=>ko,operators:()=>p,primaryKey:()=>F4,recordPickerViewer:()=>kr,relationshipType:()=>F9,reverseFieldProperties:()=>ke,timeProps:()=>kl,type:()=>F8,unique:()=>F5});var h={};l.r(h),l.d(h,{FormActiveFieldsProvider:()=>BF,appendQueryStringToUrl:()=>Ua,completeURL:()=>Um,fillParentFields:()=>Uf,findFilterTargets:()=>Kz,getAppends:()=>Un,getAssociationPath:()=>Ul,getCardItemSchema:()=>KN,getFormValues:()=>Kq,getPageSchema:()=>KE,navigateWithinSelf:()=>Uh,parseVariablesAndChangeParamsToQueryString:()=>Uc,reduceValueSize:()=>Up,replaceVariableValue:()=>Uu,updateFilterTargets:()=>KK,useAssociationCreateActionProps:()=>KV,useAssociationFilterBlockProps:()=>Ue,useAssociationFilterProps:()=>K6,useAssociationNames:()=>Uo,useBlockHeightProps:()=>KR,useBulkDestroyActionProps:()=>K2,useCollectValuesToSubmit:()=>K_,useCreateActionProps:()=>KL,useCustomizeBulkUpdateActionProps:()=>KJ,useCustomizeRequestActionProps:()=>KX,useCustomizeUpdateActionProps:()=>KY,useDataBlockParentRecord:()=>KD,useDestroyActionProps:()=>KZ,useDetailsPaginationProps:()=>K3,useDisassociateActionProps:()=>K1,useEditTableActionProps:()=>K4,useFilterBlockActionProps:()=>KW,useFormActiveFields:()=>Bk,useLinkActionProps:()=>Ud,useOptionalFieldList:()=>K9,useParseURLAndParams:()=>Us,useParsedFilter:()=>jz,usePickActionProps:()=>KB,useRefreshActionProps:()=>K8,useRemoveActionProps:()=>K0,useResetBlockActionProps:()=>KG,useTableColumns:()=>K5,useUpdateActionProps:()=>KQ});var f={};l.r(f),l.d(f,{DateFilterDynamicComponent:()=>UA,DndContext:()=>MV,DragHandler:()=>II,DraggableContext:()=>IS,ShowFormData:()=>UC,Sortable:()=>Ik,SortableContext:()=>Iw,SortableItem:()=>IM,SortableProvider:()=>IC,getRenderContent:()=>A8});var g={};l.r(g),l.d(g,{AssignedField:()=>Q8,AssignedFieldInner:()=>Q2,AssignedFieldValueType:()=>Q1,CreateAction:()=>Q7,CreateRecordAction:()=>Zt,useAclCheck:()=>Q4});var v={};l.r(v),l.d(v,{Action:()=>YB,ActionBar:()=>YG,ActionBarProvider:()=>YK,ActionContext:()=>zT,ActionContextNoRerender:()=>zN,ActionContextProvider:()=>zR,ActionDesigner:()=>W$,AfterSuccess:()=>WT,AllDataBlocksContext:()=>Ap,AllDataBlocksProvider:()=>Am,AntdSchemaComponentPlugin:()=>Xi,AntdSchemaComponentProvider:()=>Xr,AppendsTreeSelect:()=>Xh,AssignedFieldValues:()=>WC,AssociationField:()=>ZV,AssociationFieldMode:()=>QH,AssociationFieldModeProvider:()=>QJ,AssociationSelect:()=>ZH,AttachmentList:()=>Qi,AutoComplete:()=>ZY,BackButtonUsedInSubPage:()=>NE,Block:()=>ee9,BlockItem:()=>UM,BlockItemCard:()=>KT,BlockItemCardContext:()=>KI,BlocksSelector:()=>WI,ButtonEditor:()=>Ww,CardItem:()=>Z0,Cascader:()=>Z4,Checkbox:()=>QI,CollectionSelect:()=>Z7,ColorPicker:()=>eeo,ColorSelect:()=>eei,Cron:()=>eeu,CronSet:()=>eeh,DataSourceCollectionCascader:()=>een,DataSourceSelect:()=>eet,DateFormatCom:()=>FL,DatePicker:()=>qE,DatePickerProvider:()=>qI,Details:()=>eef,DetailsDesigner:()=>Y6,Divider:()=>eeg,EditComponent:()=>Uq,EditDefaultValue:()=>UO,EditDescription:()=>UN,EditOperator:()=>UV,EditPattern:()=>U_,EditRequired:()=>UB,EditSortField:()=>elU,EditTable:()=>ee$,EditTableAction:()=>eez,EditTableActionContext:()=>eeL,EditTitle:()=>UE,EditTitleField:()=>Uz,EditTooltip:()=>UD,EditValidationRules:()=>U$,Editable:()=>et8,EllipsisWithTooltip:()=>zQ,ErrorFallback:()=>PF,Expand:()=>ee0,ExpiresRadio:()=>FK,FieldsTreeSelect:()=>Xm,Fieldset:()=>ee1,Filter:()=>_I,FilterAction:()=>_g,FilterActionContext:()=>_h,FilterContext:()=>O6,FilterDynamicComponent:()=>_F,FilterLogicContext:()=>O9,Form:()=>Y8,FormDialog:()=>L_,FormDrawer:()=>eno,FormField:()=>JT,FormItem:()=>U5,FormV2:()=>JP,G2Plot:()=>ee6,G2PlotRenderer:()=>ee3,Grid:()=>Bw,GridCard:()=>etf,GridRowContext:()=>Ba,HTMLEncode:()=>zZ,ICON_POPUP_Z_INDEX:()=>_c,IconPicker:()=>etx,Input:()=>Kc,InputNumber:()=>etM,InputReadPretty:()=>z0,InputRecordPicker:()=>elo,Json:()=>zH,LinkageFilter:()=>env,List:()=>etV,Markdown:()=>Kj,MarkdownReadPretty:()=>KM,Menu:()=>I8,NanoIDInput:()=>etz,Page:()=>J0,PagePopups:()=>jS,PageTabs:()=>J1,Pagination:()=>etK,ParentRouteContext:()=>IG,Password:()=>etQ,Percent:()=>et1,PopupSettingsProvider:()=>P_,Preview:()=>et2,QuickEdit:()=>et5,Radio:()=>QP,ReadPretty:()=>z0,ReadPrettyRecordPicker:()=>eld,RecordPicker:()=>elu,RecordPickerContext:()=>et7,RecordPickerProvider:()=>elr,RefreshDataBlockRequest:()=>WO,RemoteSelect:()=>Jm,RemoveButton:()=>WR,RemoveConditionContext:()=>O3,RequestSettings:()=>WF,RichText:()=>elm,SecondConFirm:()=>WD,Select:()=>Js,SkipValidation:()=>Wk,Space:()=>elh,StablePopover:()=>_p,Table:()=>el_,TableBlockDesigner:()=>elW,TableField:()=>elH,TableSelectorDesigner:()=>elG,TableV2:()=>elY,Tabs:()=>elZ,TabsContextProvider:()=>P$,Templates:()=>Jf,TestDesigner:()=>UI,TextAreaWithGlobalScope:()=>ent,TimePicker:()=>el8,TreeSelect:()=>el4,UnixTimestamp:()=>el9,Upload:()=>Qt,Uploader:()=>Qa,Variable:()=>Hh,VariableScopeProvider:()=>Hp,VariableSelect:()=>Kh,actionSettings:()=>WB,actionSettingsItems:()=>WE,allowAddNew:()=>_U,attachmentFileTypes:()=>XD,defaultFieldNames:()=>Y7,fetchTemplateData:()=>Jv,filterFormItemSettings:()=>Gq,findByUid:()=>IR,findKeysByUid:()=>ID,findMenuItem:()=>IE,formDetailsSettings:()=>JI,formItemSettings:()=>_W,formSettings:()=>Jj,formV1Settings:()=>Y5,genStyleHook:()=>w4,getCurrentOptions:()=>Jl,getDateExact:()=>AV,getDatePickerLabels:()=>et6,getDateRanges:()=>AL,getLabelFormatValue:()=>et9,getPopupPathFromParams:()=>jo,getStoredPopupContext:()=>P6,getTabSchema:()=>Xe,getZIndex:()=>Nf,handleDateChangeOnForm:()=>AE,inferPickerType:()=>AK,isBulkEditAction:()=>Yq,isFileCollection:()=>U4,isMobile:()=>AD,isShowFilePicker:()=>ela,isTabPage:()=>J7,isWriteEmailAction:()=>Y_,mapDatePicker:()=>AN,mapRangePicker:()=>AB,mapTimeFormat:()=>el2,matchMimetype:()=>XB,moment2str:()=>AT,navigateToTab:()=>J9,pageSettings:()=>Xl,pageTabSettings:()=>Xo,readPrettyFormSettings:()=>JM,removeNullCondition:()=>_O,resolveFilterPickerFormat:()=>qP,storePopupContext:()=>P9,useActionBarContext:()=>YU,useActionContext:()=>zD,useAfterSuccessOptions:()=>Wv,useAllDataBlocks:()=>Ah,useAssociationFieldContext:()=>Ef,useAssociationFieldModeContext:()=>QX,useBackButton:()=>NR,useCloseAction:()=>zB,useColumnSchema:()=>D9,useColumnSettings:()=>Ew,useCurrentPopupContext:()=>jk,useDatePickerContext:()=>qM,useDownloadLogs:()=>PC,useEnsureOperatorsValid:()=>UL,useFieldMode:()=>_0,useFieldNames:()=>et4,useFilterActionProps:()=>_q,useFilterFieldOptions:()=>_B,useFilterFieldProps:()=>__,useFilterOptions:()=>_R,useFormDataTemplates:()=>Jh,useGetAriaLabelOfAction:()=>YE,useGetAriaLabelOfDrawer:()=>Np,useGetAriaLabelOfModal:()=>NF,useGetAriaLabelOfPopover:()=>YY,useGetFilterFieldOptions:()=>_E,useGetFilterOptions:()=>_T,useGridContext:()=>Bx,useGridRowContext:()=>Bb,useIsAddNewForm:()=>_H,useIsAssociationField:()=>_Q,useIsFieldReadPretty:()=>_J,useIsFileField:()=>_Z,useIsFormReadPretty:()=>_Y,useIsSelectFieldMode:()=>_1,useKeepAliveLocationSearch:()=>JZ,useLabelUiSchema:()=>et3,useLinkageAction:()=>z$,useListBlockContext:()=>etE,useMenuDragEnd:()=>I2,useMenuTranslation:()=>IT,useNocoBaseRoutes:()=>IJ,useParentRoute:()=>IY,usePopupSettings:()=>PL,useStyles:()=>Ir,useTableColumnIntegration:()=>EC,useTabsContext:()=>PO,useTitleFieldOptions:()=>_5,useUploadStyles:()=>XJ,useValidateSchema:()=>_2,useVariableScope:()=>Hm,useZIndexContext:()=>Nh,withSearchParams:()=>ja,zIndexContext:()=>Nm});var y={};l.r(y),l.d(y,{isDeleteButtonDisabled:()=>eoh,useBulkDestroyAction:()=>eos,useBulkDestroyActionAndRefreshCM:()=>eof,useCancelAction:()=>enZ,useChildrenCollections:()=>en5,useCollectionFieldsOptions:()=>en7,useCollectionFilterOptions:()=>en3,useCollectionFilterOptionsV2:()=>en6,useCreateAction:()=>eol,useCreateActionAndRefreshCM:()=>eou,useCreateActionWithoutRefresh:()=>eon,useDeleteButtonDisabled:()=>eom,useDestroyAction:()=>eoa,useDestroyActionAndRefreshCM:()=>eop,useFilterAction:()=>eot,useFilterActionProps:()=>eog,useFilterDataSource:()=>eoe,useKanbanEvents:()=>en2,useLinkageCollectionFilterOptions:()=>en9,useMoveAction:()=>eor,useResetFilterAction:()=>en1,useSelfAndChildrenCollections:()=>en4,useSortFields:()=>en8,useUpdateAction:()=>eoi,useUpdateActionAndRefreshCM:()=>eoc,useUpdateViewAction:()=>eoo,useValuesFromRA:()=>eod,useValuesFromRecord:()=>en0});var x={};l.r(x),l.d(x,{FieldValidation:()=>eow,ForeignKey:()=>eoI,SourceCollection:()=>eoP,SourceForeignKey:()=>eoF,SourceKey:()=>eoj,TargetForeignKey:()=>eoA,TargetKey:()=>eoM,ThroughCollection:()=>eoT,ThroughForeignKey:()=>eok});var b={};l.r(b),l.d(b,{MenuConfigure:()=>eaS,PermissionContext:()=>eaC,PermissionProvider:()=>eaF,RoleConfigure:()=>eaA,RoleResourceCollectionContext:()=>eaV,RoleTable:()=>eaN,RolesResourcesActions:()=>eaz,ScopeSelect:()=>ea_,SettingCenterPermissionProvider:()=>eaw,SettingCenterProvider:()=>esg,SettingsCenterConfigure:()=>esv,StrategyActions:()=>eaW,useRolesResourcesScopesSelectedRowKeys:()=>eaq});var S={};l.r(S),l.d(S,{ActionBarAssociationFilterAction:()=>esW,ActionInitializer:()=>es_,ActionInitializerItem:()=>esI,AssociationFilter:()=>es4,AssociationFilterDesignerDelete:()=>es6,AssociationFilterDesignerDisplayField:()=>es9,AssociationFilterPlugin:()=>es3,BlockInitializer:()=>es7,BlockItemInitializer:()=>ede,CreateFilterActionInitializer:()=>edt,CreateResetActionInitializer:()=>edl,CustomizeActionInitializer:()=>edn,DataBlockInitializer:()=>edc,G2PlotInitializer:()=>edp,InitializerWithSwitch:()=>esq,ModalActionSchemaInitializerItem:()=>edD,RecordAssociationBlockInitializer:()=>edh,RecordAssociationDetailsBlockInitializer:()=>edy,RecordAssociationFormBlockInitializer:()=>edS,RecordAssociationGridCardBlockInitializer:()=>edF,RecordAssociationListBlockInitializer:()=>edP,RecordReadPrettyAssociationFormBlockInitializer:()=>edI,SearchCollections:()=>eds,SelectActionInitializer:()=>edR,SubmitActionInitializer:()=>edE,TableActionColumnInitializer:()=>edN,useCreateAssociationDetailsBlock:()=>edx,useCreateAssociationDetailsWithoutPagination:()=>edT,useCreateAssociationFormBlock:()=>edw,useCreateAssociationGridCardBlock:()=>edk,useCreateAssociationListBlock:()=>edj,useCreateAssociationTableBlock:()=>edf,useMenuSearch:()=>edu});var w={};l.r(w),l.d(w,{ACLActionParamsContext:()=>ei4,ACLActionProvider:()=>eaa,ACLCollectionFieldProvider:()=>ead,ACLCollectionProvider:()=>eao,ACLContext:()=>eiZ,ACLCustomContext:()=>ei3,ACLMenuItemProvider:()=>eau,ACLPane:()=>esx,ACLPlugin:()=>esb,ACLProvider:()=>ei0,ACLRolesCheckProvider:()=>ei1,ADMIN_SETTINGS_KEY:()=>Df,ADMIN_SETTINGS_PATH:()=>Dg,AIManager:()=>eg,APIClient:()=>wD,APIClientContext:()=>wh,APIClientProvider:()=>wB,AccessControl:()=>Wl,Action:()=>YB,ActionBar:()=>YG,ActionBarAssociationFilterAction:()=>esW,ActionBarProvider:()=>YK,ActionContext:()=>zT,ActionContextNoRerender:()=>zN,ActionContextProvider:()=>zR,ActionDesigner:()=>W$,ActionGroupModel:()=>az,ActionInitializer:()=>es_,ActionInitializerItem:()=>esI,ActionModel:()=>aW.S0,ActionSceneEnum:()=>aW.s5,ActionType:()=>MA,AddChildActionModel:()=>dR,AddCollection:()=>eo1,AddCollectionAction:()=>eo2,AddCollectionField:()=>eoO,AddFieldAction:()=>eoq,AddNewActionModel:()=>sV,AddSubFieldAction:()=>erI,AdminDynamicPage:()=>M3,AdminLayout:()=>Ec,AdminLayoutMenuItemModel:()=>TW,AdminLayoutPlugin:()=>Ep,AdminProvider:()=>RF,AdminSettingsLayout:()=>esp,AdminSettingsLayoutModel:()=>eso,AfterSuccess:()=>WT,AllDataBlocksContext:()=>Ap,AllDataBlocksProvider:()=>Am,AntdAppProvider:()=>eo,AntdConfigPlugin:()=>esA,AntdConfigProvider:()=>esk,AntdSchemaComponentPlugin:()=>Xi,AntdSchemaComponentProvider:()=>Xr,AppLangContext:()=>esC,AppNotFound:()=>Pk,AppendsTreeSelect:()=>Xh,Application:()=>Lu,ApplicationContext:()=>wf,AssignFormModel:()=>dD,AssignedFieldValues:()=>WC,AssociatedFields:()=>euh,AssociationField:()=>ZV,AssociationFieldMode:()=>QH,AssociationFieldModeProvider:()=>QJ,AssociationFilter:()=>es4,AssociationFilterDesignerDelete:()=>es6,AssociationFilterDesignerDisplayField:()=>es9,AssociationFilterPlugin:()=>es3,AssociationOrCollectionProvider:()=>LE,AssociationProvider:()=>PJ,AssociationSelect:()=>ZH,AsyncDataContext:()=>erd,AsyncDataProvider:()=>eru,AttachmentList:()=>Qi,AutoComplete:()=>ZY,BackButtonUsedInSubPage:()=>NE,BaseVariableProvider:()=>BX,BlankComponent:()=>Dx,Block:()=>ee9,BlockAssociationContext:()=>eiD,BlockConfigsContext:()=>esP,BlockConfigsProvider:()=>esM,BlockContext:()=>eiV,BlockGridModel:()=>sh,BlockInitializer:()=>es7,BlockItem:()=>UM,BlockItemCard:()=>KT,BlockItemCardContext:()=>KI,BlockItemInitializer:()=>ede,BlockModel:()=>sf.z,BlockProvider:()=>eiU,BlockRequestContextProvider:()=>zA,BlockRequestContext_deprecated:()=>eiB,BlockRequestLoadingContext:()=>zw,BlockRequestProvider:()=>zP,BlockRequestProvider_deprecated:()=>eiq,BlockResourceContext:()=>eiN,BlockSceneEnum:()=>sf.P,BlockSchemaComponentPlugin:()=>$X,BlockSchemaComponentProvider:()=>$J,BlockSchemaToolbar:()=>BI,BlockTemplateContext:()=>$9,BlockTemplateDetails:()=>BP,BlockTemplatePage:()=>$3,BlockTemplateProvider:()=>$7,BlockTemplatesPane:()=>$6,BlocksSelector:()=>WI,ButtonEditor:()=>Ww,CSSVariableProvider:()=>A6,CardItem:()=>Z0,Cascader:()=>Z4,Checkbox:()=>QI,CheckboxFieldInterface:()=>erK,CheckboxGroupFieldInterface:()=>erU,ChildPageModel:()=>sj,ChildPageTabModel:()=>sB,ClearCollectionFieldContext:()=>enF,ClickableFieldModel:()=>hU,CodeEditor:()=>s9.BY,CodeEditorExtension:()=>s9.o8,Collection:()=>w$,CollectionActionGroupModel:()=>aK,CollectionActionModel:()=>sg.U,CollectionBlockModel:()=>sv.t,CollectionCategoriesContext:()=>Ra,CollectionCategoriesProvider:()=>Rp,CollectionCategory:()=>erB,CollectionContext:()=>enA,CollectionDeletedPlaceholder:()=>enx,CollectionField:()=>Ps,CollectionFieldContext:()=>enw,CollectionFieldInterface:()=>ka,CollectionFieldInterfaceManager:()=>ks,CollectionFieldInterfaceTag:()=>erD,CollectionFieldProvider:()=>enC,CollectionFieldUISchemaProvider:()=>CK,CollectionFieldsToFormInitializerItems:()=>enV,CollectionFieldsToInitializerItems:()=>en_,CollectionFieldsToTableInitializerItems:()=>enK,CollectionHistoryProvider:()=>TQ,CollectionManager:()=>enE,CollectionManagerContext:()=>Cu,CollectionManagerProvider:()=>Cp,CollectionManagerProvider_deprecated:()=>Rs,CollectionManagerSchemaComponentProvider:()=>Ri,CollectionNotAllowViewPlaceholder:()=>enS,CollectionPlugin:()=>eiI,CollectionProvider:()=>enP,CollectionProvider_deprecated:()=>T1,CollectionRecord:()=>FC,CollectionRecordContext:()=>FF,CollectionRecordProvider:()=>Fk,CollectionSelect:()=>Z7,CollectionSelectFieldInterface:()=>erW,CollectionTemplate:()=>enN,CollectionTemplateManager:()=>F$,CollectionTemplateTag:()=>er$,ColorFieldInterface:()=>erH,ColorPicker:()=>eeo,ColorSelect:()=>eei,CommonItemModel:()=>sy,CompatibleSchemaInitializer:()=>D0,CreateFilterActionInitializer:()=>edt,CreateFormModel:()=>pR,CreateResetActionInitializer:()=>edl,CreatedAtFieldInterface:()=>erG,CreatedByFieldInterface:()=>erY,Cron:()=>eeu,CronSet:()=>eeh,CurrentAppInfoContext:()=>TH,CurrentAppInfoProvider:()=>TY,CurrentPageUidContext:()=>kk,CurrentPageUidProvider:()=>kB,CurrentRouteProvider:()=>MJ,CurrentTabUidContext:()=>kP,CurrentTabUidProvider:()=>k$,CurrentUserContext:()=>qs,CurrentUserProvider:()=>qp,CurrentUserSettingsMenuProvider:()=>qf,CustomRouterContextProvider:()=>kX,CustomizeActionInitializer:()=>edn,DEBOUNCE_WAIT:()=>100,DEFAULT_DATA_SOURCE_KEY:()=>kd,DEFAULT_DATA_SOURCE_TITLE:()=>ku,DataBlockCollector:()=>Av,DataBlockContext:()=>LI,DataBlockInitializer:()=>edc,DataBlockModel:()=>sx.R,DataBlockProvider:()=>LN,DataBlockResourceContext:()=>Ax,DataBlockResourceProvider:()=>Ab,DataSource:()=>FD,DataSourceApplicationProvider:()=>k7,DataSourceCollectionCascader:()=>een,DataSourceContext:()=>Cn,DataSourceContext_deprecated:()=>Rt,DataSourceManager:()=>kc,DataSourceManagerContext:()=>w9,DataSourceManagerProvider:()=>w7,DataSourceProvider:()=>Co,DataSourceProvider_deprecated:()=>Ro,DataSourceSelect:()=>eet,DateFieldInterface:()=>eiw,DateFilterDynamicComponent:()=>UA,DateFormatCom:()=>FL,DatePicker:()=>qE,DatePickerProvider:()=>qI,DatetimeFieldInterface:()=>erJ,DatetimeNoTzFieldInterface:()=>eiC,DefaultToolsManager:()=>ef,DefaultValueProvider:()=>Pe,DeleteCollection:()=>erw,DeleteCollectionAction:()=>erP,Designable:()=>Fr,DesignableSwitch:()=>NY,Details:()=>eef,DetailsAssociationFieldGroupModel:()=>d4,DetailsBlockContext:()=>B6,DetailsBlockModel:()=>d7,DetailsBlockProvider:()=>$e,DetailsCustomItemModel:()=>ut,DetailsDesigner:()=>Y6,DetailsGridModel:()=>ul,DetailsItemModel:()=>dW,DisplaySubTableFieldModel:()=>g8,DisplayTextFieldModel:()=>vF,DisplayTitleFieldModel:()=>gQ,Divider:()=>eeg,DndContext:()=>MV,DocumentTitleContext:()=>JL,DocumentTitleProvider:()=>JV,DragHandler:()=>II,DraggableContext:()=>IS,DropdownVisibleContext:()=>qa,EMPTY_OBJECT:()=>CF,EditCollection:()=>eo3,EditCollectionAction:()=>eo6,EditCollectionField:()=>eoV,EditComponent:()=>Uq,EditDefaultValue:()=>UO,EditDescription:()=>UN,EditFieldAction:()=>eoz,EditFormModel:()=>dH.EditFormModel,EditOperator:()=>UV,EditPattern:()=>U_,EditRequired:()=>UB,EditSortField:()=>elU,EditSubFieldAction:()=>erE,EditTable:()=>ee$,EditTableAction:()=>eez,EditTableActionContext:()=>eeL,EditTitle:()=>UE,EditTitleField:()=>Uz,EditTooltip:()=>UD,EditValidationRules:()=>U$,Editable:()=>et8,EllipsisWithTooltip:()=>zQ,EmailFieldInterface:()=>erX,ErrorFallback:()=>PF,Expand:()=>ee0,ExpiresRadio:()=>FK,ExtendCollectionsContext:()=>Ca,ExtendCollectionsProvider:()=>Cs,FieldModel:()=>sb.o,FieldModelRenderer:()=>K.FieldModelRenderer,FieldSummary:()=>erN,FieldValidation:()=>eow,FieldsTreeSelect:()=>Xm,Fieldset:()=>ee1,Filter:()=>_I,FilterAction:()=>_g,FilterActionContext:()=>_h,FilterActionModel:()=>s4,FilterAssociatedFields:()=>eug,FilterBlockModel:()=>sS,FilterBlockProvider:()=>Ag,FilterBlockType:()=>Ae,FilterContext:()=>O6,FilterDynamicComponent:()=>_F,FilterFormActionGroupModel:()=>cT,FilterFormBlockModel:()=>c0,FilterFormBlockProvider:()=>$B,FilterFormItemModel:()=>pa,FilterGroup:()=>ah.I8,FilterLogicContext:()=>O9,FilterParentCollectionFields:()=>euf,FlagContext:()=>Me,FlagProvider:()=>Mt,ForeignKey:()=>eoI,Form:()=>Y8,FormActionGroupModel:()=>da,FormActionModel:()=>dr,FormActiveFieldsProvider:()=>BF,FormAssociationFieldGroupModel:()=>pL,FormBlockContext:()=>zO,FormBlockInitializer:()=>euo,FormBlockModel:()=>dN.F4,FormBlockProvider:()=>zV,FormComponent:()=>dN.s2,FormDialog:()=>L_,FormDrawer:()=>eno,FormField:()=>JT,FormFieldContext:()=>$$,FormFieldProvider:()=>$_,FormGridModel:()=>dB,FormItem:()=>U5,FormItemModel:()=>dQ,FormItemSchemaToolbar:()=>$a,FormProvider:()=>NQ,FormSubmitActionModel:()=>di,FormV2:()=>JP,G2Plot:()=>ee6,G2PlotInitializer:()=>edp,G2PlotRenderer:()=>ee3,GeneralSchemaDesigner:()=>O_,GeneralSchemaItems:()=>Wg,GlobalThemeProvider:()=>em,Grid:()=>Bw,GridCard:()=>etf,GridModel:()=>ss,GridRowContext:()=>Ba,HTMLEncode:()=>zZ,HeightMode:()=>E7,ICON_POPUP_Z_INDEX:()=>_c,Icon:()=>Fx,IconFieldInterface:()=>erQ,IconPicker:()=>etx,IdFieldInterface:()=>erZ,InheritanceCollectionMixin:()=>eiF,InitializerWithSwitch:()=>esq,Input:()=>Kc,InputFieldInterface:()=>er1,InputFieldModel:()=>pS.m,InputNumber:()=>etM,InputReadPretty:()=>z0,InputRecordPicker:()=>elo,IntegerFieldInterface:()=>er2,InternalAdminSettingsLayout:()=>esc,IsInNocoBaseRecursionFieldContext:()=>CJ,IsSubPageClosedByPageMenuContext:()=>kI,IsSubPageClosedByPageMenuProvider:()=>kT,JSActionModel:()=>de,Json:()=>zH,JsonFieldInterface:()=>er8,KeepAlive:()=>PD,LAZY_COMPONENT_KEY:()=>C8,LOADING_DELAY:()=>void 0,Layout:()=>We,LayoutContent:()=>l7,LinkActionModel:()=>dj,LinkToFieldInterface:()=>er5,LinkageFilter:()=>env,LinkageRuleCategory:()=>MP,LinkageRuleDataKeyMap:()=>Mj,List:()=>etV,LocalDataSource:()=>FB,LocationSearchContext:()=>kC,M2MFieldInterface:()=>er3,M2OFieldInterface:()=>er6,Markdown:()=>Kj,MarkdownFieldInterface:()=>er9,MarkdownReadPretty:()=>KM,MaybeCollectionProvider:()=>eiO,Menu:()=>I8,MenuConfigure:()=>eaS,MockFlowModelRepository:()=>bc,ModalActionSchemaInitializerItem:()=>edD,MultipleSelectFieldInterface:()=>er7,NAMESPACE_UI_SCHEMA:()=>Aw,NanoIDInput:()=>etz,NanoidFieldInterface:()=>eib,NocoBaseBuildInPlugin:()=>ec_,NocoBaseDesktopRouteType:()=>Mz,NocoBaseRecursionField:()=>CQ,NocoBaseRouteContext:()=>MY,NumberFieldInterface:()=>eie,O2MFieldInterface:()=>eit,O2OFieldInterface:()=>eil,OBOFieldInterface:()=>eio,OHOFieldInterface:()=>ein,OpenModeProvider:()=>N_,OverridingCollectionField:()=>eoU,OverridingFieldAction:()=>eoH,PMPlugin:()=>esm,Page:()=>J0,PagePopups:()=>jS,PageTabs:()=>J1,Pagination:()=>etK,ParentCollectionFields:()=>eum,ParentRouteContext:()=>IG,Password:()=>etQ,PasswordFieldInterface:()=>eir,Percent:()=>et1,PercentFieldInterface:()=>eii,PermissionContext:()=>eaC,PermissionProvider:()=>eaF,PhoneFieldInterface:()=>eia,PinnedListPlugin:()=>RD,PinnedPluginList:()=>RN,PinnedPluginListContext:()=>ni,PinnedPluginListProvider:()=>RT,Plugin:()=>M6,PluginManager:()=>esn,PluginManagerLink:()=>eaH,PluginSettingsManager:()=>Dy,PopupActionModel:()=>s_,PopupContextProvider:()=>ecW,PopupSettingsProvider:()=>P_,PopupSubTableFormActionGroupModel:()=>du,PoweredBy:()=>ecL,Preview:()=>et2,QuickEdit:()=>et5,REGEX_OF_VARIABLE:()=>AC,REGEX_OF_VARIABLE_IN_EXPRESSION:()=>AF,Radio:()=>QP,RadioGroupFieldInterface:()=>eis,ReadPretty:()=>z0,ReadPrettyRecordPicker:()=>eld,RecordActionGroupModel:()=>aU,RecordAssociationBlockInitializer:()=>edh,RecordAssociationDetailsBlockInitializer:()=>edy,RecordAssociationFormBlockInitializer:()=>edS,RecordAssociationGridCardBlockInitializer:()=>edF,RecordAssociationListBlockInitializer:()=>edP,RecordContext_deprecated:()=>enU,RecordFormBlockInitializer:()=>eua,RecordIndexContext:()=>enW,RecordIndexProvider:()=>enY,RecordLink:()=>eiQ,RecordPicker:()=>elu,RecordPickerContent:()=>m3,RecordPickerContext:()=>et7,RecordPickerProvider:()=>elr,RecordProvider:()=>enH,RecordReadPrettyAssociationFormBlockInitializer:()=>edI,RecordSelectFieldModel:()=>uN,RecordSimpleProvider:()=>enG,RefreshActionModel:()=>df,RefreshComponentProvider:()=>C_,RefreshDataBlockRequest:()=>WO,RemoteCollectionManagerProvider:()=>Rc,RemoteDocumentTitlePlugin:()=>JW,RemoteDocumentTitleProvider:()=>Jz,RemoteSchemaComponent:()=>N2,RemoteSchemaTemplateManagerPlugin:()=>Rb,RemoteSchemaTemplateManagerProvider:()=>Rx,RemoteSelect:()=>Jm,RemoveButton:()=>WR,RemoveConditionContext:()=>O3,RenderChildrenWithAssociationFilter:()=>eiL,RequestSettings:()=>WF,RerenderDataBlockProvider:()=>LR,Resizable:()=>euz,ResourceActionContext:()=>T2,ResourceActionProvider:()=>T3,RichText:()=>elm,RichTextFieldInterface:()=>eid,RoleConfigure:()=>eaA,RoleResourceCollectionContext:()=>eaV,RoleTable:()=>eaN,RolesResourcesActions:()=>eaz,RouteSchemaComponent:()=>Ii,RouterContextCleaner:()=>Db,RouterManager:()=>DC,SNIPPET_PREFIX:()=>Dv,SanitizedCollectionProvider:()=>enj,SchemaComponent:()=>CC,SchemaComponentContext:()=>Cf,SchemaComponentOnChangeContext:()=>Cb,SchemaComponentOptions:()=>Cv,SchemaComponentPlugin:()=>N6,SchemaComponentProvider:()=>N3,SchemaInitializer:()=>DZ,SchemaInitializerActionModal:()=>DY,SchemaInitializerActionModalInternal:()=>DJ,SchemaInitializerChild:()=>Mg,SchemaInitializerChildren:()=>Mc,SchemaInitializerContext:()=>Ma,SchemaInitializerDivider:()=>DL,SchemaInitializerItem:()=>DD,SchemaInitializerItemContext:()=>Md,SchemaInitializerItemGroup:()=>DW,SchemaInitializerItemGroupInternal:()=>DH,SchemaInitializerItemInternal:()=>DB,SchemaInitializerItems:()=>Mv,SchemaInitializerManager:()=>D8,SchemaInitializerMenu:()=>DT,SchemaInitializerMenuProvider:()=>DM,SchemaInitializerOpenModeSchemaItems:()=>Wh,SchemaInitializerPlugin:()=>ecO,SchemaInitializerSelect:()=>DX,SchemaInitializerSelectInternal:()=>DQ,SchemaInitializerSubMenu:()=>DR,SchemaInitializerSubMenuInternal:()=>DE,SchemaInitializerSwitch:()=>Dq,SchemaInitializerSwitchInternal:()=>D_,SchemaSettingAccessControl:()=>Wn,SchemaSettingItemContext:()=>_3,SchemaSettingOpenModeSchemaItems:()=>Wf,SchemaSettings:()=>Es,SchemaSettingsActionLinkItem:()=>Hy,SchemaSettingsActionModalItem:()=>zr,SchemaSettingsBlockHeightItem:()=>Ne,SchemaSettingsBlockTitleItem:()=>Uy,SchemaSettingsCascaderItem:()=>ze,SchemaSettingsChild:()=>Lo,SchemaSettingsChildren:()=>Le,SchemaSettingsConnectDataBlocks:()=>Ub,SchemaSettingsDataScope:()=>q7,SchemaSettingsDataTemplates:()=>zu,SchemaSettingsDateFormat:()=>_t,SchemaSettingsDefaultSortingRules:()=>za,SchemaSettingsDefaultValue:()=>_r,SchemaSettingsDivider:()=>V4,SchemaSettingsDropdown:()=>VQ,SchemaSettingsEnableChildCollections:()=>zc,SchemaSettingsFixed:()=>euK,SchemaSettingsFormItemTemplate:()=>V1,SchemaSettingsItem:()=>V2,SchemaSettingsItemGroup:()=>V8,SchemaSettingsLayoutItem:()=>Wt,SchemaSettingsLinkageRules:()=>zs,SchemaSettingsManager:()=>D5,SchemaSettingsModalItem:()=>zi,SchemaSettingsNumberFormat:()=>Uw,SchemaSettingsPlugin:()=>Yr,SchemaSettingsPopupItem:()=>zo,SchemaSettingsProvider:()=>VY,SchemaSettingsRemove:()=>V9,SchemaSettingsRenderEngine:()=>U7,SchemaSettingsSelectItem:()=>V7,SchemaSettingsSortingRule:()=>_i,SchemaSettingsSubMenu:()=>V5,SchemaSettingsSwitchItem:()=>zn,SchemaSettingsTemplate:()=>U3,SchemaSettingsWrapper:()=>Li,SchemaTemplateManagerContext:()=>Rh,SchemaToolbar:()=>Oz,SchemaToolbarContext:()=>Bt,SchemaToolbarProvider:()=>Bl,SchemaToolbarVisibleContext:()=>OV,ScopeSelect:()=>ea_,SearchCollections:()=>eds,SearchParamsContext:()=>kj,SecondConFirm:()=>WD,Select:()=>Js,SelectActionInitializer:()=>edR,SelectFieldInterface:()=>eiu,SelectWithTitle:()=>k6,SetDataLoadingMode:()=>zx,SettingCenterPermissionProvider:()=>eaw,SettingCenterProvider:()=>esg,SettingsCenterConfigure:()=>esv,SettingsCenterContext:()=>esi,SettingsCenterDropdown:()=>eaG,SettingsMenuProvider:()=>qi,ShowFormData:()=>UC,SkeletonFallback:()=>oZ,SkipValidation:()=>Wk,SnowflakeIdFieldInterface:()=>eic,Sortable:()=>Ik,SortableContext:()=>Iw,SortableItem:()=>IM,SortableProvider:()=>IC,SourceCollection:()=>eoP,SourceForeignKey:()=>eoF,SourceKey:()=>eoj,Space:()=>elh,StablePopover:()=>_p,StrategyActions:()=>eaW,SubFieldDataSourceProvider_deprecated:()=>Rn,SubTableColumnModel:()=>hg,SubTableFieldInterface:()=>eip,SubTableFieldModel:()=>hk,SubmitActionInitializer:()=>edE,SwitchLanguage:()=>ecU,SyncFieldsAction:()=>era,SyncFieldsActionCom:()=>ers,SyncSQLFieldsAction:()=>erS,SystemSettingsPane:()=>Jq,SystemSettingsPlugin:()=>J_,SystemSettingsSource:()=>ex.o,Table:()=>el_,TableActionColumnInitializer:()=>edN,TableAssociationFieldGroupModel:()=>ma,TableBlockContext:()=>E8,TableBlockDesigner:()=>elW,TableBlockInitializer:()=>euX,TableBlockModel:()=>mR,TableBlockProvider:()=>E6,TableColumnModel:()=>me,TableColumnSchemaToolbar:()=>$C,TableField:()=>elH,TableFieldContext:()=>$z,TableFieldProvider:()=>$H,TableFieldResource:()=>$U,TableSelectorContext:()=>jX,TableSelectorDesigner:()=>elG,TableSelectorInitializer:()=>euV,TableSelectorParamsProvider:()=>j0,TableSelectorProvider:()=>j5,TableV2:()=>elY,TableoidFieldInterface:()=>eim,Tabs:()=>elZ,TabsContextProvider:()=>P$,TargetForeignKey:()=>eoA,TargetKey:()=>eoM,TemplateBlockProvider:()=>k1,TemplateSummary:()=>eoQ,Templates:()=>Jf,TestDesigner:()=>UI,TextAreaWithContextSelector:()=>ac.n,TextAreaWithGlobalScope:()=>ent,TextareaFieldInterface:()=>eih,ThroughCollection:()=>eoT,ThroughForeignKey:()=>eok,TimeFieldInterface:()=>eif,TimePicker:()=>el8,TreeSelect:()=>el4,UUIDFieldInterface:()=>eix,UnSupportFields:()=>eo9,UnixTimestamp:()=>el9,UnixTimestampFieldInterface:()=>eiS,UpdateRecordActionModel:()=>dS,UpdatedAtFieldInterface:()=>eig,UpdatedByFieldInterface:()=>eiv,Upload:()=>Qt,Uploader:()=>Qa,UrlFieldInterface:()=>eiy,Variable:()=>Hh,VariableFilterItem:()=>ah.Et,VariableInput:()=>q3,VariablePopupRecordProvider:()=>FR,VariableScope:()=>Ih,VariableScopeProvider:()=>Hp,VariableSelect:()=>Kh,VariablesContext:()=>Yg,VariablesProvider:()=>Yw,ViewCollectionField:()=>eoY,ViewFieldAction:()=>eoJ,WithoutFormFieldResource:()=>$q,WithoutTableFieldResource:()=>$W,actionSettings:()=>WB,actionSettingsItems:()=>WE,addCustomAlgorithmToTheme:()=>eu,allowAddNew:()=>_U,appendQueryStringToUrl:()=>Ua,applyCollectionFieldUiSchemaToDefaultValueSchema:()=>_o,applyMobilePaginationProps:()=>dg.hO,attachmentFileTypes:()=>XD,autoFill:()=>F6,autoIncrement:()=>F3,cache:()=>C.cache,canMakeAssociationBlock:()=>ecC,collectionDataSource:()=>ki,compatOldTheme:()=>es,completeURL:()=>Um,compose:()=>LF,constraintsProps:()=>F7,createCompactSimpleItemRender:()=>dg.hH,createCreateFormBlockUISchema:()=>edb,createDesignable:()=>C7,createDetailsBlockSchema:()=>OA,createFormActionInitializers:()=>euc,createFormActionInitializers_deprecated:()=>euu,createFormBlockSchema:()=>OP,createFormBlockSettings:()=>HD,createModalSettingsItem:()=>Lx,createReadPrettyFormBlockSchema:()=>Oj,createRouterManager:()=>DF,createSelectSchemaSettingsItem:()=>Lb,createStyles:()=>lk.rU,createSwitchSettingsItem:()=>LS,createTableBlockSchema:()=>OM,createTableBlockUISchema:()=>edm,createTextSettingsItem:()=>Lw,css:()=>C.css,customAlgorithm:()=>ed,customFormItemInitializers:()=>ecw,customFormItemInitializers_deprecated:()=>ecS,cx:()=>C.cx,dataSource:()=>kn,dateTimeProps:()=>kt,defaultFieldNames:()=>Y7,defaultInputStyle:()=>zp,defaultProps:()=>ko,defaultTheme:()=>ea,dispatchEventDeep:()=>dg.Xi,ds:()=>Rl,editFormBlockSettings:()=>HB,editMarkdownFlow:()=>gW,fetchTemplateData:()=>Jv,fieldComponentSettingsItem:()=>H$,fieldSettingsFormItem:()=>HO,fileSizeSetting:()=>Gx,fillParentFields:()=>Uf,filterFormItemSettings:()=>Gq,findByUid:()=>IR,findFilterTargets:()=>Kz,findFirstPageRoute:()=>MW,findFormBlock:()=>zU,findKanbanFormItem:()=>enL,findKeysByUid:()=>ID,findMenuItem:()=>IE,findParentFieldSchema:()=>zm,findRouteBySchemaUid:()=>MK,flush:()=>C.flush,formActionInitializers:()=>eup,formDetailsSettings:()=>JI,formItemInitializers:()=>eux,formItemInitializers_deprecated:()=>euy,formItemSettings:()=>_W,formSettings:()=>Jj,formV1Settings:()=>Y5,genStyleHook:()=>w4,getAppends:()=>Un,getAssociationPath:()=>Ul,getCardItemSchema:()=>KN,getCollectionTitle:()=>BT,getConfigurableProperties:()=>erz,getCurrentOptions:()=>Jl,getDataSourceHeaders:()=>kf,getDateExact:()=>AV,getDatePickerLabels:()=>et6,getDateRanges:()=>AL,getFieldDefaultValue:()=>zg,getFilterByTkByCollection:()=>eiH,getFlowPageMenuSchema:()=>Id,getFormValues:()=>Kq,getIdsWithChildren:()=>E5,getLabelFormatValue:()=>et9,getLabelWithTooltip:()=>BZ,getPageMenuSchema:()=>Ip,getPageSchema:()=>KE,getPinnedPluginListKeys:()=>nr,getPopupPathFromParams:()=>jo,getRegisteredStyles:()=>C.getRegisteredStyles,getRenderContent:()=>A8,getSchemaSettingsConfirmZIndex:()=>V6,getSchemaSettingsDialogZIndex:()=>V3,getShouldChange:()=>q6,getSimpleModePaginationClassName:()=>dg.HZ,getStoredPopupContext:()=>P6,getSupportFieldsByAssociation:()=>Al,getSupportFieldsByForeignKey:()=>An,getSystemSettingsMutationData:()=>JB,getTabSchema:()=>Xe,getURLSearchParams:()=>q1,getURLSearchParamsChildren:()=>q2,getUniqueKeyFromCollection:()=>er4,getUnknownCountPaginationTotal:()=>dg.SM,getVariableComponentWithScope:()=>Hf,getVariableValue:()=>qr,getVariablesFromExpression:()=>AA,getZIndex:()=>Nf,gridRowColWrap:()=>Ol,handleDateChangeOnForm:()=>AE,hasIcon:()=>Fv,hydrate:()=>C.hydrate,i18n:()=>Pm,icons:()=>Ff,inferPickerType:()=>AK,injectGlobal:()=>C.injectGlobal,interfacesOfUnsupportedDefaultValue:()=>Pl,interfacesProperties:()=>m,isAssocField:()=>Aa,isBulkEditAction:()=>Yq,isDeleteButtonDisabled:()=>eoh,isFileCollection:()=>U4,isInFilterFormBlock:()=>Au,isInitializersSame:()=>D2,isMobile:()=>AD,isPatternDisabled:()=>A9,isSameCollection:()=>As,isShowFilePicker:()=>ela,isSystemField:()=>zf,isTabPage:()=>J7,isTitleField:()=>km,isVariable:()=>Ak,isWriteEmailAction:()=>Y_,itemsMerge:()=>Ot,joinCollectionName:()=>eiR,joinUrlSearch:()=>dF,keyframes:()=>C.keyframes,languageCodes:()=>Pu,lazy:()=>C4,locale:()=>Pc,mapDatePicker:()=>AN,mapRangePicker:()=>AB,mapTimeFormat:()=>el2,matchMimetype:()=>XB,merge:()=>C.merge,mergeFilter:()=>At,mergePaginationClassName:()=>dg.M6,mockAPIClient:()=>ecz,moment2str:()=>AT,navigateToTab:()=>J9,navigateWithinSelf:()=>Uh,normalizeContainer:()=>LC,openViewFlow:()=>eC,operators:()=>p,pageSettings:()=>Xl,pageTabSettings:()=>Xo,parseCollectionName:()=>eiT,parseVariablesAndChangeParamsToQueryString:()=>Uc,primaryKey:()=>F4,readPrettyFormSettings:()=>JM,recordBlockInitializers:()=>ecA,recordBlockInitializers_deprecated:()=>eck,recordPickerViewer:()=>kr,recursiveParent:()=>j2,reduceValueSize:()=>Up,registerIcon:()=>Fg,registerIcons:()=>Fy,registerInitializerMenusGenerator:()=>OD,relationshipType:()=>F9,removeNullCondition:()=>_O,replaceVariableValue:()=>Uu,replaceVariables:()=>O8,requestParentRecordData:()=>zk,resolveFilterPickerFormat:()=>qP,reverseFieldProperties:()=>ke,schemaSettingsLabelLayout:()=>zh,setDataLoadingModeSettingsItem:()=>zv,setDefaultSortingRulesSchemaSettingsItem:()=>U6,setTheDataScopeSchemaSettingsItem:()=>U9,sheet:()=>C.sheet,shouldRenderIconInTitle:()=>Tk,showFileName:()=>Gb,splitWrapSchema:()=>Fn,storePopupContext:()=>P9,subTableActionInitializers:()=>ecM,subTableActionInitializers_deprecated:()=>ecj,systemKeys:()=>kv,tabPaneInitializers:()=>ecD,tabPaneInitializersForBulkEditFormBlock:()=>ec$,tabPaneInitializersForRecordBlock:()=>ecB,tabPaneInitializers_deprecated:()=>ecN,tableActionColumnInitializers:()=>euH,tableActionColumnInitializers_deprecated:()=>euW,tableActionInitializers:()=>euJ,tableActionInitializers_deprecated:()=>euY,tableBlockSettings:()=>HQ,tableColumnInitializers:()=>eu1,tableColumnInitializers_deprecated:()=>eu0,tableColumnSettings:()=>H0,tableSelectorBlockSettings:()=>HY,timeProps:()=>kl,titleField:()=>v9,toToolsMap:()=>ev,transformFilter:()=>eh.transformFilter,transformToFilter:()=>Ar,transformVariableValue:()=>AP,tval:()=>Pp,type:()=>F8,unique:()=>F5,updateFilterTargets:()=>KK,updateFormActionInitializers:()=>euw,updateFormActionInitializers_deprecated:()=>euS,useACLActionParamsContext:()=>ear,useACLContext:()=>ei5,useACLFieldWhitelist:()=>eas,useACLRoleContext:()=>eal,useACLRolesCheck:()=>ei9,useAPIClient:()=>wv,useAPITokenVariable:()=>qy,useAclSnippets:()=>Ld,useActionAvailable:()=>edZ,useActionBarContext:()=>YU,useActionContext:()=>zD,useAdminSchemaUid:()=>eac,useAfterSuccessOptions:()=>Wv,useAllAccessDesktopRoutes:()=>MZ,useAllCollectionsInheritChainGetter:()=>Ct,useAllDataBlocks:()=>Ah,useApp:()=>wg,useAppLangContext:()=>esF,useAppSpin:()=>Lc,useAriaAttributeOfMenuItem:()=>DN,useAssociatedFields:()=>Ai,useAssociatedFormItemInitializerFields:()=>Oh,useAssociatedTableColumnInitializerFields:()=>Od,useAssociationCreateActionProps:()=>KV,useAssociationFieldContext:()=>Ef,useAssociationFieldModeContext:()=>QX,useAssociationFilterBlockProps:()=>Ue,useAssociationFilterProps:()=>K6,useAssociationName:()=>PX,useAssociationNames:()=>Uo,useAsyncData:()=>erc,useAttach:()=>jI,useBackButton:()=>NR,useBaseVariable:()=>B0,useBlockAssociationContext:()=>eiW,useBlockConfigs:()=>esj,useBlockContext:()=>eiz,useBlockHeight:()=>Ns,useBlockHeightProps:()=>KR,useBlockRequestContext:()=>ei_,useBlockResource:()=>ei$,useBlockTemplateContext:()=>Oe,useBuiltinVariables:()=>Yi,useBulkDestroyAction:()=>erA,useBulkDestroyActionAndRefreshCM:()=>erF,useBulkDestroyActionProps:()=>K2,useCancelAction:()=>enZ,useCloseAction:()=>zB,useCollectValuesToSubmit:()=>K_,useCollection:()=>enM,useCollectionDataSource:()=>Z6,useCollectionDataSourceItems:()=>Ok,useCollectionField:()=>enk,useCollectionFieldFormValues:()=>eoB,useCollectionField_deprecated:()=>Z3,useCollectionFields:()=>enI,useCollectionFieldsOptions:()=>en7,useCollectionFilterOptions:()=>en3,useCollectionHistory:()=>T0,useCollectionManager:()=>Cm,useCollectionManager_deprecated:()=>k3,useCollectionParentRecord:()=>Fj,useCollectionParentRecordData:()=>FM,useCollectionRecord:()=>FA,useCollectionRecordData:()=>FP,useCollectionState:()=>ky,useCollection_deprecated:()=>D4,useCollections:()=>Ch,useColumnSchema:()=>D9,useColumnSettings:()=>Ew,useCompatOldVariables:()=>q9,useCompile:()=>CP,useComponent:()=>jT,useContextAssociationFields:()=>qo,useContextVariable:()=>UG,useCreateActionProps:()=>KL,useCreateAssociationDetailsBlock:()=>edx,useCreateAssociationDetailsWithoutPagination:()=>edT,useCreateAssociationFormBlock:()=>edw,useCreateAssociationGridCardBlock:()=>edk,useCreateAssociationListBlock:()=>edj,useCreateAssociationTableBlock:()=>edf,useCreateEditFormBlock:()=>eus,useCreateFormBlock:()=>eur,useCreateTableBlock:()=>euQ,useCurrentAppInfo:()=>TG,useCurrentDocumentTitle:()=>JU,useCurrentPageUid:()=>kU,useCurrentPopupContext:()=>jk,useCurrentPopupRecord:()=>FE,useCurrentRoleMode:()=>ei8,useCurrentRoleVariable:()=>q0,useCurrentRoles:()=>qc,useCurrentRoute:()=>MX,useCurrentSchema:()=>OC,useCurrentSearchParams:()=>kG,useCurrentTabUid:()=>kH,useCurrentUserContext:()=>qd,useCurrentUserSettingsMenu:()=>qh,useCurrentUserVariable:()=>qv,useCustomizeBulkUpdateActionProps:()=>KJ,useCustomizeRequestActionProps:()=>KX,useCustomizeUpdateActionProps:()=>KY,useDataBlock:()=>LD,useDataBlockHeight:()=>Na,useDataBlockParentRecord:()=>KD,useDataBlockProps:()=>LB,useDataBlockRequest:()=>zj,useDataBlockRequestData:()=>zI,useDataBlockRequestGetter:()=>zM,useDataBlockResource:()=>AS,useDataLoadingMode:()=>zy,useDataSource:()=>Cr,useDataSourceFromRAC:()=>T9,useDataSourceHeaders:()=>kh,useDataSourceKey:()=>Ci,useDataSourceManager:()=>Ce,useDataTemplates:()=>zd,useDatePickerContext:()=>qM,useDateVariable:()=>qD,useDatetimeVariable:()=>q$,useDatetimeVariableContext:()=>qB,useDeleteRouteSchema:()=>Eu,useDesignable:()=>Fa,useDesigner:()=>jE,useDestroyAction:()=>erk,useDestroyActionAndRefreshCM:()=>erC,useDestroyActionProps:()=>KZ,useDetailsBlockContext:()=>$t,useDetailsBlockProps:()=>$l,useDetailsDecoratorProps:()=>$o,useDetailsPaginationProps:()=>K3,useDetailsParentRecord:()=>$r,useDetailsProps:()=>$i,useDetailsWithPaginationBlockParams:()=>BR,useDetailsWithPaginationDecoratorProps:()=>BE,useDetailsWithPaginationProps:()=>$n,useDisassociateActionProps:()=>K1,useDocumentTitle:()=>JK,useDownloadLogs:()=>PC,useEditTableActionProps:()=>K4,useEnsureOperatorsValid:()=>UL,useExactDateVariable:()=>qq,useExactDateVariableContext:()=>qO,useExtendCollections:()=>Cd,useFieldComponentName:()=>_4,useFieldComponentOptions:()=>jB,useFieldInterfaceOptions:()=>eoE,useFieldMode:()=>_0,useFieldModeOptions:()=>Nc,useFieldNames:()=>et4,useFieldProps:()=>jN,useFieldTitle:()=>j$,useFilterAPI:()=>Ad,useFilterActionProps:()=>_q,useFilterBlock:()=>Ay,useFilterBlockActionProps:()=>KW,useFilterByTk:()=>eiG,useFilterFieldOptions:()=>_B,useFilterFieldProps:()=>__,useFilterOptions:()=>_R,useFindComponent:()=>Fi,useFlag:()=>Ml,useFormActiveFields:()=>Bk,useFormBlockContext:()=>zz,useFormBlockProps:()=>zK,useFormBlockType:()=>z_,useFormDataTemplates:()=>Jh,useFormFieldContext:()=>$L,useFormFieldProps:()=>$V,useFormItemInitializerFields:()=>Op,useGetAriaLabelOfAction:()=>YE,useGetAriaLabelOfDesigner:()=>OB,useGetAriaLabelOfDrawer:()=>Np,useGetAriaLabelOfModal:()=>NF,useGetAriaLabelOfPopover:()=>YY,useGetFilterFieldOptions:()=>_E,useGetFilterOptions:()=>_T,useGetSchemaInitializerMenuItems:()=>DP,useGlobalTheme:()=>ep,useGlobalVariable:()=>Lh,useGlobalVariableCtx:()=>Lf,useGridContext:()=>Bx,useGridRowContext:()=>Bb,useHistoryCollectionsByNames:()=>TZ,useInheritsTableColumnInitializerFields:()=>Oc,useInsertPageSchema:()=>Iu,useIsAddNewForm:()=>_H,useIsAdminPage:()=>kK,useIsAllowToSetDefaultValue:()=>Pt,useIsAssociationField:()=>_Q,useIsDetailBlock:()=>zL,useIsFieldReadPretty:()=>_J,useIsFileField:()=>_Z,useIsFormReadPretty:()=>_Y,useIsInSettingsPage:()=>kW,useIsLoggedIn:()=>qu,useIsSameOrChildCollection:()=>ql,useIsSelectFieldMode:()=>_1,useIsSubPageClosedByPageMenu:()=>kJ,useKeepAlive:()=>PT,useKeepAliveLocationSearch:()=>JZ,useLabelUiSchema:()=>et3,useLazy:()=>C3,useLinkActionProps:()=>Ud,useLinkageAction:()=>z$,useLinkageCollectionFilterOptions:()=>en9,useListBlockContext:()=>etE,useLocalVariables:()=>UY,useLocalVariablesWithoutCustomVariable:()=>YP,useLocationNoUpdate:()=>kV,useLocationSearch:()=>kz,useMenuDragEnd:()=>I2,useMenuSearch:()=>edu,useMenuTranslation:()=>IT,useMobileLayout:()=>bY,useNavigateNoUpdate:()=>kL,useNocoBaseRoutes:()=>IJ,useOpenModeContext:()=>NL,useOptionalFieldList:()=>K9,useParamsFromRecord:()=>eiX,useParentCollection:()=>PY,useParentRecordCommon:()=>jK,useParentRoute:()=>IY,useParseDataScopeFilter:()=>Wr,useParseURLAndParams:()=>Us,useParsedFilter:()=>jz,usePickActionProps:()=>KB,usePlugin:()=>Lp,usePopupSettings:()=>PL,usePopupUtils:()=>jr,usePopupVariable:()=>qQ,usePopupVariableContext:()=>qX,useProps:()=>jq,useRecord:()=>enJ,useRecordCollectionDataSourceItems:()=>OF,useRecordIndex:()=>enX,useRecordIsOwn:()=>enQ,useRecordPkValue:()=>eai,useRefreshActionProps:()=>K8,useRefreshFieldSchema:()=>CV,useRemoteCollectionManagerLoading:()=>Ru,useRemoveActionProps:()=>K0,useRemoveGridFormItem:()=>Or,useRequest:()=>wP,useRerenderDataBlock:()=>L$,useResetBlockActionProps:()=>KG,useResource:()=>wj,useResourceActionContext:()=>T6,useResourceContext:()=>T7,useRoleRecheck:()=>ei2,useRoleVariable:()=>qZ,useRolesResourcesScopesSelectedRowKeys:()=>eaq,useRouter:()=>Lm,useRouterBasename:()=>kY,useSchemaComponentContext:()=>jD,useSchemaInitializer:()=>Ms,useSchemaInitializerItem:()=>Mu,useSchemaInitializerMenuItems:()=>DA,useSchemaInitializerRender:()=>Mk,useSchemaInitializerStyles:()=>Mb,useSchemaInitializerSubMenuContext:()=>DI,useSchemaOptionsContext:()=>Cg,useSchemaSettings:()=>VG,useSchemaSettingsItem:()=>_6,useSchemaSettingsRender:()=>Br,useSchemaTemplate:()=>Rg,useSchemaTemplateManager:()=>Rv,useSchemaToolbar:()=>Bn,useSchemaToolbarRender:()=>OU,useSortFields:()=>en8,useSourceId:()=>eiE,useSourceIdFromParentRecord:()=>eiJ,useSourceIdFromRecord:()=>eiY,useStyles:()=>Ir,useSupportedBlocks:()=>Ao,useSyncFromForm:()=>Uv,useSystemSettings:()=>ex.e,useSystemSettingsVariable:()=>LV,useTableBlockContext:()=>E9,useTableBlockContextBasicValue:()=>PW,useTableBlockDecoratorProps:()=>jU,useTableBlockParams:()=>jW,useTableBlockProps:()=>$F,useTableColumnInitializerFields:()=>Os,useTableColumnIntegration:()=>EC,useTableColumns:()=>K5,useTableFieldContext:()=>$G,useTableFieldProps:()=>$Y,useTableSelectorContext:()=>j4,useTableSelectorProps:()=>j3,useTableSize:()=>Nd,useTabsContext:()=>PO,useTemplateBlockContext:()=>kZ,useTitleFieldOptions:()=>_5,useToken:()=>NC,useUIConfigurationPermissions:()=>ean,useURLAndHTMLSchema:()=>Hv,useURLSearchParamsCtx:()=>q8,useURLSearchParamsVariable:()=>q5,useUpdateActionProps:()=>KQ,useUpdateCollectionActionAndRefreshCM:()=>eo4,useUploadStyles:()=>XJ,useUserVariable:()=>qg,useValidateSchema:()=>_2,useValuesFromRecord:()=>eo5,useVariableOptions:()=>q4,useVariableScope:()=>Hm,useVariableScopeInfo:()=>If,useVariables:()=>UJ,useViewport:()=>eam,useZIndexContext:()=>Nh,withDynamicSchemaProps:()=>Fp,withInitializer:()=>MC,withSearchParams:()=>ja,withSkeletonComponent:()=>Mo,zIndexContext:()=>Nm}),l(37872),l(98867),l(8906),l(68313),l(21840),l(41816),l(83826),l(46986),l(70571);var C=l(22803),F=l(88909),k=l(55373),A=l.n(k);let P=(e,t)=>{if(!e)return;let l="function"==typeof e.toJSON?e.toJSON():e,n=Object.keys(l||{}).find(e=>e.toLowerCase()===t.toLowerCase());return n?l[n]:void 0},j=(e,t)=>{let l=P(e,t);return null!=l&&""!==l};class M{get storagePrefix(){return this.api.storagePrefix}get locale(){return this.getLocale()}set locale(e){this.setLocale(e)}get role(){return this.getRole()}set role(e){this.setRole(e)}get token(){return this.getToken()}set token(e){this.setToken(e)}get authenticator(){return this.getAuthenticator()}set authenticator(e){this.setAuthenticator(e)}getOption(e){return this.api.storage.getItem(e)}setOption(e,t){return this.options[e]=t,this.api.storage.setItem(e,t||"")}getLocale(){return this.getOption("locale")}setLocale(e){this.setOption("locale",e)}getRole(){return this.getOption("role")}setRole(e){this.setOption("role",e)}getToken(){return this.getOption("token")}setToken(e){this.setOption("token",e),this.api.app&&this.api.app.eventBus.dispatchEvent(new CustomEvent("auth:tokenChanged",{detail:{token:e,authenticator:this.authenticator}}))}getAuthenticator(){return this.getOption("auth")}setAuthenticator(e){this.setOption("auth",e)}middleware(e){return this.locale&&e.headers&&(e.headers["X-Locale"]=this.locale),this.role&&e.headers&&(e.headers["X-Role"]=this.role),this.authenticator&&!j(e.headers,"X-Authenticator")&&e.headers&&(e.headers["X-Authenticator"]=this.authenticator),this.token&&!j(e.headers,"Authorization")&&e.headers&&(e.headers.Authorization=`Bearer ${this.token}`),e}async signIn(e,t){var l;let n=await this.api.request({method:"post",url:"auth:signIn",data:e,headers:{"X-Authenticator":t}}),o=null==n||null==(l=n.data)?void 0:l.data;return this.setAuthenticator(t),this.setToken(null==o?void 0:o.token),n}async signUp(e,t){return await this.api.request({method:"post",url:"auth:signUp",data:e,headers:{"X-Authenticator":t}})}async signOut(){let e=await this.api.request({method:"post",url:"auth:signOut"});return this.setToken(null),this.setRole(null),this.setAuthenticator(null),e}async lostPassword(e){let t=Object.fromEntries(new URLSearchParams(window.location.search).entries());return await this.api.request({method:"post",url:"auth:lostPassword",data:{...e,baseURL:window.location.href.split("/forgot-password")[0]},headers:{"X-Authenticator":t.name}})}async resetPassword(e){return await this.api.request({method:"post",url:"auth:resetPassword",data:e})}async checkResetToken(e){return await this.api.request({method:"post",url:"auth:checkResetToken",data:e})}constructor(e){this.options={locale:null,role:null,authenticator:null,token:null},this.api=e,this.api.axios.interceptors.request.use(this.middleware.bind(this))}}class I{toUpperCase(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];return e.toUpperCase()+l.map(e=>e.toUpperCase()).join("_")}}class T extends I{clear(){this.items.clear()}getItem(e){return this.items.get(e)}setItem(e,t){return this.items.set(e,t)}removeItem(e){return this.items.delete(e)}constructor(...e){super(...e),this.items=new Map}}class R extends I{clear(){return this.items.clear()}getItem(e){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.getItem(this.toUpperCase(this.baseStoragePrefix,e)):this.items.getItem(this.toUpperCase(this.storagePrefix,e))}setItem(e,t){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.setItem(this.toUpperCase(this.baseStoragePrefix,e),t):this.items.setItem(this.toUpperCase(this.storagePrefix,e),t)}removeItem(e){return this.shareToken&&"token"===e&&this.baseStoragePrefix?this.items.removeItem(this.toUpperCase(this.baseStoragePrefix,e)):this.items.removeItem(this.toUpperCase(this.storagePrefix,e))}constructor(e,t="",l=!1){super(),this.storagePrefix=e,this.baseStoragePrefix=t,this.shareToken=l,this.items=window.localStorage}}class E extends R{constructor(e,t="",l=!1){super(e,t,l),this.storagePrefix=e,this.baseStoragePrefix=t,this.shareToken=l,this.items=window.sessionStorage}}class N{toErrMessages(e){var t,l,n,o,r,i,a,s,d,u,c;if("u">typeof document&&"string"==typeof(null==e||null==(t=e.response)?void 0:t.data)){let t=document.createElement("div");t.innerHTML=null==e||null==(d=e.response)?void 0:d.data;let l=t.textContent||t.innerText;return l.includes("Error occurred while trying")||l.includes("502 Bad Gateway")?[{code:"APP_WARNING",message:l="The application may be starting up. Please try again later."}]:[{message:l}]}return(null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.error)?[null==e||null==(c=e.response)||null==(u=c.data)?void 0:u.error]:(null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.errors)||(null==e||null==(a=e.response)||null==(i=a.data)?void 0:i.messages)||(null==e||null==(s=e.response)?void 0:s.error)||[{message:e.message||"Server error"}]}getHeaders(){let e={};return this.auth.locale&&(e["X-Locale"]=this.auth.locale),this.auth.role&&(e["X-Role"]=this.auth.role),this.auth.authenticator&&(e["X-Authenticator"]=this.auth.authenticator),this.auth.token&&(e.Authorization=`Bearer ${this.auth.token}`),e}createStorage(e){return"localStorage"===e&&"u">typeof localStorage?new R(this.storagePrefix,this.baseStoragePrefix,this.shareToken):"sessionStorage"===e&&"u">typeof sessionStorage?new E(this.storagePrefix,this.baseStoragePrefix,this.shareToken):new T}initStorage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"localStorage";if(e){this.storage=new e(this);return}this.storage=this.createStorage(t)}interceptors(){this.axios.interceptors.request.use(e=>(e.paramsSerializer=e=>A().stringify(e,{strictNullHandling:!0,arrayFormat:"brackets"}),e))}request(e){let{resource:t,resourceOf:l,action:n,params:o,headers:r}=e;return t?this.resource(t,l,r)[n](o):this.axios.request(e)}resource(e,t,l,n){return new Proxy({},{get:(o,r)=>{if(n)return;let i=e.split(".").join(`/${encodeURIComponent(t)||"_"}/`),a={url:i+=`:${r.toString()}`};return["get","list"].includes(r)?a.method="get":a.method="post",async(e,t)=>{let{values:n,filter:o,...r}=e||{};return a.params=r,o&&("string"==typeof o?a.params.filter=o:(o["*"]&&delete o["*"],a.params.filter=JSON.stringify(o))),"get"!==a.method&&(a.data=n||{}),await this.request({...a,...t,headers:l})}}})}constructor(e){if(this.storagePrefix="NOCOBASE_",this.baseStoragePrefix="NOCOBASE_",this.shareToken=!1,this.options=e,"function"==typeof e)this.axios=e;else{const{appName:t,authClass:l,storageType:n,storageClass:o,storagePrefix:r="NOCOBASE_",shareToken:i=!1,...a}=e||{};this.shareToken=i,this.baseStoragePrefix=r,this.storagePrefix=t?`${r}${t.toUpperCase()}_`:r,this.axios=F.A.create(a),this.initStorage(o,n),l&&(this.auth=new l(this))}this.storage||this.initStorage(),this.auth||(this.auth=new M(this)),this.interceptors()}}let D=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/";if("u"<typeof window||!window.location.pathname)return;let t=`${e}apps/`;if(window.location.pathname.startsWith(t))return window.location.pathname.substring(t.length).split("/",1)[0]||""};function B(e){let t=Math.floor(Math.abs(e)),l=Math.abs(e%1*60),n=String(t).padStart(2,"0"),o=String(l).padStart(2,"0"),r=e>=0?"+":"-";return`${r}${n}:${o}`}function $(){return B(-(new Date().getTimezoneOffset()/60))}class O extends N{getHostname(){var e,t;try{return new URL("/api/").hostname}catch{}return null==(t=window)||null==(e=t.location)?void 0:e.hostname}getHeaders(){let e=super.getHeaders();return this.appName&&(e["X-App"]=this.appName),e["X-Timezone"]=$(),e["X-Hostname"]=this.getHostname(),e}interceptors(){this.axios.interceptors.request.use(e=>{let t=this.getHeaders();return Object.keys(t).forEach(l=>{j(e.headers,l)||(e.headers[l]=t[l])}),e}),super.interceptors()}constructor(e){super(e),e&&"function"!=typeof e&&(this.appName=e.appName)}}var q=l(58587),_=l(18150),L=l(68238),V=l(74848),z=l(95243),K=l(11869),U=l(40098),W=l.n(U),H=l(96540),G=l(5338),Y=l(52230),J=l(47665),X=l(84976),Q=l(47767),Z=l(44363),ee=l(36098),et=l(88040);let el=(0,H.memo)(e=>{let{children:t}=e,l=(0,ee.n)(),{notification:n}=et.A.useApp();return(0,H.useLayoutEffect)(()=>{l.context.defineProperty("notification",{value:n})},[l,n]),(0,V.jsx)(V.Fragment,{children:t})});el.displayName="AppInner";let en=e=>{let{children:t,className:l,style:n}=e;return(0,V.jsx)(et.A,{className:l,style:{height:"100%",...n},children:(0,V.jsx)(el,{children:t})})};en.displayName="AntdAppProvider";let eo=en;var er=l(35710),ei=l(4888);let ea={name:"",token:{colorPrimaryHeader:"#001529",colorBgHeader:"#001529",colorBgHeaderMenuHover:"#ffffff1a",colorBgHeaderMenuActive:"#ffffff1a",colorTextHeaderMenu:"#ffffffa6",colorTextHeaderMenuHover:"#ffffff",colorTextHeaderMenuActive:"#ffffff",colorSettings:"#F18B62",colorBgSettingsHover:"rgba(241, 139, 98, 0.06)",colorTemplateBgSettingsHover:"rgba(98, 200, 241, 0.06)",colorBorderSettingsHover:"rgba(241, 139, 98, 0.3)",motionUnit:.03}},es=function(e){var t;return(null==(t=e.token)?void 0:t.colorSettings)||(e.token={...e.token,...ea.token}),e},ed=(e,t)=>{var l,n,o,r,i,a,s,d,u,c,p,m;let h=t||er.A.defaultAlgorithm(e);return(l=h).paddingPageHorizontal??(l.paddingPageHorizontal=h.sizeLG),(n=h).paddingPageVertical??(n.paddingPageVertical=h.sizeLG),(o=h).paddingPopupHorizontal??(o.paddingPopupHorizontal=h.sizeLG),(r=h).paddingPopupVertical??(r.paddingPopupVertical=h.size),(i=h).marginBlock??(i.marginBlock=h.sizeLG),(a=h).borderRadiusBlock??(a.borderRadiusBlock=h.borderRadiusLG),(s=h).colorBgSider??(s.colorBgSider=h.colorBgElevated),(d=h).colorBgSiderMenuHover??(d.colorBgSiderMenuHover=h.colorBgTextHover||h.colorFillSecondary),(u=h).colorBgSiderMenuActive??(u.colorBgSiderMenuActive=h.colorPrimaryBg),(c=h).colorTextSiderMenu??(c.colorTextSiderMenu=h.colorText),(p=h).colorTextSiderMenuHover??(p.colorTextSiderMenuHover=h.colorText),(m=h).colorTextSiderMenuActive??(m.colorTextSiderMenuActive=h.colorPrimary),h},eu=e=>(Array.isArray(e.algorithm)?e.algorithm.includes(ed)||e.algorithm.push(ed):e.algorithm=[e.algorithm,ed].filter(Boolean),e.algorithm=e.algorithm.filter(Boolean),e);(0,C.injectGlobal)`
|
|
3
3
|
.ant-form-item-label > label {
|
|
4
4
|
font-weight: 600;
|
|
@@ -400,7 +400,7 @@ if (!ctx.record) {
|
|
|
400
400
|
flex-shrink: 0;
|
|
401
401
|
flex: 1;
|
|
402
402
|
}
|
|
403
|
-
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":ac.n,"x-component-props":{rows:1}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}},properties:{add:{type:"void",title:'{{t("Add parameter")}}',"x-component":"ArrayItems.Addition"}}},openInNewWindow:{type:"boolean","x-content":t("Open in new window"),"x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}}}},handler(e,t){e.model.setProps({url:t.url,searchParams:t.searchParams,openInNewWindow:t.openInNewWindow})}}}});class dM extends aW.S0{setTitle(e){this.setProps({title:e})}setExpandFlag(e){this.expandFlag=e}getTitle(){return this.expandFlag?this.context.t("Collapse all"):this.context.t("Expand all")}getIcon(){return this.expandFlag?"NodeCollapseOutlined":"NodeExpandOutlined"}constructor(...e){super(...e),this.defaultProps={type:"default",icon:"DownOutlined"}}}function dI(e){let{idKey:t="id",childrenKey:l="children"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];function o(e){if(Array.isArray(e))for(let r of e){let e=r[l];n.push(r[t]),Array.isArray(e)&&e.length>0&&o(e)}}return o(e),n}dM.scene=aW.s5.collection;let dT=e=>dI(e);dM.registerFlow({key:"expandCollapseSettingsInit",sort:200,steps:{init:{handler(e,t){e.blockModel.props.defaultExpandAllRows?e.model.setExpandFlag(!0):e.model.setExpandFlag(!1)}}}}),dM.registerFlow({key:"expandCollapseSettings",on:"click",steps:{expandCollapse:{async handler(e,t){var l;if(!(null==(l=e.blockModel)?void 0:l.resource))return;let n=e.blockModel.resource,{treeTable:o}=e.blockModel.props;if(o)if(e.model.expandFlag)e.blockModel.setProps({expandedRowKeys:[]}),e.model.setExpandFlag(!1);else{let t=dT(n.getData());e.blockModel.setProps({expandedRowKeys:t}),e.model.setExpandFlag(!0)}}}}}),dM.define({label:(0,K.escapeT)("Expand/Collapse"),hide(e){var t;return(null==(t=e.collection)?void 0:t.template)!=="tree"||!1===e.model.props.treeTable}});class dR extends s_{getAclActionName(){return"create"}onInit(e){super.onInit(e),this.context.defineProperty("association",{get:()=>this.context.blockModel.dataSource.getAssociation(`${this.context.blockModel.collection.name}.children`)})}constructor(...e){super(...e),this.defaultProps={type:"link",title:(0,K.tExpr)("Add child"),icon:"PlusOutlined"}}}dR.capabilityActionName=null,dR.registerFlow({key:"addChildSettingsInit",steps:{addChildInit:{async handler(e,t){e.model.onClick=t=>{e.model.dispatchEvent("click",{event:t,...e.inputArgs,sourceId:e.record.id,filterByTk:null},{debounce:!0})}}}}}),dR.define({label:(0,K.tExpr)("Add child"),hide(e){var t;return(null==(t=e.collection)?void 0:t.template)!=="tree"||!1===e.blockModel.props.treeTable}}),aU.registerActionModels({AddChildActionModel:dR});var dE=l(89013),dN=l(96491);class dD extends dN.F4{useHooksBeforeRender(){let[e]=dE.A.useForm();this.context.defineProperty("form",{get:()=>e})}onInit(e){super.onInit(e);let t=(0,K.createCurrentRecordMetaFactory)(this.context,()=>this.collection);this.context.defineProperty("record",{get:()=>{var e,t;return null==(e=(t=this).getCurrentRecord)?void 0:e.call(t)},cache:!1,resolveOnServer:(0,K.createRecordResolveOnServerWithLocal)(()=>this.collection,()=>{var e,t;return null==(e=(t=this).getCurrentRecord)?void 0:e.call(t)}),meta:t}),this.context.defineProperty("filterManager",{once:!0,get:()=>new a8(this,null==e?void 0:e.filterManager)}),this.isManualRefresh=!0}createResource(e,t){let l=this.context.createResource(K.SingleRecordResource);return l.isNewRecord=!0,l}renderComponent(){var e;let{colon:t,labelAlign:l,labelWidth:n,labelWrap:o,layout:r}=this.props;return(0,V.jsx)(dN.s2,{model:this,layoutProps:{colon:t,labelAlign:l,labelWidth:n,labelWrap:o,layout:r},children:(0,V.jsx)(K.FlowModelRenderer,{model:null==(e=this.subModels)?void 0:e.grid,showFlowSettings:!1})})}setInitialAssignedValues(e){var t;let l=null==(t=this.subModels)?void 0:t.grid;Object.entries(e||{}).forEach(e=>{let[t,n]=e;l.addOrEnsureItem(t,n)})}getAssignedValues(){return this.subModels.grid.getAssignedValues()||{}}}dD.define({label:(0,K.tExpr)("Field assignments"),hide:!0,createModelOptions:{use:"AssignFormModel",subModels:{grid:{use:"AssignFormGridModel"}}}});class dB extends ss{renderAddSubModelButton(){return(0,V.jsx)(K.AddSubModelButton,{subModelKey:"items",subModelBaseClasses:[this.context.getModelClassName("FormItemModel"),this.context.getModelClassName("FormAssociationFieldGroupModel"),this.context.getModelClassName("FormCustomItemModel"),this.context.getModelClassName("FormJSFieldItemModel")].filter(Boolean),model:this,keepDropdownOpen:!0,children:(0,V.jsx)(K.FlowSettingsButton,{icon:(0,V.jsx)(nF.A,{}),children:this.translate("Fields")})})}render(){var e,t;let l=null==(e=this.props)?void 0:e.height,n=null==(t=this.props)?void 0:t.heightModel,o=this.context.themeToken,r=super.render();return"defaultHeight"===n?r:(0,V.jsx)("div",{style:{height:l,overflowY:"auto",marginLeft:`-${o.marginLG}px`,marginRight:`-${o.marginLG}px`,paddingLeft:`${o.marginLG}px`,paddingRight:`${o.marginLG}px`,paddingTop:5},children:r})}constructor(...e){super(...e),this.itemFallback=(0,V.jsx)(oQ.A.Input,{block:!0,size:"small",style:{marginBottom:"0.5rem"}}),this.itemSettingsMenuLevel=2,this.itemFlowSettings={showBackground:!0,style:{top:-6,left:-6,right:-6,bottom:-6}},this.dragOverlayConfig={columnInsert:{before:{offsetTop:-6,height:24},after:{offsetTop:3,height:24}},columnEdge:{left:{offsetLeft:-5,width:24},right:{offsetLeft:8,width:24}},rowGap:{above:{offsetTop:-2,height:24},below:{offsetTop:-12,height:24}}}}}dB.registerFlow({key:"formFieldGridSettings",steps:{grid:{handler(e,t){e.model.setProps("rowGap",0),e.model.setProps("colGap",16)}}}});class d$ extends dB{renderAddSubModelButton(){var e,t;let l=null==(e=this.context)?void 0:e.collection,n=(null==l||null==(t=l.getFields)?void 0:t.call(l))||[],o="function"==typeof(null==l?void 0:l.getPrimaryKey)?l.getPrimaryKey():void 0,r=null==l?void 0:l.filterTargetKey,i=e=>!!e&&!!(o&&e===o||"string"==typeof r&&e===r||Array.isArray(r)&&r.includes(e)),a=n.filter(e=>!i(null==e?void 0:e.name)).map(e=>{let t=e.name,n=e.title||e.name,o=K.EditableItemModel.getDefaultBindingByField(this.context,e);if(!o)return;let r=o.modelName;return{key:t,label:n,toggleable:e=>{let l=e.getStepParams("fieldSettings","init")||{};return(null==l?void 0:l.fieldPath)===t},useModel:"AssignFormItemModel",createModelOptions:()=>({use:"AssignFormItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:null==l?void 0:l.dataSourceKey,collectionName:null==l?void 0:l.name,fieldPath:t}}},subModels:{field:{use:r,stepParams:{fieldSettings:{init:{dataSourceKey:null==l?void 0:l.dataSourceKey,collectionName:null==l?void 0:l.name,fieldPath:t}}}}}})}}).filter(Boolean);return(0,V.jsx)(K.AddSubModelButton,{subModelKey:"items",model:this,items:a,keepDropdownOpen:!0,children:(0,V.jsx)(K.FlowSettingsButton,{icon:(0,V.jsx)(nF.A,{}),children:this.translate("Fields")})})}addOrEnsureItem(e,t){var l,n,o;let r=null==(l=this.context)?void 0:l.collection,i=((null==(n=this.subModels)?void 0:n.items)||[]).find(t=>{try{let l="function"==typeof(null==t?void 0:t.getStepParams)?t.getStepParams("fieldSettings","init"):null;return(null==l?void 0:l.fieldPath)===e}catch(e){return!1}});if(i){"function"==typeof(null==i?void 0:i.setStepParams)&&i.setStepParams("fieldSettings","assignValue",{value:t}),i.assignValue=t;return}let a=((null==r||null==(o=r.getFields)?void 0:o.call(r))||[]).find(t=>t.name===e),s=K.EditableItemModel.getDefaultBindingByField(this.context,a);if(!s)return;let d=s.modelName;this.flowEngine.createModel({use:"AssignFormItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:null==r?void 0:r.dataSourceKey,collectionName:null==r?void 0:r.name,fieldPath:e},assignValue:{value:t}}},subModels:{field:{use:d,stepParams:{fieldSettings:{init:{dataSourceKey:null==r?void 0:r.dataSourceKey,collectionName:null==r?void 0:r.name,fieldPath:e}}}}},parentId:this.uid,subKey:"items"}).assignValue=t}getAssignedValues(){var e;let t=(null==(e=this.subModels)?void 0:e.items)||[],l={};for(let e of t){let t="function"==typeof e.getAssignedEntry?e.getAssignedEntry():null;t&&Array.isArray(t)&&(l[t[0]]=t[1])}return l}}d$.define({label:(0,K.tExpr)("Assign grid")});var dO=l(44329);function dq(e){return"string"==typeof e?e:"function"==typeof e&&e.name?e.name:void 0}function d_(e){var t,l;let n=null==e||null==(l=e.stepParams)||null==(t=l.fieldBinding)?void 0:t.use;return"string"==typeof n?n:void 0}async function dL(e){var t,l,n;let{parentModel:o,targetUse:r,defaultProps:i,pattern:a,fieldSettingsInit:s}=e,d=o.subModels.field,u=null==d?void 0:d.uid,c=null==d||null==(l=d.serialize)||null==(t=l.call(d))?void 0:t.subModels;for(let e in c)!1===c[e].delegateToParent&&delete c[e];let p=dq(d_(d)||(null==d?void 0:d.use))===r&&(null==d?void 0:d.stepParams)||{},m=s??(null==(n=o.getFieldSettingsInitParams)?void 0:n.call(o)),{fieldBinding:h,...f}=p,g={...f,fieldSettings:{...f.fieldSettings||{},init:m}},v=o.flowEngine;u&&(null==d||d.invalidateFlowCache("beforeRender",!0),v.removeModelWithSubModels(u));let y=o.setSubModel("field",{uid:u,use:r,props:{...i||{},...a?{pattern:a}:{}},stepParams:g,subModels:c});await y.dispatchEvent("beforeRender",void 0,{useCache:!1}),await o.save()}var dV=l(13940);function dz(e,t,l){let n=(0,U.castArray)(l).filter(e=>"string"==typeof e),o=t.split(".");if(null==n?void 0:n.length){let t=[],l=0,r=0;for(;l<o.length;){let e=o[l];if(t.push(e),r<n.length){let[l,o]=n[r].split(":");l===e&&(t.push(Number(o)),r++)}l++}return(0,U.get)(e,t)}return(0,U.get)(e,o)}function dK(e){let{record:t,currentObject:l,fieldPath:n,prefixFieldPath:o,idx:r}=e,i=dz(t,n,r);if(void 0!==i||null==l)return i;if(o&&n===o)return l;let a=o&&n.startsWith(`${o}.`)?n.slice(o.length+1):n;return a?(0,U.get)(l,a):l}function dU(e,t){return!(0,dV.E4)(e)||Array.isArray(t)?t:t&&"object"==typeof t&&Array.isArray(t.rows)?t.rows:null==t?[]:[t]}class dW extends K.DisplayItemModel{static defineChildren(e){let t=e.collection;return t.getFields().map(l=>{let n=this.getDefaultBindingByField(e,l,{fallbackToTargetTitleField:!0});if(!n)return null;let o=n.modelName,r=e.prefixFieldPath?`${e.prefixFieldPath}.${l.name}`:l.name;return{key:r,label:l.title,refreshTargets:["DetailsCustomItemModel/DetailsJSFieldItemModel"],toggleable:e=>{var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===r},useModel:"DetailsItemModel",createModelOptions:()=>({use:"DetailsItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:t.dataSourceKey,collectionName:e.model.context.blockModel.collection.name,fieldPath:r}}},subModels:{field:{use:o,props:"function"==typeof n.defaultProps?n.defaultProps(e,l):n.defaultProps}}})}}).filter(Boolean)}onInit(e){super.onInit(e),this.context.defineProperty("actionName",{get:()=>"view",cache:!1})}renderItem(){let e=this.subModels.field,t=this.context.fieldIndex,l=this.context.record,n=this.context.currentObject,o=this.context.item,r=this.context.getPropertyOptions("item"),i=this.context.prefixFieldPath,a=null!=t?(()=>{let i=e.createFork({},`${t}`);i.context.defineProperty("fieldIndex",{get:()=>t}),i.context.defineProperty("record",{get:()=>l,cache:!1}),i.context.defineProperty("currentObject",{get:()=>n,cache:!1});let{value:a,...s}=r||{};return i.context.defineProperty("item",{...s,get:()=>o,cache:!1}),this.context.pattern&&i.context.defineProperty("pattern",{get:()=>this.context.pattern}),i})():e,s=this.context.pattern?{...this.context.blockModel.props,...this.props,pattern:this.context.pattern,disabled:"readPretty"===this.context.pattern}:{...this.context.blockModel.props,...this.props},d=dU(this.collectionField,dK({record:l,currentObject:n,fieldPath:this.fieldPath,prefixFieldPath:i,idx:t}));return(0,V.jsx)(K.FormItem,{...s,value:d,children:(0,V.jsx)(K.FieldModelRenderer,{model:a})})}}dW.define({label:(0,K.tExpr)("Display fields"),searchable:!0,searchPlaceholder:(0,K.tExpr)("Search fields"),sort:100}),dW.registerFlow({key:"detailItemSettings",sort:300,title:(0,K.tExpr)("Detail item settings"),steps:{showLabel:{title:(0,K.tExpr)("Show label"),uiMode:{type:"switch",key:"showLabel"},defaultParams:{showLabel:!0},handler(e,t){e.model.setProps({showLabel:t.showLabel})}},label:{title:(0,K.tExpr)("Label"),uiSchema:e=>({title:{"x-component":"Input","x-decorator":"FormItem","x-reactions":t=>{var l;let n=e.model,o=null==(l=n.collectionField)?void 0:l.title;t.decoratorProps={...t.decoratorProps,extra:n.context.t("Original field title: ")+o}}}}),defaultParams:e=>{var t;return{title:null==(t=e.collectionField)?void 0:t.title}},handler(e,t){var l;let n={ns:"lm-flow-engine",compareWith:null==(l=e.collectionField)?void 0:l.title};e.model.setProps({label:e.t(t.title,n)})}},aclCheck:{use:"aclCheck"},init:{async handler(e){let{collectionField:t}=e.model;t&&e.model.setProps(t.getComponentProps())}},tooltip:{title:(0,K.tExpr)("Tooltip"),uiSchema:{tooltip:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({tooltip:e.t(t.tooltip,{ns:"lm-flow-engine"})})}},description:{title:(0,K.tExpr)("Description"),uiSchema:{description:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({extra:e.t(t.description,{ns:"lm-flow-engine"})})}},model:{title:(0,K.tExpr)("Field component"),use:"displayFieldComponent"},fieldNames:{use:"titleField",title:(0,K.tExpr)("Title field"),beforeParamsSave:async(e,t,l)=>{if(!e.collectionField||!e.collectionField.isAssociationField())return null;if(t.label!==l.label){var n,o;e.model.setProps({titleField:t.label,...null==(o=e.collectionField.targetCollection)||null==(n=o.getField(t.label))?void 0:n.getComponentProps()});let l=e.collectionField.targetCollection.getField(t.label),r=K.DisplayItemModel.getDefaultBindingByField(e,l),i=r.modelName;await dL({parentModel:e.model,targetUse:i,defaultProps:"function"==typeof(null==r?void 0:r.defaultProps)?r.defaultProps(e,e.collectionField):null==r?void 0:r.defaultProps,pattern:e.model.getProps().pattern})}},async handler(e,t){var l,n;if(!e.collectionField||e.model.subModels.field.disableTitleField)return;e.model.setProps({titleField:t.label,...null==(n=e.collectionField.targetCollection)||null==(l=n.getField(t.label))?void 0:l.getComponentProps()});let o=e.collectionField.targetCollection;if(o){let l=o.getField(t.label),n=K.DisplayItemModel.getDefaultBindingByField(e,l).modelName;n!==e.model.subModels.field.use&&e.model.setStepParams(e.flowKey,"model",{use:n})}},hideInSettings:async e=>!e.collectionField||!e.collectionField.isAssociationField()||e.model.subModels.field.disableTitleField}}}),dW.registerFlow({key:"paginationChange",on:"paginationChange",steps:{aclCheckRefresh:{use:"aclCheckRefresh",defaultParams:{strategy:"formItem"}}}});var dH=l(71616);function dG(e){if(!e)return!1;let t=null==e?void 0:e.type;return"belongsToMany"===t||"hasMany"===t||"belongsToArray"===t}function dY(e,t){var l;let n=!!(null==e||null==(l=e.isAssociationField)?void 0:l.call(e)),o=dG(e);return n&&!o&&Array.isArray(t)?t.length?t[0]:void 0:t}function dJ(e,t){if(!(null==t?void 0:t.length))return e;let[l,n]=String(t[t.length-1]).split(":"),o=Number(n);if(!l||!Number.isFinite(o))return e;let r=0;for(let e of t){let[t]=String(e).split(":");t===l&&(r+=1)}let i=-1,a=0;for(let t=0;t<e.length;t++)if(String(e[t])===l&&(a+=1)===r){i=t;break}if(-1===i){for(let t=e.length-1;t>=0;t--)if(String(e[t])===l){i=t;break}}return -1===i?e:[o,...e.slice(i+1)]}let dX=["o2o","oho","obo","o2m","attachment","expression","point","lineString","circle","polygon","sequence","formula"];class dQ extends K.EditableItemModel{static defineChildren(e){let t=e.collection;return t.getFields().map(l=>{let n=this.getDefaultBindingByField(e,l);if(!n)return;let o=n.modelName,r=e.prefixFieldPath?`${e.prefixFieldPath}.${l.name}`:l.name;return{key:r,label:l.title,refreshTargets:["FormJSFieldItemModel","FormItemModel/FormJSFieldItemModel"],toggleable:e=>(0,dV.pX)(e).some(e=>e===r),useModel:"FormItemModel",createModelOptions:()=>({use:"FormItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:t.dataSourceKey,collectionName:e.model.context.blockModel.collection.name,fieldPath:r}}},subModels:{field:{use:o,props:"function"==typeof n.defaultProps?n.defaultProps(e,l):n.defaultProps}}})}}).filter(Boolean)}onInit(e){super.onInit(e),this.emitter.on("onSubModelAdded",e=>{if(this.collectionField){let t=this.collectionField.getComponentProps();e.setProps(t),this.setProps({...W().pick(t,"rules")||{}})}})}renderItem(){var e,t;let l=this.subModels.field,n=this.context.fieldIndex,o=this.context.fieldKey,r=(null==(e=this.parent)?void 0:e.context.fieldPathArray)||[],i=!!this.context.flowSettingsEnabled&&!!this.props.hidden&&!this.hidden&&!this.forbidden,a=null!=n||i?(()=>{let e=i?`${this.uid}:config-visible`:`${o}`,t=l.createFork({},e);if(null!=n){t.context.defineProperty("fieldIndex",{get:()=>n}),t.context.defineProperty("fieldKey",{get:()=>o}),this.context.currentObject&&t.context.defineProperty("currentObject",{get:()=>this.context.currentObject});let e=this.context.getPropertyOptions("item");if(this.context.item){let{value:l,...n}=e||{};t.context.defineProperty("item",{...n,get:()=>this.context.item,cache:!1})}this.context.pattern&&t.context.defineProperty("pattern",{get:()=>this.context.pattern})}return t.context.defineProperty("fieldPathArray",{get:()=>this.context.fieldPathArray,cache:!1}),i&&t.setProps({hidden:!1}),t})():l,{initialValue:s,hidden:d,...u}=this.context.pattern?{...this.props,pattern:this.context.pattern}:this.props,c=i?u:{hidden:d,...u},p=dJ(this.props.name,n);this.context.defineProperty("fieldPathArray",{get:()=>[...r,...W().castArray(p)],cache:!1});let m=(null==(t=this.context.item)?void 0:t.value)||this.context.record,h=(0,V.jsx)(K.FormItem,{...c,name:p,validateFirst:!0,disabled:this.props.disabled||!W().isEmpty(m)&&!m.__is_new__&&this.props.aclDisabled||!W().isEmpty(m)&&m.__is_new__&&this.props.aclCreateDisabled,children:(0,V.jsx)(K.FieldModelRenderer,{model:a,name:p})});return i?(0,V.jsx)(tM.A,{title:this.context.t("The field is hidden and only visible when the UI Editor is active"),children:(0,V.jsx)("div",{style:{opacity:.3},children:h})}):h}}dQ.define({label:(0,K.tExpr)("Display fields"),searchable:!0,searchPlaceholder:(0,K.tExpr)("Search fields"),sort:100}),dQ.registerFlow({key:"editItemSettings",sort:300,title:(0,K.tExpr)("Form item settings"),steps:{showLabel:{title:(0,K.tExpr)("Show label"),uiMode:{type:"switch",key:"showLabel"},defaultParams:{showLabel:!0},handler(e,t){e.model.setProps({showLabel:t.showLabel})}},label:{title:(0,K.tExpr)("Label"),uiSchema:e=>({label:{"x-component":"Input","x-decorator":"FormItem","x-reactions":t=>{var l;let n=e.model,o=null==(l=n.collectionField)?void 0:l.title;t.decoratorProps={...t.decoratorProps,extra:n.context.t("Original field title: ")+o}}}}),defaultParams:e=>{var t;return{label:null==(t=e.collectionField)?void 0:t.title}},handler(e,t){var l;let n={ns:"lm-flow-engine",compareWith:null==(l=e.collectionField)?void 0:l.title};e.model.setProps({label:e.t(t.label,n)})}},aclCheck:{use:"aclCheck",async handler(e,t){var l,n,o,r,i,a,s,d,u,c,p,m,h;if(!e.collectionField||!e.blockModel)return;let f=e.blockModel.context.actionName,g=await e.aclCheck({dataSourceKey:null==(l=e.dataSource)?void 0:l.key,resourceName:null==(n=e.collectionField)?void 0:n.collectionName,fields:[null==(o=e.collectionField)?void 0:o.name],actionName:f});if("update"===f){let t=await e.aclCheck({dataSourceKey:null==(r=e.dataSource)?void 0:r.key,resourceName:null==(i=e.collectionField)?void 0:i.collectionName,fields:[e.collectionField.name],actionName:"view"});e.prefixFieldPath&&e.item&&(await e.aclCheck({dataSourceKey:null==(s=e.dataSource)?void 0:s.key,resourceName:null==(d=e.collectionField)?void 0:d.collectionName,fields:[e.collectionField.name],actionName:"create"})||e.model.setProps({aclCreateDisabled:!0}));let l=(null==(a=e.item)?void 0:a.__is_new__)??!1;t||l||(e.model.hidden=!0,e.model.forbidden={actionName:"view"},e.exitAll()),g||e.model.setProps({aclDisabled:!0})}else if("create"===f){let t=await e.aclCheck({dataSourceKey:null==(u=e.dataSource)?void 0:u.key,resourceName:null==(c=e.collectionField)?void 0:c.collectionName,actionName:"update"}),l=await e.aclCheck({dataSourceKey:null==(p=e.dataSource)?void 0:p.key,resourceName:null==(m=e.collectionField)?void 0:m.collectionName,fields:[e.collectionField.name],actionName:"update"}),n=(null==(h=e.item)?void 0:h.__is_stored__)??!1;g||n||(e.model.hidden=!0,e.model.forbidden={actionName:f},e.exitAll()),t&&l||e.model.setProps({aclDisabled:!0})}}},init:{async handler(e){let t=e.model.fieldPath,l=t.includes(".")?t.split("."):t;e.model.setProps({name:l})}},tooltip:{title:(0,K.tExpr)("Tooltip"),uiSchema:{tooltip:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({tooltip:e.t(t.tooltip,{ns:"lm-flow-engine"})})}},description:{title:(0,K.tExpr)("Description"),uiSchema:{description:{"x-component":"Input.TextArea","x-decorator":"FormItem","x-component-props":{autoSize:!0}}},handler(e,t){e.model.setProps({extra:e.t(t.description,{ns:"lm-flow-engine"})})}},initialValue:{title:(0,K.tExpr)("Default value"),disabledInSettings:!0,disabledReasonInSettings:e=>`${e.t("This setting has been moved to")}: ${e.t("Form block settings")} > ${e.t("Field values")}`,uiSchema:e=>{var t,l,n,o;if(e.model.parent.parent instanceof dH.EditFormModel||(null==(l=e.model.subModels)||null==(t=l.field)?void 0:t.updateAssociation))return;let r=null==(n=e.model.collectionField)?void 0:n.interface;if(null==dX||null==(o=dX.includes)||!o.call(dX,r))return{defaultValue:{"x-component":"DefaultValue","x-decorator":"FormItem"}}},defaultParams:e=>{let t=e.model.collectionField;if("nanoid"===t.interface&&!1!==t.options.autoFill){let{size:e,customAlphabet:l}=t.options||{size:21};return{defaultValue:(0,dO.d_)(l,e)()}}return{defaultValue:t.defaultValue}},handler(e,t){var l,n;let o=null==(l=e.model.collectionField)?void 0:l.interface;if(null==dX||null==(n=dX.includes)?void 0:n.call(dX,o))return;let r=dY(e.model.collectionField,t.defaultValue);e.model.setProps({initialValue:r})}},validation:{title:(0,K.tExpr)("Validation"),use:"validation"},required:{title:(0,K.tExpr)("Required"),use:"required"},model:{use:"fieldComponent",title:(0,K.tExpr)("Field component")},pattern:{use:"pattern"},titleField:{use:"titleField",hideInSettings:e=>!(e.collectionField&&e.collectionField.isAssociationField()&&e.collectionField.isAssociationField()&&"readPretty"===e.model.getProps().pattern),defaultParams:e=>{var t,l,n;return{titleField:e.model.props.titleField||(null==(n=e.model)||null==(l=n.context)||null==(t=l.collectionField)?void 0:t.targetCollectionTitleFieldName)}},beforeParamsSave:async(e,t,l)=>{if(!(e.collectionField.isAssociationField()&&"readPretty"===e.model.getProps().pattern))return null;let n=t.titleField||t.label;if(n!==l.titleField){let t=e.collectionField.targetCollection,l=t.getField(n),o=dW.getDefaultBindingByField(e,l);if(o.modelName!==e.model.subModels.field.use){let l=e.model.subModels.field.uid;await e.engine.destroyModel(l);let r=e.model.setSubModel("field",{use:o.modelName,stepParams:{fieldSettings:{init:{dataSourceKey:e.model.collectionField.dataSourceKey,collectionName:t.name,fieldPath:n}}}});await r.save()}e.model.setProps(e.collectionField.targetCollection.getField(n).getComponentProps())}},async handler(e,t){"readPretty"===e.model.props.pattern?e.model.setProps({titleField:null==t?void 0:t.label}):e.model.setProps({titleField:t.titleField})}}}}),dQ.registerFlow({key:"paginationChange",on:"paginationChange",steps:{aclCheckRefresh:{use:"aclCheckRefresh",defaultParams:{strategy:"formItem"}}}});var dZ=l(85352),d0=l(90199);function d1(e,t){var l,n,o;let r=null==e||null==(l=e.props)?void 0:l.fieldNames,i=null==e||null==(n=e.props)?void 0:n.titleField,a=null==e||null==(o=e.getStepParams)?void 0:o.call(e,"selectSettings","fieldNames");return{stepParams:{fieldSettings:{init:t},...a?{selectSettings:{fieldNames:a}}:{}},props:{...void 0!==r?{fieldNames:r}:{},...void 0!==i?{titleField:i}:{}}}}function d2(e){try{return JSON.stringify(e)??""}catch{return String(e)}}function d8(e){var t,l,n;let o=null==e||null==(t=e.props)?void 0:t.fieldNames,r=null==e||null==(l=e.props)?void 0:l.titleField,i=null==e||null==(n=e.getStepParams)?void 0:n.call(e,"selectSettings","fieldNames");return[(null==e?void 0:e.uid)||"",d2(o),d2(r),d2(i)].join("|")}class d5 extends dQ{onInit(e){var t,l,n,o,r,i,a;let s=null==(t=this.getStepParams("fieldSettings","assignValue"))?void 0:t.value;void 0!==s&&(this.assignValue=s),this.context.defineProperty("collectionField",{get:()=>{var e,t;let l=this.getStepParams("fieldSettings","init")||{},n=`${null==l?void 0:l.dataSourceKey}.${null==l?void 0:l.collectionName}.${null==l?void 0:l.fieldPath}`,o=null==(e=this.context)?void 0:e.dataSourceManager;return null==o||null==(t=o.getCollectionField)?void 0:t.call(o,n)}});let d=this.context,u=null==d?void 0:d.collection,c=this.fieldInit;if(!(null==(l=this.subModels)?void 0:l.field)&&(null==u?void 0:u.getFields)){let e=(u.getFields()||[]).find(e=>(null==e?void 0:e.name)===(null==c?void 0:c.fieldPath));null==u||null==(o=u.getField)||o.call(u,null==c?void 0:c.fieldPath);let t=K.EditableItemModel.getDefaultBindingByField(d,e);if(!t)return;let l=t.modelName;null==d||null==(i=d.engine)||null==(r=i.createModel)||r.call(i,{use:l,stepParams:{fieldSettings:{init:c}},parentId:this.uid,subKey:"field"})}let p=null==(n=this.context)?void 0:n.collection,m=this.fieldPath;if(m){let e=null==p||null==(a=p.getField)?void 0:a.call(p,m),t=(null==e?void 0:e.title)||m,l=m.includes(".")?m.split("."):[m];this.setProps({label:t,name:l})}}get fieldInit(){return this.getStepParams("fieldSettings","init")||{}}get fieldPath(){var e;return null==(e=this.fieldInit)?void 0:e.fieldPath}getAssignedEntry(){let e=this.fieldPath;return e?[e,this.assignValue]:null}render(){var e,t;let l=this.context,n=l.collection,o=this.fieldInit,r=(null==(e=this.props)?void 0:e.name)||(this.fieldPath?[this.fieldPath]:void 0),i=this.fieldPath,a=null==(t=this.subModels)?void 0:t.field,s=d8(a),d=()=>{var e,t,s;let[d,u]=H.useState(null);H.useEffect(()=>{var e,t,r,s,d,c,p,m,h,f,g,v,y,x,b,S,w,C,F,k,A;if(!i)return;let P=((null==n||null==(e=n.getFields)?void 0:e.call(n))||[]).find(e=>(null==e?void 0:e.name)===i);n.getField(i);let j=K.EditableItemModel.getDefaultBindingByField(l,P);if(!j)return;let M=j.modelName,I=d1(a,o),T=null==l||null==(r=l.engine)||null==(t=r.createModel)?void 0:t.call(r,{use:"VariableFieldFormModel",subModels:{fields:[{use:M,...I}]}});if(!T)return;null==(d=T.context)||null==(s=d.defineProperty)||s.call(d,"collection",{value:n});let R=null==l?void 0:l.dataSource;R&&(null==(p=T.context)||null==(c=p.defineProperty)||c.call(p,"dataSource",{value:R}));let E=null==n||null==(m=n.getField)?void 0:m.call(n,null==o?void 0:o.fieldPath);E&&(null==(f=T.context)||null==(h=f.defineProperty)||h.call(f,"collectionField",{value:E}));let N=null==l?void 0:l.blockModel;N&&(null==(v=T.context)||null==(g=v.defineProperty)||g.call(v,"blockModel",{value:N}));let D=l.form;D&&(null==(k=T.context)||null==(F=k.defineProperty)||F.call(k,"form",{value:D})),T.context&&Object.defineProperty(T.context,"resource",{configurable:!0,enumerable:!0,get:()=>null==N?void 0:N.resource});let B=null==T||null==(x=T.subModels)||null==(y=x.fields)?void 0:y[0],$=null==n||null==(b=n.getField)?void 0:b.call(n,null==o?void 0:o.fieldPath),O=null==$?void 0:$.type,q=null==$?void 0:$.interface,_="belongsToMany"===O||"hasMany"===O||"belongsToArray"===O||"m2m"===q||"o2m"===q||"mbm"===q;if(null==B||null==(S=B.setProps)||S.call(B,{disabled:!1,readPretty:!1,pattern:"editable",updateAssociation:!1,multiple:_}),null==B||null==(w=B.dispatchEvent)||w.call(B,"beforeRender",void 0,{sequential:!0,useCache:!0}),(0,dZ.NI)(B,$),!(null==B||null==(C=B.props)?void 0:C.fieldNames)&&(null==$?void 0:$.targetCollection)){let e=$.targetCollection,t=(null==$?void 0:$.targetKey)||(null==e?void 0:e.filterTargetKey)||"id";null==B||null==(A=B.setProps)||A.call(B,{fieldNames:{label:null==e?void 0:e.titleField,value:t}})}return u(T),()=>{var e,t,l,n;null==T||null==(l=T.subModels)||null==(t=l.fields)||null==(e=t.forEach)||e.call(t,e=>{var t;return null==e||null==(t=e.remove)?void 0:t.call(e)}),null==T||null==(n=T.remove)||n.call(T)}},[]);let c=e=>(H.useEffect(()=>{var t,l,n,o;if(!d)return;null==(t=d.setProps)||t.call(d,{...e});let r=null==d||null==(n=d.subModels)||null==(l=n.fields)?void 0:l[0];r&&(null==(o=r.setProps)||o.call(r,{value:null==e?void 0:e.value,onChange:function(){for(var t,l=arguments.length,n=Array(l),o=0;o<l;o++)n[o]=arguments[o];let r=n&&n.length?n[0]:void 0;null==e||null==(t=e.onChange)||t.call(e,r)}}))},[e]),d?(0,V.jsx)("div",{style:{width:"100%"},children:(0,V.jsx)(K.FlowModelRenderer,{model:d,showFlowSettings:!1})}):null),p=()=>(0,V.jsx)(st.A,{placeholder:"<Null>",readOnly:!0,style:{width:"100%"}}),m=e=>(0,V.jsx)(d0.h,{t:this.context.t,value:null==e?void 0:e.value,onChange:null==e?void 0:e.onChange,containerStyle:{width:"100%"}}),h={renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?c:"null"===l?p:"runjs"===l?m:void 0},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:"runjs"===l?{code:"",version:"v2"}:void 0},resolvePathFromValue:e=>null===e?["null"]:(0,K.isRunJSValue)(e)?["runjs"]:(0,K.isVariableExpression)(e)?(0,K.parseValueToPath)(e):["constant"]},f=async()=>{var e;let t=null==(e=this.context)?void 0:e.getPropertyMetaTree,l="function"==typeof t?await t():[];return[{title:(0,K.tExpr)("Constant"),name:"constant",type:"string",paths:["constant"],render:c},{title:(0,K.tExpr)("Null"),name:"null",type:"object",paths:["null"],render:p},{title:(0,K.tExpr)("RunJS"),name:"runjs",type:"object",paths:["runjs"],render:m},...l]},g=(null==(e=this.props)?void 0:e.label)??this.fieldPath??"",v=null==n||null==(t=n.getField)?void 0:t.call(n,this.fieldPath);return g=(null==(s=this.props)?void 0:s.label)??(null==v?void 0:v.title)??g,(0,V.jsx)(K.FormItem,{...this.props,label:g,name:r,initialValue:this.assignValue,valuePropName:"__assign_value__",trigger:"__assign_trigger__",validateTrigger:"__assign_trigger__",children:H.createElement(e=>{let t=null==e?void 0:e.__assign_value__,l=void 0===t?this.assignValue:t;return(0,V.jsx)(K.VariableInput,{value:l,onChange:t=>{var l;this.assignValue=t,null==e||null==(l=e.__assign_trigger__)||l.call(e,t)},metaTree:f,converters:h,clearValue:""})})})};return(0,V.jsx)(d,{},s)}constructor(e){super(e),this.assignValue=void 0,(0,z.define)(this,{assignValue:z.observable})}}d5.define({label:(0,K.tExpr)("Assign field")}),d5.registerFlow({key:"editItemSettings",sort:300,title:(0,K.tExpr)("Form item settings"),steps:{showLabel:{title:(0,K.tExpr)("Show label"),uiMode:{type:"switch",key:"showLabel"},defaultParams:{showLabel:!0},handler(e,t){e.model.setProps({showLabel:t.showLabel})}},label:{title:(0,K.tExpr)("Label"),uiSchema:e=>({label:{"x-component":"Input","x-decorator":"FormItem","x-reactions":t=>{var l;let n=e.model,o=null==(l=n.collectionField)?void 0:l.title;t.decoratorProps={...t.decoratorProps,extra:n.context.t("Original field title: ")+o}}}}),defaultParams:e=>({label:e.model.collectionField.title}),handler(e,t){var l;t.label&&t.label===(null==(l=e.model.collectionField)?void 0:l.title)?e.model.setProps({label:t.label}):e.model.setProps({label:e.t(t.label,{ns:"lm-flow-engine"})})}},init:{async handler(e){let t=e.model.collectionField;t&&e.model.setProps(t.getComponentProps());let l=e.model.fieldPath,n=l.includes(".")?l.split("."):l;e.model.setProps({name:n})}},tooltip:{title:(0,K.tExpr)("Tooltip"),uiSchema:{tooltip:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({tooltip:e.t(t.tooltip,{ns:"lm-flow-engine"})})}},description:{title:(0,K.tExpr)("Description"),uiSchema:{description:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({extra:e.t(t.description,{ns:"lm-flow-engine"})})}},validation:{title:(0,K.tExpr)("Validation"),use:"validation"},required:{title:(0,K.tExpr)("Required"),use:"required"}}});class d4 extends aH{}d4.itemModelName="DetailsItemModel",d4.define({label:'{{t("Display association fields")}}'});var d3=l(58929);let d6=e=>{if(!e)return 0;let t=e.getBoundingClientRect(),l=window.getComputedStyle(e),n=parseFloat(l.marginTop)||0,o=parseFloat(l.marginBottom)||0;return t.height+n+o},d9=e=>{let{heightMode:t,containerRef:l,actionsRef:n,paginationRef:o,deps:r=[]}=e,[i,a]=(0,H.useState)(),s=(0,H.useCallback)(()=>{if("specifyValue"!==t&&"fullHeight"!==t)return void a(e=>void 0===e?e:void 0);let e=l.current;if(!e)return;let r=e.getBoundingClientRect().height;if(!r)return;let i=Math.max(0,Math.floor(r-d6(n.current)-d6(o.current)));a(e=>e===i?e:i)},[t,l,n,o]);return(0,H.useLayoutEffect)(()=>{s()},[s,...r]),(0,H.useEffect)(()=>{if(!l.current||"u"<typeof ResizeObserver)return;let e=l.current,t=n.current,r=o.current,i=new ResizeObserver(()=>s());return i.observe(e),t&&i.observe(t),r&&i.observe(r),()=>i.disconnect()},[s,l,n,o,...r]),i};class d7 extends sv.t{createResource(e,t){var l,n;if((null==(l=this.association)?void 0:l.type)==="hasOne"||(null==(n=this.association)?void 0:n.type)==="belongsTo"||Object.keys(t).includes("filterByTk")){let e=this.context.createResource(K.SingleRecordResource);return e.isNewRecord=!1,e}let o=this.context.createResource(K.MultiRecordResource);return o.setPageSize(1),o}onInit(e){var t,l;super.onInit(e),this.hadSingleRecordData=(null==(l=this.resource)||null==(t=l.hasData)?void 0:t.call(l))??!1,this.hasMultiRefreshDispatched=!1;let n=(0,K.createCurrentRecordMetaFactory)(this.context,()=>this.collection);this.context.defineProperty("record",{get:()=>this.getCurrentRecord(),cache:!1,resolveOnServer:(0,K.createRecordResolveOnServerWithLocal)(()=>this.collection,()=>this.getCurrentRecord()),meta:n}),this.resource.on("refresh",()=>{var e,t;if(this.isMultiRecordResource()){this.hasMultiRefreshDispatched=!0,(0,dg.Xi)(this,"paginationChange");return}let l=this.hadSingleRecordData;this.hadSingleRecordData=(null==(t=this.resource)||null==(e=t.hasData)?void 0:e.call(t))??!1,l&&(0,dg.Xi)(this,"paginationChange")})}isMultiRecordResource(){return this.resource instanceof K.MultiRecordResource}hasDispatchedMultiRefresh(){return this.hasMultiRefreshDispatched}getCurrentRecord(){let e=this.resource.getData();return Array.isArray(e)?e[0]:e}hasAvailableData(){return this.resource.hasData()}async refresh(){await this.resource.refresh()}renderPagination(){if(!this.resource.loading&&!this.hasAvailableData()){var e,t;return(0,V.jsx)("div",{style:{textAlign:"center",color:null==(t=this.context)||null==(e=t.themeToken)?void 0:e.colorTextDescription},children:this.translate("No available data currently")})}let l=this.resource;return!this.isMultiRecordResource()||!l.getPage()||1>=this.resource.getMeta("count")?null:(0,V.jsx)("div",{style:{textAlign:"center"},children:(0,V.jsx)(d3.A,{simple:!0,pageSize:1,showSizeChanger:!1,defaultCurrent:l.getPage(),total:l.getTotalPage(),onChange:this.handlePageChange,style:{display:"inline-block"}})})}renderConfigureActions(){return(0,V.jsx)(K.AddSubModelButton,{model:this,subModelKey:"actions",subModelBaseClass:this.getModelClassName("RecordActionGroupModel"),afterSubModelInit:async e=>{e.setStepParams("buttonSettings","general",{type:"default"})},children:(0,V.jsx)(K.FlowSettingsButton,{icon:(0,V.jsx)(nF.A,{}),children:this.translate("Actions")})},"details-actions-add")}renderComponent(){let{colon:e,labelAlign:t,labelWidth:l,labelWrap:n,layout:o}=this.props,r=!!this.context.flowSettingsEnabled,i=!r&&!this.hasAvailableData(),{heightMode:a,height:s}=this.decoratorProps;return(0,V.jsx)(ue,{model:this,gridModel:this.subModels.grid,isConfigMode:r,heightMode:a,height:s,layoutProps:{colon:e,labelAlign:t,labelWidth:l,labelWrap:n,layout:o},actions:(0,V.jsx)(K.DndProvider,{children:(0,V.jsx)("div",{style:i?{pointerEvents:"none",opacity:.45}:void 0,children:(0,V.jsxs)(a5.A,{wrap:!0,children:[this.mapSubModels("actions",e=>{if(!e.hidden||r)return(0,V.jsx)(K.Droppable,{model:e,children:(0,V.jsx)(K.FlowModelRenderer,{model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:K.DragHandler,sort:1}]})},e.uid)}),this.renderConfigureActions()]})})})})}constructor(...e){super(...e),this.hadSingleRecordData=!1,this.hasMultiRefreshDispatched=!1,this._defaultCustomModelClasses={RecordActionGroupModel:"RecordActionGroupModel",DetailsItemModel:"DetailsItemModel",DetailsAssociationFieldGroupModel:"DetailsAssociationFieldGroupModel",DetailsCustomItemModel:"DetailsCustomItemModel"},this.customModelClasses={},this.handlePageChange=async e=>{if(this.resource instanceof K.MultiRecordResource){let t=this.resource;t.setPage(e),t.loading=!0,await this.refresh()}}}}d7.scene=sf.P.oam;let ue=e=>{let{model:t,gridModel:l,isConfigMode:n,heightMode:o,height:r,layoutProps:i,actions:a}=e,s=(0,H.useRef)(null),d=(0,H.useRef)(null),u=(0,H.useRef)(null),c="specifyValue"===o||"fullHeight"===o,p=d9({heightMode:o,containerRef:s,actionsRef:d,paginationRef:u,deps:[r]});(0,H.useEffect)(()=>{var e,t;if(!l)return;let n=c?p:void 0;((null==(e=l.props)?void 0:e.height)!==n||(null==(t=l.props)?void 0:t.heightMode)!==o)&&l.setProps({height:n,heightMode:o})},[l,p,c,o]);let m=c?{display:"flex",flexDirection:"column",minHeight:0,height:"100%"}:void 0,h=c?{display:"flex",flexDirection:"column",minHeight:0,flex:1}:void 0;return(0,V.jsx)(dN.s2,{model:t,layoutProps:i,style:m,children:(0,V.jsxs)("div",{ref:s,style:h,children:[(0,V.jsx)("div",{ref:d,style:{textAlign:"right",lineHeight:"0px",paddingBottom:n&&t.context.themeToken.padding},children:a}),(0,V.jsx)(K.FlowModelRenderer,{model:l,showFlowSettings:!1},`${(null==l?void 0:l.uid)||"details-grid"}:${n?"design":"runtime"}`),(0,V.jsx)("div",{ref:u,children:t.renderPagination()})]})})};d7.registerFlow({key:"detailsSettings",title:(0,K.tExpr)("Details settings"),sort:150,steps:{refresh:{async handler(e){if(!e.resource)throw Error("Resource is not initialized");await e.model.applySubModelsBeforeRenderFlows("grid")}},layout:{use:"layout",title:(0,K.tExpr)("Layout")},dataScope:{use:"dataScope"},defaultSorting:{use:"sortingRule",title:(0,K.tExpr)("Default sorting")},linkageRules:{use:"detailsFieldLinkageRules"}}}),d7.registerFlow({key:"paginationChange",on:"paginationChange",steps:{blockLinkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"blockLinkageRules",flowKey:"cardSettings",stepKey:"linkageRules"}},fieldslinkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"detailsFieldLinkageRules",flowKey:"detailsSettings",stepKey:"linkageRules"}}}}),d7.registerFlow({key:"initialPaginationChangeRefresh",sort:10001,steps:{refreshPaginationRelatedStates:{async handler(e){if(e.model.hidden||!e.model.isMultiRecordResource()||e.model.hasDispatchedMultiRefresh())return;let t=e.model.resource;if(!t)return;let l="manual"===(t.dataLoadingMode??t.loadingMode),n="function"==typeof t.hasActiveFilters&&t.hasActiveFilters();l&&!n&&await (0,dg.Xi)(e.model,"paginationChange")}}}}),d7.define({label:(0,K.tExpr)("Details"),searchable:!0,searchPlaceholder:(0,K.tExpr)("Search"),createModelOptions:{use:"DetailsBlockModel",subModels:{grid:{use:"DetailsGridModel"}}},sort:350});class ut extends K.FlowModel{static defineChildren(e){let t=e.engine.filterModelClassByParent("CommonItemModel"),l=e.engine.filterModelClassByParent("DetailsCustomItemModel"),n=t=>Array.from(t.entries()).map(t=>{var l,n,o,r,i;let[a,s]=t,d="function"==typeof s.defineChildren||!!(null==(l=s.meta)?void 0:l.children),u={key:a,label:e.t(s.meta.label),sort:s.meta.sort??999,searchable:!!(null==(n=s.meta)?void 0:n.searchable),searchPlaceholder:null==(o=s.meta)?void 0:o.searchPlaceholder,hide:null==(r=s.meta)?void 0:r.hide};return d?u.children=e=>{var t;return"function"==typeof s.defineChildren?s.defineChildren(e):(null==(t=s.meta)?void 0:t.children)||[]}:u.createModelOptions=(null==(i=s.meta)?void 0:i.createModelOptions)||{use:a},u});return W().sortBy([...n(t),...n(l)],"sort")}}ut.renderMode=K.ModelRenderMode.RenderFunction,ut.define({hide:!0,label:(0,K.tExpr)("Others")});class ul extends ss{renderAddSubModelButton(){return this.context.flowSettingsEnabled?(0,V.jsx)(K.AddSubModelButton,{model:this,subModelKey:"items",subModelBaseClasses:[this.context.getModelClassName("DetailsItemModel"),this.context.getModelClassName("DetailsAssociationFieldGroupModel"),this.context.getModelClassName("DetailsCustomItemModel")].filter(Boolean),keepDropdownOpen:!0,children:(0,V.jsx)(K.FlowSettingsButton,{icon:(0,V.jsx)(nF.A,{}),children:this.translate("Fields")})}):null}render(){var e,t;let l=null==(e=this.props)?void 0:e.height,n=null==(t=this.props)?void 0:t.heightMode,o=this.context.themeToken,r=super.render();return"defaultHeight"===n?r:(0,V.jsx)("div",{style:{height:l,overflowY:"auto",marginLeft:`-${o.marginLG}px`,marginRight:`-${o.marginLG}px`,paddingLeft:`${o.marginLG}px`,paddingRight:`${o.marginLG}px`},children:r})}constructor(...e){super(...e),this.itemFallback=(0,V.jsx)(oQ.A.Input,{block:!0,size:"small",style:{marginBottom:"0.5rem"}}),this.itemSettingsMenuLevel=2,this.itemFlowSettings={showBackground:!0,style:{top:-6,left:-6,right:-6,bottom:-6}},this.dragOverlayConfig={columnInsert:{before:{offsetTop:-6,height:24},after:{offsetTop:3,height:24}},columnEdge:{left:{offsetLeft:-5,width:24},right:{offsetLeft:8,width:24}},rowGap:{above:{offsetTop:-2,height:24},below:{offsetTop:-12,height:24}}}}}function un(e,t){let{fieldUseModel:l,refreshTargets:n}=t,o=e=>Array.isArray(e)?e.map(e=>{let t={...e};if(t.children)if("function"==typeof t.children){let e=t.children;t.children=async t=>o(await e(t))}else Array.isArray(t.children)&&(t.children=o(t.children));if(t.createModelOptions){let e=t.createModelOptions;t.createModelOptions=async(t,n)=>{let o=await ("function"==typeof e?e(t,n):e);return o.subModels=o.subModels||{},o.subModels.field={...o.subModels.field||{},use:l},o},t.refreshTargets=t.refreshTargets||n}return t}):[];return o(e)}function uo(e,t,l){let{fieldUseModel:n,refreshTargets:o}=l,r=l.key??"js-association-fields",i=l.label??(0,K.tExpr)("Display association fields");return{key:r,type:"group",label:i,searchable:l.searchable??!0,searchPlaceholder:l.searchPlaceholder??(0,K.tExpr)("Search fields"),children:async e=>un(await t(e),{fieldUseModel:n,refreshTargets:o})}}ul.registerFlow({key:"detailFieldGridSettings",steps:{grid:{handler(e,t){e.model.setProps("rowGap",0),e.model.setProps("colGap",16)}}}});class ur extends aH{}async function ui(e,t){var l;let{useModel:n,fieldUseModel:o,refreshTargets:r,associationPathName:i,associationProvider:a}=t,s=(0,K.buildWrapperFieldChildren)(e,{useModel:n,fieldUseModel:o,associationPathName:i,refreshTargets:r}),d=[],u=null==s||null==(l=s[0])?void 0:l.children;if(Array.isArray(u)&&(d=u),!a)return d;let c=await a(e);return Array.isArray(c)&&0!==c.length?[...d,uo(e,a,{fieldUseModel:o,refreshTargets:r})]:d}ur.itemModelName="FormItemModel";class ua extends ut{static defineChildren(e){return ui(e,{useModel:"DetailsItemModel",fieldUseModel:"JSFieldModel",refreshTargets:["DetailsItemModel"],associationProvider:e=>d4.defineChildren(e)})}}ua.define({label:(0,K.tExpr)("JS field"),searchable:!0,searchPlaceholder:(0,K.tExpr)("Search fields"),sort:110});class us extends sb.o{}var ud=l(85196);class uu extends sb.o{constructor(...e){super(...e),this.operator="$eq",this.updateAssociation=!0}}uu.registerFlow({key:"AssociationFieldInit",sort:800,steps:{init:{async handler(e,t){if(e.model.updateAssociation){var l,n;let t=e.model.context.blockModel,o=null==t||null==(l=t.context)?void 0:l.resource,r=null==(n=e.model.parent)?void 0:n.fieldPath;o&&r&&o.addUpdateAssociationValues(r)}}},allowCreateCheck:{async handler(e){var t;let l=await e.aclCheck({dataSourceKey:e.collectionField.dataSourceKey,resourceName:null==(t=e.collectionField)?void 0:t.target,actionName:"create"});e.model.setProps({allowCreate:!!l})}}}});let uc=(e,t)=>e===t,up=e=>{if(e&&"object"==typeof e){let t=e.data;return t&&"object"==typeof t?t:e}};function um(e){return"string"==typeof e&&e?e:Array.isArray(e)&&1===e.length&&"string"==typeof e[0]?e[0]:void 0}function uh(e,t){var l;let n="string"==typeof(null==t||null==(l=t.titleCollectionField)?void 0:l.name)?t.titleCollectionField.name:void 0,o=um(null==t?void 0:t.filterTargetKey)||"id",r="string"==typeof(null==e?void 0:e.value)&&e.value&&!uc(e.value,"value")?e.value:void 0,i="string"==typeof(null==e?void 0:e.label)&&e.label&&!uc(e.label,"label")?e.label:void 0,a=r||o;return{label:i||n||a,value:a}}function uf(e){var t,l,n,o,r,i;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=!!a.navigation,d=e=>{if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&!!e)},u=d(null==(l=e.view)||null==(t=l.inputArgs)?void 0:t.openerUids),c=d(a.openerUids),p=u||c||[];if(s)return(c||p).filter(Boolean);let m=null==(o=e.view)||null==(n=o.inputArgs)?void 0:n.viewUid,h=null==(i=e.model.context)||null==(r=i.inputArgs)?void 0:r.viewUid;return[...p,"string"==typeof m&&m?m:"string"==typeof h&&h?h:e.model.uid].filter(Boolean)}function ug(e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(Array.isArray(e)){let t=e.map(e=>{if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(e&&"object"==typeof e){let t=e.label??e.name;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return t}}).filter(e=>void 0!==e);return t.length?t.map(String).join(", "):void 0}if(e&&"object"==typeof e){let t=e.label??e.name;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return t}}function uv(e){var t,l,n;let{option:o,fieldNames:r}=e,i=(0,K.useFlowModel)(),a=up(o),s=uh(r,null==(t=i.context.collectionField)?void 0:t.targetCollection),d=i.subModels.field,u=ug(null==a?void 0:a[s.label])??ug(null==a?void 0:a.label)??ug(null==a?void 0:a[s.value]);if(!d)return(0,V.jsx)("span",{children:u??"N/A"});let c=String((null==a?void 0:a[s.value])??u??"association-option"),p=d.createFork({},c);p.context.defineProperty("record",{get:()=>a,cache:!1,meta:(0,K.createCurrentRecordMetaFactory)(p.context,()=>p.context.collection)});let m=null==(n=i.context.collectionField.targetCollection)||null==(l=n.getField)?void 0:l.call(n,s.label),h=m&&"function"==typeof m.getComponentProps?m.getComponentProps():{};p.setProps({value:u,clickToOpen:!1,...h});let f=null!=u&&""!==u?p.render():"N/A";return(0,V.jsx)("span",{style:{pointerEvents:"none"},children:f})}function uy(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"record",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!e)return l?[]:void 0;let{value:r}=t||{},i=e=>"object"==typeof e&&null!==e,a=e=>{if(i(e))return{label:(0,V.jsx)(uv,{option:e,fieldNames:t}),value:e[r]}};if("value"===n){let t=e=>{if("object"==typeof e&&null!==e)return a(e);let t=o.find(t=>(null==t?void 0:t[r])===e);return t?a(t):{label:String(e),value:e}};return l?Array.isArray(e)?e.map(e=>t(e)).filter(Boolean):[]:Array.isArray(e)?t(e[0]):t(e)}if(l)return Array.isArray(e)?e.filter(i).map(a).filter(Boolean):[];if(Array.isArray(e)){let t=e[0];return i(t)?a(t):void 0}return i(e)?a(e):void 0}function ux(e,t,l){return(null==e?void 0:e.length)?e.map(e=>(0,U.omit)(e,"disabled","options","style")):l?Array.isArray(t)?t.filter(e=>"object"==typeof e&&null!==e):[]:t&&"object"==typeof t?[t]:[]}var ub=l(33022);let uS=(0,C.css)`
|
|
403
|
+
`},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":ac.n,"x-component-props":{rows:1}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}},properties:{add:{type:"void",title:'{{t("Add parameter")}}',"x-component":"ArrayItems.Addition"}}},openInNewWindow:{type:"boolean","x-content":t("Open in new window"),"x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}}}},handler(e,t){e.model.setProps({url:t.url,searchParams:t.searchParams,openInNewWindow:t.openInNewWindow})}}}});class dM extends aW.S0{setTitle(e){this.setProps({title:e})}setExpandFlag(e){this.expandFlag=e}getTitle(){return this.expandFlag?this.context.t("Collapse all"):this.context.t("Expand all")}getIcon(){return this.expandFlag?"NodeCollapseOutlined":"NodeExpandOutlined"}constructor(...e){super(...e),this.defaultProps={type:"default",icon:"DownOutlined"}}}function dI(e){let{idKey:t="id",childrenKey:l="children"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];function o(e){if(Array.isArray(e))for(let r of e){let e=r[l];n.push(r[t]),Array.isArray(e)&&e.length>0&&o(e)}}return o(e),n}dM.scene=aW.s5.collection;let dT=e=>dI(e);dM.registerFlow({key:"expandCollapseSettingsInit",sort:200,steps:{init:{handler(e,t){e.blockModel.props.defaultExpandAllRows?e.model.setExpandFlag(!0):e.model.setExpandFlag(!1)}}}}),dM.registerFlow({key:"expandCollapseSettings",on:"click",steps:{expandCollapse:{async handler(e,t){var l;if(!(null==(l=e.blockModel)?void 0:l.resource))return;let n=e.blockModel.resource,{treeTable:o}=e.blockModel.props;if(o)if(e.model.expandFlag)e.blockModel.setProps({expandedRowKeys:[]}),e.model.setExpandFlag(!1);else{let t=dT(n.getData());e.blockModel.setProps({expandedRowKeys:t}),e.model.setExpandFlag(!0)}}}}}),dM.define({label:(0,K.escapeT)("Expand/Collapse"),hide(e){var t;return(null==(t=e.collection)?void 0:t.template)!=="tree"||!1===e.model.props.treeTable}});class dR extends s_{getAclActionName(){return"create"}onInit(e){super.onInit(e),this.context.defineProperty("association",{get:()=>this.context.blockModel.dataSource.getAssociation(`${this.context.blockModel.collection.name}.children`)})}constructor(...e){super(...e),this.defaultProps={type:"link",title:(0,K.tExpr)("Add child"),icon:"PlusOutlined"}}}dR.capabilityActionName=null,dR.registerFlow({key:"addChildSettingsInit",steps:{addChildInit:{async handler(e,t){e.model.onClick=t=>{e.model.dispatchEvent("click",{event:t,...e.inputArgs,sourceId:e.record.id,filterByTk:null},{debounce:!0})}}}}}),dR.define({label:(0,K.tExpr)("Add child"),hide(e){var t;return(null==(t=e.collection)?void 0:t.template)!=="tree"||!1===e.blockModel.props.treeTable}}),aU.registerActionModels({AddChildActionModel:dR});var dE=l(89013),dN=l(96491);class dD extends dN.F4{useHooksBeforeRender(){let[e]=dE.A.useForm();this.context.defineProperty("form",{get:()=>e})}onInit(e){super.onInit(e);let t=(0,K.createCurrentRecordMetaFactory)(this.context,()=>this.collection);this.context.defineProperty("record",{get:()=>{var e,t;return null==(e=(t=this).getCurrentRecord)?void 0:e.call(t)},cache:!1,resolveOnServer:(0,K.createRecordResolveOnServerWithLocal)(()=>this.collection,()=>{var e,t;return null==(e=(t=this).getCurrentRecord)?void 0:e.call(t)}),meta:t}),this.context.defineProperty("filterManager",{once:!0,get:()=>new a8(this,null==e?void 0:e.filterManager)}),this.isManualRefresh=!0}createResource(e,t){let l=this.context.createResource(K.SingleRecordResource);return l.isNewRecord=!0,l}renderComponent(){var e;let{colon:t,labelAlign:l,labelWidth:n,labelWrap:o,layout:r}=this.props;return(0,V.jsx)(dN.s2,{model:this,layoutProps:{colon:t,labelAlign:l,labelWidth:n,labelWrap:o,layout:r},children:(0,V.jsx)(K.FlowModelRenderer,{model:null==(e=this.subModels)?void 0:e.grid,showFlowSettings:!1})})}setInitialAssignedValues(e){var t;let l=null==(t=this.subModels)?void 0:t.grid;Object.entries(e||{}).forEach(e=>{let[t,n]=e;l.addOrEnsureItem(t,n)})}getAssignedValues(){return this.subModels.grid.getAssignedValues()||{}}}dD.define({label:(0,K.tExpr)("Field assignments"),hide:!0,createModelOptions:{use:"AssignFormModel",subModels:{grid:{use:"AssignFormGridModel"}}}});class dB extends ss{renderAddSubModelButton(){return(0,V.jsx)(K.AddSubModelButton,{subModelKey:"items",subModelBaseClasses:[this.context.getModelClassName("FormItemModel"),this.context.getModelClassName("FormAssociationFieldGroupModel"),this.context.getModelClassName("FormCustomItemModel"),this.context.getModelClassName("FormJSFieldItemModel")].filter(Boolean),model:this,keepDropdownOpen:!0,children:(0,V.jsx)(K.FlowSettingsButton,{icon:(0,V.jsx)(nF.A,{}),children:this.translate("Fields")})})}render(){var e,t;let l=null==(e=this.props)?void 0:e.height,n=null==(t=this.props)?void 0:t.heightModel,o=this.context.themeToken,r=super.render();return"defaultHeight"===n?r:(0,V.jsx)("div",{style:{height:l,overflowY:"auto",marginLeft:`-${o.marginLG}px`,marginRight:`-${o.marginLG}px`,paddingLeft:`${o.marginLG}px`,paddingRight:`${o.marginLG}px`,paddingTop:5},children:r})}constructor(...e){super(...e),this.itemFallback=(0,V.jsx)(oQ.A.Input,{block:!0,size:"small",style:{marginBottom:"0.5rem"}}),this.itemSettingsMenuLevel=2,this.itemFlowSettings={showBackground:!0,style:{top:-6,left:-6,right:-6,bottom:-6}},this.dragOverlayConfig={columnInsert:{before:{offsetTop:-6,height:24},after:{offsetTop:3,height:24}},columnEdge:{left:{offsetLeft:-5,width:24},right:{offsetLeft:8,width:24}},rowGap:{above:{offsetTop:-2,height:24},below:{offsetTop:-12,height:24}}}}}dB.registerFlow({key:"formFieldGridSettings",steps:{grid:{handler(e,t){e.model.setProps("rowGap",0),e.model.setProps("colGap",16)}}}});class d$ extends dB{renderAddSubModelButton(){var e,t;let l=null==(e=this.context)?void 0:e.collection,n=(null==l||null==(t=l.getFields)?void 0:t.call(l))||[],o="function"==typeof(null==l?void 0:l.getPrimaryKey)?l.getPrimaryKey():void 0,r=null==l?void 0:l.filterTargetKey,i=e=>!!e&&!!(o&&e===o||"string"==typeof r&&e===r||Array.isArray(r)&&r.includes(e)),a=n.filter(e=>!i(null==e?void 0:e.name)).map(e=>{let t=e.name,n=e.title||e.name,o=K.EditableItemModel.getDefaultBindingByField(this.context,e);if(!o)return;let r=o.modelName;return{key:t,label:n,toggleable:e=>{let l=e.getStepParams("fieldSettings","init")||{};return(null==l?void 0:l.fieldPath)===t},useModel:"AssignFormItemModel",createModelOptions:()=>({use:"AssignFormItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:null==l?void 0:l.dataSourceKey,collectionName:null==l?void 0:l.name,fieldPath:t}}},subModels:{field:{use:r,stepParams:{fieldSettings:{init:{dataSourceKey:null==l?void 0:l.dataSourceKey,collectionName:null==l?void 0:l.name,fieldPath:t}}}}}})}}).filter(Boolean);return(0,V.jsx)(K.AddSubModelButton,{subModelKey:"items",model:this,items:a,keepDropdownOpen:!0,children:(0,V.jsx)(K.FlowSettingsButton,{icon:(0,V.jsx)(nF.A,{}),children:this.translate("Fields")})})}addOrEnsureItem(e,t){var l,n,o;let r=null==(l=this.context)?void 0:l.collection,i=((null==(n=this.subModels)?void 0:n.items)||[]).find(t=>{try{let l="function"==typeof(null==t?void 0:t.getStepParams)?t.getStepParams("fieldSettings","init"):null;return(null==l?void 0:l.fieldPath)===e}catch(e){return!1}});if(i){"function"==typeof(null==i?void 0:i.setStepParams)&&i.setStepParams("fieldSettings","assignValue",{value:t}),i.assignValue=t;return}let a=((null==r||null==(o=r.getFields)?void 0:o.call(r))||[]).find(t=>t.name===e),s=K.EditableItemModel.getDefaultBindingByField(this.context,a);if(!s)return;let d=s.modelName;this.addSubModel("items",{use:"AssignFormItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:null==r?void 0:r.dataSourceKey,collectionName:null==r?void 0:r.name,fieldPath:e},assignValue:{value:t}}},subModels:{field:{use:d,stepParams:{fieldSettings:{init:{dataSourceKey:null==r?void 0:r.dataSourceKey,collectionName:null==r?void 0:r.name,fieldPath:e}}}}}}).assignValue=t}getAssignedValues(){var e;let t=(null==(e=this.subModels)?void 0:e.items)||[],l={};for(let e of t){let t="function"==typeof e.getAssignedEntry?e.getAssignedEntry():null;t&&Array.isArray(t)&&(l[t[0]]=t[1])}return l}}d$.define({label:(0,K.tExpr)("Assign grid")});var dO=l(44329);function dq(e){return"string"==typeof e?e:"function"==typeof e&&e.name?e.name:void 0}function d_(e){var t,l;let n=null==e||null==(l=e.stepParams)||null==(t=l.fieldBinding)?void 0:t.use;return"string"==typeof n?n:void 0}async function dL(e){var t,l,n;let{parentModel:o,targetUse:r,defaultProps:i,pattern:a,fieldSettingsInit:s}=e,d=o.subModels.field,u=null==d?void 0:d.uid,c=null==d||null==(l=d.serialize)||null==(t=l.call(d))?void 0:t.subModels;for(let e in c)!1===c[e].delegateToParent&&delete c[e];let p=dq(d_(d)||(null==d?void 0:d.use))===r&&(null==d?void 0:d.stepParams)||{},m=s??(null==(n=o.getFieldSettingsInitParams)?void 0:n.call(o)),{fieldBinding:h,...f}=p,g={...f,fieldSettings:{...f.fieldSettings||{},init:m}},v=o.flowEngine;u&&(null==d||d.invalidateFlowCache("beforeRender",!0),v.removeModelWithSubModels(u));let y=o.setSubModel("field",{uid:u,use:r,props:{...i||{},...a?{pattern:a}:{}},stepParams:g,subModels:c});await y.dispatchEvent("beforeRender",void 0,{useCache:!1}),await o.save()}var dV=l(13940);function dz(e,t,l){let n=(0,U.castArray)(l).filter(e=>"string"==typeof e),o=t.split(".");if(null==n?void 0:n.length){let t=[],l=0,r=0;for(;l<o.length;){let e=o[l];if(t.push(e),r<n.length){let[l,o]=n[r].split(":");l===e&&(t.push(Number(o)),r++)}l++}return(0,U.get)(e,t)}return(0,U.get)(e,o)}function dK(e){let{record:t,currentObject:l,fieldPath:n,prefixFieldPath:o,idx:r}=e,i=dz(t,n,r);if(void 0!==i||null==l)return i;if(o&&n===o)return l;let a=o&&n.startsWith(`${o}.`)?n.slice(o.length+1):n;return a?(0,U.get)(l,a):l}function dU(e,t){return!(0,dV.E4)(e)||Array.isArray(t)?t:t&&"object"==typeof t&&Array.isArray(t.rows)?t.rows:null==t?[]:[t]}class dW extends K.DisplayItemModel{static defineChildren(e){let t=e.collection;return t.getFields().map(l=>{let n=this.getDefaultBindingByField(e,l,{fallbackToTargetTitleField:!0});if(!n)return null;let o=n.modelName,r=e.prefixFieldPath?`${e.prefixFieldPath}.${l.name}`:l.name;return{key:r,label:l.title,refreshTargets:["DetailsCustomItemModel/DetailsJSFieldItemModel"],toggleable:e=>{var t;return(null==(t=e.getStepParams("fieldSettings","init"))?void 0:t.fieldPath)===r},useModel:"DetailsItemModel",createModelOptions:()=>({use:"DetailsItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:t.dataSourceKey,collectionName:e.model.context.blockModel.collection.name,fieldPath:r}}},subModels:{field:{use:o,props:"function"==typeof n.defaultProps?n.defaultProps(e,l):n.defaultProps}}})}}).filter(Boolean)}onInit(e){super.onInit(e),this.context.defineProperty("actionName",{get:()=>"view",cache:!1})}renderItem(){let e=this.subModels.field,t=this.context.fieldIndex,l=this.context.record,n=this.context.currentObject,o=this.context.item,r=this.context.getPropertyOptions("item"),i=this.context.prefixFieldPath,a=null!=t?(()=>{let i=e.createFork({},`${t}`);i.context.defineProperty("fieldIndex",{get:()=>t}),i.context.defineProperty("record",{get:()=>l,cache:!1}),i.context.defineProperty("currentObject",{get:()=>n,cache:!1});let{value:a,...s}=r||{};return i.context.defineProperty("item",{...s,get:()=>o,cache:!1}),this.context.pattern&&i.context.defineProperty("pattern",{get:()=>this.context.pattern}),i})():e,s=this.context.pattern?{...this.context.blockModel.props,...this.props,pattern:this.context.pattern,disabled:"readPretty"===this.context.pattern}:{...this.context.blockModel.props,...this.props},d=dU(this.collectionField,dK({record:l,currentObject:n,fieldPath:this.fieldPath,prefixFieldPath:i,idx:t}));return(0,V.jsx)(K.FormItem,{...s,value:d,children:(0,V.jsx)(K.FieldModelRenderer,{model:a})})}}dW.define({label:(0,K.tExpr)("Display fields"),searchable:!0,searchPlaceholder:(0,K.tExpr)("Search fields"),sort:100}),dW.registerFlow({key:"detailItemSettings",sort:300,title:(0,K.tExpr)("Detail item settings"),steps:{showLabel:{title:(0,K.tExpr)("Show label"),uiMode:{type:"switch",key:"showLabel"},defaultParams:{showLabel:!0},handler(e,t){e.model.setProps({showLabel:t.showLabel})}},label:{title:(0,K.tExpr)("Label"),uiSchema:e=>({title:{"x-component":"Input","x-decorator":"FormItem","x-reactions":t=>{var l;let n=e.model,o=null==(l=n.collectionField)?void 0:l.title;t.decoratorProps={...t.decoratorProps,extra:n.context.t("Original field title: ")+o}}}}),defaultParams:e=>{var t;return{title:null==(t=e.collectionField)?void 0:t.title}},handler(e,t){var l;let n={ns:"lm-flow-engine",compareWith:null==(l=e.collectionField)?void 0:l.title};e.model.setProps({label:e.t(t.title,n)})}},aclCheck:{use:"aclCheck"},init:{async handler(e){let{collectionField:t}=e.model;t&&e.model.setProps(t.getComponentProps())}},tooltip:{title:(0,K.tExpr)("Tooltip"),uiSchema:{tooltip:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({tooltip:e.t(t.tooltip,{ns:"lm-flow-engine"})})}},description:{title:(0,K.tExpr)("Description"),uiSchema:{description:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({extra:e.t(t.description,{ns:"lm-flow-engine"})})}},model:{title:(0,K.tExpr)("Field component"),use:"displayFieldComponent"},fieldNames:{use:"titleField",title:(0,K.tExpr)("Title field"),beforeParamsSave:async(e,t,l)=>{if(!e.collectionField||!e.collectionField.isAssociationField())return null;if(t.label!==l.label){var n,o;e.model.setProps({titleField:t.label,...null==(o=e.collectionField.targetCollection)||null==(n=o.getField(t.label))?void 0:n.getComponentProps()});let l=e.collectionField.targetCollection.getField(t.label),r=K.DisplayItemModel.getDefaultBindingByField(e,l),i=r.modelName;await dL({parentModel:e.model,targetUse:i,defaultProps:"function"==typeof(null==r?void 0:r.defaultProps)?r.defaultProps(e,e.collectionField):null==r?void 0:r.defaultProps,pattern:e.model.getProps().pattern})}},async handler(e,t){var l,n;if(!e.collectionField||e.model.subModels.field.disableTitleField)return;e.model.setProps({titleField:t.label,...null==(n=e.collectionField.targetCollection)||null==(l=n.getField(t.label))?void 0:l.getComponentProps()});let o=e.collectionField.targetCollection;if(o){let l=o.getField(t.label),n=K.DisplayItemModel.getDefaultBindingByField(e,l).modelName;n!==e.model.subModels.field.use&&e.model.setStepParams(e.flowKey,"model",{use:n})}},hideInSettings:async e=>!e.collectionField||!e.collectionField.isAssociationField()||e.model.subModels.field.disableTitleField}}}),dW.registerFlow({key:"paginationChange",on:"paginationChange",steps:{aclCheckRefresh:{use:"aclCheckRefresh",defaultParams:{strategy:"formItem"}}}});var dH=l(71616);function dG(e){if(!e)return!1;let t=null==e?void 0:e.type;return"belongsToMany"===t||"hasMany"===t||"belongsToArray"===t}function dY(e,t){var l;let n=!!(null==e||null==(l=e.isAssociationField)?void 0:l.call(e)),o=dG(e);return n&&!o&&Array.isArray(t)?t.length?t[0]:void 0:t}function dJ(e,t){if(!(null==t?void 0:t.length))return e;let[l,n]=String(t[t.length-1]).split(":"),o=Number(n);if(!l||!Number.isFinite(o))return e;let r=0;for(let e of t){let[t]=String(e).split(":");t===l&&(r+=1)}let i=-1,a=0;for(let t=0;t<e.length;t++)if(String(e[t])===l&&(a+=1)===r){i=t;break}if(-1===i){for(let t=e.length-1;t>=0;t--)if(String(e[t])===l){i=t;break}}return -1===i?e:[o,...e.slice(i+1)]}let dX=["o2o","oho","obo","o2m","attachment","expression","point","lineString","circle","polygon","sequence","formula"];class dQ extends K.EditableItemModel{static defineChildren(e){let t=e.collection;return t.getFields().map(l=>{let n=this.getDefaultBindingByField(e,l);if(!n)return;let o=n.modelName,r=e.prefixFieldPath?`${e.prefixFieldPath}.${l.name}`:l.name;return{key:r,label:l.title,refreshTargets:["FormJSFieldItemModel","FormItemModel/FormJSFieldItemModel"],toggleable:e=>(0,dV.pX)(e).some(e=>e===r),useModel:"FormItemModel",createModelOptions:()=>({use:"FormItemModel",stepParams:{fieldSettings:{init:{dataSourceKey:t.dataSourceKey,collectionName:e.model.context.blockModel.collection.name,fieldPath:r}}},subModels:{field:{use:o,props:"function"==typeof n.defaultProps?n.defaultProps(e,l):n.defaultProps}}})}}).filter(Boolean)}onInit(e){super.onInit(e),this.emitter.on("onSubModelAdded",e=>{if(this.collectionField){let t=this.collectionField.getComponentProps();e.setProps(t),this.setProps({...W().pick(t,"rules")||{}})}})}renderItem(){var e,t;let l=this.subModels.field,n=this.context.fieldIndex,o=this.context.fieldKey,r=(null==(e=this.parent)?void 0:e.context.fieldPathArray)||[],i=!!this.context.flowSettingsEnabled&&!!this.props.hidden&&!this.hidden&&!this.forbidden,a=null!=n||i?(()=>{let e=i?`${this.uid}:config-visible`:`${o}`,t=l.createFork({},e);if(null!=n){t.context.defineProperty("fieldIndex",{get:()=>n}),t.context.defineProperty("fieldKey",{get:()=>o}),this.context.currentObject&&t.context.defineProperty("currentObject",{get:()=>this.context.currentObject});let e=this.context.getPropertyOptions("item");if(this.context.item){let{value:l,...n}=e||{};t.context.defineProperty("item",{...n,get:()=>this.context.item,cache:!1})}this.context.pattern&&t.context.defineProperty("pattern",{get:()=>this.context.pattern})}return t.context.defineProperty("fieldPathArray",{get:()=>this.context.fieldPathArray,cache:!1}),i&&t.setProps({hidden:!1}),t})():l,{initialValue:s,hidden:d,...u}=this.context.pattern?{...this.props,pattern:this.context.pattern}:this.props,c=i?u:{hidden:d,...u},p=dJ(this.props.name,n);this.context.defineProperty("fieldPathArray",{get:()=>[...r,...W().castArray(p)],cache:!1});let m=(null==(t=this.context.item)?void 0:t.value)||this.context.record,h=(0,V.jsx)(K.FormItem,{...c,name:p,validateFirst:!0,disabled:this.props.disabled||!W().isEmpty(m)&&!m.__is_new__&&this.props.aclDisabled||!W().isEmpty(m)&&m.__is_new__&&this.props.aclCreateDisabled,children:(0,V.jsx)(K.FieldModelRenderer,{model:a,name:p})});return i?(0,V.jsx)(tM.A,{title:this.context.t("The field is hidden and only visible when the UI Editor is active"),children:(0,V.jsx)("div",{style:{opacity:.3},children:h})}):h}}dQ.define({label:(0,K.tExpr)("Display fields"),searchable:!0,searchPlaceholder:(0,K.tExpr)("Search fields"),sort:100}),dQ.registerFlow({key:"editItemSettings",sort:300,title:(0,K.tExpr)("Form item settings"),steps:{showLabel:{title:(0,K.tExpr)("Show label"),uiMode:{type:"switch",key:"showLabel"},defaultParams:{showLabel:!0},handler(e,t){e.model.setProps({showLabel:t.showLabel})}},label:{title:(0,K.tExpr)("Label"),uiSchema:e=>({label:{"x-component":"Input","x-decorator":"FormItem","x-reactions":t=>{var l;let n=e.model,o=null==(l=n.collectionField)?void 0:l.title;t.decoratorProps={...t.decoratorProps,extra:n.context.t("Original field title: ")+o}}}}),defaultParams:e=>{var t;return{label:null==(t=e.collectionField)?void 0:t.title}},handler(e,t){var l;let n={ns:"lm-flow-engine",compareWith:null==(l=e.collectionField)?void 0:l.title};e.model.setProps({label:e.t(t.label,n)})}},aclCheck:{use:"aclCheck",async handler(e,t){var l,n,o,r,i,a,s,d,u,c,p,m,h;if(!e.collectionField||!e.blockModel)return;let f=e.blockModel.context.actionName,g=await e.aclCheck({dataSourceKey:null==(l=e.dataSource)?void 0:l.key,resourceName:null==(n=e.collectionField)?void 0:n.collectionName,fields:[null==(o=e.collectionField)?void 0:o.name],actionName:f});if("update"===f){let t=await e.aclCheck({dataSourceKey:null==(r=e.dataSource)?void 0:r.key,resourceName:null==(i=e.collectionField)?void 0:i.collectionName,fields:[e.collectionField.name],actionName:"view"});e.prefixFieldPath&&e.item&&(await e.aclCheck({dataSourceKey:null==(s=e.dataSource)?void 0:s.key,resourceName:null==(d=e.collectionField)?void 0:d.collectionName,fields:[e.collectionField.name],actionName:"create"})||e.model.setProps({aclCreateDisabled:!0}));let l=(null==(a=e.item)?void 0:a.__is_new__)??!1;t||l||(e.model.hidden=!0,e.model.forbidden={actionName:"view"},e.exitAll()),g||e.model.setProps({aclDisabled:!0})}else if("create"===f){let t=await e.aclCheck({dataSourceKey:null==(u=e.dataSource)?void 0:u.key,resourceName:null==(c=e.collectionField)?void 0:c.collectionName,actionName:"update"}),l=await e.aclCheck({dataSourceKey:null==(p=e.dataSource)?void 0:p.key,resourceName:null==(m=e.collectionField)?void 0:m.collectionName,fields:[e.collectionField.name],actionName:"update"}),n=(null==(h=e.item)?void 0:h.__is_stored__)??!1;g||n||(e.model.hidden=!0,e.model.forbidden={actionName:f},e.exitAll()),t&&l||e.model.setProps({aclDisabled:!0})}}},init:{async handler(e){let t=e.model.fieldPath,l=t.includes(".")?t.split("."):t;e.model.setProps({name:l})}},tooltip:{title:(0,K.tExpr)("Tooltip"),uiSchema:{tooltip:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({tooltip:e.t(t.tooltip,{ns:"lm-flow-engine"})})}},description:{title:(0,K.tExpr)("Description"),uiSchema:{description:{"x-component":"Input.TextArea","x-decorator":"FormItem","x-component-props":{autoSize:!0}}},handler(e,t){e.model.setProps({extra:e.t(t.description,{ns:"lm-flow-engine"})})}},initialValue:{title:(0,K.tExpr)("Default value"),disabledInSettings:!0,disabledReasonInSettings:e=>`${e.t("This setting has been moved to")}: ${e.t("Form block settings")} > ${e.t("Field values")}`,uiSchema:e=>{var t,l,n,o;if(e.model.parent.parent instanceof dH.EditFormModel||(null==(l=e.model.subModels)||null==(t=l.field)?void 0:t.updateAssociation))return;let r=null==(n=e.model.collectionField)?void 0:n.interface;if(null==dX||null==(o=dX.includes)||!o.call(dX,r))return{defaultValue:{"x-component":"DefaultValue","x-decorator":"FormItem"}}},defaultParams:e=>{let t=e.model.collectionField;if("nanoid"===t.interface&&!1!==t.options.autoFill){let{size:e,customAlphabet:l}=t.options||{size:21};return{defaultValue:(0,dO.d_)(l,e)()}}return{defaultValue:t.defaultValue}},handler(e,t){var l,n;let o=null==(l=e.model.collectionField)?void 0:l.interface;if(null==dX||null==(n=dX.includes)?void 0:n.call(dX,o))return;let r=dY(e.model.collectionField,t.defaultValue);e.model.setProps({initialValue:r})}},validation:{title:(0,K.tExpr)("Validation"),use:"validation"},required:{title:(0,K.tExpr)("Required"),use:"required"},model:{use:"fieldComponent",title:(0,K.tExpr)("Field component")},pattern:{use:"pattern"},titleField:{use:"titleField",hideInSettings:e=>!(e.collectionField&&e.collectionField.isAssociationField()&&e.collectionField.isAssociationField()&&"readPretty"===e.model.getProps().pattern),defaultParams:e=>{var t,l,n;return{titleField:e.model.props.titleField||(null==(n=e.model)||null==(l=n.context)||null==(t=l.collectionField)?void 0:t.targetCollectionTitleFieldName)}},beforeParamsSave:async(e,t,l)=>{if(!(e.collectionField.isAssociationField()&&"readPretty"===e.model.getProps().pattern))return null;let n=t.titleField||t.label;if(n!==l.titleField){let t=e.collectionField.targetCollection,l=t.getField(n),o=dW.getDefaultBindingByField(e,l);if(o.modelName!==e.model.subModels.field.use){let l=e.model.subModels.field.uid;await e.engine.destroyModel(l);let r=e.model.setSubModel("field",{use:o.modelName,stepParams:{fieldSettings:{init:{dataSourceKey:e.model.collectionField.dataSourceKey,collectionName:t.name,fieldPath:n}}}});await r.save()}e.model.setProps(e.collectionField.targetCollection.getField(n).getComponentProps())}},async handler(e,t){"readPretty"===e.model.props.pattern?e.model.setProps({titleField:null==t?void 0:t.label}):e.model.setProps({titleField:t.titleField})}}}}),dQ.registerFlow({key:"paginationChange",on:"paginationChange",steps:{aclCheckRefresh:{use:"aclCheckRefresh",defaultParams:{strategy:"formItem"}}}});var dZ=l(85352),d0=l(90199);function d1(e,t){var l,n,o;let r=null==e||null==(l=e.props)?void 0:l.fieldNames,i=null==e||null==(n=e.props)?void 0:n.titleField,a=null==e||null==(o=e.getStepParams)?void 0:o.call(e,"selectSettings","fieldNames");return{stepParams:{fieldSettings:{init:t},...a?{selectSettings:{fieldNames:a}}:{}},props:{...void 0!==r?{fieldNames:r}:{},...void 0!==i?{titleField:i}:{}}}}function d2(e){try{return JSON.stringify(e)??""}catch{return String(e)}}function d8(e){var t,l,n;let o=null==e||null==(t=e.props)?void 0:t.fieldNames,r=null==e||null==(l=e.props)?void 0:l.titleField,i=null==e||null==(n=e.getStepParams)?void 0:n.call(e,"selectSettings","fieldNames");return[(null==e?void 0:e.uid)||"",d2(o),d2(r),d2(i)].join("|")}class d5 extends dQ{onInit(e){var t,l,n,o,r,i,a;let s=null==(t=this.getStepParams("fieldSettings","assignValue"))?void 0:t.value;void 0!==s&&(this.assignValue=s),this.context.defineProperty("collectionField",{get:()=>{var e,t;let l=this.getStepParams("fieldSettings","init")||{},n=`${null==l?void 0:l.dataSourceKey}.${null==l?void 0:l.collectionName}.${null==l?void 0:l.fieldPath}`,o=null==(e=this.context)?void 0:e.dataSourceManager;return null==o||null==(t=o.getCollectionField)?void 0:t.call(o,n)}});let d=this.context,u=null==d?void 0:d.collection,c=this.fieldInit;if(!(null==(l=this.subModels)?void 0:l.field)&&(null==u?void 0:u.getFields)){let e=(u.getFields()||[]).find(e=>(null==e?void 0:e.name)===(null==c?void 0:c.fieldPath));null==u||null==(o=u.getField)||o.call(u,null==c?void 0:c.fieldPath);let t=K.EditableItemModel.getDefaultBindingByField(d,e);if(!t)return;let l=t.modelName;null==d||null==(i=d.engine)||null==(r=i.createModel)||r.call(i,{use:l,stepParams:{fieldSettings:{init:c}},parentId:this.uid,subKey:"field"})}let p=null==(n=this.context)?void 0:n.collection,m=this.fieldPath;if(m){let e=null==p||null==(a=p.getField)?void 0:a.call(p,m),t=(null==e?void 0:e.title)||m,l=m.includes(".")?m.split("."):[m];this.setProps({label:t,name:l})}}get fieldInit(){return this.getStepParams("fieldSettings","init")||{}}get fieldPath(){var e;return null==(e=this.fieldInit)?void 0:e.fieldPath}getAssignedEntry(){let e=this.fieldPath;return e?[e,this.assignValue]:null}render(){var e,t;let l=this.context,n=l.collection,o=this.fieldInit,r=(null==(e=this.props)?void 0:e.name)||(this.fieldPath?[this.fieldPath]:void 0),i=this.fieldPath,a=null==(t=this.subModels)?void 0:t.field,s=d8(a),d=()=>{var e,t,s;let[d,u]=H.useState(null);H.useEffect(()=>{var e,t,r,s,d,c,p,m,h,f,g,v,y,x,b,S,w,C,F,k,A;if(!i)return;let P=((null==n||null==(e=n.getFields)?void 0:e.call(n))||[]).find(e=>(null==e?void 0:e.name)===i);n.getField(i);let j=K.EditableItemModel.getDefaultBindingByField(l,P);if(!j)return;let M=j.modelName,I=d1(a,o),T=null==l||null==(r=l.engine)||null==(t=r.createModel)?void 0:t.call(r,{use:"VariableFieldFormModel",subModels:{fields:[{use:M,...I}]}});if(!T)return;null==(d=T.context)||null==(s=d.defineProperty)||s.call(d,"collection",{value:n});let R=null==l?void 0:l.dataSource;R&&(null==(p=T.context)||null==(c=p.defineProperty)||c.call(p,"dataSource",{value:R}));let E=null==n||null==(m=n.getField)?void 0:m.call(n,null==o?void 0:o.fieldPath);E&&(null==(f=T.context)||null==(h=f.defineProperty)||h.call(f,"collectionField",{value:E}));let N=null==l?void 0:l.blockModel;N&&(null==(v=T.context)||null==(g=v.defineProperty)||g.call(v,"blockModel",{value:N}));let D=l.form;D&&(null==(k=T.context)||null==(F=k.defineProperty)||F.call(k,"form",{value:D})),T.context&&Object.defineProperty(T.context,"resource",{configurable:!0,enumerable:!0,get:()=>null==N?void 0:N.resource});let B=null==T||null==(x=T.subModels)||null==(y=x.fields)?void 0:y[0],$=null==n||null==(b=n.getField)?void 0:b.call(n,null==o?void 0:o.fieldPath),O=null==$?void 0:$.type,q=null==$?void 0:$.interface,_="belongsToMany"===O||"hasMany"===O||"belongsToArray"===O||"m2m"===q||"o2m"===q||"mbm"===q;if(null==B||null==(S=B.setProps)||S.call(B,{disabled:!1,readPretty:!1,updateAssociation:!1,multiple:_}),null==B||null==(w=B.dispatchEvent)||w.call(B,"beforeRender",void 0,{sequential:!0,useCache:!0}),(0,dZ.NI)(B,$),!(null==B||null==(C=B.props)?void 0:C.fieldNames)&&(null==$?void 0:$.targetCollection)){let e=$.targetCollection,t=(null==$?void 0:$.targetKey)||(null==e?void 0:e.filterTargetKey)||"id";null==B||null==(A=B.setProps)||A.call(B,{fieldNames:{label:null==e?void 0:e.titleField,value:t}})}return u(T),()=>{var e,t,l,n;null==T||null==(l=T.subModels)||null==(t=l.fields)||null==(e=t.forEach)||e.call(t,e=>{var t;return null==e||null==(t=e.remove)?void 0:t.call(e)}),null==T||null==(n=T.remove)||n.call(T)}},[]);let c=e=>(H.useEffect(()=>{var t,l,n,o;if(!d)return;null==(t=d.setProps)||t.call(d,{...e});let r=null==d||null==(n=d.subModels)||null==(l=n.fields)?void 0:l[0];r&&(null==(o=r.setProps)||o.call(r,{value:null==e?void 0:e.value,onChange:function(){for(var t,l=arguments.length,n=Array(l),o=0;o<l;o++)n[o]=arguments[o];let r=n&&n.length?n[0]:void 0;null==e||null==(t=e.onChange)||t.call(e,r)}}))},[e]),d?(0,V.jsx)("div",{style:{width:"100%"},children:(0,V.jsx)(K.FlowModelRenderer,{model:d,showFlowSettings:!1})}):null),p=()=>(0,V.jsx)(st.A,{placeholder:"<Null>",readOnly:!0,style:{width:"100%"}}),m=e=>(0,V.jsx)(d0.h,{t:this.context.t,value:null==e?void 0:e.value,onChange:null==e?void 0:e.onChange,containerStyle:{width:"100%"}}),h={renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?c:"null"===l?p:"runjs"===l?m:void 0},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:"runjs"===l?{code:"",version:"v2"}:void 0},resolvePathFromValue:e=>null===e?["null"]:(0,K.isRunJSValue)(e)?["runjs"]:(0,K.isVariableExpression)(e)?(0,K.parseValueToPath)(e):["constant"]},f=async()=>{var e;let t=null==(e=this.context)?void 0:e.getPropertyMetaTree,l="function"==typeof t?await t():[];return[{title:(0,K.tExpr)("Constant"),name:"constant",type:"string",paths:["constant"],render:c},{title:(0,K.tExpr)("Null"),name:"null",type:"object",paths:["null"],render:p},{title:(0,K.tExpr)("RunJS"),name:"runjs",type:"object",paths:["runjs"],render:m},...l]},g=(null==(e=this.props)?void 0:e.label)??this.fieldPath??"",v=null==n||null==(t=n.getField)?void 0:t.call(n,this.fieldPath);return g=(null==(s=this.props)?void 0:s.label)??(null==v?void 0:v.title)??g,(0,V.jsx)(K.FormItem,{...this.props,label:g,name:r,initialValue:this.assignValue,valuePropName:"__assign_value__",trigger:"__assign_trigger__",validateTrigger:"__assign_trigger__",children:H.createElement(e=>{let t=null==e?void 0:e.__assign_value__,l=void 0===t?this.assignValue:t;return(0,V.jsx)(K.VariableInput,{value:l,onChange:t=>{var l;this.assignValue=t,null==e||null==(l=e.__assign_trigger__)||l.call(e,t)},metaTree:f,converters:h,clearValue:""})})})};return(0,V.jsx)(d,{},s)}constructor(e){super(e),this.assignValue=void 0,(0,z.define)(this,{assignValue:z.observable})}}d5.define({label:(0,K.tExpr)("Assign field")}),d5.registerFlow({key:"editItemSettings",sort:300,title:(0,K.tExpr)("Form item settings"),steps:{showLabel:{title:(0,K.tExpr)("Show label"),uiMode:{type:"switch",key:"showLabel"},defaultParams:{showLabel:!0},handler(e,t){e.model.setProps({showLabel:t.showLabel})}},label:{title:(0,K.tExpr)("Label"),uiSchema:e=>({label:{"x-component":"Input","x-decorator":"FormItem","x-reactions":t=>{var l;let n=e.model,o=null==(l=n.collectionField)?void 0:l.title;t.decoratorProps={...t.decoratorProps,extra:n.context.t("Original field title: ")+o}}}}),defaultParams:e=>({label:e.model.collectionField.title}),handler(e,t){var l;t.label&&t.label===(null==(l=e.model.collectionField)?void 0:l.title)?e.model.setProps({label:t.label}):e.model.setProps({label:e.t(t.label,{ns:"lm-flow-engine"})})}},init:{async handler(e){let t=e.model.collectionField;t&&e.model.setProps(t.getComponentProps());let l=e.model.fieldPath,n=l.includes(".")?l.split("."):l;e.model.setProps({name:n})}},tooltip:{title:(0,K.tExpr)("Tooltip"),uiSchema:{tooltip:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({tooltip:e.t(t.tooltip,{ns:"lm-flow-engine"})})}},description:{title:(0,K.tExpr)("Description"),uiSchema:{description:{"x-component":"Input.TextArea","x-decorator":"FormItem"}},handler(e,t){e.model.setProps({extra:e.t(t.description,{ns:"lm-flow-engine"})})}},validation:{title:(0,K.tExpr)("Validation"),use:"validation"},required:{title:(0,K.tExpr)("Required"),use:"required"}}});class d4 extends aH{}d4.itemModelName="DetailsItemModel",d4.define({label:'{{t("Display association fields")}}'});var d3=l(58929);let d6=e=>{if(!e)return 0;let t=e.getBoundingClientRect(),l=window.getComputedStyle(e),n=parseFloat(l.marginTop)||0,o=parseFloat(l.marginBottom)||0;return t.height+n+o},d9=e=>{let{heightMode:t,containerRef:l,actionsRef:n,paginationRef:o,deps:r=[]}=e,[i,a]=(0,H.useState)(),s=(0,H.useCallback)(()=>{if("specifyValue"!==t&&"fullHeight"!==t)return void a(e=>void 0===e?e:void 0);let e=l.current;if(!e)return;let r=e.getBoundingClientRect().height;if(!r)return;let i=Math.max(0,Math.floor(r-d6(n.current)-d6(o.current)));a(e=>e===i?e:i)},[t,l,n,o]);return(0,H.useLayoutEffect)(()=>{s()},[s,...r]),(0,H.useEffect)(()=>{if(!l.current||"u"<typeof ResizeObserver)return;let e=l.current,t=n.current,r=o.current,i=new ResizeObserver(()=>s());return i.observe(e),t&&i.observe(t),r&&i.observe(r),()=>i.disconnect()},[s,l,n,o,...r]),i};class d7 extends sv.t{createResource(e,t){var l,n;if((null==(l=this.association)?void 0:l.type)==="hasOne"||(null==(n=this.association)?void 0:n.type)==="belongsTo"||Object.keys(t).includes("filterByTk")){let e=this.context.createResource(K.SingleRecordResource);return e.isNewRecord=!1,e}let o=this.context.createResource(K.MultiRecordResource);return o.setPageSize(1),o}onInit(e){var t,l;super.onInit(e),this.hadSingleRecordData=(null==(l=this.resource)||null==(t=l.hasData)?void 0:t.call(l))??!1,this.hasMultiRefreshDispatched=!1;let n=(0,K.createCurrentRecordMetaFactory)(this.context,()=>this.collection);this.context.defineProperty("record",{get:()=>this.getCurrentRecord(),cache:!1,resolveOnServer:(0,K.createRecordResolveOnServerWithLocal)(()=>this.collection,()=>this.getCurrentRecord()),meta:n}),this.resource.on("refresh",()=>{var e,t;if(this.isMultiRecordResource()){this.hasMultiRefreshDispatched=!0,(0,dg.Xi)(this,"paginationChange");return}let l=this.hadSingleRecordData;this.hadSingleRecordData=(null==(t=this.resource)||null==(e=t.hasData)?void 0:e.call(t))??!1,l&&(0,dg.Xi)(this,"paginationChange")})}isMultiRecordResource(){return this.resource instanceof K.MultiRecordResource}hasDispatchedMultiRefresh(){return this.hasMultiRefreshDispatched}getCurrentRecord(){let e=this.resource.getData();return Array.isArray(e)?e[0]:e}hasAvailableData(){return this.resource.hasData()}async refresh(){await this.resource.refresh()}renderPagination(){if(!this.resource.loading&&!this.hasAvailableData()){var e,t;return(0,V.jsx)("div",{style:{textAlign:"center",color:null==(t=this.context)||null==(e=t.themeToken)?void 0:e.colorTextDescription},children:this.translate("No available data currently")})}let l=this.resource;return!this.isMultiRecordResource()||!l.getPage()||1>=this.resource.getMeta("count")?null:(0,V.jsx)("div",{style:{textAlign:"center"},children:(0,V.jsx)(d3.A,{simple:!0,pageSize:1,showSizeChanger:!1,defaultCurrent:l.getPage(),total:l.getTotalPage(),onChange:this.handlePageChange,style:{display:"inline-block"}})})}renderConfigureActions(){return(0,V.jsx)(K.AddSubModelButton,{model:this,subModelKey:"actions",subModelBaseClass:this.getModelClassName("RecordActionGroupModel"),afterSubModelInit:async e=>{e.setStepParams("buttonSettings","general",{type:"default"})},children:(0,V.jsx)(K.FlowSettingsButton,{icon:(0,V.jsx)(nF.A,{}),children:this.translate("Actions")})},"details-actions-add")}renderComponent(){let{colon:e,labelAlign:t,labelWidth:l,labelWrap:n,layout:o}=this.props,r=!!this.context.flowSettingsEnabled,i=!r&&!this.hasAvailableData(),{heightMode:a,height:s}=this.decoratorProps;return(0,V.jsx)(ue,{model:this,gridModel:this.subModels.grid,isConfigMode:r,heightMode:a,height:s,layoutProps:{colon:e,labelAlign:t,labelWidth:l,labelWrap:n,layout:o},actions:(0,V.jsx)(K.DndProvider,{children:(0,V.jsx)("div",{style:i?{pointerEvents:"none",opacity:.45}:void 0,children:(0,V.jsxs)(a5.A,{wrap:!0,children:[this.mapSubModels("actions",e=>{if(!e.hidden||r)return(0,V.jsx)(K.Droppable,{model:e,children:(0,V.jsx)(K.FlowModelRenderer,{model:e,showFlowSettings:{showBackground:!1,showBorder:!1,toolbarPosition:"above"},extraToolbarItems:[{key:"drag-handler",component:K.DragHandler,sort:1}]})},e.uid)}),this.renderConfigureActions()]})})})})}constructor(...e){super(...e),this.hadSingleRecordData=!1,this.hasMultiRefreshDispatched=!1,this._defaultCustomModelClasses={RecordActionGroupModel:"RecordActionGroupModel",DetailsItemModel:"DetailsItemModel",DetailsAssociationFieldGroupModel:"DetailsAssociationFieldGroupModel",DetailsCustomItemModel:"DetailsCustomItemModel"},this.customModelClasses={},this.handlePageChange=async e=>{if(this.resource instanceof K.MultiRecordResource){let t=this.resource;t.setPage(e),t.loading=!0,await this.refresh()}}}}d7.scene=sf.P.oam;let ue=e=>{let{model:t,gridModel:l,isConfigMode:n,heightMode:o,height:r,layoutProps:i,actions:a}=e,s=(0,H.useRef)(null),d=(0,H.useRef)(null),u=(0,H.useRef)(null),c="specifyValue"===o||"fullHeight"===o,p=d9({heightMode:o,containerRef:s,actionsRef:d,paginationRef:u,deps:[r]});(0,H.useEffect)(()=>{var e,t;if(!l)return;let n=c?p:void 0;((null==(e=l.props)?void 0:e.height)!==n||(null==(t=l.props)?void 0:t.heightMode)!==o)&&l.setProps({height:n,heightMode:o})},[l,p,c,o]);let m=c?{display:"flex",flexDirection:"column",minHeight:0,height:"100%"}:void 0,h=c?{display:"flex",flexDirection:"column",minHeight:0,flex:1}:void 0;return(0,V.jsx)(dN.s2,{model:t,layoutProps:i,style:m,children:(0,V.jsxs)("div",{ref:s,style:h,children:[(0,V.jsx)("div",{ref:d,style:{textAlign:"right",lineHeight:"0px",paddingBottom:n&&t.context.themeToken.padding},children:a}),(0,V.jsx)(K.FlowModelRenderer,{model:l,showFlowSettings:!1},`${(null==l?void 0:l.uid)||"details-grid"}:${n?"design":"runtime"}`),(0,V.jsx)("div",{ref:u,children:t.renderPagination()})]})})};d7.registerFlow({key:"detailsSettings",title:(0,K.tExpr)("Details settings"),sort:150,steps:{refresh:{async handler(e){if(!e.resource)throw Error("Resource is not initialized");await e.model.applySubModelsBeforeRenderFlows("grid")}},layout:{use:"layout",title:(0,K.tExpr)("Layout")},dataScope:{use:"dataScope"},defaultSorting:{use:"sortingRule",title:(0,K.tExpr)("Default sorting")},linkageRules:{use:"detailsFieldLinkageRules"}}}),d7.registerFlow({key:"paginationChange",on:"paginationChange",steps:{blockLinkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"blockLinkageRules",flowKey:"cardSettings",stepKey:"linkageRules"}},fieldslinkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"detailsFieldLinkageRules",flowKey:"detailsSettings",stepKey:"linkageRules"}}}}),d7.registerFlow({key:"initialPaginationChangeRefresh",sort:10001,steps:{refreshPaginationRelatedStates:{async handler(e){if(e.model.hidden||!e.model.isMultiRecordResource()||e.model.hasDispatchedMultiRefresh())return;let t=e.model.resource;if(!t)return;let l="manual"===(t.dataLoadingMode??t.loadingMode),n="function"==typeof t.hasActiveFilters&&t.hasActiveFilters();l&&!n&&await (0,dg.Xi)(e.model,"paginationChange")}}}}),d7.define({label:(0,K.tExpr)("Details"),searchable:!0,searchPlaceholder:(0,K.tExpr)("Search"),createModelOptions:{use:"DetailsBlockModel",subModels:{grid:{use:"DetailsGridModel"}}},sort:350});class ut extends K.FlowModel{static defineChildren(e){let t=e.engine.filterModelClassByParent("CommonItemModel"),l=e.engine.filterModelClassByParent("DetailsCustomItemModel"),n=t=>Array.from(t.entries()).map(t=>{var l,n,o,r,i;let[a,s]=t,d="function"==typeof s.defineChildren||!!(null==(l=s.meta)?void 0:l.children),u={key:a,label:e.t(s.meta.label),sort:s.meta.sort??999,searchable:!!(null==(n=s.meta)?void 0:n.searchable),searchPlaceholder:null==(o=s.meta)?void 0:o.searchPlaceholder,hide:null==(r=s.meta)?void 0:r.hide};return d?u.children=e=>{var t;return"function"==typeof s.defineChildren?s.defineChildren(e):(null==(t=s.meta)?void 0:t.children)||[]}:u.createModelOptions=(null==(i=s.meta)?void 0:i.createModelOptions)||{use:a},u});return W().sortBy([...n(t),...n(l)],"sort")}}ut.renderMode=K.ModelRenderMode.RenderFunction,ut.define({hide:!0,label:(0,K.tExpr)("Others")});class ul extends ss{renderAddSubModelButton(){return this.context.flowSettingsEnabled?(0,V.jsx)(K.AddSubModelButton,{model:this,subModelKey:"items",subModelBaseClasses:[this.context.getModelClassName("DetailsItemModel"),this.context.getModelClassName("DetailsAssociationFieldGroupModel"),this.context.getModelClassName("DetailsCustomItemModel")].filter(Boolean),keepDropdownOpen:!0,children:(0,V.jsx)(K.FlowSettingsButton,{icon:(0,V.jsx)(nF.A,{}),children:this.translate("Fields")})}):null}render(){var e,t;let l=null==(e=this.props)?void 0:e.height,n=null==(t=this.props)?void 0:t.heightMode,o=this.context.themeToken,r=super.render();return"defaultHeight"===n?r:(0,V.jsx)("div",{style:{height:l,overflowY:"auto",marginLeft:`-${o.marginLG}px`,marginRight:`-${o.marginLG}px`,paddingLeft:`${o.marginLG}px`,paddingRight:`${o.marginLG}px`},children:r})}constructor(...e){super(...e),this.itemFallback=(0,V.jsx)(oQ.A.Input,{block:!0,size:"small",style:{marginBottom:"0.5rem"}}),this.itemSettingsMenuLevel=2,this.itemFlowSettings={showBackground:!0,style:{top:-6,left:-6,right:-6,bottom:-6}},this.dragOverlayConfig={columnInsert:{before:{offsetTop:-6,height:24},after:{offsetTop:3,height:24}},columnEdge:{left:{offsetLeft:-5,width:24},right:{offsetLeft:8,width:24}},rowGap:{above:{offsetTop:-2,height:24},below:{offsetTop:-12,height:24}}}}}function un(e,t){let{fieldUseModel:l,refreshTargets:n}=t,o=e=>Array.isArray(e)?e.map(e=>{let t={...e};if(t.children)if("function"==typeof t.children){let e=t.children;t.children=async t=>o(await e(t))}else Array.isArray(t.children)&&(t.children=o(t.children));if(t.createModelOptions){let e=t.createModelOptions;t.createModelOptions=async(t,n)=>{let o=await ("function"==typeof e?e(t,n):e);return o.subModels=o.subModels||{},o.subModels.field={...o.subModels.field||{},use:l},o},t.refreshTargets=t.refreshTargets||n}return t}):[];return o(e)}function uo(e,t,l){let{fieldUseModel:n,refreshTargets:o}=l,r=l.key??"js-association-fields",i=l.label??(0,K.tExpr)("Display association fields");return{key:r,type:"group",label:i,searchable:l.searchable??!0,searchPlaceholder:l.searchPlaceholder??(0,K.tExpr)("Search fields"),children:async e=>un(await t(e),{fieldUseModel:n,refreshTargets:o})}}ul.registerFlow({key:"detailFieldGridSettings",steps:{grid:{handler(e,t){e.model.setProps("rowGap",0),e.model.setProps("colGap",16)}}}});class ur extends aH{}async function ui(e,t){var l;let{useModel:n,fieldUseModel:o,refreshTargets:r,associationPathName:i,associationProvider:a}=t,s=(0,K.buildWrapperFieldChildren)(e,{useModel:n,fieldUseModel:o,associationPathName:i,refreshTargets:r}),d=[],u=null==s||null==(l=s[0])?void 0:l.children;if(Array.isArray(u)&&(d=u),!a)return d;let c=await a(e);return Array.isArray(c)&&0!==c.length?[...d,uo(e,a,{fieldUseModel:o,refreshTargets:r})]:d}ur.itemModelName="FormItemModel";class ua extends ut{static defineChildren(e){return ui(e,{useModel:"DetailsItemModel",fieldUseModel:"JSFieldModel",refreshTargets:["DetailsItemModel"],associationProvider:e=>d4.defineChildren(e)})}}ua.define({label:(0,K.tExpr)("JS field"),searchable:!0,searchPlaceholder:(0,K.tExpr)("Search fields"),sort:110});class us extends sb.o{}var ud=l(85196);class uu extends sb.o{constructor(...e){super(...e),this.operator="$eq",this.updateAssociation=!0}}uu.registerFlow({key:"AssociationFieldInit",sort:800,steps:{init:{async handler(e,t){if(e.model.updateAssociation){var l,n;let t=e.model.context.blockModel,o=null==t||null==(l=t.context)?void 0:l.resource,r=null==(n=e.model.parent)?void 0:n.fieldPath;o&&r&&o.addUpdateAssociationValues(r)}}},allowCreateCheck:{async handler(e){var t;let l=await e.aclCheck({dataSourceKey:e.collectionField.dataSourceKey,resourceName:null==(t=e.collectionField)?void 0:t.target,actionName:"create"});e.model.setProps({allowCreate:!!l})}}}});let uc=(e,t)=>e===t,up=e=>{if(e&&"object"==typeof e){let t=e.data;return t&&"object"==typeof t?t:e}};function um(e){return"string"==typeof e&&e?e:Array.isArray(e)&&1===e.length&&"string"==typeof e[0]?e[0]:void 0}function uh(e,t){var l;let n="string"==typeof(null==t||null==(l=t.titleCollectionField)?void 0:l.name)?t.titleCollectionField.name:void 0,o=um(null==t?void 0:t.filterTargetKey)||"id",r="string"==typeof(null==e?void 0:e.value)&&e.value&&!uc(e.value,"value")?e.value:void 0,i="string"==typeof(null==e?void 0:e.label)&&e.label&&!uc(e.label,"label")?e.label:void 0,a=r||o;return{label:i||n||a,value:a}}function uf(e){var t,l,n,o,r,i;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=!!a.navigation,d=e=>{if(Array.isArray(e))return e.filter(e=>"string"==typeof e&&!!e)},u=d(null==(l=e.view)||null==(t=l.inputArgs)?void 0:t.openerUids),c=d(a.openerUids),p=u||c||[];if(s)return(c||p).filter(Boolean);let m=null==(o=e.view)||null==(n=o.inputArgs)?void 0:n.viewUid,h=null==(i=e.model.context)||null==(r=i.inputArgs)?void 0:r.viewUid;return[...p,"string"==typeof m&&m?m:"string"==typeof h&&h?h:e.model.uid].filter(Boolean)}function ug(e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(Array.isArray(e)){let t=e.map(e=>{if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if(e&&"object"==typeof e){let t=e.label??e.name;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return t}}).filter(e=>void 0!==e);return t.length?t.map(String).join(", "):void 0}if(e&&"object"==typeof e){let t=e.label??e.name;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return t}}function uv(e){var t,l,n;let{option:o,fieldNames:r}=e,i=(0,K.useFlowModel)(),a=up(o),s=uh(r,null==(t=i.context.collectionField)?void 0:t.targetCollection),d=i.subModels.field,u=ug(null==a?void 0:a[s.label])??ug(null==a?void 0:a.label)??ug(null==a?void 0:a[s.value]);if(!d)return(0,V.jsx)("span",{children:u??"N/A"});let c=String((null==a?void 0:a[s.value])??u??"association-option"),p=d.createFork({},c);p.context.defineProperty("record",{get:()=>a,cache:!1,meta:(0,K.createCurrentRecordMetaFactory)(p.context,()=>p.context.collection)});let m=null==(n=i.context.collectionField.targetCollection)||null==(l=n.getField)?void 0:l.call(n,s.label),h=m&&"function"==typeof m.getComponentProps?m.getComponentProps():{};p.setProps({value:u,clickToOpen:!1,...h});let f=null!=u&&""!==u?p.render():"N/A";return(0,V.jsx)("span",{style:{pointerEvents:"none"},children:f})}function uy(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"record",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!e)return l?[]:void 0;let{value:r}=t||{},i=e=>"object"==typeof e&&null!==e,a=e=>{if(i(e))return{label:(0,V.jsx)(uv,{option:e,fieldNames:t}),value:e[r]}};if("value"===n){let t=e=>{if("object"==typeof e&&null!==e)return a(e);let t=o.find(t=>(null==t?void 0:t[r])===e);return t?a(t):{label:String(e),value:e}};return l?Array.isArray(e)?e.map(e=>t(e)).filter(Boolean):[]:Array.isArray(e)?t(e[0]):t(e)}if(l)return Array.isArray(e)?e.filter(i).map(a).filter(Boolean):[];if(Array.isArray(e)){let t=e[0];return i(t)?a(t):void 0}return i(e)?a(e):void 0}function ux(e,t,l){return(null==e?void 0:e.length)?e.map(e=>(0,U.omit)(e,"disabled","options","style")):l?Array.isArray(t)?t.filter(e=>"object"==typeof e&&null!==e):[]:t&&"object"==typeof t?[t]:[]}var ub=l(33022);let uS=(0,C.css)`
|
|
404
404
|
div {
|
|
405
405
|
white-space: nowrap !important;
|
|
406
406
|
overflow: hidden;
|
|
@@ -878,7 +878,7 @@ ctx.render(<JsItem />);
|
|
|
878
878
|
display: flex;
|
|
879
879
|
margin: 5px 0px;
|
|
880
880
|
}
|
|
881
|
-
`,defaultValue:"h:mm a",formats:["hh:mm:ss a","HH:mm:ss"],timeFormat:!0},default:"HH:mm:ss",enum:[{label:(0,Sm.b)({format:"hh:mm:ss a"}),value:"hh:mm:ss a"},{label:(0,Sm.b)({format:"HH:mm:ss"}),value:"HH:mm:ss"},{label:"custom",value:"custom"}]}},SC={type:"array",title:'{{t("Options")}}',"x-decorator":"FormItem","x-component":"ArrayTable","x-component-props":{pagination:{pageSize:1e3}},items:{type:"object",properties:{column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:50,title:"",align:"center"},properties:{sort:{type:"void","x-component":"ArrayTable.SortHandle"}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Option value")}}'},properties:{value:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"Input"}}},column3:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Option label")}}'},properties:{label:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"Input"}}},column4:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Color")}}'},properties:{color:{type:"string","x-decorator":"FormItem","x-component":"ColorSelect"}}},column5:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:"",dataIndex:"operations",fixed:"right"},properties:{item:{type:"void","x-component":"FormItem",properties:{remove:{type:"void","x-component":"ArrayTable.Remove"}}}}}}},properties:{add:{type:"void","x-component":"ArrayTable.Addition","x-component-props":{randomValue:!0},title:"{{t('Add option')}}"}}},SF={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input","x-validator":"uid",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"}},Sk={type:"string",title:'{{t("Options")}}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{multiple:!0},enum:"{{collections}}"};class SA{addComponentOption(e){if(!this.componentOptions){var t,l,n,o,r,i;this.componentOptions=[];let e=null==(l=this.default)||null==(t=l.uiSchema)?void 0:t["x-component"],a=null==(o=this.default)||null==(n=o.uiSchema)?void 0:n["x-component-props"];if(e){let t=(null==(i=this.default)||null==(r=i.uiSchema)?void 0:r.type)||"string",l=(0,eh.tval)(e.startsWith("Input")?(0,U.capitalize)(t):e.split(".").pop());this.componentOptions=[{label:l,value:e,useProps:()=>a||{}}]}}this.componentOptions.push(e)}getConfigureFormProperties(e){var t,l,n,o;let r=(null==(l=this.configure)||null==(t=l.getConfigureFormProperties)?void 0:t.call(l,e))||(null==(n=this.configure)?void 0:n.properties)||{},i=this.hasDefaultValue?this.getDefaultValueProperty():{},a=null==e?void 0:e.view,s=(null==e?void 0:e.template)==="sql"||(null==e?void 0:e.sql),d=[...new Set([...this.availableValidationOptions,"required"])],u=a||s||!this.validationType?{}:{validation:{title:'{{ t("Validation") }}',required:!1,"x-decorator":"FormItem","x-component":"FieldValidation","x-component-props":{type:this.validationType,availableValidationOptions:d,excludeValidationOptions:[...new Set(this.excludeValidationOptions)],isAssociation:this.isAssociation}}};return{...(0,U.cloneDeep)({...SF,...null==(o=this)?void 0:o.properties,...r}),...i,...u}}getDefaultValueProperty(){var e,t,l,n;return{defaultValue:{...(0,U.cloneDeep)(null==(t=this)||null==(e=t.default)?void 0:e.uiSchema),...null==(n=this)||null==(l=n.properties)?void 0:l.uiSchema,required:!1,title:'{{ t("Default value") }}',"x-decorator":"FormItem"}}}addOperator(e){var t;iu(this.filterable);let l=[...id(null==(t=this.filterable)?void 0:t.operators)];(0,U.set)(this,"filterable.operators",l),l.find(t=>t.value===e.value)||l.push(e)}constructor(e){this.collectionFieldInterfaceManager=e,this.availableValidationOptions=[]}}class SP extends SA{constructor(...e){super(...e),this.name="checkbox",this.type="object",this.group="choices",this.order=1,this.title='{{t("Checkbox")}}',this.default={type:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},this.availableTypes=["boolean","integer","bigInt","bit"],this.hasDefaultValue=!0,this.properties={...SF},this.filterable={operators:"boolean"}}}class Sj extends SA{constructor(...e){super(...e),this.name="checkboxGroup",this.type="object",this.group="choices",this.order=5,this.title='{{t("Checkbox group")}}',this.default={interface:"checkboxGroup",type:"array",defaultValue:[],uiSchema:{type:"string","x-component":"Checkbox.Group"}},this.availableTypes=["array","json"],this.hasDefaultValue=!0,this.properties={...SF,"uiSchema.enum":SC},this.filterable={operators:"array"}}}class SM extends SA{constructor(...e){super(...e),this.name="collection",this.type="string",this.group="advanced",this.order=5,this.title='{{t("Collection selector")}}',this.description='{{t("Providing certain collections as options for users, typically used in polymorphic or inheritance scenarios")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"CollectionSelect"}},this.availableTypes=["string"],this.hasDefaultValue=!1,this.properties={...SF,"uiSchema.enum":Sk},this.filterable={operators:"collection"}}}class SI extends SA{constructor(...e){super(...e),this.name="color",this.type="object",this.group="basic",this.order=10,this.title='{{t("Color")}}',this.default={type:"string",uiSchema:{type:"string","x-component":"ColorPicker"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.properties={...SF},this.filterable={operators:"string"}}}class ST extends SA{constructor(...e){super(...e),this.name="createdAt",this.type="object",this.group="systemInfo",this.order=1,this.title='{{t("Created at")}}',this.sortable=!0,this.default={type:"date",field:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},this.description='{{t("Store the creation time of each record")}}',this.availableTypes=[],this.properties={...SF,...SS},this.filterable={operators:"datetime"},this.titleUsable=!0}}class SR extends SA{constructor(...e){super(...e),this.name="createdBy",this.type="object",this.group="systemInfo",this.order=3,this.title='{{t("Created by")}}',this.isAssociation=!0,this.default={type:"belongsTo",target:"users",foreignKey:"createdById",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},this.availableTypes=["belongsTo"],this.properties={...SF},this.filterable={nested:!0,children:[]},this.description='{{t("Store the creation user of each record")}}'}}class SE extends SA{constructor(...e){super(...e),this.name="datetime",this.type="object",this.group="datetime",this.order=1,this.title='{{t("Datetime (with time zone)")}}',this.sortable=!0,this.default={type:"date",defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,timezone:!0,uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{showTime:!1,utc:!0}}},this.availableTypes=["date","string","datetime","datetimeTz"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...SF,...SS,defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp on update")}}'},"uiSchema.x-component-props.gmt":{type:"boolean",title:'{{t("GMT")}}',"x-hidden":!0,"x-component":"Checkbox","x-content":'{{t("Use the same time zone (GMT) for all users")}}',"x-decorator":"FormItem",default:!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class SN extends SA{constructor(...e){super(...e),this.name="email",this.type="object",this.group="basic",this.order=4,this.title='{{t("Email")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Input","x-validator":"email"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","email","pattern"],this.properties={...SF,unique:Sh},this.filterable={operators:"string"},this.titleUsable=!0}}class SD extends SA{constructor(...e){super(...e),this.name="icon",this.type="object",this.group="basic",this.order=10,this.title='{{t("Icon")}}',this.default={type:"string",uiSchema:{type:"string","x-component":"IconPicker"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.properties={...SF}}}class SB extends SA{constructor(...e){super(...e),this.name="id",this.type="object",this.group="systemInfo",this.order=0,this.title='{{t("ID")}}',this.hidden=!0,this.sortable=!0,this.default={name:"id",type:"bigInt",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0}},this.availableTypes=["bigInt","integer"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,default:"ID","x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"}},this.filterable={operators:"id"},this.description='{{t("Primary key, unique identifier, self growth") }}',this.titleUsable=!0}}let S$=e=>e,SO=e=>{if((0,rx.isArr)(e)){for(let t=0;t<e.length;t++)if((0,rx.isValid)(e[t]))return!1;return!0}if(null==e?void 0:e.getCurrentContent){var t;return!(null==(t=e.getCurrentContent())?void 0:t.hasText())}return(0,rx.isEmpty)(e)};(0,b2.registerValidateRules)({username:e=>/^[^@<>"'/]{1,50}$/.test(e)||S$("Must be 1-50 characters in length (excluding @<>\"'/)"),required:(e,t)=>!1===t.required?"":("string"==typeof e&&(e=e.trim()),SO(e)?t.message:"")});class Sq extends SA{constructor(...e){super(...e),this.name="input",this.type="object",this.group="basic",this.order=1,this.title='{{t("Single line text")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.sortable=!0,this.default={interface:"input",type:"string",uiSchema:{type:"string","x-component":"Input"}},this.availableTypes=["string","uid"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.properties={...SF,trim:{type:"boolean","x-content":'{{t("Automatically remove heading and tailing spaces")}}',"x-decorator":"FormItem","x-component":"Checkbox"},layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}}},this.filterable={operators:"string"},this.titleUsable=!0}}(0,ry.registerValidateFormats)({odd:/^-?\d*[13579]$/,even:/^-?\d*[02468]$/});class S_ extends SA{constructor(...e){super(...e),this.name="integer",this.type="object",this.group="basic",this.order=6,this.title='{{t("Integer")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier, self growth")}}',this.sortable=!0,this.default={type:"bigInt",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"},"x-validator":"integer"}},this.availableTypes=["bigInt","integer","sort","snowflakeId"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["precision"],this.properties={...SF,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}},autoIncrement:Sg},this.filterable={operators:"number"},this.titleUsable=!0}}(0,ry.registerValidateRules)({json(e){try{return JSON.parse(e),!0}catch(e){return{type:"error",message:e.message}}}});class SL extends SA{constructor(...e){super(...e),this.name="json",this.type="object",this.group="advanced",this.order=4,this.title='{{t("JSON")}}',this.sortable=!1,this.default={type:"json",uiSchema:{type:"object","x-component":"Input.JSON","x-component-props":{autoSize:{minRows:5}},default:null}},this.availableTypes=["json","array","set","jsonb","text","circle","lineString","point","polygon"],this.hasDefaultValue=!0,this.properties={...SF,jsonb:{title:"JSONB","x-component":"Checkbox"}},this.configure={items:[{name:"jsonb",title:"JSONB",component:"Checkbox",schema:{"x-content":" "},hidden:e=>{let{context:t}=e,l=t.isDialect;return"function"!=typeof l||!l("postgres")},disabled:e=>{let{context:t}=e;return!!t.disabledJSONB}}]}}}class SV extends SA{initialize(e){"belongsToMany"===e.type&&(e.through||(e.through=`t_${(0,rx.uid)()}`),e.foreignKey||(e.foreignKey=`f_${(0,rx.uid)()}`),e.otherKey||(e.otherKey=`f_${(0,rx.uid)()}`),e.sourceKey||(e.sourceKey="id"),e.targetKey||(e.targetKey="id"))}constructor(...e){super(...e),this.name="m2m",this.type="object",this.group="relation",this.order=6,this.title='{{t("Many to many")}}',this.description='{{t("Many to many description")}}',this.isAssociation=!0,this.default={type:"belongsToMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}},reverseField:{interface:"m2m",type:"belongsToMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}}}},this.availableTypes=["belongsToMany"],this.validationType="object",this.properties={...SF,type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"string",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{through:{type:"string",title:'{{t("Through collection")}}',description:'{{ t("Generated automatically if left blank") }}',"x-decorator":"FormItem","x-disabled":"{{ !createOnly }}","x-component":"ThroughCollection","x-component-props":{allowClear:!0}}}},col13:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key 1")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly||override }}"}}},col23:{type:"void","x-component":"Grid.Col",properties:{}}}},row3:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{}},col22:{type:"void","x-component":"Grid.Col",properties:{otherKey:{type:"string",title:'{{t("Foreign key 2")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly||override }}"}}},col23:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',"x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}",description:"{{t('Field values must be unique.')}}"}}}}}}},...Sb},this.filterable={nested:!0,children:[]}}}class Sz extends SA{constructor(...e){super(...e),this.name="m2o",this.type="object",this.group="relation",this.order=5,this.title='{{t("Many to one")}}',this.description='{{t("Many to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"o2m",type:"hasMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}}}},this.availableTypes=["belongsTo"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}"}}}}}}},...Sx,...Sb},this.filterable={nested:!0,children:[]}}}class SK extends SA{constructor(...e){super(...e),this.name="markdown",this.type="object",this.title='{{t("Markdown")}}',this.group="media",this.default={type:"text",uiSchema:{type:"string","x-component":"Markdown"}},this.availableTypes=["text","json","string"],this.hasDefaultValue=!0,this.properties={...SF},this.filterable={operators:"bigField"}}}class SU extends SA{constructor(...e){super(...e),this.name="multipleSelect",this.type="object",this.group="choices",this.order=3,this.title='{{t("Multiple select")}}',this.default={type:"array",defaultValue:[],uiSchema:{type:"array","x-component":"Select","x-component-props":{mode:"multiple"},enum:[]}},this.availableTypes=["array","json"],this.hasDefaultValue=!0,this.properties={...SF,"uiSchema.enum":SC},this.filterable={operators:"array"}}}class SW extends SA{constructor(...e){super(...e),this.name="number",this.type="object",this.group="basic",this.order=7,this.title='{{t("Number")}}',this.sortable=!0,this.default={type:"double",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"}}},this.availableTypes=["double","float","decimal"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["integer"],this.properties={type:{type:"string",title:'{{t("Data type")}}',"x-component":"Select","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:"double",enum:[{label:'{{t("Double")}}',value:"double"},{label:'{{t("Float")}}',value:"float"},{label:'{{t("Decimal")}}',value:"decimal"}]},...SF,unique:Sh,"uiSchema.x-component-props.step":{type:"string",title:'{{t("Precision(UI)")}}',"x-component":"Select","x-decorator":"FormItem",default:"1",enum:[{value:"1",label:"1"},{value:"0.1",label:"1.0"},{value:"0.01",label:"1.00"},{value:"0.001",label:"1.000"},{value:"0.0001",label:"1.0000"},{value:"0.00001",label:"1.00000"},{value:"0.000001",label:"1.000000"},{value:"0.0000001",label:"1.0000000"},{value:"0.00000001",label:"1.00000000"}]},precision:{type:"string",title:'{{t("Precision")}}',"x-component":"InputNumber","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:10},scale:{type:"string",title:'{{t("Scale")}}',"x-component":"InputNumber","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:2}},this.filterable={operators:"number"},this.titleUsable=!0}}class SH extends SA{constructor(...e){super(...e),this.name="obo",this.type="object",this.group="relation",this.order=3.1,this.title='{{t("One to one (belongs to)")}}',this.description='{{t("One to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"oho",type:"hasOne",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["belongsTo"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}"}}}}}}},...Sx,...Sb},this.filterable={nested:!0,children:[]}}}class SG extends SA{constructor(...e){super(...e),this.name="o2m",this.type="object",this.group="relation",this.order=4,this.title='{{t("One to many")}}',this.description='{{t("One to many description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"hasMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}},reverseField:{interface:"m2o",type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["hasMany"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection"}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}}}},row3:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',"x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}",description:"{{t('Field values must be unique.')}}"}}}}}}},...Sx,...Sb},this.filterable={nested:!0,children:[]}}}class SY extends SA{constructor(...e){super(...e),this.name="oho",this.type="object",this.group="relation",this.order=3,this.title='{{t("One to one (has one)")}}',this.description='{{t("One to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"hasOne",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"obo",type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["hasOne"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}}}}}},...Sx,...Sb},this.filterable={nested:!0,children:[]}}}class SJ extends SA{constructor(...e){super(...e),this.name="password",this.type="object",this.group="basic",this.order=9,this.title='{{t("Password")}}',this.default={type:"password",hidden:!0,uiSchema:{type:"string","x-component":"Password"}},this.availableTypes=["password","string"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.properties={...SF,unique:Sh},this.filterable={operators:"string"}}}(0,ry.registerValidateRules)({percentMode(e,t){let{maxValue:l,minValue:n}=t;return l&&e>l?{type:"error",message:`${S$("The field value cannot be greater than ")}${100*l}%`}:!n||!(e<n)||{type:"error",message:`${S$("The field value cannot be less than ")}${100*n}%`}},percentFormats(e,t){let{percentFormat:l}=t;return!e||"Integer"!==l||!1!==/^-?[1-9]\d*$/.test((100*e).toString())||{type:"error",message:`${S$("The field value is not an integer number")}`}}});class SX extends SA{constructor(...e){super(...e),this.name="percent",this.type="object",this.group="basic",this.order=8,this.title='{{t("Percent")}}',this.sortable=!0,this.default={type:"float",uiSchema:{type:"string","x-component":"Percent","x-component-props":{stringMode:!0,step:"1",addonAfter:"%"}}},this.availableTypes=["float","double","decimal"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["integer"],this.properties={...SF,unique:Sh,"uiSchema.x-component-props.step":{type:"string",title:'{{t("Precision")}}',"x-component":"Select","x-decorator":"FormItem",default:"1",enum:[{value:"1",label:"1%"},{value:"0.1",label:"1.0%"},{value:"0.01",label:"1.00%"},{value:"0.001",label:"1.000%"},{value:"0.0001",label:"1.0000%"},{value:"0.00001",label:"1.00000%"}]}},this.filterable={operators:"number"},this.titleUsable=!0}}class SQ extends SA{constructor(...e){super(...e),this.name="phone",this.type="object",this.group="basic",this.order=3,this.title='{{t("Phone")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Input","x-component-props":{type:"tel"}}},this.availableTypes=["string"],this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.hasDefaultValue=!0,this.properties={...SF,unique:Sh},this.filterable={operators:"string"},this.titleUsable=!0}}class SZ extends SA{constructor(...e){super(...e),this.name="radioGroup",this.type="object",this.group="choices",this.order=4,this.title='{{t("Radio group")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Radio.Group"}},this.availableTypes=["string","integer","boolean","integer"],this.hasDefaultValue=!0,this.properties={...SF,"uiSchema.enum":SC},this.filterable={operators:"enumType"},this.titleUsable=!0}}class S0 extends SA{constructor(...e){super(...e),this.name="richText",this.type="object",this.group="media",this.order=2,this.title='{{t("Rich Text")}}',this.default={interface:"richText",type:"text",uiSchema:{type:"string","x-component":"RichText"}},this.availableTypes=["text","json","string"],this.hasDefaultValue=!0,this.properties={...SF},this.filterable={operators:"bigField"}}}class S1 extends SA{constructor(...e){super(...e),this.name="select",this.type="object",this.group="choices",this.order=2,this.title='{{t("Single select")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Select",enum:[]}},this.availableTypes=["string","bigInt","boolean"],this.hasDefaultValue=!0,this.properties={...SF,"uiSchema.enum":SC},this.filterable={operators:"enumType"},this.titleUsable=!0}}class S2 extends SA{constructor(...e){super(...e),this.name="snowflakeId",this.type="object",this.group="advanced",this.order=0,this.title='{{t("Snowflake ID (53-bit)")}}',this.primaryKeyDescription='{{t("Primary key, distributed uniqueness, time-ordering")}}',this.hidden=!1,this.sortable=!0,this.default={type:"snowflakeId",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,separator:"0.00",step:"1"},"x-validator":"integer"}},this.availableTypes=["snowflakeId"],this.properties={...SF,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}}},this.filterable={operators:"number"},this.description='{{t("A 53-bit Snowflake ID designed to be compatible with JavaScript’s safe integer range, providing both time-ordering and uniqueness.") }}',this.titleUsable=!0}}class S8 extends SA{constructor(...e){super(...e),this.name="tableoid",this.type="object",this.group="systemInfo",this.order=0,this.title='{{t("Table OID")}}',this.sortable=!0,this.default={name:"__collection",type:"virtual",uiSchema:{type:"string",title:'{{t("Table OID")}}',"x-component":"CollectionSelect","x-component-props":{isTableOid:!0},"x-read-pretty":!0}},this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Input"}},this.filterable={operators:"tableoid"}}}class S5 extends SA{constructor(...e){super(...e),this.name="textarea",this.type="object",this.group="basic",this.order=2,this.title='{{t("Long text")}}',this.default={interface:"textarea",type:"text",uiSchema:{type:"string","x-component":"Input.TextArea"}},this.availableTypes=["text","json","string"],this.validationType="string",this.availableValidationOptions=["min","max","length","case","pattern"],this.hasDefaultValue=!0,this.titleUsable=!0,this.properties={...SF,trim:{type:"boolean","x-content":'{{t("Automatically remove heading and tailing spaces")}}',"x-decorator":"FormItem","x-component":"Checkbox"}},this.filterable={operators:"string"}}}class S4 extends SA{constructor(...e){super(...e),this.name="time",this.type="object",this.group="datetime",this.order=4,this.title='{{t("Time")}}',this.sortable=!0,this.default={type:"time",uiSchema:{type:"string","x-component":"TimePicker"}},this.availableTypes=["time"],this.hasDefaultValue=!0,this.properties={...SF,...Sw},this.filterable={operators:"time"},this.titleUsable=!0}}class S3 extends SA{constructor(...e){super(...e),this.name="updatedAt",this.type="object",this.group="systemInfo",this.order=2,this.title='{{t("Last updated at")}}',this.sortable=!0,this.default={type:"date",field:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},this.description='{{t("Store the last update time of each record")}}',this.availableTypes=[],this.properties={...SF,...SS},this.filterable={operators:"datetime"},this.titleUsable=!0}}class S6 extends SA{constructor(...e){super(...e),this.name="updatedBy",this.type="object",this.group="systemInfo",this.order=4,this.title='{{t("Last updated by")}}',this.isAssociation=!0,this.default={type:"belongsTo",target:"users",foreignKey:"updatedById",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},this.availableTypes=["belongsTo"],this.properties={...SF},this.filterable={nested:!0,children:[]},this.description='{{t("Store the last update user of each record")}}'}}class S9 extends SA{constructor(...e){super(...e),this.name="url",this.type="string",this.group="basic",this.order=5,this.title='{{t("URL")}}',this.default={type:"text",uiSchema:{type:"string","x-component":"Input.URL"}},this.componentOptions=[{label:"URL",value:"Input.URL"},{label:"Preview",value:"Input.Preview"}],this.availableTypes=["string","text"],this.validationType="string",this.availableValidationOptions=["uri","pattern"],this.properties={...SF},this.titleUsable=!0,this.filterable={operators:"string"}}}class S7 extends SA{constructor(...e){super(...e),this.name="uuid",this.type="object",this.group="advanced",this.order=0,this.title='{{t("UUID")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.hidden=!1,this.sortable=!0,this.default={type:"uuid",uiSchema:{type:"string","x-component":"Input","x-validator":"uuid"}},this.availableTypes=["uid","uuid"],this.validationType="string",this.availableValidationOptions=["uuid","pattern"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},autoFill:Sv,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}}},this.filterable={operators:"string"},this.titleUsable=!0}}class we extends SA{constructor(...e){super(...e),this.name="nanoid",this.type="object",this.group="advanced",this.order=0,this.title='{{t("Nano ID")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.hidden=!1,this.sortable=!0,this.default={type:"nanoid",uiSchema:{type:"string","x-component":"NanoIDInput"}},this.availableTypes=["nanoid"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},customAlphabet:{type:"string",title:'{{t("Alphabet")}}',default:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz","x-decorator":"FormItem","x-component":"Input"},size:{type:"number",title:'{{t("Length")}}',default:21,"x-decorator":"FormItem","x-component":"InputNumber"},autoFill:Sv,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}}},this.filterable={operators:"string"},this.titleUsable=!0}}class wt extends SA{constructor(...e){super(...e),this.name="unixTimestamp",this.type="object",this.group="datetime",this.order=4,this.title='{{t("Unix Timestamp")}}',this.sortable=!0,this.default={type:"unixTimestamp",accuracy:"second",timezone:!0,defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,uiSchema:{type:"number","x-component":"UnixTimestamp","x-component-props":{showTime:!0}}},this.availableTypes=["unixTimestamp"],this.hasDefaultValue=!1,this.validationType="date",this.availableValidationOptions=["timestamp"],this.properties={...SF,...SS,accuracy:{type:"string",title:'{{t("Accuracy")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"second",enum:[{value:"millisecond",label:'{{t("Millisecond")}}'},{value:"second",label:'{{t("Second")}}'}]},defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp on update")}}'}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class wl extends SA{constructor(...e){super(...e),this.name="date",this.type="object",this.group="datetime",this.order=3,this.title='{{t("DateOnly")}}',this.sortable=!0,this.default={type:"dateOnly",uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{dateOnly:!0,showTime:!1}}},this.availableTypes=["dateOnly"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...SF,...SS,"uiSchema.x-component-props.showTime":{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-visible":!1},"uiSchema.x-component-props.timeFormat":{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-visible":!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class wn extends SA{constructor(...e){super(...e),this.name="datetimeNoTz",this.type="object",this.group="datetime",this.order=2,this.title='{{t("Datetime (without time zone)")}}',this.sortable=!0,this.default={type:"datetimeNoTz",defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,timezone:!1,uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{showTime:!1,utc:!1}}},this.availableTypes=["string","datetimeNoTz"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...SF,...SS,defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current server time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp to the current server time on update")}}'},"uiSchema.x-component-props.gmt":{type:"boolean",title:'{{t("GMT")}}',"x-hidden":!0,"x-component":"Checkbox","x-content":'{{t("Use the same time zone (GMT) for all users")}}',"x-decorator":"FormItem",default:!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}function wo(e){if(null==e?void 0:e.filterTargetKey){if(Array.isArray(e.filterTargetKey)){var t;return null==e||null==(t=e.filterTargetKey)?void 0:t[0]}return null==e?void 0:e.filterTargetKey}return(null==e?void 0:e.getPrimaryKey())||"id"}function wr(e,t){var l,n,o,r,i;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=e.interface,d=s?(null==t||null==(n=t.getFieldInterfaceConfigure)||null==(l=n.call(t,s,a.collectionInfo))?void 0:l.default)||(null==t||null==(r=t.getFieldInterface)||null==(o=r.call(t,s))?void 0:o.default):void 0,u=(0,U.merge)({},(0,U.cloneDeep)(d||{}),(0,U.cloneDeep)(e)),c=(0,U.merge)({},(0,U.cloneDeep)((null==d?void 0:d.uiSchema)||{}),(0,U.cloneDeep)(e.uiSchema||{}));return void 0!==e.title&&(c.title=e.title),void 0!==e.options&&(c.enum=(0,U.cloneDeep)(e.options)),void 0!==e.component&&(c["x-component"]=e.component),void 0!==e.componentProps&&(c["x-component-props"]=(0,U.merge)({},(0,U.cloneDeep)((null==d||null==(i=d.uiSchema)?void 0:i["x-component-props"])||{}),(0,U.cloneDeep)(e.componentProps))),delete u.title,delete u.options,delete u.component,delete u.componentProps,Object.keys(c).length&&(u.uiSchema=c),u}function wi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,l=arguments.length>2?arguments[2]:void 0;return e.map(e=>wr(e,t,l))}let wa=e=>{var t,l,n,o,r,i,a,s,d;let{dataSource:u="main",collections:c,syncOnChange:p=!1,children:m}=e,h=(0,ee.n)(),f=(0,H.useRef)(null),g=(0,H.useRef)(null);if(null===f.current){let e=null==(l=h.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,u),r=[];if(e)for(let t of c)null!=(n=e.getCollection)&&n.call(e,t.name)||(null==(o=e.addCollection)||o.call(e,t),r.push(t));f.current=r,g.current=c}else if(p&&g.current!==c){let e=null==(i=h.dataSourceManager)||null==(r=i.getDataSource)?void 0:r.call(i,u);if(e){let t=new Set(c.map(e=>e.name)),l=new Map(f.current.map(e=>[e.name,e]));for(let n of l.keys())t.has(n)||null==(a=e.removeCollection)||a.call(e,n);let n=[];for(let t of c){let o=l.get(t.name);if(o){n.push(o);continue}null!=(s=e.getCollection)&&s.call(e,t.name)||(null==(d=e.addCollection)||d.call(e,t),n.push(t))}f.current=n}g.current=c}return(0,H.useEffect)(()=>{var e;let t=e=>{var t,l,n,o,r;let i=null==(t=e.detail)?void 0:t.dataSourceKey;if(i!==u&&"*"!==i)return;let a=null==(n=h.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);if(a&&f.current)for(let e of f.current)null!=(o=a.getCollection)&&o.call(a,e.name)||null==(r=a.addCollection)||r.call(a,e)};return null==(e=h.eventBus)||e.addEventListener("dataSource:loaded",t),()=>{var e,l,n,o;null==(e=h.eventBus)||e.removeEventListener("dataSource:loaded",t);let r=null==(n=h.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u),i=f.current??[];if(f.current=null,g.current=null,r)for(let e of i)null==(o=r.removeCollection)||o.call(r,e.name)}},[h,u]),(0,V.jsx)(V.Fragment,{children:m})};var ws=l(30872),wd=l.n(ws),wu=l(88055),wc=l.n(wu),wp=l(90179),wm=l.n(wp);let wh=(0,H.createContext)(null);wh.displayName="APIClientContext";let wf=(0,H.createContext)(null);wf.displayName="ApplicationContext";let wg=()=>{var e;let t=(0,H.useContext)(wf),l=(0,K.useFlowEngine)({throwError:!1});return(null==l||null==(e=l.context)?void 0:e.app)||t||{}};function wv(){let e=wg();return(0,H.useContext)(wh)||e.apiClient}var wy=l(89412),wx=l(14744),wb=l.n(wx),wS=l(63375),ww=l.n(wS);function wC(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(t=>e.propertyIsEnumerable(t)):[]}function wF(e){return Object.keys(e).concat(wC(e))}let wk=new Map;function wA(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return wF(t).forEach(n=>{let o=l[n],r=wk.get("deepMerge");"function"==typeof o?r=o:"string"==typeof o&&wk.has(o)&&(r=wk.get(o)),e[n]=r(e[n],t[n])}),e}function wP(e){let t,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[n,o]=(0,wy.A)({}),r=wv();t="function"==typeof e?e:e?async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{resource:l,url:n}=e,o=wc()(e);l||n?(o.params=o.params||{},wA(o.params,t)):o=(0,rx.merge)(o,t);let i=await r.request(o);return null==i?void 0:i.data}:async()=>{};let i={...l,onSuccess(){for(var e,t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];null==(e=l.onSuccess)||e.call(l,...n),l.uid&&(r.services[l.uid]=a)}},a=(0,oJ.A)(t,i);return(0,H.useMemo)(()=>({...a,state:n,setState:o}),[a,o,n])}function wj(e,t){return wv().resource(e,t)}wk.set("overwrite",(e,t)=>t),wk.set("andMerge",(e,t)=>{if(e||t)return e?t?{$and:[e,t]}:e:t}),wk.set("orMerge",(e,t)=>{if(e||t)return e?t?{$or:[e,t]}:e:t}),wk.set("deepMerge",(e,t)=>(0,eh.isPlainObject)(e)&&(0,eh.isPlainObject)(t)?wb()(e,t,{arrayMerge:(e,t)=>t}):t),wk.set("merge",(e,t)=>(0,eh.isPlainObject)(e)&&(0,eh.isPlainObject)(t)?Object.assign(e,t):t),wk.set("union",(e,t)=>("string"==typeof e&&(e=e.split(",")),"string"==typeof t&&(t=t.split(",")),ww()((e||[]).concat(t||[])))),wk.set("intersect",(e,t)=>("string"==typeof e&&(e=e.split(",")),"string"==typeof t&&(t=t.split(",")),Array.isArray(e)&&0!==e.length)?Array.isArray(t)&&0!==t.length?e.filter(e=>t.includes(e)):e||[]:t||[]);var wM=l(98892);function wI(e,t,l){var n;(null==t?void 0:t.length)&&l[e]({message:null==(n=t.map)?void 0:n.call(t,(e,t)=>H.createElement("div",{key:`${t}_${e.message}`},"string"==typeof e?e:e.message))})}let wT=(e,t)=>{var l;let n=new FileReader;n.readAsText(null==e||null==(l=e.response)?void 0:l.data,"utf-8"),n.onload=function(){wI("error",JSON.parse(n.result).errors,t)}};function wR(e){let t=Math.floor(Math.abs(e)),l=Math.abs(e%1*60);return(e>=0?"+":"-")+(t<10?"0":"")+t+":"+(l<10?"0":"")+l}let wE=()=>wR(-(new Date().getTimezoneOffset()/60)),wN=new Map;class wD extends N{get notification(){var e,t;return(null==(t=this.app)||null==(e=t.context)?void 0:e.notification)||wM.Ay}cloneInstance(){let e=new wD(this.options);e.options=this.options,e.services=this.services,e.storage=this.storage,e.app=this.app,e.auth=this.auth,e.storagePrefix=this.storagePrefix;let t=[];for(let n of this.axios.interceptors.response.handlers){var l;(null==n||null==(l=n.rejected)?void 0:l._name)==="handleNotificationError"?t.push({...n,rejected:e.handleNotificationError.bind(e)}):t.push(n)}return e.axios.interceptors.response.handlers=t,e}getHostname(){var e,t;try{return new URL("/api/").hostname}catch(e){}return null==(t=window)||null==(e=t.location)?void 0:e.hostname}getHeaders(){var e;let t=super.getHeaders(),l=null==(e=this.app)?void 0:e.getName();return l&&(t["X-App"]=l),t["X-Timezone"]=wE(),t["X-Hostname"]=this.getHostname(),t}service(e){return this.services[e]}interceptors(){this.axios.interceptors.request.use(e=>{e.headers["X-With-ACL-Meta"]=!0;let t=this.getHeaders();return Object.keys(t).forEach(l=>{j(e.headers,l)||(e.headers[l]=t[l])}),e}),super.interceptors(),this.useNotificationMiddleware(),this.axios.interceptors.response.use(e=>e,e=>{let t=this.toErrMessages(e);throw t.find(e=>"ROLE_NOT_FOUND_ERR"===e.code)&&(this.auth.setRole(null),window.location.reload()),t.find(e=>"TOKEN_INVALID"===e.code||"USER_LOCKED"===e.code)&&this.auth.setToken(null),t.find(e=>"ROLE_NOT_FOUND_FOR_USER"===e.code)&&(this.auth.setRole(null),window.location.reload()),e})}toErrMessages(e){var t,l,n,o,r,i,a,s,d,u,c;if("string"==typeof(null==e||null==(t=e.response)?void 0:t.data)){let t=document.createElement("div");t.innerHTML=null==e||null==(d=e.response)?void 0:d.data;let l=t.textContent||t.innerText;return l.includes("Error occurred while trying")||l.includes("502 Bad Gateway")?[{code:"APP_WARNING",message:l="The application may be starting up. Please try again later."}]:[{message:l}]}return(null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.error)?[null==e||null==(c=e.response)||null==(u=c.data)?void 0:u.error]:(null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.errors)||(null==e||null==(a=e.response)||null==(i=a.data)?void 0:i.messages)||(null==e||null==(s=e.response)?void 0:s.error)||[{message:e.message||"Server error"}]}async handleNotificationError(e){var t,l,n,o,r,i,a,s,d,u;if(this.silence)throw e;let c=null==(t=e.config)?void 0:t.skipNotify;if(c&&("function"==typeof c&&c(e)||!0===c))throw e;let p=null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.redirectTo;if(p)return window.location.href=p;if((null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.type)==="application/json")wT(e,this.notification);else{wN.size>10&&wN.clear();let t=!!(null==e||null==(s=e.response)||null==(a=s.data)||null==(i=a.error)?void 0:i.maintaining);if(this.app.maintaining!==t&&(this.app.maintaining=t),this.app.maintaining)throw this.app.error=null==e||null==(u=e.response)||null==(d=u.data)?void 0:d.error,e;this.app.error&&(this.app.error=null);let l=this.toErrMessages(e);if(0===(l=l.filter(e=>{let t=wN.get(e.message);return!(t&&new Date().getTime()-t<500)&&(wN.set(e.message,new Date().getTime()),!0)})).length)throw e;wI("error",l,this.notification)}throw e}useNotificationMiddleware(){let e=this.handleNotificationError.bind(this);e._name="handleNotificationError",this.axios.interceptors.response.use(e=>{var t,l;return(null==(l=e.data)||null==(t=l.messages)?void 0:t.length)&&wI("success",e.data.messages.filter(e=>{let t=wN.get("string"==typeof e?e:e.message);return!(t&&new Date().getTime()-t<500)&&(wN.set(e.message,new Date().getTime()),!0)}),this.notification),e},e)}silent(){let e=this.cloneInstance();return e.silence=!0,e}constructor(...e){super(...e),this.services={},this.silence=!1}}let wB=e=>{let{apiClient:t,children:l}=e;return(0,V.jsx)(wh.Provider,{value:t,children:l})};class w${get fields(){return this.options.fields||[]}get app(){return this.collectionManager.app}get dataSource(){return this.options.dataSource}get sourceKey(){return this.options.sourceKey}get name(){return this.options.name}get key(){return this.options.key}get title(){return this.options.title}get inherit(){return this.options.inherit}get hidden(){return this.options.hidden}get description(){return this.options.description}get duplicator(){return this.options.duplicator}get category(){return this.options.category}get targetKey(){return this.options.targetKey}get model(){return this.options.model}get createdBy(){return this.options.createdBy}get updatedBy(){return this.options.updatedBy}get logging(){return this.options.logging}get from(){return this.options.from}get rawTitle(){return this.options.rawTitle}getPrimaryKey(){if(this.primaryKey)return this.primaryKey;if(this.options.targetKey)return this.options.targetKey;let e=this.getFields({primaryKey:!0})[0];return this.primaryKey=null==e?void 0:e.name,this.primaryKey}getFilterTargetKey(){return this.filterTargetKey||this.getPrimaryKey()||"id"}get inherits(){return this.options.inherits||[]}get titleField(){return this.hasField(this.options.titleField)?this.options.titleField:this.getPrimaryKey()}get sources(){return this.options.sources||[]}get template(){return this.options.template}get tableName(){return this.options.tableName}get viewName(){return this.options.viewName}get writableView(){return this.options.writableView}get filterTargetKey(){return this.options.filterTargetKey}get sortable(){return this.options.sortable}get autoGenId(){return this.options.autoGenId}get magicAttribute(){return this.options.magicAttribute}get tree(){return this.options.tree}get isThrough(){return this.options.isThrough}get autoCreate(){return this.options.autoCreate}get resource(){return this.options.resource}setOption(e,t){return this.options[e]=t,this}getOptions(){return this.options}getOption(e){return this.options[e]}getFields(e){return e?(0,rw.filter)(this.fields,e):this.fields}getAllFields(e){return this.getFields(e)}getFieldsMap(){return this.fieldsMap||(this.fieldsMap=this.getFields().reduce((e,t)=>(e[t.name]=t,e),{})),this.fieldsMap}getFieldByAssociationName(e){let t=this.getFieldsMap(),[l,...n]=String(e).split("."),o=t[l];if(!o)return;let r=null==o?void 0:o.target;if(!r)return;let i=this.collectionManager.getCollection(r);if(i)return i.getField(n.join("."))}getField(e){if(!e)return;let t=this.getFieldsMap();if(String(e).split(".").length>1){let t=this.getFieldByAssociationName(e);return t||("string"==typeof e&&e.startsWith(`${this.name}.`)?(e=e.replace(`${this.name}.`,""),this.getField(e)):void 0)}return t[e]}hasField(e){return!!this.getField(e)}isTitleField(e){var t;return null==(t=this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterface(e.interface))?void 0:t.titleUsable}isInherited(){return this.inherits.length>0}constructor(e,t){this.options=e,this.collectionManager=t}}let{ConfigContext:wO}=ei.Ay,wq=()=>(0,H.useContext)(wO),w_=(e,t)=>{let{getPrefixCls:l}=(0,H.useContext)(ei.Ay.ConfigContext)||{};if("ConfigContext"in ei.Ay)return(null==l?void 0:l(e,null==t?void 0:t.prefixCls))||"";{let l=(null==t?void 0:t.prefixCls)??"ant-";return`${l}${e??""}`}},wL=()=>er.A.useToken(),wV=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Loading...",t=arguments.length>1?arguments[1]:void 0,l=null,n=setTimeout(()=>{l=yq.Ay.loading(e)},100);try{return await t()}finally{null==l||l(),clearTimeout(n)}},wz={...lP},{version:wK,render:wU,unmountComponentAtNode:wW}=wz;try{Number((wK||"").split(".")[0])>=18&&wz.createRoot&&(n=wz.createRoot)}catch(e){}function wH(e){let{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:t}=wz;t&&"object"==typeof t&&(t.usingClientEntryPoint=e)}let wG="__antd_mobile_root__";function wY(e,t){wU(e,t)}function wJ(e,t){wH(!0);let l=t[wG]||n(t);wH(!1),l.render(e),t[wG]=l}function wX(e,t){n?wJ(e,t):wY(e,t)}function wQ(e){return wW(e)}async function wZ(e){return Promise.resolve().then(()=>{var t;null==(t=e[wG])||t.unmount(),delete e[wG]})}function w0(e){return n?wZ(e):wQ(e)}let w1=(0,z.observable)(new Map),w2=e=>{let t=e=>(e.id&&!w1.has(e.id)&&w1.set(e.id,null),(0,V.jsxs)(H.Fragment,{children:[e.children,(0,V.jsx)(ne.Observer,{children:()=>{if(!e.id)return(0,V.jsx)(V.Fragment,{});let t=w1.get(e.id);return t?(0,lA.createPortal)(t,document.body):(0,V.jsx)(V.Fragment,{})}})]}));return t.defaultProps={id:e},t};function w8(e,t){return{render:function(l){w1.has(t)?w1.set(t,null==l?void 0:l()):e&&wX((0,V.jsx)(H.Fragment,{children:null==l?void 0:l()}),e)},unmount:function(){if(w1.has(t)&&w1.set(t,null),e&&w0(e)&&e.parentNode){var l;null==(l=e.parentNode)||l.removeChild(e)}}}}let w5=(e,t)=>{let{fontFamily:l,fontSize:n}=e,o=`[class^="${t}"], [class*=" ${t}"]`;return{[o]:{fontFamily:l,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},w4=(e,t)=>l=>{let{theme:n,token:o,hashId:r}=wL(),{getPrefixCls:i,iconPrefixCls:a}=wq(),s=w_(e),d=i(),u=(0,rm.useStyleRegister)({theme:n,token:o,hashId:r,path:["formily-antd",e,s,a]},()=>{let e=`.${s}`,n=t((0,rx.merge)(o,{componentCls:e,prefixCls:s,iconCls:`.${a}`,antCls:`.${d}`}),l,{hashId:r,prefixCls:s,rootPrefixCls:d,iconPrefixCls:a});return[w5(o,s),n]});return{wrapSSR:(0,H.useMemo)(()=>u,[n,o,r,s,a,d,l]),hashId:r,componentCls:s,rootPrefixCls:d}};var w3=l(38221),w6=l.n(w3);let w9=(0,H.createContext)(null);w9.displayName="DataSourceManagerContext";let w7=e=>{let{children:t,dataSourceManager:l}=e;return(0,V.jsx)(w9.Provider,{value:l,children:t})};function Ce(){return(0,H.useContext)(w9)}function Ct(){let e=Ce();return{getAllCollectionsInheritChain:(0,H.useCallback)((t,l)=>{var n,o,r;return null==e||null==(r=e.getDataSource(l))||null==(o=r.collectionManager)||null==(n=o.getCollection(t))?void 0:n.getInheritChain()},[e])}}var Cl=l(68870);let Cn=(0,H.createContext)(null);Cn.displayName="DataSourceContext";let Co=e=>{let{children:t,dataSource:l}=e,n=Ce(),{t:o}=(0,lj.B)(),{refresh:r}=jD(),[i,a]=H.useState(0),s=null==n?void 0:n.getDataSource(l);return s?"loading-failed"===s.status?(0,V.jsx)(enx,{type:"Data Source",name:s.displayName||l,message:s.errorMessage||"loading failed"}):"loading"===s.status||"reloading"===s.status?(0,V.jsx)(Z0,{children:(0,V.jsx)(lH.Ay,{icon:(0,V.jsx)(Cl.A,{}),title:`${s.displayName||l} ${o("data source")} ${o("loading")}...`,extra:(0,V.jsx)(nk.Ay,{type:"primary",onClick:()=>s.reload().then(()=>{r(),a(Math.random())}),children:o("Refresh")})})}):(0,V.jsx)(Cn.Provider,{value:s,children:t}):(0,V.jsx)(enx,{type:"Data Source",name:l})};function Cr(){return(0,H.useContext)(Cn)}function Ci(){let e=(0,H.useContext)(Cn);return null==e?void 0:e.key}let Ca=(0,H.createContext)(null);Ca.displayName="ExtendCollectionsContext";let Cs=e=>{let{children:t,collections:l}=e,n=Cd(),o=(0,H.useMemo)(()=>n?[...n,...l]:l,[n,l]),r=Ci();return(0,V.jsx)(Ca.Provider,{value:o,children:(0,V.jsx)(Cp,{dataSource:r,children:t})})};function Cd(){return(0,H.useContext)(Ca)}let Cu=(0,H.createContext)(null);Cu.displayName="CollectionManagerContext";let Cc=e=>{let{instance:t,children:l}=e,n=Cr(),o=Cd(),r=(0,H.useMemo)(()=>t||(null==n?void 0:n.collectionManager),[t,n]),[i,a]=H.useState(Math.random());(0,H.useEffect)(()=>{r.dataSource.addReloadCallback(()=>{a(Math.random())})},[r]);let s=(0,H.useMemo)(()=>{let e=r;return(null==o?void 0:o.length)?e.clone(o):e},[r,o,i]);return(0,V.jsx)(Cu.Provider,{value:s,children:l})},Cp=e=>{let{instance:t,dataSource:l,children:n}=e;return(0,V.jsx)(Co,{dataSource:l,children:(0,V.jsx)(Cc,{instance:t,children:n})})};function Cm(){return(0,H.useContext)(Cu)}let Ch=e=>{let t=Cm();return(0,H.useMemo)(()=>t.getCollections(e),[t,e])},Cf=(0,H.createContext)({});Cf.displayName="SchemaComponentContext.Provider";let Cg=()=>(0,H.useContext)(ne.SchemaOptionsContext)||{},Cv=(0,H.memo)(e=>{let{children:t}=e,l=Cg(),n=(0,H.useMemo)(()=>({...l.components,...e.components}),[l.components,e.components]),o=(0,H.useMemo)(()=>({...l.scope,...e.scope}),[l.scope,e.scope]),r=(0,H.useMemo)(()=>({scope:o,components:n}),[o,n]);return(0,V.jsx)(ne.SchemaOptionsContext.Provider,{value:r,children:(0,V.jsx)(ne.SchemaComponentsContext.Provider,{value:n,children:(0,V.jsx)(ne.ExpressionScope,{value:o,children:t})})})});function Cy(e){return ne.Schema.isSchemaInstance(e)?e:new ne.Schema((null==e?void 0:e.name)?{type:"object",properties:{[e.name]:e},name:`p_${e.name}`}:e)}Cv.displayName="SchemaComponentOptions";let Cx=e=>(0,H.useMemo)(()=>Cy(e),[]),Cb=(0,H.createContext)({onChange:rC().noop}),CS=(0,H.memo)(e=>{let{components:t,scope:l,schema:n,distributed:o,onChange:r,parentSchema:i,...a}=e,s=(0,H.useContext)(Cf),d=(0,H.useMemo)(()=>Cy(n),[n]),u=(0,H.useMemo)(()=>({...s,distributed:!1!=s.distributed&&o,refresh:s.refresh||rC().noop}),[s,o]),{onChange:c}=(0,H.useContext)(Cb),p=(0,H.useMemo)(()=>({onChange:()=>{null==r||r(d),null==c||c()}}),[r,c,d]);return(0,V.jsx)(Cb.Provider,{value:p,children:(0,V.jsx)(Cf.Provider,{value:u,children:(0,V.jsx)(Cv,{inherit:!0,components:t,scope:l,children:(0,V.jsx)(CQ,{...a,schema:d,isUseFormilyField:!0,parentSchema:i})})})})});CS.displayName="RecursionSchemaComponent";let Cw=(0,H.memo)(e=>{let{schema:t,parentSchema:l,...n}=e,o=Cx(t);return(0,V.jsx)(CS,{...n,schema:o,parentSchema:l})});Cw.displayName="MemoizedSchemaComponent";let CC=(0,H.memo)(e=>{let{memoized:t,...l}=e;return t?(0,V.jsx)(Cw,{...l}):(0,V.jsx)(CS,{...l})});CC.displayName="SchemaComponent";let CF=Object.freeze({}),Ck={},CA=e=>/{{.*?}}/g.test(e),CP=function(){let{noCache:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{noCache:!1},t=(0,H.useContext)(ne.SchemaOptionsContext),l=(0,H.useContext)(ne.SchemaExpressionScopeContext);return(n,o)=>{let r,i=!1;if("string"==typeof n&&n.startsWith("{{")&&(i=!0,r=n),n&&"object"==typeof n&&!(0,H.isValidElement)(n)){try{r=JSON.stringify(n)}catch(e){return console.warn("Failed to stringify:",e),n}if(Ck[r])return Ck[r];i=CA(r)}if(Array.isArray(n)){try{r=JSON.stringify(n)}catch(e){return console.warn("Failed to stringify:",e),n}if(Ck[r])return Ck[r];i=CA(r)}if(i){let i={...null==t?void 0:t.scope,...l,...o};if(!r)return ne.Schema.compile(n,i);try{if(e)return ne.Schema.compile(n,i);return Ck[r]=Ck[r]||ne.Schema.compile(n,i),Ck[r]}catch(e){return console.log("useCompile error",n,e),ne.Schema.compile(n,i)}}return n}},Cj=(e,t)=>{if((e||t)&&!(0,rx.isFn)(e))return(0,V.jsxs)(H.Fragment,{children:[e,t]})},CM=e=>e&&("object"==typeof e||"function"==typeof e),CI=(e,t,l)=>(0,rx.isFn)(e)?e(t,l):e,CT=e=>{let t,l=(0,H.useContext)(ne.SchemaComponentsContext),n=e.field,o=Cj(CI(e.children,n,n.form),n.content??n.componentProps.children);if("visible"!==n.display)return null;let r=e=>CM(e)?e:rx.FormPath.getIn(l,e)??e;return t=n.componentType?H.createElement(r(n.componentType),{...n.componentProps,value:n.value},o):o,n.decoratorType?H.createElement(r(n.decoratorType),n.decoratorProps,t):(0,V.jsx)(H.Fragment,{children:t})};CT.displayName="NocoBaseReactiveInternal";let CR=CT;function CE(e){return new CN(e)}CR.displayName="NocoBaseReactiveField";class CN{initialize(){var e,t,l,n,o,r,i,a,s,d,u,c,p,m,h,f,g,v,y,x;let b=this.props.compile;this.pattern="readPretty",this.readPretty=!0,this.initialized=!0,this.loading=!1,this.validating=!1,this.submitting=!1,this.selfModified=!1,this.active=!1,this.visited=!0,this.mounted=!0,this.unmounted=!1,this.inputValues=[],this.inputValue=null,this.feedbacks=[],this.title=b(this.props.title||(null==(e=this.props.schema)?void 0:e.title)),this.description=b(this.props.description||(null==(t=this.props.schema)?void 0:t.description)),this.display="visible",this.editable=this.props.editable||(null==(l=this.props.schema)?void 0:l["x-editable"]),this.disabled=this.props.disabled||(null==(n=this.props.schema)?void 0:n["x-disabled"]),this.readOnly=this.props.readOnly||(null==(o=this.props.schema)?void 0:o["x-read-only"]),this.visible=this.props.visible||(null==(r=this.props.schema)?void 0:r["x-visible"]),this.hidden=this.props.hidden||(null==(i=this.props.schema)?void 0:i["x-hidden"]),this.dataSource=b(this.props.dataSource||(null==(a=this.props.schema)?void 0:a.enum)),this.validator=this.props.validator,this.required=this.props.required||!!(null==(s=this.props.schema)?void 0:s.required),this.content=b(this.props.content||(null==(d=this.props.schema)?void 0:d["x-content"])),this.initialValue=b(this.props.initialValue||(null==(u=this.props.schema)?void 0:u.default)),this.value=b(this.props.value),this.data=this.props.data||(null==(c=this.props.schema)?void 0:c["x-data"]),this.decorator=this.props.decorator?(0,rx.toArr)(this.props.decorator):[null==(p=this.props.schema)?void 0:p["x-decorator"],null==(m=this.props.schema)?void 0:m["x-decorator-props"]],this.component=this.props.component?(0,rx.toArr)(this.props.component):[null==(h=this.props.schema)?void 0:h["x-component"],null==(f=this.props.schema)?void 0:f["x-component-props"]],this.decoratorProps=(null==(g=this.props.schema)?void 0:g["x-decorator-props"])||{},this.componentProps=(null==(v=this.props.schema)?void 0:v["x-component-props"])||{},this.decoratorType=null==(y=this.props.schema)?void 0:y["x-decorator"],this.componentType=null==(x=this.props.schema)?void 0:x["x-component"],this.path={},this.form={},this.address={concat:rC().noop}}constructor(e){this.props=e,this.initialize()}}let CD=e=>{let t=CP(),l=(0,ne.useFieldSchema)(),n=(0,H.useMemo)(()=>CE({...e,compile:t}),[]);return Object.assign(n.componentProps,l["x-component-props"]),n.value=e.value,(0,V.jsx)(ne.FieldContext.Provider,{value:n,children:(0,V.jsx)(CR,{field:n,children:e.children})})},CB=H.createContext({}),C$=H.createContext(rC().noop),CO=e=>{let{children:t,refresh:l}=e,n=CV(),o=(0,H.useCallback)(e=>{l(),(null==e?void 0:e.refreshParentSchema)&&(null==n||n())},[n,l]);return(0,V.jsx)(C$.Provider,{value:o,children:t})},Cq=H.createContext(rC().noop),C_=e=>{let{children:t,refresh:l}=e;return(0,V.jsx)(Cq.Provider,{value:l,children:t})},CL=()=>H.useContext(Cq),CV=()=>H.useContext(C$),Cz=()=>H.useContext(CB)||{},CK=e=>{let{children:t,fieldSchema:l}=e,n=enM(),o=Cm(),r=null==l?void 0:l.name,i=(0,H.useMemo)(()=>{var e;if(!n)return null;let t=null==l||null==(e=l["x-component-props"])?void 0:e.field;return o.getCollectionField(null==l?void 0:l["x-collection-field"])||t||n.getField((null==t?void 0:t.name)||r)},[n,o,l,r]);return(0,V.jsx)(CB.Provider,{value:i,children:t})},CU=rC().memoize((e,t)=>e.toFieldProps({scope:t})),CW=e=>CU(e,(0,ne.useExpressionScope)()),CH=e=>{let t=(0,ne.useField)();if(e.onlyRenderProperties){var l;return e.basePath||(null==t||null==(l=t.address)?void 0:l.concat(e.name))}return e.basePath||(null==t?void 0:t.address)},CG=(e,t,l)=>{let n=e.toJSON();if(l){if(!n.properties)return e;let l=Object.keys(n.properties)[0],o=Object.values(n.properties)[0];return n.properties[l]=(0,rx.merge)(rC().omit(t,"type","x-read-pretty"),o),new ne.Schema(n)}return new ne.Schema((0,rx.merge)(rC().omit(t,"type","x-read-pretty"),n))},CY=e=>{let{schema:t,field:l,basePath:n,mapProperties:o,filterProperties:r,propsRecursion:i,values:a,isUseFormilyField:s}=e,d=ne.Schema.getOrderProperties(t);return d.length?(0,V.jsx)(H.Fragment,{children:d.map((e,t)=>{let{schema:d,key:u}=e,c=(null==l?void 0:l.address)||n,p=d;if((0,rx.isFn)(o)){let e=o(d,u);e&&(p=e)}if((0,rx.isFn)(r)&&!1===r(p,u))return null;let m=(0,rx.isBool)(i)&&i?(0,V.jsx)(CQ,{propsRecursion:!0,filterProperties:r,mapProperties:o,schema:p,name:u,basePath:c,values:rC().get(a,u),isUseFormilyField:s}):(0,V.jsx)(CQ,{schema:p,name:u,basePath:c,values:rC().get(a,u),isUseFormilyField:s});return"CollectionField"===p["x-component"]?(0,V.jsx)(CJ.Provider,{value:!0,children:(0,V.jsx)(CK,{fieldSchema:p,children:m})},`${t}-${u}`):(0,V.jsx)(CJ.Provider,{value:!1,children:(0,V.jsx)(CB.Provider,{value:CF,children:m})},`${t}-${u}`)})}):null},CJ=H.createContext(!1),CX=()=>H.useContext(CJ),CQ=H.memo(e=>{let{schema:t,name:l,onlyRenderProperties:n,onlyRenderSelf:o,mapProperties:r,filterProperties:i,propsRecursion:a,values:s,isUseFormilyField:d=!0,uiSchema:u,parentSchema:c}=e,p=CH(e),m=(0,H.useRef)(null),h=(0,H.useMemo)(()=>(m.current=null,new ne.Schema(t)),[t]),{uiSchema:f,defaultValue:g}=Cz(),v=(0,bh.A)(),{onChange:y}=(0,H.useContext)(Cb),x=m.current||h;if(!x.parent&&c){var b,S;x.parent=c,(null==(S=x.parent)||null==(b=S.properties)?void 0:b[x.name])||!x.name||rC().set(x.parent,`properties.${x.name}`,x)}let w=(0,H.useCallback)(()=>{let e=x.parent;m.current=new ne.Schema(x.toJSON(),e),(null==e?void 0:e.properties)&&Object.keys(e.properties).forEach(t=>{t===x.name&&(e.properties[t]=m.current)}),v(),null==y||y()},[x,y,v]),C=(0,H.useMemo)(()=>u?CG(x,u,n):f?(f.default=g,CG(x,f,n)):x,[f,g,x,n,u]),F=CW(C),k=e=>{if(!o)return CY({schema:x,field:e,basePath:p,mapProperties:r,filterProperties:i,propsRecursion:a,values:s,isUseFormilyField:d})},A=()=>(0,rx.isValid)(l)?"object"===C.type?n?k():(0,V.jsx)(ne.ObjectField,{...F,name:l,basePath:p,children:k}):"array"===C.type?(0,V.jsx)(ne.ArrayField,{...F,name:l,basePath:p}):"void"===C.type?n?k():(0,V.jsx)(ne.VoidField,{...F,name:l,basePath:p,children:k}):d?(0,V.jsx)(ne.Field,{...F,name:l,basePath:p}):(0,V.jsx)(CD,{name:l,value:s,initialValue:s,basePath:p,schema:C}):k();return x?(0,V.jsx)(ne.SchemaContext.Provider,{value:x,children:(0,V.jsx)(CO,{refresh:w,children:A()})}):(0,V.jsx)(H.Fragment,{})});CQ.displayName="NocoBaseRecursionField";var CZ=l(58156),C0=l.n(CZ),C1=l(63560),C2=l.n(C1);let C8=Symbol("LAZY_COMPONENT_KEY"),C5=new Map;function C4(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(0===l.length){let t=(0,H.lazy)(()=>e().then(e=>{let t=e.default;return l[C8]=t,{default:t}})),l=e=>(0,V.jsx)(H.Suspense,{fallback:(0,V.jsx)(nx.A,{}),children:(0,V.jsx)(t,{...e})});return l}return l.reduce((t,l)=>{let n=(0,H.lazy)(()=>e().then(e=>{let n=(0,rw.get)(e,l);return t[l][C8]=n,{default:n}}));return t[l]=e=>(0,V.jsx)(H.Suspense,{fallback:(0,V.jsx)(nx.A,{}),children:(0,V.jsx)(n,{...e})}),t},{})}function C3(e,t){let l="function"==typeof t?t:e=>e[t],n=e.toString(),o=C5.get(n);if(null==o?void 0:o.error)throw o.error;if(null==o?void 0:o.module)return l(o.module);if(!(null==o?void 0:o.promise)){let t=o||{};throw t.promise=e().then(e=>(t.module=e,e)).catch(e=>{throw t.error=e,e}),C5.set(n,t),t.promise}throw o.promise}function C6(e,t){if(e)return e["x-app-version"]||(e["x-app-version"]=t),Object.keys(e.properties||{}).forEach(l=>{var n;C6(null==(n=e.properties)?void 0:n[l],t)}),e}var C9=JSON.parse('{"rE":"2.1.0-beta.40"}');function C7(e){return new Fr(e)}let Fe=e=>{e&&(e["x-uid"]||(e["x-uid"]=(0,rx.uid)()),Object.keys(e.properties||{}).forEach(t=>{Fe(e.properties[t])}))},Ft=e=>e,Fl=(e,t)=>{if(e&&t){for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)&&t[l]!==(null==e?void 0:e[l]))return!1;return!0}},Fn=(e,t)=>{if(e["x-uid"]&&e["x-uid"]===t["x-uid"])return[null,e.toJSON()];let l=e.toJSON(),n={...l,properties:{}},o=null,r=(e,l)=>{Object.keys(e||{}).forEach(n=>{let i=e[n];if(i["x-uid"]===t["x-uid"]){o=e[n];return}l.properties[n]={...i,properties:{}},r(null==i?void 0:i.properties,l.properties[n])})};return r(l.properties,n),[n,o]},Fo=e=>e;class Fr{get model(){return this.options.model}get query(){return this.options.query}loadAPIClientEvents(){let{api:e,t=Fo}=this.options;if(!e)return;let l=e=>{if(!e)return[];let t=Object.values(e.properties).length,l=[];return(e.mapProperties(e=>{e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].width=100/t,e["x-uid"]&&l.push({"x-uid":e["x-uid"],"x-component-props":e["x-component-props"]})}),e["x-uid"]&&l.length)?l:[]};this.on("insertAdjacent",async n=>{var o;let{onSuccess:r,current:i,position:a,schema:s,wrap:d,wrapped:u,removed:c}=n,p=[];if((null==u?void 0:u["x-component"])==="Grid.Col"&&(p=p.concat(l(u.parent))),(null==c?void 0:c["x-component"])==="Grid.Col"&&(p=p.concat(l(c.parent))),this.refresh(),!i["x-uid"])return;let m=await e.request({url:`/uiSchemas:insertAdjacent/${i["x-uid"]}?position=${a}`,method:"post",data:{schema:C6(s,this.appVersion),wrap:d}});p.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:p}),(null==c?void 0:c["x-uid"])&&await e.request({url:`/uiSchemas:remove/${c["x-uid"]}`,method:"post"}),null==r||r(null==m||null==(o=m.data)?void 0:o.data),yq.Ay.success(t("Saved successfully"),.2)}),this.on("patch",async l=>{let{schema:n}=l;this.refresh(),(null==n?void 0:n["x-uid"])&&(await e.request({url:"/uiSchemas:patch",method:"post",data:{...n}}),yq.Ay.success(t("Saved successfully"),.2))}),this.on("initializeActionContext",async t=>{let{schema:l}=t;(null==l?void 0:l["x-uid"])&&await e.request({url:"/uiSchemas:initializeActionContext",method:"post",data:{...l}})}),this.on("batchPatch",async l=>{let{schemas:n}=l;this.refresh(),await e.request({url:"/uiSchemas:batchPatch",method:"post",data:n}),yq.Ay.success(t("Saved successfully"),.2)}),this.on("remove",async n=>{let{removed:o}=n,r=[];(null==o?void 0:o["x-component"])==="Grid.Col"&&(r=l(o.parent)),this.refresh(),(null==o?void 0:o["x-uid"])&&(await e.request({url:`/uiSchemas:remove/${o["x-uid"]}`,method:"post"}),r.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:r}),yq.Ay.success(t("Saved successfully"),.2))})}prepareProperty(e){e.type||(e.type="void"),e.name||(e.name=(0,rx.uid)()),this.current["x-uid"]&&Fe(e)}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}async emit(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(!this.events[e])return;let[o,...r]=l;return Promise.all(this.events[e].map(e=>e.bind(this)({current:this.current,...o},...r)))}parentsIn(e){if(!e||!ne.Schema.isSchemaInstance(e))return!1;let t=this.current;for(;null==t?void 0:t.parent;){if(t.parent===e)return!0;t=t.parent}return!1}refresh(e){let{refresh:t}=this.options;return null==t?void 0:t(e)}deepMerge(e){let t={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly"},l={"x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(n=>{t[n]?(this.current[n]=e[n],this.updateModel(t[n],e[n])):l[n]?Object.keys(e[n]).forEach(t=>{C2()(this.current,[n,t],e[n][t]),this.updateModel([l[n],t],e[n][t])}):this.current[n]=e[n]}),this.emit("patch",{schema:e})}getSchemaAttribute(e,t){return C0()(this.current,e,t)}shallowMerge(e){let t={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly","x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(l=>{this.current[l]=e[l],t[l]&&this.updateModel(t[l],e[l])}),this.emit("patch",{schema:e})}updateModel(e,t){let l=l=>{C2()(l,e,t)};this.model&&l(this.model),this.query&&this.query.take(l)}insertAdjacent(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};switch(e){case"beforeBegin":return this.insertBeforeBegin(t,l);case"afterBegin":return this.insertAfterBegin(t,l);case"beforeEnd":return this.insertBeforeEnd(t,l);case"afterEnd":return this.insertAfterEnd(t,l)}}recursiveRemoveIfNoChildren(e,t){let l;if(!e)return;let n=e,o=null==t?void 0:t.breakRemoveOn;for(;n;){if("function"==typeof o){if(o(n))break}else if(Fl(n,o))break;if(Object.keys(n.properties||{}).length>0)break;n.parent&&(l=n.parent.removeProperty(n.name)),n=n.parent}return l}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:l,removeParentsIfNoChildren:n}=t,o=e||this.current,r=o.parent.removeProperty(o.name);if(n){let e=this.recursiveRemoveIfNoChildren(o.parent,{breakRemoveOn:l});e&&(r=e)}return this.emit("remove",{removed:r})}removeWithoutEmit(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:l,removeParentsIfNoChildren:n}=t,o=e||this.current,r=o.parent.removeProperty(o.name);if(n){let e=this.recursiveRemoveIfNoChildren(o.parent,{breakRemoveOn:l});e&&(r=e)}return r}insertBeforeBeginOrAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current)||!ne.Schema.isSchemaInstance(e)||this.current.parent!==e.parent)return;let l=0,n=0;return this.current.parent.mapProperties((t,o,r)=>{this.current.name===o&&(n=r),e.name===o&&(l=r)}),l>n?this.insertBeforeBegin(e,t):this.insertAfterEnd(e,t)}insertBeforeBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current))return;let l={onSuccess:t.onSuccess},{wrap:n=Ft,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ne.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=wc()(e));let i={},a=!1,s=0,d=0;this.current.parent.mapProperties((e,t)=>{t===this.current.name&&(d=s,a=!0,++s),e["x-index"]=s,++s,a&&(i[t]=e,this.current.parent.removeProperty(t))}),this.prepareProperty(e);let u=n(e),c=this.current.parent.addProperty(u.name||(0,rx.uid)(),u);c["x-index"]=d,c.parent=this.current.parent,this.current.parent.setProperties(i);let[p,m]=Fn(c,e);this.emit("insertAdjacent",{position:"beforeBegin",schema:m,wrapped:u,wrap:p,...l})}insertAfterBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current))return;let l={onSuccess:t.onSuccess},{wrap:n=Ft,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ne.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=wc()(e));let i={},a=1;this.current.mapProperties((e,t)=>{e["x-index"]=a,++a,i[t]=e}),this.current.properties={},this.prepareProperty(e);let s=n(e),d=this.current.addProperty(s.name||(0,rx.uid)(),s);d["x-index"]=0,d.parent=this.current,this.current.setProperties(i);let[u,c]=Fn(d,e);this.emit("insertAdjacent",{position:"afterBegin",schema:c,wrap:u,wrapped:s,...l})}insertBeforeEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current))return;delete e["x-index"];let l={onSuccess:t.onSuccess},{wrap:n=Ft,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ne.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=wc()(e));this.prepareProperty(e);let i=n(e),a=this.current.addProperty(i.name||(0,rx.uid)(),i);a.parent=this.current;let[s,d]=Fn(a,e);return this.emit("insertAdjacent",{position:"beforeEnd",schema:d,wrap:s,wrapped:i,...l})}insertAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current))return;let l={onSuccess:null==t?void 0:t.onSuccess},{wrap:n=Ft,breakRemoveOn:o,removeParentsIfNoChildren:r}=t,i=0,a=0,s=!1,d={};if(this.current.parent.mapProperties((e,t)=>{e["x-index"]=i,t===this.current.name&&(a=++i,s=!0),++i,s&&t!==this.current.name&&(d[t]=e,this.current.parent.removeProperty(t))}),ne.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o})),e.parent=null}else e&&(e=wc()(e));this.prepareProperty(e);let u=n(e),c=this.current.parent.addProperty(u.name||(0,rx.uid)(),u);c.parent=this.current.parent,c["x-index"]=a,this.current.parent.setProperties(d);let[p,m]=Fn(c,e);this.emit("insertAdjacent",{position:"afterEnd",schema:m,wrap:p,wrapped:u,...l})}constructor(e){this.events={},this.options=e,this.current=e.current,this.appVersion=e.appVersion}}function Fi(){let e=(0,H.useContext)(ne.SchemaOptionsContext),t=(0,H.useMemo)(()=>(null==e?void 0:e.components)||{},[e]);return e=>{if(!e)return null;if("string"!=typeof e)return e;let l=C0()(t,e);return l||console.error(`[nocobase]: Component "${e}" not found`),l}}function Fa(){let{designable:e,setDesignable:t,refresh:l,reset:n}=(0,H.useContext)(Cf),o=(0,H.useContext)(ne.SchemaOptionsContext),r=(0,H.useMemo)(()=>(null==o?void 0:o.components)||{},[o]),i=(0,H.useMemo)(()=>()=>(0,V.jsx)(V.Fragment,{}),[]),a=(0,bh.A)(),s=CV(),d=CL(),u=(0,H.useCallback)(e=>{null==l||l(),a(),null==s||s(e),null==d||d()},[l,a,s,d]),c=(0,ne.useField)(),p=(0,ne.useFieldSchema)(),m=wv(),{t:h}=(0,lj.B)(),f=(0,H.useMemo)(()=>C7({t:h,api:m,refresh:u,current:p,model:c,appVersion:C9.rE}),[h,m,u,p,c]);(0,H.useEffect)(()=>{f.loadAPIClientEvents()},[f]);let{isMobileLayout:g}=bY();return{dn:f,designable:!g&&e,reset:n,refresh:u,setDesignable:t,DesignableBar:i,findComponent:(0,H.useCallback)(e=>{if(!e)return null;if("string"!=typeof e)return e;let t=C0()(r,e);return(null==t?void 0:t[C8])??t},[C0()]),on:f.on.bind(f),patch:(0,H.useCallback)((e,t)=>{let l=e=>{Object.keys(e).forEach(t=>{let l=e[t];"title"===t&&(c.title=l,p.title=l),"x-decorator-props"===t&&(c.decoratorProps||(c.decoratorProps={}),p["x-decorator-props"]||(p["x-decorator-props"]={}),Object.keys(l).forEach(e=>{c.decoratorProps[e]=l[e],p["x-decorator-props"][e]=l[e]})),"x-component-props"===t&&(c.componentProps||(c.componentProps={}),p["x-component-props"]||(p["x-component-props"]={}),Object.keys(l).forEach(e=>{c.componentProps[e]=l[e],p["x-component-props"][e]=l[e]}))})};if("string"==typeof e){let n={};return C2()(n,e,t),l(n)}l(e),u()},[f]),shallowMerge:(0,H.useCallback)(e=>{f.shallowMerge(e)},[f]),deepMerge:(0,H.useCallback)(e=>{f.deepMerge(e)},[f]),remove:(0,H.useCallback)((e,t)=>{f.remove(e,t)},[f]),insertAdjacent:(0,H.useCallback)((e,t,l)=>{f.insertAdjacent(e,t,l)},[f]),insertBeforeBegin:(0,H.useCallback)(e=>{f.insertBeforeBegin(e)},[f]),insertAfterBegin:(0,H.useCallback)(e=>{f.insertAfterBegin(e)},[f]),insertBeforeEnd:(0,H.useCallback)(e=>{f.insertBeforeEnd(e)},[f]),insertAfterEnd:(0,H.useCallback)(e=>{f.insertAfterEnd(e)},[f])}}let Fs=()=>void 0,Fd=(e,t,l)=>{let n;return rC().isFunction(e)?n=e:(n=t[e])||console.error(`${l} is not registered`),n||Fs},Fu=(e,t)=>{let l;if(!e)return Fs;if(rC().isFunction(e))return e;for(let n of e.split("."))l=Fd(n,l||t,e);return l};function Fc(e,t){return Fu(e,(0,ne.useExpressionScope)())(t)}function Fp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=t.displayName||e.displayName||e.name,n=t=>{let{dn:l,findComponent:o}=Fa(),r=Fc((0,H.useMemo)(()=>{let e=l.getSchemaAttribute("x-component"),t=l.getSchemaAttribute("x-decorator"),r=l.getSchemaAttribute("x-use-component-props"),i=l.getSchemaAttribute("x-use-decorator-props");return e&&r&&o(e)===n?r:t&&i&&o(t)===n?i:void 0},[l]),t),i=(0,H.useMemo)(()=>({...t,...r}),[r,t]);return(0,V.jsx)(H.Suspense,{fallback:(0,V.jsx)(nx.A,{}),children:(0,V.jsx)(e,{...i,children:t.children})})};return e.displayName=l,n.displayName=`withSchemaProps(${l})`,n}var Fm=l(16933),Fh=l(60152);let Ff=new Map;function Fg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;Ff.set(e.toLowerCase(),t)}function Fv(e){return!!e&&Ff.has(e.toLowerCase())}function Fy(e){Object.keys(e).forEach(t=>{Fg(t,e[t])})}Object.keys(rh).forEach(e=>{Fg(e,rh[e])});let Fx=e=>{let{type:t="",component:l,...n}=e;if(l)return(0,V.jsx)(Fm.A,{component:l,...n});if(t&&Ff.has(t.toLowerCase())){let e=Ff.get(t.toLowerCase());return(0,V.jsx)(e,{...n})}return t&&o?(0,V.jsx)(o,{type:t}):null};Fx.createFromIconfontCN=e=>{o=(0,Fh.A)(e)},Fx.register=e=>{Fy(e)};let Fb=(0,H.createContext)(null),FS=e=>{let{children:t,parent:l}=e;return(0,V.jsx)(Fb.Provider,{value:{parent:l},children:t})},Fw=()=>{let e=H.useContext(Fb);return null==e?void 0:e.parent};class FC{setData(e){this.data=e}setParentRecord(e){this.parentRecord=e}constructor(e){const{data:t,parentRecord:l,isNew:n}=e;this.isNew=n,this.data=t,this.parentRecord=l}}let FF=(0,H.createContext)(null);FF.displayName="CollectionRecordContext";let Fk=H.memo(e=>{let{isNew:t,record:l,parentRecord:n,children:o}=e,r=(0,H.useMemo)(()=>n?n instanceof FC?n:new FC({data:n}):l instanceof FC?l.parentRecord:void 0,[n,l]),i=(0,H.useMemo)(()=>{let e;return l?l instanceof FC?(e=l).isNew=l.isNew||t:e=new FC({data:l,isNew:t}):e=new FC({isNew:t}),e.setParentRecord(r),e},[l,r,t]);return(0,V.jsx)(FF.Provider,{value:i,children:o})});function FA(){return(0,H.useContext)(FF)}function FP(){let e=FA();return null==e?void 0:e.data}function Fj(){let e=FA();return null==e?void 0:e.parentRecord}function FM(){var e;let t=FA();return null==t||null==(e=t.parentRecord)?void 0:e.data}Fk.displayName="CollectionRecordProvider";let FI=H.createContext(null),FT=H.createContext(null),FR=H.memo(e=>{var t,l;let{t:n}=(0,lj.B)(),o=FP(),r=enM(),i=FE();return(0,V.jsx)(FT.Provider,{value:{name:"$nParentPopupRecord",title:n("Parent popup record"),value:(null==(t=e.parent)?void 0:t.recordData)||(null==i?void 0:i.value),collection:(null==(l=e.parent)?void 0:l.collection)||(null==i?void 0:i.collection)},children:(0,V.jsx)(FI.Provider,{value:{name:"$nPopupRecord",title:n("Current popup record"),value:e.recordData||o,collection:e.collection||r},children:e.children})})});FR.displayName="VariablePopupRecordProvider";let FE=()=>H.useContext(FI),FN=()=>H.useContext(FT);class FD{get app(){return this.dataSourceManager.app}get key(){return this.options.key}get displayName(){return this.options.displayName}get status(){return this.options.status}get errorMessage(){return this.options.errorMessage}get collections(){return this.collectionManager.getCollections()||[]}getOptions(){return this.options}setOptions(e){Object.assign(this.options,e)}getOption(e){return this.options[e]}addReloadCallback(e){this.reloadCallbacks.includes(e)||this.reloadCallbacks.push(e)}removeReloadCallback(e){this.reloadCallbacks=this.reloadCallbacks.filter(t=>t!==e)}get flowEngineDataSourceManager(){var e;return null==(e=this.app.flowEngine)?void 0:e.context.dataSourceManager}async reload(){let e=await this.getDataSource(),t=this.flowEngineDataSourceManager;return t&&(t.upsertDataSource(this.options),t.getDataSource(this.key).upsertCollections(e.collections||[],{clearFields:!0})),this.setOptions(e),this.collectionManager.setCollections(e.collections||[]),this.reloadCallbacks.forEach(t=>t(e.collections)),this.options}constructor(e,t){this.options=e,this.dataSourceManager=t,this.reloadCallbacks=[],this.collectionManager=new enE(e.collections,this)}}class FB extends FD{getDataSource(){return{collections:this.collections}}}class F${addCollectionTemplates(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.reduce((e,t)=>{let l=new t(this);return e[l.name]=l,e},{});return Object.assign(this.collectionTemplateInstances,t),this.dataSourceManager.getDataSources().forEach(e=>{let l=e.collectionManager.getCollections(e=>t[e.template]);e.collectionManager.reAddCollections(l)}),t}getCollectionTemplate(e){return this.collectionTemplateInstances[e]}getCollectionTemplates(e){return Object.values(this.collectionTemplateInstances).filter(t=>{var l,n;return!e||!t.supportDataSourceType&&!t.notSupportDataSourceType||(t.supportDataSourceType?null==(l=t.supportDataSourceType)?void 0:l.includes(e):t.notSupportDataSourceType?!(null==(n=t.notSupportDataSourceType)?void 0:n.includes(e)):void 0)}).sort((e,t)=>(e.order||0)-(t.order||0))}constructor(e,t){this.dataSourceManager=t,this.collectionTemplateInstances={},this.addCollectionTemplates(e)}}var FO=l(84795);let Fq=fD()(),F_=(0,C.css)`
|
|
881
|
+
`,defaultValue:"h:mm a",formats:["hh:mm:ss a","HH:mm:ss"],timeFormat:!0},default:"HH:mm:ss",enum:[{label:(0,Sm.b)({format:"hh:mm:ss a"}),value:"hh:mm:ss a"},{label:(0,Sm.b)({format:"HH:mm:ss"}),value:"HH:mm:ss"},{label:"custom",value:"custom"}]}},SC={type:"array",title:'{{t("Options")}}',"x-decorator":"FormItem","x-component":"ArrayTable","x-component-props":{pagination:{pageSize:1e3}},items:{type:"object",properties:{column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:50,title:"",align:"center"},properties:{sort:{type:"void","x-component":"ArrayTable.SortHandle"}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Option value")}}'},properties:{value:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"Input"}}},column3:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Option label")}}'},properties:{label:{type:"string",required:!0,"x-decorator":"FormItem","x-component":"Input"}}},column4:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:'{{t("Color")}}'},properties:{color:{type:"string","x-decorator":"FormItem","x-component":"ColorSelect"}}},column5:{type:"void","x-component":"ArrayTable.Column","x-component-props":{title:"",dataIndex:"operations",fixed:"right"},properties:{item:{type:"void","x-component":"FormItem",properties:{remove:{type:"void","x-component":"ArrayTable.Remove"}}}}}}},properties:{add:{type:"void","x-component":"ArrayTable.Addition","x-component-props":{randomValue:!0},title:"{{t('Add option')}}"}}},SF={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input","x-validator":"uid",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"}},Sk={type:"string",title:'{{t("Options")}}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{multiple:!0},enum:"{{collections}}"};class SA{addComponentOption(e){if(!this.componentOptions){var t,l,n,o,r,i;this.componentOptions=[];let e=null==(l=this.default)||null==(t=l.uiSchema)?void 0:t["x-component"],a=null==(o=this.default)||null==(n=o.uiSchema)?void 0:n["x-component-props"];if(e){let t=(null==(i=this.default)||null==(r=i.uiSchema)?void 0:r.type)||"string",l=(0,eh.tval)(e.startsWith("Input")?(0,U.capitalize)(t):e.split(".").pop());this.componentOptions=[{label:l,value:e,useProps:()=>a||{}}]}}this.componentOptions.push(e)}getConfigureFormProperties(e){var t,l,n,o;let r=(null==(l=this.configure)||null==(t=l.getConfigureFormProperties)?void 0:t.call(l,e))||(null==(n=this.configure)?void 0:n.properties)||{},i=this.hasDefaultValue?this.getDefaultValueProperty():{},a=null==e?void 0:e.view,s=(null==e?void 0:e.template)==="sql"||(null==e?void 0:e.sql),d=[...new Set([...this.availableValidationOptions,"required"])],u=a||s||!this.validationType?{}:{validation:{title:'{{ t("Validation") }}',required:!1,"x-decorator":"FormItem","x-component":"FieldValidation","x-component-props":{type:this.validationType,availableValidationOptions:d,excludeValidationOptions:[...new Set(this.excludeValidationOptions)],isAssociation:this.isAssociation}}};return{...(0,U.cloneDeep)({...SF,...null==(o=this)?void 0:o.properties,...r}),...i,...u}}getDefaultValueProperty(){var e,t,l,n;return{defaultValue:{...(0,U.cloneDeep)(null==(t=this)||null==(e=t.default)?void 0:e.uiSchema),...null==(n=this)||null==(l=n.properties)?void 0:l.uiSchema,required:!1,title:'{{ t("Default value") }}',"x-decorator":"FormItem"}}}addOperator(e){var t;iu(this.filterable);let l=[...id(null==(t=this.filterable)?void 0:t.operators)];(0,U.set)(this,"filterable.operators",l),l.find(t=>t.value===e.value)||l.push(e)}constructor(e){this.collectionFieldInterfaceManager=e,this.availableValidationOptions=[]}}class SP extends SA{constructor(...e){super(...e),this.name="checkbox",this.type="object",this.group="choices",this.order=1,this.title='{{t("Checkbox")}}',this.default={type:"boolean",uiSchema:{type:"boolean","x-component":"Checkbox"}},this.availableTypes=["boolean","integer","bigInt","bit"],this.hasDefaultValue=!0,this.properties={...SF},this.filterable={operators:"boolean"}}}class Sj extends SA{constructor(...e){super(...e),this.name="checkboxGroup",this.type="object",this.group="choices",this.order=5,this.title='{{t("Checkbox group")}}',this.default={interface:"checkboxGroup",type:"array",defaultValue:[],uiSchema:{type:"string","x-component":"Checkbox.Group"}},this.availableTypes=["array","json"],this.hasDefaultValue=!0,this.properties={...SF,"uiSchema.enum":SC},this.filterable={operators:"array"}}}class SM extends SA{constructor(...e){super(...e),this.name="collection",this.type="string",this.group="advanced",this.order=5,this.title='{{t("Collection selector")}}',this.description='{{t("Providing certain collections as options for users, typically used in polymorphic or inheritance scenarios")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"CollectionSelect"}},this.availableTypes=["string"],this.hasDefaultValue=!1,this.properties={...SF,"uiSchema.enum":Sk},this.filterable={operators:"collection"}}}class SI extends SA{constructor(...e){super(...e),this.name="color",this.type="object",this.group="basic",this.order=10,this.title='{{t("Color")}}',this.default={type:"string",uiSchema:{type:"string","x-component":"ColorPicker"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.properties={...SF},this.filterable={operators:"string"}}}class ST extends SA{constructor(...e){super(...e),this.name="createdAt",this.type="object",this.group="systemInfo",this.order=1,this.title='{{t("Created at")}}',this.sortable=!0,this.default={type:"date",field:"createdAt",uiSchema:{type:"datetime",title:'{{t("Created at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},this.description='{{t("Store the creation time of each record")}}',this.availableTypes=[],this.properties={...SF,...SS},this.filterable={operators:"datetime"},this.titleUsable=!0}}class SR extends SA{constructor(...e){super(...e),this.name="createdBy",this.type="object",this.group="systemInfo",this.order=3,this.title='{{t("Created by")}}',this.isAssociation=!0,this.default={type:"belongsTo",target:"users",foreignKey:"createdById",uiSchema:{type:"object",title:'{{t("Created by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},this.availableTypes=["belongsTo"],this.properties={...SF},this.filterable={nested:!0,children:[]},this.description='{{t("Store the creation user of each record")}}'}}class SE extends SA{constructor(...e){super(...e),this.name="datetime",this.type="object",this.group="datetime",this.order=1,this.title='{{t("Datetime (with time zone)")}}',this.sortable=!0,this.default={type:"date",defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,timezone:!0,uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{showTime:!1,utc:!0}}},this.availableTypes=["date","string","datetime","datetimeTz"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...SF,...SS,defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp on update")}}'},"uiSchema.x-component-props.gmt":{type:"boolean",title:'{{t("GMT")}}',"x-hidden":!0,"x-component":"Checkbox","x-content":'{{t("Use the same time zone (GMT) for all users")}}',"x-decorator":"FormItem",default:!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class SN extends SA{constructor(...e){super(...e),this.name="email",this.type="object",this.group="basic",this.order=4,this.title='{{t("Email")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Input","x-validator":"email"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","email","pattern"],this.properties={...SF,unique:Sh},this.filterable={operators:"string"},this.titleUsable=!0}}class SD extends SA{constructor(...e){super(...e),this.name="icon",this.type="object",this.group="basic",this.order=10,this.title='{{t("Icon")}}',this.default={type:"string",uiSchema:{type:"string","x-component":"IconPicker"}},this.availableTypes=["string"],this.hasDefaultValue=!0,this.properties={...SF}}}class SB extends SA{constructor(...e){super(...e),this.name="id",this.type="object",this.group="systemInfo",this.order=0,this.title='{{t("ID")}}',this.hidden=!0,this.sortable=!0,this.default={name:"id",type:"bigInt",autoIncrement:!0,primaryKey:!0,allowNull:!1,uiSchema:{type:"number",title:'{{t("ID")}}',"x-component":"InputNumber","x-read-pretty":!0}},this.availableTypes=["bigInt","integer"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,default:"ID","x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"}},this.filterable={operators:"id"},this.description='{{t("Primary key, unique identifier, self growth") }}',this.titleUsable=!0}}let S$=e=>e,SO=e=>{if((0,rx.isArr)(e)){for(let t=0;t<e.length;t++)if((0,rx.isValid)(e[t]))return!1;return!0}if(null==e?void 0:e.getCurrentContent){var t;return!(null==(t=e.getCurrentContent())?void 0:t.hasText())}return(0,rx.isEmpty)(e)};(0,b2.registerValidateRules)({username:e=>/^[^@<>"'/]{1,50}$/.test(e)||S$("Must be 1-50 characters in length (excluding @<>\"'/)"),required:(e,t)=>!1===t.required?"":("string"==typeof e&&(e=e.trim()),SO(e)?t.message:"")});class Sq extends SA{constructor(...e){super(...e),this.name="input",this.type="object",this.group="basic",this.order=1,this.title='{{t("Single line text")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.sortable=!0,this.default={interface:"input",type:"string",uiSchema:{type:"string","x-component":"Input"}},this.availableTypes=["string","uid"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.properties={...SF,trim:{type:"boolean","x-content":'{{t("Automatically remove heading and tailing spaces")}}',"x-decorator":"FormItem","x-component":"Checkbox"},layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}}},this.filterable={operators:"string"},this.titleUsable=!0}}(0,ry.registerValidateFormats)({odd:/^-?\d*[13579]$/,even:/^-?\d*[02468]$/});class S_ extends SA{constructor(...e){super(...e),this.name="integer",this.type="object",this.group="basic",this.order=6,this.title='{{t("Integer")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier, self growth")}}',this.sortable=!0,this.default={type:"bigInt",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"},"x-validator":"integer"}},this.availableTypes=["bigInt","integer","sort","snowflakeId"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["precision"],this.properties={...SF,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}},autoIncrement:Sg},this.filterable={operators:"number"},this.titleUsable=!0}}(0,ry.registerValidateRules)({json(e){try{return JSON.parse(e),!0}catch(e){return{type:"error",message:e.message}}}});class SL extends SA{constructor(...e){super(...e),this.name="json",this.type="object",this.group="advanced",this.order=4,this.title='{{t("JSON")}}',this.sortable=!1,this.default={type:"json",uiSchema:{type:"object","x-component":"Input.JSON","x-component-props":{autoSize:{minRows:5}},default:null}},this.availableTypes=["json","array","set","jsonb","text","circle","lineString","point","polygon"],this.hasDefaultValue=!0,this.properties={...SF,jsonb:{title:"JSONB","x-component":"Checkbox"}},this.configure={items:[{name:"jsonb",title:"JSONB",component:"Checkbox",schema:{"x-content":" "},hidden:e=>{let{context:t}=e,l=t.isDialect;return"function"!=typeof l||!l("postgres")},disabled:e=>{let{context:t}=e;return!!t.disabledJSONB}}]}}}class SV extends SA{initialize(e){"belongsToMany"===e.type&&(e.through||(e.through=`t_${(0,rx.uid)()}`),e.foreignKey||(e.foreignKey=`f_${(0,rx.uid)()}`),e.otherKey||(e.otherKey=`f_${(0,rx.uid)()}`),e.sourceKey||(e.sourceKey="id"),e.targetKey||(e.targetKey="id"))}constructor(...e){super(...e),this.name="m2m",this.type="object",this.group="relation",this.order=6,this.title='{{t("Many to many")}}',this.description='{{t("Many to many description")}}',this.isAssociation=!0,this.default={type:"belongsToMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}},reverseField:{interface:"m2m",type:"belongsToMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}}}},this.availableTypes=["belongsToMany"],this.validationType="object",this.properties={...SF,type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"string",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{through:{type:"string",title:'{{t("Through collection")}}',description:'{{ t("Generated automatically if left blank") }}',"x-decorator":"FormItem","x-disabled":"{{ !createOnly }}","x-component":"ThroughCollection","x-component-props":{allowClear:!0}}}},col13:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key 1")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly||override }}"}}},col23:{type:"void","x-component":"Grid.Col",properties:{}}}},row3:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{}},col22:{type:"void","x-component":"Grid.Col",properties:{otherKey:{type:"string",title:'{{t("Foreign key 2")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly||override }}"}}},col23:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',"x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}",description:"{{t('Field values must be unique.')}}"}}}}}}},...Sb},this.filterable={nested:!0,children:[]}}}class Sz extends SA{constructor(...e){super(...e),this.name="m2o",this.type="object",this.group="relation",this.order=5,this.title='{{t("Many to one")}}',this.description='{{t("Many to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"o2m",type:"hasMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}}}},this.availableTypes=["belongsTo"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}"}}}}}}},...Sx,...Sb},this.filterable={nested:!0,children:[]}}}class SK extends SA{constructor(...e){super(...e),this.name="markdown",this.type="object",this.title='{{t("Markdown")}}',this.group="media",this.default={type:"text",uiSchema:{type:"string","x-component":"Markdown"}},this.availableTypes=["text","json","string"],this.hasDefaultValue=!0,this.properties={...SF},this.filterable={operators:"bigField"}}}class SU extends SA{constructor(...e){super(...e),this.name="multipleSelect",this.type="object",this.group="choices",this.order=3,this.title='{{t("Multiple select")}}',this.default={type:"array",defaultValue:[],uiSchema:{type:"array","x-component":"Select","x-component-props":{mode:"multiple"},enum:[]}},this.availableTypes=["array","json"],this.hasDefaultValue=!0,this.properties={...SF,"uiSchema.enum":SC},this.filterable={operators:"array"}}}class SW extends SA{constructor(...e){super(...e),this.name="number",this.type="object",this.group="basic",this.order=7,this.title='{{t("Number")}}',this.sortable=!0,this.default={type:"double",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"}}},this.availableTypes=["double","float","decimal"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["integer"],this.properties={type:{type:"string",title:'{{t("Data type")}}',"x-component":"Select","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:"double",enum:[{label:'{{t("Double")}}',value:"double"},{label:'{{t("Float")}}',value:"float"},{label:'{{t("Decimal")}}',value:"decimal"}]},...SF,unique:Sh,"uiSchema.x-component-props.step":{type:"string",title:'{{t("Precision(UI)")}}',"x-component":"Select","x-decorator":"FormItem",default:"1",enum:[{value:"1",label:"1"},{value:"0.1",label:"1.0"},{value:"0.01",label:"1.00"},{value:"0.001",label:"1.000"},{value:"0.0001",label:"1.0000"},{value:"0.00001",label:"1.00000"},{value:"0.000001",label:"1.000000"},{value:"0.0000001",label:"1.0000000"},{value:"0.00000001",label:"1.00000000"}]},precision:{type:"string",title:'{{t("Precision")}}',"x-component":"InputNumber","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:10},scale:{type:"string",title:'{{t("Scale")}}',"x-component":"InputNumber","x-decorator":"FormItem","x-disabled":"{{ !createOnly }}",default:2}},this.filterable={operators:"number"},this.titleUsable=!0}}class SH extends SA{constructor(...e){super(...e),this.name="obo",this.type="object",this.group="relation",this.order=3.1,this.title='{{t("One to one (belongs to)")}}',this.description='{{t("One to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"oho",type:"hasOne",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["belongsTo"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}"}}}}}}},...Sx,...Sb},this.filterable={nested:!0,children:[]}}}class SG extends SA{constructor(...e){super(...e),this.name="o2m",this.type="object",this.group="relation",this.order=4,this.title='{{t("One to many")}}',this.description='{{t("One to many description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"hasMany",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!0}},reverseField:{interface:"m2o",type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["hasMany"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection"}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}}}},row3:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{}},col22:{type:"void","x-component":"Grid.Col",properties:{targetKey:{type:"string",title:'{{t("Target key")}}',"x-decorator":"FormItem","x-component":"TargetKey","x-disabled":"{{ !createOnly }}",description:"{{t('Field values must be unique.')}}"}}}}}}},...Sx,...Sb},this.filterable={nested:!0,children:[]}}}class SY extends SA{constructor(...e){super(...e),this.name="oho",this.type="object",this.group="relation",this.order=3,this.title='{{t("One to one (has one)")}}',this.description='{{t("One to one description")}}',this.isAssociation=!0,this.validationType="object",this.default={type:"hasOne",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}},reverseField:{interface:"obo",type:"belongsTo",uiSchema:{"x-component":"AssociationField","x-component-props":{multiple:!1}}}},this.availableTypes=["hasOne"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},type:Sy,grid:{type:"void","x-component":"Grid",properties:{row1:{type:"void","x-component":"Grid.Row",properties:{col11:{type:"void","x-component":"Grid.Col",properties:{source:{type:"void",title:'{{t("Source collection")}}',"x-decorator":"FormItem","x-component":"SourceCollection","x-disabled":!0}}},col12:{type:"void","x-component":"Grid.Col",properties:{target:{type:"string",title:'{{t("Target collection")}}',required:!0,"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}"}}}}},row2:{type:"void","x-component":"Grid.Row",properties:{col21:{type:"void","x-component":"Grid.Col",properties:{sourceKey:{type:"string",title:'{{t("Source key")}}',description:"{{t('Field values must be unique.')}}","x-decorator":"FormItem","x-component":"SourceKey","x-disabled":"{{ !createOnly }}"}}},col22:{type:"void","x-component":"Grid.Col",properties:{foreignKey:{type:"string",title:'{{t("Foreign key")}}',required:!0,default:'{{ useNewId("f_") }}',description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}","x-decorator":"FormItem","x-component":"ForeignKey","x-validator":"uid","x-disabled":"{{ !createOnly }}"}}}}}}},...Sx,...Sb},this.filterable={nested:!0,children:[]}}}class SJ extends SA{constructor(...e){super(...e),this.name="password",this.type="object",this.group="basic",this.order=9,this.title='{{t("Password")}}',this.default={type:"password",hidden:!0,uiSchema:{type:"string","x-component":"Password"}},this.availableTypes=["password","string"],this.hasDefaultValue=!0,this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.properties={...SF,unique:Sh},this.filterable={operators:"string"}}}(0,ry.registerValidateRules)({percentMode(e,t){let{maxValue:l,minValue:n}=t;return l&&e>l?{type:"error",message:`${S$("The field value cannot be greater than ")}${100*l}%`}:!n||!(e<n)||{type:"error",message:`${S$("The field value cannot be less than ")}${100*n}%`}},percentFormats(e,t){let{percentFormat:l}=t;return!e||"Integer"!==l||!1!==/^-?[1-9]\d*$/.test((100*e).toString())||{type:"error",message:`${S$("The field value is not an integer number")}`}}});class SX extends SA{constructor(...e){super(...e),this.name="percent",this.type="object",this.group="basic",this.order=8,this.title='{{t("Percent")}}',this.sortable=!0,this.default={type:"float",uiSchema:{type:"string","x-component":"Percent","x-component-props":{stringMode:!0,step:"1",addonAfter:"%"}}},this.availableTypes=["float","double","decimal"],this.hasDefaultValue=!0,this.validationType="number",this.excludeValidationOptions=["integer"],this.properties={...SF,unique:Sh,"uiSchema.x-component-props.step":{type:"string",title:'{{t("Precision")}}',"x-component":"Select","x-decorator":"FormItem",default:"1",enum:[{value:"1",label:"1%"},{value:"0.1",label:"1.0%"},{value:"0.01",label:"1.00%"},{value:"0.001",label:"1.000%"},{value:"0.0001",label:"1.0000%"},{value:"0.00001",label:"1.00000%"}]}},this.filterable={operators:"number"},this.titleUsable=!0}}class SQ extends SA{constructor(...e){super(...e),this.name="phone",this.type="object",this.group="basic",this.order=3,this.title='{{t("Phone")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Input","x-component-props":{type:"tel"}}},this.availableTypes=["string"],this.validationType="string",this.availableValidationOptions=["min","max","length","pattern"],this.hasDefaultValue=!0,this.properties={...SF,unique:Sh},this.filterable={operators:"string"},this.titleUsable=!0}}class SZ extends SA{constructor(...e){super(...e),this.name="radioGroup",this.type="object",this.group="choices",this.order=4,this.title='{{t("Radio group")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Radio.Group"}},this.availableTypes=["string","integer","boolean","integer"],this.hasDefaultValue=!0,this.properties={...SF,"uiSchema.enum":SC},this.filterable={operators:"enumType"},this.titleUsable=!0}}class S0 extends SA{constructor(...e){super(...e),this.name="richText",this.type="object",this.group="media",this.order=2,this.title='{{t("Rich Text")}}',this.default={interface:"richText",type:"text",uiSchema:{type:"string","x-component":"RichText"}},this.availableTypes=["text","json","string"],this.hasDefaultValue=!0,this.properties={...SF},this.filterable={operators:"bigField"}}}class S1 extends SA{constructor(...e){super(...e),this.name="select",this.type="object",this.group="choices",this.order=2,this.title='{{t("Single select")}}',this.sortable=!0,this.default={type:"string",uiSchema:{type:"string","x-component":"Select",enum:[]}},this.availableTypes=["string","bigInt","boolean"],this.hasDefaultValue=!0,this.properties={...SF,"uiSchema.enum":SC},this.filterable={operators:"enumType"},this.titleUsable=!0}}class S2 extends SA{constructor(...e){super(...e),this.name="snowflakeId",this.type="object",this.group="advanced",this.order=0,this.title='{{t("Snowflake ID (53-bit)")}}',this.primaryKeyDescription='{{t("Primary key, distributed uniqueness, time-ordering")}}',this.hidden=!1,this.sortable=!0,this.default={type:"snowflakeId",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,separator:"0.00",step:"1"},"x-validator":"integer"}},this.availableTypes=["snowflakeId"],this.properties={...SF,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}}},this.filterable={operators:"number"},this.description='{{t("A 53-bit Snowflake ID designed to be compatible with JavaScript’s safe integer range, providing both time-ordering and uniqueness.") }}',this.titleUsable=!0}}class S8 extends SA{constructor(...e){super(...e),this.name="tableoid",this.type="object",this.group="systemInfo",this.order=0,this.title='{{t("Table OID")}}',this.sortable=!0,this.default={name:"__collection",type:"virtual",uiSchema:{type:"string",title:'{{t("Table OID")}}',"x-component":"CollectionSelect","x-component-props":{isTableOid:!0},"x-read-pretty":!0}},this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":!0,"x-decorator":"FormItem","x-component":"Input"}},this.filterable={operators:"tableoid"}}}class S5 extends SA{constructor(...e){super(...e),this.name="textarea",this.type="object",this.group="basic",this.order=2,this.title='{{t("Long text")}}',this.default={interface:"textarea",type:"text",uiSchema:{type:"string","x-component":"Input.TextArea"}},this.availableTypes=["text","json","string"],this.validationType="string",this.availableValidationOptions=["min","max","length","case","pattern"],this.hasDefaultValue=!0,this.titleUsable=!0,this.properties={...SF,trim:{type:"boolean","x-content":'{{t("Automatically remove heading and tailing spaces")}}',"x-decorator":"FormItem","x-component":"Checkbox"}},this.filterable={operators:"string"}}}class S4 extends SA{constructor(...e){super(...e),this.name="time",this.type="object",this.group="datetime",this.order=4,this.title='{{t("Time")}}',this.sortable=!0,this.default={type:"time",uiSchema:{type:"string","x-component":"TimePicker"}},this.availableTypes=["time"],this.hasDefaultValue=!0,this.properties={...SF,...Sw},this.filterable={operators:"time"},this.titleUsable=!0}}class S3 extends SA{constructor(...e){super(...e),this.name="updatedAt",this.type="object",this.group="systemInfo",this.order=2,this.title='{{t("Last updated at")}}',this.sortable=!0,this.default={type:"date",field:"updatedAt",uiSchema:{type:"datetime",title:'{{t("Last updated at")}}',"x-component":"DatePicker","x-component-props":{},"x-read-pretty":!0}},this.description='{{t("Store the last update time of each record")}}',this.availableTypes=[],this.properties={...SF,...SS},this.filterable={operators:"datetime"},this.titleUsable=!0}}class S6 extends SA{constructor(...e){super(...e),this.name="updatedBy",this.type="object",this.group="systemInfo",this.order=4,this.title='{{t("Last updated by")}}',this.isAssociation=!0,this.default={type:"belongsTo",target:"users",foreignKey:"updatedById",uiSchema:{type:"object",title:'{{t("Last updated by")}}',"x-component":"AssociationField","x-component-props":{fieldNames:{value:"id",label:"nickname"}},"x-read-pretty":!0}},this.availableTypes=["belongsTo"],this.properties={...SF},this.filterable={nested:!0,children:[]},this.description='{{t("Store the last update user of each record")}}'}}class S9 extends SA{constructor(...e){super(...e),this.name="url",this.type="string",this.group="basic",this.order=5,this.title='{{t("URL")}}',this.default={type:"text",uiSchema:{type:"string","x-component":"Input.URL"}},this.componentOptions=[{label:"URL",value:"Input.URL"},{label:"Preview",value:"Input.Preview"}],this.availableTypes=["string","text"],this.validationType="string",this.availableValidationOptions=["uri","pattern"],this.properties={...SF},this.titleUsable=!0,this.filterable={operators:"string"}}}class S7 extends SA{constructor(...e){super(...e),this.name="uuid",this.type="object",this.group="advanced",this.order=0,this.title='{{t("UUID")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.hidden=!1,this.sortable=!0,this.default={type:"uuid",uiSchema:{type:"string","x-component":"Input","x-validator":"uuid"}},this.availableTypes=["uid","uuid"],this.validationType="string",this.availableValidationOptions=["uuid","pattern"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},autoFill:Sv,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}}},this.filterable={operators:"string"},this.titleUsable=!0}}class we extends SA{constructor(...e){super(...e),this.name="nanoid",this.type="object",this.group="advanced",this.order=0,this.title='{{t("Nano ID")}}',this.primaryKeyDescription='{{t("Primary key, unique identifier")}}',this.hidden=!1,this.sortable=!0,this.default={type:"nanoid",uiSchema:{type:"string","x-component":"NanoIDInput"}},this.availableTypes=["nanoid"],this.properties={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input","x-disabled":"{{ !createOnly }}",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"},customAlphabet:{type:"string",title:'{{t("Alphabet")}}',default:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz","x-decorator":"FormItem","x-component":"Input"},size:{type:"number",title:'{{t("Length")}}',default:21,"x-decorator":"FormItem","x-component":"InputNumber"},autoFill:Sv,layout:{type:"void",title:'{{t("Index")}}',"x-component":"Space","x-decorator":"FormItem","x-decorator-props":{style:{marginBottom:"0px"}},properties:{primaryKey:Sf,unique:Sh}}},this.filterable={operators:"string"},this.titleUsable=!0}}class wt extends SA{constructor(...e){super(...e),this.name="unixTimestamp",this.type="object",this.group="datetime",this.order=4,this.title='{{t("Unix Timestamp")}}',this.sortable=!0,this.default={type:"unixTimestamp",accuracy:"second",timezone:!0,defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,uiSchema:{type:"number","x-component":"UnixTimestamp","x-component-props":{showTime:!0}}},this.availableTypes=["unixTimestamp"],this.hasDefaultValue=!1,this.validationType="date",this.availableValidationOptions=["timestamp"],this.properties={...SF,...SS,accuracy:{type:"string",title:'{{t("Accuracy")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"second",enum:[{value:"millisecond",label:'{{t("Millisecond")}}'},{value:"second",label:'{{t("Second")}}'}]},defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp on update")}}'}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class wl extends SA{constructor(...e){super(...e),this.name="date",this.type="object",this.group="datetime",this.order=3,this.title='{{t("DateOnly")}}',this.sortable=!0,this.default={type:"dateOnly",uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{dateOnly:!0,showTime:!1}}},this.availableTypes=["dateOnly"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...SF,...SS,"uiSchema.x-component-props.showTime":{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-visible":!1},"uiSchema.x-component-props.timeFormat":{type:"string","x-decorator":"FormItem","x-component":"Radio.Group","x-visible":!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}class wn extends SA{constructor(...e){super(...e),this.name="datetimeNoTz",this.type="object",this.group="datetime",this.order=2,this.title='{{t("Datetime (without time zone)")}}',this.sortable=!0,this.default={type:"datetimeNoTz",defaultToCurrentTime:!1,onUpdateToCurrentTime:!1,timezone:!1,uiSchema:{type:"string","x-component":"DatePicker","x-component-props":{showTime:!1,utc:!1}}},this.availableTypes=["string","datetimeNoTz"],this.hasDefaultValue=!0,this.validationType="date",this.properties={...SF,...SS,defaultToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Default value to current server time")}}'},onUpdateToCurrentTime:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-content":'{{t("Automatically update timestamp to the current server time on update")}}'},"uiSchema.x-component-props.gmt":{type:"boolean",title:'{{t("GMT")}}',"x-hidden":!0,"x-component":"Checkbox","x-content":'{{t("Use the same time zone (GMT) for all users")}}',"x-decorator":"FormItem",default:!1}},this.filterable={operators:"datetime"},this.titleUsable=!0}}function wo(e){if(null==e?void 0:e.filterTargetKey){if(Array.isArray(e.filterTargetKey)){var t;return null==e||null==(t=e.filterTargetKey)?void 0:t[0]}return null==e?void 0:e.filterTargetKey}return(null==e?void 0:e.getPrimaryKey())||"id"}function wr(e,t){var l,n,o,r,i;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=e.interface,d=s?(null==t||null==(n=t.getFieldInterfaceConfigure)||null==(l=n.call(t,s,a.collectionInfo))?void 0:l.default)||(null==t||null==(r=t.getFieldInterface)||null==(o=r.call(t,s))?void 0:o.default):void 0,u=(0,U.merge)({},(0,U.cloneDeep)(d||{}),(0,U.cloneDeep)(e)),c=(0,U.merge)({},(0,U.cloneDeep)((null==d?void 0:d.uiSchema)||{}),(0,U.cloneDeep)(e.uiSchema||{}));return void 0!==e.title&&(c.title=e.title),void 0!==e.options&&(c.enum=(0,U.cloneDeep)(e.options)),void 0!==e.component&&(c["x-component"]=e.component),void 0!==e.componentProps&&(c["x-component-props"]=(0,U.merge)({},(0,U.cloneDeep)((null==d||null==(i=d.uiSchema)?void 0:i["x-component-props"])||{}),(0,U.cloneDeep)(e.componentProps))),delete u.title,delete u.options,delete u.component,delete u.componentProps,Object.keys(c).length&&(u.uiSchema=c),u}function wi(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,l=arguments.length>2?arguments[2]:void 0;return e.map(e=>wr(e,t,l))}let wa=e=>{var t,l,n,o,r,i,a,s,d;let{dataSource:u="main",collections:c,syncOnChange:p=!1,children:m}=e,h=(0,ee.n)(),f=(0,H.useRef)(null),g=(0,H.useRef)(null);if(null===f.current){let e=null==(l=h.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,u),r=[];if(e)for(let t of c)null!=(n=e.getCollection)&&n.call(e,t.name)||(null==(o=e.addCollection)||o.call(e,t),r.push(t));f.current=r,g.current=c}else if(p&&g.current!==c){let e=null==(i=h.dataSourceManager)||null==(r=i.getDataSource)?void 0:r.call(i,u);if(e){let t=new Set(c.map(e=>e.name)),l=new Map(f.current.map(e=>[e.name,e]));for(let n of l.keys())t.has(n)||null==(a=e.removeCollection)||a.call(e,n);let n=[];for(let t of c){let o=l.get(t.name);if(o){n.push(o);continue}null!=(s=e.getCollection)&&s.call(e,t.name)||(null==(d=e.addCollection)||d.call(e,t),n.push(t))}f.current=n}g.current=c}return(0,H.useEffect)(()=>{var e;let t=e=>{var t,l,n,o,r;let i=null==(t=e.detail)?void 0:t.dataSourceKey;if(i!==u&&"*"!==i)return;let a=null==(n=h.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);if(a&&f.current)for(let e of f.current)null!=(o=a.getCollection)&&o.call(a,e.name)||null==(r=a.addCollection)||r.call(a,e)};return null==(e=h.eventBus)||e.addEventListener("dataSource:loaded",t),()=>{var e,l,n,o;null==(e=h.eventBus)||e.removeEventListener("dataSource:loaded",t);let r=null==(n=h.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u),i=f.current??[];if(f.current=null,g.current=null,r)for(let e of i)null==(o=r.removeCollection)||o.call(r,e.name)}},[h,u]),(0,V.jsx)(V.Fragment,{children:m})};var ws=l(30872),wd=l.n(ws),wu=l(88055),wc=l.n(wu),wp=l(90179),wm=l.n(wp);let wh=(0,H.createContext)(null);wh.displayName="APIClientContext";let wf=(0,H.createContext)(null);wf.displayName="ApplicationContext";let wg=()=>{var e;let t=(0,H.useContext)(wf),l=(0,K.useFlowEngine)({throwError:!1});return(null==l||null==(e=l.context)?void 0:e.app)||t||{}};function wv(){let e=wg();return(0,H.useContext)(wh)||e.apiClient}var wy=l(89412),wx=l(14744),wb=l.n(wx),wS=l(63375),ww=l.n(wS);function wC(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(t=>e.propertyIsEnumerable(t)):[]}function wF(e){return Object.keys(e).concat(wC(e))}let wk=new Map;function wA(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return wF(t).forEach(n=>{let o=l[n],r=wk.get("deepMerge");"function"==typeof o?r=o:"string"==typeof o&&wk.has(o)&&(r=wk.get(o)),e[n]=r(e[n],t[n])}),e}function wP(e){let t,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},[n,o]=(0,wy.A)({}),r=wv();t="function"==typeof e?e:e?async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{resource:l,url:n}=e,o=wc()(e);l||n?(o.params=o.params||{},wA(o.params,t)):o=(0,rx.merge)(o,t);let i=await r.request(o);return null==i?void 0:i.data}:async()=>{};let i={...l,onSuccess(){for(var e,t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];null==(e=l.onSuccess)||e.call(l,...n),l.uid&&(r.services[l.uid]=a)}},a=(0,oJ.A)(t,i);return(0,H.useMemo)(()=>({...a,state:n,setState:o}),[a,o,n])}function wj(e,t){return wv().resource(e,t)}wk.set("overwrite",(e,t)=>t),wk.set("andMerge",(e,t)=>{if(e||t)return e?t?{$and:[e,t]}:e:t}),wk.set("orMerge",(e,t)=>{if(e||t)return e?t?{$or:[e,t]}:e:t}),wk.set("deepMerge",(e,t)=>(0,eh.isPlainObject)(e)&&(0,eh.isPlainObject)(t)?wb()(e,t,{arrayMerge:(e,t)=>t}):t),wk.set("merge",(e,t)=>(0,eh.isPlainObject)(e)&&(0,eh.isPlainObject)(t)?Object.assign(e,t):t),wk.set("union",(e,t)=>("string"==typeof e&&(e=e.split(",")),"string"==typeof t&&(t=t.split(",")),ww()((e||[]).concat(t||[])))),wk.set("intersect",(e,t)=>("string"==typeof e&&(e=e.split(",")),"string"==typeof t&&(t=t.split(",")),Array.isArray(e)&&0!==e.length)?Array.isArray(t)&&0!==t.length?e.filter(e=>t.includes(e)):e||[]:t||[]);var wM=l(98892);function wI(e,t,l){var n;(null==t?void 0:t.length)&&l[e]({message:null==(n=t.map)?void 0:n.call(t,(e,t)=>H.createElement("div",{key:`${t}_${e.message}`},"string"==typeof e?e:e.message))})}let wT=(e,t)=>{var l;let n=new FileReader;n.readAsText(null==e||null==(l=e.response)?void 0:l.data,"utf-8"),n.onload=function(){wI("error",JSON.parse(n.result).errors,t)}};function wR(e){let t=Math.floor(Math.abs(e)),l=Math.abs(e%1*60);return(e>=0?"+":"-")+(t<10?"0":"")+t+":"+(l<10?"0":"")+l}let wE=()=>wR(-(new Date().getTimezoneOffset()/60)),wN=new Map;class wD extends N{get notification(){var e,t;return(null==(t=this.app)||null==(e=t.context)?void 0:e.notification)||wM.Ay}cloneInstance(){let e=new wD(this.options);e.options=this.options,e.services=this.services,e.storage=this.storage,e.app=this.app,e.auth=this.auth,e.storagePrefix=this.storagePrefix;let t=[];for(let n of this.axios.interceptors.response.handlers){var l;(null==n||null==(l=n.rejected)?void 0:l._name)==="handleNotificationError"?t.push({...n,rejected:e.handleNotificationError.bind(e)}):t.push(n)}return e.axios.interceptors.response.handlers=t,e}getHostname(){var e,t;try{return new URL("/api/").hostname}catch(e){}return null==(t=window)||null==(e=t.location)?void 0:e.hostname}getHeaders(){var e;let t=super.getHeaders(),l=null==(e=this.app)?void 0:e.getName();return l&&(t["X-App"]=l),t["X-Timezone"]=wE(),t["X-Hostname"]=this.getHostname(),t}service(e){return this.services[e]}interceptors(){this.axios.interceptors.request.use(e=>{e.headers["X-With-ACL-Meta"]=!0;let t=this.getHeaders();return Object.keys(t).forEach(l=>{j(e.headers,l)||(e.headers[l]=t[l])}),e}),super.interceptors(),this.useNotificationMiddleware(),this.axios.interceptors.response.use(e=>e,e=>{let t=this.toErrMessages(e);throw t.find(e=>"ROLE_NOT_FOUND_ERR"===e.code)&&(this.auth.setRole(null),window.location.reload()),t.find(e=>"TOKEN_INVALID"===e.code||"USER_LOCKED"===e.code)&&this.auth.setToken(null),t.find(e=>"ROLE_NOT_FOUND_FOR_USER"===e.code)&&(this.auth.setRole(null),window.location.reload()),e})}toErrMessages(e){var t,l,n,o,r,i,a,s,d,u,c;if("string"==typeof(null==e||null==(t=e.response)?void 0:t.data)){let t=document.createElement("div");t.innerHTML=null==e||null==(d=e.response)?void 0:d.data;let l=t.textContent||t.innerText;return l.includes("Error occurred while trying")||l.includes("502 Bad Gateway")?[{code:"APP_WARNING",message:l="The application may be starting up. Please try again later."}]:[{message:l}]}return(null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.error)?[null==e||null==(c=e.response)||null==(u=c.data)?void 0:u.error]:(null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.errors)||(null==e||null==(a=e.response)||null==(i=a.data)?void 0:i.messages)||(null==e||null==(s=e.response)?void 0:s.error)||[{message:e.message||"Server error"}]}async handleNotificationError(e){var t,l,n,o,r,i,a,s,d,u;if(this.silence)throw e;let c=null==(t=e.config)?void 0:t.skipNotify;if(c&&("function"==typeof c&&c(e)||!0===c))throw e;let p=null==e||null==(n=e.response)||null==(l=n.data)?void 0:l.redirectTo;if(p)return window.location.href=p;if((null==e||null==(r=e.response)||null==(o=r.data)?void 0:o.type)==="application/json")wT(e,this.notification);else{wN.size>10&&wN.clear();let t=!!(null==e||null==(s=e.response)||null==(a=s.data)||null==(i=a.error)?void 0:i.maintaining);if(this.app.maintaining!==t&&(this.app.maintaining=t),this.app.maintaining)throw this.app.error=null==e||null==(u=e.response)||null==(d=u.data)?void 0:d.error,e;this.app.error&&(this.app.error=null);let l=this.toErrMessages(e);if(0===(l=l.filter(e=>{let t=wN.get(e.message);return!(t&&new Date().getTime()-t<500)&&(wN.set(e.message,new Date().getTime()),!0)})).length)throw e;wI("error",l,this.notification)}throw e}useNotificationMiddleware(){let e=this.handleNotificationError.bind(this);e._name="handleNotificationError",this.axios.interceptors.response.use(e=>{var t,l;return(null==(l=e.data)||null==(t=l.messages)?void 0:t.length)&&wI("success",e.data.messages.filter(e=>{let t=wN.get("string"==typeof e?e:e.message);return!(t&&new Date().getTime()-t<500)&&(wN.set(e.message,new Date().getTime()),!0)}),this.notification),e},e)}silent(){let e=this.cloneInstance();return e.silence=!0,e}constructor(...e){super(...e),this.services={},this.silence=!1}}let wB=e=>{let{apiClient:t,children:l}=e;return(0,V.jsx)(wh.Provider,{value:t,children:l})};class w${get fields(){return this.options.fields||[]}get app(){return this.collectionManager.app}get dataSource(){return this.options.dataSource}get sourceKey(){return this.options.sourceKey}get name(){return this.options.name}get key(){return this.options.key}get title(){return this.options.title}get inherit(){return this.options.inherit}get hidden(){return this.options.hidden}get description(){return this.options.description}get duplicator(){return this.options.duplicator}get category(){return this.options.category}get targetKey(){return this.options.targetKey}get model(){return this.options.model}get createdBy(){return this.options.createdBy}get updatedBy(){return this.options.updatedBy}get logging(){return this.options.logging}get from(){return this.options.from}get rawTitle(){return this.options.rawTitle}getPrimaryKey(){if(this.primaryKey)return this.primaryKey;if(this.options.targetKey)return this.options.targetKey;let e=this.getFields({primaryKey:!0})[0];return this.primaryKey=null==e?void 0:e.name,this.primaryKey}getFilterTargetKey(){return this.filterTargetKey||this.getPrimaryKey()||"id"}get inherits(){return this.options.inherits||[]}get titleField(){return this.hasField(this.options.titleField)?this.options.titleField:this.getPrimaryKey()}get sources(){return this.options.sources||[]}get template(){return this.options.template}get tableName(){return this.options.tableName}get viewName(){return this.options.viewName}get writableView(){return this.options.writableView}get filterTargetKey(){return this.options.filterTargetKey}get sortable(){return this.options.sortable}get autoGenId(){return this.options.autoGenId}get magicAttribute(){return this.options.magicAttribute}get tree(){return this.options.tree}get isThrough(){return this.options.isThrough}get autoCreate(){return this.options.autoCreate}get resource(){return this.options.resource}setOption(e,t){return this.options[e]=t,this}getOptions(){return this.options}getOption(e){return this.options[e]}getFields(e){return e?(0,rw.filter)(this.fields,e):this.fields}getAllFields(e){return this.getFields(e)}getFieldsMap(){return this.fieldsMap||(this.fieldsMap=this.getFields().reduce((e,t)=>(e[t.name]=t,e),{})),this.fieldsMap}getFieldByAssociationName(e){let t=this.getFieldsMap(),[l,...n]=String(e).split("."),o=t[l];if(!o)return;let r=null==o?void 0:o.target;if(!r)return;let i=this.collectionManager.getCollection(r);if(i)return i.getField(n.join("."))}getField(e){if(!e)return;let t=this.getFieldsMap();if(String(e).split(".").length>1){let t=this.getFieldByAssociationName(e);return t||("string"==typeof e&&e.startsWith(`${this.name}.`)?(e=e.replace(`${this.name}.`,""),this.getField(e)):void 0)}return t[e]}hasField(e){return!!this.getField(e)}isTitleField(e){var t;return null==(t=this.app.dataSourceManager.collectionFieldInterfaceManager.getFieldInterface(e.interface))?void 0:t.titleUsable}isInherited(){return this.inherits.length>0}constructor(e,t){this.options=e,this.collectionManager=t}}let{ConfigContext:wO}=ei.Ay,wq=()=>(0,H.useContext)(wO),w_=(e,t)=>{let{getPrefixCls:l}=(0,H.useContext)(ei.Ay.ConfigContext)||{};if("ConfigContext"in ei.Ay)return(null==l?void 0:l(e,null==t?void 0:t.prefixCls))||"";{let l=(null==t?void 0:t.prefixCls)??"ant-";return`${l}${e??""}`}},wL=()=>er.A.useToken(),wV=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Loading...",t=arguments.length>1?arguments[1]:void 0,l=null,n=setTimeout(()=>{l=yq.Ay.loading(e)},100);try{return await t()}finally{null==l||l(),clearTimeout(n)}},wz={...lP},{version:wK,render:wU,unmountComponentAtNode:wW}=wz;try{Number((wK||"").split(".")[0])>=18&&wz.createRoot&&(n=wz.createRoot)}catch(e){}function wH(e){let{__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:t}=wz;t&&"object"==typeof t&&(t.usingClientEntryPoint=e)}let wG="__antd_mobile_root__";function wY(e,t){wU(e,t)}function wJ(e,t){wH(!0);let l=t[wG]||n(t);wH(!1),l.render(e),t[wG]=l}function wX(e,t){n?wJ(e,t):wY(e,t)}function wQ(e){return wW(e)}async function wZ(e){return Promise.resolve().then(()=>{var t;null==(t=e[wG])||t.unmount(),delete e[wG]})}function w0(e){return n?wZ(e):wQ(e)}let w1=(0,z.observable)(new Map),w2=e=>{let t=e=>(e.id&&!w1.has(e.id)&&w1.set(e.id,null),(0,V.jsxs)(H.Fragment,{children:[e.children,(0,V.jsx)(ne.Observer,{children:()=>{if(!e.id)return(0,V.jsx)(V.Fragment,{});let t=w1.get(e.id);return t?(0,lA.createPortal)(t,document.body):(0,V.jsx)(V.Fragment,{})}})]}));return t.defaultProps={id:e},t};function w8(e,t){return{render:function(l){w1.has(t)?w1.set(t,null==l?void 0:l()):e&&wX((0,V.jsx)(H.Fragment,{children:null==l?void 0:l()}),e)},unmount:function(){if(w1.has(t)&&w1.set(t,null),e&&w0(e)&&e.parentNode){var l;null==(l=e.parentNode)||l.removeChild(e)}}}}let w5=(e,t)=>{let{fontFamily:l,fontSize:n}=e,o=`[class^="${t}"], [class*=" ${t}"]`;return{[o]:{fontFamily:l,fontSize:n,boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"},[o]:{boxSizing:"border-box","&::before, &::after":{boxSizing:"border-box"}}}}},w4=(e,t)=>l=>{let{theme:n,token:o,hashId:r}=wL(),{getPrefixCls:i,iconPrefixCls:a}=wq(),s=w_(e),d=i(),u=(0,rm.useStyleRegister)({theme:n,token:o,hashId:r,path:["formily-antd",e,s,a]},()=>{let e=`.${s}`,n=t((0,rx.merge)(o,{componentCls:e,prefixCls:s,iconCls:`.${a}`,antCls:`.${d}`}),l,{hashId:r,prefixCls:s,rootPrefixCls:d,iconPrefixCls:a});return[w5(o,s),n]});return{wrapSSR:(0,H.useMemo)(()=>u,[n,o,r,s,a,d,l]),hashId:r,componentCls:s,rootPrefixCls:d}};var w3=l(38221),w6=l.n(w3);let w9=(0,H.createContext)(null);w9.displayName="DataSourceManagerContext";let w7=e=>{let{children:t,dataSourceManager:l}=e;return(0,V.jsx)(w9.Provider,{value:l,children:t})};function Ce(){return(0,H.useContext)(w9)}function Ct(){let e=Ce();return{getAllCollectionsInheritChain:(0,H.useCallback)((t,l)=>{var n,o,r;return null==e||null==(r=e.getDataSource(l))||null==(o=r.collectionManager)||null==(n=o.getCollection(t))?void 0:n.getInheritChain()},[e])}}var Cl=l(68870);let Cn=(0,H.createContext)(null);Cn.displayName="DataSourceContext";let Co=e=>{let{children:t,dataSource:l}=e,n=Ce(),{t:o}=(0,lj.B)(),{refresh:r}=jD(),[i,a]=H.useState(0),s=null==n?void 0:n.getDataSource(l);return s?"loading-failed"===s.status?(0,V.jsx)(enx,{type:"Data Source",name:s.displayName||l,message:s.errorMessage||"loading failed"}):"loading"===s.status||"reloading"===s.status?(0,V.jsx)(Z0,{children:(0,V.jsx)(lH.Ay,{icon:(0,V.jsx)(Cl.A,{}),title:`${s.displayName||l} ${o("data source")} ${o("loading")}...`,extra:(0,V.jsx)(nk.Ay,{type:"primary",onClick:()=>s.reload().then(()=>{r(),a(Math.random())}),children:o("Refresh")})})}):(0,V.jsx)(Cn.Provider,{value:s,children:t}):(0,V.jsx)(enx,{type:"Data Source",name:l})};function Cr(){return(0,H.useContext)(Cn)}function Ci(){let e=(0,H.useContext)(Cn);return null==e?void 0:e.key}let Ca=(0,H.createContext)(null);Ca.displayName="ExtendCollectionsContext";let Cs=e=>{let{children:t,collections:l}=e,n=Cd(),o=(0,H.useMemo)(()=>n?[...n,...l]:l,[n,l]),r=Ci();return(0,V.jsx)(Ca.Provider,{value:o,children:(0,V.jsx)(Cp,{dataSource:r,children:t})})};function Cd(){return(0,H.useContext)(Ca)}let Cu=(0,H.createContext)(null);Cu.displayName="CollectionManagerContext";let Cc=e=>{let{instance:t,children:l}=e,n=Cr(),o=Cd(),r=(0,H.useMemo)(()=>t||(null==n?void 0:n.collectionManager),[t,n]),[i,a]=H.useState(Math.random());(0,H.useEffect)(()=>{r.dataSource.addReloadCallback(()=>{a(Math.random())})},[r]);let s=(0,H.useMemo)(()=>{let e=r;return(null==o?void 0:o.length)?e.clone(o):e},[r,o,i]);return(0,V.jsx)(Cu.Provider,{value:s,children:l})},Cp=e=>{let{instance:t,dataSource:l,children:n}=e;return(0,V.jsx)(Co,{dataSource:l,children:(0,V.jsx)(Cc,{instance:t,children:n})})};function Cm(){return(0,H.useContext)(Cu)}let Ch=e=>{let t=Cm();return(0,H.useMemo)(()=>t.getCollections(e),[t,e])},Cf=(0,H.createContext)({});Cf.displayName="SchemaComponentContext.Provider";let Cg=()=>(0,H.useContext)(ne.SchemaOptionsContext)||{},Cv=(0,H.memo)(e=>{let{children:t}=e,l=Cg(),n=(0,H.useMemo)(()=>({...l.components,...e.components}),[l.components,e.components]),o=(0,H.useMemo)(()=>({...l.scope,...e.scope}),[l.scope,e.scope]),r=(0,H.useMemo)(()=>({scope:o,components:n}),[o,n]);return(0,V.jsx)(ne.SchemaOptionsContext.Provider,{value:r,children:(0,V.jsx)(ne.SchemaComponentsContext.Provider,{value:n,children:(0,V.jsx)(ne.ExpressionScope,{value:o,children:t})})})});function Cy(e){return ne.Schema.isSchemaInstance(e)?e:new ne.Schema((null==e?void 0:e.name)?{type:"object",properties:{[e.name]:e},name:`p_${e.name}`}:e)}Cv.displayName="SchemaComponentOptions";let Cx=e=>(0,H.useMemo)(()=>Cy(e),[]),Cb=(0,H.createContext)({onChange:rC().noop}),CS=(0,H.memo)(e=>{let{components:t,scope:l,schema:n,distributed:o,onChange:r,parentSchema:i,...a}=e,s=(0,H.useContext)(Cf),d=(0,H.useMemo)(()=>Cy(n),[n]),u=(0,H.useMemo)(()=>({...s,distributed:!1!=s.distributed&&o,refresh:s.refresh||rC().noop}),[s,o]),{onChange:c}=(0,H.useContext)(Cb),p=(0,H.useMemo)(()=>({onChange:()=>{null==r||r(d),null==c||c()}}),[r,c,d]);return(0,V.jsx)(Cb.Provider,{value:p,children:(0,V.jsx)(Cf.Provider,{value:u,children:(0,V.jsx)(Cv,{inherit:!0,components:t,scope:l,children:(0,V.jsx)(CQ,{...a,schema:d,isUseFormilyField:!0,parentSchema:i})})})})});CS.displayName="RecursionSchemaComponent";let Cw=(0,H.memo)(e=>{let{schema:t,parentSchema:l,...n}=e,o=Cx(t);return(0,V.jsx)(CS,{...n,schema:o,parentSchema:l})});Cw.displayName="MemoizedSchemaComponent";let CC=(0,H.memo)(e=>{let{memoized:t,...l}=e;return t?(0,V.jsx)(Cw,{...l}):(0,V.jsx)(CS,{...l})});CC.displayName="SchemaComponent";let CF=Object.freeze({}),Ck={},CA=e=>/{{.*?}}/g.test(e),CP=function(){let{noCache:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{noCache:!1},t=(0,H.useContext)(ne.SchemaOptionsContext),l=(0,H.useContext)(ne.SchemaExpressionScopeContext);return(n,o)=>{let r,i=!1;if("string"==typeof n&&n.startsWith("{{")&&(i=!0,r=n),n&&"object"==typeof n&&!(0,H.isValidElement)(n)){try{r=JSON.stringify(n)}catch(e){return console.warn("Failed to stringify:",e),n}if(Ck[r])return Ck[r];i=CA(r)}if(Array.isArray(n)){try{r=JSON.stringify(n)}catch(e){return console.warn("Failed to stringify:",e),n}if(Ck[r])return Ck[r];i=CA(r)}if(i){let i={...null==t?void 0:t.scope,...l,...o};if(!r)return ne.Schema.compile(n,i);try{if(e)return ne.Schema.compile(n,i);return Ck[r]=Ck[r]||ne.Schema.compile(n,i),Ck[r]}catch(e){return console.log("useCompile error",n,e),ne.Schema.compile(n,i)}}return n}},Cj=(e,t)=>{if((e||t)&&!(0,rx.isFn)(e))return(0,V.jsxs)(H.Fragment,{children:[e,t]})},CM=e=>e&&("object"==typeof e||"function"==typeof e),CI=(e,t,l)=>(0,rx.isFn)(e)?e(t,l):e,CT=e=>{let t,l=(0,H.useContext)(ne.SchemaComponentsContext),n=e.field,o=Cj(CI(e.children,n,n.form),n.content??n.componentProps.children);if("visible"!==n.display)return null;let r=e=>CM(e)?e:rx.FormPath.getIn(l,e)??e;return t=n.componentType?H.createElement(r(n.componentType),{...n.componentProps,value:n.value},o):o,n.decoratorType?H.createElement(r(n.decoratorType),n.decoratorProps,t):(0,V.jsx)(H.Fragment,{children:t})};CT.displayName="NocoBaseReactiveInternal";let CR=CT;function CE(e){return new CN(e)}CR.displayName="NocoBaseReactiveField";class CN{initialize(){var e,t,l,n,o,r,i,a,s,d,u,c,p,m,h,f,g,v,y,x;let b=this.props.compile;this.pattern="readPretty",this.readPretty=!0,this.initialized=!0,this.loading=!1,this.validating=!1,this.submitting=!1,this.selfModified=!1,this.active=!1,this.visited=!0,this.mounted=!0,this.unmounted=!1,this.inputValues=[],this.inputValue=null,this.feedbacks=[],this.title=b(this.props.title||(null==(e=this.props.schema)?void 0:e.title)),this.description=b(this.props.description||(null==(t=this.props.schema)?void 0:t.description)),this.display="visible",this.editable=this.props.editable||(null==(l=this.props.schema)?void 0:l["x-editable"]),this.disabled=this.props.disabled||(null==(n=this.props.schema)?void 0:n["x-disabled"]),this.readOnly=this.props.readOnly||(null==(o=this.props.schema)?void 0:o["x-read-only"]),this.visible=this.props.visible||(null==(r=this.props.schema)?void 0:r["x-visible"]),this.hidden=this.props.hidden||(null==(i=this.props.schema)?void 0:i["x-hidden"]),this.dataSource=b(this.props.dataSource||(null==(a=this.props.schema)?void 0:a.enum)),this.validator=this.props.validator,this.required=this.props.required||!!(null==(s=this.props.schema)?void 0:s.required),this.content=b(this.props.content||(null==(d=this.props.schema)?void 0:d["x-content"])),this.initialValue=b(this.props.initialValue||(null==(u=this.props.schema)?void 0:u.default)),this.value=b(this.props.value),this.data=this.props.data||(null==(c=this.props.schema)?void 0:c["x-data"]),this.decorator=this.props.decorator?(0,rx.toArr)(this.props.decorator):[null==(p=this.props.schema)?void 0:p["x-decorator"],null==(m=this.props.schema)?void 0:m["x-decorator-props"]],this.component=this.props.component?(0,rx.toArr)(this.props.component):[null==(h=this.props.schema)?void 0:h["x-component"],null==(f=this.props.schema)?void 0:f["x-component-props"]],this.decoratorProps=(null==(g=this.props.schema)?void 0:g["x-decorator-props"])||{},this.componentProps=(null==(v=this.props.schema)?void 0:v["x-component-props"])||{},this.decoratorType=null==(y=this.props.schema)?void 0:y["x-decorator"],this.componentType=null==(x=this.props.schema)?void 0:x["x-component"],this.path={},this.form={},this.address={concat:rC().noop}}constructor(e){this.props=e,this.initialize()}}let CD=e=>{let t=CP(),l=(0,ne.useFieldSchema)(),n=(0,H.useMemo)(()=>CE({...e,compile:t}),[]);return Object.assign(n.componentProps,l["x-component-props"]),n.value=e.value,(0,V.jsx)(ne.FieldContext.Provider,{value:n,children:(0,V.jsx)(CR,{field:n,children:e.children})})},CB=H.createContext({}),C$=H.createContext(rC().noop),CO=e=>{let{children:t,refresh:l}=e,n=CV(),o=(0,H.useCallback)(e=>{l(),(null==e?void 0:e.refreshParentSchema)&&(null==n||n())},[n,l]);return(0,V.jsx)(C$.Provider,{value:o,children:t})},Cq=H.createContext(rC().noop),C_=e=>{let{children:t,refresh:l}=e;return(0,V.jsx)(Cq.Provider,{value:l,children:t})},CL=()=>H.useContext(Cq),CV=()=>H.useContext(C$),Cz=()=>H.useContext(CB)||{},CK=e=>{let{children:t,fieldSchema:l}=e,n=enM(),o=Cm(),r=null==l?void 0:l.name,i=(0,H.useMemo)(()=>{var e;if(!n)return null;let t=null==l||null==(e=l["x-component-props"])?void 0:e.field;return o.getCollectionField(null==l?void 0:l["x-collection-field"])||t||n.getField((null==t?void 0:t.name)||r)},[n,o,l,r]);return(0,V.jsx)(CB.Provider,{value:i,children:t})},CU=rC().memoize((e,t)=>e.toFieldProps({scope:t})),CW=e=>CU(e,(0,ne.useExpressionScope)()),CH=e=>{let t=(0,ne.useField)();if(e.onlyRenderProperties){var l;return e.basePath||(null==t||null==(l=t.address)?void 0:l.concat(e.name))}return e.basePath||(null==t?void 0:t.address)},CG=(e,t,l)=>{let n=e.toJSON();if(l){if(!n.properties)return e;let l=Object.keys(n.properties)[0],o=Object.values(n.properties)[0];return n.properties[l]=(0,rx.merge)(rC().omit(t,"type","x-read-pretty"),o),new ne.Schema(n)}return new ne.Schema((0,rx.merge)(rC().omit(t,"type","x-read-pretty"),n))},CY=e=>{let{schema:t,field:l,basePath:n,mapProperties:o,filterProperties:r,propsRecursion:i,values:a,isUseFormilyField:s}=e,d=ne.Schema.getOrderProperties(t);return d.length?(0,V.jsx)(H.Fragment,{children:d.map((e,t)=>{let{schema:d,key:u}=e,c=(null==l?void 0:l.address)||n,p=d;if((0,rx.isFn)(o)){let e=o(d,u);e&&(p=e)}if((0,rx.isFn)(r)&&!1===r(p,u))return null;let m=(0,rx.isBool)(i)&&i?(0,V.jsx)(CQ,{propsRecursion:!0,filterProperties:r,mapProperties:o,schema:p,name:u,basePath:c,values:rC().get(a,u),isUseFormilyField:s}):(0,V.jsx)(CQ,{schema:p,name:u,basePath:c,values:rC().get(a,u),isUseFormilyField:s});return"CollectionField"===p["x-component"]?(0,V.jsx)(CJ.Provider,{value:!0,children:(0,V.jsx)(CK,{fieldSchema:p,children:m})},`${t}-${u}`):(0,V.jsx)(CJ.Provider,{value:!1,children:(0,V.jsx)(CB.Provider,{value:CF,children:m})},`${t}-${u}`)})}):null},CJ=H.createContext(!1),CX=()=>H.useContext(CJ),CQ=H.memo(e=>{let{schema:t,name:l,onlyRenderProperties:n,onlyRenderSelf:o,mapProperties:r,filterProperties:i,propsRecursion:a,values:s,isUseFormilyField:d=!0,uiSchema:u,parentSchema:c}=e,p=CH(e),m=(0,H.useRef)(null),h=(0,H.useMemo)(()=>(m.current=null,new ne.Schema(t)),[t]),{uiSchema:f,defaultValue:g}=Cz(),v=(0,bh.A)(),{onChange:y}=(0,H.useContext)(Cb),x=m.current||h;if(!x.parent&&c){var b,S;x.parent=c,(null==(S=x.parent)||null==(b=S.properties)?void 0:b[x.name])||!x.name||rC().set(x.parent,`properties.${x.name}`,x)}let w=(0,H.useCallback)(()=>{let e=x.parent;m.current=new ne.Schema(x.toJSON(),e),(null==e?void 0:e.properties)&&Object.keys(e.properties).forEach(t=>{t===x.name&&(e.properties[t]=m.current)}),v(),null==y||y()},[x,y,v]),C=(0,H.useMemo)(()=>u?CG(x,u,n):f?(f.default=g,CG(x,f,n)):x,[f,g,x,n,u]),F=CW(C),k=e=>{if(!o)return CY({schema:x,field:e,basePath:p,mapProperties:r,filterProperties:i,propsRecursion:a,values:s,isUseFormilyField:d})},A=()=>(0,rx.isValid)(l)?"object"===C.type?n?k():(0,V.jsx)(ne.ObjectField,{...F,name:l,basePath:p,children:k}):"array"===C.type?(0,V.jsx)(ne.ArrayField,{...F,name:l,basePath:p}):"void"===C.type?n?k():(0,V.jsx)(ne.VoidField,{...F,name:l,basePath:p,children:k}):d?(0,V.jsx)(ne.Field,{...F,name:l,basePath:p}):(0,V.jsx)(CD,{name:l,value:s,initialValue:s,basePath:p,schema:C}):k();return x?(0,V.jsx)(ne.SchemaContext.Provider,{value:x,children:(0,V.jsx)(CO,{refresh:w,children:A()})}):(0,V.jsx)(H.Fragment,{})});CQ.displayName="NocoBaseRecursionField";var CZ=l(58156),C0=l.n(CZ),C1=l(63560),C2=l.n(C1);let C8=Symbol("LAZY_COMPONENT_KEY"),C5=new Map;function C4(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(0===l.length){let t=(0,H.lazy)(()=>e().then(e=>{let t=e.default;return l[C8]=t,{default:t}})),l=e=>(0,V.jsx)(H.Suspense,{fallback:(0,V.jsx)(nx.A,{}),children:(0,V.jsx)(t,{...e})});return l}return l.reduce((t,l)=>{let n=(0,H.lazy)(()=>e().then(e=>{let n=(0,rw.get)(e,l);return t[l][C8]=n,{default:n}}));return t[l]=e=>(0,V.jsx)(H.Suspense,{fallback:(0,V.jsx)(nx.A,{}),children:(0,V.jsx)(n,{...e})}),t},{})}function C3(e,t){let l="function"==typeof t?t:e=>e[t],n=e.toString(),o=C5.get(n);if(null==o?void 0:o.error)throw o.error;if(null==o?void 0:o.module)return l(o.module);if(!(null==o?void 0:o.promise)){let t=o||{};throw t.promise=e().then(e=>(t.module=e,e)).catch(e=>{throw t.error=e,e}),C5.set(n,t),t.promise}throw o.promise}function C6(e,t){if(e)return e["x-app-version"]||(e["x-app-version"]=t),Object.keys(e.properties||{}).forEach(l=>{var n;C6(null==(n=e.properties)?void 0:n[l],t)}),e}var C9=JSON.parse('{"rE":"2.1.0-beta.42"}');function C7(e){return new Fr(e)}let Fe=e=>{e&&(e["x-uid"]||(e["x-uid"]=(0,rx.uid)()),Object.keys(e.properties||{}).forEach(t=>{Fe(e.properties[t])}))},Ft=e=>e,Fl=(e,t)=>{if(e&&t){for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)&&t[l]!==(null==e?void 0:e[l]))return!1;return!0}},Fn=(e,t)=>{if(e["x-uid"]&&e["x-uid"]===t["x-uid"])return[null,e.toJSON()];let l=e.toJSON(),n={...l,properties:{}},o=null,r=(e,l)=>{Object.keys(e||{}).forEach(n=>{let i=e[n];if(i["x-uid"]===t["x-uid"]){o=e[n];return}l.properties[n]={...i,properties:{}},r(null==i?void 0:i.properties,l.properties[n])})};return r(l.properties,n),[n,o]},Fo=e=>e;class Fr{get model(){return this.options.model}get query(){return this.options.query}loadAPIClientEvents(){let{api:e,t=Fo}=this.options;if(!e)return;let l=e=>{if(!e)return[];let t=Object.values(e.properties).length,l=[];return(e.mapProperties(e=>{e["x-component-props"]=e["x-component-props"]||{},e["x-component-props"].width=100/t,e["x-uid"]&&l.push({"x-uid":e["x-uid"],"x-component-props":e["x-component-props"]})}),e["x-uid"]&&l.length)?l:[]};this.on("insertAdjacent",async n=>{var o;let{onSuccess:r,current:i,position:a,schema:s,wrap:d,wrapped:u,removed:c}=n,p=[];if((null==u?void 0:u["x-component"])==="Grid.Col"&&(p=p.concat(l(u.parent))),(null==c?void 0:c["x-component"])==="Grid.Col"&&(p=p.concat(l(c.parent))),this.refresh(),!i["x-uid"])return;let m=await e.request({url:`/uiSchemas:insertAdjacent/${i["x-uid"]}?position=${a}`,method:"post",data:{schema:C6(s,this.appVersion),wrap:d}});p.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:p}),(null==c?void 0:c["x-uid"])&&await e.request({url:`/uiSchemas:remove/${c["x-uid"]}`,method:"post"}),null==r||r(null==m||null==(o=m.data)?void 0:o.data),yq.Ay.success(t("Saved successfully"),.2)}),this.on("patch",async l=>{let{schema:n}=l;this.refresh(),(null==n?void 0:n["x-uid"])&&(await e.request({url:"/uiSchemas:patch",method:"post",data:{...n}}),yq.Ay.success(t("Saved successfully"),.2))}),this.on("initializeActionContext",async t=>{let{schema:l}=t;(null==l?void 0:l["x-uid"])&&await e.request({url:"/uiSchemas:initializeActionContext",method:"post",data:{...l}})}),this.on("batchPatch",async l=>{let{schemas:n}=l;this.refresh(),await e.request({url:"/uiSchemas:batchPatch",method:"post",data:n}),yq.Ay.success(t("Saved successfully"),.2)}),this.on("remove",async n=>{let{removed:o}=n,r=[];(null==o?void 0:o["x-component"])==="Grid.Col"&&(r=l(o.parent)),this.refresh(),(null==o?void 0:o["x-uid"])&&(await e.request({url:`/uiSchemas:remove/${o["x-uid"]}`,method:"post"}),r.length&&await e.request({url:"/uiSchemas:batchPatch",method:"post",data:r}),yq.Ay.success(t("Saved successfully"),.2))})}prepareProperty(e){e.type||(e.type="void"),e.name||(e.name=(0,rx.uid)()),this.current["x-uid"]&&Fe(e)}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}async emit(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];if(!this.events[e])return;let[o,...r]=l;return Promise.all(this.events[e].map(e=>e.bind(this)({current:this.current,...o},...r)))}parentsIn(e){if(!e||!ne.Schema.isSchemaInstance(e))return!1;let t=this.current;for(;null==t?void 0:t.parent;){if(t.parent===e)return!0;t=t.parent}return!1}refresh(e){let{refresh:t}=this.options;return null==t?void 0:t(e)}deepMerge(e){let t={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly"},l={"x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(n=>{t[n]?(this.current[n]=e[n],this.updateModel(t[n],e[n])):l[n]?Object.keys(e[n]).forEach(t=>{C2()(this.current,[n,t],e[n][t]),this.updateModel([l[n],t],e[n][t])}):this.current[n]=e[n]}),this.emit("patch",{schema:e})}getSchemaAttribute(e,t){return C0()(this.current,e,t)}shallowMerge(e){let t={title:"title",description:"description",default:"initialValue",readOnly:"readOnly",writeOnly:"editable",enum:"dataSource","x-pattern":"pattern","x-display":"display","x-validator":"validator","x-decorator":"decorator","x-component":"component","x-reactions":"reactions","x-content":"content","x-visible":"visible","x-hidden":"hidden","x-disabled":"disabled","x-editable":"editable","x-read-only":"readOnly","x-decorator-props":"decoratorProps","x-component-props":"componentProps","x-data":"data"};Object.keys(e).forEach(l=>{this.current[l]=e[l],t[l]&&this.updateModel(t[l],e[l])}),this.emit("patch",{schema:e})}updateModel(e,t){let l=l=>{C2()(l,e,t)};this.model&&l(this.model),this.query&&this.query.take(l)}insertAdjacent(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};switch(e){case"beforeBegin":return this.insertBeforeBegin(t,l);case"afterBegin":return this.insertAfterBegin(t,l);case"beforeEnd":return this.insertBeforeEnd(t,l);case"afterEnd":return this.insertAfterEnd(t,l)}}recursiveRemoveIfNoChildren(e,t){let l;if(!e)return;let n=e,o=null==t?void 0:t.breakRemoveOn;for(;n;){if("function"==typeof o){if(o(n))break}else if(Fl(n,o))break;if(Object.keys(n.properties||{}).length>0)break;n.parent&&(l=n.parent.removeProperty(n.name)),n=n.parent}return l}remove(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:l,removeParentsIfNoChildren:n}=t,o=e||this.current,r=o.parent.removeProperty(o.name);if(n){let e=this.recursiveRemoveIfNoChildren(o.parent,{breakRemoveOn:l});e&&(r=e)}return this.emit("remove",{removed:r})}removeWithoutEmit(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{breakRemoveOn:l,removeParentsIfNoChildren:n}=t,o=e||this.current,r=o.parent.removeProperty(o.name);if(n){let e=this.recursiveRemoveIfNoChildren(o.parent,{breakRemoveOn:l});e&&(r=e)}return r}insertBeforeBeginOrAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current)||!ne.Schema.isSchemaInstance(e)||this.current.parent!==e.parent)return;let l=0,n=0;return this.current.parent.mapProperties((t,o,r)=>{this.current.name===o&&(n=r),e.name===o&&(l=r)}),l>n?this.insertBeforeBegin(e,t):this.insertAfterEnd(e,t)}insertBeforeBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current))return;let l={onSuccess:t.onSuccess},{wrap:n=Ft,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ne.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=wc()(e));let i={},a=!1,s=0,d=0;this.current.parent.mapProperties((e,t)=>{t===this.current.name&&(d=s,a=!0,++s),e["x-index"]=s,++s,a&&(i[t]=e,this.current.parent.removeProperty(t))}),this.prepareProperty(e);let u=n(e),c=this.current.parent.addProperty(u.name||(0,rx.uid)(),u);c["x-index"]=d,c.parent=this.current.parent,this.current.parent.setProperties(i);let[p,m]=Fn(c,e);this.emit("insertAdjacent",{position:"beforeBegin",schema:m,wrapped:u,wrap:p,...l})}insertAfterBegin(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current))return;let l={onSuccess:t.onSuccess},{wrap:n=Ft,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ne.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=wc()(e));let i={},a=1;this.current.mapProperties((e,t)=>{e["x-index"]=a,++a,i[t]=e}),this.current.properties={},this.prepareProperty(e);let s=n(e),d=this.current.addProperty(s.name||(0,rx.uid)(),s);d["x-index"]=0,d.parent=this.current,this.current.setProperties(i);let[u,c]=Fn(d,e);this.emit("insertAdjacent",{position:"afterBegin",schema:c,wrap:u,wrapped:s,...l})}insertBeforeEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current))return;delete e["x-index"];let l={onSuccess:t.onSuccess},{wrap:n=Ft,breakRemoveOn:o,removeParentsIfNoChildren:r}=t;if(ne.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o}))}else e&&(e=wc()(e));this.prepareProperty(e);let i=n(e),a=this.current.addProperty(i.name||(0,rx.uid)(),i);a.parent=this.current;let[s,d]=Fn(a,e);return this.emit("insertAdjacent",{position:"beforeEnd",schema:d,wrap:s,wrapped:i,...l})}insertAfterEnd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ne.Schema.isSchemaInstance(this.current))return;let l={onSuccess:null==t?void 0:t.onSuccess},{wrap:n=Ft,breakRemoveOn:o,removeParentsIfNoChildren:r}=t,i=0,a=0,s=!1,d={};if(this.current.parent.mapProperties((e,t)=>{e["x-index"]=i,t===this.current.name&&(a=++i,s=!0),++i,s&&t!==this.current.name&&(d[t]=e,this.current.parent.removeProperty(t))}),ne.Schema.isSchemaInstance(e)){if(this.parentsIn(e))return void this.emit("error",{code:"parent_is_not_allowed",schema:e});e.parent.removeProperty(e.name),r&&(l.removed=this.recursiveRemoveIfNoChildren(e.parent,{breakRemoveOn:o})),e.parent=null}else e&&(e=wc()(e));this.prepareProperty(e);let u=n(e),c=this.current.parent.addProperty(u.name||(0,rx.uid)(),u);c.parent=this.current.parent,c["x-index"]=a,this.current.parent.setProperties(d);let[p,m]=Fn(c,e);this.emit("insertAdjacent",{position:"afterEnd",schema:m,wrap:p,wrapped:u,...l})}constructor(e){this.events={},this.options=e,this.current=e.current,this.appVersion=e.appVersion}}function Fi(){let e=(0,H.useContext)(ne.SchemaOptionsContext),t=(0,H.useMemo)(()=>(null==e?void 0:e.components)||{},[e]);return e=>{if(!e)return null;if("string"!=typeof e)return e;let l=C0()(t,e);return l||console.error(`[nocobase]: Component "${e}" not found`),l}}function Fa(){let{designable:e,setDesignable:t,refresh:l,reset:n}=(0,H.useContext)(Cf),o=(0,H.useContext)(ne.SchemaOptionsContext),r=(0,H.useMemo)(()=>(null==o?void 0:o.components)||{},[o]),i=(0,H.useMemo)(()=>()=>(0,V.jsx)(V.Fragment,{}),[]),a=(0,bh.A)(),s=CV(),d=CL(),u=(0,H.useCallback)(e=>{null==l||l(),a(),null==s||s(e),null==d||d()},[l,a,s,d]),c=(0,ne.useField)(),p=(0,ne.useFieldSchema)(),m=wv(),{t:h}=(0,lj.B)(),f=(0,H.useMemo)(()=>C7({t:h,api:m,refresh:u,current:p,model:c,appVersion:C9.rE}),[h,m,u,p,c]);(0,H.useEffect)(()=>{f.loadAPIClientEvents()},[f]);let{isMobileLayout:g}=bY();return{dn:f,designable:!g&&e,reset:n,refresh:u,setDesignable:t,DesignableBar:i,findComponent:(0,H.useCallback)(e=>{if(!e)return null;if("string"!=typeof e)return e;let t=C0()(r,e);return(null==t?void 0:t[C8])??t},[C0()]),on:f.on.bind(f),patch:(0,H.useCallback)((e,t)=>{let l=e=>{Object.keys(e).forEach(t=>{let l=e[t];"title"===t&&(c.title=l,p.title=l),"x-decorator-props"===t&&(c.decoratorProps||(c.decoratorProps={}),p["x-decorator-props"]||(p["x-decorator-props"]={}),Object.keys(l).forEach(e=>{c.decoratorProps[e]=l[e],p["x-decorator-props"][e]=l[e]})),"x-component-props"===t&&(c.componentProps||(c.componentProps={}),p["x-component-props"]||(p["x-component-props"]={}),Object.keys(l).forEach(e=>{c.componentProps[e]=l[e],p["x-component-props"][e]=l[e]}))})};if("string"==typeof e){let n={};return C2()(n,e,t),l(n)}l(e),u()},[f]),shallowMerge:(0,H.useCallback)(e=>{f.shallowMerge(e)},[f]),deepMerge:(0,H.useCallback)(e=>{f.deepMerge(e)},[f]),remove:(0,H.useCallback)((e,t)=>{f.remove(e,t)},[f]),insertAdjacent:(0,H.useCallback)((e,t,l)=>{f.insertAdjacent(e,t,l)},[f]),insertBeforeBegin:(0,H.useCallback)(e=>{f.insertBeforeBegin(e)},[f]),insertAfterBegin:(0,H.useCallback)(e=>{f.insertAfterBegin(e)},[f]),insertBeforeEnd:(0,H.useCallback)(e=>{f.insertBeforeEnd(e)},[f]),insertAfterEnd:(0,H.useCallback)(e=>{f.insertAfterEnd(e)},[f])}}let Fs=()=>void 0,Fd=(e,t,l)=>{let n;return rC().isFunction(e)?n=e:(n=t[e])||console.error(`${l} is not registered`),n||Fs},Fu=(e,t)=>{let l;if(!e)return Fs;if(rC().isFunction(e))return e;for(let n of e.split("."))l=Fd(n,l||t,e);return l};function Fc(e,t){return Fu(e,(0,ne.useExpressionScope)())(t)}function Fp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=t.displayName||e.displayName||e.name,n=t=>{let{dn:l,findComponent:o}=Fa(),r=Fc((0,H.useMemo)(()=>{let e=l.getSchemaAttribute("x-component"),t=l.getSchemaAttribute("x-decorator"),r=l.getSchemaAttribute("x-use-component-props"),i=l.getSchemaAttribute("x-use-decorator-props");return e&&r&&o(e)===n?r:t&&i&&o(t)===n?i:void 0},[l]),t),i=(0,H.useMemo)(()=>({...t,...r}),[r,t]);return(0,V.jsx)(H.Suspense,{fallback:(0,V.jsx)(nx.A,{}),children:(0,V.jsx)(e,{...i,children:t.children})})};return e.displayName=l,n.displayName=`withSchemaProps(${l})`,n}var Fm=l(16933),Fh=l(60152);let Ff=new Map;function Fg(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;Ff.set(e.toLowerCase(),t)}function Fv(e){return!!e&&Ff.has(e.toLowerCase())}function Fy(e){Object.keys(e).forEach(t=>{Fg(t,e[t])})}Object.keys(rh).forEach(e=>{Fg(e,rh[e])});let Fx=e=>{let{type:t="",component:l,...n}=e;if(l)return(0,V.jsx)(Fm.A,{component:l,...n});if(t&&Ff.has(t.toLowerCase())){let e=Ff.get(t.toLowerCase());return(0,V.jsx)(e,{...n})}return t&&o?(0,V.jsx)(o,{type:t}):null};Fx.createFromIconfontCN=e=>{o=(0,Fh.A)(e)},Fx.register=e=>{Fy(e)};let Fb=(0,H.createContext)(null),FS=e=>{let{children:t,parent:l}=e;return(0,V.jsx)(Fb.Provider,{value:{parent:l},children:t})},Fw=()=>{let e=H.useContext(Fb);return null==e?void 0:e.parent};class FC{setData(e){this.data=e}setParentRecord(e){this.parentRecord=e}constructor(e){const{data:t,parentRecord:l,isNew:n}=e;this.isNew=n,this.data=t,this.parentRecord=l}}let FF=(0,H.createContext)(null);FF.displayName="CollectionRecordContext";let Fk=H.memo(e=>{let{isNew:t,record:l,parentRecord:n,children:o}=e,r=(0,H.useMemo)(()=>n?n instanceof FC?n:new FC({data:n}):l instanceof FC?l.parentRecord:void 0,[n,l]),i=(0,H.useMemo)(()=>{let e;return l?l instanceof FC?(e=l).isNew=l.isNew||t:e=new FC({data:l,isNew:t}):e=new FC({isNew:t}),e.setParentRecord(r),e},[l,r,t]);return(0,V.jsx)(FF.Provider,{value:i,children:o})});function FA(){return(0,H.useContext)(FF)}function FP(){let e=FA();return null==e?void 0:e.data}function Fj(){let e=FA();return null==e?void 0:e.parentRecord}function FM(){var e;let t=FA();return null==t||null==(e=t.parentRecord)?void 0:e.data}Fk.displayName="CollectionRecordProvider";let FI=H.createContext(null),FT=H.createContext(null),FR=H.memo(e=>{var t,l;let{t:n}=(0,lj.B)(),o=FP(),r=enM(),i=FE();return(0,V.jsx)(FT.Provider,{value:{name:"$nParentPopupRecord",title:n("Parent popup record"),value:(null==(t=e.parent)?void 0:t.recordData)||(null==i?void 0:i.value),collection:(null==(l=e.parent)?void 0:l.collection)||(null==i?void 0:i.collection)},children:(0,V.jsx)(FI.Provider,{value:{name:"$nPopupRecord",title:n("Current popup record"),value:e.recordData||o,collection:e.collection||r},children:e.children})})});FR.displayName="VariablePopupRecordProvider";let FE=()=>H.useContext(FI),FN=()=>H.useContext(FT);class FD{get app(){return this.dataSourceManager.app}get key(){return this.options.key}get displayName(){return this.options.displayName}get status(){return this.options.status}get errorMessage(){return this.options.errorMessage}get collections(){return this.collectionManager.getCollections()||[]}getOptions(){return this.options}setOptions(e){Object.assign(this.options,e)}getOption(e){return this.options[e]}addReloadCallback(e){this.reloadCallbacks.includes(e)||this.reloadCallbacks.push(e)}removeReloadCallback(e){this.reloadCallbacks=this.reloadCallbacks.filter(t=>t!==e)}get flowEngineDataSourceManager(){var e;return null==(e=this.app.flowEngine)?void 0:e.context.dataSourceManager}async reload(){let e=await this.getDataSource(),t=this.flowEngineDataSourceManager;return t&&(t.upsertDataSource(this.options),t.getDataSource(this.key).upsertCollections(e.collections||[],{clearFields:!0})),this.setOptions(e),this.collectionManager.setCollections(e.collections||[]),this.reloadCallbacks.forEach(t=>t(e.collections)),this.options}constructor(e,t){this.options=e,this.dataSourceManager=t,this.reloadCallbacks=[],this.collectionManager=new enE(e.collections,this)}}class FB extends FD{getDataSource(){return{collections:this.collections}}}class F${addCollectionTemplates(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.reduce((e,t)=>{let l=new t(this);return e[l.name]=l,e},{});return Object.assign(this.collectionTemplateInstances,t),this.dataSourceManager.getDataSources().forEach(e=>{let l=e.collectionManager.getCollections(e=>t[e.template]);e.collectionManager.reAddCollections(l)}),t}getCollectionTemplate(e){return this.collectionTemplateInstances[e]}getCollectionTemplates(e){return Object.values(this.collectionTemplateInstances).filter(t=>{var l,n;return!e||!t.supportDataSourceType&&!t.notSupportDataSourceType||(t.supportDataSourceType?null==(l=t.supportDataSourceType)?void 0:l.includes(e):t.notSupportDataSourceType?!(null==(n=t.notSupportDataSourceType)?void 0:n.includes(e)):void 0)}).sort((e,t)=>(e.order||0)-(t.order||0))}constructor(e,t){this.dataSourceManager=t,this.collectionTemplateInstances={},this.addCollectionTemplates(e)}}var FO=l(84795);let Fq=fD()(),F_=(0,C.css)`
|
|
882
882
|
width: 100%;
|
|
883
883
|
& > .ant-space-item {
|
|
884
884
|
flex: 1;
|
|
@@ -2886,7 +2886,7 @@ ${JSON.stringify(g,null,2)}`)},[d,s,a,o,n,C,t,i,r,h,l,f,x,F,b,S,m]),A=(0,H.useCa
|
|
|
2886
2886
|
... (stack truncated)`}function F(e){let t=String(e||"").split("\n"),l=new Set;for(let e=0;e<t.length;e++){let n=t[e];(g.test(n)||v.test(n))&&l.add(e)}if(0===l.size)return()=>!1;let n=[0];for(let e=1;e<t.length;e++)n[e]=n[e-1]+t[e-1].length+1;let o=e=>{let t=0,l=n.length-1,o=0;for(;t<=l;){let r=t+l>>1;n[r]<=e?(o=r,t=r+1):l=r-1}return o};return e=>l.has(o(e))}function k(e,t){let l=Math.max(0,Math.min(e.length,Math.floor(t))),n=e.lineAt(l);return{line:n.number,column:l-n.from+1}}function A(e){return[...e].sort((e,t)=>{var l,n,o,r,i,a,s,d;let u=+("lint"!==e.type),c=+("lint"!==t.type);if(u!==c)return u-c;let p=(null==(n=e.location)||null==(l=n.start)?void 0:l.line)??Number.MAX_SAFE_INTEGER,m=(null==(r=t.location)||null==(o=r.start)?void 0:o.line)??Number.MAX_SAFE_INTEGER;if(p!==m)return p-m;let h=(null==(a=e.location)||null==(i=a.start)?void 0:i.column)??Number.MAX_SAFE_INTEGER,f=(null==(d=t.location)||null==(s=d.start)?void 0:s.column)??Number.MAX_SAFE_INTEGER;return h!==f?h-f:String(e.ruleId||"").localeCompare(String(t.ruleId||""))})}function P(e){let t={error:0,warn:1,info:2,log:3};return e.map((e,t)=>({log:e,index:t})).sort((e,l)=>{let n=t[e.log.level]??Number.MAX_SAFE_INTEGER,o=t[l.log.level]??Number.MAX_SAFE_INTEGER;return n!==o?n-o:e.index-l.index}).map(e=>e.log)}function j(e){let t,l=String(e||"");if(!l.trim())return[];let n=o.EY.of(l.split("\n")),r=F(l);try{t=f.parse(l).cursor()}catch(e){return[{type:"lint",ruleId:"parse-error",message:`Syntax error: ${y((null==e?void 0:e.message)||e)}`,location:{start:{line:1,column:1}}}]}let i=[],a=new Set,s=e=>{let t=Math.max(0,Math.min(l.length,e));if(r(t)||a.has(t))return;a.add(t);let o=k(n,t),s=l.slice(t,Math.min(l.length,t+24)).replace(/\s+/g," ").trim(),d=s?` near "${s}"`:"";i.push({type:"lint",ruleId:"parse-error",message:`Syntax error${d}.`,location:{start:o}})};do t.type.isError&&s(t.from);while(t.next());return i}function M(e){let t,l=String(e||"");if(!l.trim())return[];let n=F(l),i=o.EY.of(l.split("\n")),d=[],c=(e,t,o)=>{let r=Math.max(0,Math.min(l.length,e));if(n(r))return;let a=k(i,r);d.push({type:"lint",ruleId:t,message:o,location:{start:a}})},p=()=>{let e="no-noncallable-call",t=new Set,o=o=>{let r=Math.max(0,Math.min(l.length,o));n(r)||t.has(r)||(t.add(r),c(r,e,"This expression is not callable."))},r=l.length,i=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||95===t||36===t},a=e=>{if(!e)return!1;let t=e.charCodeAt(0);return i(e)||t>=48&&t<=57},s=e=>{let t=e;for(;t<r&&/\s/.test(l[t]);)t++;return t},d=e=>!(e>=r)&&("("===l[e]||"?"===l[e]&&"."===l[e+1]&&"("===l[e+2]),u=e=>{let t=1,n="code";for(let o=e+1;o<r;o++){let e=l[o],i=o+1<r?l[o+1]:"";if("lineComment"===n){"\n"===e&&(n="code");continue}if("blockComment"===n){"*"===e&&"/"===i&&(n="code",o+=1);continue}if("single"===n){if("\\"===e){o+=1;continue}"'"===e&&(n="code");continue}if("double"===n){if("\\"===e){o+=1;continue}'"'===e&&(n="code");continue}if("template"===n){if("\\"===e){o+=1;continue}"`"===e&&(n="code");continue}if("/"===e&&"/"===i){n="lineComment",o+=1;continue}if("/"===e&&"*"===i){n="blockComment",o+=1;continue}if("'"===e){n="single";continue}if('"'===e){n="double";continue}if("`"===e){n="template";continue}if("("===e)t++;else if(")"===e&&0==--t)return o}return -1},p=e=>"true"===e||"false"===e||"null"===e,m="code";for(let e=0;e<r;e++){let t=l[e],n=e+1<r?l[e+1]:"";if("lineComment"===m){"\n"===t&&(m="code");continue}if("blockComment"===m){"*"===t&&"/"===n&&(m="code",e+=1);continue}if("/"===t&&"/"===n){m="lineComment",e+=1;continue}if("/"===t&&"*"===n){m="blockComment",e+=1;continue}if("'"===t||'"'===t){let n=t,i=e;for(e+=1;e<r;){let t=l[e];if("\\"===t){e+=2;continue}if(t===n)break;e+=1}d(s(Math.min(r,e+1)))&&o(i);continue}if("`"===t){let t=e;for(e+=1;e<r;){let t=l[e];if("\\"===t){e+=2;continue}if("`"===t)break;e+=1}d(s(Math.min(r,e+1)))&&o(t);continue}if(t>="0"&&t<="9"){let t=e;for(e+=1;e<r&&l[e]>="0"&&l[e]<="9";)e++;if("."===l[e])for(e+=1;e<r&&l[e]>="0"&&l[e]<="9";)e++;if("e"===l[e]||"E"===l[e]){let t=l[e+1],n=e+1;if(("+"===t||"-"===t)&&(n+=1),l[n]>="0"&&l[n]<="9")for(e=n+1;e<r&&l[e]>="0"&&l[e]<="9";)e++}"n"===l[e]&&(e+=1),d(s(e))&&o(t),e-=1;continue}if(i(t)){let t=e;for(e+=1;e<r&&a(l[e]);)e++;p(l.slice(t,e))&&d(s(e))&&o(t),e-=1;continue}if("("===t){let t=s(e+1),n=t,c=!1;("+"===l[t]||"-"===l[t])&&(n=t,t=s(t+1));let m=l[t];if("{"===m||"["===m||"'"===m||'"'===m||"`"===m)c=!0;else if(m>="0"&&m<="9")c=!0;else if(i(m)){let e=t+1;for(;e<r&&a(l[e]);)e++;p(l.slice(t,e))&&(c=!0)}if(c){let t=u(e);t>e&&d(s(t+1))&&o(n)}}}};try{let e=r.Parser||r;t=("function"==typeof a()?e.extend(a()()):e).parse(l,{ecmaVersion:2022,sourceType:"script",allowAwaitOutsideFunction:!0,allowReturnOutsideFunction:!0,locations:!0})}catch(e){return p(),d}let m=new Set(["ctx","console","window","document","navigator","Math","Date","Array","Object","Number","String","Boolean","Promise","RegExp","Set","Map","WeakSet","WeakMap","JSON","Intl","URL","Error","TypeError","encodeURIComponent","decodeURIComponent","parseInt","parseFloat","isNaN","isFinite","undefined","NaN","Infinity"]),h=e=>{e&&"string"==typeof e.name&&m.add(e.name)},f=e=>{if(!e)return;let t=[e];for(;t.length;){let e=t.pop();e&&("Identifier"===e.type?h(e):"AssignmentPattern"===e.type?t.push(e.left):"ArrayPattern"===e.type?(e.elements||[]).forEach(e=>e&&t.push(e)):"ObjectPattern"===e.type&&(e.properties||[]).forEach(e=>e&&t.push(e.value||e)))}};try{s.a2(t,e=>{switch(null==e?void 0:e.type){case"VariableDeclarator":f(e.id);break;case"FunctionDeclaration":case"FunctionExpression":h(e.id),(e.params||[]).forEach(f);break;case"ArrowFunctionExpression":(e.params||[]).forEach(f);break;case"CatchClause":f(e.param);break;case"ClassDeclaration":h(e.id)}},u)}catch(e){}try{s.a2(t,e=>{if(!e||"string"!=typeof e.type||"CallExpression"!==e.type)return;let t=e.callee;if(!(t&&("Identifier"===t.type||"MemberExpression"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type||"CallExpression"===t.type||"ChainExpression"===t.type))){let l=(null==t?void 0:t.start)??e.start??0;c(l,"no-noncallable-call","This expression is not callable.")}},u)}catch(e){}try{let e=new Set,l=new Set(["t"]);s.a2(t,t=>{var n,o,r;if(!t||"string"!=typeof t.type||"CallExpression"!==t.type)return;let i=t.callee;if((null==i?void 0:i.type)==="ChainExpression"&&(i=i.expression),!i||"MemberExpression"!==i.type)return;let a=i.object;if(!a||"Identifier"!==a.type||"ctx"!==a.name)return;let s=null;if(i.computed||(null==(n=i.property)?void 0:n.type)!=="Identifier"?i.computed&&(null==(o=i.property)?void 0:o.type)==="Literal"&&"string"==typeof i.property.value&&(s=i.property.value):s=i.property.name,!s||"string"!=typeof s)return;let d=s.trim();if(!d||d.startsWith("_")||d.length>2||l.has(d)||e.has(d))return;let u=(null==(r=i.property)?void 0:r.start)??i.start??t.start??0;c(u,"possible-undefined-ctx-member-call",`Possible undefined ctx method call: ctx.${d}(). This may be a typo or not available in the current ctx API.`),e.add(d)},u)}catch(e){}try{let e=new Set;s.ai(t,{Identifier(t,l){let n=null==t?void 0:t.name;if(!n||m.has(n)||e.has(n))return;let o=l[l.length-2];if(!o||"VariableDeclarator"===o.type&&o.id===t||"FunctionDeclaration"===o.type&&o.id===t||"FunctionExpression"===o.type&&o.id===t||"ClassDeclaration"===o.type&&o.id===t||"ClassExpression"===o.type&&o.id===t||"Property"===o.type&&o.key===t&&!0!==o.computed||"MemberExpression"===o.type&&o.property===t&&!0!==o.computed||"LabeledStatement"===o.type&&o.label===t||"BreakStatement"===o.type&&o.label===t||"ContinueStatement"===o.type&&o.label===t)return;let r=t.start??0;c(r,"possible-undefined-variable",`Possible undefined variable: ${n}`),e.add(n)}},u)}catch(e){}return d}function I(e){let t=(t,l)=>{let n=l.map(e=>y(e)).join(" ").trim();e.push({level:t,message:n})},l={trace:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("log",l)},debug:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("log",l)},info:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("info",l)},warn:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("warn",l)},error:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("error",l)},fatal:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("error",l)},child:()=>l};return{consoleCapture:{log:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("log",l)},info:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("info",l)},warn:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("warn",l)},error:function(){for(var e=arguments.length,l=Array(e),n=0;n<e;n++)l[n]=arguments[n];return t("error",l)}},loggerCapture:l}}function T(e){if(!e.length)return;let t={timeout:0,internal:1,"preview-start-failed":2};return[...e].sort((e,l)=>{let n=t[String(e.ruleId||"")]??10,o=t[String(l.ruleId||"")]??10;return n!==o?n-o:0})[0]}function R(e){var t;let l=null==(t=e.location)?void 0:t.start,n=l?`line ${l.line}:${l.column} `:"",o=e.ruleId?`(${e.ruleId}) `:"";return`${n}${o}${e.message}`.trim()}function E(e){if(!e)return"Preview execution: unknown";let t="number"==typeof e.durationMs?`${Math.round(e.durationMs)}ms`:"unknown";return`Preview execution: started=${e.started}, finished=${e.finished}, timeout=${e.timeout}, duration=${t}`}function N(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",n=String(e||"");return n.length<=t?n:`${n.slice(0,Math.max(0,t-l.length))}${l}`}function D(e,t){let{issues:l,logs:n,execution:o}=e,r=l.filter(e=>"lint"===e.type),i=l.filter(e=>"runtime"===e.type),a=P(n),s=T(i),d=[],u=l.length,c=r.length,p=i.length,m=a.length,h=e=>{e.length&&(d.push("Key logs:"),e.forEach(e=>{d.push(`[${e.level}] ${N(e.message,t.maxLogChars)}`)}),a.length>e.length&&d.push(`... ${a.length-e.length} more logs not shown`))};if(0===u){let e=a.some(e=>"warn"===e.level||"error"===e.level);d.push(e?`RunJS preview completed with warning/error logs: no diagnostic issues found. Logs: ${m}.`:`RunJS preview succeeded: no issues found. Logs: ${m}.`),d.push(E(o));let l=a.slice(0,Math.max(0,t.maxLogs));l.length&&(d.push(""),h(l));let n=d.join("\n").trimEnd();return{message:N(n,t.maxChars),truncated:n.length>t.maxChars}}d.push(`RunJS preview failed: ${u} issues (lint ${c} / runtime ${p}), logs: ${m}.`),d.push(E(o)),d.push("");let f=(e,l)=>{if(!l.length)return;d.push(`${e}:`);let n=l.slice(0,Math.max(0,t.maxIssues));n.forEach((e,l)=>{let n=`${l+1}) ${R(e)}`;if(d.push(n),t.includeStack&&e.stack){let l=N(String(e.stack),t.maxStackChars);d.push(N(l,t.maxStackChars))}}),l.length>n.length&&d.push(`... ${l.length-n.length} more not shown`),d.push("")},g=s&&i.length>1?[s,...i.filter(e=>e!==s)]:i;f("Static issues",r),f("Runtime issues",g);let v=a.slice(0,Math.max(0,t.maxLogs));v.length&&h(v);let y=d.join("\n").trimEnd(),x=y.length>t.maxChars;return{message:x?N(y,t.maxChars):y,truncated:x}}function B(e){let t=`(issues total ${e.issues.length}, logs total ${e.logs.length})`,l=!1;for(let n of[{maxLogs:40,maxLogChars:220,maxIssues:12,includeStack:!0,maxStackChars:800},{maxLogs:20,maxLogChars:160,maxIssues:10,includeStack:!0,maxStackChars:400},{maxLogs:12,maxLogChars:140,maxIssues:8,includeStack:!1,maxStackChars:0},{maxLogs:8,maxLogChars:120,maxIssues:5,includeStack:!1,maxStackChars:0},{maxLogs:3,maxLogChars:100,maxIssues:3,includeStack:!1,maxStackChars:0}]){let{message:o,truncated:r}=D(e,{...n,maxChars:c});if(l=l||r,!r){if(!l)return o;return N(`RunJS preview output was truncated.
|
|
2887
2887
|
${t}
|
|
2888
2888
|
|
|
2889
|
-
${o}`,c)}}let n=T(e.issues.filter(e=>"runtime"===e.type)),o=n?`Key runtime issue: ${R(n)}`:"",r=["RunJS preview output was truncated.",t,e.execution?E(e.execution):void 0,o||void 0].filter(Boolean).join("\n").trim();return r.length<=c?r:N(r,c-1)+"\n"}function $(e){return B(e)}async function O(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n="string"==typeof e?e:String(e??""),o=[],r=[],i=null==l?void 0:l.version,a=(0,d.shouldPreprocessRunJSTemplates)({version:i});r.push(...j(n)),r.push(...M(n));let s="u">typeof performance&&"function"==typeof performance.now?performance.now():Date.now(),u={started:!1,finished:!1,timeout:!1,durationMs:void 0};try{u.started=!0;let{consoleCapture:e,loggerCapture:l}=I(o),s={console:e};try{if("u">typeof window){let e=(0,d.createSafeNavigator)();s.navigator=e,s.window=(0,d.createSafeWindow)({navigator:e}),s.document=(0,d.createSafeDocument)()}}catch(e){}let c=n;try{c=await (0,d.prepareRunJsCode)(n,{preprocessTemplates:a})}catch(n){let e=String((null==n?void 0:n.name)||""),t=y((null==n?void 0:n.message)||n),l=n instanceof SyntaxError||/^SyntaxError\b/i.test(e)||/SyntaxError\b/i.test(t);return r.push({type:"runtime",ruleId:l?"preview-start-failed":"internal",message:l?t:`Preview internal failure: ${t}`,stack:C(n)}),u.finished=!0,u.timeout=!1,{issues:A(r),logs:o,execution:u}}let m=await t.createJSRunner({globals:s,timeoutMs:p,version:i});m.globals.ctx.defineProperty("logger",{value:l});let h=await m.run(c);if(u.finished=!0,u.timeout=!!(null==h?void 0:h.timeout),!(null==h?void 0:h.success)){let e=null==h?void 0:h.error,t=(null==h?void 0:h.timeout)?"Execution timed out":y((null==e?void 0:e.message)||e||"Unknown error"),l=e instanceof SyntaxError||/^SyntaxError\b/i.test(String((null==e?void 0:e.name)||""));r.push({type:"runtime",ruleId:(null==h?void 0:h.timeout)?"timeout":l?"preview-start-failed":"runtime-error",message:t,stack:C(e)})}}catch(e){u.finished=!0,u.timeout=!1,r.push({type:"runtime",ruleId:"internal",message:`Preview internal failure: ${y((null==e?void 0:e.message)||e)}`,stack:C(e)})}finally{let e=Math.max(0,("u">typeof performance&&"function"==typeof performance.now?performance.now():Date.now())-s);u.durationMs=Number.isFinite(e)?e:void 0}return{issues:A(r),logs:o,execution:u}}function q(e){let t=new d.FlowContext;if(t.addDelegate(e),"u">typeof document&&"function"==typeof document.createElement&&!e.element)try{let e=document.createElement("div");t.defineProperty("element",{value:e})}catch(e){}return t}async function _(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=q(t),o=await O(e,n,l),r=0===o.issues.length,i=$(o);return{success:r,message:i.length>c?N(i,c):i}}},68669(e,t,l){"use strict";l.d(t,{a:()=>a});var n=l(74848),o=l(84626),r=l(71021);l(96540);var i=l(7521);let a=(0,l(11869).observer)(e=>{var t;let{value:l,FilterItem:a,ctx:s}=e;l.logic||(l.logic="$and"),Array.isArray(l.items)||(l.items=[]);let d=()=>{var e;(null==s||null==(e=s.model)?void 0:e.dispatchEvent)&&s.model.dispatchEvent("reset")},u=()=>{var e;(null==s||null==(e=s.model)?void 0:e.dispatchEvent)&&s.model.dispatchEvent("submit")},c=(null==s||null==(t=s.model)?void 0:t.translate)||(e=>e);return(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),u()},children:[(0,n.jsx)(i.I,{value:l,FilterItem:a}),(0,n.jsxs)(o.A,{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:[(0,n.jsx)(r.Ay,{htmlType:"button",onClick:d,children:c("Reset")}),(0,n.jsx)(r.Ay,{type:"primary",htmlType:"submit",children:c("Submit")})]})]})},{displayName:"FilterContent"})},7521(e,t,l){"use strict";l.d(t,{I:()=>f});var n=l(74848),o=l(97373),r=l(18853),i=l(35710),a=l(36492),s=l(84626),d=l(71021),u=l(18492);l(96540);var c=l(11869);let p=new WeakMap,m=0,h=e=>{let t=p.get(e);return t||(m+=1,t=`filter-item-${m}`,p.set(e,t)),t},f=(0,c.observer)(e=>{let{token:t}=i.A.useToken(),{value:l={logic:"$and",items:[]},FilterItem:c,showBorder:p=!1,onRemove:m,onChange:g,closeIcon:v=(0,n.jsx)(o.A,{style:{color:t.colorIcon}})}=e,{t:y}=(0,u.B)();l.logic||(l.logic="$and"),Array.isArray(l.items)||(l.items=[]);let{logic:x,items:b}=l,S=p?{position:"relative",border:`1px dashed ${t.colorBorder}`,padding:t.paddingSM,marginBottom:t.marginXS,borderRadius:t.borderRadius}:{position:"relative",marginBottom:t.marginXS},w=e=>{l.logic=e,null==g||g(l)},C=()=>{b.push({path:"",operator:"",value:""}),null==g||g(l)},F=()=>{b.push({logic:"$and",items:[]}),null==g||g(l)},k=e=>{b.splice(e,1),null==g||g(l)},A=e=>"path"in e||"operator"in e||"value"in e,P=e=>"logic"in e&&"items"in e;return(0,n.jsxs)("div",{style:S,children:[p&&m&&(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{position:"absolute",right:10,top:10,cursor:"pointer",background:"transparent",border:0,padding:0},onClick:m,children:v}),(0,n.jsx)("div",{style:{marginBottom:8,color:t.colorText},children:(0,n.jsxs)("span",{children:[y("Meet")," ",(0,n.jsxs)(a.A,{"data-testid":"filter-select-all-or-any",style:{width:"auto"},value:x,onChange:w,children:[(0,n.jsx)(a.A.Option,{value:"$and",children:y("All")}),(0,n.jsx)(a.A.Option,{value:"$or",children:y("Any")})]})," ",y("conditions in the group")]})}),(0,n.jsx)("div",{children:b.map((e,o)=>P(e)?(0,n.jsx)(f,{value:e,FilterItem:c,showBorder:!0,onRemove:()=>k(o),onChange:e=>{b[o]=e,null==g||g(l)}},h(e)):A(e)?c?(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsx)(c,{value:e}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>k(o),children:v})]})},h(e)):(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsxs)("span",{children:[e.path," ",e.operator," ",String(e.value)]}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>k(o),children:v})]})},h(e)):(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsx)("span",{style:{color:t.colorTextTertiary},children:"Invalid filter item"}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>k(o),children:v})]})},h(e)))}),(0,n.jsxs)(s.A,{size:16,style:{marginTop:8,marginBottom:8},children:[(0,n.jsx)(d.Ay,{style:{padding:0},type:"link",size:"small",icon:(0,n.jsx)(r.A,{}),onClick:C,children:y("Add condition")}),(0,n.jsx)(d.Ay,{style:{padding:0},type:"link",size:"small",icon:(0,n.jsx)(r.A,{}),onClick:F,children:y("Add condition group")})]})]})},{displayName:"FilterGroup"})},44e3(e,t,l){"use strict";l.d(t,{H:()=>n});let n=(e,t,l,n)=>e.map(e=>o(e,t,l,n)).filter(Boolean),o=(e,t,l,o)=>{var r;if(l.length&&1===t&&l.includes(e.name)||!e.interface||!1===e.filterable)return;let i=e.getInterfaceOptions();if(!(null==i?void 0:i.filterable))return;let{nested:a,children:s,operators:d}=i.filterable,u={name:e.name,type:e.type,target:e.target,title:o(e.title),schema:null==e?void 0:e.uiSchema,operators:((null==d||null==(r=d.filter)?void 0:r.call(d,t=>!(null==t?void 0:t.visible)||t.visible(e)))||[]).map(e=>({...e,label:o(e.label)}))};if(!e.target||!(t>2)){if(t>2)return u;if((null==s?void 0:s.length)&&(u.children=s),a){let r=n(e.getFields().filter(e=>"attachments"!==e.target&&"formula"!==e.interface),t+1,l,o).filter(Boolean);u.children=u.children||[],u.children.push(...r)}return u}}},58528(e,t,l){"use strict";l.d(t,{Ru:()=>z,I8:()=>o.I,qi:()=>p,oJ:()=>n.a,Et:()=>T,uw:()=>K.u});var n=l(68669),o=l(7521),r=l(74848),i=l(11869),a=l(84626),s=l(36492),d=l(95725),u=l(96540),c=l(44e3);let p=(0,i.observer)(e=>{var t;let{path:l,operator:n,value:o}=e.value,i=e.model,p=(null==(t=i.context.blockModel.collection)?void 0:t.getFields().filter(e=>"attachments"!==e.target))||[],h=m(i.props.filterableFieldNames||[],p.map(e=>e.name)),f=i.translate,g=(0,c.H)(p.filter(e=>"attachments"!==e.target&&"formula"!==e.interface&&!["belongsTo","belongsToMany","hasOne","hasMany","oho","obo","m2o","o2m","m2m"].includes(e.type)),1,e.noIgnore?[]:h,f).filter(Boolean),v=(0,u.useMemo)(()=>{let e=g.find(e=>e.name===l);return(null==e?void 0:e.operators)||[]},[g,l]),y=t=>{var l;e.value.path=t;let n=g.find(e=>e.name===t);(null==n||null==(l=n.operators)?void 0:l.length)>0?e.value.operator=n.operators[0].value:e.value.operator="",e.value.value=""},x=t=>{e.value.operator=t},b=t=>{e.value.value=t.target.value};return(0,r.jsxs)(a.A,{children:[(0,r.jsx)(s.A,{style:{width:200},placeholder:f("Select field"),value:l||void 0,onChange:y,children:g.map(e=>(0,r.jsx)(s.A.Option,{value:e.name,children:e.title},e.name))}),(0,r.jsx)(s.A,{style:{width:120},placeholder:f("Select operator"),value:n||void 0,onChange:x,disabled:!l||0===v.length,children:v.map(e=>(0,r.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),(0,r.jsx)(d.A,{style:{width:200},placeholder:f("Enter value"),value:o,onChange:b})]})},{displayName:"FilterItem"});function m(e,t){return null==t?void 0:t.filter(t=>!e.includes(t))}var h=l(63718),f=l(94313),g=l(60518),v=l(51643),y=l(60209),x=l(2077),b=l(18451),S=l.n(b),w=l(40098),C=l.n(w),F=l(20419),k=l(85352),A=l(53869);let{DateFilterDynamicComponent:P}=(0,x.RZ)(()=>Promise.resolve().then(l.bind(l,13595)),"DateFilterDynamicComponent");async function j(e){var t,l,n,o;let r=async e=>Array.isArray(e)?e:"function"==typeof e?await e():[];if(null==(l=e.getPropertyOptions)||null==(t=l.call(e,"collection"))?void 0:t.meta){let t=null==(o=e.getPropertyMetaTree)?void 0:o.call(e,"{{ ctx.collection }}");return await r(t)}let a=()=>(null==e?void 0:e.collection)??null,s=await (0,i.createEphemeralContext)(e,{defineProperties:{collection:{get:a,meta:(0,i.createCollectionContextMeta)(a,"Current collection")}}}),d=null==(n=s.getPropertyMetaTree)?void 0:n.call(s,"{{ ctx.collection }}");return await r(d)}function M(e,t,l,n){var o;let i=null==e?void 0:e["x-component"],a=(null==t||null==(o=t.uiSchema)?void 0:o["x-component-props"])||{},u=(null==e?void 0:e["x-component-props"])||{},c=S()({},a,u),p=(0,k.di)(null==e?void 0:e.enum,l)||[],m={style:{width:200,...(null==c?void 0:c.style)||{}},placeholder:(null==c?void 0:c.placeholder)||l("Enter value"),...c},x=e=>{if("number"==typeof e||(null==c?void 0:c.stringMode)===!0&&"string"==typeof e)return e};return e=>{let{value:t,onChange:l,...o}=e||{};if("InputNumber"===i)return(0,r.jsx)(h.A,{...m,...o,value:x(t),onChange:e=>null==l?void 0:l(e)});if("NumberPicker"===i)return(0,r.jsx)(F.NumberPicker,{...m,...o,value:x(t),onChange:e=>null==l?void 0:l(e)});if("Switch"===i)return(0,r.jsx)(f.A,{...m,...o,checked:!!t,onChange:e=>null==l?void 0:l(e)});if("Select"===i)return(0,r.jsx)(s.A,{options:p,...m,...o,value:(0,k.xO)(t,m),onChange:e=>null==l?void 0:l(e)});if("Checkbox"===i)return(0,r.jsx)(g.A,{...m,...o,checked:!!t,onChange:e=>null==l?void 0:l(e.target.checked)});if("Checkbox.Group"===i)return(0,r.jsx)(g.A.Group,{...m,...o,value:Array.isArray(t)?t:void 0,onChange:e=>null==l?void 0:l(e)});if("Radio.Group"===i)return(0,r.jsx)(v.Ay.Group,{...m,...o,value:Array.isArray(t)||"string"==typeof t||"number"==typeof t||"boolean"==typeof t?t:void 0,onChange:e=>null==l?void 0:l(e.target.value)});if("Cascader"===i)return(0,r.jsx)(y.A,{...m,...o,value:Array.isArray(t)?t:void 0,onChange:e=>null==l?void 0:l(e)});if("Input.TextArea"===i||"TextArea"===i)return(0,r.jsx)(d.A.TextArea,{...m,...o,value:"string"==typeof t?t:null==t?"":String(t),onChange:e=>null==l?void 0:l(e.target.value)});if("DateFilterDynamicComponent"===i)return(0,r.jsx)(P,{...m,...o,value:t,onChange:e=>null==l?void 0:l(e)});if(i&&(null==n?void 0:n.getComponent)){let e=n.getComponent(i);if(e)return(0,r.jsx)(e,{...m,...o,value:t,onChange:e=>null==l?void 0:l(e),style:{width:200,...m.style||{},...null==o?void 0:o.style}})}return(0,r.jsx)(d.A,{...m,...o,value:"string"==typeof t?t:null==t?"":String(t),onChange:e=>null==l?void 0:l(e.target.value)})}}function I(e){if(e&&"object"==typeof e){let l=e;if("function"==typeof l.preventDefault||l.nativeEvent||"target"in l){var t;let n=null==(t=l.target)?void 0:t.value;return void 0!==n?n:e}}return e}let T=(0,i.observer)(e=>{let{value:t,model:l,rightAsVariable:n,rightMetaTree:o,ignoreFieldNames:c}=e,p=(0,i.useFlowViewContext)(),m=l.translate,{path:h,operator:f,value:g}=t,[v,y]=(0,u.useState)(null),b=(0,u.useCallback)(e=>{var t;return(0,x.w6)(e,l.context.dataSourceManager,null==(t=l.context.app)?void 0:t.dataSourceManager)},[l]),w=(0,u.useMemo)(()=>{var e,t;if(!v)return[];let l=v.interface?b(v.interface):void 0,n=null==v||null==(e=v.uiSchema)?void 0:e["x-filter-operators"];return((Array.isArray(n)&&n.length?n:null==l||null==(t=l.filterable)?void 0:t.operators)||[]).filter(e=>!e.visible||e.visible(v))},[b,v]);(0,u.useEffect)(()=>{if(!w.length)return;let e=C().find(w,e=>e.value===t.operator);if(e)t.noValue=!!e.noValue;else{let e=w[0];t.operator=e.value,t.value=!!e.noValue||void 0,t.noValue=!!e.noValue}},[w,t]);let F=(0,u.useMemo)(()=>w.map(e=>({value:e.value,label:"string"==typeof e.label?m(e.label):e.label})),[w,m]),P=(0,u.useCallback)((e,l)=>{let n=t.path||"",o=e||"",r=o!==n;t.path=o,r&&n&&(t.operator="",t.value=void 0,t.noValue=!1),l&&y(l)},[t]),T=(0,u.useMemo)(()=>({resolveValueFromPath:e=>(y(e),(null==e?void 0:e.paths.slice(1).join("."))||null),resolvePathFromValue(e){if(null==e)return;let t=String(e).trim();if(t)return["collection",...t.split(".")]}}),[]),R=(0,u.useCallback)(e=>{t.operator=e;let l=w.find(t=>t.value===e);(null==l?void 0:l.noValue)?(t.value=!0,t.noValue=!0):(t.value=void 0,t.noValue=!1)},[w,t]),E=(0,u.useMemo)(()=>w.find(e=>e.value===f),[w,f]),N=(0,u.useCallback)(e=>{var t,l;return(null==e||null==(t=e.options)?void 0:t.dataType)||(null==e?void 0:e.dataType)||(null==e?void 0:e.type)||(null==e||null==(l=e.uiSchema)?void 0:l.type)||"double"},[]),D=(0,u.useCallback)(e=>{switch(e){case"boolean":return"Switch";case"date":return"DateFilterDynamicComponent";case"integer":case"bigInt":case"double":case"decimal":case"number":return"InputNumber";default:return"Input"}},[]),B=(0,u.useMemo)(()=>{let e=(null==v?void 0:v.uiSchema)||{},t=(null==E?void 0:E.schema)||{},l=S()({},e,t);if((null==v?void 0:v.interface)==="formula"){let e={"x-read-pretty":!1,"x-component":D(N(v)),"x-component-props":{...l["x-component-props"]}};return S()({},l,e)}return l},[v,E,D,N]),$=u.useRef(null==B?void 0:B["x-component"]),O=null==B?void 0:B["x-component"],q=(0,u.useMemo)(()=>{let e=$.current;$.current=O;let l=void 0!==e&&e!==O;if(null==E?void 0:E.noValue)return g;if(l&&null!=g){t.value=void 0;return}return g},[O,g,t,E]),_=(0,u.useCallback)(e=>{t.value=I(e)},[t]),L=u.useRef(m);u.useEffect(()=>{L.current=m},[m]);let V=u.useCallback(e=>{var t;return(null==(t=L.current)?void 0:t.call(L,e))??e},[]),z=(0,u.useMemo)(()=>(0,k.di)(null==B?void 0:B.enum,V)||[],[B,V]),K=(0,u.useMemo)(()=>M(B,v,V,l.context.app),[B,v,V,l.context.app]),U=(0,u.useCallback)(()=>{let e=(0,A._)(l.context.app,f,w),t="$in"===f||"$notIn"===f;if(e&&t){let{Comp:t,props:l}=e,n={...l};(!(null==n?void 0:n.options)||(null==n?void 0:n.options.length)===0)&&(null==z?void 0:z.length)&&(n.options=z);let o={flex:"1 1 40%",minWidth:160,maxWidth:"100%",...(null==n?void 0:n.style)||{}},i=Array.isArray(q)&&q.every(e=>"string"==typeof e||"number"==typeof e)?q:"string"==typeof q?q.split(/\r?\n/).map(e=>e.trim()).filter(Boolean):[];return(0,r.jsx)("div",{style:o,children:(0,r.jsx)(t,{...n,style:{width:"100%",...(null==n?void 0:n.style)||{}},value:i,onChange:e=>_(e)})})}let n=K;return(0,r.jsx)("div",{style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},children:(0,r.jsx)(n,{value:q,onChange:e=>_(e)})})},[f,w,q,K,l.context.app,_,z]),W=(0,u.useMemo)(()=>function(){return(0,r.jsx)(d.A,{placeholder:`<${m("Null")}>`,readOnly:!0})},[m]),H=(0,u.useMemo)(()=>async()=>{let e="function"==typeof o?await o():o??p.getPropertyMetaTree(),t=Array.isArray(e)?e:await e();return[{title:m("Constant"),name:"constant",type:"string",paths:["constant"],render:K},{title:m("Null"),name:"null",type:"object",paths:["null"],render:W},...t]},[o,p,K,W,m]),G=(0,u.useMemo)(()=>({renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?K:"null"===l?W:null},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:void 0},resolvePathFromValue:e=>{if(null===e)return["null"];let t="string"==typeof e?(0,i.parseValueToPath)(e):void 0;return t||["constant"]}}),[W,K]),Y=(0,u.useMemo)(()=>async()=>{let e=await j(l.context),t=async e=>{let t=e.interface?b(e.interface):void 0,n=[],o=null==t?void 0:t.filterable,r=null==o?void 0:o.children;if(Array.isArray(r)&&r.length)for(let t of r){var i,a,s;let o=t.title||t.name,r=(null==(i=l.context)?void 0:i.t)?l.context.t(o):o;n.push({name:t.name,title:r,type:(null==(a=t.schema)?void 0:a.type)||"string",interface:(null==(s=t.schema)?void 0:s["x-component"])==="Select"?"select":"input",uiSchema:{...t.schema||{},"x-filter-operators":t.operators},paths:[...e.paths||[],t.name],parentTitles:[...e.parentTitles||[],e.title]})}if("function"==typeof e.children){let t=e.children;return{...e,children:async()=>{let e=await t(),l=[...Array.isArray(e)?e:[],...n];return C().uniqBy(l,"name")}}}let d=[...Array.isArray(e.children)?e.children:[],...n];return{...e,children:d.length?d:e.children}},n=[];for(let l of e)n.push(await t(l));return n},[b,l]);return(0,r.jsxs)(a.A,{wrap:!0,style:{width:"100%"},children:[(0,r.jsx)(i.VariableInput,{value:h,metaTree:Y,onChange:P,converters:T,showValueComponent:!1,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},onlyLeafSelectable:!0,placeholder:m("Select field"),ignoreFieldNames:c}),(0,r.jsx)(s.A,{style:{flex:"0 0 140px",minWidth:120,maxWidth:"100%"},placeholder:m("Comparison"),value:f||void 0,onChange:R,children:F.map(e=>(0,r.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),!(null==E?void 0:E.noValue)&&(n?(0,r.jsx)(i.VariableInput,{value:q,onChange:e=>_(e),metaTree:H,converters:G,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:m("Enter value")}):U())]})});var R=l(68827),E=l.n(R),N=l(97456);let{DateFilterDynamicComponent:D}=(0,x.RZ)(()=>Promise.resolve().then(l.bind(l,13595)),"DateFilterDynamicComponent");function B(e,t,l){var n,o,i;let a=null==e?void 0:e["x-component"],u=(null==t||null==(n=t.uiSchema)?void 0:n["x-component-props"])||{},c=(null==e?void 0:e["x-component-props"])||{},p=S()({},u,c),m=Array.isArray(null==t||null==(o=t.uiSchema)?void 0:o.enum)?null==t||null==(i=t.uiSchema)?void 0:i.enum:void 0,g=(0,k.di)(m,l),v={style:{width:200,...(null==p?void 0:p.style)||{}},placeholder:(null==p?void 0:p.placeholder)||l("Enter value"),...p};return e=>{let{value:t,onChange:n,...o}=e||{};if("InputNumber"===a)return(0,r.jsx)(h.A,{...v,...o,value:t,onChange:n});if("NumberPicker"===a)return(0,r.jsx)(F.NumberPicker,{...v,...o,value:t,onChange:n});if("Switch"===a)return(0,r.jsx)(f.A,{...v,...o,checked:!!t,onChange:n});if("Select"===a){let e=v;return Array.isArray(null==e?void 0:e.options)&&e.options.length>0?e={...e,options:(0,k.ZY)(e.options,l)}:g&&(e={...e,options:g}),(0,r.jsx)(s.A,{...e,...o,value:(0,k.xO)(t,e),onChange:n})}return"DateFilterDynamicComponent"===a?(0,r.jsx)(D,{...v,...o,value:t,onChange:n}):(0,r.jsx)(d.A,{...v,...o,value:t,onChange:e=>{var t;return null==n?void 0:n(null==e||null==(t=e.target)?void 0:t.value)}})}}let $=[{value:"$includes",label:"contains",selected:!0},{value:"$notIncludes",label:"does not contain"},{value:"$eq",label:"is"},{value:"$ne",label:"is not"},{value:"$empty",label:"is empty",noValue:!0},{value:"$notEmpty",label:"is not empty",noValue:!0}],O=new Set(["$in","$notIn"]);function q(e,t){let l=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(!n.length)return l;let o=n.find(e=>(null==e?void 0:e.name)==="item");if(!o)return[...n,...l];let r=(0,N.mD)(l,[o]);return[...n.filter(e=>(null==e?void 0:e.name)!=="item"),...r]}function _(e,t){var l,n;return{name:t.name,title:t.title||t.name,type:(null==(l=t.schema)?void 0:l.type)||"string",interface:(null==(n=t.schema)?void 0:n["x-component"])==="Select"?"select":"input",uiSchema:{...t.schema||{},"x-filter-operators":t.operators},paths:[...e.paths||[],t.name],parentTitles:[...e.parentTitles||[],e.title]}}async function L(e,t){var l,n;let o=e.interface&&t?t(e.interface):void 0,r=(Array.isArray(null==o||null==(l=o.filterable)?void 0:l.children)?null==o||null==(n=o.filterable)?void 0:n.children:[]).map(t=>_(e,t)),i=async e=>{let l=[...await Promise.all(e.map(e=>L(e,t))),...r];return E()(l,e=>e.name)};if("function"==typeof e.children){let t=e.children;return{...e,children:async()=>{let e=await t(),l=Array.isArray(e)?e:[];return await i(l)}}}return Array.isArray(e.children)?{...e,children:await i(e.children)}:r.length?{...e,children:r}:e}async function V(e,t){let l=Array.isArray(e)?e:[];return await Promise.all(l.map(e=>L(e,t)))}let z=(0,i.observer)(e=>{var t;let{value:l,model:n,extraMetaTree:o}=e,c=(0,i.useFlowViewContext)(),p=n.translate,{path:m,operator:h,value:f}=l||{},[g,v]=(0,u.useState)(null),y=(0,u.useRef)(!1),b=(0,u.useMemo)(()=>{if(g){var e,t,l;let o=g.interface?(0,x.w6)(g.interface,n.context.dataSourceManager,null==(e=n.context.app)?void 0:e.dataSourceManager):void 0,r=null==g||null==(t=g.uiSchema)?void 0:t["x-filter-operators"];return((Array.isArray(r)&&r.length?r:null==o||null==(l=o.filterable)?void 0:l.operators)||$).filter(e=>!e.visible||e.visible(g)).map(e=>({value:e.value,label:e.label,noValue:!!e.noValue,schema:e.schema,selected:!!e.selected}))}return[]},[g,n]),w=(0,u.useMemo)(()=>b.map(e=>({value:e.value,label:"string"==typeof e.label?p(e.label):e.label})),[b,p]);(0,u.useEffect)(()=>{if(0!==b.length){if(!h){if(y.current){let e=b.find(e=>e.selected)||b[0];l.operator=(null==e?void 0:e.value)||"",(null==e?void 0:e.noValue)?(l.value=!0,l.noValue=!0):l.noValue=!1,y.current=!1}return}if(!b.some(e=>e.value===h)){let e=b.find(e=>e.selected)||b[0];l.operator=(null==e?void 0:e.value)||"",(null==e?void 0:e.noValue)?(l.value=!0,l.noValue=!0):l.noValue=!1}}},[b,h,l]);let C=(0,u.useMemo)(()=>b.find(e=>e.value===h),[b,h]),F=(0,u.useMemo)(()=>{let e=(null==g?void 0:g.uiSchema)||{},t=(null==C?void 0:C.schema)||{};return S()({},e,t)},[g,C]),P=(0,u.useRef)(p);(0,u.useEffect)(()=>{P.current=p},[p]);let j=(0,u.useCallback)(e=>{var t;return(null==(t=P.current)?void 0:t.call(P,e))??e},[]),M=(0,u.useMemo)(()=>B(F,g,j),[F,g,j]),I=(0,u.useMemo)(()=>(0,k.di)(null==F?void 0:F.enum,j)||[],[F,j]),T=(0,u.useMemo)(()=>{let e=(0,A._)(n.context.app,h,b),t=O.has(h);if(!e||!t)return M;let{Comp:l,props:o}=e;return e=>{let{value:t,onChange:n,...i}=e||{},a={...o};(null==a?void 0:a.options)&&(null==a?void 0:a.options.length)!==0||!(I.length>0)||(a.options=I);let s=Array.isArray(t)?t:"string"==typeof t?t.split(/\r?\n/).map(e=>e.trim()).filter(Boolean):[];return(0,r.jsx)(l,{...a,...i,value:s,onChange:n,style:{width:200,...(null==a?void 0:a.style)||{},...(null==i?void 0:i.style)||{}}})}},[I,n.context.app,b,h,M]),R=(0,u.useMemo)(()=>function(){return(0,r.jsx)(d.A,{placeholder:`<${p("Null")}>`,readOnly:!0})},[p]),E=(0,u.useMemo)(()=>async()=>{let e=q((null==n?void 0:n.context.getPropertyMetaTree())||c.getPropertyMetaTree(),o);return[{title:p("Constant"),name:"constant",type:"string",paths:["constant"]},{title:p("Null"),name:"null",type:"object",paths:["null"]},...e]},[c,n,p,o]),N=(0,u.useCallback)(async()=>{var e,t;let l=(null==n||null==(t=n.context)||null==(e=t.getPropertyMetaTree)?void 0:e.call(t))||c.getPropertyMetaTree(),r=q(Array.isArray(l)?l:[],o),i=e=>{var t;return(0,x.w6)(e,n.context.dataSourceManager,null==(t=n.context.app)?void 0:t.dataSourceManager)};return await V(r,i)},[c,n,o]),D=(0,u.useMemo)(()=>({renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?T:"null"===l?R:null},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:void 0},resolvePathFromValue:e=>{if(null===e)return["null"];let t=(0,i.parseValueToPath)(e);return t||["constant"]}}),[R,T]),_=(0,u.useCallback)((e,t)=>{let n=l.path||"",o=e||"",r=o!==n;l.path=o,r&&n&&(l.operator="",l.value="",y.current=!0),n||!o||l.operator||(y.current=!0),t&&v(t)},[l]),L=(0,u.useCallback)(e=>{let t=l.operator;l.operator=e;let n=b.find(t=>t.value===e);(null==n?void 0:n.noValue)?(l.value=!0,l.noValue=!0):(O.has(t)&&!O.has(e)&&Array.isArray(l.value)&&(l.value=l.value.join("\n")),l.noValue=!1)},[l,b]);return(0,r.jsxs)(a.A,{wrap:!0,style:{width:"100%"},children:[(0,r.jsx)(i.VariableInput,{value:m,onChange:_,metaTree:N,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:p("Select variable"),onlyLeafSelectable:!0}),(0,r.jsx)(s.A,{style:{flex:"0 0 140px",minWidth:120,maxWidth:"100%"},placeholder:p("Comparison"),value:h||void 0,onChange:L,children:w.map(e=>(0,r.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),!(null==(t=b.find(e=>e.value===h))?void 0:t.noValue)&&(0,r.jsx)(i.VariableInput,{value:f,onChange:e=>l.value=e,metaTree:E,converters:D,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:p("Enter value"),clearValue:""})]})});var K=l(17669)},17669(e,t,l){"use strict";l.d(t,{u:()=>i});var n=l(96540),o=l(44e3);let r=e=>e;function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{filterableFieldNames:l,nonfilterableFieldNames:i,noIgnore:a=!1,t:s=r}=t,d=(0,n.useMemo)(()=>(null==e?void 0:e.getFields())||[],[e]),u=(0,n.useMemo)(()=>{let e=!a&&(null==l?void 0:l.length)?d.map(e=>e.name).filter(e=>!l.includes(e)):[],t=i??[];return t.length?Array.from(new Set([...e,...t])):e},[d,l,i,a]);return(0,n.useMemo)(()=>(0,o.H)(d.filter(e=>"attachments"!==e.target&&"formula"!==e.interface),1,u,s).filter(Boolean),[d,u,s])}},39580(e,t,l){"use strict";l.d(t,{b2:()=>o.b,tn:()=>n.t,S5:()=>o.S});var n=l(27941);l(74848),l(98668),l(43627),l(11869),l(96540),l(74979),l(21335);var o=l(36869);l(95266),l(47785)},51612(e,t,l){"use strict";l.d(t,{g:()=>f});var n=l(74848),o=l(96540),r=l(40098);let i=l.n(r)().memoize(async e=>e?(await Promise.all([l.e("957"),l.e("2174"),l.e("3338"),l.e("1339"),l.e("32")]).then(l.bind(l,86419))).default.render(e):e);function a(e){let[t,l]=(0,o.useState)(""),[n,r]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{r(!0),i(e).then(e=>{l(e),r(!1)}).catch(e=>console.log(e))},[e]),{html:t,loading:n}}function s(e){let t=e,l=document.createElement("div");l.innerHTML=t;let n=l.innerText;return l=null,(null==n?void 0:n.replace(/[\n\r]/g,""))||""}var d=l(24978),u=l(22803),c=l(11869),p=l(35710);let m=()=>{let e=(0,c.useFlowContext)(),{token:t}=p.A.useToken(),l=!!e.isDarkTheme,n=new d.q(t.colorFillAlter).onBackground(t.colorBgContainer).toHexShortString(),o={lineHeight:"inherit","&.nb-markdown-default":{"pre code.hljs":{display:"block",overflowX:"auto",padding:"1em"},"code.hljs":{padding:"3px 5px"},":not(pre) code":{padding:"2px 5px",color:"#d56161",background:t.colorFillQuaternary,border:`1px solid ${t.colorBorder}`,borderRadius:t.borderRadiusSM},blockquote:{borderLeft:"4px solid #ccc",paddingLeft:"20px",marginLeft:"0",color:"#666",fontStyle:"italic"},img:{maxWidth:"100%"},".hljs":{background:"#f8f8f8",color:"#444"},".hljs-comment":{color:"#697070"},".hljs-punctuation,.hljs-tag":{color:"#444a"},".hljs-tag .hljs-attr,.hljs-tag .hljs-name":{color:"#444"},".hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag":{fontWeight:700},".hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type":{color:"#800"},".hljs-section,.hljs-title":{color:"#800",fontWeight:700},".hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable":{color:"#ab5656"},".hljs-literal":{color:"#695"},".hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code":{color:"#397300"},".hljs-meta":{color:"#1f7199"},".hljs-meta .hljs-string":{color:"#38a"},".hljs-emphasis":{fontStyle:"italic"},".hljs-strong":{fontWeight:700}},"&.nb-markdown-table":{table:{borderCollapse:"collapse",width:"100%",fontFamily:"Arial, sans-serif",marginBottom:"1.5rem"},"th, td":{borderBottom:`1px solid ${t.colorBorderSecondary}`,padding:`${t.paddingContentVertical}px ${t.paddingContentHorizontal}px`,textAlign:"left"},th:{backgroundColor:n,fontWeight:"bold",color:t.colorText},"tr:hover":{backgroundColor:t.colorFillTertiary},"tr:last-child td":{borderBottom:"none"},"tr:first-child th":{borderTop:"none"}}},r={"&.nb-markdown-default":{"pre code.hljs":{display:"block",overflowX:"auto",padding:"1em"},"code.hljs":{padding:"3px 5px"},":not(pre) code":{padding:"2px 5px",color:"#d56161",background:t.colorFillQuaternary,border:`1px solid ${t.colorBorder}`,borderRadius:t.borderRadiusSM},".hljs":{color:"#adbac7",background:"#22272e"},".hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_":{color:"#f47067"},".hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_":{color:"#dcbdfb"},".hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable":{color:"#6cb6ff"},".hljs-meta .hljs-string,.hljs-regexp,.hljs-string":{color:"#96d0ff"},".hljs-built_in,.hljs-symbol":{color:"#f69d50"},".hljs-code,.hljs-comment,.hljs-formula":{color:"#768390"},".hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag":{color:"#8ddb8c"},".hljs-subst":{color:"#adbac7"},".hljs-section":{color:"#316dca",fontWeight:700},".hljs-bullet":{color:"#eac55f"},".hljs-emphasis":{color:"#adbac7",fontStyle:"italic"},".hljs-strong":{color:"#adbac7",fontWeight:700},".hljs-addition":{color:"#b4f1b4",backgroundColor:"#1b4721"},".hljs-deletion":{color:"#ffd8d3",backgroundColor:"#78191b"}},"&.nb-markdown-table":{table:{borderCollapse:"collapse",width:"100%",fontFamily:"Arial, sans-serif",marginBottom:"1.5rem"},"th, td":{borderBottom:`1px solid ${t.colorBorderSecondary}`,padding:`${t.paddingContentVertical}px ${t.paddingContentHorizontal}px`,textAlign:"left"},th:{backgroundColor:n,fontWeight:"bold",color:t.colorText},"tr:hover":{backgroundColor:t.colorFillTertiary},"tr:last-child td":{borderBottom:"none"},"tr:first-child th":{borderTop:"none"}}};return(0,u.css)({lineHeight:t.lineHeight,"& > *:last-child":{marginBottom:"0"},".ant-description-textarea, .ant-description-input":{lineHeight:t.lineHeight},".field-interface-datetime":{minWidth:"100px"},img:{maxWidth:"100%"},...l?r:o})};var h=l(42443);let f=e=>{let{textOnly:t,overflowMode:l,style:r}=e,i=m(),{html:d=""}=a(e.value),u=s(d),c="ellipsis"===l,p=(0,o.useRef)(null),[f,g]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(p.current){let e=p.current;g(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)}},[d,r,l]);let v={...r||{},...c?{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",wordBreak:"break-word",cursor:"default"}:{}},y=(0,n.jsx)("div",{ref:p,className:`${i} nb-markdown`,dangerouslySetInnerHTML:{__html:t?u:d},style:v});return c&&f?(0,n.jsx)(h.A,{title:(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:d},style:{maxHeight:500,overflowY:"auto",padding:10,color:"#000"}}),overlayInnerStyle:{background:"#fff",color:"#000",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},color:"#fff",children:y}):y}},85352(e,t,l){"use strict";function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.map(e=>{if(e&&"object"==typeof e&&!Array.isArray(e)){let t=e,l=void 0!==t.label,n=void 0!==t.value,o=l?t.label:String(t.value??""),r=n?t.value:o,i={label:o,value:r};return t.color&&(i.color=t.color),t.icon&&(i.icon=t.icon),i}return{label:String(e),value:e}}):[]}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return Array.isArray(e)?e.map(e=>"string"==typeof(null==e?void 0:e.label)?{...e,label:t(e.label)}:e):[]}function r(e,t){if(e&&Array.isArray(e)&&0!==e.length)return o(n(e),t)}function i(e,t){let l=null==t?void 0:t.mode,n="multiple"===l||"tags"===l||(null==t?void 0:t.multiple)===!0;return Array.isArray(e)?e.filter(e=>""!==e&&null!=e):""===e||null==e?n?[]:void 0:e}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(Array.isArray(e)?e:null==e?[]:[e]).map(e=>{var l;let n=t.find(t=>(null==t?void 0:t.value)===e);return n?{value:e,label:n.label}:{value:e,label:(null==e||null==(l=e.toString)?void 0:l.call(e))??e}})}function s(e,t){var l,o,r,i;if(!["radioGroup","checkboxGroup","select","multipleSelect"].includes(null==t?void 0:t.interface)||Array.isArray(null==(l=e.props)?void 0:l.options)&&(null==(r=e.props)||null==(o=r.options)?void 0:o.length)>0)return!1;let a=null==(i=t.uiSchema)?void 0:i.enum;if(!Array.isArray(a)||0===a.length)return!1;let s=n(a);return!!s.length&&(e.setProps({options:s}),!0)}l.d(t,{NI:()=>s,ZY:()=>o,di:()=>r,xO:()=>i,yg:()=>a})},13940(e,t,l){"use strict";l.d(t,{E4:()=>r,Gj:()=>d,a_:()=>n,eo:()=>p,pX:()=>s,w7:()=>i});let n="__custom__";function o(e){return`${n}:${e}`}function r(e){var t;if(!e||"object"!=typeof e)return!1;let l=e;if(!(null==(t=l.isAssociationField)?void 0:t.call(l)))return!1;let n=l.type,o=l.interface;return"belongsToMany"===n||"hasMany"===n||"belongsToArray"===n||"m2m"===o||"o2m"===o||"mbm"===o}function i(e){var t;if(!e||"object"!=typeof e)return;let l=e;return l.collection||(null==(t=l.context)?void 0:t.collection)||void 0}function a(e){return"string"==typeof e?e.trim():""}function s(e){if(!e||"object"!=typeof e)return[];let t=e,l="function"==typeof t.getStepParams?t.getStepParams("fieldSettings","init"):void 0,n=l&&"object"==typeof l?l:void 0,r="function"==typeof t.getStepParams?t.getStepParams("formItemSettings","fieldSettings"):void 0,i=r&&"object"==typeof r?r:void 0,s=(null==n?void 0:n.fieldPath)??t.fieldPath,d=(null==n?void 0:n.associationPathName)??t.associationPathName,u=null==i?void 0:i.name,c=a(s),p=a(d),m=a(u),h=new Set;return c&&h.add(c),p&&(c?c.startsWith(`${p}.`)?h.add(c):h.add(`${p}.${c}`):h.add(p)),m&&h.add(o(m)),Array.from(h)}function d(e){return s(e)[0]}function u(e){if(!e||"object"!=typeof e)return[];let t=e.subModels;if(!t||"object"!=typeof t)return[];let l=t.items;if(Array.isArray(l))return l;let n=t.grid;if(!n||"object"!=typeof n)return[];let o=n.subModels;if(!o||"object"!=typeof o)return[];let r=o.items;return Array.isArray(r)?r:[]}function c(e){if(!e||"object"!=typeof e)return[];let t=e.subModels;return t&&"object"==typeof t?u(t.field):[]}function p(e,t){let l=a(t);if(!l)return null;let n=e=>{if(!Array.isArray(e))return null;for(let t of e){if(s(t).some(e=>e===l))return t;let e=n(c(t));if(e)return e}return null};return n(u(e))}},53869(e,t,l){"use strict";l.d(t,{_:()=>o});var n=l(13595);function o(e,t,l){let o;if(!l||!Array.isArray(l))return null;let r=l.find(e=>(null==e?void 0:e.value)===t),i=null==r?void 0:r.schema,a=null==i?void 0:i["x-component"];if(!a)return null;if("DateFilterDynamicComponent"===a)o=n.DateFilterDynamicComponent;else{var s;o=null==e||null==(s=e.getComponent)?void 0:s.call(e,a)}return o?{Comp:o,props:(null==i?void 0:i["x-component-props"])||{}}:null}},25359(e,t,l){"use strict";l.d(t,{ON:()=>r,jI:()=>o});let n="__saveStepParamsWithSubModels";function o(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error("[saveStepParamsWithSubModels] model is not an object");e[n]=!0}async function r(e,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error("[saveStepParamsWithSubModels] model is not an object");let l=e;if(!0!==l[n])return await t();if("function"!=typeof l.save)throw Error("[saveStepParamsWithSubModels] model.save is not a function");try{return await l.save()}finally{delete l[n]}}},14252(e,t,l){"use strict";l.d(t,{S0:()=>i.S0,_T:()=>i._T,s5:()=>i.s5});var n=l(11869),o=l(2077);l(96540);var r=l(2117),i=l(52717);i.S0.registerFlow({key:"buttonSettings",title:(0,n.tExpr)("Button settings"),sort:-999,steps:{general:{title:(0,n.tExpr)("Edit button"),uiSchema:e=>({title:e.model.enableEditTitle?{"x-decorator":"FormItem","x-component":"Input",title:(0,n.tExpr)("Button title")}:void 0,tooltip:e.model.enableEditTooltip?{"x-decorator":"FormItem","x-component":"Input",title:(0,n.tExpr)("Button tooltip")}:void 0,icon:e.model.enableEditIcon?{"x-decorator":"FormItem","x-component":"IconPicker",title:(0,n.tExpr)("Button icon")}:void 0,iconOnly:e.model.enableEditIcon?{"x-decorator":"FormItem","x-component":"Switch",title:(0,n.tExpr)("Icon only")}:void 0,type:e.model.enableEditType?{"x-decorator":"FormItem","x-component":"Radio.Group",title:(0,n.tExpr)("Button type"),enum:e.model.buttonTypeOptions}:void 0,danger:e.model.enableEditDanger?{"x-decorator":"FormItem","x-component":"Switch",title:(0,n.tExpr)("Danger action")}:void 0,color:e.model.enableEditColor?{"x-decorator":"FormItem","x-component":o.sk,title:(0,n.tExpr)("Color")}:void 0}),defaultParams(e){var t,l;let n=e.model.defaultProps||{};return e.model.enableEditColor?{...n,color:(null==(t=e.model.props)?void 0:t.color)??n.color??(null==(l=e.themeToken)?void 0:l.colorPrimary)}:n},handler(e,t){let{title:l,tooltip:n,...o}=t;e.model.setProps({title:e.t(l,{ns:"lm-flow-engine"}),tooltip:e.t(n,{ns:"lm-flow-engine"}),...o})}},linkageRules:{use:"actionLinkageRules"}}}),i.S0.registerFlow({key:"buttonAclSettings",steps:{aclCheck:{use:"aclCheck"}}}),i.S0.registerFlow({key:"paginationChange",on:"paginationChange",steps:{aclCheckRefresh:{use:"aclCheckRefresh"},linkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"actionLinkageRules",flowKey:"buttonSettings",stepKey:"linkageRules"}}}}),i.S0.registerEvents({click:{title:(0,n.tExpr)("Click"),name:"click",uiSchema:{condition:{type:"object",title:(0,n.tExpr)("Trigger condition"),"x-decorator":"FormItem","x-component":r.H}},handler:r.b}})},52717(e,t,l){"use strict";l.d(t,{S0:()=>h,_T:()=>p,s5:()=>m});var n=l(74848),o=l(11869),r=l(51103),i=l(42443),a=l(71021),s=l(40098),d=l.n(s),u=l(96540),c=l(18492);function p(e){let{t}=(0,c.B)(),l=(0,o.useFlowModel)(),r=l.context.blockModel,a=e.collection||r.collection,s=a.dataSource,p=(0,u.useMemo)(()=>{let e=`${t(s.displayName||s.key)} > `,l=a?`${t(a.title)||a.name||a.tableName} `:"";return`${e}${l}`},[]),{actionName:m}=(null==e?void 0:e.forbidden)||l.forbidden,h=(0,u.useMemo)(()=>t('The current user only has the UI configuration permission, but don\'t have "{{actionName}}" permission for collection "{{name}}"',{name:p,actionName:t(d().capitalize(m))}).replaceAll(">",">"),[m,p,t]);return(0,n.jsx)(i.A,{title:e.message||h,children:e.children})}let m={collection:"collection",record:"record",all:["collection","record"],both:["collection","record"]};class h extends o.FlowModel{static _getScene(){return d().castArray(this.scene||[])}static _isScene(e){return this._getScene().includes(e)}getAclActionName(){return null}onInit(e){super.onInit(e),this.context.defineProperty("actionName",{get:()=>this.getAclActionName(),cache:!1})}getInputArgs(){let e={},t=[];if(this.context.resource){let l=this.context.resource.getSourceId();l&&(e.sourceId=l,t.push("sourceId"))}if(this.context.collection&&this.context.record){let l=this.context.collection.getFilterByTK(this.context.record);l&&(e.filterByTk=l,t.push("filterByTk"))}return t.length&&(e.defaultInputKeys=t),e}onClick(e){this.dispatchEvent("click",{event:e,...this.getInputArgs()},{debounce:!0})}getTitle(){return this.props.title}getIcon(){return this.props.icon}renderButton(){let{iconOnly:e,...t}=this.props,l=this.getIcon()?(0,n.jsx)(r.In,{type:this.getIcon()}):void 0;return(0,n.jsx)(a.Ay,{...t,onClick:this.onClick.bind(this),icon:l,children:e?null:t.children||this.getTitle()})}render(){return this.props.tooltip?(0,n.jsx)(i.A,{title:this.props.tooltip,children:this.renderButton()}):this.renderButton()}renderHiddenInConfig(){let{iconOnly:e,...t}=this.props,l=this.getIcon()?(0,n.jsx)(r.In,{type:this.getIcon()}):void 0;return this.forbidden?(0,n.jsx)(p,{children:(0,n.jsx)(a.Ay,{...t,onClick:this.onClick.bind(this),icon:l,style:{opacity:"0.3"},children:e?null:t.children||this.getTitle()})}):(0,n.jsx)(i.A,{title:this.context.t("The button is hidden and only visible when the UI Editor is active"),children:(0,n.jsx)(a.Ay,{...t,onClick:this.onClick.bind(this),icon:l,style:{opacity:"0.3"},children:e?null:t.children||this.getTitle()})})}constructor(...e){super(...e),this.defaultProps={type:"default",title:(0,o.tExpr)("Action"),iconOnly:!1},this.enableEditTooltip=!0,this.enableEditTitle=!0,this.enableEditIcon=!0,this.enableEditType=!0,this.enableEditDanger=!0,this.enableEditColor=!1,this.buttonTypeOptions=[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Primary")}}'},{value:"dashed",label:'{{t("Dashed")}}'},{value:"link",label:'{{t("Link")}}'},{value:"text",label:'{{t("Text")}}'}]}}},15892(e,t,l){"use strict";l.d(t,{P:()=>v,z:()=>y});var n=l(74848),o=l(95243),r=l(11869),i=l(40098),a=l.n(i),s=l(96540),d=l(42443),u=l(39580),c=l(2117),p=l(92275),m=l(18492),h=l(27941);let f=()=>{let{t:e}=(0,m.B)(),t=(0,r.useFlowModel)(),l=t.context.blockModel.collection,o=l.dataSource,i=(0,s.useMemo)(()=>{let t=`${e(o.displayName||o.key)} > `,n=l?`${e(l.title)||l.name||l.tableName} `:"";return`${t}${n}`},[]),{actionName:d}=t.forbidden,u=(0,s.useMemo)(()=>e('The current user only has the UI configuration permission, but don\'t have "{{actionName}}" permission for collection "{{name}}"',{name:i,actionName:e(a().capitalize(d))}).replaceAll(">",">"),[d,i,e]);return(0,n.jsx)(h.t,{children:(0,n.jsx)(p.Ay,{status:"403",subTitle:u})})};function g(){let{t:e}=(0,m.B)(),t=(0,r.useFlowModel)(),l=t.dataSource,o=(0,s.useMemo)(()=>{let n=`${e(l.displayName||l.key)} > `,o=t.resource.resourceName;return`${n}${o}`},[]),i=(0,s.useMemo)(()=>e('The {{type}} "{{name}}" may have been deleted. Please remove this {{blockType}}.',{type:e("Collection"),name:o,blockType:e("Block")}).replaceAll(">",">"),[o,e]);return(0,n.jsx)(h.t,{children:(0,n.jsx)(p.Ay,{status:"404",subTitle:i})})}let v={new:"new",one:"one",many:"many",select:"select",filter:"filter",oam:["one","many"],subForm:"subForm",bulkEditForm:"bulkEditForm"};class y extends r.FlowModel{setFilterActive(e,t){this.activeFilterSources.set(e,t)}hasActiveFilters(){let e=this.resource;if(e&&e.filter&&Object.keys(e.filter).length>0)return!0;for(let[,e]of this.activeFilterSources)if(e)return!0;return!1}removeFilterSource(e){this.activeFilterSources.delete(e)}getDataLoadingMode(){var e;let t=this.getStepParams("dataLoadingModeSettings");return(null==t||null==(e=t.dataLoadingMode)?void 0:e.mode)||"auto"}static _getScene(){return a().castArray(this.scene||[])}static _isScene(e){return this._getScene().includes(e)}getModelClassName(e){return Object.keys(this.customModelClasses).includes(e)?this.customModelClasses[e]:this._defaultCustomModelClasses[e]||e}renderHiddenInConfig(){return this.forbidden?(0,n.jsx)(f,{}):(0,n.jsx)(d.A,{title:this.context.t("The block is hidden and only visible when the UI Editor is active"),children:(0,n.jsx)(u.tn,{ref:this.context.ref,...this.decoratorProps,style:{opacity:"0.3"},children:(0,n.jsx)(this.ObservedRenderComponent,{})})})}onInit(e){super.onInit(e),this.context.defineProperty("blockModel",{value:this}),this.context.defineMethod("getModelClassName",e=>this.getModelClassName(e)),this.ObservedRenderComponent=(0,r.observer)(()=>this.renderComponent(),{displayName:"ObservedRenderComponent"})}setDecoratorProps(e){Object.assign(this.decoratorProps,e)}get title(){return this._title||(this._title=this.defaultBlockTitle()),this._title}defaultBlockTitle(){var e;return`${this.translate((null==(e=this.constructor.meta)?void 0:e.label)||this.constructor.name)}`}renderComponent(){throw Error("renderComponent method must be implemented in subclasses of BlockModel")}render(){return this.collectionRequired&&!this.context.collection?(0,n.jsx)(g,{}):(0,n.jsx)(u.tn,{ref:this.context.ref,...this.decoratorProps,children:(0,n.jsx)(this.ObservedRenderComponent,{})})}constructor(...e){super(...e),this.decoratorProps=(0,o.observable)({}),this._defaultCustomModelClasses={},this.customModelClasses={},this.collectionRequired=!1,this.ObservedRenderComponent=null,this.activeFilterSources=new Map}}y.registerFlow({key:"cardSettings",title:(0,r.tExpr)("Card settings"),steps:{titleDescription:{title:(0,r.tExpr)("Title & description"),uiSchema:{title:{"x-component":"Input","x-decorator":"FormItem",title:(0,r.tExpr)("Title")},description:{"x-component":"Input.TextArea","x-decorator":"FormItem",title:(0,r.tExpr)("Description")}},handler(e,t){let l=e.t(t.title,{ns:"lm-flow-engine"}),n=e.t(t.description,{ns:"lm-flow-engine"});e.model.setDecoratorProps({title:l,description:n})}},linkageRules:{use:"blockLinkageRules"},blockHeight:{use:"blockHeight"}}}),y.define({hide:!0,label:(0,r.tExpr)("Other blocks")}),r.FlowModel.registerEvents({beforeRender:{title:(0,r.tExpr)("Before render"),name:"beforeRender",uiSchema:{condition:{type:"object",title:(0,r.tExpr)("Trigger condition"),"x-decorator":"FormItem","x-component":c.H}},handler:c.b}})},72380(e,t,l){"use strict";l.d(t,{U:()=>r});var n=l(11869),o=l(14252);class r extends o.S0{}r.define({children:async e=>(await (0,n.buildSubModelItems)(o.S0)(e)).filter(t=>e.engine.getModelClass(t.useModel)._isScene(o.s5.collection))})},52175(e,t,l){"use strict";l.d(t,{t:()=>d});var n=l(11869),o=l(40098),r=l.n(o),i=l(42632),a=l(94130),s=l(5679);class d extends s.R{onMount(){super.onMount(),this.previousBeforeRenderHash=this.context.location.search}getDirtyTrackingVersion(e,t,l,n){var o;let r=new Set,i=(null==l||null==(o=l.getResourceName)?void 0:o.call(l))||n.associationName||n.collectionName;i&&r.add(String(i)),n.associationName&&r.add(String(n.associationName)),n.collectionName&&r.add(String(n.collectionName));let a=0;for(let l of r)a+=e.getDataSourceDirtyVersion(t,l);return a}onActive(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.hidden&&this.previousBeforeRenderHash!==this.context.location.search&&(this.rerender(),!e)||this.hidden)return;let t=this.context.resource;if(!t)return;let l=this.getResourceSettingsInitParams(),n=t.getDataSourceKey()||l.dataSourceKey||"main",o=this.context.engine,r=this.getDirtyTrackingVersion(o,n,t,l);if(e){if(this.dirtyRefreshing)return;this.dirtyRefreshing=!0,t.refresh().then(()=>{this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(o,n,t,l)}).catch(()=>{}).finally(()=>{this.dirtyRefreshing=!1});return}this.isManualRefresh||null!==this.lastSeenDirtyVersion&&r===this.lastSeenDirtyVersion||this.dirtyRefreshing||(this.dirtyRefreshing=!0,t.refresh().then(()=>{this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(o,n,t,l)}).catch(()=>{}).finally(()=>{this.dirtyRefreshing=!1}))}static filterCollection(e){return!!e.filterTargetKey}static isCollectionAvailable(e){if(!e)return!1;let t=(0,a.b1)(this);return(0,a.F3)(e,t)}static async defineChildren(e){let t=t=>{var l;if(!(null==(l=this.meta)?void 0:l.createModelOptions))return t||{};if("function"==typeof this.meta.createModelOptions){let l=this.meta.createModelOptions(e);return r().merge({},l,t)}return r().merge({},this.meta.createModelOptions,t)},l=e=>this.name+e,{dataSourceKey:o,collectionName:i,associationName:a,filterByTk:s}=e.view.inputArgs,d=e.dataSourceManager.getDataSources().map(e=>0===e.getCollections().length?null:{key:l(`ds-${e.key}`),label:e.displayName,searchable:!0,searchPlaceholder:(0,n.tExpr)("Search"),children:n=>e.getCollections().map(n=>{if(!this.filterCollection(n)||!this.isCollectionAvailable(n))return null;let o={dataSourceKey:n.dataSourceKey,collectionName:n.name};return{key:l(`ds-${e.key}.${n.name}`),label:n.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:o}}})}}).filter(Boolean)}).filter(Boolean),u=e=>1===d.length?d[0].children(e):d;if(!i)return u(e);if(this._isScene("select")){let n={dataSourceKey:o,collectionName:i};a&&(n.associationName=a,n.sourceId="{{ctx.view.inputArgs.sourceId}}");let r=e.dataSourceManager.getCollection(o,i),s=[];return this.isCollectionAvailable(r)&&s.push({key:l("current-collection"),label:"Current collection",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:n}}})}),s.push({key:l("others-collections"),label:"Other collections",children:u(e)}),s}if(this._isScene("new")){let n={dataSourceKey:o,collectionName:i};a&&(n.associationName=a,n.sourceId="{{ctx.view.inputArgs.sourceId}}");let r=[],d=e.dataSourceManager.getCollection(o,i);return this.isCollectionAvailable(d)&&r.push({key:l("current-collection"),label:"Current collection",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:n}}})}),null!=s&&r.push({key:l("associated"),label:"Associated records",children:()=>e.dataSourceManager.getCollection(o,i).getAssociationFields(this._getScene()).map(e=>{if(!e.targetCollection||"belongsToArray"===e.type||!this.filterCollection(e.targetCollection)||!this.isCollectionAvailable(e.targetCollection))return null;let n=`{{ctx.popup.record.${e.sourceKey||e.collection.filterTargetKey}}}`;e.sourceKey===e.collection.filterTargetKey&&(n="{{ctx.view.inputArgs.filterByTk}}");let r={dataSourceKey:o,collectionName:e.target,associationName:e.resourceName,sourceId:n};return{key:l(`associated-${e.name}`),label:e.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}}).filter(Boolean)}),r.push({key:l("others-collections"),label:"Other collections",children:u(e)}),r}let c=[{key:l("associated"),label:"Associated records",children:()=>e.dataSourceManager.getCollection(o,i).getAssociationFields(this._getScene()).map(e=>{if(!e.targetCollection||"belongsToArray"===e.type||!this.filterCollection(e.targetCollection)||!this.isCollectionAvailable(e.targetCollection))return null;let n=`{{ctx.popup.record.${e.sourceKey||e.collection.filterTargetKey}}}`;e.sourceKey===e.collection.filterTargetKey&&(n="{{ctx.view.inputArgs.filterByTk}}");let r={dataSourceKey:o,collectionName:e.target,associationName:e.resourceName,sourceId:n};return{key:l(`associated-${e.name}`),label:e.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}}).filter(Boolean)},{key:l("others-records"),label:"Other records",children:u(e)}];if(this._isScene("one")){let n=e.dataSourceManager.getCollection(o,i);if(!n||!this.filterCollection(n)||!this.isCollectionAvailable(n))return c;let r={dataSourceKey:o,collectionName:i,filterByTk:"{{ctx.view.inputArgs.filterByTk}}"};a&&(r.associationName=a,r.sourceId="{{ctx.view.inputArgs.sourceId}}"),c.unshift({key:l("current-record"),label:"Current record",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})})}return c}get dataSource(){return this.context.dataSource}get collection(){return this.context.collection}get resource(){return this.context.resource}get association(){return this.context.association}get associationField(){return this.context.association}getAclActionName(){return"view"}async getFilterFields(){return this.collection.getFields().filter(e=>e.filterable)}getResourceSettingsInitParams(){return this.getStepParams("resourceSettings","init")}onInit(e){super.onInit(e),this.context.defineProperty("blockModel",{value:this}),this.context.defineProperty("actionName",{get:()=>this.getAclActionName(),cache:!1}),this.context.defineProperty("resourceName",{get:()=>this.resource.getResourceName(),cache:!1}),this.context.defineProperty("dataSource",{get:()=>{let e=this.getResourceSettingsInitParams();return this.context.dataSourceManager.getDataSource(e.dataSourceKey)}}),this.context.defineProperty("collection",{get:()=>{let e=this.getResourceSettingsInitParams();return this.context.dataSourceManager.getCollection(e.dataSourceKey,e.collectionName)}}),this.context.defineProperty("resource",{get:()=>{let e=this.getResourceSettingsInitParams(),t=this.createResource(this.context,e);t.setDataSourceKey(e.dataSourceKey),t.setResourceName(e.associationName||e.collectionName);let l=()=>{var l;let n=this.context.engine;if(!(null==n?void 0:n.getDataSourceDirtyVersion))return;let o=(null==(l=t.getDataSourceKey)?void 0:l.call(t))||e.dataSourceKey||"main";this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(n,o,t,e)};return l(),t.on("refresh",()=>{l(),this.invalidateFlowCache("beforeRender")}),t}}),this.context.defineProperty("association",{get:()=>{let e=this.getResourceSettingsInitParams();if(e.associationName)return this.dataSource.getAssociation(e.associationName)}})}createResource(e,t){throw Error("createResource method must be implemented in subclasses of CollectionBlockModel")}refresh(){return this.resource?this.resource.refresh():super.refresh()}defaultBlockTitle(){var e,t,l,n,o,r,a;let s=this.translate((null==(e=this.constructor.meta)?void 0:e.label)||this.constructor.name),d=(null==(t=this.dataSource)?void 0:t.displayName)||(null==(l=this.dataSource)?void 0:l.key),u=(null==(r=this.context)||null==(o=r.dataSourceManager)||null==(n=o.getDataSources)?void 0:n.call(o).length)||0,c=null==(a=this.collection)?void 0:a.title;if(this.association){let e=this.resource.getResourceName(),t=this.dataSource.getCollection(e.split(".")[0]);return(0,i.l)({blockLabel:s,dsName:d,dsCount:u,collectionTitle:c,sourceCollectionTitle:t.title,associationTitle:this.association.title})}return(0,i.l)({blockLabel:s,dsName:d,dsCount:u,collectionTitle:c})}addAppends(e){var t,l;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)if(e.includes(".")){let[l,o]=e.split("."),r=this.context.dataSourceManager.getCollectionField(`${this.collection.dataSourceKey}.${this.collection.name}.${l}`);if(!r)return;let i=r.target;if(!i)return;let a=this.context.dataSourceManager.getCollectionField(`${this.collection.dataSourceKey}.${i}.${o}`);if(a&&a.isAssociationField()){if(this.resource.addAppends(e),(null==(t=a.targetCollection)?void 0:t.template)==="tree"){let t=e.includes(".")?e.slice(e.lastIndexOf(".")+1):e;a.name===t&&this.resource.addAppends(`${e}.parent(recursively=true)`)}n&&this.resource.refresh()}}else{if(!this.collection)return;let t=this.context.dataSourceManager.getCollectionField(`${this.collection.dataSourceKey}.${this.collection.name}.${e}`);if(!t)return;t.isAssociationField()&&(this.resource.addAppends(t.name),(null==(l=t.targetCollection)?void 0:l.template)==="tree"&&this.resource.addAppends(`${t.name}.parent(recursively=true)`),n&&this.resource.refresh())}}constructor(...e){super(...e),this.isManualRefresh=!1,this.collectionRequired=!0,this.lastSeenDirtyVersion=null,this.dirtyRefreshing=!1}}d.registerFlow({key:"resourceSettings",sort:-999,steps:{collectionCheck:{handler(e){e.collection||e.exitAll()}},aclCheck:{use:"aclCheck"},init:{handler(e,t){if(!t.dataSourceKey)throw Error("dataSourceKey is required");if(!t.collectionName)throw Error("collectionName is required");Object.keys(t).includes("sourceId")&&e.resource.setSourceId(t.sourceId),Object.keys(t).includes("filterByTk")&&e.resource.setFilterByTk(t.filterByTk)}}}}),d.registerFlow({key:"refreshSettings",sort:1e4,steps:{refresh:{async handler(e){let t=e.model,l=e.model.context.filterManager,o=(null==l?void 0:l.prepareFiltersForTarget)?await l.prepareFiltersForTarget(e.model.uid):void 0;l&&l.bindToTarget(e.model.uid);let r=t.getDataLoadingMode(),i=t.resource;if(i instanceof n.MultiRecordResource&&"manual"===r&&!t.hasActiveFilters()){i.setData([]),i.setMeta({count:0,hasNext:!1,page:1}),i.loading=!1;return}null==o||o.forEach(t=>{var l;null==t||null==(l=t.markInitialTargetRefreshHandled)||l.call(t,e.model.uid)}),e.model.isManualRefresh?e.model.resource.loading=!1:await e.model.resource.refresh()}}}}),d.registerFlow({key:"dataLoadingModeSettings",sort:800,title:(0,n.tExpr)("Set data loading mode"),steps:{dataLoadingMode:{use:"dataLoadingMode"}}}),d.define({hide:!0})},5679(e,t,l){"use strict";l.d(t,{R:()=>r});var n=l(11869),o=l(15892);class r extends o.z{}r.define({hide:!0,label:(0,n.tExpr)("Data blocks"),async children(e){let t=await (0,n.buildSubModelItems)(r)(e),{collectionName:l,filterByTk:o,scene:i}=e.view.inputArgs;return t.filter(t=>{var n,r,a,s,d,u,c;let p=e.engine.getModelClass(t.useModel);return"select"===i?null==(s=p._isScene)?void 0:s.call(p,"select"):"subForm"===i?null==(d=p._isScene)?void 0:d.call(p,"subForm"):"bulkEditForm"===i?null==(u=p._isScene)?void 0:u.call(p,"bulkEditForm"):"new"===i||l&&!o?null==(c=p._isScene)?void 0:c.call(p,"new"):!p._isScene||!(null==(n=p._isScene)?void 0:n.call(p,"select"))&&!(null==(r=p._isScene)?void 0:r.call(p,"subForm"))&&!(null==(a=p._isScene)?void 0:a.call(p,"bulkEditForm"))})}})},81486(e,t,l){"use strict";l.d(t,{o:()=>o});var n=l(11869);class o extends n.FlowModel{static resolveUse(e,t,l){var n,o;let r=null==e||null==(o=e.stepParams)||null==(n=o.fieldBinding)?void 0:n.use;return r&&r!==(null==e?void 0:e.use)?r:null==e?void 0:e.use}}},33297(e,t,l){"use strict";l.d(t,{L:()=>r});var n=l(11869),o=l(14252);class r extends o.S0{}r.define({children:async e=>(await (0,n.buildSubModelItems)(o.S0)(e)).filter(t=>e.engine.getModelClass(t.useModel)._isScene(o.s5.record))})},58428(e,t,l){"use strict";l.d(t,{GO:()=>h,KW:()=>g,Z1:()=>p,eu:()=>m,nF:()=>c,zL:()=>s});var n=l(74848),o=l(11869),r=l(96540),i=l(72380),a=l(33297);let s="assignFieldValues";function d(e){let t=null==e?void 0:e.collection;return t&&"object"==typeof t?t:void 0}function u(e){let t=d(e),l=null==t?void 0:t.dataSourceKey,n=null==t?void 0:t.name;return l&&n?{dataSourceKey:l,collectionName:n}:void 0}function c(e){return{async:!0,use:"AssignFormModel",stepParams:{resourceSettings:{init:u(e)}}}}function p(e,t){var l,n;let o=(null==(l=(n=e.model).getStepParams)?void 0:l.call(n,t,s))||{};return{assignedValues:(null==o?void 0:o.assignedValues)||{}}}async function m(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"AssignFieldValues";try{return await (0,o.resolveRunJSObjectValues)(e,t)}catch(t){var n,r,i;return console.error(`[${l}] RunJS execution failed`,t),null==(i=e.message)||null==(r=i.error)||r.call(i,(null==(n=e.t)?void 0:n.call(e,"RunJS execution failed"))||"RunJS execution failed"),null}}function h(e,t){return t&&"object"==typeof t&&Object.keys(t).length?{...e,...t}:e}function f(e){let{model:t,blockModel:l}=(0,o.useFlowSettingsContext)(),u=t,c=(0,o.useFlowEngine)(),p=(0,r.useRef)(!1),[m,h]=r.useState(null);return(0,r.useEffect)(()=>{let e=!1;return(async()=>{let l=await c.loadOrCreateModel({parentId:u.uid,subKey:"assignForm",use:"AssignFormModel"},{skipSave:!t.context.flowSettingsEnabled});e||(h(l),u.assignFormUid=(null==l?void 0:l.uid)||u.assignFormUid)})(),()=>{e=!0}},[u,c,t.context.flowSettingsEnabled]),(0,r.useEffect)(()=>{var t,n;if(p.current||!m)return;let o=(null==(t=u.getStepParams)?void 0:t.call(u,e.settingsFlowKey,s))||{},r=(null==l?void 0:l.collection)||d(null==u?void 0:u.context),c=null==r?void 0:r.dataSourceKey,h=null==r?void 0:r.name;c&&h&&m.setStepParams("resourceSettings","init",{dataSourceKey:c,collectionName:h}),m.setInitialAssignedValues((null==o?void 0:o.assignedValues)||{}),(e.clearRecordContext||u instanceof i.U&&!(u instanceof a.L))&&(null==(n=m.context)?void 0:n.defineProperty)&&m.context.defineProperty("record",{get:()=>void 0,cache:!1}),p.current=!0},[u,null==l?void 0:l.collection,m,e.clearRecordContext,e.settingsFlowKey]),m?(0,n.jsx)(o.FlowModelRenderer,{model:m,showFlowSettings:!1}):null}function g(e){return{title:e.title||(0,o.tExpr)("Assign field values"),uiSchema:()=>({tip:e.tipComponent?{"x-decorator":"FormItem","x-component":e.tipComponent}:void 0,editor:{"x-decorator":"FormItem","x-component":()=>(0,n.jsx)(f,{settingsFlowKey:e.settingsFlowKey,clearRecordContext:e.clearRecordContext})}}),async beforeParamsSave(t){var l,n,o,r,i,a,d;let u=t.model.assignFormUid?null==(l=(n=t.engine).getModel)?void 0:l.call(n,t.model.assignFormUid,!0):void 0;if(!u)return;e.validateBeforeSave&&await (null==(d=u.form)||null==(a=d.validateFields)?void 0:a.call(d));let c=(null==(o=u.getAssignedValues)?void 0:o.call(u))||{};null==(r=(i=t.model).setStepParams)||r.call(i,e.settingsFlowKey,s,{assignedValues:c})},handler(){}}}},13595(e,t,l){"use strict";l.r(t),l.d(t,{DateFilterDynamicComponent:()=>k});var n=l(74848),o=l(96540),r=l(35710),i=l(71500),a=l(84626),s=l(36492),d=l(63718),u=l(22803),c=l(11869),p=l(2077),m=l(96436),h=l(37985),f=l(40098),g=l.n(f);let v=e=>e?e.replace(/\s*HH?:mm(?::ss)?(?:\.SSS)?/g,"").trim():e,y=(e,t)=>{if(!e)return null;if(m.dayjs.isDayjs(e))return e;if("string"==typeof e&&e.endsWith("Z")){let l=(0,m.dayjs)(e).format(t),n=(0,m.dayjs)(l,t);return n.isValid()?n:(0,m.dayjs)(e)}let l=(0,m.dayjs)(e,t);if(l.isValid())return l;let n=(0,m.dayjs)(e);return n.isValid()?n:null},x=e=>{let{value:t,picker:l="date",format:r,showTime:i,timeFormat:a}=e,s=(0,c.useFlowEngine)(),d=s.translate.bind(s),u=(0,p.fD)(),f=[{label:d("Today"),value:u.today},{label:d("Last week"),value:u.lastWeek},{label:d("This week"),value:u.thisWeek},{label:d("Next week"),value:u.nextWeek},{label:d("Last month"),value:u.lastMonth},{label:d("This month"),value:u.thisMonth},{label:d("Next month"),value:u.nextMonth},{label:d("Last quarter"),value:u.lastQuarter},{label:d("This quarter"),value:u.thisQuarter},{label:d("Next quarter"),value:u.nextQuarter},{label:d("Last year"),value:u.lastYear},{label:d("This year"),value:u.thisYear},{label:d("Next year"),value:u.nextYear},{label:d("Last 7 days"),value:u.last7Days},{label:d("Next 7 days"),value:u.next7Days},{label:d("Last 30 days"),value:u.last30Days},{label:d("Next 30 days"),value:u.next30Days},{label:d("Last 90 days"),value:u.last90Days},{label:d("Next 90 days"),value:u.next90Days}],x=t?(0,p.Pn)(null==t?void 0:t[0],l):l,b=x===l&&r?r:(0,m.getPickerFormat)(x),S="date"===x?v(b):b,w=(0,m.getDateTimeFormat)(x,S,i,a),C={utc:!0,presets:f,...e,format:w,picker:x,showTime:!!i&&{defaultValue:[(0,m.dayjs)("00:00:00","HH:mm:ss"),(0,m.dayjs)("23:59:59","HH:mm:ss")]}},F=(0,o.useMemo)(()=>g().castArray(e.value).map(e=>y(e,w)),[e.value,w]);return(0,n.jsx)(h.A.RangePicker,{...C,style:{flex:1,...null==C?void 0:C.style},value:F})},b=e=>e?e.replace(/\s*HH?:mm(?::ss)?(?:\.SSS)?/g,"").trim():e,S=(e,t)=>{if(!e)return null;if(m.dayjs.isDayjs(e))return e;if("string"==typeof e&&e.endsWith("Z")){let l=(0,m.dayjs)(e).format(t),n=(0,m.dayjs)(l,t);return n.isValid()?n:(0,m.dayjs)(e)}let l=(0,m.dayjs)(e,t);if(l.isValid())return l;let n=(0,m.dayjs)(e);return n.isValid()?n:null},w=e=>{let{picker:t="date",format:l,showTime:r,timeFormat:i,onChange:d}=e,u=(0,c.useFlowContext)(),f=Array.isArray(e.value)?e.value[0]:e.value,g=f?(0,p.Pn)(f,t):t,[v,y]=(0,o.useState)(g),x=u.model.translate.bind(u.model),w=e=>{let n=e===t&&l?l:(0,m.getPickerFormat)(e),o="date"===e?b(n):n;return(0,m.getDateTimeFormat)(e,o,r,i)},C=(0,o.useMemo)(()=>w(v),[l,t,r,v,i]),F=(0,o.useMemo)(()=>S(f,C),[f,C]),k={utc:!0,inputReadOnly:u.isMobileLayout,...e,underFilter:!0,showTime:!!r&&{defaultValue:(0,m.dayjs)("00:00:00","HH:mm:ss")},format:C,picker:v};return(0,n.jsxs)(a.A.Compact,{style:{width:"100%"},children:[(0,n.jsx)(s.A,{style:{width:"100px"},popupMatchSelectWidth:!1,value:v,options:[{label:x("Date"),value:"date"},{label:x("Month"),value:"month"},{label:x("Quarter"),value:"quarter"},{label:x("Year"),value:"year"}],onChange:e=>{let t=w(e),l=C;if(y(e),!f||!d)return;let n=S(f,l);n&&n.isValid()&&d(n,n.format(t))}}),(0,n.jsx)(h.A,{...k,style:{flex:1,...null==k?void 0:k.style},value:F})]})},C=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=[{value:"exact",label:e("Exact day")},{value:"past",label:e("Past")},{value:"next",label:e("Next")},{value:"today",label:e("Today")},{value:"yesterday",label:e("Yesterday")},{value:"tomorrow",label:e("Tomorrow")},{value:"thisWeek",label:e("This Week")},{value:"lastWeek",label:e("Last Week")},{value:"nextWeek",label:e("Next Week")},{value:"thisMonth",label:e("This Month")},{value:"lastMonth",label:e("Last Month")},{value:"nextMonth",label:e("Next Month")},{value:"thisQuarter",label:e("This Quarter")},{value:"lastQuarter",label:e("Last Quarter")},{value:"nextQuarter",label:e("Next Quarter")},{value:"thisYear",label:e("This Year")},{value:"lastYear",label:e("Last Year")},{value:"nextYear",label:e("Next Year")}];return t&&l.splice(3,0,{value:"now",label:e("Now")}),l},F=e=>{let{isRange:t,defaultValue:l,onChange:r,...i}=e,a=(0,o.useCallback)((e,t)=>r(t),[r]);return t?(0,n.jsx)(x,{...i,onChange:a}):(0,n.jsx)(w,{...i,onChange:a})},k=e=>{let{value:t,onChange:l,includeNow:p=!1,...m}=e,h=(0,c.useFlowEngine)(),f=h.translate.bind(h),{token:g}=r.A.useToken(),[v,y]=(0,o.useState)(!1),x=(0,o.useMemo)(()=>C(f,p),[f,p]),b=e=>{if(y(!1),"exact"===e)return l(void 0);let t={type:e};["past","next"].includes(e)&&(t.number=1,t.unit="day"),l(t)},S=()=>{let e=x.slice(0,3),t=x.slice(3),l=(0,u.css)`
|
|
2889
|
+
${o}`,c)}}let n=T(e.issues.filter(e=>"runtime"===e.type)),o=n?`Key runtime issue: ${R(n)}`:"",r=["RunJS preview output was truncated.",t,e.execution?E(e.execution):void 0,o||void 0].filter(Boolean).join("\n").trim();return r.length<=c?r:N(r,c-1)+"\n"}function $(e){return B(e)}async function O(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n="string"==typeof e?e:String(e??""),o=[],r=[],i=null==l?void 0:l.version,a=(0,d.shouldPreprocessRunJSTemplates)({version:i});r.push(...j(n)),r.push(...M(n));let s="u">typeof performance&&"function"==typeof performance.now?performance.now():Date.now(),u={started:!1,finished:!1,timeout:!1,durationMs:void 0};try{u.started=!0;let{consoleCapture:e,loggerCapture:l}=I(o),s={console:e};try{if("u">typeof window){let e=(0,d.createSafeNavigator)();s.navigator=e,s.window=(0,d.createSafeWindow)({navigator:e}),s.document=(0,d.createSafeDocument)()}}catch(e){}let c=n;try{c=await (0,d.prepareRunJsCode)(n,{preprocessTemplates:a})}catch(n){let e=String((null==n?void 0:n.name)||""),t=y((null==n?void 0:n.message)||n),l=n instanceof SyntaxError||/^SyntaxError\b/i.test(e)||/SyntaxError\b/i.test(t);return r.push({type:"runtime",ruleId:l?"preview-start-failed":"internal",message:l?t:`Preview internal failure: ${t}`,stack:C(n)}),u.finished=!0,u.timeout=!1,{issues:A(r),logs:o,execution:u}}let m=await t.createJSRunner({globals:s,timeoutMs:p,version:i});m.globals.ctx.defineProperty("logger",{value:l});let h=await m.run(c);if(u.finished=!0,u.timeout=!!(null==h?void 0:h.timeout),!(null==h?void 0:h.success)){let e=null==h?void 0:h.error,t=(null==h?void 0:h.timeout)?"Execution timed out":y((null==e?void 0:e.message)||e||"Unknown error"),l=e instanceof SyntaxError||/^SyntaxError\b/i.test(String((null==e?void 0:e.name)||""));r.push({type:"runtime",ruleId:(null==h?void 0:h.timeout)?"timeout":l?"preview-start-failed":"runtime-error",message:t,stack:C(e)})}}catch(e){u.finished=!0,u.timeout=!1,r.push({type:"runtime",ruleId:"internal",message:`Preview internal failure: ${y((null==e?void 0:e.message)||e)}`,stack:C(e)})}finally{let e=Math.max(0,("u">typeof performance&&"function"==typeof performance.now?performance.now():Date.now())-s);u.durationMs=Number.isFinite(e)?e:void 0}return{issues:A(r),logs:o,execution:u}}function q(e){let t=new d.FlowContext;if(t.addDelegate(e),"u">typeof document&&"function"==typeof document.createElement&&!e.element)try{let e=document.createElement("div");t.defineProperty("element",{value:e})}catch(e){}return t}async function _(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=q(t),o=await O(e,n,l),r=0===o.issues.length,i=$(o);return{success:r,message:i.length>c?N(i,c):i}}},68669(e,t,l){"use strict";l.d(t,{a:()=>a});var n=l(74848),o=l(84626),r=l(71021);l(96540);var i=l(7521);let a=(0,l(11869).observer)(e=>{var t;let{value:l,FilterItem:a,ctx:s}=e;l.logic||(l.logic="$and"),Array.isArray(l.items)||(l.items=[]);let d=()=>{var e;(null==s||null==(e=s.model)?void 0:e.dispatchEvent)&&s.model.dispatchEvent("reset")},u=()=>{var e;(null==s||null==(e=s.model)?void 0:e.dispatchEvent)&&s.model.dispatchEvent("submit")},c=(null==s||null==(t=s.model)?void 0:t.translate)||(e=>e);return(0,n.jsxs)("form",{onSubmit:e=>{e.preventDefault(),u()},children:[(0,n.jsx)(i.I,{value:l,FilterItem:a}),(0,n.jsxs)(o.A,{style:{width:"100%",display:"flex",justifyContent:"flex-end"},children:[(0,n.jsx)(r.Ay,{htmlType:"button",onClick:d,children:c("Reset")}),(0,n.jsx)(r.Ay,{type:"primary",htmlType:"submit",children:c("Submit")})]})]})},{displayName:"FilterContent"})},7521(e,t,l){"use strict";l.d(t,{I:()=>f});var n=l(74848),o=l(97373),r=l(18853),i=l(35710),a=l(36492),s=l(84626),d=l(71021),u=l(18492);l(96540);var c=l(11869);let p=new WeakMap,m=0,h=e=>{let t=p.get(e);return t||(m+=1,t=`filter-item-${m}`,p.set(e,t)),t},f=(0,c.observer)(e=>{let{token:t}=i.A.useToken(),{value:l={logic:"$and",items:[]},FilterItem:c,showBorder:p=!1,onRemove:m,onChange:g,closeIcon:v=(0,n.jsx)(o.A,{style:{color:t.colorIcon}})}=e,{t:y}=(0,u.B)();l.logic||(l.logic="$and"),Array.isArray(l.items)||(l.items=[]);let{logic:x,items:b}=l,S=p?{position:"relative",border:`1px dashed ${t.colorBorder}`,padding:t.paddingSM,marginBottom:t.marginXS,borderRadius:t.borderRadius}:{position:"relative",marginBottom:t.marginXS},w=e=>{l.logic=e,null==g||g(l)},C=()=>{b.push({path:"",operator:"",value:""}),null==g||g(l)},F=()=>{b.push({logic:"$and",items:[]}),null==g||g(l)},k=e=>{b.splice(e,1),null==g||g(l)},A=e=>"path"in e||"operator"in e||"value"in e,P=e=>"logic"in e&&"items"in e;return(0,n.jsxs)("div",{style:S,children:[p&&m&&(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{position:"absolute",right:10,top:10,cursor:"pointer",background:"transparent",border:0,padding:0},onClick:m,children:v}),(0,n.jsx)("div",{style:{marginBottom:8,color:t.colorText},children:(0,n.jsxs)("span",{children:[y("Meet")," ",(0,n.jsxs)(a.A,{"data-testid":"filter-select-all-or-any",style:{width:"auto"},value:x,onChange:w,children:[(0,n.jsx)(a.A.Option,{value:"$and",children:y("All")}),(0,n.jsx)(a.A.Option,{value:"$or",children:y("Any")})]})," ",y("conditions in the group")]})}),(0,n.jsx)("div",{children:b.map((e,o)=>P(e)?(0,n.jsx)(f,{value:e,FilterItem:c,showBorder:!0,onRemove:()=>k(o),onChange:e=>{b[o]=e,null==g||g(l)}},h(e)):A(e)?c?(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsx)(c,{value:e}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>k(o),children:v})]})},h(e)):(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsxs)("span",{children:[e.path," ",e.operator," ",String(e.value)]}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>k(o),children:v})]})},h(e)):(0,n.jsx)("div",{style:{marginBottom:8,display:"flex",alignItems:"flex-end"},children:(0,n.jsxs)(s.A,{style:{flex:1,minWidth:0},children:[(0,n.jsx)("span",{style:{color:t.colorTextTertiary},children:"Invalid filter item"}),(0,n.jsx)("button",{type:"button","aria-label":"icon-close",style:{marginLeft:8,marginRight:8,flex:"0 0 auto",cursor:"pointer",background:"transparent",border:0,padding:0},onClick:()=>k(o),children:v})]})},h(e)))}),(0,n.jsxs)(s.A,{size:16,style:{marginTop:8,marginBottom:8},children:[(0,n.jsx)(d.Ay,{style:{padding:0},type:"link",size:"small",icon:(0,n.jsx)(r.A,{}),onClick:C,children:y("Add condition")}),(0,n.jsx)(d.Ay,{style:{padding:0},type:"link",size:"small",icon:(0,n.jsx)(r.A,{}),onClick:F,children:y("Add condition group")})]})]})},{displayName:"FilterGroup"})},44e3(e,t,l){"use strict";l.d(t,{H:()=>n});let n=(e,t,l,n)=>e.map(e=>o(e,t,l,n)).filter(Boolean),o=(e,t,l,o)=>{var r;if(l.length&&1===t&&l.includes(e.name)||!e.interface||!1===e.filterable)return;let i=e.getInterfaceOptions();if(!(null==i?void 0:i.filterable))return;let{nested:a,children:s,operators:d}=i.filterable,u={name:e.name,type:e.type,target:e.target,title:o(e.title),schema:null==e?void 0:e.uiSchema,operators:((null==d||null==(r=d.filter)?void 0:r.call(d,t=>!(null==t?void 0:t.visible)||t.visible(e)))||[]).map(e=>({...e,label:o(e.label)}))};if(!e.target||!(t>2)){if(t>2)return u;if((null==s?void 0:s.length)&&(u.children=s),a){let r=n(e.getFields().filter(e=>"attachments"!==e.target&&"formula"!==e.interface),t+1,l,o).filter(Boolean);u.children=u.children||[],u.children.push(...r)}return u}}},58528(e,t,l){"use strict";l.d(t,{Ru:()=>z,I8:()=>o.I,qi:()=>p,oJ:()=>n.a,Et:()=>T,uw:()=>K.u});var n=l(68669),o=l(7521),r=l(74848),i=l(11869),a=l(84626),s=l(36492),d=l(95725),u=l(96540),c=l(44e3);let p=(0,i.observer)(e=>{var t;let{path:l,operator:n,value:o}=e.value,i=e.model,p=(null==(t=i.context.blockModel.collection)?void 0:t.getFields().filter(e=>"attachments"!==e.target))||[],h=m(i.props.filterableFieldNames||[],p.map(e=>e.name)),f=i.translate,g=(0,c.H)(p.filter(e=>"attachments"!==e.target&&"formula"!==e.interface&&!["belongsTo","belongsToMany","hasOne","hasMany","oho","obo","m2o","o2m","m2m"].includes(e.type)),1,e.noIgnore?[]:h,f).filter(Boolean),v=(0,u.useMemo)(()=>{let e=g.find(e=>e.name===l);return(null==e?void 0:e.operators)||[]},[g,l]),y=t=>{var l;e.value.path=t;let n=g.find(e=>e.name===t);(null==n||null==(l=n.operators)?void 0:l.length)>0?e.value.operator=n.operators[0].value:e.value.operator="",e.value.value=""},x=t=>{e.value.operator=t},b=t=>{e.value.value=t.target.value};return(0,r.jsxs)(a.A,{children:[(0,r.jsx)(s.A,{style:{width:200},placeholder:f("Select field"),value:l||void 0,onChange:y,children:g.map(e=>(0,r.jsx)(s.A.Option,{value:e.name,children:e.title},e.name))}),(0,r.jsx)(s.A,{style:{width:120},placeholder:f("Select operator"),value:n||void 0,onChange:x,disabled:!l||0===v.length,children:v.map(e=>(0,r.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),(0,r.jsx)(d.A,{style:{width:200},placeholder:f("Enter value"),value:o,onChange:b})]})},{displayName:"FilterItem"});function m(e,t){return null==t?void 0:t.filter(t=>!e.includes(t))}var h=l(63718),f=l(94313),g=l(60518),v=l(51643),y=l(60209),x=l(2077),b=l(18451),S=l.n(b),w=l(40098),C=l.n(w),F=l(20419),k=l(85352),A=l(53869);let{DateFilterDynamicComponent:P}=(0,x.RZ)(()=>Promise.resolve().then(l.bind(l,13595)),"DateFilterDynamicComponent");async function j(e){var t,l,n,o;let r=async e=>Array.isArray(e)?e:"function"==typeof e?await e():[];if(null==(l=e.getPropertyOptions)||null==(t=l.call(e,"collection"))?void 0:t.meta){let t=null==(o=e.getPropertyMetaTree)?void 0:o.call(e,"{{ ctx.collection }}");return await r(t)}let a=()=>(null==e?void 0:e.collection)??null,s=await (0,i.createEphemeralContext)(e,{defineProperties:{collection:{get:a,meta:(0,i.createCollectionContextMeta)(a,"Current collection")}}}),d=null==(n=s.getPropertyMetaTree)?void 0:n.call(s,"{{ ctx.collection }}");return await r(d)}function M(e,t,l,n){var o;let i=null==e?void 0:e["x-component"],a=(null==t||null==(o=t.uiSchema)?void 0:o["x-component-props"])||{},u=(null==e?void 0:e["x-component-props"])||{},c=S()({},a,u),p=(0,k.di)(null==e?void 0:e.enum,l)||[],m={style:{width:200,...(null==c?void 0:c.style)||{}},placeholder:(null==c?void 0:c.placeholder)||l("Enter value"),...c},x=e=>{if("number"==typeof e||(null==c?void 0:c.stringMode)===!0&&"string"==typeof e)return e};return e=>{let{value:t,onChange:l,...o}=e||{};if("InputNumber"===i)return(0,r.jsx)(h.A,{...m,...o,value:x(t),onChange:e=>null==l?void 0:l(e)});if("NumberPicker"===i)return(0,r.jsx)(F.NumberPicker,{...m,...o,value:x(t),onChange:e=>null==l?void 0:l(e)});if("Switch"===i)return(0,r.jsx)(f.A,{...m,...o,checked:!!t,onChange:e=>null==l?void 0:l(e)});if("Select"===i)return(0,r.jsx)(s.A,{options:p,...m,...o,value:(0,k.xO)(t,m),onChange:e=>null==l?void 0:l(e)});if("Checkbox"===i)return(0,r.jsx)(g.A,{...m,...o,checked:!!t,onChange:e=>null==l?void 0:l(e.target.checked)});if("Checkbox.Group"===i)return(0,r.jsx)(g.A.Group,{...m,...o,value:Array.isArray(t)?t:void 0,onChange:e=>null==l?void 0:l(e)});if("Radio.Group"===i)return(0,r.jsx)(v.Ay.Group,{...m,...o,value:Array.isArray(t)||"string"==typeof t||"number"==typeof t||"boolean"==typeof t?t:void 0,onChange:e=>null==l?void 0:l(e.target.value)});if("Cascader"===i)return(0,r.jsx)(y.A,{...m,...o,value:Array.isArray(t)?t:void 0,onChange:e=>null==l?void 0:l(e)});if("Input.TextArea"===i||"TextArea"===i)return(0,r.jsx)(d.A.TextArea,{...m,...o,value:"string"==typeof t?t:null==t?"":String(t),onChange:e=>null==l?void 0:l(e.target.value)});if("DateFilterDynamicComponent"===i)return(0,r.jsx)(P,{...m,...o,value:t,onChange:e=>null==l?void 0:l(e)});if(i&&(null==n?void 0:n.getComponent)){let e=n.getComponent(i);if(e)return(0,r.jsx)(e,{...m,...o,value:t,onChange:e=>null==l?void 0:l(e),style:{width:200,...m.style||{},...null==o?void 0:o.style}})}return(0,r.jsx)(d.A,{...m,...o,value:"string"==typeof t?t:null==t?"":String(t),onChange:e=>null==l?void 0:l(e.target.value)})}}function I(e){if(e&&"object"==typeof e){let l=e;if("function"==typeof l.preventDefault||l.nativeEvent||"target"in l){var t;let n=null==(t=l.target)?void 0:t.value;return void 0!==n?n:e}}return e}let T=(0,i.observer)(e=>{let{value:t,model:l,rightAsVariable:n,rightMetaTree:o,ignoreFieldNames:c}=e,p=(0,i.useFlowViewContext)(),m=l.translate,{path:h,operator:f,value:g}=t,[v,y]=(0,u.useState)(null),b=(0,u.useCallback)(e=>{var t;return(0,x.w6)(e,l.context.dataSourceManager,null==(t=l.context.app)?void 0:t.dataSourceManager)},[l]),w=(0,u.useMemo)(()=>{var e,t;if(!v)return[];let l=v.interface?b(v.interface):void 0,n=null==v||null==(e=v.uiSchema)?void 0:e["x-filter-operators"];return((Array.isArray(n)&&n.length?n:null==l||null==(t=l.filterable)?void 0:t.operators)||[]).filter(e=>!e.visible||e.visible(v))},[b,v]);(0,u.useEffect)(()=>{if(!w.length)return;let e=C().find(w,e=>e.value===t.operator);if(e)t.noValue=!!e.noValue;else{let e=w[0];t.operator=e.value,t.value=!!e.noValue||void 0,t.noValue=!!e.noValue}},[w,t]);let F=(0,u.useMemo)(()=>w.map(e=>({value:e.value,label:"string"==typeof e.label?m(e.label):e.label})),[w,m]),P=(0,u.useCallback)((e,l)=>{let n=t.path||"",o=e||"",r=o!==n;t.path=o,r&&n&&(t.operator="",t.value=void 0,t.noValue=!1),l&&y(l)},[t]),T=(0,u.useMemo)(()=>({resolveValueFromPath:e=>(y(e),(null==e?void 0:e.paths.slice(1).join("."))||null),resolvePathFromValue(e){if(null==e)return;let t=String(e).trim();if(t)return["collection",...t.split(".")]}}),[]),R=(0,u.useCallback)(e=>{t.operator=e;let l=w.find(t=>t.value===e);(null==l?void 0:l.noValue)?(t.value=!0,t.noValue=!0):(t.value=void 0,t.noValue=!1)},[w,t]),E=(0,u.useMemo)(()=>w.find(e=>e.value===f),[w,f]),N=(0,u.useCallback)(e=>{var t,l;return(null==e||null==(t=e.options)?void 0:t.dataType)||(null==e?void 0:e.dataType)||(null==e?void 0:e.type)||(null==e||null==(l=e.uiSchema)?void 0:l.type)||"double"},[]),D=(0,u.useCallback)(e=>{switch(e){case"boolean":return"Switch";case"date":return"DateFilterDynamicComponent";case"integer":case"bigInt":case"double":case"decimal":case"number":return"InputNumber";default:return"Input"}},[]),B=(0,u.useMemo)(()=>{let e=(null==v?void 0:v.uiSchema)||{},t=(null==E?void 0:E.schema)||{},l=S()({},e,t);if((null==v?void 0:v.interface)==="formula"){let e={"x-read-pretty":!1,"x-component":D(N(v)),"x-component-props":{...l["x-component-props"]}};return S()({},l,e)}return l},[v,E,D,N]),$=u.useRef(null==B?void 0:B["x-component"]),O=null==B?void 0:B["x-component"],q=(0,u.useMemo)(()=>{let e=$.current;$.current=O;let l=void 0!==e&&e!==O;if(null==E?void 0:E.noValue)return g;if(l&&null!=g){t.value=void 0;return}return g},[O,g,t,E]),_=(0,u.useCallback)(e=>{t.value=I(e)},[t]),L=u.useRef(m);u.useEffect(()=>{L.current=m},[m]);let V=u.useCallback(e=>{var t;return(null==(t=L.current)?void 0:t.call(L,e))??e},[]),z=(0,u.useMemo)(()=>(0,k.di)(null==B?void 0:B.enum,V)||[],[B,V]),K=(0,u.useMemo)(()=>M(B,v,V,l.context.app),[B,v,V,l.context.app]),U=(0,u.useCallback)(()=>{let e=(0,A._)(l.context.app,f,w),t="$in"===f||"$notIn"===f;if(e&&t){let{Comp:t,props:l}=e,n={...l};(!(null==n?void 0:n.options)||(null==n?void 0:n.options.length)===0)&&(null==z?void 0:z.length)&&(n.options=z);let o={flex:"1 1 40%",minWidth:160,maxWidth:"100%",...(null==n?void 0:n.style)||{}},i=Array.isArray(q)&&q.every(e=>"string"==typeof e||"number"==typeof e)?q:"string"==typeof q?q.split(/\r?\n/).map(e=>e.trim()).filter(Boolean):[];return(0,r.jsx)("div",{style:o,children:(0,r.jsx)(t,{...n,style:{width:"100%",...(null==n?void 0:n.style)||{}},value:i,onChange:e=>_(e)})})}let n=K;return(0,r.jsx)("div",{style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},children:(0,r.jsx)(n,{value:q,onChange:e=>_(e)})})},[f,w,q,K,l.context.app,_,z]),W=(0,u.useMemo)(()=>function(){return(0,r.jsx)(d.A,{placeholder:`<${m("Null")}>`,readOnly:!0})},[m]),H=(0,u.useMemo)(()=>async()=>{let e="function"==typeof o?await o():o??p.getPropertyMetaTree(),t=Array.isArray(e)?e:await e();return[{title:m("Constant"),name:"constant",type:"string",paths:["constant"],render:K},{title:m("Null"),name:"null",type:"object",paths:["null"],render:W},...t]},[o,p,K,W,m]),G=(0,u.useMemo)(()=>({renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?K:"null"===l?W:null},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:void 0},resolvePathFromValue:e=>{if(null===e)return["null"];let t="string"==typeof e?(0,i.parseValueToPath)(e):void 0;return t||["constant"]}}),[W,K]),Y=(0,u.useMemo)(()=>async()=>{let e=await j(l.context),t=async e=>{let t=e.interface?b(e.interface):void 0,n=[],o=null==t?void 0:t.filterable,r=null==o?void 0:o.children;if(Array.isArray(r)&&r.length)for(let t of r){var i,a,s;let o=t.title||t.name,r=(null==(i=l.context)?void 0:i.t)?l.context.t(o):o;n.push({name:t.name,title:r,type:(null==(a=t.schema)?void 0:a.type)||"string",interface:(null==(s=t.schema)?void 0:s["x-component"])==="Select"?"select":"input",uiSchema:{...t.schema||{},"x-filter-operators":t.operators},paths:[...e.paths||[],t.name],parentTitles:[...e.parentTitles||[],e.title]})}if("function"==typeof e.children){let t=e.children;return{...e,children:async()=>{let e=await t(),l=[...Array.isArray(e)?e:[],...n];return C().uniqBy(l,"name")}}}let d=[...Array.isArray(e.children)?e.children:[],...n];return{...e,children:d.length?d:e.children}},n=[];for(let l of e)n.push(await t(l));return n},[b,l]);return(0,r.jsxs)(a.A,{wrap:!0,style:{width:"100%"},children:[(0,r.jsx)(i.VariableInput,{value:h,metaTree:Y,onChange:P,converters:T,showValueComponent:!1,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},onlyLeafSelectable:!0,placeholder:m("Select field"),ignoreFieldNames:c}),(0,r.jsx)(s.A,{style:{flex:"0 0 140px",minWidth:120,maxWidth:"100%"},placeholder:m("Comparison"),value:f||void 0,onChange:R,children:F.map(e=>(0,r.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),!(null==E?void 0:E.noValue)&&(n?(0,r.jsx)(i.VariableInput,{value:q,onChange:e=>_(e),metaTree:H,converters:G,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:m("Enter value")}):U())]})});var R=l(68827),E=l.n(R),N=l(97456);let{DateFilterDynamicComponent:D}=(0,x.RZ)(()=>Promise.resolve().then(l.bind(l,13595)),"DateFilterDynamicComponent");function B(e,t,l){var n,o,i;let a=null==e?void 0:e["x-component"],u=(null==t||null==(n=t.uiSchema)?void 0:n["x-component-props"])||{},c=(null==e?void 0:e["x-component-props"])||{},p=S()({},u,c),m=Array.isArray(null==t||null==(o=t.uiSchema)?void 0:o.enum)?null==t||null==(i=t.uiSchema)?void 0:i.enum:void 0,g=(0,k.di)(m,l),v={style:{width:200,...(null==p?void 0:p.style)||{}},placeholder:(null==p?void 0:p.placeholder)||l("Enter value"),...p};return e=>{let{value:t,onChange:n,...o}=e||{};if("InputNumber"===a)return(0,r.jsx)(h.A,{...v,...o,value:t,onChange:n});if("NumberPicker"===a)return(0,r.jsx)(F.NumberPicker,{...v,...o,value:t,onChange:n});if("Switch"===a)return(0,r.jsx)(f.A,{...v,...o,checked:!!t,onChange:n});if("Select"===a){let e=v;return Array.isArray(null==e?void 0:e.options)&&e.options.length>0?e={...e,options:(0,k.ZY)(e.options,l)}:g&&(e={...e,options:g}),(0,r.jsx)(s.A,{...e,...o,value:(0,k.xO)(t,e),onChange:n})}return"DateFilterDynamicComponent"===a?(0,r.jsx)(D,{...v,...o,value:t,onChange:n}):(0,r.jsx)(d.A,{...v,...o,value:t,onChange:e=>{var t;return null==n?void 0:n(null==e||null==(t=e.target)?void 0:t.value)}})}}let $=[{value:"$includes",label:"contains",selected:!0},{value:"$notIncludes",label:"does not contain"},{value:"$eq",label:"is"},{value:"$ne",label:"is not"},{value:"$empty",label:"is empty",noValue:!0},{value:"$notEmpty",label:"is not empty",noValue:!0}],O=new Set(["$in","$notIn"]);function q(e,t){let l=Array.isArray(e)?e:[],n=Array.isArray(t)?t:[];if(!n.length)return l;let o=n.find(e=>(null==e?void 0:e.name)==="item");if(!o)return[...n,...l];let r=(0,N.mD)(l,[o]);return[...n.filter(e=>(null==e?void 0:e.name)!=="item"),...r]}function _(e,t){var l,n;return{name:t.name,title:t.title||t.name,type:(null==(l=t.schema)?void 0:l.type)||"string",interface:(null==(n=t.schema)?void 0:n["x-component"])==="Select"?"select":"input",uiSchema:{...t.schema||{},"x-filter-operators":t.operators},paths:[...e.paths||[],t.name],parentTitles:[...e.parentTitles||[],e.title]}}async function L(e,t){var l,n;let o=e.interface&&t?t(e.interface):void 0,r=(Array.isArray(null==o||null==(l=o.filterable)?void 0:l.children)?null==o||null==(n=o.filterable)?void 0:n.children:[]).map(t=>_(e,t)),i=async e=>{let l=[...await Promise.all(e.map(e=>L(e,t))),...r];return E()(l,e=>e.name)};if("function"==typeof e.children){let t=e.children;return{...e,children:async()=>{let e=await t(),l=Array.isArray(e)?e:[];return await i(l)}}}return Array.isArray(e.children)?{...e,children:await i(e.children)}:r.length?{...e,children:r}:e}async function V(e,t){let l=Array.isArray(e)?e:[];return await Promise.all(l.map(e=>L(e,t)))}let z=(0,i.observer)(e=>{var t;let{value:l,model:n,extraMetaTree:o}=e,c=(0,i.useFlowViewContext)(),p=n.translate,{path:m,operator:h,value:f}=l||{},[g,v]=(0,u.useState)(null),y=(0,u.useRef)(!1),b=(0,u.useMemo)(()=>{if(g){var e,t,l;let o=g.interface?(0,x.w6)(g.interface,n.context.dataSourceManager,null==(e=n.context.app)?void 0:e.dataSourceManager):void 0,r=null==g||null==(t=g.uiSchema)?void 0:t["x-filter-operators"];return((Array.isArray(r)&&r.length?r:null==o||null==(l=o.filterable)?void 0:l.operators)||$).filter(e=>!e.visible||e.visible(g)).map(e=>({value:e.value,label:e.label,noValue:!!e.noValue,schema:e.schema,selected:!!e.selected}))}return[]},[g,n]),w=(0,u.useMemo)(()=>b.map(e=>({value:e.value,label:"string"==typeof e.label?p(e.label):e.label})),[b,p]);(0,u.useEffect)(()=>{if(0!==b.length){if(!h){if(y.current){let e=b.find(e=>e.selected)||b[0];l.operator=(null==e?void 0:e.value)||"",(null==e?void 0:e.noValue)?(l.value=!0,l.noValue=!0):l.noValue=!1,y.current=!1}return}if(!b.some(e=>e.value===h)){let e=b.find(e=>e.selected)||b[0];l.operator=(null==e?void 0:e.value)||"",(null==e?void 0:e.noValue)?(l.value=!0,l.noValue=!0):l.noValue=!1}}},[b,h,l]);let C=(0,u.useMemo)(()=>b.find(e=>e.value===h),[b,h]),F=(0,u.useMemo)(()=>{let e=(null==g?void 0:g.uiSchema)||{},t=(null==C?void 0:C.schema)||{};return S()({},e,t)},[g,C]),P=(0,u.useRef)(p);(0,u.useEffect)(()=>{P.current=p},[p]);let j=(0,u.useCallback)(e=>{var t;return(null==(t=P.current)?void 0:t.call(P,e))??e},[]),M=(0,u.useMemo)(()=>B(F,g,j),[F,g,j]),I=(0,u.useMemo)(()=>(0,k.di)(null==F?void 0:F.enum,j)||[],[F,j]),T=(0,u.useMemo)(()=>{let e=(0,A._)(n.context.app,h,b),t=O.has(h);if(!e||!t)return M;let{Comp:l,props:o}=e;return e=>{let{value:t,onChange:n,...i}=e||{},a={...o};(null==a?void 0:a.options)&&(null==a?void 0:a.options.length)!==0||!(I.length>0)||(a.options=I);let s=Array.isArray(t)?t:"string"==typeof t?t.split(/\r?\n/).map(e=>e.trim()).filter(Boolean):[];return(0,r.jsx)(l,{...a,...i,value:s,onChange:n,style:{width:200,...(null==a?void 0:a.style)||{},...(null==i?void 0:i.style)||{}}})}},[I,n.context.app,b,h,M]),R=(0,u.useMemo)(()=>function(){return(0,r.jsx)(d.A,{placeholder:`<${p("Null")}>`,readOnly:!0})},[p]),E=(0,u.useMemo)(()=>async()=>{let e=q((null==n?void 0:n.context.getPropertyMetaTree())||c.getPropertyMetaTree(),o);return[{title:p("Constant"),name:"constant",type:"string",paths:["constant"]},{title:p("Null"),name:"null",type:"object",paths:["null"]},...e]},[c,n,p,o]),N=(0,u.useCallback)(async()=>{var e,t;let l=(null==n||null==(t=n.context)||null==(e=t.getPropertyMetaTree)?void 0:e.call(t))||c.getPropertyMetaTree(),r=q(Array.isArray(l)?l:[],o),i=e=>{var t;return(0,x.w6)(e,n.context.dataSourceManager,null==(t=n.context.app)?void 0:t.dataSourceManager)};return await V(r,i)},[c,n,o]),D=(0,u.useMemo)(()=>({renderInputComponent:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?T:"null"===l?R:null},resolveValueFromPath:e=>{var t;let l=null==e||null==(t=e.paths)?void 0:t[0];return"constant"===l?"":"null"===l?null:void 0},resolvePathFromValue:e=>{if(null===e)return["null"];let t=(0,i.parseValueToPath)(e);return t||["constant"]}}),[R,T]),_=(0,u.useCallback)((e,t)=>{let n=l.path||"",o=e||"",r=o!==n;l.path=o,r&&n&&(l.operator="",l.value="",y.current=!0),n||!o||l.operator||(y.current=!0),t&&v(t)},[l]),L=(0,u.useCallback)(e=>{let t=l.operator;l.operator=e;let n=b.find(t=>t.value===e);(null==n?void 0:n.noValue)?(l.value=!0,l.noValue=!0):(O.has(t)&&!O.has(e)&&Array.isArray(l.value)&&(l.value=l.value.join("\n")),l.noValue=!1)},[l,b]);return(0,r.jsxs)(a.A,{wrap:!0,style:{width:"100%"},children:[(0,r.jsx)(i.VariableInput,{value:m,onChange:_,metaTree:N,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:p("Select variable"),onlyLeafSelectable:!0}),(0,r.jsx)(s.A,{style:{flex:"0 0 140px",minWidth:120,maxWidth:"100%"},placeholder:p("Comparison"),value:h||void 0,onChange:L,children:w.map(e=>(0,r.jsx)(s.A.Option,{value:e.value,children:e.label},e.value))}),!(null==(t=b.find(e=>e.value===h))?void 0:t.noValue)&&(0,r.jsx)(i.VariableInput,{value:f,onChange:e=>l.value=e,metaTree:E,converters:D,showValueComponent:!0,style:{flex:"1 1 40%",minWidth:160,maxWidth:"100%"},placeholder:p("Enter value"),clearValue:""})]})});var K=l(17669)},17669(e,t,l){"use strict";l.d(t,{u:()=>i});var n=l(96540),o=l(44e3);let r=e=>e;function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{filterableFieldNames:l,nonfilterableFieldNames:i,noIgnore:a=!1,t:s=r}=t,d=(0,n.useMemo)(()=>(null==e?void 0:e.getFields())||[],[e]),u=(0,n.useMemo)(()=>{let e=!a&&(null==l?void 0:l.length)?d.map(e=>e.name).filter(e=>!l.includes(e)):[],t=i??[];return t.length?Array.from(new Set([...e,...t])):e},[d,l,i,a]);return(0,n.useMemo)(()=>(0,o.H)(d.filter(e=>"attachments"!==e.target&&"formula"!==e.interface),1,u,s).filter(Boolean),[d,u,s])}},39580(e,t,l){"use strict";l.d(t,{b2:()=>o.b,tn:()=>n.t,S5:()=>o.S});var n=l(27941);l(74848),l(98668),l(43627),l(11869),l(96540),l(74979),l(21335);var o=l(36869);l(95266),l(47785)},51612(e,t,l){"use strict";l.d(t,{g:()=>f});var n=l(74848),o=l(96540),r=l(40098);let i=l.n(r)().memoize(async e=>e?(await Promise.all([l.e("957"),l.e("2174"),l.e("3338"),l.e("1339"),l.e("32")]).then(l.bind(l,86419))).default.render(e):e);function a(e){let[t,l]=(0,o.useState)(""),[n,r]=(0,o.useState)(!0);return(0,o.useEffect)(()=>{r(!0),i(e).then(e=>{l(e),r(!1)}).catch(e=>console.log(e))},[e]),{html:t,loading:n}}function s(e){let t=e,l=document.createElement("div");l.innerHTML=t;let n=l.innerText;return l=null,(null==n?void 0:n.replace(/[\n\r]/g,""))||""}var d=l(24978),u=l(22803),c=l(11869),p=l(35710);let m=()=>{let e=(0,c.useFlowContext)(),{token:t}=p.A.useToken(),l=!!e.isDarkTheme,n=new d.q(t.colorFillAlter).onBackground(t.colorBgContainer).toHexShortString(),o={lineHeight:"inherit","&.nb-markdown-default":{"pre code.hljs":{display:"block",overflowX:"auto",padding:"1em"},"code.hljs":{padding:"3px 5px"},":not(pre) code":{padding:"2px 5px",color:"#d56161",background:t.colorFillQuaternary,border:`1px solid ${t.colorBorder}`,borderRadius:t.borderRadiusSM},blockquote:{borderLeft:"4px solid #ccc",paddingLeft:"20px",marginLeft:"0",color:"#666",fontStyle:"italic"},img:{maxWidth:"100%"},".hljs":{background:"#f8f8f8",color:"#444"},".hljs-comment":{color:"#697070"},".hljs-punctuation,.hljs-tag":{color:"#444a"},".hljs-tag .hljs-attr,.hljs-tag .hljs-name":{color:"#444"},".hljs-attribute,.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-name,.hljs-selector-tag":{fontWeight:700},".hljs-deletion,.hljs-number,.hljs-quote,.hljs-selector-class,.hljs-selector-id,.hljs-string,.hljs-template-tag,.hljs-type":{color:"#800"},".hljs-section,.hljs-title":{color:"#800",fontWeight:700},".hljs-link,.hljs-operator,.hljs-regexp,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-symbol,.hljs-template-variable,.hljs-variable":{color:"#ab5656"},".hljs-literal":{color:"#695"},".hljs-addition,.hljs-built_in,.hljs-bullet,.hljs-code":{color:"#397300"},".hljs-meta":{color:"#1f7199"},".hljs-meta .hljs-string":{color:"#38a"},".hljs-emphasis":{fontStyle:"italic"},".hljs-strong":{fontWeight:700}},"&.nb-markdown-table":{table:{borderCollapse:"collapse",width:"100%",fontFamily:"Arial, sans-serif",marginBottom:"1.5rem"},"th, td":{borderBottom:`1px solid ${t.colorBorderSecondary}`,padding:`${t.paddingContentVertical}px ${t.paddingContentHorizontal}px`,textAlign:"left"},th:{backgroundColor:n,fontWeight:"bold",color:t.colorText},"tr:hover":{backgroundColor:t.colorFillTertiary},"tr:last-child td":{borderBottom:"none"},"tr:first-child th":{borderTop:"none"}}},r={"&.nb-markdown-default":{"pre code.hljs":{display:"block",overflowX:"auto",padding:"1em"},"code.hljs":{padding:"3px 5px"},":not(pre) code":{padding:"2px 5px",color:"#d56161",background:t.colorFillQuaternary,border:`1px solid ${t.colorBorder}`,borderRadius:t.borderRadiusSM},".hljs":{color:"#adbac7",background:"#22272e"},".hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_":{color:"#f47067"},".hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_":{color:"#dcbdfb"},".hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable":{color:"#6cb6ff"},".hljs-meta .hljs-string,.hljs-regexp,.hljs-string":{color:"#96d0ff"},".hljs-built_in,.hljs-symbol":{color:"#f69d50"},".hljs-code,.hljs-comment,.hljs-formula":{color:"#768390"},".hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag":{color:"#8ddb8c"},".hljs-subst":{color:"#adbac7"},".hljs-section":{color:"#316dca",fontWeight:700},".hljs-bullet":{color:"#eac55f"},".hljs-emphasis":{color:"#adbac7",fontStyle:"italic"},".hljs-strong":{color:"#adbac7",fontWeight:700},".hljs-addition":{color:"#b4f1b4",backgroundColor:"#1b4721"},".hljs-deletion":{color:"#ffd8d3",backgroundColor:"#78191b"}},"&.nb-markdown-table":{table:{borderCollapse:"collapse",width:"100%",fontFamily:"Arial, sans-serif",marginBottom:"1.5rem"},"th, td":{borderBottom:`1px solid ${t.colorBorderSecondary}`,padding:`${t.paddingContentVertical}px ${t.paddingContentHorizontal}px`,textAlign:"left"},th:{backgroundColor:n,fontWeight:"bold",color:t.colorText},"tr:hover":{backgroundColor:t.colorFillTertiary},"tr:last-child td":{borderBottom:"none"},"tr:first-child th":{borderTop:"none"}}};return(0,u.css)({lineHeight:t.lineHeight,"& > *:last-child":{marginBottom:"0"},".ant-description-textarea, .ant-description-input":{lineHeight:t.lineHeight},".field-interface-datetime":{minWidth:"100px"},img:{maxWidth:"100%"},...l?r:o})};var h=l(42443);let f=e=>{let{textOnly:t,overflowMode:l,style:r}=e,i=m(),{html:d=""}=a(e.value),u=s(d),c="ellipsis"===l,p=(0,o.useRef)(null),[f,g]=(0,o.useState)(!1);(0,o.useEffect)(()=>{if(p.current){let e=p.current;g(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)}},[d,r,l]);let v={...r||{},...c?{display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal",wordBreak:"break-word",cursor:"default"}:{}},y=(0,n.jsx)("div",{ref:p,className:`${i} nb-markdown`,dangerouslySetInnerHTML:{__html:t?u:d},style:v});return c&&f?(0,n.jsx)(h.A,{title:(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:d},style:{maxHeight:500,overflowY:"auto",padding:10,color:"#000"}}),overlayInnerStyle:{background:"#fff",color:"#000",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"},color:"#fff",children:y}):y}},85352(e,t,l){"use strict";function n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Array.isArray(e)?e.map(e=>{if(e&&"object"==typeof e&&!Array.isArray(e)){let t=e,l=void 0!==t.label,n=void 0!==t.value,o=l?t.label:String(t.value??""),r=n?t.value:o,i={label:o,value:r};return t.color&&(i.color=t.color),t.icon&&(i.icon=t.icon),i}return{label:String(e),value:e}}):[]}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return Array.isArray(e)?e.map(e=>"string"==typeof(null==e?void 0:e.label)?{...e,label:t(e.label)}:e):[]}function r(e,t){if(e&&Array.isArray(e)&&0!==e.length)return o(n(e),t)}function i(e,t){let l=null==t?void 0:t.mode,n="multiple"===l||"tags"===l||(null==t?void 0:t.multiple)===!0;return Array.isArray(e)?e.filter(e=>""!==e&&null!=e):""===e||null==e?n?[]:void 0:e}function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return(Array.isArray(e)?e:null==e?[]:[e]).map(e=>{var l;let n=t.find(t=>(null==t?void 0:t.value)===e);return n?{value:e,label:n.label}:{value:e,label:(null==e||null==(l=e.toString)?void 0:l.call(e))??e}})}function s(e,t){var l,o,r,i;if(!["radioGroup","checkboxGroup","select","multipleSelect"].includes(null==t?void 0:t.interface)||Array.isArray(null==(l=e.props)?void 0:l.options)&&(null==(r=e.props)||null==(o=r.options)?void 0:o.length)>0)return!1;let a=null==(i=t.uiSchema)?void 0:i.enum;if(!Array.isArray(a)||0===a.length)return!1;let s=n(a);return!!s.length&&(e.setProps({options:s}),!0)}l.d(t,{NI:()=>s,ZY:()=>o,di:()=>r,xO:()=>i,yg:()=>a})},13940(e,t,l){"use strict";l.d(t,{E4:()=>r,Gj:()=>d,a_:()=>n,eo:()=>p,pX:()=>s,w7:()=>i});let n="__custom__";function o(e){return`${n}:${e}`}function r(e){var t;if(!e||"object"!=typeof e)return!1;let l=e;if(!(null==(t=l.isAssociationField)?void 0:t.call(l)))return!1;let n=l.type,o=l.interface;return"belongsToMany"===n||"hasMany"===n||"belongsToArray"===n||"m2m"===o||"o2m"===o||"mbm"===o}function i(e){var t;if(!e||"object"!=typeof e)return;let l=e;return l.collection||(null==(t=l.context)?void 0:t.collection)||void 0}function a(e){return"string"==typeof e?e.trim():""}function s(e){if(!e||"object"!=typeof e)return[];let t=e,l="function"==typeof t.getStepParams?t.getStepParams("fieldSettings","init"):void 0,n=l&&"object"==typeof l?l:void 0,r="function"==typeof t.getStepParams?t.getStepParams("formItemSettings","fieldSettings"):void 0,i=r&&"object"==typeof r?r:void 0,s=(null==n?void 0:n.fieldPath)??t.fieldPath,d=(null==n?void 0:n.associationPathName)??t.associationPathName,u=null==i?void 0:i.name,c=a(s),p=a(d),m=a(u),h=new Set;return c&&h.add(c),p&&(c?c.startsWith(`${p}.`)?h.add(c):h.add(`${p}.${c}`):h.add(p)),m&&h.add(o(m)),Array.from(h)}function d(e){return s(e)[0]}function u(e){if(!e||"object"!=typeof e)return[];let t=e.subModels;if(!t||"object"!=typeof t)return[];let l=t.items;if(Array.isArray(l))return l;let n=t.grid;if(!n||"object"!=typeof n)return[];let o=n.subModels;if(!o||"object"!=typeof o)return[];let r=o.items;return Array.isArray(r)?r:[]}function c(e){if(!e||"object"!=typeof e)return[];let t=e.subModels;return t&&"object"==typeof t?u(t.field):[]}function p(e,t){let l=a(t);if(!l)return null;let n=e=>{if(!Array.isArray(e))return null;for(let t of e){if(s(t).some(e=>e===l))return t;let e=n(c(t));if(e)return e}return null};return n(u(e))}},53869(e,t,l){"use strict";l.d(t,{_:()=>o});var n=l(13595);function o(e,t,l){let o;if(!l||!Array.isArray(l))return null;let r=l.find(e=>(null==e?void 0:e.value)===t),i=null==r?void 0:r.schema,a=null==i?void 0:i["x-component"];if(!a)return null;if("DateFilterDynamicComponent"===a)o=n.DateFilterDynamicComponent;else{var s;o=null==e||null==(s=e.getComponent)?void 0:s.call(e,a)}return o?{Comp:o,props:(null==i?void 0:i["x-component-props"])||{}}:null}},25359(e,t,l){"use strict";l.d(t,{ON:()=>r,jI:()=>o});let n="__saveStepParamsWithSubModels";function o(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error("[saveStepParamsWithSubModels] model is not an object");e[n]=!0}async function r(e,t){if(!e||"object"!=typeof e&&"function"!=typeof e)throw Error("[saveStepParamsWithSubModels] model is not an object");let l=e;if(!0!==l[n])return await t();if("function"!=typeof l.save)throw Error("[saveStepParamsWithSubModels] model.save is not a function");try{return await l.save()}finally{delete l[n]}}},14252(e,t,l){"use strict";l.d(t,{S0:()=>i.S0,_T:()=>i._T,s5:()=>i.s5});var n=l(11869),o=l(2077);l(96540);var r=l(2117),i=l(52717);i.S0.registerFlow({key:"buttonSettings",title:(0,n.tExpr)("Button settings"),sort:-999,steps:{general:{title:(0,n.tExpr)("Edit button"),uiSchema:e=>({title:e.model.enableEditTitle?{"x-decorator":"FormItem","x-component":"Input",title:(0,n.tExpr)("Button title")}:void 0,tooltip:e.model.enableEditTooltip?{"x-decorator":"FormItem","x-component":"Input",title:(0,n.tExpr)("Button tooltip")}:void 0,icon:e.model.enableEditIcon?{"x-decorator":"FormItem","x-component":"IconPicker",title:(0,n.tExpr)("Button icon")}:void 0,iconOnly:e.model.enableEditIcon?{"x-decorator":"FormItem","x-component":"Switch",title:(0,n.tExpr)("Icon only")}:void 0,type:e.model.enableEditType?{"x-decorator":"FormItem","x-component":"Radio.Group",title:(0,n.tExpr)("Button type"),enum:e.model.buttonTypeOptions}:void 0,danger:e.model.enableEditDanger?{"x-decorator":"FormItem","x-component":"Switch",title:(0,n.tExpr)("Danger action")}:void 0,color:e.model.enableEditColor?{"x-decorator":"FormItem","x-component":o.sk,title:(0,n.tExpr)("Color")}:void 0}),defaultParams(e){var t,l;let n=e.model.defaultProps||{};return e.model.enableEditColor?{...n,color:(null==(t=e.model.props)?void 0:t.color)??n.color??(null==(l=e.themeToken)?void 0:l.colorPrimary)}:n},handler(e,t){let{title:l,tooltip:n,...o}=t;e.model.setProps({title:e.t(l,{ns:"lm-flow-engine"}),tooltip:e.t(n,{ns:"lm-flow-engine"}),...o})}},linkageRules:{use:"actionLinkageRules"}}}),i.S0.registerFlow({key:"buttonAclSettings",steps:{aclCheck:{use:"aclCheck"}}}),i.S0.registerFlow({key:"paginationChange",on:"paginationChange",steps:{aclCheckRefresh:{use:"aclCheckRefresh"},linkageRulesRefresh:{use:"linkageRulesRefresh",defaultParams:{actionName:"actionLinkageRules",flowKey:"buttonSettings",stepKey:"linkageRules"}}}}),i.S0.registerEvents({click:{title:(0,n.tExpr)("Click"),name:"click",uiSchema:{condition:{type:"object",title:(0,n.tExpr)("Trigger condition"),"x-decorator":"FormItem","x-component":r.H}},handler:r.b}})},52717(e,t,l){"use strict";l.d(t,{S0:()=>h,_T:()=>p,s5:()=>m});var n=l(74848),o=l(11869),r=l(51103),i=l(42443),a=l(71021),s=l(40098),d=l.n(s),u=l(96540),c=l(18492);function p(e){let{t}=(0,c.B)(),l=(0,o.useFlowModel)(),r=l.context.blockModel,a=e.collection||r.collection,s=a.dataSource,p=(0,u.useMemo)(()=>{let e=`${t(s.displayName||s.key)} > `,l=a?`${t(a.title)||a.name||a.tableName} `:"";return`${e}${l}`},[]),{actionName:m}=(null==e?void 0:e.forbidden)||l.forbidden,h=(0,u.useMemo)(()=>t('The current user only has the UI configuration permission, but don\'t have "{{actionName}}" permission for collection "{{name}}"',{name:p,actionName:t(d().capitalize(m))}).replaceAll(">",">"),[m,p,t]);return(0,n.jsx)(i.A,{title:e.message||h,children:e.children})}let m={collection:"collection",record:"record",all:["collection","record"],both:["collection","record"]};class h extends o.FlowModel{static _getScene(){return d().castArray(this.scene||[])}static _isScene(e){return this._getScene().includes(e)}getAclActionName(){return null}onInit(e){super.onInit(e),this.context.defineProperty("actionName",{get:()=>this.getAclActionName(),cache:!1})}getInputArgs(){let e={},t=[];if(this.context.resource){let l=this.context.resource.getSourceId();l&&(e.sourceId=l,t.push("sourceId"))}if(this.context.collection&&this.context.record){let l=this.context.collection.getFilterByTK(this.context.record);l&&(e.filterByTk=l,t.push("filterByTk"))}return t.length&&(e.defaultInputKeys=t),e}onClick(e){this.dispatchEvent("click",{event:e,...this.getInputArgs()},{debounce:!0})}getTitle(){return this.props.title}getIcon(){return this.props.icon}renderButton(){let{iconOnly:e,...t}=this.props,l=this.getIcon()?(0,n.jsx)(r.In,{type:this.getIcon()}):void 0;return(0,n.jsx)(a.Ay,{...t,onClick:this.onClick.bind(this),icon:l,children:e?null:t.children||this.getTitle()})}render(){return this.props.tooltip?(0,n.jsx)(i.A,{title:this.props.tooltip,children:this.renderButton()}):this.renderButton()}renderHiddenInConfig(){let{iconOnly:e,...t}=this.props,l=this.getIcon()?(0,n.jsx)(r.In,{type:this.getIcon()}):void 0;return this.forbidden?(0,n.jsx)(p,{children:(0,n.jsx)(a.Ay,{...t,onClick:this.onClick.bind(this),icon:l,style:{opacity:"0.3"},children:e?null:t.children||this.getTitle()})}):(0,n.jsx)(i.A,{title:this.context.t("The button is hidden and only visible when the UI Editor is active"),children:(0,n.jsx)(a.Ay,{...t,onClick:this.onClick.bind(this),icon:l,style:{opacity:"0.3"},children:e?null:t.children||this.getTitle()})})}constructor(...e){super(...e),this.defaultProps={type:"default",title:(0,o.tExpr)("Action"),iconOnly:!1},this.enableEditTooltip=!0,this.enableEditTitle=!0,this.enableEditIcon=!0,this.enableEditType=!0,this.enableEditDanger=!0,this.enableEditColor=!1,this.buttonTypeOptions=[{value:"default",label:'{{t("Default")}}'},{value:"primary",label:'{{t("Primary")}}'},{value:"dashed",label:'{{t("Dashed")}}'},{value:"link",label:'{{t("Link")}}'},{value:"text",label:'{{t("Text")}}'}]}}},15892(e,t,l){"use strict";l.d(t,{P:()=>v,z:()=>y});var n=l(74848),o=l(95243),r=l(11869),i=l(40098),a=l.n(i),s=l(96540),d=l(42443),u=l(39580),c=l(2117),p=l(92275),m=l(18492),h=l(27941);let f=()=>{let{t:e}=(0,m.B)(),t=(0,r.useFlowModel)(),l=t.context.blockModel.collection,o=l.dataSource,i=(0,s.useMemo)(()=>{let t=`${e(o.displayName||o.key)} > `,n=l?`${e(l.title)||l.name||l.tableName} `:"";return`${t}${n}`},[]),{actionName:d}=t.forbidden,u=(0,s.useMemo)(()=>e('The current user only has the UI configuration permission, but don\'t have "{{actionName}}" permission for collection "{{name}}"',{name:i,actionName:e(a().capitalize(d))}).replaceAll(">",">"),[d,i,e]);return(0,n.jsx)(h.t,{children:(0,n.jsx)(p.Ay,{status:"403",subTitle:u})})};function g(){let{t:e}=(0,m.B)(),t=(0,r.useFlowModel)(),l=t.dataSource,o=(0,s.useMemo)(()=>{let n=`${e(l.displayName||l.key)} > `,o=t.resource.resourceName;return`${n}${o}`},[]),i=(0,s.useMemo)(()=>e('The {{type}} "{{name}}" may have been deleted. Please remove this {{blockType}}.',{type:e("Collection"),name:o,blockType:e("Block")}).replaceAll(">",">"),[o,e]);return(0,n.jsx)(h.t,{children:(0,n.jsx)(p.Ay,{status:"404",subTitle:i})})}let v={new:"new",one:"one",many:"many",select:"select",filter:"filter",oam:["one","many"],subForm:"subForm",bulkEditForm:"bulkEditForm"};class y extends r.FlowModel{setFilterActive(e,t){this.activeFilterSources.set(e,t)}hasActiveFilters(){let e=this.resource;if(e&&e.filter&&Object.keys(e.filter).length>0)return!0;for(let[,e]of this.activeFilterSources)if(e)return!0;return!1}removeFilterSource(e){this.activeFilterSources.delete(e)}getDataLoadingMode(){var e;let t=this.getStepParams("dataLoadingModeSettings");return(null==t||null==(e=t.dataLoadingMode)?void 0:e.mode)||"auto"}static _getScene(){return a().castArray(this.scene||[])}static _isScene(e){return this._getScene().includes(e)}getModelClassName(e){return Object.keys(this.customModelClasses).includes(e)?this.customModelClasses[e]:this._defaultCustomModelClasses[e]||e}renderHiddenInConfig(){return this.forbidden?(0,n.jsx)(f,{}):(0,n.jsx)(d.A,{title:this.context.t("The block is hidden and only visible when the UI Editor is active"),children:(0,n.jsx)(u.tn,{ref:this.context.ref,...this.decoratorProps,style:{opacity:"0.3"},children:(0,n.jsx)(this.ObservedRenderComponent,{})})})}onInit(e){super.onInit(e),this.context.defineProperty("blockModel",{value:this}),this.context.defineMethod("getModelClassName",e=>this.getModelClassName(e)),this.ObservedRenderComponent=(0,r.observer)(()=>this.renderComponent(),{displayName:"ObservedRenderComponent"})}setDecoratorProps(e){Object.assign(this.decoratorProps,e)}get title(){return this._title||(this._title=this.defaultBlockTitle()),this._title}defaultBlockTitle(){var e;return`${this.translate((null==(e=this.constructor.meta)?void 0:e.label)||this.constructor.name)}`}renderComponent(){throw Error("renderComponent method must be implemented in subclasses of BlockModel")}render(){return this.collectionRequired&&!this.context.collection?(0,n.jsx)(g,{}):(0,n.jsx)(u.tn,{ref:this.context.ref,...this.decoratorProps,children:(0,n.jsx)(this.ObservedRenderComponent,{})})}constructor(...e){super(...e),this.decoratorProps=(0,o.observable)({}),this._defaultCustomModelClasses={},this.customModelClasses={},this.collectionRequired=!1,this.ObservedRenderComponent=null,this.activeFilterSources=new Map}}y.registerFlow({key:"cardSettings",title:(0,r.tExpr)("Card settings"),steps:{titleDescription:{title:(0,r.tExpr)("Title & description"),uiSchema:{title:{"x-component":"Input","x-decorator":"FormItem",title:(0,r.tExpr)("Title")},description:{"x-component":"Input.TextArea","x-decorator":"FormItem",title:(0,r.tExpr)("Description")}},handler(e,t){let l=e.t(t.title,{ns:"lm-flow-engine"}),n=e.t(t.description,{ns:"lm-flow-engine"});e.model.setDecoratorProps({title:l,description:n})}},linkageRules:{use:"blockLinkageRules"},blockHeight:{use:"blockHeight"}}}),y.define({hide:!0,label:(0,r.tExpr)("Other blocks")}),r.FlowModel.registerEvents({beforeRender:{title:(0,r.tExpr)("Before render"),name:"beforeRender",uiSchema:{condition:{type:"object",title:(0,r.tExpr)("Trigger condition"),"x-decorator":"FormItem","x-component":c.H}},handler:c.b}})},72380(e,t,l){"use strict";l.d(t,{U:()=>r});var n=l(11869),o=l(14252);class r extends o.S0{}r.define({children:async e=>(await (0,n.buildSubModelItems)(o.S0)(e)).filter(t=>e.engine.getModelClass(t.useModel)._isScene(o.s5.collection))})},52175(e,t,l){"use strict";l.d(t,{t:()=>d});var n=l(11869),o=l(40098),r=l.n(o),i=l(42632),a=l(94130),s=l(5679);class d extends s.R{onMount(){super.onMount(),this.previousBeforeRenderHash=this.context.location.search}getDirtyTrackingVersion(e,t,l,n){var o;let r=new Set,i=(null==l||null==(o=l.getResourceName)?void 0:o.call(l))||n.associationName||n.collectionName;i&&r.add(String(i)),n.associationName&&r.add(String(n.associationName)),n.collectionName&&r.add(String(n.collectionName));let a=0;for(let l of r)a+=e.getDataSourceDirtyVersion(t,l);return a}onActive(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.hidden&&this.previousBeforeRenderHash!==this.context.location.search&&(this.rerender(),!e)||this.hidden)return;let t=this.context.resource;if(!t)return;let l=this.getResourceSettingsInitParams(),n=t.getDataSourceKey()||l.dataSourceKey||"main",o=this.context.engine,r=this.getDirtyTrackingVersion(o,n,t,l);if(e){if(this.dirtyRefreshing)return;this.dirtyRefreshing=!0,t.refresh().then(()=>{this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(o,n,t,l)}).catch(()=>{}).finally(()=>{this.dirtyRefreshing=!1});return}this.isManualRefresh||null!==this.lastSeenDirtyVersion&&r===this.lastSeenDirtyVersion||this.dirtyRefreshing||(this.dirtyRefreshing=!0,t.refresh().then(()=>{this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(o,n,t,l)}).catch(()=>{}).finally(()=>{this.dirtyRefreshing=!1}))}static filterCollection(e){return!!e.filterTargetKey}static isCollectionAvailable(e){if(!e)return!1;let t=(0,a.b1)(this);return(0,a.F3)(e,t)}static async defineChildren(e){let t=t=>{var l;if(!(null==(l=this.meta)?void 0:l.createModelOptions))return t||{};if("function"==typeof this.meta.createModelOptions){let l=this.meta.createModelOptions(e);return r().merge({},l,t)}return r().merge({},this.meta.createModelOptions,t)},l=e=>this.name+e,{dataSourceKey:o,collectionName:i,associationName:a,filterByTk:s}=e.view.inputArgs,d=e.dataSourceManager.getDataSources().map(e=>0===e.getCollections().length?null:{key:l(`ds-${e.key}`),label:e.displayName,searchable:!0,searchPlaceholder:(0,n.tExpr)("Search"),children:n=>e.getCollections().map(n=>{if(!this.filterCollection(n)||!this.isCollectionAvailable(n))return null;let o={dataSourceKey:n.dataSourceKey,collectionName:n.name};return{key:l(`ds-${e.key}.${n.name}`),label:n.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:o}}})}}).filter(Boolean)}).filter(Boolean),u=e=>1===d.length?d[0].children(e):d;if(!i)return u(e);if(this._isScene("select")){let n={dataSourceKey:o,collectionName:i};a&&(n.associationName=a,n.sourceId="{{ctx.view.inputArgs.sourceId}}");let r=e.dataSourceManager.getCollection(o,i),s=[];return this.isCollectionAvailable(r)&&s.push({key:l("current-collection"),label:"Current collection",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:n}}})}),s.push({key:l("others-collections"),label:"Other collections",children:u(e)}),s}if(this._isScene("new")){let n={dataSourceKey:o,collectionName:i};a&&(n.associationName=a,n.sourceId="{{ctx.view.inputArgs.sourceId}}");let r=[],d=e.dataSourceManager.getCollection(o,i);return this.isCollectionAvailable(d)&&r.push({key:l("current-collection"),label:"Current collection",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:n}}})}),null!=s&&r.push({key:l("associated"),label:"Associated records",children:()=>e.dataSourceManager.getCollection(o,i).getAssociationFields(this._getScene()).map(e=>{if(!e.targetCollection||"belongsToArray"===e.type||!this.filterCollection(e.targetCollection)||!this.isCollectionAvailable(e.targetCollection))return null;let n=`{{ctx.popup.record.${e.sourceKey||e.collection.filterTargetKey}}}`;e.sourceKey===e.collection.filterTargetKey&&(n="{{ctx.view.inputArgs.filterByTk}}");let r={dataSourceKey:o,collectionName:e.target,associationName:e.resourceName,sourceId:n};return{key:l(`associated-${e.name}`),label:e.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}}).filter(Boolean)}),r.push({key:l("others-collections"),label:"Other collections",children:u(e)}),r}let c=[{key:l("associated"),label:"Associated records",children:()=>e.dataSourceManager.getCollection(o,i).getAssociationFields(this._getScene()).map(e=>{if(!e.targetCollection||"belongsToArray"===e.type||!this.filterCollection(e.targetCollection)||!this.isCollectionAvailable(e.targetCollection))return null;let n=`{{ctx.popup.record.${e.sourceKey||e.collection.filterTargetKey}}}`;e.sourceKey===e.collection.filterTargetKey&&(n="{{ctx.view.inputArgs.filterByTk}}");let r={dataSourceKey:o,collectionName:e.target,associationName:e.resourceName,sourceId:n};return{key:l(`associated-${e.name}`),label:e.title,useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})}}).filter(Boolean)},{key:l("others-records"),label:"Other records",children:u(e)}];if(this._isScene("one")){let n=e.dataSourceManager.getCollection(o,i);if(!n||!this.filterCollection(n)||!this.isCollectionAvailable(n))return c;let r={dataSourceKey:o,collectionName:i,filterByTk:"{{ctx.view.inputArgs.filterByTk}}"};a&&(r.associationName=a,r.sourceId="{{ctx.view.inputArgs.sourceId}}"),c.unshift({key:l("current-record"),label:"Current record",useModel:this.name,createModelOptions:t({stepParams:{resourceSettings:{init:r}}})})}return c}get dataSource(){return this.context.dataSource}get collection(){return this.context.collection}get resource(){return this.context.resource}get association(){return this.context.association}get associationField(){return this.context.association}getAclActionName(){return"view"}async getFilterFields(){return this.collection.getFields().filter(e=>e.filterable)}getResourceSettingsInitParams(){return this.getStepParams("resourceSettings","init")}onInit(e){super.onInit(e),this.context.defineProperty("blockModel",{value:this}),this.context.defineProperty("actionName",{get:()=>this.getAclActionName(),cache:!1}),this.context.defineProperty("resourceName",{get:()=>this.resource.getResourceName(),cache:!1}),this.context.defineProperty("dataSource",{get:()=>{let e=this.getResourceSettingsInitParams();return this.context.dataSourceManager.getDataSource(e.dataSourceKey)}}),this.context.defineProperty("collection",{get:()=>{let e=this.getResourceSettingsInitParams();return this.context.dataSourceManager.getCollection(e.dataSourceKey,e.collectionName)}}),this.context.defineProperty("resource",{get:()=>{let e=this.getResourceSettingsInitParams(),t=this.createResource(this.context,e);t.setDataSourceKey(e.dataSourceKey),t.setResourceName(e.associationName||e.collectionName);let l=()=>{var l;let n=this.context.engine;if(!(null==n?void 0:n.getDataSourceDirtyVersion))return;let o=(null==(l=t.getDataSourceKey)?void 0:l.call(t))||e.dataSourceKey||"main";this.lastSeenDirtyVersion=this.getDirtyTrackingVersion(n,o,t,e)};return l(),t.on("refresh",()=>{l(),this.invalidateFlowCache("beforeRender")}),t}}),this.context.defineProperty("association",{get:()=>{let e=this.getResourceSettingsInitParams();if(e.associationName)return this.dataSource.getAssociation(e.associationName)}})}createResource(e,t){throw Error("createResource method must be implemented in subclasses of CollectionBlockModel")}refresh(){return this.resource?this.resource.refresh():super.refresh()}defaultBlockTitle(){var e,t,l,n,o,r,a;let s=this.translate((null==(e=this.constructor.meta)?void 0:e.label)||this.constructor.name),d=(null==(t=this.dataSource)?void 0:t.displayName)||(null==(l=this.dataSource)?void 0:l.key),u=(null==(r=this.context)||null==(o=r.dataSourceManager)||null==(n=o.getDataSources)?void 0:n.call(o).length)||0,c=null==(a=this.collection)?void 0:a.title;if(this.association){let e=this.resource.getResourceName(),t=this.dataSource.getCollection(e.split(".")[0]);return(0,i.l)({blockLabel:s,dsName:d,dsCount:u,collectionTitle:c,sourceCollectionTitle:t.title,associationTitle:this.association.title})}return(0,i.l)({blockLabel:s,dsName:d,dsCount:u,collectionTitle:c})}addAppends(e){var t,l;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)if(e.includes(".")){let[l,o]=e.split("."),r=this.context.dataSourceManager.getCollectionField(`${this.collection.dataSourceKey}.${this.collection.name}.${l}`);if(!r)return;let i=r.target;if(!i)return;let a=this.context.dataSourceManager.getCollectionField(`${this.collection.dataSourceKey}.${i}.${o}`);if(a&&a.isAssociationField()){if(this.resource.addAppends(e),(null==(t=a.targetCollection)?void 0:t.template)==="tree"){let t=e.includes(".")?e.slice(e.lastIndexOf(".")+1):e;a.name===t&&this.resource.addAppends(`${e}.parent(recursively=true)`)}n&&this.resource.refresh()}}else{if(!this.collection)return;let t=this.context.dataSourceManager.getCollectionField(`${this.collection.dataSourceKey}.${this.collection.name}.${e}`);if(!t)return;t.isAssociationField()&&(this.resource.addAppends(t.name),(null==(l=t.targetCollection)?void 0:l.template)==="tree"&&this.resource.addAppends(`${t.name}.parent(recursively=true)`),n&&this.resource.refresh())}}constructor(...e){super(...e),this.isManualRefresh=!1,this.collectionRequired=!0,this.lastSeenDirtyVersion=null,this.dirtyRefreshing=!1}}d.registerFlow({key:"resourceSettings",sort:-999,steps:{collectionCheck:{handler(e){e.collection||e.exitAll()}},aclCheck:{use:"aclCheck"},init:{handler(e,t){if(!t.dataSourceKey)throw Error("dataSourceKey is required");if(!t.collectionName)throw Error("collectionName is required");Object.keys(t).includes("sourceId")&&e.resource.setSourceId(t.sourceId),Object.keys(t).includes("filterByTk")&&e.resource.setFilterByTk(t.filterByTk)}}}}),d.registerFlow({key:"refreshSettings",sort:1e4,steps:{refresh:{async handler(e){let t=e.model,l=e.model.context.filterManager,o=(null==l?void 0:l.prepareFiltersForTarget)?await l.prepareFiltersForTarget(e.model.uid):void 0;l&&l.bindToTarget(e.model.uid);let r=t.getDataLoadingMode(),i=t.resource;if(i instanceof n.MultiRecordResource&&"manual"===r&&!t.hasActiveFilters()){i.setData([]),i.setMeta({count:0,hasNext:!1,page:1}),i.loading=!1;return}null==o||o.forEach(t=>{var l;null==t||null==(l=t.markInitialTargetRefreshHandled)||l.call(t,e.model.uid)}),e.model.isManualRefresh?e.model.resource.loading=!1:await e.model.resource.refresh()}}}}),d.registerFlow({key:"dataLoadingModeSettings",sort:800,title:(0,n.tExpr)("Set data loading mode"),steps:{dataLoadingMode:{use:"dataLoadingMode"}}}),d.define({hide:!0})},5679(e,t,l){"use strict";l.d(t,{R:()=>r});var n=l(11869),o=l(15892);class r extends o.z{}r.define({hide:!0,label:(0,n.tExpr)("Data blocks"),async children(e){let t=await (0,n.buildSubModelItems)(r)(e),{collectionName:l,filterByTk:o,scene:i}=e.view.inputArgs;return t.filter(t=>{var n,r,a,s,d,u,c;let p=e.engine.getModelClass(t.useModel);return"select"===i?null==(s=p._isScene)?void 0:s.call(p,"select"):"subForm"===i?null==(d=p._isScene)?void 0:d.call(p,"subForm"):"bulkEditForm"===i?null==(u=p._isScene)?void 0:u.call(p,"bulkEditForm"):"new"===i||l&&!o?null==(c=p._isScene)?void 0:c.call(p,"new"):!p._isScene||!(null==(n=p._isScene)?void 0:n.call(p,"select"))&&!(null==(r=p._isScene)?void 0:r.call(p,"subForm"))&&!(null==(a=p._isScene)?void 0:a.call(p,"bulkEditForm"))})}})},81486(e,t,l){"use strict";l.d(t,{o:()=>o});var n=l(11869);class o extends n.FlowModel{static resolveUse(e,t,l){var n,o;let r=null==e||null==(o=e.stepParams)||null==(n=o.fieldBinding)?void 0:n.use;return r&&r!==(null==e?void 0:e.use)?r:null==e?void 0:e.use}}},33297(e,t,l){"use strict";l.d(t,{L:()=>r});var n=l(11869),o=l(14252);class r extends o.S0{}r.define({children:async e=>(await (0,n.buildSubModelItems)(o.S0)(e)).filter(t=>e.engine.getModelClass(t.useModel)._isScene(o.s5.record))})},58428(e,t,l){"use strict";l.d(t,{GO:()=>v,KW:()=>x,Z1:()=>f,eu:()=>g,nF:()=>h,zL:()=>s});var n=l(74848),o=l(11869),r=l(96540),i=l(72380),a=l(33297);let s="assignFieldValues";function d(e){let t=null==e?void 0:e.collection;return t&&"object"==typeof t?t:void 0}function u(e){let t=d(e),l=null==t?void 0:t.dataSourceKey,n=null==t?void 0:t.name;return l&&n?{dataSourceKey:l,collectionName:n}:void 0}function c(e,t){let l=(null==e?void 0:e.collection)||d(t),n=null==l?void 0:l.dataSourceKey,o=null==l?void 0:l.name;return n&&o?{dataSourceKey:n,collectionName:o}:void 0}function p(e){if(!e||"object"!=typeof e)return!1;let t=e;return"string"==typeof t.dataSourceKey&&!!t.dataSourceKey&&"string"==typeof t.collectionName&&!!t.collectionName}function m(e){var t,l,n,o,r,i,a,s;null==e||null==(l=e.context)||null==(t=l.removeCache)||t.call(l,"dataSource"),null==e||null==(o=e.context)||null==(n=o.removeCache)||n.call(o,"collection"),null==e||null==(i=e.context)||null==(r=i.removeCache)||r.call(i,"resource"),null==e||null==(s=e.context)||null==(a=s.removeCache)||a.call(s,"association")}function h(e){return{async:!0,use:"AssignFormModel",stepParams:{resourceSettings:{init:u(e)}}}}function f(e,t){var l,n;let o=(null==(l=(n=e.model).getStepParams)?void 0:l.call(n,t,s))||{};return{assignedValues:(null==o?void 0:o.assignedValues)||{}}}async function g(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"AssignFieldValues";try{return await (0,o.resolveRunJSObjectValues)(e,t)}catch(t){var n,r,i;return console.error(`[${l}] RunJS execution failed`,t),null==(i=e.message)||null==(r=i.error)||r.call(i,(null==(n=e.t)?void 0:n.call(e,"RunJS execution failed"))||"RunJS execution failed"),null}}function v(e,t){return t&&"object"==typeof t&&Object.keys(t).length?{...e,...t}:e}function y(e){let{model:t,blockModel:l}=(0,o.useFlowSettingsContext)(),d=t,u=(0,o.useFlowEngine)(),[h,f]=r.useState(null);return(0,r.useEffect)(()=>{let n=!1;return(async()=>{var o,r,h,g,v;let y=c(l,null==d?void 0:d.context),x=await u.loadOrCreateModel(y?{parentId:d.uid,subKey:"assignForm",use:"AssignFormModel",stepParams:{resourceSettings:{init:y}}}:{parentId:d.uid,subKey:"assignForm",use:"AssignFormModel"},{skipSave:!t.context.flowSettingsEnabled});if(n)return;if(p(y)){let e=null==(h=x.getStepParams)?void 0:h.call(x,"resourceSettings","init");p(e)&&e.dataSourceKey===y.dataSourceKey&&e.collectionName===y.collectionName||null==(v=x.setStepParams)||v.call(x,"resourceSettings","init",y),m(x),m(null==(g=x.subModels)?void 0:g.grid)}let b=(null==(o=d.getStepParams)?void 0:o.call(d,e.settingsFlowKey,s))||{};x.setInitialAssignedValues((null==b?void 0:b.assignedValues)||{});let S=t instanceof i.U&&!(t instanceof a.L);(e.clearRecordContext||S)&&(null==(r=x.context)?void 0:r.defineProperty)&&x.context.defineProperty("record",{get:()=>void 0,cache:!1}),f(x),d.assignFormUid=(null==x?void 0:x.uid)||d.assignFormUid})(),()=>{n=!0}},[d,l,u,t,t.context.flowSettingsEnabled,e.clearRecordContext,e.settingsFlowKey]),h?(0,n.jsx)(o.FlowModelRenderer,{model:h,showFlowSettings:!1}):null}function x(e){return{title:e.title||(0,o.tExpr)("Assign field values"),uiSchema:()=>({tip:e.tipComponent?{"x-decorator":"FormItem","x-component":e.tipComponent}:void 0,editor:{"x-decorator":"FormItem","x-component":()=>(0,n.jsx)(y,{settingsFlowKey:e.settingsFlowKey,clearRecordContext:e.clearRecordContext})}}),async beforeParamsSave(t){var l,n,o,r,i,a,d;let u=t.model.assignFormUid?null==(l=(n=t.engine).getModel)?void 0:l.call(n,t.model.assignFormUid,!0):void 0;if(!u)return;e.validateBeforeSave&&await (null==(d=u.form)||null==(a=d.validateFields)?void 0:a.call(d));let c=(null==(o=u.getAssignedValues)?void 0:o.call(u))||{};null==(r=(i=t.model).setStepParams)||r.call(i,e.settingsFlowKey,s,{assignedValues:c})},handler(){}}}},13595(e,t,l){"use strict";l.r(t),l.d(t,{DateFilterDynamicComponent:()=>k});var n=l(74848),o=l(96540),r=l(35710),i=l(71500),a=l(84626),s=l(36492),d=l(63718),u=l(22803),c=l(11869),p=l(2077),m=l(96436),h=l(37985),f=l(40098),g=l.n(f);let v=e=>e?e.replace(/\s*HH?:mm(?::ss)?(?:\.SSS)?/g,"").trim():e,y=(e,t)=>{if(!e)return null;if(m.dayjs.isDayjs(e))return e;if("string"==typeof e&&e.endsWith("Z")){let l=(0,m.dayjs)(e).format(t),n=(0,m.dayjs)(l,t);return n.isValid()?n:(0,m.dayjs)(e)}let l=(0,m.dayjs)(e,t);if(l.isValid())return l;let n=(0,m.dayjs)(e);return n.isValid()?n:null},x=e=>{let{value:t,picker:l="date",format:r,showTime:i,timeFormat:a}=e,s=(0,c.useFlowEngine)(),d=s.translate.bind(s),u=(0,p.fD)(),f=[{label:d("Today"),value:u.today},{label:d("Last week"),value:u.lastWeek},{label:d("This week"),value:u.thisWeek},{label:d("Next week"),value:u.nextWeek},{label:d("Last month"),value:u.lastMonth},{label:d("This month"),value:u.thisMonth},{label:d("Next month"),value:u.nextMonth},{label:d("Last quarter"),value:u.lastQuarter},{label:d("This quarter"),value:u.thisQuarter},{label:d("Next quarter"),value:u.nextQuarter},{label:d("Last year"),value:u.lastYear},{label:d("This year"),value:u.thisYear},{label:d("Next year"),value:u.nextYear},{label:d("Last 7 days"),value:u.last7Days},{label:d("Next 7 days"),value:u.next7Days},{label:d("Last 30 days"),value:u.last30Days},{label:d("Next 30 days"),value:u.next30Days},{label:d("Last 90 days"),value:u.last90Days},{label:d("Next 90 days"),value:u.next90Days}],x=t?(0,p.Pn)(null==t?void 0:t[0],l):l,b=x===l&&r?r:(0,m.getPickerFormat)(x),S="date"===x?v(b):b,w=(0,m.getDateTimeFormat)(x,S,i,a),C={utc:!0,presets:f,...e,format:w,picker:x,showTime:!!i&&{defaultValue:[(0,m.dayjs)("00:00:00","HH:mm:ss"),(0,m.dayjs)("23:59:59","HH:mm:ss")]}},F=(0,o.useMemo)(()=>g().castArray(e.value).map(e=>y(e,w)),[e.value,w]);return(0,n.jsx)(h.A.RangePicker,{...C,style:{flex:1,...null==C?void 0:C.style},value:F})},b=e=>e?e.replace(/\s*HH?:mm(?::ss)?(?:\.SSS)?/g,"").trim():e,S=(e,t)=>{if(!e)return null;if(m.dayjs.isDayjs(e))return e;if("string"==typeof e&&e.endsWith("Z")){let l=(0,m.dayjs)(e).format(t),n=(0,m.dayjs)(l,t);return n.isValid()?n:(0,m.dayjs)(e)}let l=(0,m.dayjs)(e,t);if(l.isValid())return l;let n=(0,m.dayjs)(e);return n.isValid()?n:null},w=e=>{let{picker:t="date",format:l,showTime:r,timeFormat:i,onChange:d}=e,u=(0,c.useFlowContext)(),f=Array.isArray(e.value)?e.value[0]:e.value,g=f?(0,p.Pn)(f,t):t,[v,y]=(0,o.useState)(g),x=u.model.translate.bind(u.model),w=e=>{let n=e===t&&l?l:(0,m.getPickerFormat)(e),o="date"===e?b(n):n;return(0,m.getDateTimeFormat)(e,o,r,i)},C=(0,o.useMemo)(()=>w(v),[l,t,r,v,i]),F=(0,o.useMemo)(()=>S(f,C),[f,C]),k={utc:!0,inputReadOnly:u.isMobileLayout,...e,underFilter:!0,showTime:!!r&&{defaultValue:(0,m.dayjs)("00:00:00","HH:mm:ss")},format:C,picker:v};return(0,n.jsxs)(a.A.Compact,{style:{width:"100%"},children:[(0,n.jsx)(s.A,{style:{width:"100px"},popupMatchSelectWidth:!1,value:v,options:[{label:x("Date"),value:"date"},{label:x("Month"),value:"month"},{label:x("Quarter"),value:"quarter"},{label:x("Year"),value:"year"}],onChange:e=>{let t=w(e),l=C;if(y(e),!f||!d)return;let n=S(f,l);n&&n.isValid()&&d(n,n.format(t))}}),(0,n.jsx)(h.A,{...k,style:{flex:1,...null==k?void 0:k.style},value:F})]})},C=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=[{value:"exact",label:e("Exact day")},{value:"past",label:e("Past")},{value:"next",label:e("Next")},{value:"today",label:e("Today")},{value:"yesterday",label:e("Yesterday")},{value:"tomorrow",label:e("Tomorrow")},{value:"thisWeek",label:e("This Week")},{value:"lastWeek",label:e("Last Week")},{value:"nextWeek",label:e("Next Week")},{value:"thisMonth",label:e("This Month")},{value:"lastMonth",label:e("Last Month")},{value:"nextMonth",label:e("Next Month")},{value:"thisQuarter",label:e("This Quarter")},{value:"lastQuarter",label:e("Last Quarter")},{value:"nextQuarter",label:e("Next Quarter")},{value:"thisYear",label:e("This Year")},{value:"lastYear",label:e("Last Year")},{value:"nextYear",label:e("Next Year")}];return t&&l.splice(3,0,{value:"now",label:e("Now")}),l},F=e=>{let{isRange:t,defaultValue:l,onChange:r,...i}=e,a=(0,o.useCallback)((e,t)=>r(t),[r]);return t?(0,n.jsx)(x,{...i,onChange:a}):(0,n.jsx)(w,{...i,onChange:a})},k=e=>{let{value:t,onChange:l,includeNow:p=!1,...m}=e,h=(0,c.useFlowEngine)(),f=h.translate.bind(h),{token:g}=r.A.useToken(),[v,y]=(0,o.useState)(!1),x=(0,o.useMemo)(()=>C(f,p),[f,p]),b=e=>{if(y(!1),"exact"===e)return l(void 0);let t={type:e};["past","next"].includes(e)&&(t.number=1,t.unit="day"),l(t)},S=()=>{let e=x.slice(0,3),t=x.slice(3),l=(0,u.css)`
|
|
2890
2890
|
padding: 3px 10px;
|
|
2891
2891
|
cursor: pointer;
|
|
2892
2892
|
white-space: nowrap;
|
|
@@ -3340,4 +3340,4 @@ ${r.join("\n")}`:""}function k(e){let t=String((null==e?void 0:e.message)||"");i
|
|
|
3340
3340
|
${i.join("\n")}`:""}function j(e,t){let l=Error(t);l.cause=e;try{let t="string"==typeof(null==e?void 0:e.name)?e.name:"";t&&(l.name=t)}catch(e){}try{let n="string"==typeof(null==e?void 0:e.stack)?e.stack:"";if(n){let e=String(n).split("\n");e.length&&(e[0]=`${l.name}: ${t}`,l.stack=e.join("\n"))}}catch(e){}return l}function M(e){if(!e)return null;let t=d.get(e);if(t)return t;if("function"!=typeof e.createElement)return null;let l=e.Component;if("function"!=typeof l)return null;class n extends l{static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e){try{var t,l,n;let o=null==(t=this.props)?void 0:t.enhanceReactError,r="function"==typeof o?o(e):e,i=String((null==r?void 0:r.message)||"");if(i&&/\[RunJS Hint\]/.test(i)){console.error(i);let e=null==(n=this.props)||null==(l=n.ctx)?void 0:l.logger;e&&"function"==typeof e.error&&e.error(i)}}catch(e){}}componentDidUpdate(e){var t,l;(null==e?void 0:e.resetKey)!==(null==(t=this.props)?void 0:t.resetKey)&&(null==(l=this.state)?void 0:l.error)&&this.setState({error:void 0})}render(){var t,l;let n=null==(t=this.state)?void 0:t.error;if(!n)return this.props.children;let o="";try{let e=null==(l=this.props)?void 0:l.enhanceReactError,t="function"==typeof e?e(n):n;o=String((null==t?void 0:t.message)||t||(null==n?void 0:n.message)||n||"")}catch(e){o=String((null==n?void 0:n.message)||n||"")}let r={boxSizing:"border-box",padding:12,borderRadius:6,border:"1px solid #ffccc7",background:"#fff2f0",color:"#a8071a",fontSize:12,lineHeight:1.5,maxWidth:"100%",overflow:"auto"},i={margin:0,whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace'},a={fontWeight:600,marginBottom:8};return e.createElement("div",{style:r},e.createElement("div",{style:a},"RunJS render error"),e.createElement("pre",{style:i},o))}constructor(...e){super(...e),this.state={}}}return d.set(e,n),n}function I(e){let{ctx:t,vnode:l,enhanceReactError:n,resetKey:o}=e,r=null==t?void 0:t.React,i=M(r);return i?r.createElement(i,{ctx:t,enhanceReactError:n,resetKey:o},l):l}function T(e){var t;let{ctx:l,entry:n,containerEl:r,rootMap:i,unmountContainerRoot:a,enhanceReactError:s,internalReact:d,internalAntd:u}=e;if(!(!(null==(t=l.ReactDOM)?void 0:t.__nbRunjsInternalShim)&&l.React&&l.React!==d&&l.antd&&l.antd!==u&&void 0!==l.antd.ConfigProvider)){if(n.disposeTheme){try{n.disposeTheme()}catch(e){}n.disposeTheme=void 0}return!1}let c=()=>{var e,t,o,r,i,a,s;null==l||null==(t=l.engine)||null==(e=t.context)||e.themeToken;let d=null==l||null==(r=l.engine)||null==(o=r.context)?void 0:o.antdConfig,u=(null==l||null==(s=l.engine)||null==(a=s.context)||null==(i=a.locales)?void 0:i.antd)||(null==d?void 0:d.locale),c=l.antd.ConfigProvider,p=l.antd.App,m={popupMatchSelectWidth:!1,locale:u||{}};d&&"object"==typeof d&&(void 0!==d.direction&&(m.direction=d.direction),"string"==typeof d.prefixCls&&(m.prefixCls=d.prefixCls),"string"==typeof d.iconPrefixCls&&(m.iconPrefixCls=d.iconPrefixCls),"function"==typeof d.getPopupContainer&&(m.getPopupContainer=d.getPopupContainer),d.theme&&"object"==typeof d.theme&&(m.theme=d.theme));let h=n.lastVnode,f=p?l.React.createElement(c,m,l.React.createElement(p,null,h)):l.React.createElement(c,m,h);n.root.render(f)};return n.disposeTheme?c():n.disposeTheme=(0,o.autorun)(()=>{try{if(r&&1===r.nodeType&&"boolean"==typeof r.isConnected&&!r.isConnected&&n.wasConnected)return void queueMicrotask(()=>{i.get(r)===n&&a()});r&&1===r.nodeType&&"boolean"==typeof r.isConnected&&r.isConnected&&(n.wasConnected=!0),c()}catch(e){throw s(e)}}),!0}function R(e){let{ctx:t,entry:l,vnode:n,containerEl:o,rootMap:r,unmountContainerRoot:i,internalReact:a,internalAntd:s}=e,d=e=>{let l=String((null==e?void 0:e.message)||e||"");if(!l||/\[RunJS Hint\]/.test(l))return e;let n=/invalid hook call/i.test(l),o=k(e);if(!n&&!o)return e;let r=F({ctx:t,internalReact:a,internalAntd:s})||P({ctx:t,internalReact:a,internalAntd:s,err:e});return r?j(e,`${l}${r}`):e};try{return l.__nbRunjsRenderSeq=(l.__nbRunjsRenderSeq||0)+1,l.lastVnode=I({ctx:t,vnode:n,enhanceReactError:d,resetKey:l.__nbRunjsRenderSeq}),T({ctx:t,entry:l,containerEl:o,rootMap:r,unmountContainerRoot:i,enhanceReactError:d,internalReact:a,internalAntd:s})||l.root.render(l.lastVnode),l.root}catch(e){throw d(e)}}},44476(e,t,l){"use strict";l.d(t,{H:()=>d,a:()=>u});var n=l(2543),o=l.n(n),r=l(35846);function i(e){if(!e)return;let t=e.match(/^([^.[]+)/);return null==t?void 0:t[1]}function a(e,t){var l;if(!e||!t)return;let n=e.getField(t);return n||((null==(l=e.getFields)?void 0:l.call(e))||[]).find(e=>e.name===t)}function s(e,t){if(null!=e){if(Array.isArray(t)){if("object"!=typeof e||!e)return;let l={};for(let n of t){let t=e[n];if(null==t)return;l[n]=t}return l}if("string"==typeof e||"number"==typeof e)return e;if("object"==typeof e)return e[t]}}function d(e,t){return l=>{if(!l||!l.includes("."))return!1;let n=i(l);if(!n)return!1;let r=a(e(),n);if(!(null==r?void 0:r.isAssociationField()))return!1;if("function"==typeof t){let e=t();if(e&&"object"==typeof e&&void 0!==o().get(e,l))return!1}return!0}}function u(e,t,l){let n=(0,r.H)(e,t,!0),o=async()=>{let t=await n();return t?{...t,buildVariablesParams:t=>{var n;let o=e(),r=l(t);if(!o||!r||"object"!=typeof r)return{};let i={};for(let e of(null==(n=o.getFields)?void 0:n.call(o))||[]){let t=e.name;if(!t||!e.isAssociationField())continue;let l=e.target,n=e.targetCollection;if(!l||!n)continue;let o=n.filterTargetKey,a=r[t];if(null!=a)if(Array.isArray(a)){let e=a.map(e=>s(e,o)).filter(e=>null!=e);e.length&&(i[t]={collection:l,dataSourceKey:n.dataSourceKey,filterByTk:e})}else{let e=s(a,o);null!=e&&(i[t]={collection:l,dataSourceKey:n.dataSourceKey,filterByTk:e})}}return i}}:null};return o.title=t,o}},35846(e,t,l){"use strict";l.d(t,{H:()=>d});let n=["belongsTo","hasOne","hasMany","belongsToMany","belongsToArray"],o=["integer","float","double","decimal"];function r(e,t){return!!(e.interface&&(t||e.filterable))}function i(e,t){let l=s(e);if(e.isAssociationField()){let n=e.targetCollection;return n?{type:"object",...l,properties:async()=>{let e={};return n.fields.forEach(l=>{r(l,t)&&(e[l.name]=i(l,t))}),e}}:{type:"object",...l}}return{type:a(e),...l}}function a(e){let t=e.type;if(n.includes(t))return"object";if(o.includes(t))return"number";switch(t){case"boolean":return"boolean";case"json":return"object";case"array":return"array";default:return"string"}}function s(e){return{title:e.title||e.name,interface:e.interface,options:e.options,uiSchema:e.uiSchema||{}}}function d(e,t,l){let n=async()=>{let n="function"==typeof e?e():e;return n?{type:"object",title:t||n.title||n.name,properties:async()=>{let e={};return n.fields.forEach(t=>{r(t,l)&&(e[t.name]=i(t,l))}),e}}:null};return n.title=t,n}},62572(e,t,l){"use strict";l.d(t,{v:()=>o});var n=l(29007);async function o(e,t){if(null==t||!t.defineProperties&&!t.defineMethods)return e;let l=new n.cB;l.addDelegate(e);let o=l.createProxy(),r=o,i=e,a=t=>{let l=Reflect.get(i,t,i);return"function"==typeof l?l.bind(e):l},s=e=>"defineProperty"===e||"defineMethod"===e||Reflect.has(r,e)||Reflect.has(i,e),d=new Proxy(o,{get:(e,t,n)=>"string"==typeof t?"defineProperty"===t?(e,t)=>l.defineProperty(e,t):"defineMethod"===t?(e,t,n)=>l.defineMethod(e,t,n):Reflect.has(r,t)?Reflect.get(r,t,n):a(t):Reflect.get(r,t,n),set:(e,t,l)=>Reflect.set(i,t,l),has:(e,t)=>s(t),getOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(r,t)||Object.getOwnPropertyDescriptor(i,t)});if(t)for(let e of Array.isArray(t)?t:[t]){if(!e)continue;let t=e.defineProperties;if(t){let e="function"==typeof t?await t(d):t;if(!e||"object"!=typeof e)throw TypeError("defineProperties must return an object of PropertyOptions");for(let[t,n]of Object.entries(e)){if(!n||"object"!=typeof n)throw TypeError(`defineProperties['${t}'] must be a PropertyOptions object`);l.defineProperty(t,n)}}let n=e.defineMethods;if(n){let e="function"==typeof n?await n(d):n;if(!e||"object"!=typeof e)throw TypeError("defineMethods must return an object of functions");for(let[t,n]of Object.entries(e)){if("function"!=typeof n)throw TypeError(`defineMethods['${t}'] must be a function`);l.defineMethod(t,n)}}}return new Proxy(o,{get:(t,l,n)=>"string"==typeof l?"defineProperty"===l?(t,l)=>e.defineProperty(t,l):"defineMethod"===l?(t,l,n)=>e.defineMethod(t,l,n):Reflect.has(r,l)?Reflect.get(r,l,n):a(l):Reflect.get(r,l,n),set:(e,t,l)=>Reflect.set(i,t,l),has:(e,t)=>s(t),getOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(r,t)||Object.getOwnPropertyDescriptor(i,t)})}},31108(e,t,l){"use strict";l.d(t,{VD:()=>r,sy:()=>n,zz:()=>o});class n extends Error{constructor(e,t,l){super(l||`Flow '${e}' on model '${t}' exited via ctx.exit().`),this.name="FlowExitException",this.flowKey=e,this.modelUid=t}}class o extends Error{constructor(e,t,l){super(l||`Flow '${e}' on model '${t}' exited via ctx.exitAll().`),this.name="FlowExitAllException",this.flowKey=e,this.modelUid=t}}class r extends Error{constructor(e="Flow settings save cancelled."){super(e),this.name="FlowCancelSaveException"}}},37242(e,t,l){"use strict";l.d(t,{pM:()=>e2,Fv:()=>i,ju:()=>j.ju,MI:()=>d,vq:()=>e1.v,yz:()=>N,M5:()=>er,X4:()=>ei,Vv:()=>es,E2:()=>ec,lW:()=>a,n2:()=>T,FA:()=>p,J3:()=>ep,vP:()=>j.vP,ME:()=>y,H9:()=>A.H,ey:()=>ed.ey,KB:()=>q,JE:()=>H,kl:()=>o,u4:()=>n,UX:()=>j.UX,XM:()=>k,AP:()=>I,mP:()=>ey,zz:()=>u.zz,D1:()=>ed.D1,gG:()=>m.gG,I2:()=>ed.I2,af:()=>P.a,mv:()=>m.mv,QP:()=>c,Xh:()=>ed.Xh,$S:()=>j.$S,EI:()=>e8,_:()=>ed._,qI:()=>C,wx:()=>g.w,Z8:()=>D,ln:()=>S,zE:()=>e3,yp:()=>e5.y,y4:()=>eo,$n:()=>ev,VD:()=>u.VD,ji:()=>e0,WJ:()=>r,i:()=>e5.i,hz:()=>ea,MZ:()=>s,sy:()=>u.sy,YB:()=>M,xI:()=>j.xI,$X:()=>en,o7:()=>w,mH:()=>eZ,M:()=>m.M,nN:()=>j.nN,GZ:()=>E,Hi:()=>P.H,pc:()=>j.pc,_3:()=>F,DX:()=>el,XU:()=>j.XU});let n="flow-engine",o={DATA:"dataBlocks",FILTER:"filterBlocks",OTHER:"otherBlocks"},r={data:{key:o.DATA,label:"Data blocks",type:"group",hasCurrentFlowContext:!0},filter:{key:o.FILTER,label:"Filter blocks",type:"group",hasCurrentFlowContext:!1},other:{key:o.OTHER,label:"Other blocks",type:"group",hasCurrentFlowContext:!1}},i={CURRENT_RECORD:"currentRecord",ASSOCIATION_RECORDS:"associationRecords",OTHER_RECORDS:"otherRecords",OTHER_COLLECTIONS:"otherCollections",CURRENT_COLLECTIONS:"currentCollections"};function a(e){var t;return(null==(t=e.flowEngine)?void 0:t.translate)?(t,l)=>e.flowEngine.translate(t,{ns:[n,"client"],nsMode:"fallback",...l}):e=>e}function s(e,t){return t?`{{t(${JSON.stringify(e)}, ${JSON.stringify(t)})}}`:`{{t(${JSON.stringify(e)})}}`}function d(e,t){return s(e,t)}var u=l(31108);function c(e){return e}function p(e,t){if(e===t)return!1;if(e.prototype instanceof t)return!0;let l=Object.getPrototypeOf(e.prototype);for(;l&&l!==Object.prototype;){if(l.constructor===t)return!0;l=Object.getPrototypeOf(l)}return!1}var m=l(81982),h=l(27153),f=l(29007),g=l(88439);async function v(e,t){if(!e)return{};if("function"==typeof e)try{return await e(t)||{}}catch(e){return console.error("Error resolving uiSchema function:",e),{}}return e}async function y(e,t){if(!e)return"dialog";if("function"==typeof e)try{return await e(t)||"dialog"}catch(e){return console.error("Error resolving uiMode function:",e),"dialog"}return e}let x={},b=e=>{if("function"==typeof e)return!0;if(!e||"object"!=typeof e)return!1;let t=new WeakSet,l=e=>{if("function"==typeof e)return!0;if(!e||"object"!=typeof e||t.has(e))return!1;if(t.add(e),Array.isArray(e)){for(let t of e)if(l(t))return!0;return!1}for(let t of Object.keys(e))if(l(e[t]))return!0;return!1};return l(e)};function S(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},{noCache:n=!1}=l,o=e=>/\{\{.*?\}\}/g.test(e);return(t=>{let l,r=!1;if("string"==typeof t&&t.startsWith("{{")&&(r=!0,l=t),t&&"object"==typeof t&&!Array.isArray(t)){try{l=JSON.stringify(t)}catch(e){return console.warn("Failed to stringify:",e),t}let i=!!(r=o(l))&&!n&&b(t);if(x[l]&&!n&&!i)return x[l];if(i)try{return h.Schema.compile(t,e)}catch(e){return console.warn("Failed to compile with Formily Schema.compile:",e),t}}if(Array.isArray(t)){try{l=JSON.stringify(t)}catch(e){return console.warn("Failed to stringify:",e),t}let i=!!(r=o(l))&&!n&&b(t);if(x[l]&&!n&&!i)return x[l];if(i)try{return h.Schema.compile(t,e)}catch(e){return console.warn("Failed to compile with Formily Schema.compile:",e),t}}if(r){if(!l)try{return h.Schema.compile(t,e)}catch(e){return console.warn("Failed to compile with Formily Schema.compile:",e),t}try{if(n)return h.Schema.compile(t,e);return x[l]=x[l]||h.Schema.compile(t,e),x[l]}catch(l){console.log("compileUiSchema error",t,l);try{return h.Schema.compile(t,e)}catch(e){}}}return t})(t)}async function w(e,t,l){let n=new f.W5(e,t.key,"settings");(0,g.w)(n,t.steps,e,t.key),n.defineProperty("currentStep",{value:l});let o=l.uiSchema;if(l.use)try{var r;let t=null==(r=e.getAction)?void 0:r.call(e,l.use);t&&t.uiSchema&&(o=o||t.uiSchema)}catch(e){console.warn(`Failed to get action ${l.use}:`,e)}let i=await v(o||{},n);return 0===Object.keys(i).length?null:i}async function C(e,t,l){if(!l)return!0;let{hideInSettings:n}=l;if("function"==typeof n)try{let l=new f.W5(e,t.key,"settings");return(0,g.w)(l,t.steps||{},e,t.key),!!await n(l)}catch(e){return console.warn(`Error evaluating hideInSettings for event '${l.name||""}' in flow '${t.key}':`,e),!1}return!!n}async function F(e,t,l){if(!l)return!0;let n=l.hideInSettings;if(void 0===n&&l.use){var o;let t=null==(o=e.getAction)?void 0:o.call(e,l.use);n=null==t?void 0:t.hideInSettings}if("function"==typeof n)try{let o=new f.W5(e,t.key,"settings");return(0,g.w)(o,t.steps,e,t.key),o.defineProperty("currentStep",{value:l}),!!await n(o)}catch(e){return console.warn(`Error evaluating hideInSettings for step '${l.key||""}' in flow '${t.key}':`,e),!1}return!!n}async function k(e,t,l){let n;if(!l)return{disabled:!1};let o=l.disabledInSettings,r=l.disabledReasonInSettings;if((void 0===o||void 0===r)&&l.use)try{var i;let t=null==(i=e.getAction)?void 0:i.call(e,l.use);void 0===o&&(o=null==t?void 0:t.disabledInSettings),void 0===r&&(r=null==t?void 0:t.disabledReasonInSettings)}catch(e){console.warn(`Failed to get action ${l.use}:`,e)}let a=null,s=()=>(a||(a=new f.W5(e,t.key,"settings"),(0,g.w)(a,t.steps,e,t.key),a.defineProperty("currentStep",{value:l})),a),d=!1;if("function"==typeof o)try{d=!!await o(s())}catch(e){return console.warn(`Error evaluating disabledInSettings for step '${l.key||""}' in flow '${t.key}':`,e),{disabled:!1}}else d=!!o;if(!d)return{disabled:!1};if("function"==typeof r)try{let e=await r(s());null!=e&&""!==e&&(n=String(e))}catch(e){console.warn(`Error evaluating disabledReasonInSettings for step '${l.key||""}' in flow '${t.key}':`,e)}else null!=r&&""!==r&&(n=String(r));return{disabled:!0,reason:n}}var A=l(35846),P=l(44476),j=l(73398);function M(e){if("string"!=typeof e)return null;let t=e.trim(),l=/^\{\{\s*ctx(?:\.(.+?))?\s*\}\}$/,n=t.match(l);if(!n)return null;let o=n[1];return o?o.split(".").map(e=>e.trim()).filter(e=>e.length>0):[]}function I(e){return 0===e.length?"{{ ctx }}":`{{ ctx.${e.join(".")} }}`}function T(e){if("string"!=typeof e)return!1;let t=e.trim();return/^\{\{\s*ctx(?:\..+?)?\s*\}\}$/.test(t)}let R=new WeakMap;function E(e,t){R.set(e,t??null)}function N(e){return R.get(e)??null}function D(e){R.delete(e)}let B=e=>e&&"/"!==e?`/${e.replace(/^\/+/,"").replace(/\/+$/,"")}`:"/",$=e=>`/${e.replace(/^\/+/,"").replace(/\/+$/,"")}`,O=(e,t)=>{let l=B(e),n=$(t);return l===n?"":l.startsWith(`${n}/`)?l.slice(n.length+1):""},q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"/"===e)return[];let l=t.rootPrefix||"admin",n=t.basePath?O(e,t.basePath):"",o=(t.basePath?n:e).replace(/^\/+/,"").split("/").filter(Boolean);if(o.length<(t.basePath?1:2))return[];let r=[],i=null,a=0;for(t.basePath&&(i={viewUid:o[0]},a=1);a<o.length;){let e=o[a];if(e===l||"view"===e)if(i&&r.push(i),a+1<o.length)i={viewUid:o[a+1]},a+=2;else break;else if(i&&a+1<o.length){let t=o[a+1],l=t;try{l=decodeURIComponent(t)}catch(e){}switch(e){case"tab":i.tabUid=l;break;case"filterbytk":{let e=e=>{let t={};return e.split("&").forEach(e=>{let[l,n=""]=e.split("=");if(l)try{let e=decodeURIComponent(l),o=decodeURIComponent(n);t[e]=o}catch(e){t[l]=n}}),t},t=l;if(l&&(l.startsWith("{")||l.startsWith("[")))try{let e=JSON.parse(l);t=e&&"object"==typeof e&&!Array.isArray(e)?e:l}catch(e){t=l}else l&&/^[^=&]+=[^=&]*(?:&[^=&]+=[^=&]*)*$/.test(l)&&(t=e(l));i.filterByTk=t;break}case"sourceid":i.sourceId=l}a+=2}else a++}return i&&r.push(i),r};var _=l(74353),L=l.n(_);let V=/^\{\{\s*ctx\.date(?:\.(.+?))?\s*\}\}$/,z=new Set(["today","now","yesterday","tomorrow","thisWeek","lastWeek","nextWeek","thisMonth","lastMonth","nextMonth","thisQuarter","lastQuarter","nextQuarter","thisYear","lastYear","nextYear"]),K=new Set(["next","past"]),U=new Set(["day","week","month","year"]);function W(e){if("string"!=typeof e)return null;let t=e.trim().match(V);if(!t)return null;let l=String(t[1]||"");return l?l.split(".").map(e=>e.trim()).filter(Boolean):[]}function H(e){let t=G((e||[]).map(e=>String(e)));if("date"!==t[0])return!1;if(1===t.length)return!0;if("preset"===t[1])return 2===t.length||3===t.length&&z.has(t[2]);if("relative"===t[1])return 2===t.length||(3===t.length?K.has(t[2]):4===t.length?K.has(t[2])&&U.has(t[3]):5===t.length&&K.has(t[2])&&U.has(t[3])&&"number"==typeof Z(t[4]));if("exact"===t[1]){if(2===t.length)return!0;if("single"===t[2])return 3===t.length||(4===t.length?"date"===t[3]:5===t.length&&"date"===t[3]&&/^v.+/.test(t[4]));if("range"===t[2]){if(3===t.length)return!0;if(4===t.length)return"date"===t[3];if(5===t.length)return"date"===t[3]&&/^v.+/.test(t[4]);if(6===t.length)return"date"===t[3]&&/^v.+/.test(t[4])&&/^v.+/.test(t[5])}}return!1}function G(e){return"date"===e[0]?e:["date",...e]}function Y(e){let t=G(e);return`{{ ctx.${t.join(".")} }}`}function J(e){var t;let l=null==(t=globalThis)?void 0:t.Buffer;if(l&&"function"==typeof l.from)return l.from(e,"utf8").toString("base64");if("function"==typeof btoa)return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16))));throw Error("No base64 encoder available")}function X(e){var t;let l=null==(t=globalThis)?void 0:t.Buffer;if(l&&"function"==typeof l.from)return l.from(e,"base64").toString("utf8");if("function"==typeof atob)return decodeURIComponent(Array.from(atob(e)).map(e=>`%${e.charCodeAt(0).toString(16).padStart(2,"0")}`).join(""));throw Error("No base64 decoder available")}function Q(e){if(null!=e){if("string"==typeof e){let t=e.trim();return t.length?t:void 0}if(L().isDayjs(e))return e.toISOString();if(e instanceof Date)return L()(e).toISOString();if("number"==typeof e||"boolean"==typeof e)return String(e)}}function Z(e){let t=String(e||"").match(/^n(\d+)$/);if(!t)return;let l=Number(t[1]);if(Number.isFinite(l)&&!(l<=0))return l}function ee(e){let t=e.day(),l=0===t?-6:1-t;return e.add(l,"day").startOf("day")}function et(e){let t=3*Math.floor(e.month()/3);return e.month(t).startOf("month")}function el(e){return J(String(e||"")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function en(e){try{let t=String(e||"").replace(/=+$/g,"");if(!t||!/^[A-Za-z0-9_-]+$/.test(t))return;let l=t.replace(/-/g,"+").replace(/_/g,"/"),n=l.length%4==0?0:4-l.length%4,o=`${l}${"=".repeat(n)}`,r=X(o);if(el(r)!==t)return;return r}catch(e){return}}function eo(e){return"string"==typeof e&&V.test(e.trim())}function er(e){if(!H(e))return!1;let t=G((e||[]).map(e=>String(e)));return"date"===t[0]&&("preset"===t[1]?3===t.length&&z.has(t[2]):"relative"===t[1]?5===t.length&&K.has(t[2])&&U.has(t[3])&&"number"==typeof Z(t[4]):"exact"===t[1]&&"single"===t[2]&&"date"===t[3]?5===t.length&&/^v.+/.test(t[4]):"exact"===t[1]&&"range"===t[2]&&"date"===t[3]&&6===t.length&&/^v.+/.test(t[4])&&/^v.+/.test(t[5]))}function ei(e){if(!eo(e))return;let t=G(W(e)||[]);if("preset"===t[1]&&3===t.length&&z.has(t[2]))return{type:t[2]};if("relative"===t[1]&&5===t.length&&K.has(t[2])&&U.has(t[3])){let e=Z(t[4]);return"number"==typeof e?{type:t[2],unit:t[3],number:e}:void 0}if("exact"===t[1]&&"single"===t[2]&&"date"===t[3]&&5===t.length){let e=String(t[4]||"");if(!e.startsWith("v"))return;return en(e.slice(1))}if("exact"===t[1]&&"range"===t[2]&&"date"===t[3]&&6===t.length){let e=String(t[4]||""),l=String(t[5]||"");if(!e.startsWith("v")||!l.startsWith("v"))return;let n=en(e.slice(1)),o=en(l.slice(1));if(void 0===n||void 0===o)return;return[n,o]}}function ea(e){if(eo(e))return String(e).trim();if(null==e||""===e)return;if(Array.isArray(e)){let t=Q(e[0]),l=Q(e[1]);return t&&l?Y(["date","exact","range","date",`v${el(t)}`,`v${el(l)}`]):t?Y(["date","exact","single","date",`v${el(t)}`]):void 0}if("object"==typeof e&&e){let t=e,l="string"==typeof t.type?t.type:"";if("past"===l||"next"===l){let e="string"==typeof t.unit&&U.has(t.unit)?t.unit:"day",n=Number(t.number),o=Number.isFinite(n)&&n>0?Math.floor(n):1;return Y(["date","relative",l,e,`n${o}`])}if(z.has(l))return Y(["date","preset",l])}let t=Q(e);if(t)return Y(["date","exact","single","date",`v${el(t)}`])}function es(e){let t=G((e||[]).map(e=>String(e)));if("date"===t[0]){if("preset"===t[1]&&3===t.length){let e=t[2];if("now"===e)return L()().toISOString();let l=L()();return"today"===e?l.format("YYYY-MM-DD"):"yesterday"===e?l.add(-1,"day").format("YYYY-MM-DD"):"tomorrow"===e?l.add(1,"day").format("YYYY-MM-DD"):"thisWeek"===e?ee(l).format("YYYY-MM-DD"):"lastWeek"===e?ee(l.add(-1,"week")).format("YYYY-MM-DD"):"nextWeek"===e?ee(l.add(1,"week")).format("YYYY-MM-DD"):"thisMonth"===e?l.startOf("month").format("YYYY-MM-DD"):"lastMonth"===e?l.add(-1,"month").startOf("month").format("YYYY-MM-DD"):"nextMonth"===e?l.add(1,"month").startOf("month").format("YYYY-MM-DD"):"thisQuarter"===e?et(l).format("YYYY-MM-DD"):"lastQuarter"===e?et(l.add(-3,"month")).format("YYYY-MM-DD"):"nextQuarter"===e?et(l.add(3,"month")).format("YYYY-MM-DD"):"thisYear"===e?l.startOf("year").format("YYYY-MM-DD"):"lastYear"===e?l.add(-1,"year").startOf("year").format("YYYY-MM-DD"):"nextYear"===e?l.add(1,"year").startOf("year").format("YYYY-MM-DD"):void 0}if("relative"===t[1]&&5===t.length&&K.has(t[2])&&U.has(t[3])){let e=Z(t[4]);if("number"!=typeof e)return;let l="past"===t[2]?-1:1,n=t[3];return L()().add(l*e,n).format("YYYY-MM-DD")}if("exact"===t[1]&&"single"===t[2]&&"date"===t[3]&&5===t.length){let e=String(t[4]||"");if(!e.startsWith("v"))return;return en(e.slice(1))}if("exact"===t[1]&&"range"===t[2]&&"date"===t[3]&&6===t.length){let e=String(t[4]||""),l=String(t[5]||"");if(!e.startsWith("v")||!l.startsWith("v"))return;let n=en(e.slice(1)),o=en(l.slice(1));if(void 0===n||void 0===o)return;return[n,o]}}}var ed=l(51143);let eu=new Set(["code","version"]);function ec(e){if(!e||"object"!=typeof e||Array.isArray(e))return!1;let t=Object.keys(e);if(!t.includes("code")||"string"!=typeof e.code||"version"in e&&null!=e.version&&"string"!=typeof e.version)return!1;for(let e of t)if(!eu.has(e))return!1;return!0}function ep(e){return{code:String((null==e?void 0:e.code)??""),version:String((null==e?void 0:e.version)??"v1")}}function em(e){let t="",l="code";for(let n=0;n<e.length;n++){let o=e[n],r=n+1<e.length?e[n+1]:"";if("code"===l){if("/"===o&&"/"===r){t+=" ",n++,l="line";continue}if("/"===o&&"*"===r){t+=" ",n++,l="block";continue}if("'"===o){t+=" ",l="single";continue}if('"'===o){t+=" ",l="double";continue}t+=o;continue}if("line"===l){"\n"===o?(t+="\n",l="code"):t+=" ";continue}if("block"===l){"*"===o&&"/"===r?(t+=" ",n++,l="code"):t+="\n"===o?"\n":" ";continue}if("single"===l){if("\\"===o){t+=" ",n++;continue}"'"===o?(t+=" ",l="code"):t+="\n"===o?"\n":" ";continue}if("\\"===o){t+=" ",n++;continue}'"'===o?(t+=" ",l="code"):t+="\n"===o?"\n":" "}return t}function eh(e){let t="",l="code";for(let n=0;n<e.length;n++){let o=e[n],r=n+1<e.length?e[n+1]:"";if("code"===l){if("/"===o&&"/"===r){t+=" ",n++,l="line";continue}if("/"===o&&"*"===r){t+=" ",n++,l="block";continue}if("'"===o){t+=o,l="single";continue}if('"'===o){t+=o,l="double";continue}t+=o;continue}if("line"===l){"\n"===o?(t+="\n",l="code"):t+=" ";continue}if("block"===l){"*"===o&&"/"===r?(t+=" ",n++,l="code"):t+="\n"===o?"\n":" ";continue}if("single"===l){if(t+=o,"\\"===o){let l=n+1<e.length?e[n+1]:"";l&&(t+=l,n++);continue}"'"===o&&(l="code");continue}if(t+=o,"\\"===o){let l=n+1<e.length?e[n+1]:"";l&&(t+=l,n++);continue}'"'===o&&(l="code")}return t}function ef(e){let t;if(!e)return{subPath:"",wildcard:!1};let l=e;l=l.replace(/\[['"]([a-zA-Z_$][a-zA-Z0-9_$]*)['"]\]/g,".$1");let n=/\[([^\]]+)\]/g;for(;t=n.exec(l);){let e=String(t[1]??"").trim();if(!(/^\d+$/.test(e)||/^['"][a-zA-Z_$][a-zA-Z0-9_$]*['"]$/.test(e)))return{subPath:l.startsWith(".")?l.slice(1):l,wildcard:!0}}return l.startsWith(".")&&(l=l.slice(1)),{subPath:l,wildcard:!1}}function eg(e){let t=String(e||"").trim();if(!t||"ctx"===t)return null;let l=t.match(/^ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([\s\S]*)$/);if(l){let e=l[1]||"",t=ef(l[2]||"");return{varName:e,subPath:t.subPath,wildcard:t.wildcard}}let n=t.match(/^ctx\s*\[\s*(['"])([a-zA-Z_$][a-zA-Z0-9_$]*)\1\s*\]([\s\S]*)$/);if(n){let e=n[2]||"",t=ef(n[3]||"");return{varName:e,subPath:t.subPath,wildcard:t.wildcard}}return null}function ev(e){let t;if("string"!=typeof e||!e.trim())return{};let l=em(e),n=eh(e),o=new Map,r=(e,t)=>{if(!e)return;let l=o.get(e)||new Set;l.add(t||""),o.set(e,l)},i=e=>{let t=eg(e);(null==t?void 0:t.varName)&&r(t.varName,t.wildcard?"":t.subPath)},a=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g;for(;t=a.exec(l);)i(`ctx.${t[1]||""}`);let s=/ctx\s*\[\s*(['"])([a-zA-Z_$][a-zA-Z0-9_$]*)\1\s*\]((?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g;for(;t=s.exec(n);)i(`ctx['${t[2]||""}']${t[3]||""}`);let d=/ctx\.getVar\s*\(\s*(['"])((?:\\.|(?!\1)[\s\S])*)\1\s*\)/g;for(;t=d.exec(n);){let e=String(t[2]||"").replace(/\\'/g,"'").replace(/\\"/g,'"').trim();e.startsWith("ctx")&&i(e)}let u={};for(let[e,t]of o.entries())u[e]=Array.from(t);return u}async function ey(e,t){let l={};if(!t||"object"!=typeof t||Array.isArray(t))return l;for(let[n,o]of Object.entries(t))if(void 0!==o){if(ec(o)){let{code:t,version:r}=ep(o);if(!t.trim())continue;let i=await (0,ed._)(e,t,{version:r});if(!(null==i?void 0:i.success))throw Error(`RunJS execution failed for "${n}"`);void 0!==i.value&&(l[n]=i.value);continue}l[n]=o}return l}var ex=l(49773);let eb="ctx.resolveJsonTemplate",eS=/\{\{\s*ctx(?:\.|\[|\?\.)/,ew=/\bctx(?:\?\.|\.)libs\b/,eC="__runjs_templateValueToString",eF=/\b__runjs_ctx_tpl_\d+\b/,ek=/\b__runjs_templateValueToString(?:_\d+)?\b/,eA=/\b__runjs_ctx_tpl_\d+\b|\b__runjs_templateValueToString(?:_\d+)?\b/,eP=/\b__runjs_ensure_libs\b/,ej=256,eM={withTemplates:new Map,withoutTemplates:new Map};function eI(e,t){let l=e.get(t);if(void 0!==l)return e.delete(t),e.set(t,l),l}function eT(e,t,l,n){if(e.has(t)&&e.delete(t),e.set(t,l),e.size<=n)return;let o=e.keys().next().value;void 0!==o&&e.delete(o)}function eR(e){return!!e&&/[A-Za-z0-9_$]/.test(e)}function eE(e){if(!e.startsWith("{{")||!e.endsWith("}}"))return!1;let t=e.slice(2,-2).trim();return t.startsWith("ctx.")||t.startsWith("ctx[")||t.startsWith("ctx?.")}function eN(e,t){if(!e.startsWith(eb,t))return!1;let l=t>0?e[t-1]:"",n=e[t+eb.length]||"";return!(eR(l)||eR(n))}function eD(e,t){let l=t+2;for(;l<e.length;){let t=e[l];if(l+=1,"\n"===t)break}return l}function eB(e,t){let l=t+2;for(;l<e.length;){let t=e[l],n=e[l+1];if("*"===t&&"/"===n)return l+2;l+=1}return l}function e$(e,t,l){let n=t+1;for(;n<e.length;){let t=e[n];if("\\"===t){n+=2;continue}if(n+=1,t===l)break}return n}function eO(e,t){let l=t+1;for(;l<e.length;){let t=e[l];if("\\"===t){l+=2;continue}if("`"===t)return l+1;if("$"===t&&"{"===e[l+1]){l+=2;let t=1;for(;l<e.length&&t>0;){let n=e[l],o=e[l+1];if("'"===n||'"'===n){l=e$(e,l,n);continue}if("`"===n){l=eO(e,l);continue}if("/"===n&&"/"===o){l=eD(e,l);continue}if("/"===n&&"*"===o){l=eB(e,l);continue}"{"===n?t+=1:"}"===n&&(t-=1),l+=1}continue}l+=1}return l}function eq(e){if(!eS.test(e))return[];let t=[],l=0;for(;l<e.length;){let n=e.indexOf("{{",l);if(-1===n)break;let o=e.indexOf("}}",n+2);if(-1===o)break;let r=e.slice(n,o+2);eE(r)&&t.push(r),l=o+2}return t}function e_(e,t){let l=t;for(;l<e.length&&/\s/.test(e[l]);)l+=1;return l}function eL(e,t){let l=t;for(;l>=0&&/\s/.test(e[l]);)l-=1;return l}function eV(e,t){let l=t;for(;;){l=e_(e,l);let t=e[l],n=e[l+1];if("/"===t&&"/"===n){l=eD(e,l);continue}if("/"===t&&"*"===n){l=eB(e,l);continue}return l}}function ez(e){return!!e&&/[A-Za-z_$]/.test(e)}function eK(e,t){if(!ez(e[t]))return null;let l=t+1;for(;l<e.length&&eR(e[l]);)l+=1;return{name:e.slice(t,l),end:l}}function eU(e,t,l){if(e[t]!==l)return null;let n=t+1,o="";for(;n<e.length;){let t=e[n];if("\\"===t){let t=e[n+1];if(void 0===t)break;o+=t,n+=2;continue}if(t===l)return{value:o,end:n+1};o+=t,n+=1}return null}function eW(e,t){if(!e.startsWith("ctx",t))return null;let l=t>0?e[t-1]:"",n=e[t+3]||"";if(eR(l)||eR(n))return null;let o=e.slice(t+3);return o.startsWith(".libs")?t+3+5:o.startsWith("?.libs")?t+3+6:null}function eH(e,t){let l=eW(e,t);if(null===l)return null;let n=eV(e,l),o=e[n],r=e[n+1],i=e[n+2];if("?"===o&&"."===r&&"["===i){n=eV(e,n+3);let t=e[n];if("'"===t||'"'===t){let l=eU(e,n,t);if(!l)return{end:n+1};let o=eV(e,l.end);return"]"===e[o]&&(o+=1),{end:o,key:l.value}}return{end:n}}if("["===o){n=eV(e,n+1);let t=e[n];if("'"===t||'"'===t){let l=eU(e,n,t);if(!l)return{end:n+1};let o=eV(e,l.end);return"]"===e[o]&&(o+=1),{end:o,key:l.value}}return{end:n}}if("?"===o&&"."===r){n=eV(e,n+2);let t=eK(e,n);return t?{end:t.end,key:t.name}:{end:n}}if("."===o){n=eV(e,n+1);let t=eK(e,n);return t?{end:t.end,key:t.name}:{end:n}}return{end:l}}function eG(e){let t=[],l=String(e??""),n=0,o=0,r=0,i=0,a=e=>{let l=String(e??"").trim();if(!l||l.startsWith("..."))return;let n=l,o=0,r=0,i=0,a=0;for(;o<l.length;){let e=l[o],t=l[o+1];if("/"===e&&"/"===t)break;if("/"===e&&"*"===t){let e=l.indexOf("*/",o+2);o=-1===e?l.length:e+2;continue}if("'"===e||'"'===e){let t=o+1;for(;t<l.length;){let n=l[t];if("\\"===n){t+=2;continue}if(t+=1,n===e)break}o=t;continue}if("`"===e){let e=o+1;for(;e<l.length;){let t=l[e];if("\\"===t){e+=2;continue}if(e+=1,"`"===t)break}o=e;continue}if("{"===e?r+=1:"}"===e?r-=1:"["===e?i+=1:"]"===e?i-=1:"("===e?a+=1:")"===e&&(a-=1),0===r&&0===i&&0===a&&(":"===e||"="===e)){n=l.slice(0,o).trim();break}o+=1}if(!n)return;if(n.startsWith("'")||n.startsWith('"')){let e=n[0],l=eU(n,0,e);l&&t.push(l.value);return}let s=n.match(/^[A-Za-z_$][A-Za-z0-9_$]*/);s&&t.push(s[0])},s=0;for(;s<l.length;){let e=l[s],t=l[s+1];if("/"===e&&"/"===t)break;if("/"===e&&"*"===t){let e=l.indexOf("*/",s+2);s=-1===e?l.length:e+2;continue}if("'"===e||'"'===e){s=e$(l,s,e);continue}if("`"===e){s=eO(l,s);continue}"{"===e?o+=1:"}"===e?o-=1:"["===e?r+=1:"]"===e?r-=1:"("===e?i+=1:")"===e&&(i-=1),0===o&&0===r&&0===i&&","===e&&(a(l.slice(n,s)),n=s+1),s+=1}return a(l.slice(n)),t}function eY(e){if(!ew.test(e))return[];let t=new Set,l=l=>{let o=l,r=1;for(;o<e.length&&r>0;){let l=e[o],i=e[o+1];if("/"===l&&"/"===i){o=eD(e,o);continue}if("/"===l&&"*"===i){o=eB(e,o);continue}if("'"===l||'"'===l){o=e$(e,o,l);continue}if("`"===l){o=n(o+1);continue}let a=eH(e,o);if(a){a.key&&t.add(a.key),o=a.end;continue}"{"===l?r+=1:"}"===l&&(r-=1),o+=1}return o},n=t=>{let n=t;for(;n<e.length;){let t=e[n],o=e[n+1];if("\\"===t){n+=2;continue}if("`"===t)return n+1;if("$"===t&&"{"===o){n=l(n+2);continue}n+=1}return n},o=0;for(;o<e.length;){let l=e[o],r=e[o+1];if("/"===l&&"/"===r){o=eD(e,o);continue}if("/"===l&&"*"===r){o=eB(e,o);continue}if("'"===l||'"'===l){o=e$(e,o,l);continue}if("`"===l){o=n(o+1);continue}let i=eH(e,o);if(i){i.key&&t.add(i.key),o=i.end;continue}if("="===l&&"="!==r&&">"!==r&&"<"!==r){let l=eV(e,o+1);if(null!==eW(e,l)){let l=eL(e,o-1);if("}"===e[l]){let n=0,o=l;for(;o>=0;){let t=e[o];if("}"===t)n+=1;else if("{"===t&&0==(n-=1))break;o-=1}if(o>=0&&"{"===e[o])for(let n of eG(e.slice(o+1,l)))t.add(n)}}}o+=1}return Array.from(t)}function eJ(e){if(eP.test(e)||!ew.test(e))return e;let t=eY(e);return t.length?`/* __runjs_ensure_libs */
|
|
3341
3341
|
await ctx.__ensureLibs(${JSON.stringify(t)});
|
|
3342
3342
|
${e}`:e}function eX(e,t,l){let n=e_(e,l);if(":"!==e[n])return!1;let o=eL(e,t-1),r=o>=0?e[o]:"";return"{"===r||","===r}function eQ(e,t,l,n){let o=Array.from(new Set(t));if(!o.length)return e;let r=e;for(let e of o){let t=l(e);r=`(${r}).split(${JSON.stringify(e)}).join(${n}(${t}, ${JSON.stringify(e)}))`}return r}function eZ(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!eS.test(e))return e;let l=!1!==t.processBarePlaceholders,n=!1!==t.processStringLiterals;if(l&&n&&eA.test(e)||l&&!n&&eF.test(e)||!l&&n&&ek.test(e))return e;let o=new Map,r=[],i=!1,a=new Set,s=(t=>{if(!e.includes(t)&&!a.has(t))return a.add(t),t;let l=1;for(;e.includes(`${t}_${l}`)||a.has(`${t}_${l}`);)l+=1;let n=`${t}_${l}`;return a.add(n),n})(eC),d=0,u=()=>{for(;;){let t=`__runjs_ctx_tpl_${d}`;if(d+=1,!(e.includes(t)||a.has(t)))return a.add(t),t}},c=e=>{let t=o.get(e);if(t)return t;let l=u();return o.set(e,l),r.push(`const ${l} = await ctx.resolveJsonTemplate(${JSON.stringify(e)});`),l},p="",m=0,h=!1,f=0;for(;m<e.length;){let t=e[m],o=e[m+1];if("/"===t&&"/"===o){let t=eD(e,m);p+=e.slice(m,t),m=t;continue}if("/"===t&&"*"===o){let t=eB(e,m);p+=e.slice(m,t),m=t;continue}if("'"===t||'"'===t){let l=e$(e,m,t),o=e.slice(m,l);if(n&&0===f){let t=eq(o);if(t.length){i=!0;let n=eQ(o,t,c,s);p+=eX(e,m,l)?`[${n}]`:n}else p+=o}else p+=o;m=l;continue}if("`"===t){let t=eO(e,m),l=e.slice(m,t);if(n&&0===f){let n=eq(l);if(n.length){i=!0;let o=eQ(l,n,c,s);p+=eX(e,m,t)?`[${o}]`:o}else p+=l}else p+=l;m=t;continue}if(0===f&&!h&&eN(e,m)){p+=eb,m+=eb.length,h=!0;continue}if(h){if(/\s/.test(t)){p+=t,m+=1;continue}if("("===t){p+=t,m+=1,h=!1,f=1;continue}h=!1;continue}if(f>0){"("===t?f+=1:")"===t&&(f-=1),p+=t,m+=1;continue}if(l&&"{"===t&&"{"===o){let t=e.indexOf("}}",m+2);if(-1!==t){let l=e.slice(m,t+2);if(eE(l)){p+=c(l),m=t+2;continue}}}p+=t,m+=1}if(!r.length)return p;let g=[];return i&&g.push(`const ${s} = (value, placeholder) => {`," if (typeof value === 'undefined') return placeholder;"," if (typeof value === 'object' && value !== null) {"," try {"," return JSON.stringify(value);"," } catch (e) {"," return String(value);"," }"," }"," return String(value);","};"),g.push(...r),`${g.join("\n")}
|
|
3343
|
-
${p}`}async function e0(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l="string"==typeof e?e:String(e??""),n=!!t.preprocessTemplates,o=n?eM.withTemplates:eM.withoutTemplates,r=eI(o,l);if(r)return await r;let i=(async()=>{if(!n)return eJ(await (0,ex.W)(l));let e=eZ(l,{processStringLiterals:!1});return eJ(eZ(await (0,ex.W)(e),{processBarePlaceholders:!1}))})();eT(o,l,i,ej);try{return await i}catch(e){throw o.delete(l),e}}var e1=l(62572);function e2(e){if(Array.isArray(e)){let t=e.map(e=>e2(e)).filter(e=>void 0!==e);return t.length?t:void 0}if(e&&"object"==typeof e){let t={};return Object.keys(e).forEach(l=>{let n=e2(e[l]);void 0!==n&&(t[l]=n)}),Object.keys(t).length?t:void 0}return null==e||"string"==typeof e&&""===e?void 0:e}let e8=e=>"string"==typeof e.on?"beforeRender"===e.on:"object"==typeof e.on?"beforeRender"===e.on.eventName:!e.on&&!0!==e.manual;var e5=l(47684);let e4="0123456789abcdefghijklmnopqrstuvwxyz";function e3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11,l="";for(let e=0;e<t;e++)l+=e4[Math.random()*e4.length|0];return`${e}${l}`}},49773(e,t,l){"use strict";async function n(e){if(!/<[A-Za-z]|<\//.test(e))return e;try{var t;let n=await l.e("1339").then(l.bind(l,1608)),o=(null==n?void 0:n.transform)||(null==n||null==(t=n.default)?void 0:t.transform);if("function"!=typeof o)return e;let r=o(e,{transforms:["jsx"],jsxPragma:"ctx.React.createElement",jsxFragmentPragma:"ctx.React.Fragment",disableESTransforms:!0,production:!0});return(r&&(r.code||(null==r?void 0:r.output)))??e}catch(t){return e}}l.d(t,{W:()=>n})},81982(e,t,l){"use strict";l.d(t,{M:()=>m,gG:()=>i,mv:()=>a,o4:()=>p});var n=l(40542),o=l(2543),r=l.n(o);async function i(e,t){if(!e)return{};if("function"==typeof e)try{return await e(t)||{}}catch(e){return console.error("Error resolving defaultParams function:",e),{}}return e}async function a(e,t,l){if(!e)return{};if("function"==typeof e)try{return await e(t,l)||{}}catch(e){return console.error("Error resolving createModelOptions function:",e),{}}return e}let s={queue:[],timer:null,inflightByRun:new Map},d=10;function u(e){if(Array.isArray(e))return e.map(u);if(r().isPlainObject(e)){let t=Object.entries(e).map(e=>{let[t,l]=e;return[t,u(l)]});return Object.fromEntries(r().sortBy(t,e=>{let[t]=e;return t}))}return e}function c(e){try{return JSON.stringify(u(e))}catch{try{return JSON.stringify(e)}catch{return String(e)}}}function p(e,t){let l,n,o=s,r=e.runId||"GLOBAL",i=c(t),a=o.inflightByRun.get(r);a||(a=new Map,o.inflightByRun.set(r,a));let u=a.get(i);if(u)return u;let p=new Promise((e,t)=>{l=e,n=t});a.set(i,p);let m={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,ctx:e,payload:t,resolve:l,reject:n,runId:r,dedupKey:i};o.queue.push(m);let h=async()=>{var t,l,n,r,i,a;let s=o.queue.splice(0,o.queue.length);if(o.timer=null,!s.length)return;let d=null==(t=s[0].ctx)?void 0:t.api;if(!d){for(let e of s)try{e.resolve(e.payload.template)}catch(t){e.reject(t)}finally{null==(l=o.inflightByRun.get(e.runId))||l.delete(e.dedupKey)}return}try{let e=s.map(e=>({id:e.id,template:e.payload.template,contextParams:e.payload.contextParams||{}})),t=await d.request({method:"POST",url:"variables:resolve",data:{values:{batch:e}}}),l=t.data??t,r=l.data??l,i=null==r?void 0:r.results,a=Array.isArray(i)?i:Array.isArray(r)?r:[],u=new Map;for(let e of a){let t=(null==e?void 0:e.id)!=null?String(e.id):"";t&&u.set(t,null==e?void 0:e.data)}for(let e of s)try{let t=String(e.id),l=u.has(t)?u.get(t):e.payload.template;e.resolve(l)}catch(t){e.reject(t)}finally{null==(n=o.inflightByRun.get(e.runId))||n.delete(e.dedupKey)}}catch(t){for(let l of s)try{null==e||null==(i=e.logger)||null==(r=i.warn)||r.call(i,{err:t},"variables:resolve(batch) failed, fallback"),l.resolve(l.payload.template)}catch(e){l.reject(e)}finally{null==(a=o.inflightByRun.get(l.runId))||a.delete(l.dedupKey)}}};return o.timer||(o.timer=setTimeout(h,d)),p}async function m(e,t){let l=async e=>{if("string"==typeof e&&/\{\{.*?\}\}/.test(e))return await g(e,t);if(Array.isArray(e))return Promise.all(e.map(l));if(e&&"object"==typeof e){let t={};for(let[n,o]of Object.entries(e))t[n]=await l(o);return t}return e};return l(e)}async function h(e,t){let l=await f(e.trim(),t),n=await t.runjs(`return ${l}`,{t:t.t});return(null==n?void 0:n.success)?n.value:void 0}async function f(e,t){let l,n=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g,o=[],r=new Set;for(;null!==(l=n.exec(e));){let e=l[0],t=l[1],n=t.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)/);if(n){let l=n[1],i=t.substring(l.length);o.push({fullPath:e,firstKey:l,restPath:i}),r.add(l)}}if(0===o.length)return e;let i=new Map;for(let e of r)try{let l=await t[e],n=l&&!0===l.__isRecordProxy__;i.set(e,n)}catch(t){i.set(e,!1)}o.sort((e,t)=>t.fullPath.length-e.fullPath.length);let a=e;for(let{fullPath:e,firstKey:t,restPath:l}of o){let n,o=i.get(t)||!1;n=""===l?`await ctx.${t}`:o?`await (await ctx.${t})${l}`:`(await ctx.${t})${l}`;let r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=RegExp(`\\b${r}\\b`,"g");a=a.replace(s,n)}return a}async function g(e,t){let l=e=>{let t=e.trim().match(/^ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\.([a-zA-Z_$][a-zA-Z0-9_$-]*(?:\.[a-zA-Z_$][a-zA-Z0-9_$-]*)*))?$/);return t?t[2]?`${t[1]}.${t[2]}`:t[1]:null},o=async e=>{let l=e.split("."),o=l.shift();if(!o)return;let r=await t[o];return 0===l.length?r:(0,n.D)(r,l.join("."))},r=async e=>{let n=l(e);if(n){let l=await o(n);return void 0===l&&n.includes("-")?await h(e,t):l}return await h(e,t)},i=e.match(/^\s*\{\{\s*([^{}]+?)\s*\}\}\s*$/);if(i){let e=i[1];return await r(e)}let a=[...e.matchAll(/\{\{\s*(.+?)\s*\}\}/g)],s=e;for(let[e,t]of a){let l=await r(t);if(void 0!==l){let t="object"==typeof l&&null!==l?JSON.stringify(l):String(l);s=s.replace(e,t)}}return s}},47684(e,t,l){"use strict";function n(e,t){if(!e||"string"!=typeof e)throw Error("invalid url");let l=e.trim();if(l.startsWith("http://")||l.startsWith("https://"))return l;let n=window.__esm_cdn_base_url__||"https://esm.sh",o=(null==t?void 0:t.addSuffix)&&window.__esm_cdn_suffix__||"",r=n.replace(/\/$/,""),i=l.replace(/^\//,"");if(null==t?void 0:t.raw){let e=i.includes("?")?"&":"?";return`${r}/${i}${e}raw`}return`${r}/${i}${o}`}function o(e){return!!e&&"string"==typeof e&&e.split("?")[0].split("#")[0].endsWith(".css")}l.d(t,{i:()=>n,y:()=>o})},51143(e,t,l){"use strict";function n(){var e,t;let l=globalThis;if((null==(e=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:e.windowAllow)&&(null==(t=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:t.documentAllow))return l.__nocobaseRunJSSafeGlobalsRegistry;let n={windowAllow:new Set,documentAllow:new Set};return l.__nocobaseRunJSSafeGlobalsRegistry=n,n}function o(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.windowAllow.add(e)}}function r(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.documentAllow.add(e)}}function i(e){return n().windowAllow.has(e)}function a(e){return n().documentAllow.has(e)}function s(e){let t=()=>`${window.location.origin}${window.location.pathname}`,l=(e,l,n)=>{if(!(e=>{try{let l=new URL(e,t()),n=l.protocol.toLowerCase();if("about:"===n)return"about:blank"===l.href;return"http:"===n||"https:"===n}catch{return!1}})(e))throw Error("Unsafe URL: window.open only allows http/https/about:blank.");let o="_blank",r=(e=>{let t=new Set;return e&&e.split(",").map(e=>e.trim()).filter(Boolean).forEach(e=>{let l=e.split("=")[0].trim().toLowerCase();"noopener"!==l&&"noreferrer"!==l&&t.add(e)}),t.add("noopener"),t.add("noreferrer"),Array.from(t).join(",")})(n),i=window.open.call(window,e,o,r);if(i&&"opener"in i)try{i.opener=null}catch{}return i},n=(e,n)=>{let o=new URL(e,t()),r=o.protocol.toLowerCase(),i="about:"===r&&"about:blank"===o.href;if("http:"!==r&&"https:"!==r&&!i)throw Error("Unsafe URL: only http/https/about:blank are allowed.");if(i)return(null==n?void 0:n.replace)?window.location.replace("about:blank"):window.location.assign("about:blank");if(o.protocol===window.location.protocol&&o.hostname===window.location.hostname&&o.port===window.location.port)return(null==n?void 0:n.replace)?window.location.replace(o.href):window.location.assign(o.href);if(!l(o.href))throw Error("Popup blocked: cross-origin navigation is opened in a new tab.")},o=new Proxy({},{get(e,t){switch(t){case"origin":return window.location.origin;case"protocol":return window.location.protocol;case"host":return window.location.host;case"hostname":return window.location.hostname;case"port":return window.location.port;case"pathname":return window.location.pathname;case"assign":return e=>n(e,{replace:!1});case"replace":return e=>n(e,{replace:!0});case"reload":return window.location.reload.bind(window.location);case"href":throw Error("Reading location.href is not allowed.");default:throw Error(`Access to location property "${t}" is not allowed.`)}},set(e,t,l){if("href"===t)return n(String(l),{replace:!1}),!0;throw Error("Mutation on location is not allowed.")}}),r={setTimeout:window.setTimeout.bind(window),clearTimeout:window.clearTimeout.bind(window),setInterval:window.setInterval.bind(window),clearInterval:window.clearInterval.bind(window),console,Math,Date,FormData,..."u">typeof Blob?{Blob}:{},..."u">typeof URL?{URL}:{},addEventListener:addEventListener.bind(window),open:l,location:o,...e||{}};return new Proxy(Object.create(null),{get(e,t){if("string"!=typeof t)return Reflect.get(e,t);if(t in r)return r[t];if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(i(t)){let e=window[t];return"function"==typeof e?e.bind(window):e}throw Error(`Access to global property "${t}" is not allowed.`)},set(e,t,l){if("string"!=typeof t)return Reflect.set(e,t,l),!0;if(t in r)throw Error(`Mutation of global property "${t}" is not allowed.`);return e[t]=l,!0},has:(e,t)=>"string"!=typeof t?Reflect.has(e,t):!!(t in r||Object.prototype.hasOwnProperty.call(e,t)||i(t))})}function d(e){let t={createElement:document.createElement.bind(document),querySelector:document.querySelector.bind(document),querySelectorAll:document.querySelectorAll.bind(document),...e||{}};return new Proxy(Object.create(null),{get(e,l){if("string"!=typeof l)return Reflect.get(e,l);if(l in t)return t[l];if(Object.prototype.hasOwnProperty.call(e,l))return e[l];if(a(l)){let e=document[l];return"function"==typeof e?e.bind(document):e}throw Error(`Access to document property "${l}" is not allowed.`)},set(e,l,n){if("string"!=typeof l)return Reflect.set(e,l,n),!0;if(l in t)throw Error(`Mutation of document property "${l}" is not allowed.`);return e[l]=n,!0},has:(e,l)=>"string"!=typeof l?Reflect.has(e,l):!!(l in t||Object.prototype.hasOwnProperty.call(e,l)||a(l))})}function u(e){var t;let l="u">typeof window&&window.navigator||void 0,n={},o=null==l||null==(t=l.clipboard)?void 0:t.writeText;"function"==typeof o&&(n.writeText=o.bind(l.clipboard));let r={clipboard:n};return Object.defineProperty(r,"onLine",{get:()=>!!(null==l?void 0:l.onLine),enumerable:!0,configurable:!1}),Object.defineProperty(r,"language",{get:()=>null==l?void 0:l.language,enumerable:!0,configurable:!1}),Object.defineProperty(r,"languages",{get:()=>(null==l?void 0:l.languages)?[...l.languages]:void 0,enumerable:!0,configurable:!1}),Object.assign(r,e||{}),new Proxy({},{get(e,t){if(t in r)return r[t];throw Error(`Access to navigator property "${String(t)}" is not allowed.`)}})}function c(e){let t={};try{let e=u();t.navigator=e;try{t.window=s({navigator:e})}catch{}}catch{}try{t.document=d()}catch{}return e?{...t,...e}:t}async function p(e,t,l,n){if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.runjs)return e.runjs(t,c(n),l)}l.d(t,{D1:()=>u,I2:()=>c,Vm:()=>o,Xh:()=>d,_:()=>p,ey:()=>s,yz:()=>r})},22928(e,t,l){"use strict";function n(e){let t={};return Object.entries(e||{}).forEach(e=>{let[l,n]=e;null!=n&&(t[l]=n)}),t}function o(e,t,l){try{var n,o,r,i,a;let s=null==(o=e.dataSourceManager)||null==(n=o.getDataSource)?void 0:n.call(o,t||"main"),d=null==s||null==(i=s.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,l);return(null==d||null==(a=d.getPrimaryKey)?void 0:a.call(d))||"id"}catch(e){return"id"}}function r(e,t){var l,r;if(!t)return;let i=t.dataSourceKey||"main",a=t.collection||(null==(l=t.record)?void 0:l.__collectionName);if(!a)return;let s=o(e,i,a)||"id",d=void 0!==t.filterByTk?t.filterByTk:void 0!==t.id?t.id:null==(r=t.record)?void 0:r[s];if(void 0!==d)return n({collection:a,filterByTk:d,dataSourceKey:i,associationName:t.associationName,sourceId:t.sourceId,fields:t.fields,appends:t.appends})}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=e=>!!e&&"object"==typeof e&&"string"==typeof e.collection&&(void 0!==e.filterByTk||void 0!==e.id||e.record),n={},o=(t,i)=>{if(l(t)){let l=r(e,t);l&&(n[i.join(".")]=l);return}if(Array.isArray(t)){for(let e=0;e<t.length;e++)o(t[e],[...i,String(e)]);return}if(t&&"object"==typeof t){for(let[e,l]of Object.entries(t))o(l,[...i,e]);return}};return o(t,[]),Object.keys(n).length?n:void 0}l.d(t,{d:()=>i})},88439(e,t,l){"use strict";function n(e,t,l,n){let o={},r={};for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a)){let s=t[a],d={};if(s.uiSchema&&"object"==typeof s.uiSchema){for(let[e,t]of Object.entries(s.uiSchema))if(t&&"object"==typeof t){var i;let l=t;d[e]={type:l.type||"any",title:l.title||(null==(i=l["x-decorator-props"])?void 0:i.label)||e,interface:l["x-component"],uiSchema:l}}}let u=Object.keys(d).length>0;r[a]={type:"object",title:e.t(s.title)||a,display:u?"default":"none",properties:u?{params:{type:"object",title:"Parameters",display:"flatten",properties:d}}:void 0},o[a]={get params(){return l.getStepParams(n,a)||{}},get uiSchema(){return s.uiSchema},result:void 0}}e.defineProperty("steps",{get:()=>o})}l.d(t,{w:()=>n})},73398(e,t,l){"use strict";function n(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=r.exec(o));)t.add(e[1]);let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=i.exec(o));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function o(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=r.exec(o));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],o=e[3]||"";t[l].push(`${n}${o}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],o=e[2]||"";t[l].push(`[${n}]${o}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=i.exec(o));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],o=n[3]||"";t[e].push(`${l}${o}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],o=n[2]||"";t[e].push(`[${l}]${o}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}l.d(t,{xI:()=>h,vP:()=>y,$S:()=>f,pc:()=>g,Cg:()=>c,nN:()=>x,ju:()=>b,Xx:()=>m,vE:()=>p,XU:()=>u,UX:()=>v});var r=l(22928),i=l(35846),a=l(44476),s=l(2543),d=l.n(s);function u(e){var t,l,n,o;let r=e.resource,i=e.collection,a=e.record,s=(null==i?void 0:i.name)||(null==r||null==(t=r.getResourceName)?void 0:t.call(r)),d=(null==i?void 0:i.dataSourceKey)||(null==r||null==(l=r.getDataSourceKey)?void 0:l.call(r)),u=(null==r||null==(n=r.getFilterByTk)?void 0:n.call(r))??(null==i||null==(o=i.getFilterByTK)?void 0:o.call(i,a));if(!s||null==u)return;let c=String(s).split(".");return{collection:c[c.length-1],dataSourceKey:d,filterByTk:u}}function c(e){var t,l,n;let o=e.view;if(!o)return;let r=(null==o?void 0:o.inputArgs)||{},i=(null==r?void 0:r.collectionName)||(null==o||null==(t=o.record)?void 0:t.collection),a=(null==r?void 0:r.dataSourceKey)||(null==o||null==(l=o.record)?void 0:l.dataSourceKey)||"main",s=(null==r?void 0:r.filterByTk)||(null==o||null==(n=o.record)?void 0:n.filterByTk),d=null==r?void 0:r.associationName,u=null==r?void 0:r.sourceId;if(i&&null!=s)return{collection:i,dataSourceKey:a,filterByTk:s,sourceId:u,associationName:d}}function p(e,t){var l,n,o;let r=null==(l=e.inputArgs)?void 0:l.record,i=null==(n=e.collection)?void 0:n.filterTargetKey;if(!r||!i)return;let a=t.view,s=null==a||null==(o=a.inputArgs)?void 0:o.filterByTk,u=r[i];if(null!=s&&null!=u&&s===u)return d().cloneDeep(r)}function m(e,t){return l=>{var n,o,r,i;if(!("record"===l||l.startsWith("record.")))return!1;let s=t();if(!s)return!0;if("record"===l)return!1;let d=c(e),u=null==d?void 0:d.collection,p=(null==d?void 0:d.dataSourceKey)||"main";if(!u)return!0;let m=null==(o=e.dataSourceManager)||null==(n=o.getDataSource)?void 0:n.call(o,p),h=null==m||null==(i=m.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,u);if(!h)return!0;let f=(0,a.H)(()=>h,()=>s),g=l.startsWith("record.")?l.slice(7):"";return!!g&&f(g)}}function h(e,t){let l=(0,a.H)(e,()=>t());return n=>{let o=t();if(!o)return!0;if(!n)return!1;let r=e();if(!n.includes(".")){var i;let e,t=n;return r&&("function"==typeof r.getField&&(e=r.getField(t)),e||"function"!=typeof r.getFields||(e=(r.getFields()||[]).find(e=>(null==e?void 0:e.name)===t))),!!(null==e||null==(i=e.isAssociationField)?void 0:i.call(e))&&null==(null==o?void 0:o[t])}return l(n)}}async function f(e,t,l){let n=await (0,i.H)(e,t,!0)();return n?{...n,buildVariablesParams:e=>l?l(e):u(e)}:null}function g(e,t,l){let n=async()=>f(e,t,l);return n.title=t,n}function v(e,t,l){var n,o;return g(t,(null==l?void 0:l.title)?(null==(n=e.t)?void 0:n.call(e,l.title))||l.title:(null==(o=e.t)?void 0:o.call(e,"Current record"))||"Current record",e=>u(e))}let y=n,x=o;async function b(e,t){let l=Object.keys(o(t)||{});if(!l.length)return;let n={};for(let t of l){var i;let l,o=null==(i=e.getPropertyOptions)?void 0:i.call(e,t),r=null==o?void 0:o.meta;if(r){try{let t="function"==typeof r?await r():r,n=null==t?void 0:t.buildVariablesParams;"function"==typeof n&&(l=await n(e))}catch(e){continue}l&&(n[t]=l)}}return(0,r.d)(e,n)}},67778(e,t,l){"use strict";l.d(t,{sp:()=>j,bt:()=>R,U:()=>ee,N5:()=>K,xB:()=>q,mW:()=>O,fP:()=>G});var n=l(74848),o=l(96540),r=l(99418),i=l(11869),a=l(29007),s=l(52568),d=l(73398);function u(e){return null!=e}function c(e,t){if(e===t)return!0;if(!u(e)||!u(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch(l){return String(e)===String(t)}}function p(e){var t;let l=null==e||null==(t=e.navigation)?void 0:t.viewStack;return Array.isArray(l)?l:[]}function m(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p(e);if(!l.length)return -1;let n=(null==e?void 0:e.inputArgs)||{},o=(null==e||null==(t=e.navigation)?void 0:t.viewParams)||{},r=n.viewUid??o.viewUid;if(!r)return l.length-1;let i=l.map((e,t)=>({item:e,index:t})).filter(e=>{let{item:t}=e;return(null==t?void 0:t.viewUid)===r});if(!i.length)return l.length-1;let a=["filterByTk","sourceId","tabUid"],s=i[i.length-1].index,d=-1;for(let{item:e,index:t}of i){let l=0,o=!0;for(let t of a)if(u(n[t])){if(!c(null==e?void 0:e[t],n[t])){o=!1;break}l+=1}o&&l>=d&&(s=t,d=l)}return s}function h(e,t){return t??e.view}function f(e){var t;if(!e)return!1;let l=p(e),n=null==e||null==(t=e.inputArgs)?void 0:t.openerUids,o=Array.isArray(n)&&n.length>0;return m(e,l)>=1||o}function g(e,t){let l=t=>e.t(t),n=function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;return f(h(l,t))},o=async e=>{let l=h(e,t);if(!l||!f(l))return;let n=await v(e,l),o=null==n?void 0:n.resource;return(null==o?void 0:o.collectionName)&&null!=o.filterByTk?{collection:o.collectionName,dataSourceKey:o.dataSourceKey||"main",filterByTk:o.filterByTk,associationName:o.associationName,sourceId:o.sourceId}:(0,d.Cg)(e)},r=async()=>{var t,l,n,r;let i=await o(e);if(!(null==i?void 0:i.collection))return null;let a=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,i.dataSourceKey||"main");return(null==a||null==(r=a.collectionManager)||null==(n=r.getCollection)?void 0:n.call(r,i.collection))||null},i=async(l,n)=>{var o,r,i,a,s,d;try{let s=n||e,d=h(s,t),u=p(d),c=m(d,u);if(c<1||l<1)return;let f=c-l;if(f<1)return;let g=u[f];if(!(null==g?void 0:g.viewUid))return;let v=null==(o=s.engine)?void 0:o.getModel(g.viewUid,!0);if(!v)try{v=await s.engine.loadModel({uid:g.viewUid})}catch(t){null==(a=s.logger||e.logger)||null==(i=a.warn)||i.call(a,{err:t},"[FlowEngine] popup.getParentRecordRef loadModel failed")}let y=(null==v||null==(r=v.getStepParams)?void 0:r.call(v,"popupSettings","openView"))||{},x=null==y?void 0:y.collectionName,b=(null==y?void 0:y.dataSourceKey)||"main",S=(null==g?void 0:g.filterByTk)??(null==g?void 0:g.sourceId);if(!x||null==S)return;return{collection:x,dataSourceKey:b,filterByTk:S,sourceId:null==g?void 0:g.sourceId,associationName:null==y?void 0:y.associationName}}catch(t){null==(d=(null==n?void 0:n.logger)||e.logger)||null==(s=d.warn)||s.call(d,{err:t},"[FlowEngine] popup.getParentRecordRef failed");return}},a=l=>{try{let n=h(e,t),o=p(n);return m(n,o)-l>=1}catch(e){return!1}},s=t=>{let n=()=>({type:"object",title:l("Parent popup"),disabled:()=>!a(t),disabledReason:()=>a(t)?void 0:l("No parent popup"),hidden:()=>!a(t),properties:async()=>{let n=await i(t),o={};if(o.uid={type:"string",title:l("Popup uid")},n){let t=(()=>{try{var t,l,o,r;let i=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,n.dataSourceKey||"main");return(null==i||null==(r=i.collectionManager)||null==(o=r.getCollection)?void 0:o.call(r,n.collection||""))||null}catch(e){return null}})();o.record=await (0,d.$S)(()=>t,l("Popup record"),()=>n)||{type:"object",title:l("Popup record")}}else o.record={type:"object",title:l("Popup record")};return o.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},o}});return n.title=l("Parent popup"),n},u=()=>({type:"object",title:l("Current popup"),disabled:()=>!n(),hidden:()=>!n(),buildVariablesParams:async e=>{var l,r,a,s;if(!n(e))return;let d=await o(e),u=h(e,t),c=null==u?void 0:u.inputArgs,f={};if(d){let e={...d};!e.associationName&&(null==c?void 0:c.associationName)&&(e.associationName=c.associationName),void 0===e.sourceId&&void 0!==(null==c?void 0:c.sourceId)&&(e.sourceId=null==c?void 0:c.sourceId),f.record=e}try{let t=p(u);if(m(u,t)>=2){let t=f,l=1,n=await i(l,e);for(;n;)t.parent||(t.parent={}),t.parent.record=n,t=t.parent,l+=1,n=await i(l,e)}}catch(t){null==(r=e.logger)||null==(l=r.debug)||l.call(r,{err:t},"[FlowEngine] buildVariablesParams: build parent-chain failed")}try{let e=null==c?void 0:c.sourceId,t=null==c?void 0:c.associationName,l=(null==c?void 0:c.dataSourceKey)||"main";if(null!=e&&""!==e&&t&&"string"==typeof t){let n=String(t).split(".")[0];n&&(f.sourceRecord={collection:n,dataSourceKey:l,filterByTk:e})}}catch(t){null==(s=e.logger)||null==(a=s.debug)||a.call(s,{err:t},"[FlowEngine] buildVariablesParams: infer sourceRecord failed")}return f},properties:async()=>{var n,a,u,c;let f={};if(f.uid={type:"string",title:l("Popup uid")},await o(e)){let e=async()=>{let e=await r();return e?await (0,d.$S)(()=>e,l("Current popup record"),e=>o(e)):null};e.title=l("Current popup record"),e.hasChildren=!0,f.record=e}try{let o=h(e,t),r=null==o?void 0:o.inputArgs,i=null==r?void 0:r.sourceId,s=null==r?void 0:r.associationName,u=(null==r?void 0:r.dataSourceKey)||"main";if(!s||"string"!=typeof s||!s.includes(".")){let t=p(o),l=m(o,t),r=l>=0?null==t?void 0:t[l]:void 0;if(null==r?void 0:r.viewUid){let t=null==e||null==(n=e.engine)?void 0:n.getModel(r.viewUid,!0);t||(t=await e.engine.loadModel({uid:r.viewUid}));let l=(null==t||null==(a=t.getStepParams)?void 0:a.call(t,"popupSettings","openView"))||{};s=(null==l?void 0:l.associationName)||s,u=(null==l?void 0:l.dataSourceKey)||u}}if(null!=i&&""!==i&&s&&"string"==typeof s){let t=String(s).includes(".")?String(s).split(".")[0]:void 0;if(t){let n=()=>{try{var l,n,o,r;let i=null==(n=e.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);return(null==i||null==(r=i.collectionManager)||null==(o=r.getCollection)?void 0:o.call(r,t))||null}catch(e){return null}},o=await (0,d.$S)(n,l("Current popup parent record"),()=>({collection:t,dataSourceKey:u,filterByTk:i}));o&&(f.sourceRecord=o)}}}catch(t){null==(c=e.logger)||null==(u=c.debug)||u.call(c,{err:t},"[FlowEngine] popup.properties: build sourceRecord failed")}return f.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},await i(1)&&(f.parent=s(1)),f}});return u.title=l("Current popup"),u.sort=975,u}async function v(e,t){var l;let n=p(t),o=m(t,n),r=null==t||null==(l=t.inputArgs)?void 0:l.openerUids,i=Array.isArray(r)&&r.length>0;if(!(o>=1||i))return;if(!n.length){let e=(null==t?void 0:t.inputArgs)||{};if(!(e.collectionName||null!=e.filterByTk||null!=e.sourceId||e.associationName||e.viewUid))return;return{uid:e.viewUid,resource:{dataSourceKey:e.dataSourceKey||"main",collectionName:e.collectionName,associationName:e.associationName,filterByTk:e.filterByTk,sourceId:e.sourceId}}}let a=async t=>{var l,o,r,i,s,d;if(t<0||!(null==(l=n[t])?void 0:l.viewUid))return;let u=n[t].viewUid,c=null==(o=e.engine)?void 0:o.getModel(u,!0);c||(c=await (null==(d=e.engine)?void 0:d.loadModel({uid:u})));let p=(null==c||null==(r=c.getStepParams)?void 0:r.call(c,"popupSettings","openView"))||{},m=null==p?void 0:p.collectionName,h={uid:u,resource:{dataSourceKey:(null==p?void 0:p.dataSourceKey)||"main",collectionName:m,associationName:null==p?void 0:p.associationName,filterByTk:null==(i=n[t])?void 0:i.filterByTk,sourceId:null==(s=n[t])?void 0:s.sourceId}},f=await a(t-1);return f&&(h.parent=f),h};return await a(o)}function y(e,t){let l=/^(?:record|sourceRecord)(?:\.|$)|^parent(?:\.parent)*(?:\.(?:record|sourceRecord))(?:\.|$)/;e.defineProperty("popup",{get:async()=>v(e,t),meta:g(e,t),resolveOnServer:e=>{try{return!!e&&l.test(e)}catch(e){return!1}}})}var x=l(18182);let b=(0,o.forwardRef)((e,t)=>{let{afterClose:l,footer:r,header:i,hidden:a,...s}=e,[d,u]=(0,o.useState)(!0),[c,p]=(0,o.useState)(s),[m,h]=(0,o.useState)(()=>r),[f,g]=(0,o.useState)(i);(0,o.useImperativeHandle)(t,()=>({destroy:()=>{u(!1),null==l||l()},update:e=>p(t=>({...t,...e})),setFooter:e=>{h(e)},setHeader:e=>{0===Object.values(e||{}).length?g(null):g(e)}}));let v={...c,title:(null==f?void 0:f.title)||c.title,extra:null==f?void 0:f.extra,footer:void 0!==m?m:c.footer??null},y=o.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return(0,n.jsx)(x.A,{closable:!1,rootClassName:a?"nb-hidden":"",getContainer:y,...v,open:d,onCancel:c.onCancel,afterClose:()=>{null==l||l()},children:c.children})});function S(){let[e,t]=o.useState([]);return[e,o.useCallback(e=>(t(t=>[...t,e]),()=>{t(t=>t.filter(t=>t!==e))}),[])]}var w=l(16639),C=l(20616),F=l(47451);async function k(e,t){var l;return!!t.force||!1!==await (null==(l=e.beforeClose)?void 0:l.call(e,t))}function A(e,t){var l;let n=null==t?void 0:t.layoutContext,o=null==t||null==(l=t.engine)?void 0:l.context;n instanceof a.cB&&n!==t&&n!==o&&e.addDelegate(n)}let P=0;function j(){let e=o.useRef(null),t=(t,l)=>{var u,c,p;let m,h,f=null==l?void 0:l.engine;P+=1;let g=o.createRef(),v=new Promise(e=>{h=e}),x=null,S=null,j=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return x=t,null==(e=g.current)||e.setFooter(t),()=>{var e;x=null,null==(e=g.current)||e.setFooter(null)}},[t]),null},M=e=>(o.useEffect(()=>{var t;return S=e,null==(t=g.current)||t.setHeader(e),()=>{var e;S=null,null==(e=g.current)||e.setHeader(null)}},[e]),null),I=new a.cB,T=(0,F._)(l.engine),R=(0,w.eX)(f,T);I.defineProperty("engine",{value:T}),I.addDelegate(T.context),!1!==t.inheritContext?I.addDelegate(l):(I.addDelegate(l.engine.context),A(I,l));let E=!1,N={type:"dialog",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,r;if(E)return;E=!0,null==(l=t.onClose)||l.call(t),null==(n=g.current)||n.destroy(),null==m||m(),null==h||h(e);let i=null==R?void 0:R.emitter;(0,w.Z8)(i),null==i||null==(r=i.emit)||r.call(i,w.B9,{type:"dialog",viewUid:null==N||null==(o=N.inputArgs)?void 0:o.viewUid}),T.unlinkFromStack()},update:e=>{var t;return null==(t=g.current)?void 0:t.update(e)},close:async(e,l)=>{var n,o;return(!t.preventClose||!!l)&&!!await k(N,{result:e,force:l})&&(t.triggerByRouter&&(null==(o=t.inputArgs)||null==(n=o.navigation)?void 0:n.back)?t.inputArgs.navigation.back():N.destroy(e),!0)},Footer:j,Header:M,setFooter:e=>{var t;x=e,null==(t=g.current)||t.setFooter(e)},setHeader:e=>{var t;S=e,null==(t=g.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,I)}};I.defineProperty("view",{get:()=>N,resolveOnServer:(0,d.Xx)(I,()=>(0,d.vE)(l,I))}),T.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),N.destroy()}),y(I,N);let D=(0,i.observer)(()=>{var e,l,i,a;let s=o.useRef(!1),d="function"==typeof t.content?t.content(N,I):t.content,u="string"==typeof d?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(d)}}):d;return(o.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,N,I)},[]),(null==(l=t.inputArgs)||null==(e=l.hidden)?void 0:e.value)&&!s.current)?null:(s.current=!0,(0,n.jsx)(b,{className:"nb-dialog-overflow-hidden",ref:g,hidden:null==(a=t.inputArgs)||null==(i=a.hidden)?void 0:i.value,footer:x,header:S,...t,onCancel:()=>{N.close(t.result)},children:u}))},{displayName:"DialogWithContext"}),B=(null==t||null==(c=t.inputArgs)?void 0:c.viewUid)||`page-${P}`,$=(0,n.jsx)(C.I6,{engine:T,children:(0,n.jsx)(s.YQ,{context:I,children:(0,n.jsx)(D,{})})},B);return m=null==(p=e.current)?void 0:p.patchElement($),Object.assign(v,N)},l=o.useMemo(()=>({open:t}),[]),u=o.memo(o.forwardRef((e,t)=>{let[l,r]=S();return o.useImperativeHandle(t,()=>({patchElement:r}),[r]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(u,{ref:e},"dialog-holder")]}var M=l(97134),I=l(61793);let T=o.forwardRef((e,t)=>{var l;let{children:r,footer:i,title:a,extra:s,hidden:d,isMobile:u,...c}=e,[p,m]=o.useState(!0),[h,f]=o.useState(()=>i),[g,v]=o.useState({title:a,extra:s,...c.header});o.useImperativeHandle(t,()=>({destroy:()=>{m(!1)},update:e=>{Object.assign(c,e)},setFooter:e=>{f(e)},setHeader:e=>{0===Object.values(e||{}).length?v(null):v(e)}}),[]);let y=o.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return u?(0,n.jsx)(I.D,{className:d?"nb-hidden":"",visible:p,...c,footer:h,...g,onClose:c.onClose,children:r}):(0,n.jsx)(M.A,{rootClassName:d?"nb-hidden":"",closable:!1,getContainer:y,...c,open:p,footer:h,styles:{...c.styles,footer:{display:"flex",justifyContent:"flex-end",...null==(l=c.styles)?void 0:l.footer}},...g,onClose:c.onClose,children:r})});function R(){let e=o.useRef(null),t=o.useMemo(()=>i.observable.shallow({value:[]}),[]),l=o.memo(e=>{let{index:r}=e,[a,s]=o.useState(null);return(o.useEffect(()=>{(0,i.autorun)(()=>{let e=t.value;e[r]&&a!==e[r]&&s(e[r]),e[r]||s(null)})},[a,r]),a)?(0,n.jsx)(a,{children:(0,n.jsx)(l,{index:r+1})}):null});l.displayName="RenderNestedDrawer";let u=(t,l)=>{var u,c;let p,m,h=l.engine,f=o.createRef(),g=new Promise(e=>{m=e}),v=null,x=null,b=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return v=t,null==(e=f.current)||e.setFooter(t),()=>{var e;v=null,null==(e=f.current)||e.setFooter(null)}},[t]),null},S=e=>(o.useEffect(()=>{var t;return x=e,null==(t=f.current)||t.setHeader(e),()=>{var e;x=null,null==(e=f.current)||e.setHeader(null)}},[e]),null),P=new a.cB,j=(0,F._)(l.engine),M=(0,w.eX)(h,j);P.defineProperty("engine",{value:j}),P.addDelegate(j.context),!1!==t.inheritContext?P.addDelegate(l):(P.addDelegate(l.engine.context),A(P,l));let I=!1,R={type:"drawer",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,r;if(I)return;I=!0,null==(l=t.onClose)||l.call(t),null==(n=f.current)||n.destroy(),null==p||p(),null==m||m(e);let i=null==M?void 0:M.emitter;(0,w.Z8)(i),null==i||null==(r=i.emit)||r.call(i,w.B9,{type:"drawer",viewUid:null==R||null==(o=R.inputArgs)?void 0:o.viewUid}),j.unlinkFromStack()},update:e=>{var t;return null==(t=f.current)?void 0:t.update(e)},close:async(e,l)=>{var n,o;return(!t.preventClose||!!l)&&!!await k(R,{result:e,force:l})&&(t.triggerByRouter&&(null==(o=t.inputArgs)||null==(n=o.navigation)?void 0:n.back)?t.inputArgs.navigation.back():R.destroy(e),!0)},Footer:b,Header:S,setFooter:e=>{var t;v=e,null==(t=f.current)||t.setFooter(e)},setHeader:e=>{var t;x=e,null==(t=f.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,P)}};P.defineProperty("view",{get:()=>R,resolveOnServer:(0,d.Xx)(P,()=>(0,d.vE)(l,P))}),j.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),R.destroy()}),y(P,R);let E=o.memo((0,i.observer)(e=>{var l,i,a,s;let d=o.useRef(!1),u="function"==typeof t.content?t.content(R,P):t.content,c="string"==typeof u?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(u)}}):u;return(o.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,R,P)},[]),(null==(i=t.inputArgs)||null==(l=i.hidden)?void 0:l.value)&&!d.current)?(0,n.jsx)(n.Fragment,{children:e.children}):(d.current=!0,(0,n.jsxs)(T,{ref:f,...t,footer:v,header:t.header||x,hidden:null==(s=t.inputArgs)||null==(a=s.hidden)?void 0:a.value,onClose:()=>{R.close(t.result)},isMobile:P.isMobileLayout,children:[c,e.children]}))}));E.displayName="DrawerWithContext";let N=o.memo(e=>{let{children:t}=e;return(0,n.jsx)(C.I6,{engine:j,children:(0,n.jsx)(s.YQ,{context:P,children:(0,n.jsx)(E,{children:t})})})});return N.displayName="RenderDrawer",p=null==(c=e.current)?void 0:c.patchElement(N),Object.assign(g,R)},c=o.useMemo(()=>({open:u}),[]),p=o.memo(o.forwardRef((e,r)=>{let[i,a]=S();return o.useImperativeHandle(r,()=>({patchElement:a}),[a]),o.useEffect(()=>{t.value=i},[i]),(0,n.jsx)(l,{index:0})}));return[c,(0,n.jsx)(p,{ref:e},"drawer-holder")]}var E=l(40961),N=l(31333),D=l(71021);let B=(0,o.forwardRef)((e,t)=>{let[l,r]=o.useState({}),{visible:i=!0,footer:a=null,header:s=null,children:d,hidden:u,title:c,styles:p={},zIndex:m=4,onClose:h}={...e,...l},f=(0,o.useRef)(!1),g=(0,C.uf)(),[v,y]=(0,o.useState)(()=>a),[x,b]=(0,o.useState)(s);(0,o.useImperativeHandle)(t,()=>({destroy:()=>{f.current||(f.current=!0)},update:e=>{r(e)},setFooter:e=>{y(e)},setHeader:e=>{0===Object.values(e||{}).length?b(null):b(e)}}));let S=(0,o.useMemo)(()=>({display:u?"none":"flex",flexDirection:"column",height:"100%",zIndex:m}),[u,m]),w=(0,o.useMemo)(()=>{if(!x&&!c)return null;let{title:e=c,extra:t}=x||{},l=g.context.themeToken;return(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${l.paddingSM}px ${l.padding}px`,borderBottom:`1px solid ${l.colorSplit}`,backgroundColor:l.colorBgContainer,...p.header},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:l.marginXS},children:[(0,n.jsx)(D.Ay,{type:"text",size:"small",icon:(0,n.jsx)(N.A,{}),onClick:async()=>{f.current||!1!==await (null==h?void 0:h())&&(f.current=!0)},style:{color:l.colorTextTertiary}}),e&&(0,n.jsx)("div",{style:{fontSize:l.fontSizeLG,fontWeight:l.fontWeightStrong,color:l.colorText},children:e})]}),t&&(0,n.jsx)("div",{children:t})]})},[x,c,g.context.themeToken,p.header,h]),F=(0,o.useMemo)(()=>{if(!v)return null;let e=g.context.themeToken;return(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:`${e.paddingXS}px ${e.padding}px`,borderTop:`1px solid ${e.colorSplit}`,backgroundColor:e.colorBgContainer,...p.footer},children:v})},[v,g.context.themeToken,p.footer]);return i?(0,n.jsxs)("div",{style:{...S,...p.content},children:[w,(0,n.jsx)("div",{style:{flex:1,overflowY:"auto",...p.body},children:d}),F]}):null}),$=0,O="nocobase-embed-container",q="nocobaseEmbedReplacing";function _(e){return!!e&&"function"==typeof e.then}function L(e,t){e.dataset[q]="1";try{let l=t.close();if(_(l))return Promise.resolve(l).finally(()=>{delete e.dataset[q]});return delete e.dataset[q],l}catch(t){throw delete e.dataset[q],t}}function V(e,t,l){let n,o={},r=e.then(e=>{let{page:t}=e;return(n=t)&&("beforeClose"in o&&(n.beforeClose=o.beforeClose),"update"in o&&n.update(o.update),"footer"in o&&n.setFooter(o.footer),"header"in o&&n.setHeader(o.header),o.destroyed&&n.destroy(o.destroyed.result)),{page:t}});return Object.assign(r.then(e=>{let{page:t}=e;return!!t&&t}),{type:"embed",inputArgs:t,preventClose:l,Header:null,Footer:null,get beforeClose(){return(null==n?void 0:n.beforeClose)??o.beforeClose},set beforeClose(value){n?n.beforeClose=value:o.beforeClose=value},close:(e,t)=>r.then(l=>{let{page:n}=l;return!!n&&n.close(e,t)}),destroy:e=>{n?n.destroy(e):o.destroyed={result:e}},update:e=>{n?n.update(e):o.update={...o.update,...e}},setFooter:e=>{n?n.setFooter(e):o.footer=e},setHeader:e=>{n?n.setHeader(e):o.header=e}})}let z=o.memo(o.forwardRef((e,t)=>{let[l,r]=S();return o.useImperativeHandle(t,()=>({patchElement:r}),[r]),(0,n.jsx)(n.Fragment,{children:l})}));function K(){let e=o.useRef(null),t=o.useRef(null),l=o.useRef(0),r=(r,u)=>{let{target:c,content:p,preventClose:m,inheritContext:h=!0,inputArgs:f={},onOpenCancelled:g,...v}=r,x=c instanceof HTMLElement&&c.id===O,b=()=>{var l,g,b;let S,P,j,M=null==u?void 0:u.engine;$+=1;let I=o.createRef(),T=new Promise(e=>{P=e}),R=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return null==(e=I.current)||e.setFooter(t),()=>{var e;null==(e=I.current)||e.setFooter(null)}},[t]),null},N=e=>(o.useEffect(()=>{var t;return null==(t=I.current)||t.setHeader(e),()=>{var e;null==(e=I.current)||e.setHeader(null)}},[e]),null),D=new a.cB,O=(0,F._)(u.engine),_=(0,w.eX)(M,O);D.defineProperty("engine",{value:O}),D.addDelegate(O.context),h?D.addDelegate(u):(D.addDelegate(u.engine.context),A(D,u));let L=!1,V={type:"embed",inputArgs:f,preventClose:!!r.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,i,a;if(!L){if(L=!0,null==(l=r.onClose)||l.call(r),null==P||P(e),null==(n=I.current)||n.destroy(),null==S||S(),x&&t.current===V&&(t.current=null),!(x&&c instanceof HTMLElement&&(null==(o=c.dataset)?void 0:o[q])==="1")){let e=null==_?void 0:_.emitter;(0,w.Z8)(e),null==e||null==(a=e.emit)||a.call(e,w.B9,{type:"embed",viewUid:null==V||null==(i=V.inputArgs)?void 0:i.viewUid})}O.unlinkFromStack()}},update:e=>{var t;return null==(t=I.current)?void 0:t.update(e)},close:(e,t)=>L?Promise.resolve(!0):j||(j=(async()=>{try{var l,n;if(m&&!t)return j=void 0,!1;let o=await k(V,{result:e,force:t});if(L)return!0;if(!o)return j=void 0,!1;if(r.triggerByRouter&&(null==(n=r.inputArgs)||null==(l=n.navigation)?void 0:l.back))return r.inputArgs.navigation.back(),!0;return V.destroy(e),!0}catch(e){throw L||(j=void 0),e}})()),Header:N,Footer:R,setFooter:e=>{var t;null==(t=I.current)||t.setFooter(e)},setHeader:e=>{var t;null==(t=I.current)||t.setHeader(e)},navigation:null==(l=r.inputArgs)?void 0:l.navigation,get record(){return(0,d.vE)(u,D)}};D.defineProperty("view",{get:()=>V,resolveOnServer:(0,d.Xx)(D,()=>(0,d.vE)(u,D))}),y(D,V);let z=(0,i.observer)(()=>{var e,t,l,i;let a=o.useRef(!1),s=o.useMemo(()=>"function"==typeof p?p(V,D):p,[]);return(D.themeToken,o.useEffect(()=>{var e;null==(e=r.onOpen)||e.call(r,V,D)},[]),(null==(t=r.inputArgs)||null==(e=t.hidden)?void 0:e.value)&&!a.current)?null:(a.current=!0,(0,n.jsx)(B,{ref:I,hidden:null==(i=r.inputArgs)||null==(l=i.hidden)?void 0:l.value,...v,onClose:()=>V.close(r.result),children:s}))},{displayName:"PageWithContext"}),K=(null==f?void 0:f.viewUid)||`page-${$}`,U=(0,n.jsx)(C.I6,{engine:O,children:(0,n.jsx)(s.YQ,{context:D,children:(0,n.jsx)(z,{})})},K);return S=c&&c instanceof HTMLElement?null==(g=e.current)?void 0:g.patchElement(E.createPortal(U,c,K)):null==(b=e.current)?void 0:b.patchElement(U),x&&(t.current=V),Object.assign(T,V)};if(x&&t.current){let e,n=l.current+=1,o=()=>null==g?void 0:g();try{e=L(c,t.current)}catch(e){throw o(),e}if(_(e))return V(Promise.resolve(e).then(e=>!1===e||n!==l.current?(o(),{page:null}):{page:b()},e=>{throw o(),e}),f,!!r.preventClose);if(!1===e)return o(),V(Promise.resolve({page:null}),f,!!r.preventClose)}return b()};return[o.useMemo(()=>({open:r}),[]),(0,n.jsx)(z,{ref:e},"page-holder")]}var U=l(28073);let W=0,H=o.forwardRef((e,t)=>{var l,r;let{afterClose:i,content:a,placement:s,rect:d,...u}=e,[c,p]=o.useState(!0),[m,h]=o.useState({content:a,placement:s,rect:d,...u});return o.useImperativeHandle(t,()=>({destroy:()=>p(!1),update:e=>h(t=>({...t,...e})),close:(e,t)=>p(!1)})),o.useEffect(()=>{c||null==i||i()},[c,i]),(0,n.jsx)(U.A,{arrow:!1,open:c,trigger:["click"],destroyTooltipOnHide:!0,content:m.content,placement:m.placement,getPopupContainer:()=>document.querySelector("#nocobase-app-container")||document.body,onOpenChange:e=>{(e||!m.preventClose)&&(p(e),e||null==i||i())},...m,children:(0,n.jsx)("span",{style:{position:"absolute",top:((null==(l=m.rect)?void 0:l.top)??0)+window.scrollY,left:((null==(r=m.rect)?void 0:r.left)??0)+window.scrollX,width:0,height:0}})})});function G(){let e=o.useRef(null),t=t=>{var l,i;let a,s;W+=1;let{target:d,placement:u="rightTop",content:c,...p}=t,m=o.createRef(),h=(null==d||null==(l=d.getBoundingClientRect)?void 0:l.call(d))??{top:0,left:0},f=new Promise(e=>{s=e}),g={type:"popover",destroy:()=>{var e;return null==(e=m.current)?void 0:e.destroy()},update:e=>{var t;return null==(t=m.current)?void 0:t.update(e)},close:e=>{var t;null==s||s(e),null==(t=m.current)||t.close(e)}},v="function"==typeof c?c(g):c,y="string"==typeof v?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(v)}}):v,x=(0,n.jsx)(H,{ref:m,content:y,placement:u,rect:h,afterClose:()=>{var e;null==a||a(),null==(e=t.onClose)||e.call(t),null==s||s(t.result)},...p},`popover-${W}`);return a=null==(i=e.current)?void 0:i.patchElement(x),Object.assign(f,g)},l=o.useMemo(()=>({open:t}),[]),i=o.memo(o.forwardRef((e,t)=>{let[l,r]=S();return o.useImperativeHandle(t,()=>({patchElement:r}),[]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(i,{ref:e},"popover-holder")]}var Y=l(52847);function J(e){return null==e?"":e&&"object"==typeof e&&!Array.isArray(e)?encodeURIComponent(Object.entries(e).map(e=>{let[t,l]=e;return`${encodeURIComponent(String(t))}=${encodeURIComponent(String(l))}`}).join("&")):encodeURIComponent(String(e))}function X(e){return null!=e&&""!==String(e)}function Q(e){let t=e||"/admin";return`/${t.replace(/^\/+/,"").replace(/\/+$/,"")}`}function Z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=Q(t.basePath||t.prefix);if(!e||0===e.length)return l;let n=l.replace(/^\/+/,"").split("/").filter(Boolean);return e.forEach((e,t)=>{if(t>0&&n.push("view"),n.push(e.viewUid),e.tabUid&&n.push("tab",e.tabUid),null!=e.filterByTk){let t=J(e.filterByTk);t&&n.push("filterbytk",t)}X(e.sourceId)&&n.push("sourceid",String(e.sourceId))}),"/"+n.join("/")}class ee{setViewStack(e){this.viewStack=Object.freeze([...e]),this.viewParams=this.viewStack[this.viewStack.length-1]||{}}changeTo(e){let t=Z(this.viewStack.map((t,l)=>l===this.viewStack.length-1?{...t,...e}:{...t}),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(t,{replace:!0})}navigateTo(e,t){let l=Z([...this.viewStack,e],{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(l,t)}back(){let e=Z(this.viewStack.slice(0,-1),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(e,{replace:!0})}getLayoutBasePath(){var e,t;let l=null==(e=this.ctx.layout)?void 0:e.routePath;return this.basePath||(null==(t=this.ctx.layoutRoute)?void 0:t.basePathname)||((null==l?void 0:l.startsWith("/"))?l:"/admin")}constructor(e,t,l={}){this.setViewStack(t),this.ctx=e,this.basePath=l.basePath||l.layoutBasePath,(0,Y.E8)(this,{viewParams:Y.sH})}}},16639(e,t,l){"use strict";l.d(t,{B9:()=>o,FH:()=>s,HK:()=>r,Z8:()=>d,eX:()=>p,i6:()=>i,tb:()=>n});let n=Symbol.for("__NOCOBASE_VIEW_ACTIVATED_VERSION__"),o="view:activated",r="dataSource:dirty",i="__NOCOBASE_ENGINE_SCOPE__",a="view";function s(e){let t=Reflect.get(e,n),l="number"==typeof t?t:Number(t);return Number.isFinite(l)&&l>0?l:0}function d(e){let t=s(e);if(!Object.isExtensible(e))return t;let l=t+1;return Reflect.set(e,n,l),l}function u(e){return Reflect.get(e,i)===a}function c(e){let t=e,l=0;for(;t&&l++<50;){if(u(t))return t;t=t.previousEngine}}function p(e,t){if(!e)return;let l=c(e);return l||c(null==t?void 0:t.previousEngine)||e}},40542(e,t,l){"use strict";l.d(t,{D:()=>n});let n=(e,t,l)=>{if(!e)return l;let o=t.split("."),r=[],i=e,a=!1;for(let e=0;e<o.length;e++){let t=o[e];if(Array.isArray(i)){for(let t of(a=!0,i)){let i=n(t,o.slice(e).join("."),l);r=r.concat(i)}break}if((null==i?void 0:i[t])===void 0)break;i=i[t],e===o.length-1&&r.push(i)}return 0===(r=r.filter(e=>void 0!==e)).length?l:a?r.filter(e=>null!==e):r[0]}},96436(e,t,l){"use strict";l.r(t),l.d(t,{getDayRange:()=>tl,isEmptyFilter:()=>ed,sleep:()=>es,getDateVars:()=>ta,isString:()=>ee,unflatten:()=>e4,sortTree:()=>ea,forEach:()=>eA,utc2unit:()=>to,extractUsedVariablePaths:()=>tM,getValuesByPath:()=>eP,isArray:()=>et,moment2str:()=>ex,transformLiquidContext:()=>tT,isURL:()=>tC,isPortalInBody:()=>ty,extractUsedVariableNames:()=>tj,parseHTML:()=>tx,toGmt:()=>ep,isPlainObject:()=>en,lockdownSes:()=>tf,splitPathToTwoParts:()=>ts,transformFilter:()=>Y,parseSQLBindParams:()=>tN,getPickerFormat:()=>eC,nextTick:()=>er,removeNullCondition:()=>eu,CollectionsGraph:()=>V,isValidFilter:()=>eE,evaluateConditions:()=>Z,toUnit:()=>tr,BASE_BLOCKED_IDENTIFIERS:()=>tp,getFormatFromDateStr:()=>ek,removeInvalidFilterItems:()=>J,toLocal:()=>em,getDayRangeByParams:()=>_,getDefaultFormat:()=>ec,transformMultiColumnToSingleColumn:()=>tA,treeFind:()=>ei,transformSQL:()=>tD,parseFilter:()=>tt,flatten:()=>e5,getOffsetRangeByParams:()=>B,isEmpty:()=>el,offsetFromString:()=>eb,tval:()=>tg,error:()=>eL,Registry:()=>td,lodash:()=>o(),parse:()=>e$,hasEmptyValue:()=>eo,toFixedByStep:()=>eJ,getDateTimeFormat:()=>eF,showToast:()=>eH,Handlebars:()=>eI(),getLiquidContext:()=>tR,merge:()=>eU,dayjs:()=>i(),parseLiquidContext:()=>tE,uid:()=>tw,str2moment:()=>eg});var n=l(2543),o=l.n(n),r=l(74353),i=l.n(r),a=l(97375),s=l.n(a),d=l(90445),u=l.n(d),c=l(43522),p=l.n(c),m=l(37872),h=l.n(m),f=l(98867),g=l.n(f),v=l(8906),y=l.n(v),x=l(68313),b=l.n(x),S=l(21840),w=l.n(S),C=l(41816),F=l.n(C),k=l(88569),A=l.n(k),P=l(83826),j=l.n(P),M=l(8134),I=l.n(M),T=l(28623),R=l.n(T),E=l(46986),N=l.n(E);i().extend(N()),i().extend(w()),i().extend(A()),i().extend(j()),i().extend(F()),i().extend(b()),i().extend(h()),i().extend(g()),i().extend(y()),i().extend(I()),i().extend(R()),i().extend(u()),i().extend(s()),i().extend(p());let D=e=>{if(!e)return i()();if(/^[+-]\d{2}:\d{2}$/.test(e)){let[t,l,n]=e.match(/([+-])(\d{2}):(\d{2})/).slice(1),o=(60*parseInt(l)+parseInt(n))*("+"===t?1:-1);return i()().utcOffset(o)}return i()().tz(e)},B=e=>{let t,l,{type:n,unit:o="day",number:r=1,timezone:i}=e,a=D(i),s="week"===o?"isoWeek":o;if("past"===n){let e=a.startOf(s);t=e.subtract(r,o).startOf(s),l=e.subtract(1,o).endOf(s)}else if("next"===n)l=(t=a.startOf(s).add(1,o).startOf(s)).add(r-1,o).endOf(s);else throw Error(`Unsupported type: ${n}`);return[t.format("YYYY-MM-DD HH:mm:ss"),l.format("YYYY-MM-DD HH:mm:ss")]},$=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).startOf(t)},O=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).endOf(t)},q={today:e=>[$(0,"day",null==e?void 0:e.timezone),O(0,"day",null==e?void 0:e.timezone)],yesterday:e=>[$(-1,"day",null==e?void 0:e.timezone),O(-1,"day",null==e?void 0:e.timezone)],tomorrow:e=>[$(1,"day",null==e?void 0:e.timezone),O(1,"day",null==e?void 0:e.timezone)],thisWeek:e=>[$(0,"isoWeek",null==e?void 0:e.timezone),O(0,"isoWeek",null==e?void 0:e.timezone)],lastWeek:e=>[$(-1,"isoWeek",null==e?void 0:e.timezone),O(-1,"isoWeek",null==e?void 0:e.timezone)],nextWeek:e=>[$(1,"isoWeek",null==e?void 0:e.timezone),O(1,"isoWeek",null==e?void 0:e.timezone)],thisMonth:e=>[$(0,"month",null==e?void 0:e.timezone),O(0,"month",null==e?void 0:e.timezone)],lastMonth:e=>[$(-1,"month",null==e?void 0:e.timezone),O(-1,"month",null==e?void 0:e.timezone)],nextMonth:e=>[$(1,"month",null==e?void 0:e.timezone),O(1,"month",null==e?void 0:e.timezone)],thisQuarter:e=>[$(0,"quarter",null==e?void 0:e.timezone),O(0,"quarter",null==e?void 0:e.timezone)],lastQuarter:e=>[$(-1,"quarter",null==e?void 0:e.timezone),O(-1,"quarter",null==e?void 0:e.timezone)],nextQuarter:e=>[$(1,"quarter",null==e?void 0:e.timezone),O(1,"quarter",null==e?void 0:e.timezone)],thisYear:e=>[$(0,"year",null==e?void 0:e.timezone),O(0,"year",null==e?void 0:e.timezone)],lastYear:e=>[$(-1,"year",null==e?void 0:e.timezone),O(-1,"year",null==e?void 0:e.timezone)],nextYear:e=>[$(1,"year",null==e?void 0:e.timezone),O(1,"year",null==e?void 0:e.timezone)]},_=e=>{if("past"===e.type||"next"===e.type)return B(e);let t=q[e.type];if(!t)throw Error(`Unsupported type: ${e.type}`);let[l,n]=t(e);return[l.format("YYYY-MM-DD HH:mm:ss"),n.format("YYYY-MM-DD HH:mm:ss")]};var L=l(38362);class V{static graphlib(){return L}static connectedNodes(e){let t=(0,n.castArray)(e.nodes),l=(0,n.castArray)(e.excludes||[]),o=V.build(e),r=new Set;for(let e of t)for(let t of L.alg.preorder(o,e))l.includes(t)||r.add(t);return Array.from(r)}static preOrder(e){return V.graphlib().alg.preorder(V.build(e),e.node)}static build(e){let t=e.collections,l="forward"===((null==e?void 0:e.direction)||"forward"),n=new L.Graph;for(let e of t)n.setNode(e.name);for(let e of t){for(let t of e.inherits||[])l?n.setEdge(e.name,t):n.setEdge(t,e.name);for(let t of e.fields||[])if(("hasMany"===t.type||"belongsTo"===t.type||"hasOne"===t.type)&&(l?n.setEdge(e.name,t.target):n.setEdge(t.target,e.name)),"belongsToMany"===t.type){let o=t.through;l?(n.setEdge(e.name,o),n.setEdge(o,t.target)):(n.setEdge(t.target,o),n.setEdge(o,e.name))}}return n}}var z=l(81814),K=l.n(z);function U(e){return"path"in e&&"operator"in e}function W(e){return"logic"in e&&"items"in e}function H(e){let{path:t,operator:l,value:n}=e;return{[t]:{[l]:n}}}function G(e){let{logic:t,items:l}=e;return{[t]:l.map(e=>{if(U(e))return H(e);if(W(e))return G(e);throw Error("Invalid filter item type")})}}function Y(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return eu(G(e))}function J(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return e.items=e.items.filter(e=>U(e)?!!e.operator:!!W(e)&&J(e)),{...e}}function X(e,t){let{path:l,operator:n,value:o}=e;return t(l,n,o)}function Q(e,t){let{logic:l,items:n}=e;if(!n||0===n.length)return!0;let o=n.map(e=>{if(U(e))return X(e,t);if(W(e))return Q(e,t);throw Error("Invalid filter item type")});if("$and"===l)return o.every(e=>!0===e);if("$or"===l)return o.some(e=>!0===e);throw Error(`Unsupported logic operator: ${l}`)}function Z(e,t){if(!e||"object"!=typeof e)throw Error("Invalid conditions: conditions must be an object");if(!W(e))throw Error("Invalid conditions: conditions must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid conditions: items must be an array");if("function"!=typeof t)throw Error("Invalid evaluator: evaluator must be a function");return Q(e,t)}let ee=e=>"string"==typeof e,et=e=>Array.isArray(e),el=e=>en(e)?0===Object.keys(e).length:!!Array.isArray(e)&&0===e.length,en=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},eo=e=>{let t=!0;for(let l in e){if(t=!1,et(e[l])&&0===e[l].length||!e[l])return!0;if(en(e[l])||et(e[l]))return eo(e[l])}return t},er=e=>{setTimeout(e)};function ei(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return;let{childrenKey:n="children"}=l;for(let o of Array.isArray(e)?[...e]:[e]){if(t(o))return o;let e="function"==typeof n?n(o):o[n];if(Array.isArray(e)&&e.length>0){let n=ei(e,t,l);if(void 0!==n)return n}}}function ea(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children",n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return e&&Array.isArray(e)&&0!==e.length?o().orderBy(e,t,n?"asc":"desc").map(e=>e[l]&&e[l].length>0?{...e,[l]:ea(e[l],t,l,n)}:e):e}function es(e){return new Promise(t=>{setTimeout(t,e)})}function ed(e){return!!(!e||"$and"in e&&o().isEmpty(e.$and)||"$or"in e&&o().isEmpty(e.$or))}let eu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K(),l=t(e||{}),n={};for(let e in l){let t=l[e];null==t||el(t)||""===t||(n[e]=t)}let r=t.unflatten(n);for(let e in r)Array.isArray(r[e])&&(r[e]=r[e].filter(e=>null!=e));return o().isEmpty(r)?void 0:r},ec=e=>e.format?e.format:e.dateFormat?e.showTime?`${e.dateFormat} ${e.timeFormat||"HH:mm:ss"}`:e.dateFormat:"month"===e.picker?"YYYY-MM":"quarter"===e.picker?"YYYY-\\QQ":"year"===e.picker?"YYYY":"week"===e.picker?"YYYY[W]W":e.showTime?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD",ep=e=>e&&i().isDayjs(e)?`${e.format("YYYY-MM-DD")}T${e.format("HH:mm:ss.SSS")}Z`:e,em=e=>e?Array.isArray(e)?e.map(e=>e.startOf("second").toISOString()):i().isDayjs(e)?e.startOf("second").toISOString():void 0:e,eh=e=>{try{let t=parseInt(e.slice(0,4)),l=parseInt(e.slice(-1));return i()().quarter(l).year(t)}catch(e){return null}},ef=(e,t)=>{if(!e)return;let l=t.utcOffset,{gmt:n,picker:o,utc:r=!0,dateOnly:a}=t;if(!i()(e).isValid())return eh(e);if(a){let t=i()(e);if(!t.isValid())return e;let l=t.format("YYYY-MM-DD");return i().utc(l,"YYYY-MM-DD")}return r?i().isDayjs(e)?l?e.utcOffset(eb(l)):e:n?i()(e).utcOffset(0):l?i()(e).utcOffset(eb(l)):i()(e):i()(e)},eg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?e.map(e=>ef(e,t)):e?ef(e,t):e},ev=(e,t)=>"year"===t?e.format("YYYY")+"-01-01T00:00:00.000Z":"month"===t||"quarter"===t?e.format("YYYY-MM")+"-01T00:00:00.000Z":e.format("YYYY-MM-DD")+"T00:00:00.000Z",ey=(e,t)=>e?Array.isArray(e)?e.map(e=>ev(e,t)):i().isDayjs(e)?ev(e,t):void 0:e,ex=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{showTime:l,gmt:n,picker:o}=t;return e?l?n?ep(e):em(e):ey(e,o):e};function eb(e){if(!o().isString(e))return e;let t=/([+-]|\d\d)/gi,l=/Z|[+-]\d\d(?::?\d\d)?/gi,n=/[+-]?\d+(\.\d{1,3})?/,r=(e||"").match(l);if(null===r&&(r=(e||"").match(n)),null===r)return null;let i=((r[r.length-1]||[])+"").match(t)||["-",0,0],a=+(60*Number(i[1]))+eS(i[2]);return 0===a?0:"+"===i[0]?a:-a}function eS(e){let t=+e,l=0;return 0!==t&&isFinite(t)&&(l=ew(t)),l}function ew(e){return e<0?Math.ceil(e)||0:Math.floor(e)}let eC=e=>{switch(e){case"week":return"YYYY[W]W";case"month":return"YYYY-MM";case"quarter":return"YYYY[Q]Q";case"year":return"YYYY";default:return"YYYY-MM-DD"}},eF=(e,t,l,n)=>"date"===e&&l?`${t} ${n||"HH:mm:ss"}`:t;function ek(e){return/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?"YYYY-MM-DD HH:mm:ss":/^\d{4}-\d{2}-\d{2}$/.test(e)?"YYYY-MM-DD":/^\d{4}-\d{2}$/.test(e)?"YYYY-MM":/^\d{4}$/.test(e)?"YYYY":/^\d{4}Q[1-4]$/.test(e)?"YYYY[Q]Q":/^\d{4}-\d{2}-\d{2}T/.test(e)?"YYYY-MM-DDTHH:mm:ss.SSSZ":null}let eA=(e,t)=>{Array.isArray(e)?e.forEach(t):Object.keys(e).forEach(l=>{t(e[l],l)})},eP=(e,t,l)=>{if(!e)return l;let n=t.split("."),o=[],r=e,i=!1;for(let e=0;e<n.length;e++){let t=n[e];if(Array.isArray(r)){for(let t of(i=!0,r)){let r=eP(t,n.slice(e).join("."),l);o=o.concat(r)}break}if((null==r?void 0:r[t])===void 0)break;r=r[t],e===n.length-1&&o.push(r)}return 0===(o=o.filter(e=>void 0!==e)).length?l:i?o.filter(e=>null!==e):o[0]};var ej=l(88835),eM=l(60639),eI=l.n(eM),eT=l(79441);let eR=l.n(eT)()();function eE(e){if(!e)return!1;let t=[e.$and,e.$or].filter(Boolean);return 0==t.length?Object.keys(e).length>0:t.some(e=>{if(Array.isArray(e))return e.some(eE);if(e.$and||e.$or)return eE(e);let[t]=Object.keys(e);if(!t||!e[t])return!1;let[l]=Object.keys(e[t]);return!!l&&void 0!==e[t][l]})}function eN(e){let t=typeof e;return Array.isArray(e)?t="array":e instanceof Date?t="date":null===e&&(t="null"),t}function eD(e){let t=e.substr(2,e.length-4).trim(),l=t.indexOf(":");return -1!==l?{key:t.substr(0,l),defaultValue:t.substr(l+1)}:{key:t}}function eB(e,t){return e.parameters=Array.from(new Map(t.map(e=>[e.key,e])).values()),e}function e$(e){switch(eN(e)){case"string":return eO(e);case"object":return eq(e);case"array":return e_(e);default:return eB(function(){return e},[])}}Object.keys(eR).forEach(function(e){eI().registerHelper(e,eR[e])}),eI().registerHelper("json",function(e){return JSON.stringify(e)}),eI().registerHelper("urlParse",function(e){try{return JSON.stringify(ej.parse(e))}catch(t){return`Invalid URL: ${e}`}}),eI().registerHelper("dateFormat",(e,t,l)=>"string"==typeof l?i()(e).tz(l).format(t):i()(e).format(t)),eI().registerHelper("isNull",e=>o().isNull(e));let eO=(()=>{let e=/{{(\w|:|[\s-+.,@/()?=*_$])+}}/g;return t=>{let l=[],o=e=>t,r=t.match(e);return r&&(l=r.map(eD),o=e=>(e=e||{},r.reduce((o,i,a)=>{let s=l[a],d=(0,n.get)(e,s.key);return(void 0===d&&(d=s.defaultValue),"function"==typeof d&&(d=d()),1===r.length&&t.startsWith("{{")&&t.endsWith("}}"))?d:(d instanceof Date&&(d=d.toISOString()),o.replace(i,null==d?"":d))},t))),eB(o,l)}})();function eq(e){let t=Object.keys(e).map(t=>({keyTemplate:eO(t),valueTemplate:e$(e[t])}));return eB(e=>t.reduce((t,l)=>(t[l.keyTemplate(e)]=l.valueTemplate(e),t),{}),t.reduce((e,t)=>e.concat(t.valueTemplate.parameters,t.keyTemplate.parameters),[]))}function e_(e){let t=e.map(e$);return eB(e=>t.map(t=>t(e)),t.reduce((e,t)=>e.concat(t.parameters),[]))}let eL=function(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];console.error(e,...l)};var eV=l(14744),ez=l.n(eV);let eK=(e,t,l)=>t;function eU(e,t,l){return ez()(e,t,{arrayMerge:eK,...l})}var eW=l(98892);let eH=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;eW.Ay[t]({message:e,duration:l})};var eG=l(5062),eY=l(85738);function eJ(e,t){if(null==e||""===e)return"";let l=(0,eG.i5)(t);return(0,eY.Mg)(String(e),".",l)}var eX=l(63560),eQ=l.n(eX),eZ=l(95093),e0=l.n(eZ);let e1=/^\s*\{\{([\s\S]*)\}\}\s*$/;function e2(e){return e&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function e8(e){return e}function e5(e,t){let l=(t=t||{}).delimiter||".",n=t.maxDepth,r=t.transformKey||e8,i=t.transformValue||e8,a={};function s(e,d,u){u=u||1,o().isObjectLike(e)&&Object.keys(e).forEach(function(o){var c;let p=e[o],m=t.safe&&Array.isArray(p),h=Object.prototype.toString.call(p),f=e2(p),g="[object Object]"===h||"[object Array]"===h,v=d?d+l+r(o):r(o);if(null==(c=t.breakOn)?void 0:c.call(t,{key:o,value:p,path:v})){a[v]=i(p,v);return}if(!m&&!f&&g&&Object.keys(p).length&&(!t.maxDepth||u<n))return s(p,v,u+1);a[v]=i(p,v)})}return s(e),a}function e4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l={},n=t.transformValue||e8;for(let t of Object.keys(e))eQ()(l,t,n(e[t],t));return l}let e3=e=>{let t=e.split(".").pop()||"";return t.startsWith("$")||(t=""),{operator:t}},e6=e=>["$dateOn","$dateNotOn","$dateBefore","$dateAfter","$dateNotBefore","$dateNotAfter","$dateBetween"].includes(e);function e9(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function e7(e){return(null==e?void 0:e.type)==="dateOnly"||(null==e?void 0:e.type)==="datetimeNoTz"||(null==e?void 0:e.constructor.name)==="DateOnlyField"||(null==e?void 0:e.constructor.name)==="DatetimeNoTzField"}let te=(e,t)=>e?(e.type&&(e=_({...e,timezone:t})),Array.isArray(e))?(2===e.length?e.push("[]",t):3===e.length&&e.push(t),e):"string"==typeof e?!t||/(\+|-)\d\d:\d\d$/.test(e)?e:e+t:e9(e)?e.toISOString():void 0:null,tt=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=new Set,n=t.vars||{},o=t.timezone,r=t.now,i=t.getField,a=e5(e,{breakOn(e){let{key:t}=e;return t.startsWith("$")&&"$and"!==t&&"$or"!==t},transformValue(e){if("string"!=typeof e)return e;let t=e1.exec(e);if(t){let e=t[1].trim();e.startsWith("$user")&&l.add(e.substring(6))}return e}});if(l.size>0){let e=await n.$user({fields:[...l.values()]});Object.assign(n,{$user:e})}return e4(a,{transformValue(e,t){let{operator:l}=e3(t);if("string"==typeof e){let a=e1.exec(e);if(a){let s=eP(n,a[1].trim(),null),d=null==i?void 0:i(t);e="function"==typeof s?null==s?void 0:s({field:d,operator:l,timezone:o,now:r}):s}}if(e6(l)){let l=null==i?void 0:i(t);return e7(l)?e.type?_({...e,timezone:(null==l?void 0:l.timezone)||o}):e:te(e,(null==l?void 0:l.timezone)||o)}return e}})};function tl(e){let{now:t,timezone:l="+00:00",offset:n}=e,o=tn(t).utcOffset(eb(l));return n>0?[(o=o.add(1,"day").startOf("day")).format("YYYY-MM-DD"),o.clone().add(n,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]:[o.clone().subtract(-1*n-1,"day").startOf("day").format("YYYY-MM-DD"),o.clone().add(1,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]}function tn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?i().isDayjs(e)?e:t?e0()(e):i()(e):t?e0()():i()()}function to(e){var t;let{now:l,unit:n,timezone:o="+00:00",offset:r}=e,i=tn(l,"isoWeek"===n);i=(i=i.utcOffset(eb(o))).startOf(n),r>0?i=i.add(r,n):r<0&&(i=i.subtract(-1*r,n));let a={year:()=>i.format("YYYY"),quarter:()=>i.format("YYYY[Q]Q"),month:()=>i.format("YYYY-MM"),week:()=>i.format("gggg[w]ww"),isoWeek:()=>i.format("GGGG[W]WW"),day:()=>i.format("YYYY-MM-DD")},s=null==(t=a[n])?void 0:t.call(a);return o?s+o:s}let tr=(e,t)=>l=>{let{now:n,timezone:o,field:r}=l;return(null==r?void 0:r.timezone)&&(o=null==r?void 0:r.timezone),to({now:n,timezone:o,unit:e,offset:t})},ti=e=>t=>{let{now:l,timezone:n,field:o}=t;return(null==o?void 0:o.timezone)&&(n=null==o?void 0:o.timezone),tl({now:l,timezone:n,offset:e})};function ta(){return{now:new Date().toISOString(),today:tr("day"),yesterday:tr("day",-1),tomorrow:tr("day",1),thisWeek:tr("week"),lastWeek:tr("week",-1),nextWeek:tr("week",1),thisIsoWeek:tr("isoWeek"),lastIsoWeek:tr("isoWeek",-1),nextIsoWeek:tr("isoWeek",1),thisMonth:tr("month"),lastMonth:tr("month",-1),nextMonth:tr("month",1),thisQuarter:tr("quarter"),lastQuarter:tr("quarter",-1),nextQuarter:tr("quarter",1),thisYear:tr("year"),lastYear:tr("year",-1),nextYear:tr("year",1),last7Days:ti(-7),next7Days:ti(7),last30Days:ti(-30),next30Days:ti(30),last90Days:ti(-90),next90Days:ti(90)}}function ts(e){let t=e.split(".");return[t.shift(),t.join(".")]}class td{register(e,t){if(!this.options.override&&this.map.has(e))throw Error(`this registry does not allow to override existing keys: "${e}"`);this.map.set(e,t)}get(e){return this.map.get(e)}getKeys(){return this.map.keys()}getValues(){return this.map.values()}getEntities(){return this.map.entries()}constructor(e={override:!1}){this.map=new Map,this.options=e}}l(67980);let tu=Symbol.for("nocobase.utils.sesLockdown"),tc=Symbol.for("nocobase.utils.bufferOverrides"),tp=["globalThis","global","self","Function","AsyncFunction","GeneratorFunction","eval","Compartment","lockdown","harden","assert"];function tm(e){return!!e&&"object"==typeof e&&(e.message||"").includes("(SES_ALREADY_LOCKED_DOWN)")}function th(){let e=globalThis;if(e[tc])return;let t=e.Buffer;if(!t||!t.prototype)return;let l=t.prototype;for(let e of Reflect.ownKeys(l)){let t=Object.getOwnPropertyDescriptor(l,e);if(!t||"function"!=typeof t.value||!t.configurable)continue;let n=t.value,o=function(){return n},r=function(t){if(this===l)throw TypeError(`Cannot assign to read only property '${String(e)}' of object 'Buffer.prototype'`);Object.defineProperty(this,e,{configurable:!0,enumerable:!0,writable:!0,value:t})};Object.defineProperty(o,"originalValue",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(l,e,{configurable:t.configurable,enumerable:t.enumerable,get:o,set:r})}e[tc]=!0}function tf(e){th();let t=globalThis;if(!t[tu]){if("function"!=typeof lockdown)throw Error("SES lockdown is unavailable in the current runtime environment.");try{lockdown(e)}catch(e){if(!tm(e))throw e}t[tu]=!0}}function tg(e,t){return t?`{{t(${JSON.stringify(e)}, ${JSON.stringify(t)})}}`:`{{t(${JSON.stringify(e)})}}`}var tv=l(65606);let ty=e=>{for(;e;){var t;if("root"===e.id||(null==(t=e.classList)?void 0:t.contains("nb-action")))return!1;e=e.parentNode}return!tv.env.__TEST__};function tx(e,t){return e.replace(/\{\{(\w+)\}\}/g,function(e,l){return void 0!==t[l]?t[l]:e})}let tb=36,tS="";for(;tb--;)tS+=tb.toString(36);function tw(e){let t="",l=e||11;for(;l--;)t+=tS[36*Math.random()|0];return t}function tC(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}var tF=l(27153),tk=JSON.parse('{"rE":"2.1.0-beta.40"}');let tA=(e,t)=>{if(!e)return e;if("Grid"!==e["x-component"])return Object.keys(e.properties||{}).forEach(l=>{e.properties[l]=tA(e.properties[l],t)}),e;let l=e.parent;e=e.toJSON?e.toJSON():o().cloneDeep(e);let n={},{properties:r={}}=e,i=0;if(Object.keys(r).forEach((e,l)=>{let a=r[e];if("Grid.Row"!==a["x-component"]){a["x-index"]=++i,n[e]=a;return}if(a.properties){if(1===Object.keys(a.properties).length){a["x-index"]=++i,n[e]=a;return}Object.keys(a.properties).forEach((l,r)=>{let s=a.properties[l];if(o().set(s,"x-component-props.width",100),0===r){a["x-index"]=++i,n[e]=a;return}null!=t&&t(s)||(delete a.properties[l],n[`${tw()}_${l}`]=tP(s,l,++i))})}}),e.properties=n,l){let t=new tF.Schema(e,l);return l.properties&&Object.keys(l.properties).forEach(n=>{n===e.name&&(l.properties[n]=t)}),t}return e};function tP(e,t,l){return{type:"void",version:"2.0","x-component":"Grid.Row","x-app-version":tk.rE,"x-uid":tw(),"x-async":!1,"x-index":l,_isJSONSchemaObject:!0,properties:{[t]:e}}}function tj(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=r.exec(o));)t.add(e[1]);let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=i.exec(o));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function tM(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=r.exec(o));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],o=e[3]||"";t[l].push(`${n}${o}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],o=e[2]||"";t[l].push(`[${n}]${o}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=i.exec(o));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],o=n[3]||"";t[e].push(`${l}${o}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],o=n[2]||"";t[e].push(`[${l}]${o}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}let tI=new(l(23155)).HX;function tT(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};for(let l of e){let e=l.replace(/^ctx\./,"").split("."),n=t;for(let t=0;t<e.length;t++){let o=e[t];t===e.length-1?n[o]=`{{${l}}}`:(n[o]=n[o]||{},n=n[o])}}return t}async function tR(e){return tT(await tI.fullVariables(e))}async function tE(e,t){return await tI.parseAndRender(e,{ctx:t})}function tN(e){let t=1,l={};return{sql:e.replace(/{{\s*([^}]+)\s*}}/g,(e,n)=>{let o=`__var${t}`;return l[o]=`{{${n.trim()}}}`,t++,`$${o}`}),bind:l}}async function tD(e){let{sql:t,bind:l}=tN(e),n=await tR(t);return{sql:t,bind:l,liquidContext:n}}},59598(){},23005(){},14892(){},2813(){},61511(){},92489(){},52453(){},72522(){},66883(){},9845(){}},function(e){var t=function(t){return e(e.s=t)};e.O(0,["1339","2174","268","3210","3338","3658","3782","404","8159","8732","8878","9200","9223","957","9817","9967"],function(){return t(65644)}),e.O()}]);
|
|
3343
|
+
${p}`}async function e0(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l="string"==typeof e?e:String(e??""),n=!!t.preprocessTemplates,o=n?eM.withTemplates:eM.withoutTemplates,r=eI(o,l);if(r)return await r;let i=(async()=>{if(!n)return eJ(await (0,ex.W)(l));let e=eZ(l,{processStringLiterals:!1});return eJ(eZ(await (0,ex.W)(e),{processBarePlaceholders:!1}))})();eT(o,l,i,ej);try{return await i}catch(e){throw o.delete(l),e}}var e1=l(62572);function e2(e){if(Array.isArray(e)){let t=e.map(e=>e2(e)).filter(e=>void 0!==e);return t.length?t:void 0}if(e&&"object"==typeof e){let t={};return Object.keys(e).forEach(l=>{let n=e2(e[l]);void 0!==n&&(t[l]=n)}),Object.keys(t).length?t:void 0}return null==e||"string"==typeof e&&""===e?void 0:e}let e8=e=>"string"==typeof e.on?"beforeRender"===e.on:"object"==typeof e.on?"beforeRender"===e.on.eventName:!e.on&&!0!==e.manual;var e5=l(47684);let e4="0123456789abcdefghijklmnopqrstuvwxyz";function e3(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:11,l="";for(let e=0;e<t;e++)l+=e4[Math.random()*e4.length|0];return`${e}${l}`}},49773(e,t,l){"use strict";async function n(e){if(!/<[A-Za-z]|<\//.test(e))return e;try{var t;let n=await l.e("1339").then(l.bind(l,1608)),o=(null==n?void 0:n.transform)||(null==n||null==(t=n.default)?void 0:t.transform);if("function"!=typeof o)return e;let r=o(e,{transforms:["jsx"],jsxPragma:"ctx.React.createElement",jsxFragmentPragma:"ctx.React.Fragment",disableESTransforms:!0,production:!0});return(r&&(r.code||(null==r?void 0:r.output)))??e}catch(t){return e}}l.d(t,{W:()=>n})},81982(e,t,l){"use strict";l.d(t,{M:()=>m,gG:()=>i,mv:()=>a,o4:()=>p});var n=l(40542),o=l(2543),r=l.n(o);async function i(e,t){if(!e)return{};if("function"==typeof e)try{return await e(t)||{}}catch(e){return console.error("Error resolving defaultParams function:",e),{}}return e}async function a(e,t,l){if(!e)return{};if("function"==typeof e)try{return await e(t,l)||{}}catch(e){return console.error("Error resolving createModelOptions function:",e),{}}return e}let s={queue:[],timer:null,inflightByRun:new Map},d=10;function u(e){if(Array.isArray(e))return e.map(u);if(r().isPlainObject(e)){let t=Object.entries(e).map(e=>{let[t,l]=e;return[t,u(l)]});return Object.fromEntries(r().sortBy(t,e=>{let[t]=e;return t}))}return e}function c(e){try{return JSON.stringify(u(e))}catch{try{return JSON.stringify(e)}catch{return String(e)}}}function p(e,t){let l,n,o=s,r=e.runId||"GLOBAL",i=c(t),a=o.inflightByRun.get(r);a||(a=new Map,o.inflightByRun.set(r,a));let u=a.get(i);if(u)return u;let p=new Promise((e,t)=>{l=e,n=t});a.set(i,p);let m={id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,ctx:e,payload:t,resolve:l,reject:n,runId:r,dedupKey:i};o.queue.push(m);let h=async()=>{var t,l,n,r,i,a;let s=o.queue.splice(0,o.queue.length);if(o.timer=null,!s.length)return;let d=null==(t=s[0].ctx)?void 0:t.api;if(!d){for(let e of s)try{e.resolve(e.payload.template)}catch(t){e.reject(t)}finally{null==(l=o.inflightByRun.get(e.runId))||l.delete(e.dedupKey)}return}try{let e=s.map(e=>({id:e.id,template:e.payload.template,contextParams:e.payload.contextParams||{}})),t=await d.request({method:"POST",url:"variables:resolve",data:{values:{batch:e}}}),l=t.data??t,r=l.data??l,i=null==r?void 0:r.results,a=Array.isArray(i)?i:Array.isArray(r)?r:[],u=new Map;for(let e of a){let t=(null==e?void 0:e.id)!=null?String(e.id):"";t&&u.set(t,null==e?void 0:e.data)}for(let e of s)try{let t=String(e.id),l=u.has(t)?u.get(t):e.payload.template;e.resolve(l)}catch(t){e.reject(t)}finally{null==(n=o.inflightByRun.get(e.runId))||n.delete(e.dedupKey)}}catch(t){for(let l of s)try{null==e||null==(i=e.logger)||null==(r=i.warn)||r.call(i,{err:t},"variables:resolve(batch) failed, fallback"),l.resolve(l.payload.template)}catch(e){l.reject(e)}finally{null==(a=o.inflightByRun.get(l.runId))||a.delete(l.dedupKey)}}};return o.timer||(o.timer=setTimeout(h,d)),p}async function m(e,t){let l=async e=>{if("string"==typeof e&&/\{\{.*?\}\}/.test(e))return await g(e,t);if(Array.isArray(e))return Promise.all(e.map(l));if(e&&"object"==typeof e){let t={};for(let[n,o]of Object.entries(e))t[n]=await l(o);return t}return e};return l(e)}async function h(e,t){let l=await f(e.trim(),t),n=await t.runjs(`return ${l}`,{t:t.t});return(null==n?void 0:n.success)?n.value:void 0}async function f(e,t){let l,n=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*(?:(?:\.[a-zA-Z_$][a-zA-Z0-9_$]*)|(?:\[[^\]]+\]))*)(?!\s*\()/g,o=[],r=new Set;for(;null!==(l=n.exec(e));){let e=l[0],t=l[1],n=t.match(/^([a-zA-Z_$][a-zA-Z0-9_$]*)/);if(n){let l=n[1],i=t.substring(l.length);o.push({fullPath:e,firstKey:l,restPath:i}),r.add(l)}}if(0===o.length)return e;let i=new Map;for(let e of r)try{let l=await t[e],n=l&&!0===l.__isRecordProxy__;i.set(e,n)}catch(t){i.set(e,!1)}o.sort((e,t)=>t.fullPath.length-e.fullPath.length);let a=e;for(let{fullPath:e,firstKey:t,restPath:l}of o){let n,o=i.get(t)||!1;n=""===l?`await ctx.${t}`:o?`await (await ctx.${t})${l}`:`(await ctx.${t})${l}`;let r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),s=RegExp(`\\b${r}\\b`,"g");a=a.replace(s,n)}return a}async function g(e,t){let l=e=>{let t=e.trim().match(/^ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)(?:\.([a-zA-Z_$][a-zA-Z0-9_$-]*(?:\.[a-zA-Z_$][a-zA-Z0-9_$-]*)*))?$/);return t?t[2]?`${t[1]}.${t[2]}`:t[1]:null},o=async e=>{let l=e.split("."),o=l.shift();if(!o)return;let r=await t[o];return 0===l.length?r:(0,n.D)(r,l.join("."))},r=async e=>{let n=l(e);if(n){let l=await o(n);return void 0===l&&n.includes("-")?await h(e,t):l}return await h(e,t)},i=e.match(/^\s*\{\{\s*([^{}]+?)\s*\}\}\s*$/);if(i){let e=i[1];return await r(e)}let a=[...e.matchAll(/\{\{\s*(.+?)\s*\}\}/g)],s=e;for(let[e,t]of a){let l=await r(t);if(void 0!==l){let t="object"==typeof l&&null!==l?JSON.stringify(l):String(l);s=s.replace(e,t)}}return s}},47684(e,t,l){"use strict";function n(e,t){if(!e||"string"!=typeof e)throw Error("invalid url");let l=e.trim();if(l.startsWith("http://")||l.startsWith("https://"))return l;let n=window.__esm_cdn_base_url__||"https://esm.sh",o=(null==t?void 0:t.addSuffix)&&window.__esm_cdn_suffix__||"",r=n.replace(/\/$/,""),i=l.replace(/^\//,"");if(null==t?void 0:t.raw){let e=i.includes("?")?"&":"?";return`${r}/${i}${e}raw`}return`${r}/${i}${o}`}function o(e){return!!e&&"string"==typeof e&&e.split("?")[0].split("#")[0].endsWith(".css")}l.d(t,{i:()=>n,y:()=>o})},51143(e,t,l){"use strict";function n(){var e,t;let l=globalThis;if((null==(e=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:e.windowAllow)&&(null==(t=l.__nocobaseRunJSSafeGlobalsRegistry)?void 0:t.documentAllow))return l.__nocobaseRunJSSafeGlobalsRegistry;let n={windowAllow:new Set,documentAllow:new Set};return l.__nocobaseRunJSSafeGlobalsRegistry=n,n}function o(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.windowAllow.add(e)}}function r(e){if(!e)return;let t=n();for(let l of e){if("string"!=typeof l)continue;let e=l.trim();e&&t.documentAllow.add(e)}}function i(e){return n().windowAllow.has(e)}function a(e){return n().documentAllow.has(e)}function s(e){let t=()=>`${window.location.origin}${window.location.pathname}`,l=(e,l,n)=>{if(!(e=>{try{let l=new URL(e,t()),n=l.protocol.toLowerCase();if("about:"===n)return"about:blank"===l.href;return"http:"===n||"https:"===n}catch{return!1}})(e))throw Error("Unsafe URL: window.open only allows http/https/about:blank.");let o="_blank",r=(e=>{let t=new Set;return e&&e.split(",").map(e=>e.trim()).filter(Boolean).forEach(e=>{let l=e.split("=")[0].trim().toLowerCase();"noopener"!==l&&"noreferrer"!==l&&t.add(e)}),t.add("noopener"),t.add("noreferrer"),Array.from(t).join(",")})(n),i=window.open.call(window,e,o,r);if(i&&"opener"in i)try{i.opener=null}catch{}return i},n=(e,n)=>{let o=new URL(e,t()),r=o.protocol.toLowerCase(),i="about:"===r&&"about:blank"===o.href;if("http:"!==r&&"https:"!==r&&!i)throw Error("Unsafe URL: only http/https/about:blank are allowed.");if(i)return(null==n?void 0:n.replace)?window.location.replace("about:blank"):window.location.assign("about:blank");if(o.protocol===window.location.protocol&&o.hostname===window.location.hostname&&o.port===window.location.port)return(null==n?void 0:n.replace)?window.location.replace(o.href):window.location.assign(o.href);if(!l(o.href))throw Error("Popup blocked: cross-origin navigation is opened in a new tab.")},o=new Proxy({},{get(e,t){switch(t){case"origin":return window.location.origin;case"protocol":return window.location.protocol;case"host":return window.location.host;case"hostname":return window.location.hostname;case"port":return window.location.port;case"pathname":return window.location.pathname;case"assign":return e=>n(e,{replace:!1});case"replace":return e=>n(e,{replace:!0});case"reload":return window.location.reload.bind(window.location);case"href":throw Error("Reading location.href is not allowed.");default:throw Error(`Access to location property "${t}" is not allowed.`)}},set(e,t,l){if("href"===t)return n(String(l),{replace:!1}),!0;throw Error("Mutation on location is not allowed.")}}),r={setTimeout:window.setTimeout.bind(window),clearTimeout:window.clearTimeout.bind(window),setInterval:window.setInterval.bind(window),clearInterval:window.clearInterval.bind(window),console,Math,Date,FormData,..."u">typeof Blob?{Blob}:{},..."u">typeof URL?{URL}:{},addEventListener:addEventListener.bind(window),open:l,location:o,...e||{}};return new Proxy(Object.create(null),{get(e,t){if("string"!=typeof t)return Reflect.get(e,t);if(t in r)return r[t];if(Object.prototype.hasOwnProperty.call(e,t))return e[t];if(i(t)){let e=window[t];return"function"==typeof e?e.bind(window):e}throw Error(`Access to global property "${t}" is not allowed.`)},set(e,t,l){if("string"!=typeof t)return Reflect.set(e,t,l),!0;if(t in r)throw Error(`Mutation of global property "${t}" is not allowed.`);return e[t]=l,!0},has:(e,t)=>"string"!=typeof t?Reflect.has(e,t):!!(t in r||Object.prototype.hasOwnProperty.call(e,t)||i(t))})}function d(e){let t={createElement:document.createElement.bind(document),querySelector:document.querySelector.bind(document),querySelectorAll:document.querySelectorAll.bind(document),...e||{}};return new Proxy(Object.create(null),{get(e,l){if("string"!=typeof l)return Reflect.get(e,l);if(l in t)return t[l];if(Object.prototype.hasOwnProperty.call(e,l))return e[l];if(a(l)){let e=document[l];return"function"==typeof e?e.bind(document):e}throw Error(`Access to document property "${l}" is not allowed.`)},set(e,l,n){if("string"!=typeof l)return Reflect.set(e,l,n),!0;if(l in t)throw Error(`Mutation of document property "${l}" is not allowed.`);return e[l]=n,!0},has:(e,l)=>"string"!=typeof l?Reflect.has(e,l):!!(l in t||Object.prototype.hasOwnProperty.call(e,l)||a(l))})}function u(e){var t;let l="u">typeof window&&window.navigator||void 0,n={},o=null==l||null==(t=l.clipboard)?void 0:t.writeText;"function"==typeof o&&(n.writeText=o.bind(l.clipboard));let r={clipboard:n};return Object.defineProperty(r,"onLine",{get:()=>!!(null==l?void 0:l.onLine),enumerable:!0,configurable:!1}),Object.defineProperty(r,"language",{get:()=>null==l?void 0:l.language,enumerable:!0,configurable:!1}),Object.defineProperty(r,"languages",{get:()=>(null==l?void 0:l.languages)?[...l.languages]:void 0,enumerable:!0,configurable:!1}),Object.assign(r,e||{}),new Proxy({},{get(e,t){if(t in r)return r[t];throw Error(`Access to navigator property "${String(t)}" is not allowed.`)}})}function c(e){let t={};try{let e=u();t.navigator=e;try{t.window=s({navigator:e})}catch{}}catch{}try{t.document=d()}catch{}return e?{...t,...e}:t}async function p(e,t,l,n){if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.runjs)return e.runjs(t,c(n),l)}l.d(t,{D1:()=>u,I2:()=>c,Vm:()=>o,Xh:()=>d,_:()=>p,ey:()=>s,yz:()=>r})},22928(e,t,l){"use strict";function n(e){let t={};return Object.entries(e||{}).forEach(e=>{let[l,n]=e;null!=n&&(t[l]=n)}),t}function o(e,t,l){try{var n,o,r,i,a;let s=null==(o=e.dataSourceManager)||null==(n=o.getDataSource)?void 0:n.call(o,t||"main"),d=null==s||null==(i=s.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,l);return(null==d||null==(a=d.getPrimaryKey)?void 0:a.call(d))||"id"}catch(e){return"id"}}function r(e,t){var l,r;if(!t)return;let i=t.dataSourceKey||"main",a=t.collection||(null==(l=t.record)?void 0:l.__collectionName);if(!a)return;let s=o(e,i,a)||"id",d=void 0!==t.filterByTk?t.filterByTk:void 0!==t.id?t.id:null==(r=t.record)?void 0:r[s];if(void 0!==d)return n({collection:a,filterByTk:d,dataSourceKey:i,associationName:t.associationName,sourceId:t.sourceId,fields:t.fields,appends:t.appends})}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=e=>!!e&&"object"==typeof e&&"string"==typeof e.collection&&(void 0!==e.filterByTk||void 0!==e.id||e.record),n={},o=(t,i)=>{if(l(t)){let l=r(e,t);l&&(n[i.join(".")]=l);return}if(Array.isArray(t)){for(let e=0;e<t.length;e++)o(t[e],[...i,String(e)]);return}if(t&&"object"==typeof t){for(let[e,l]of Object.entries(t))o(l,[...i,e]);return}};return o(t,[]),Object.keys(n).length?n:void 0}l.d(t,{d:()=>i})},88439(e,t,l){"use strict";function n(e,t,l,n){let o={},r={};for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a)){let s=t[a],d={};if(s.uiSchema&&"object"==typeof s.uiSchema){for(let[e,t]of Object.entries(s.uiSchema))if(t&&"object"==typeof t){var i;let l=t;d[e]={type:l.type||"any",title:l.title||(null==(i=l["x-decorator-props"])?void 0:i.label)||e,interface:l["x-component"],uiSchema:l}}}let u=Object.keys(d).length>0;r[a]={type:"object",title:e.t(s.title)||a,display:u?"default":"none",properties:u?{params:{type:"object",title:"Parameters",display:"flatten",properties:d}}:void 0},o[a]={get params(){return l.getStepParams(n,a)||{}},get uiSchema(){return s.uiSchema},result:void 0}}e.defineProperty("steps",{get:()=>o})}l.d(t,{w:()=>n})},73398(e,t,l){"use strict";function n(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=r.exec(o));)t.add(e[1]);let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=i.exec(o));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function o(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=r.exec(o));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],o=e[3]||"";t[l].push(`${n}${o}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],o=e[2]||"";t[l].push(`[${n}]${o}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=i.exec(o));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],o=n[3]||"";t[e].push(`${l}${o}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],o=n[2]||"";t[e].push(`[${l}]${o}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}l.d(t,{xI:()=>h,vP:()=>y,$S:()=>f,pc:()=>g,Cg:()=>c,nN:()=>x,ju:()=>b,Xx:()=>m,vE:()=>p,XU:()=>u,UX:()=>v});var r=l(22928),i=l(35846),a=l(44476),s=l(2543),d=l.n(s);function u(e){var t,l,n,o;let r=e.resource,i=e.collection,a=e.record,s=(null==i?void 0:i.name)||(null==r||null==(t=r.getResourceName)?void 0:t.call(r)),d=(null==i?void 0:i.dataSourceKey)||(null==r||null==(l=r.getDataSourceKey)?void 0:l.call(r)),u=(null==r||null==(n=r.getFilterByTk)?void 0:n.call(r))??(null==i||null==(o=i.getFilterByTK)?void 0:o.call(i,a));if(!s||null==u)return;let c=String(s).split(".");return{collection:c[c.length-1],dataSourceKey:d,filterByTk:u}}function c(e){var t,l,n;let o=e.view;if(!o)return;let r=(null==o?void 0:o.inputArgs)||{},i=(null==r?void 0:r.collectionName)||(null==o||null==(t=o.record)?void 0:t.collection),a=(null==r?void 0:r.dataSourceKey)||(null==o||null==(l=o.record)?void 0:l.dataSourceKey)||"main",s=(null==r?void 0:r.filterByTk)||(null==o||null==(n=o.record)?void 0:n.filterByTk),d=null==r?void 0:r.associationName,u=null==r?void 0:r.sourceId;if(i&&null!=s)return{collection:i,dataSourceKey:a,filterByTk:s,sourceId:u,associationName:d}}function p(e,t){var l,n,o;let r=null==(l=e.inputArgs)?void 0:l.record,i=null==(n=e.collection)?void 0:n.filterTargetKey;if(!r||!i)return;let a=t.view,s=null==a||null==(o=a.inputArgs)?void 0:o.filterByTk,u=r[i];if(null!=s&&null!=u&&s===u)return d().cloneDeep(r)}function m(e,t){return l=>{var n,o,r,i;if(!("record"===l||l.startsWith("record.")))return!1;let s=t();if(!s)return!0;if("record"===l)return!1;let d=c(e),u=null==d?void 0:d.collection,p=(null==d?void 0:d.dataSourceKey)||"main";if(!u)return!0;let m=null==(o=e.dataSourceManager)||null==(n=o.getDataSource)?void 0:n.call(o,p),h=null==m||null==(i=m.collectionManager)||null==(r=i.getCollection)?void 0:r.call(i,u);if(!h)return!0;let f=(0,a.H)(()=>h,()=>s),g=l.startsWith("record.")?l.slice(7):"";return!!g&&f(g)}}function h(e,t){let l=(0,a.H)(e,()=>t());return n=>{let o=t();if(!o)return!0;if(!n)return!1;let r=e();if(!n.includes(".")){var i;let e,t=n;return r&&("function"==typeof r.getField&&(e=r.getField(t)),e||"function"!=typeof r.getFields||(e=(r.getFields()||[]).find(e=>(null==e?void 0:e.name)===t))),!!(null==e||null==(i=e.isAssociationField)?void 0:i.call(e))&&null==(null==o?void 0:o[t])}return l(n)}}async function f(e,t,l){let n=await (0,i.H)(e,t,!0)();return n?{...n,buildVariablesParams:e=>l?l(e):u(e)}:null}function g(e,t,l){let n=async()=>f(e,t,l);return n.title=t,n}function v(e,t,l){var n,o;return g(t,(null==l?void 0:l.title)?(null==(n=e.t)?void 0:n.call(e,l.title))||l.title:(null==(o=e.t)?void 0:o.call(e,"Current record"))||"Current record",e=>u(e))}let y=n,x=o;async function b(e,t){let l=Object.keys(o(t)||{});if(!l.length)return;let n={};for(let t of l){var i;let l,o=null==(i=e.getPropertyOptions)?void 0:i.call(e,t),r=null==o?void 0:o.meta;if(r){try{let t="function"==typeof r?await r():r,n=null==t?void 0:t.buildVariablesParams;"function"==typeof n&&(l=await n(e))}catch(e){continue}l&&(n[t]=l)}}return(0,r.d)(e,n)}},67778(e,t,l){"use strict";l.d(t,{sp:()=>j,bt:()=>R,U:()=>ee,N5:()=>K,xB:()=>q,mW:()=>O,fP:()=>G});var n=l(74848),o=l(96540),r=l(99418),i=l(11869),a=l(29007),s=l(52568),d=l(73398);function u(e){return null!=e}function c(e,t){if(e===t)return!0;if(!u(e)||!u(t))return!1;try{return JSON.stringify(e)===JSON.stringify(t)}catch(l){return String(e)===String(t)}}function p(e){var t;let l=null==e||null==(t=e.navigation)?void 0:t.viewStack;return Array.isArray(l)?l:[]}function m(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p(e);if(!l.length)return -1;let n=(null==e?void 0:e.inputArgs)||{},o=(null==e||null==(t=e.navigation)?void 0:t.viewParams)||{},r=n.viewUid??o.viewUid;if(!r)return l.length-1;let i=l.map((e,t)=>({item:e,index:t})).filter(e=>{let{item:t}=e;return(null==t?void 0:t.viewUid)===r});if(!i.length)return l.length-1;let a=["filterByTk","sourceId","tabUid"],s=i[i.length-1].index,d=-1;for(let{item:e,index:t}of i){let l=0,o=!0;for(let t of a)if(u(n[t])){if(!c(null==e?void 0:e[t],n[t])){o=!1;break}l+=1}o&&l>=d&&(s=t,d=l)}return s}function h(e,t){return t??e.view}function f(e){var t;if(!e)return!1;let l=p(e),n=null==e||null==(t=e.inputArgs)?void 0:t.openerUids,o=Array.isArray(n)&&n.length>0;return m(e,l)>=1||o}function g(e,t){let l=t=>e.t(t),n=function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e;return f(h(l,t))},o=async e=>{let l=h(e,t);if(!l||!f(l))return;let n=await v(e,l),o=null==n?void 0:n.resource;return(null==o?void 0:o.collectionName)&&null!=o.filterByTk?{collection:o.collectionName,dataSourceKey:o.dataSourceKey||"main",filterByTk:o.filterByTk,associationName:o.associationName,sourceId:o.sourceId}:(0,d.Cg)(e)},r=async()=>{var t,l,n,r;let i=await o(e);if(!(null==i?void 0:i.collection))return null;let a=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,i.dataSourceKey||"main");return(null==a||null==(r=a.collectionManager)||null==(n=r.getCollection)?void 0:n.call(r,i.collection))||null},i=async(l,n)=>{var o,r,i,a,s,d;try{let s=n||e,d=h(s,t),u=p(d),c=m(d,u);if(c<1||l<1)return;let f=c-l;if(f<1)return;let g=u[f];if(!(null==g?void 0:g.viewUid))return;let v=null==(o=s.engine)?void 0:o.getModel(g.viewUid,!0);if(!v)try{v=await s.engine.loadModel({uid:g.viewUid})}catch(t){null==(a=s.logger||e.logger)||null==(i=a.warn)||i.call(a,{err:t},"[FlowEngine] popup.getParentRecordRef loadModel failed")}let y=(null==v||null==(r=v.getStepParams)?void 0:r.call(v,"popupSettings","openView"))||{},x=null==y?void 0:y.collectionName,b=(null==y?void 0:y.dataSourceKey)||"main",S=(null==g?void 0:g.filterByTk)??(null==g?void 0:g.sourceId);if(!x||null==S)return;return{collection:x,dataSourceKey:b,filterByTk:S,sourceId:null==g?void 0:g.sourceId,associationName:null==y?void 0:y.associationName}}catch(t){null==(d=(null==n?void 0:n.logger)||e.logger)||null==(s=d.warn)||s.call(d,{err:t},"[FlowEngine] popup.getParentRecordRef failed");return}},a=l=>{try{let n=h(e,t),o=p(n);return m(n,o)-l>=1}catch(e){return!1}},s=t=>{let n=()=>({type:"object",title:l("Parent popup"),disabled:()=>!a(t),disabledReason:()=>a(t)?void 0:l("No parent popup"),hidden:()=>!a(t),properties:async()=>{let n=await i(t),o={};if(o.uid={type:"string",title:l("Popup uid")},n){let t=(()=>{try{var t,l,o,r;let i=null==(l=e.dataSourceManager)||null==(t=l.getDataSource)?void 0:t.call(l,n.dataSourceKey||"main");return(null==i||null==(r=i.collectionManager)||null==(o=r.getCollection)?void 0:o.call(r,n.collection||""))||null}catch(e){return null}})();o.record=await (0,d.$S)(()=>t,l("Popup record"),()=>n)||{type:"object",title:l("Popup record")}}else o.record={type:"object",title:l("Popup record")};return o.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},o}});return n.title=l("Parent popup"),n},u=()=>({type:"object",title:l("Current popup"),disabled:()=>!n(),hidden:()=>!n(),buildVariablesParams:async e=>{var l,r,a,s;if(!n(e))return;let d=await o(e),u=h(e,t),c=null==u?void 0:u.inputArgs,f={};if(d){let e={...d};!e.associationName&&(null==c?void 0:c.associationName)&&(e.associationName=c.associationName),void 0===e.sourceId&&void 0!==(null==c?void 0:c.sourceId)&&(e.sourceId=null==c?void 0:c.sourceId),f.record=e}try{let t=p(u);if(m(u,t)>=2){let t=f,l=1,n=await i(l,e);for(;n;)t.parent||(t.parent={}),t.parent.record=n,t=t.parent,l+=1,n=await i(l,e)}}catch(t){null==(r=e.logger)||null==(l=r.debug)||l.call(r,{err:t},"[FlowEngine] buildVariablesParams: build parent-chain failed")}try{let e=null==c?void 0:c.sourceId,t=null==c?void 0:c.associationName,l=(null==c?void 0:c.dataSourceKey)||"main";if(null!=e&&""!==e&&t&&"string"==typeof t){let n=String(t).split(".")[0];n&&(f.sourceRecord={collection:n,dataSourceKey:l,filterByTk:e})}}catch(t){null==(s=e.logger)||null==(a=s.debug)||a.call(s,{err:t},"[FlowEngine] buildVariablesParams: infer sourceRecord failed")}return f},properties:async()=>{var n,a,u,c;let f={};if(f.uid={type:"string",title:l("Popup uid")},await o(e)){let e=async()=>{let e=await r();return e?await (0,d.$S)(()=>e,l("Current popup record"),e=>o(e)):null};e.title=l("Current popup record"),e.hasChildren=!0,f.record=e}try{let o=h(e,t),r=null==o?void 0:o.inputArgs,i=null==r?void 0:r.sourceId,s=null==r?void 0:r.associationName,u=(null==r?void 0:r.dataSourceKey)||"main";if(!s||"string"!=typeof s||!s.includes(".")){let t=p(o),l=m(o,t),r=l>=0?null==t?void 0:t[l]:void 0;if(null==r?void 0:r.viewUid){let t=null==e||null==(n=e.engine)?void 0:n.getModel(r.viewUid,!0);t||(t=await e.engine.loadModel({uid:r.viewUid}));let l=(null==t||null==(a=t.getStepParams)?void 0:a.call(t,"popupSettings","openView"))||{};s=(null==l?void 0:l.associationName)||s,u=(null==l?void 0:l.dataSourceKey)||u}}if(null!=i&&""!==i&&s&&"string"==typeof s){let t=String(s).includes(".")?String(s).split(".")[0]:void 0;if(t){let n=()=>{try{var l,n,o,r;let i=null==(n=e.dataSourceManager)||null==(l=n.getDataSource)?void 0:l.call(n,u);return(null==i||null==(r=i.collectionManager)||null==(o=r.getCollection)?void 0:o.call(r,t))||null}catch(e){return null}},o=await (0,d.$S)(n,l("Current popup parent record"),()=>({collection:t,dataSourceKey:u,filterByTk:i}));o&&(f.sourceRecord=o)}}}catch(t){null==(c=e.logger)||null==(u=c.debug)||u.call(c,{err:t},"[FlowEngine] popup.properties: build sourceRecord failed")}return f.resource={type:"object",title:l("Data source"),properties:async()=>({dataSourceKey:{type:"string",title:l("Data source key")},collectionName:{type:"string",title:l("Collection name")},associationName:{type:"string",title:l("Association name")},filterByTk:{type:"string",title:l("filterByTk")},sourceId:{type:"string",title:l("sourceId")}})},await i(1)&&(f.parent=s(1)),f}});return u.title=l("Current popup"),u.sort=975,u}async function v(e,t){var l;let n=p(t),o=m(t,n),r=null==t||null==(l=t.inputArgs)?void 0:l.openerUids,i=Array.isArray(r)&&r.length>0;if(!(o>=1||i))return;if(!n.length){let e=(null==t?void 0:t.inputArgs)||{};if(!(e.collectionName||null!=e.filterByTk||null!=e.sourceId||e.associationName||e.viewUid))return;return{uid:e.viewUid,resource:{dataSourceKey:e.dataSourceKey||"main",collectionName:e.collectionName,associationName:e.associationName,filterByTk:e.filterByTk,sourceId:e.sourceId}}}let a=async t=>{var l,o,r,i,s,d;if(t<0||!(null==(l=n[t])?void 0:l.viewUid))return;let u=n[t].viewUid,c=null==(o=e.engine)?void 0:o.getModel(u,!0);c||(c=await (null==(d=e.engine)?void 0:d.loadModel({uid:u})));let p=(null==c||null==(r=c.getStepParams)?void 0:r.call(c,"popupSettings","openView"))||{},m=null==p?void 0:p.collectionName,h={uid:u,resource:{dataSourceKey:(null==p?void 0:p.dataSourceKey)||"main",collectionName:m,associationName:null==p?void 0:p.associationName,filterByTk:null==(i=n[t])?void 0:i.filterByTk,sourceId:null==(s=n[t])?void 0:s.sourceId}},f=await a(t-1);return f&&(h.parent=f),h};return await a(o)}function y(e,t){let l=/^(?:record|sourceRecord)(?:\.|$)|^parent(?:\.parent)*(?:\.(?:record|sourceRecord))(?:\.|$)/;e.defineProperty("popup",{get:async()=>v(e,t),meta:g(e,t),resolveOnServer:e=>{try{return!!e&&l.test(e)}catch(e){return!1}}})}var x=l(18182);let b=(0,o.forwardRef)((e,t)=>{let{afterClose:l,footer:r,header:i,hidden:a,...s}=e,[d,u]=(0,o.useState)(!0),[c,p]=(0,o.useState)(s),[m,h]=(0,o.useState)(()=>r),[f,g]=(0,o.useState)(i);(0,o.useImperativeHandle)(t,()=>({destroy:()=>{u(!1),null==l||l()},update:e=>p(t=>({...t,...e})),setFooter:e=>{h(e)},setHeader:e=>{0===Object.values(e||{}).length?g(null):g(e)}}));let v={...c,title:(null==f?void 0:f.title)||c.title,extra:null==f?void 0:f.extra,footer:void 0!==m?m:c.footer??null},y=o.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return(0,n.jsx)(x.A,{closable:!1,rootClassName:a?"nb-hidden":"",getContainer:y,...v,open:d,onCancel:c.onCancel,afterClose:()=>{null==l||l()},children:c.children})});function S(){let[e,t]=o.useState([]);return[e,o.useCallback(e=>(t(t=>[...t,e]),()=>{t(t=>t.filter(t=>t!==e))}),[])]}var w=l(16639),C=l(20616),F=l(47451);async function k(e,t){var l;return!!t.force||!1!==await (null==(l=e.beforeClose)?void 0:l.call(e,t))}function A(e,t){var l;let n=null==t?void 0:t.layoutContext,o=null==t||null==(l=t.engine)?void 0:l.context;n instanceof a.cB&&n!==t&&n!==o&&e.addDelegate(n)}let P=0;function j(){let e=o.useRef(null),t=(t,l)=>{var u,c,p;let m,h,f=null==l?void 0:l.engine;P+=1;let g=o.createRef(),v=new Promise(e=>{h=e}),x=null,S=null,j=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return x=t,null==(e=g.current)||e.setFooter(t),()=>{var e;x=null,null==(e=g.current)||e.setFooter(null)}},[t]),null},M=e=>(o.useEffect(()=>{var t;return S=e,null==(t=g.current)||t.setHeader(e),()=>{var e;S=null,null==(e=g.current)||e.setHeader(null)}},[e]),null),I=new a.cB,T=(0,F._)(l.engine),R=(0,w.eX)(f,T);I.defineProperty("engine",{value:T}),I.addDelegate(T.context),!1!==t.inheritContext?I.addDelegate(l):(I.addDelegate(l.engine.context),A(I,l));let E=!1,N={type:"dialog",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,r;if(E)return;E=!0,null==(l=t.onClose)||l.call(t),null==(n=g.current)||n.destroy(),null==m||m(),null==h||h(e);let i=null==R?void 0:R.emitter;(0,w.Z8)(i),null==i||null==(r=i.emit)||r.call(i,w.B9,{type:"dialog",viewUid:null==N||null==(o=N.inputArgs)?void 0:o.viewUid}),T.unlinkFromStack()},update:e=>{var t;return null==(t=g.current)?void 0:t.update(e)},close:async(e,l)=>{var n,o;return(!t.preventClose||!!l)&&!!await k(N,{result:e,force:l})&&(t.triggerByRouter&&(null==(o=t.inputArgs)||null==(n=o.navigation)?void 0:n.back)?t.inputArgs.navigation.back():N.destroy(e),!0)},Footer:j,Header:M,setFooter:e=>{var t;x=e,null==(t=g.current)||t.setFooter(e)},setHeader:e=>{var t;S=e,null==(t=g.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,I)}};I.defineProperty("view",{get:()=>N,resolveOnServer:(0,d.Xx)(I,()=>(0,d.vE)(l,I))}),T.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),N.destroy()}),y(I,N);let D=(0,i.observer)(()=>{var e,l,i,a;let s=o.useRef(!1),d="function"==typeof t.content?t.content(N,I):t.content,u="string"==typeof d?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(d)}}):d;return(o.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,N,I)},[]),(null==(l=t.inputArgs)||null==(e=l.hidden)?void 0:e.value)&&!s.current)?null:(s.current=!0,(0,n.jsx)(b,{className:"nb-dialog-overflow-hidden",ref:g,hidden:null==(a=t.inputArgs)||null==(i=a.hidden)?void 0:i.value,footer:x,header:S,...t,onCancel:()=>{N.close(t.result)},children:u}))},{displayName:"DialogWithContext"}),B=(null==t||null==(c=t.inputArgs)?void 0:c.viewUid)||`page-${P}`,$=(0,n.jsx)(C.I6,{engine:T,children:(0,n.jsx)(s.YQ,{context:I,children:(0,n.jsx)(D,{})})},B);return m=null==(p=e.current)?void 0:p.patchElement($),Object.assign(v,N)},l=o.useMemo(()=>({open:t}),[]),u=o.memo(o.forwardRef((e,t)=>{let[l,r]=S();return o.useImperativeHandle(t,()=>({patchElement:r}),[r]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(u,{ref:e},"dialog-holder")]}var M=l(97134),I=l(61793);let T=o.forwardRef((e,t)=>{var l;let{children:r,footer:i,title:a,extra:s,hidden:d,isMobile:u,...c}=e,[p,m]=o.useState(!0),[h,f]=o.useState(()=>i),[g,v]=o.useState({title:a,extra:s,...c.header});o.useImperativeHandle(t,()=>({destroy:()=>{m(!1)},update:e=>{Object.assign(c,e)},setFooter:e=>{f(e)},setHeader:e=>{0===Object.values(e||{}).length?v(null):v(e)}}),[]);let y=o.useMemo(()=>document.querySelector("#nocobase-app-container"),[]);return u?(0,n.jsx)(I.D,{className:d?"nb-hidden":"",visible:p,...c,footer:h,...g,onClose:c.onClose,children:r}):(0,n.jsx)(M.A,{rootClassName:d?"nb-hidden":"",closable:!1,getContainer:y,...c,open:p,footer:h,styles:{...c.styles,footer:{display:"flex",justifyContent:"flex-end",...null==(l=c.styles)?void 0:l.footer}},...g,onClose:c.onClose,children:r})});function R(){let e=o.useRef(null),t=o.useMemo(()=>i.observable.shallow({value:[]}),[]),l=o.memo(e=>{let{index:r}=e,[a,s]=o.useState(null);return(o.useEffect(()=>{(0,i.autorun)(()=>{let e=t.value;e[r]&&a!==e[r]&&s(e[r]),e[r]||s(null)})},[a,r]),a)?(0,n.jsx)(a,{children:(0,n.jsx)(l,{index:r+1})}):null});l.displayName="RenderNestedDrawer";let u=(t,l)=>{var u,c;let p,m,h=l.engine,f=o.createRef(),g=new Promise(e=>{m=e}),v=null,x=null,b=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return v=t,null==(e=f.current)||e.setFooter(t),()=>{var e;v=null,null==(e=f.current)||e.setFooter(null)}},[t]),null},S=e=>(o.useEffect(()=>{var t;return x=e,null==(t=f.current)||t.setHeader(e),()=>{var e;x=null,null==(e=f.current)||e.setHeader(null)}},[e]),null),P=new a.cB,j=(0,F._)(l.engine),M=(0,w.eX)(h,j);P.defineProperty("engine",{value:j}),P.addDelegate(j.context),!1!==t.inheritContext?P.addDelegate(l):(P.addDelegate(l.engine.context),A(P,l));let I=!1,R={type:"drawer",inputArgs:t.inputArgs||{},preventClose:!!t.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,r;if(I)return;I=!0,null==(l=t.onClose)||l.call(t),null==(n=f.current)||n.destroy(),null==p||p(),null==m||m(e);let i=null==M?void 0:M.emitter;(0,w.Z8)(i),null==i||null==(r=i.emit)||r.call(i,w.B9,{type:"drawer",viewUid:null==R||null==(o=R.inputArgs)?void 0:o.viewUid}),j.unlinkFromStack()},update:e=>{var t;return null==(t=f.current)?void 0:t.update(e)},close:async(e,l)=>{var n,o;return(!t.preventClose||!!l)&&!!await k(R,{result:e,force:l})&&(t.triggerByRouter&&(null==(o=t.inputArgs)||null==(n=o.navigation)?void 0:n.back)?t.inputArgs.navigation.back():R.destroy(e),!0)},Footer:b,Header:S,setFooter:e=>{var t;v=e,null==(t=f.current)||t.setFooter(e)},setHeader:e=>{var t;x=e,null==(t=f.current)||t.setHeader(e)},navigation:null==(u=t.inputArgs)?void 0:u.navigation,get record(){return(0,d.vE)(l,P)}};P.defineProperty("view",{get:()=>R,resolveOnServer:(0,d.Xx)(P,()=>(0,d.vE)(l,P))}),j.setDestroyView(()=>{var e,l;t.triggerByRouter&&(null==(l=t.inputArgs)||null==(e=l.navigation)?void 0:e.back)&&t.inputArgs.navigation.back(),R.destroy()}),y(P,R);let E=o.memo((0,i.observer)(e=>{var l,i,a,s;let d=o.useRef(!1),u="function"==typeof t.content?t.content(R,P):t.content,c="string"==typeof u?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(u)}}):u;return(o.useEffect(()=>{var e;null==(e=t.onOpen)||e.call(t,R,P)},[]),(null==(i=t.inputArgs)||null==(l=i.hidden)?void 0:l.value)&&!d.current)?(0,n.jsx)(n.Fragment,{children:e.children}):(d.current=!0,(0,n.jsxs)(T,{ref:f,...t,footer:v,header:t.header||x,hidden:null==(s=t.inputArgs)||null==(a=s.hidden)?void 0:a.value,onClose:()=>{R.close(t.result)},isMobile:P.isMobileLayout,children:[c,e.children]}))}));E.displayName="DrawerWithContext";let N=o.memo(e=>{let{children:t}=e;return(0,n.jsx)(C.I6,{engine:j,children:(0,n.jsx)(s.YQ,{context:P,children:(0,n.jsx)(E,{children:t})})})});return N.displayName="RenderDrawer",p=null==(c=e.current)?void 0:c.patchElement(N),Object.assign(g,R)},c=o.useMemo(()=>({open:u}),[]),p=o.memo(o.forwardRef((e,r)=>{let[i,a]=S();return o.useImperativeHandle(r,()=>({patchElement:a}),[a]),o.useEffect(()=>{t.value=i},[i]),(0,n.jsx)(l,{index:0})}));return[c,(0,n.jsx)(p,{ref:e},"drawer-holder")]}var E=l(40961),N=l(31333),D=l(71021);let B=(0,o.forwardRef)((e,t)=>{let[l,r]=o.useState({}),{visible:i=!0,footer:a=null,header:s=null,children:d,hidden:u,title:c,styles:p={},zIndex:m=4,onClose:h}={...e,...l},f=(0,o.useRef)(!1),g=(0,C.uf)(),[v,y]=(0,o.useState)(()=>a),[x,b]=(0,o.useState)(s);(0,o.useImperativeHandle)(t,()=>({destroy:()=>{f.current||(f.current=!0)},update:e=>{r(e)},setFooter:e=>{y(e)},setHeader:e=>{0===Object.values(e||{}).length?b(null):b(e)}}));let S=(0,o.useMemo)(()=>({display:u?"none":"flex",flexDirection:"column",height:"100%",zIndex:m}),[u,m]),w=(0,o.useMemo)(()=>{if(!x&&!c)return null;let{title:e=c,extra:t}=x||{},l=g.context.themeToken;return(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${l.paddingSM}px ${l.padding}px`,borderBottom:`1px solid ${l.colorSplit}`,backgroundColor:l.colorBgContainer,...p.header},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:l.marginXS},children:[(0,n.jsx)(D.Ay,{type:"text",size:"small",icon:(0,n.jsx)(N.A,{}),onClick:async()=>{f.current||!1!==await (null==h?void 0:h())&&(f.current=!0)},style:{color:l.colorTextTertiary}}),e&&(0,n.jsx)("div",{style:{fontSize:l.fontSizeLG,fontWeight:l.fontWeightStrong,color:l.colorText},children:e})]}),t&&(0,n.jsx)("div",{children:t})]})},[x,c,g.context.themeToken,p.header,h]),F=(0,o.useMemo)(()=>{if(!v)return null;let e=g.context.themeToken;return(0,n.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",padding:`${e.paddingXS}px ${e.padding}px`,borderTop:`1px solid ${e.colorSplit}`,backgroundColor:e.colorBgContainer,...p.footer},children:v})},[v,g.context.themeToken,p.footer]);return i?(0,n.jsxs)("div",{style:{...S,...p.content},children:[w,(0,n.jsx)("div",{style:{flex:1,overflowY:"auto",...p.body},children:d}),F]}):null}),$=0,O="nocobase-embed-container",q="nocobaseEmbedReplacing";function _(e){return!!e&&"function"==typeof e.then}function L(e,t){e.dataset[q]="1";try{let l=t.close();if(_(l))return Promise.resolve(l).finally(()=>{delete e.dataset[q]});return delete e.dataset[q],l}catch(t){throw delete e.dataset[q],t}}function V(e,t,l){let n,o={},r=e.then(e=>{let{page:t}=e;return(n=t)&&("beforeClose"in o&&(n.beforeClose=o.beforeClose),"update"in o&&n.update(o.update),"footer"in o&&n.setFooter(o.footer),"header"in o&&n.setHeader(o.header),o.destroyed&&n.destroy(o.destroyed.result)),{page:t}});return Object.assign(r.then(e=>{let{page:t}=e;return!!t&&t}),{type:"embed",inputArgs:t,preventClose:l,Header:null,Footer:null,get beforeClose(){return(null==n?void 0:n.beforeClose)??o.beforeClose},set beforeClose(value){n?n.beforeClose=value:o.beforeClose=value},close:(e,t)=>r.then(l=>{let{page:n}=l;return!!n&&n.close(e,t)}),destroy:e=>{n?n.destroy(e):o.destroyed={result:e}},update:e=>{n?n.update(e):o.update={...o.update,...e}},setFooter:e=>{n?n.setFooter(e):o.footer=e},setHeader:e=>{n?n.setHeader(e):o.header=e}})}let z=o.memo(o.forwardRef((e,t)=>{let[l,r]=S();return o.useImperativeHandle(t,()=>({patchElement:r}),[r]),(0,n.jsx)(n.Fragment,{children:l})}));function K(){let e=o.useRef(null),t=o.useRef(null),l=o.useRef(0),r=(r,u)=>{let{target:c,content:p,preventClose:m,inheritContext:h=!0,inputArgs:f={},onOpenCancelled:g,...v}=r,x=c instanceof HTMLElement&&c.id===O,b=()=>{var l,g,b;let S,P,j,M=null==u?void 0:u.engine;$+=1;let I=o.createRef(),T=new Promise(e=>{P=e}),R=e=>{let{children:t}=e;return o.useEffect(()=>{var e;return null==(e=I.current)||e.setFooter(t),()=>{var e;null==(e=I.current)||e.setFooter(null)}},[t]),null},N=e=>(o.useEffect(()=>{var t;return null==(t=I.current)||t.setHeader(e),()=>{var e;null==(e=I.current)||e.setHeader(null)}},[e]),null),D=new a.cB,O=(0,F._)(u.engine),_=(0,w.eX)(M,O);D.defineProperty("engine",{value:O}),D.addDelegate(O.context),h?D.addDelegate(u):(D.addDelegate(u.engine.context),A(D,u));let L=!1,V={type:"embed",inputArgs:f,preventClose:!!r.preventClose,beforeClose:void 0,destroy:e=>{var l,n,o,i,a;if(!L){if(L=!0,null==(l=r.onClose)||l.call(r),null==P||P(e),null==(n=I.current)||n.destroy(),null==S||S(),x&&t.current===V&&(t.current=null),!(x&&c instanceof HTMLElement&&(null==(o=c.dataset)?void 0:o[q])==="1")){let e=null==_?void 0:_.emitter;(0,w.Z8)(e),null==e||null==(a=e.emit)||a.call(e,w.B9,{type:"embed",viewUid:null==V||null==(i=V.inputArgs)?void 0:i.viewUid})}O.unlinkFromStack()}},update:e=>{var t;return null==(t=I.current)?void 0:t.update(e)},close:(e,t)=>L?Promise.resolve(!0):j||(j=(async()=>{try{var l,n;if(m&&!t)return j=void 0,!1;let o=await k(V,{result:e,force:t});if(L)return!0;if(!o)return j=void 0,!1;if(r.triggerByRouter&&(null==(n=r.inputArgs)||null==(l=n.navigation)?void 0:l.back))return r.inputArgs.navigation.back(),!0;return V.destroy(e),!0}catch(e){throw L||(j=void 0),e}})()),Header:N,Footer:R,setFooter:e=>{var t;null==(t=I.current)||t.setFooter(e)},setHeader:e=>{var t;null==(t=I.current)||t.setHeader(e)},navigation:null==(l=r.inputArgs)?void 0:l.navigation,get record(){return(0,d.vE)(u,D)}};D.defineProperty("view",{get:()=>V,resolveOnServer:(0,d.Xx)(D,()=>(0,d.vE)(u,D))}),y(D,V);let z=(0,i.observer)(()=>{var e,t,l,i;let a=o.useRef(!1),s=o.useMemo(()=>"function"==typeof p?p(V,D):p,[]);return(D.themeToken,o.useEffect(()=>{var e;null==(e=r.onOpen)||e.call(r,V,D)},[]),(null==(t=r.inputArgs)||null==(e=t.hidden)?void 0:e.value)&&!a.current)?null:(a.current=!0,(0,n.jsx)(B,{ref:I,hidden:null==(i=r.inputArgs)||null==(l=i.hidden)?void 0:l.value,...v,onClose:()=>V.close(r.result),children:s}))},{displayName:"PageWithContext"}),K=(null==f?void 0:f.viewUid)||`page-${$}`,U=(0,n.jsx)(C.I6,{engine:O,children:(0,n.jsx)(s.YQ,{context:D,children:(0,n.jsx)(z,{})})},K);return S=c&&c instanceof HTMLElement?null==(g=e.current)?void 0:g.patchElement(E.createPortal(U,c,K)):null==(b=e.current)?void 0:b.patchElement(U),x&&(t.current=V),Object.assign(T,V)};if(x&&t.current){let e,n=l.current+=1,o=()=>null==g?void 0:g();try{e=L(c,t.current)}catch(e){throw o(),e}if(_(e))return V(Promise.resolve(e).then(e=>!1===e||n!==l.current?(o(),{page:null}):{page:b()},e=>{throw o(),e}),f,!!r.preventClose);if(!1===e)return o(),V(Promise.resolve({page:null}),f,!!r.preventClose)}return b()};return[o.useMemo(()=>({open:r}),[]),(0,n.jsx)(z,{ref:e},"page-holder")]}var U=l(28073);let W=0,H=o.forwardRef((e,t)=>{var l,r;let{afterClose:i,content:a,placement:s,rect:d,...u}=e,[c,p]=o.useState(!0),[m,h]=o.useState({content:a,placement:s,rect:d,...u});return o.useImperativeHandle(t,()=>({destroy:()=>p(!1),update:e=>h(t=>({...t,...e})),close:(e,t)=>p(!1)})),o.useEffect(()=>{c||null==i||i()},[c,i]),(0,n.jsx)(U.A,{arrow:!1,open:c,trigger:["click"],destroyTooltipOnHide:!0,content:m.content,placement:m.placement,getPopupContainer:()=>document.querySelector("#nocobase-app-container")||document.body,onOpenChange:e=>{(e||!m.preventClose)&&(p(e),e||null==i||i())},...m,children:(0,n.jsx)("span",{style:{position:"absolute",top:((null==(l=m.rect)?void 0:l.top)??0)+window.scrollY,left:((null==(r=m.rect)?void 0:r.left)??0)+window.scrollX,width:0,height:0}})})});function G(){let e=o.useRef(null),t=t=>{var l,i;let a,s;W+=1;let{target:d,placement:u="rightTop",content:c,...p}=t,m=o.createRef(),h=(null==d||null==(l=d.getBoundingClientRect)?void 0:l.call(d))??{top:0,left:0},f=new Promise(e=>{s=e}),g={type:"popover",destroy:()=>{var e;return null==(e=m.current)?void 0:e.destroy()},update:e=>{var t;return null==(t=m.current)?void 0:t.update(e)},close:e=>{var t;null==s||s(e),null==(t=m.current)||t.close(e)}},v="function"==typeof c?c(g):c,y="string"==typeof v?(0,n.jsx)("div",{dangerouslySetInnerHTML:{__html:r.A.sanitize(v)}}):v,x=(0,n.jsx)(H,{ref:m,content:y,placement:u,rect:h,afterClose:()=>{var e;null==a||a(),null==(e=t.onClose)||e.call(t),null==s||s(t.result)},...p},`popover-${W}`);return a=null==(i=e.current)?void 0:i.patchElement(x),Object.assign(f,g)},l=o.useMemo(()=>({open:t}),[]),i=o.memo(o.forwardRef((e,t)=>{let[l,r]=S();return o.useImperativeHandle(t,()=>({patchElement:r}),[]),(0,n.jsx)(n.Fragment,{children:l})}));return[l,(0,n.jsx)(i,{ref:e},"popover-holder")]}var Y=l(52847);function J(e){return null==e?"":e&&"object"==typeof e&&!Array.isArray(e)?encodeURIComponent(Object.entries(e).map(e=>{let[t,l]=e;return`${encodeURIComponent(String(t))}=${encodeURIComponent(String(l))}`}).join("&")):encodeURIComponent(String(e))}function X(e){return null!=e&&""!==String(e)}function Q(e){let t=e||"/admin";return`/${t.replace(/^\/+/,"").replace(/\/+$/,"")}`}function Z(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=Q(t.basePath||t.prefix);if(!e||0===e.length)return l;let n=l.replace(/^\/+/,"").split("/").filter(Boolean);return e.forEach((e,t)=>{if(t>0&&n.push("view"),n.push(e.viewUid),e.tabUid&&n.push("tab",e.tabUid),null!=e.filterByTk){let t=J(e.filterByTk);t&&n.push("filterbytk",t)}X(e.sourceId)&&n.push("sourceid",String(e.sourceId))}),"/"+n.join("/")}class ee{setViewStack(e){this.viewStack=Object.freeze([...e]),this.viewParams=this.viewStack[this.viewStack.length-1]||{}}changeTo(e){let t=Z(this.viewStack.map((t,l)=>l===this.viewStack.length-1?{...t,...e}:{...t}),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(t,{replace:!0})}navigateTo(e,t){let l=Z([...this.viewStack,e],{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(l,t)}back(){let e=Z(this.viewStack.slice(0,-1),{basePath:this.getLayoutBasePath()});this.ctx.router.navigate(e,{replace:!0})}getLayoutBasePath(){var e,t;let l=null==(e=this.ctx.layout)?void 0:e.routePath;return this.basePath||(null==(t=this.ctx.layoutRoute)?void 0:t.basePathname)||((null==l?void 0:l.startsWith("/"))?l:"/admin")}constructor(e,t,l={}){this.setViewStack(t),this.ctx=e,this.basePath=l.basePath||l.layoutBasePath,(0,Y.E8)(this,{viewParams:Y.sH})}}},16639(e,t,l){"use strict";l.d(t,{B9:()=>o,FH:()=>s,HK:()=>r,Z8:()=>d,eX:()=>p,i6:()=>i,tb:()=>n});let n=Symbol.for("__NOCOBASE_VIEW_ACTIVATED_VERSION__"),o="view:activated",r="dataSource:dirty",i="__NOCOBASE_ENGINE_SCOPE__",a="view";function s(e){let t=Reflect.get(e,n),l="number"==typeof t?t:Number(t);return Number.isFinite(l)&&l>0?l:0}function d(e){let t=s(e);if(!Object.isExtensible(e))return t;let l=t+1;return Reflect.set(e,n,l),l}function u(e){return Reflect.get(e,i)===a}function c(e){let t=e,l=0;for(;t&&l++<50;){if(u(t))return t;t=t.previousEngine}}function p(e,t){if(!e)return;let l=c(e);return l||c(null==t?void 0:t.previousEngine)||e}},40542(e,t,l){"use strict";l.d(t,{D:()=>n});let n=(e,t,l)=>{if(!e)return l;let o=t.split("."),r=[],i=e,a=!1;for(let e=0;e<o.length;e++){let t=o[e];if(Array.isArray(i)){for(let t of(a=!0,i)){let i=n(t,o.slice(e).join("."),l);r=r.concat(i)}break}if((null==i?void 0:i[t])===void 0)break;i=i[t],e===o.length-1&&r.push(i)}return 0===(r=r.filter(e=>void 0!==e)).length?l:a?r.filter(e=>null!==e):r[0]}},96436(e,t,l){"use strict";l.r(t),l.d(t,{getDayRange:()=>tl,isEmptyFilter:()=>ed,sleep:()=>es,getDateVars:()=>ta,isString:()=>ee,unflatten:()=>e4,sortTree:()=>ea,forEach:()=>eA,utc2unit:()=>to,extractUsedVariablePaths:()=>tM,getValuesByPath:()=>eP,isArray:()=>et,moment2str:()=>ex,transformLiquidContext:()=>tT,isURL:()=>tC,isPortalInBody:()=>ty,extractUsedVariableNames:()=>tj,parseHTML:()=>tx,toGmt:()=>ep,isPlainObject:()=>en,lockdownSes:()=>tf,splitPathToTwoParts:()=>ts,transformFilter:()=>Y,parseSQLBindParams:()=>tN,getPickerFormat:()=>eC,nextTick:()=>er,removeNullCondition:()=>eu,CollectionsGraph:()=>V,isValidFilter:()=>eE,evaluateConditions:()=>Z,toUnit:()=>tr,BASE_BLOCKED_IDENTIFIERS:()=>tp,getFormatFromDateStr:()=>ek,removeInvalidFilterItems:()=>J,toLocal:()=>em,getDayRangeByParams:()=>_,getDefaultFormat:()=>ec,transformMultiColumnToSingleColumn:()=>tA,treeFind:()=>ei,transformSQL:()=>tD,parseFilter:()=>tt,flatten:()=>e5,getOffsetRangeByParams:()=>B,isEmpty:()=>el,offsetFromString:()=>eb,tval:()=>tg,error:()=>eL,Registry:()=>td,lodash:()=>o(),parse:()=>e$,hasEmptyValue:()=>eo,toFixedByStep:()=>eJ,getDateTimeFormat:()=>eF,showToast:()=>eH,Handlebars:()=>eI(),getLiquidContext:()=>tR,merge:()=>eU,dayjs:()=>i(),parseLiquidContext:()=>tE,uid:()=>tw,str2moment:()=>eg});var n=l(2543),o=l.n(n),r=l(74353),i=l.n(r),a=l(97375),s=l.n(a),d=l(90445),u=l.n(d),c=l(43522),p=l.n(c),m=l(37872),h=l.n(m),f=l(98867),g=l.n(f),v=l(8906),y=l.n(v),x=l(68313),b=l.n(x),S=l(21840),w=l.n(S),C=l(41816),F=l.n(C),k=l(88569),A=l.n(k),P=l(83826),j=l.n(P),M=l(8134),I=l.n(M),T=l(28623),R=l.n(T),E=l(46986),N=l.n(E);i().extend(N()),i().extend(w()),i().extend(A()),i().extend(j()),i().extend(F()),i().extend(b()),i().extend(h()),i().extend(g()),i().extend(y()),i().extend(I()),i().extend(R()),i().extend(u()),i().extend(s()),i().extend(p());let D=e=>{if(!e)return i()();if(/^[+-]\d{2}:\d{2}$/.test(e)){let[t,l,n]=e.match(/([+-])(\d{2}):(\d{2})/).slice(1),o=(60*parseInt(l)+parseInt(n))*("+"===t?1:-1);return i()().utcOffset(o)}return i()().tz(e)},B=e=>{let t,l,{type:n,unit:o="day",number:r=1,timezone:i}=e,a=D(i),s="week"===o?"isoWeek":o;if("past"===n){let e=a.startOf(s);t=e.subtract(r,o).startOf(s),l=e.subtract(1,o).endOf(s)}else if("next"===n)l=(t=a.startOf(s).add(1,o).startOf(s)).add(r-1,o).endOf(s);else throw Error(`Unsupported type: ${n}`);return[t.format("YYYY-MM-DD HH:mm:ss"),l.format("YYYY-MM-DD HH:mm:ss")]},$=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).startOf(t)},O=(e,t,l)=>{let n="isoWeek"===t?"week":t;return D(l).add(e,n).endOf(t)},q={today:e=>[$(0,"day",null==e?void 0:e.timezone),O(0,"day",null==e?void 0:e.timezone)],yesterday:e=>[$(-1,"day",null==e?void 0:e.timezone),O(-1,"day",null==e?void 0:e.timezone)],tomorrow:e=>[$(1,"day",null==e?void 0:e.timezone),O(1,"day",null==e?void 0:e.timezone)],thisWeek:e=>[$(0,"isoWeek",null==e?void 0:e.timezone),O(0,"isoWeek",null==e?void 0:e.timezone)],lastWeek:e=>[$(-1,"isoWeek",null==e?void 0:e.timezone),O(-1,"isoWeek",null==e?void 0:e.timezone)],nextWeek:e=>[$(1,"isoWeek",null==e?void 0:e.timezone),O(1,"isoWeek",null==e?void 0:e.timezone)],thisMonth:e=>[$(0,"month",null==e?void 0:e.timezone),O(0,"month",null==e?void 0:e.timezone)],lastMonth:e=>[$(-1,"month",null==e?void 0:e.timezone),O(-1,"month",null==e?void 0:e.timezone)],nextMonth:e=>[$(1,"month",null==e?void 0:e.timezone),O(1,"month",null==e?void 0:e.timezone)],thisQuarter:e=>[$(0,"quarter",null==e?void 0:e.timezone),O(0,"quarter",null==e?void 0:e.timezone)],lastQuarter:e=>[$(-1,"quarter",null==e?void 0:e.timezone),O(-1,"quarter",null==e?void 0:e.timezone)],nextQuarter:e=>[$(1,"quarter",null==e?void 0:e.timezone),O(1,"quarter",null==e?void 0:e.timezone)],thisYear:e=>[$(0,"year",null==e?void 0:e.timezone),O(0,"year",null==e?void 0:e.timezone)],lastYear:e=>[$(-1,"year",null==e?void 0:e.timezone),O(-1,"year",null==e?void 0:e.timezone)],nextYear:e=>[$(1,"year",null==e?void 0:e.timezone),O(1,"year",null==e?void 0:e.timezone)]},_=e=>{if("past"===e.type||"next"===e.type)return B(e);let t=q[e.type];if(!t)throw Error(`Unsupported type: ${e.type}`);let[l,n]=t(e);return[l.format("YYYY-MM-DD HH:mm:ss"),n.format("YYYY-MM-DD HH:mm:ss")]};var L=l(38362);class V{static graphlib(){return L}static connectedNodes(e){let t=(0,n.castArray)(e.nodes),l=(0,n.castArray)(e.excludes||[]),o=V.build(e),r=new Set;for(let e of t)for(let t of L.alg.preorder(o,e))l.includes(t)||r.add(t);return Array.from(r)}static preOrder(e){return V.graphlib().alg.preorder(V.build(e),e.node)}static build(e){let t=e.collections,l="forward"===((null==e?void 0:e.direction)||"forward"),n=new L.Graph;for(let e of t)n.setNode(e.name);for(let e of t){for(let t of e.inherits||[])l?n.setEdge(e.name,t):n.setEdge(t,e.name);for(let t of e.fields||[])if(("hasMany"===t.type||"belongsTo"===t.type||"hasOne"===t.type)&&(l?n.setEdge(e.name,t.target):n.setEdge(t.target,e.name)),"belongsToMany"===t.type){let o=t.through;l?(n.setEdge(e.name,o),n.setEdge(o,t.target)):(n.setEdge(t.target,o),n.setEdge(o,e.name))}}return n}}var z=l(81814),K=l.n(z);function U(e){return"path"in e&&"operator"in e}function W(e){return"logic"in e&&"items"in e}function H(e){let{path:t,operator:l,value:n}=e;return{[t]:{[l]:n}}}function G(e){let{logic:t,items:l}=e;return{[t]:l.map(e=>{if(U(e))return H(e);if(W(e))return G(e);throw Error("Invalid filter item type")})}}function Y(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return eu(G(e))}function J(e){if(!e||"object"!=typeof e)throw Error("Invalid filter: filter must be an object");if(!W(e))throw Error("Invalid filter: filter must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid filter: items must be an array");return e.items=e.items.filter(e=>U(e)?!!e.operator:!!W(e)&&J(e)),{...e}}function X(e,t){let{path:l,operator:n,value:o}=e;return t(l,n,o)}function Q(e,t){let{logic:l,items:n}=e;if(!n||0===n.length)return!0;let o=n.map(e=>{if(U(e))return X(e,t);if(W(e))return Q(e,t);throw Error("Invalid filter item type")});if("$and"===l)return o.every(e=>!0===e);if("$or"===l)return o.some(e=>!0===e);throw Error(`Unsupported logic operator: ${l}`)}function Z(e,t){if(!e||"object"!=typeof e)throw Error("Invalid conditions: conditions must be an object");if(!W(e))throw Error("Invalid conditions: conditions must have logic and items properties");if(!Array.isArray(e.items))throw Error("Invalid conditions: items must be an array");if("function"!=typeof t)throw Error("Invalid evaluator: evaluator must be a function");return Q(e,t)}let ee=e=>"string"==typeof e,et=e=>Array.isArray(e),el=e=>en(e)?0===Object.keys(e).length:!!Array.isArray(e)&&0===e.length,en=e=>{if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},eo=e=>{let t=!0;for(let l in e){if(t=!1,et(e[l])&&0===e[l].length||!e[l])return!0;if(en(e[l])||et(e[l]))return eo(e[l])}return t},er=e=>{setTimeout(e)};function ei(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return;let{childrenKey:n="children"}=l;for(let o of Array.isArray(e)?[...e]:[e]){if(t(o))return o;let e="function"==typeof n?n(o):o[n];if(Array.isArray(e)&&e.length>0){let n=ei(e,t,l);if(void 0!==n)return n}}}function ea(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"children",n=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return e&&Array.isArray(e)&&0!==e.length?o().orderBy(e,t,n?"asc":"desc").map(e=>e[l]&&e[l].length>0?{...e,[l]:ea(e[l],t,l,n)}:e):e}function es(e){return new Promise(t=>{setTimeout(t,e)})}function ed(e){return!!(!e||"$and"in e&&o().isEmpty(e.$and)||"$or"in e&&o().isEmpty(e.$or))}let eu=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:K(),l=t(e||{}),n={};for(let e in l){let t=l[e];null==t||el(t)||""===t||(n[e]=t)}let r=t.unflatten(n);for(let e in r)Array.isArray(r[e])&&(r[e]=r[e].filter(e=>null!=e));return o().isEmpty(r)?void 0:r},ec=e=>e.format?e.format:e.dateFormat?e.showTime?`${e.dateFormat} ${e.timeFormat||"HH:mm:ss"}`:e.dateFormat:"month"===e.picker?"YYYY-MM":"quarter"===e.picker?"YYYY-\\QQ":"year"===e.picker?"YYYY":"week"===e.picker?"YYYY[W]W":e.showTime?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD",ep=e=>e&&i().isDayjs(e)?`${e.format("YYYY-MM-DD")}T${e.format("HH:mm:ss.SSS")}Z`:e,em=e=>e?Array.isArray(e)?e.map(e=>e.startOf("second").toISOString()):i().isDayjs(e)?e.startOf("second").toISOString():void 0:e,eh=e=>{try{let t=parseInt(e.slice(0,4)),l=parseInt(e.slice(-1));return i()().quarter(l).year(t)}catch(e){return null}},ef=(e,t)=>{if(!e)return;let l=t.utcOffset,{gmt:n,picker:o,utc:r=!0,dateOnly:a}=t;if(!i()(e).isValid())return eh(e);if(a){let t=i()(e);if(!t.isValid())return e;let l=t.format("YYYY-MM-DD");return i().utc(l,"YYYY-MM-DD")}return r?i().isDayjs(e)?l?e.utcOffset(eb(l)):e:n?i()(e).utcOffset(0):l?i()(e).utcOffset(eb(l)):i()(e):i()(e)},eg=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Array.isArray(e)?e.map(e=>ef(e,t)):e?ef(e,t):e},ev=(e,t)=>"year"===t?e.format("YYYY")+"-01-01T00:00:00.000Z":"month"===t||"quarter"===t?e.format("YYYY-MM")+"-01T00:00:00.000Z":e.format("YYYY-MM-DD")+"T00:00:00.000Z",ey=(e,t)=>e?Array.isArray(e)?e.map(e=>ev(e,t)):i().isDayjs(e)?ev(e,t):void 0:e,ex=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{showTime:l,gmt:n,picker:o}=t;return e?l?n?ep(e):em(e):ey(e,o):e};function eb(e){if(!o().isString(e))return e;let t=/([+-]|\d\d)/gi,l=/Z|[+-]\d\d(?::?\d\d)?/gi,n=/[+-]?\d+(\.\d{1,3})?/,r=(e||"").match(l);if(null===r&&(r=(e||"").match(n)),null===r)return null;let i=((r[r.length-1]||[])+"").match(t)||["-",0,0],a=+(60*Number(i[1]))+eS(i[2]);return 0===a?0:"+"===i[0]?a:-a}function eS(e){let t=+e,l=0;return 0!==t&&isFinite(t)&&(l=ew(t)),l}function ew(e){return e<0?Math.ceil(e)||0:Math.floor(e)}let eC=e=>{switch(e){case"week":return"YYYY[W]W";case"month":return"YYYY-MM";case"quarter":return"YYYY[Q]Q";case"year":return"YYYY";default:return"YYYY-MM-DD"}},eF=(e,t,l,n)=>"date"===e&&l?`${t} ${n||"HH:mm:ss"}`:t;function ek(e){return/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/.test(e)?"YYYY-MM-DD HH:mm:ss":/^\d{4}-\d{2}-\d{2}$/.test(e)?"YYYY-MM-DD":/^\d{4}-\d{2}$/.test(e)?"YYYY-MM":/^\d{4}$/.test(e)?"YYYY":/^\d{4}Q[1-4]$/.test(e)?"YYYY[Q]Q":/^\d{4}-\d{2}-\d{2}T/.test(e)?"YYYY-MM-DDTHH:mm:ss.SSSZ":null}let eA=(e,t)=>{Array.isArray(e)?e.forEach(t):Object.keys(e).forEach(l=>{t(e[l],l)})},eP=(e,t,l)=>{if(!e)return l;let n=t.split("."),o=[],r=e,i=!1;for(let e=0;e<n.length;e++){let t=n[e];if(Array.isArray(r)){for(let t of(i=!0,r)){let r=eP(t,n.slice(e).join("."),l);o=o.concat(r)}break}if((null==r?void 0:r[t])===void 0)break;r=r[t],e===n.length-1&&o.push(r)}return 0===(o=o.filter(e=>void 0!==e)).length?l:i?o.filter(e=>null!==e):o[0]};var ej=l(88835),eM=l(60639),eI=l.n(eM),eT=l(79441);let eR=l.n(eT)()();function eE(e){if(!e)return!1;let t=[e.$and,e.$or].filter(Boolean);return 0==t.length?Object.keys(e).length>0:t.some(e=>{if(Array.isArray(e))return e.some(eE);if(e.$and||e.$or)return eE(e);let[t]=Object.keys(e);if(!t||!e[t])return!1;let[l]=Object.keys(e[t]);return!!l&&void 0!==e[t][l]})}function eN(e){let t=typeof e;return Array.isArray(e)?t="array":e instanceof Date?t="date":null===e&&(t="null"),t}function eD(e){let t=e.substr(2,e.length-4).trim(),l=t.indexOf(":");return -1!==l?{key:t.substr(0,l),defaultValue:t.substr(l+1)}:{key:t}}function eB(e,t){return e.parameters=Array.from(new Map(t.map(e=>[e.key,e])).values()),e}function e$(e){switch(eN(e)){case"string":return eO(e);case"object":return eq(e);case"array":return e_(e);default:return eB(function(){return e},[])}}Object.keys(eR).forEach(function(e){eI().registerHelper(e,eR[e])}),eI().registerHelper("json",function(e){return JSON.stringify(e)}),eI().registerHelper("urlParse",function(e){try{return JSON.stringify(ej.parse(e))}catch(t){return`Invalid URL: ${e}`}}),eI().registerHelper("dateFormat",(e,t,l)=>"string"==typeof l?i()(e).tz(l).format(t):i()(e).format(t)),eI().registerHelper("isNull",e=>o().isNull(e));let eO=(()=>{let e=/{{(\w|:|[\s-+.,@/()?=*_$])+}}/g;return t=>{let l=[],o=e=>t,r=t.match(e);return r&&(l=r.map(eD),o=e=>(e=e||{},r.reduce((o,i,a)=>{let s=l[a],d=(0,n.get)(e,s.key);return(void 0===d&&(d=s.defaultValue),"function"==typeof d&&(d=d()),1===r.length&&t.startsWith("{{")&&t.endsWith("}}"))?d:(d instanceof Date&&(d=d.toISOString()),o.replace(i,null==d?"":d))},t))),eB(o,l)}})();function eq(e){let t=Object.keys(e).map(t=>({keyTemplate:eO(t),valueTemplate:e$(e[t])}));return eB(e=>t.reduce((t,l)=>(t[l.keyTemplate(e)]=l.valueTemplate(e),t),{}),t.reduce((e,t)=>e.concat(t.valueTemplate.parameters,t.keyTemplate.parameters),[]))}function e_(e){let t=e.map(e$);return eB(e=>t.map(t=>t(e)),t.reduce((e,t)=>e.concat(t.parameters),[]))}let eL=function(e){for(var t=arguments.length,l=Array(t>1?t-1:0),n=1;n<t;n++)l[n-1]=arguments[n];console.error(e,...l)};var eV=l(14744),ez=l.n(eV);let eK=(e,t,l)=>t;function eU(e,t,l){return ez()(e,t,{arrayMerge:eK,...l})}var eW=l(98892);let eH=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;eW.Ay[t]({message:e,duration:l})};var eG=l(5062),eY=l(85738);function eJ(e,t){if(null==e||""===e)return"";let l=(0,eG.i5)(t);return(0,eY.Mg)(String(e),".",l)}var eX=l(63560),eQ=l.n(eX),eZ=l(95093),e0=l.n(eZ);let e1=/^\s*\{\{([\s\S]*)\}\}\s*$/;function e2(e){return e&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function e8(e){return e}function e5(e,t){let l=(t=t||{}).delimiter||".",n=t.maxDepth,r=t.transformKey||e8,i=t.transformValue||e8,a={};function s(e,d,u){u=u||1,o().isObjectLike(e)&&Object.keys(e).forEach(function(o){var c;let p=e[o],m=t.safe&&Array.isArray(p),h=Object.prototype.toString.call(p),f=e2(p),g="[object Object]"===h||"[object Array]"===h,v=d?d+l+r(o):r(o);if(null==(c=t.breakOn)?void 0:c.call(t,{key:o,value:p,path:v})){a[v]=i(p,v);return}if(!m&&!f&&g&&Object.keys(p).length&&(!t.maxDepth||u<n))return s(p,v,u+1);a[v]=i(p,v)})}return s(e),a}function e4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l={},n=t.transformValue||e8;for(let t of Object.keys(e))eQ()(l,t,n(e[t],t));return l}let e3=e=>{let t=e.split(".").pop()||"";return t.startsWith("$")||(t=""),{operator:t}},e6=e=>["$dateOn","$dateNotOn","$dateBefore","$dateAfter","$dateNotBefore","$dateNotAfter","$dateBetween"].includes(e);function e9(e){return e instanceof Date||"[object Date]"===Object.prototype.toString.call(e)}function e7(e){return(null==e?void 0:e.type)==="dateOnly"||(null==e?void 0:e.type)==="datetimeNoTz"||(null==e?void 0:e.constructor.name)==="DateOnlyField"||(null==e?void 0:e.constructor.name)==="DatetimeNoTzField"}let te=(e,t)=>e?(e.type&&(e=_({...e,timezone:t})),Array.isArray(e))?(2===e.length?e.push("[]",t):3===e.length&&e.push(t),e):"string"==typeof e?!t||/(\+|-)\d\d:\d\d$/.test(e)?e:e+t:e9(e)?e.toISOString():void 0:null,tt=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=new Set,n=t.vars||{},o=t.timezone,r=t.now,i=t.getField,a=e5(e,{breakOn(e){let{key:t}=e;return t.startsWith("$")&&"$and"!==t&&"$or"!==t},transformValue(e){if("string"!=typeof e)return e;let t=e1.exec(e);if(t){let e=t[1].trim();e.startsWith("$user")&&l.add(e.substring(6))}return e}});if(l.size>0){let e=await n.$user({fields:[...l.values()]});Object.assign(n,{$user:e})}return e4(a,{transformValue(e,t){let{operator:l}=e3(t);if("string"==typeof e){let a=e1.exec(e);if(a){let s=eP(n,a[1].trim(),null),d=null==i?void 0:i(t);e="function"==typeof s?null==s?void 0:s({field:d,operator:l,timezone:o,now:r}):s}}if(e6(l)){let l=null==i?void 0:i(t);return e7(l)?e.type?_({...e,timezone:(null==l?void 0:l.timezone)||o}):e:te(e,(null==l?void 0:l.timezone)||o)}return e}})};function tl(e){let{now:t,timezone:l="+00:00",offset:n}=e,o=tn(t).utcOffset(eb(l));return n>0?[(o=o.add(1,"day").startOf("day")).format("YYYY-MM-DD"),o.clone().add(n,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]:[o.clone().subtract(-1*n-1,"day").startOf("day").format("YYYY-MM-DD"),o.clone().add(1,"day").startOf("day").format("YYYY-MM-DD"),"[)",l]}function tn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return e?i().isDayjs(e)?e:t?e0()(e):i()(e):t?e0()():i()()}function to(e){var t;let{now:l,unit:n,timezone:o="+00:00",offset:r}=e,i=tn(l,"isoWeek"===n);i=(i=i.utcOffset(eb(o))).startOf(n),r>0?i=i.add(r,n):r<0&&(i=i.subtract(-1*r,n));let a={year:()=>i.format("YYYY"),quarter:()=>i.format("YYYY[Q]Q"),month:()=>i.format("YYYY-MM"),week:()=>i.format("gggg[w]ww"),isoWeek:()=>i.format("GGGG[W]WW"),day:()=>i.format("YYYY-MM-DD")},s=null==(t=a[n])?void 0:t.call(a);return o?s+o:s}let tr=(e,t)=>l=>{let{now:n,timezone:o,field:r}=l;return(null==r?void 0:r.timezone)&&(o=null==r?void 0:r.timezone),to({now:n,timezone:o,unit:e,offset:t})},ti=e=>t=>{let{now:l,timezone:n,field:o}=t;return(null==o?void 0:o.timezone)&&(n=null==o?void 0:o.timezone),tl({now:l,timezone:n,offset:e})};function ta(){return{now:new Date().toISOString(),today:tr("day"),yesterday:tr("day",-1),tomorrow:tr("day",1),thisWeek:tr("week"),lastWeek:tr("week",-1),nextWeek:tr("week",1),thisIsoWeek:tr("isoWeek"),lastIsoWeek:tr("isoWeek",-1),nextIsoWeek:tr("isoWeek",1),thisMonth:tr("month"),lastMonth:tr("month",-1),nextMonth:tr("month",1),thisQuarter:tr("quarter"),lastQuarter:tr("quarter",-1),nextQuarter:tr("quarter",1),thisYear:tr("year"),lastYear:tr("year",-1),nextYear:tr("year",1),last7Days:ti(-7),next7Days:ti(7),last30Days:ti(-30),next30Days:ti(30),last90Days:ti(-90),next90Days:ti(90)}}function ts(e){let t=e.split(".");return[t.shift(),t.join(".")]}class td{register(e,t){if(!this.options.override&&this.map.has(e))throw Error(`this registry does not allow to override existing keys: "${e}"`);this.map.set(e,t)}get(e){return this.map.get(e)}getKeys(){return this.map.keys()}getValues(){return this.map.values()}getEntities(){return this.map.entries()}constructor(e={override:!1}){this.map=new Map,this.options=e}}l(67980);let tu=Symbol.for("nocobase.utils.sesLockdown"),tc=Symbol.for("nocobase.utils.bufferOverrides"),tp=["globalThis","global","self","Function","AsyncFunction","GeneratorFunction","eval","Compartment","lockdown","harden","assert"];function tm(e){return!!e&&"object"==typeof e&&(e.message||"").includes("(SES_ALREADY_LOCKED_DOWN)")}function th(){let e=globalThis;if(e[tc])return;let t=e.Buffer;if(!t||!t.prototype)return;let l=t.prototype;for(let e of Reflect.ownKeys(l)){let t=Object.getOwnPropertyDescriptor(l,e);if(!t||"function"!=typeof t.value||!t.configurable)continue;let n=t.value,o=function(){return n},r=function(t){if(this===l)throw TypeError(`Cannot assign to read only property '${String(e)}' of object 'Buffer.prototype'`);Object.defineProperty(this,e,{configurable:!0,enumerable:!0,writable:!0,value:t})};Object.defineProperty(o,"originalValue",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(l,e,{configurable:t.configurable,enumerable:t.enumerable,get:o,set:r})}e[tc]=!0}function tf(e){th();let t=globalThis;if(!t[tu]){if("function"!=typeof lockdown)throw Error("SES lockdown is unavailable in the current runtime environment.");try{lockdown(e)}catch(e){if(!tm(e))throw e}t[tu]=!0}}function tg(e,t){return t?`{{t(${JSON.stringify(e)}, ${JSON.stringify(t)})}}`:`{{t(${JSON.stringify(e)})}}`}var tv=l(65606);let ty=e=>{for(;e;){var t;if("root"===e.id||(null==(t=e.classList)?void 0:t.contains("nb-action")))return!1;e=e.parentNode}return!tv.env.__TEST__};function tx(e,t){return e.replace(/\{\{(\w+)\}\}/g,function(e,l){return void 0!==t[l]?t[l]:e})}let tb=36,tS="";for(;tb--;)tS+=tb.toString(36);function tw(e){let t="",l=e||11;for(;l--;)t+=tS[36*Math.random()|0];return t}function tC(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}var tF=l(27153),tk=JSON.parse('{"rE":"2.1.0-beta.42"}');let tA=(e,t)=>{if(!e)return e;if("Grid"!==e["x-component"])return Object.keys(e.properties||{}).forEach(l=>{e.properties[l]=tA(e.properties[l],t)}),e;let l=e.parent;e=e.toJSON?e.toJSON():o().cloneDeep(e);let n={},{properties:r={}}=e,i=0;if(Object.keys(r).forEach((e,l)=>{let a=r[e];if("Grid.Row"!==a["x-component"]){a["x-index"]=++i,n[e]=a;return}if(a.properties){if(1===Object.keys(a.properties).length){a["x-index"]=++i,n[e]=a;return}Object.keys(a.properties).forEach((l,r)=>{let s=a.properties[l];if(o().set(s,"x-component-props.width",100),0===r){a["x-index"]=++i,n[e]=a;return}null!=t&&t(s)||(delete a.properties[l],n[`${tw()}_${l}`]=tP(s,l,++i))})}}),e.properties=n,l){let t=new tF.Schema(e,l);return l.properties&&Object.keys(l.properties).forEach(n=>{n===e.name&&(l.properties[n]=t)}),t}return e};function tP(e,t,l){return{type:"void",version:"2.0","x-component":"Grid.Row","x-app-version":tk.rE,"x-uid":tw(),"x-async":!1,"x-index":l,_isJSONSchemaObject:!0,properties:{[t]:e}}}function tj(e){let t=new Set,l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)/g;for(;null!==(e=r.exec(o));)t.add(e[1]);let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]/g;for(;null!==(n=i.exec(o));)t.add(n[2])}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}function tM(e){let t={},l=e=>{if("string"==typeof e){let l,n=/\{\{\s*([^}]+?)\s*\}\}/g;for(;null!==(l=n.exec(e));){let e,n,o=l[1],r=/ctx\.([a-zA-Z_$][a-zA-Z0-9_$]*)([^\s)]*)/g;for(;null!==(e=r.exec(o));){let l=e[1],n=e[2]||"";if(t[l]=t[l]||[],n.startsWith("."))t[l].push(n.slice(1));else if(n.startsWith("[")){let e=n.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(e){let n=e[2],o=e[3]||"";t[l].push(`${n}${o}`)}else{let e=n.match(/^\[(\d+)\](.*)$/);if(e){let n=e[1],o=e[2]||"";t[l].push(`[${n}]${o}`)}}}else n.startsWith("(")&&!t[l].length&&t[l].push("")}let i=/ctx\[\s*(["'])\s*([a-zA-Z_$][a-zA-Z0-9_$]*)\s*\1\s*\]([^\s)]*)/g;for(;null!==(n=i.exec(o));){let e=n[2],l=n[3]||"";if(t[e]=t[e]||[],l.startsWith("."))t[e].push(l.slice(1));else if(l.startsWith("[")){let n=l.match(/^\[\s*(["'])\s*([^'"\]]+)\s*\1\s*\](.*)$/);if(n){let l=n[2],o=n[3]||"";t[e].push(`${l}${o}`)}else{let n=l.match(/^\[(\d+)\](.*)$/);if(n){let l=n[1],o=n[2]||"";t[e].push(`[${l}]${o}`)}}}else l.startsWith("(")&&!t[e].length&&t[e].push("")}}}else Array.isArray(e)?e.forEach(l):e&&"object"==typeof e&&Object.values(e).forEach(l)};return l(e),t}let tI=new(l(23155)).HX;function tT(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t={};for(let l of e){let e=l.replace(/^ctx\./,"").split("."),n=t;for(let t=0;t<e.length;t++){let o=e[t];t===e.length-1?n[o]=`{{${l}}}`:(n[o]=n[o]||{},n=n[o])}}return t}async function tR(e){return tT(await tI.fullVariables(e))}async function tE(e,t){return await tI.parseAndRender(e,{ctx:t})}function tN(e){let t=1,l={};return{sql:e.replace(/{{\s*([^}]+)\s*}}/g,(e,n)=>{let o=`__var${t}`;return l[o]=`{{${n.trim()}}}`,t++,`$${o}`}),bind:l}}async function tD(e){let{sql:t,bind:l}=tN(e),n=await tR(t);return{sql:t,bind:l,liquidContext:n}}},59598(){},23005(){},14892(){},2813(){},61511(){},92489(){},52453(){},72522(){},66883(){},9845(){}},function(e){var t=function(t){return e(e.s=t)};e.O(0,["1339","2174","268","3210","3338","3658","3782","404","8159","8732","8878","9200","9223","957","9817","9967"],function(){return t(65644)}),e.O()}]);
|