@farris/ui-vue 1.5.0-beta.0 → 1.5.0-beta.1

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.
Files changed (68) hide show
  1. package/components/avatar/index.esm.js +897 -901
  2. package/components/avatar/index.umd.cjs +1 -1
  3. package/components/combo-list/index.esm.js +483 -487
  4. package/components/combo-list/index.umd.cjs +1 -1
  5. package/components/component/index.esm.js +482 -486
  6. package/components/component/index.umd.cjs +1 -1
  7. package/components/condition/index.esm.js +543 -547
  8. package/components/condition/index.umd.cjs +1 -1
  9. package/components/content-container/index.esm.js +619 -623
  10. package/components/content-container/index.umd.cjs +1 -1
  11. package/components/data-grid/index.esm.js +439 -440
  12. package/components/data-grid/index.umd.cjs +1 -1
  13. package/components/data-view/index.esm.js +423 -425
  14. package/components/data-view/index.umd.cjs +1 -1
  15. package/components/designer-canvas/index.esm.js +529 -533
  16. package/components/designer-canvas/index.umd.cjs +1 -1
  17. package/components/dynamic-form/index.esm.js +723 -727
  18. package/components/dynamic-form/index.umd.cjs +1 -1
  19. package/components/events-editor/index.esm.js +504 -508
  20. package/components/events-editor/index.umd.cjs +1 -1
  21. package/components/expression-editor/index.esm.js +679 -683
  22. package/components/expression-editor/index.umd.cjs +4 -4
  23. package/components/filter-bar/index.esm.js +503 -507
  24. package/components/filter-bar/index.umd.cjs +1 -1
  25. package/components/filter-condition-editor/index.esm.js +557 -561
  26. package/components/filter-condition-editor/index.umd.cjs +4 -4
  27. package/components/flow-canvas/index.esm.js +327 -331
  28. package/components/flow-canvas/index.umd.cjs +1 -1
  29. package/components/list-view/index.esm.js +502 -506
  30. package/components/list-view/index.umd.cjs +2 -2
  31. package/components/mapping-editor/index.esm.js +347 -348
  32. package/components/mapping-editor/index.umd.cjs +1 -1
  33. package/components/number-range/index.esm.js +479 -483
  34. package/components/number-range/index.umd.cjs +1 -1
  35. package/components/number-spinner/index.esm.js +1037 -1041
  36. package/components/number-spinner/index.umd.cjs +1 -1
  37. package/components/order/index.esm.js +1238 -1242
  38. package/components/order/index.umd.cjs +2 -2
  39. package/components/pagination/index.esm.js +94 -91
  40. package/components/pagination/index.umd.cjs +1 -1
  41. package/components/property-panel/index.esm.js +534 -538
  42. package/components/property-panel/index.umd.cjs +2 -2
  43. package/components/query-solution/index.esm.js +785 -789
  44. package/components/query-solution/index.umd.cjs +5 -5
  45. package/components/response-layout/index.esm.js +710 -714
  46. package/components/response-layout/index.umd.cjs +1 -1
  47. package/components/schema-selector/index.esm.js +701 -702
  48. package/components/schema-selector/index.umd.cjs +3 -3
  49. package/components/section/index.esm.js +502 -506
  50. package/components/section/index.umd.cjs +1 -1
  51. package/components/sort-condition-editor/index.esm.js +556 -560
  52. package/components/sort-condition-editor/index.umd.cjs +4 -4
  53. package/components/textarea/index.esm.js +480 -484
  54. package/components/textarea/index.umd.cjs +2 -2
  55. package/components/time-picker/index.esm.js +594 -598
  56. package/components/time-picker/index.umd.cjs +1 -1
  57. package/components/tooltip/index.esm.js +189 -179
  58. package/components/tooltip/index.umd.cjs +1 -1
  59. package/components/tree-grid/index.esm.js +463 -467
  60. package/components/tree-grid/index.umd.cjs +1 -1
  61. package/components/tree-view/index.esm.js +629 -633
  62. package/components/tree-view/index.umd.cjs +1 -1
  63. package/components/video/index.esm.js +632 -636
  64. package/components/video/index.umd.cjs +1 -1
  65. package/farris.all.esm.js +2583 -2569
  66. package/farris.all.umd.cjs +11 -11
  67. package/index.css +1 -1
  68. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(Z,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../tabs/index.umd.js"),require("../tags/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../external-container/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../modal/index.umd.js"),require("../condition/index.umd.js"),require("../checkbox/index.umd.js"),require("../tooltip/index.umd.js"),require("../button/index.umd.js"),require("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../search-box/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../tabs/index.umd.js","../tags/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../schema-selector/index.umd.js","../tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../external-container/index.umd.js","@vueuse/core","../data-view/index.umd.js","../modal/index.umd.js","../condition/index.umd.js","../checkbox/index.umd.js","../tooltip/index.umd.js","../button/index.umd.js","../notify/index.umd.js"],a):(Z=typeof globalThis<"u"?globalThis:Z||self,a(Z["dynamic-form"]={},Z.Vue,Z.LodashES,Z.common,Z.dynamicResolver,Z.designerCanvas,Z.propertyPanel,Z.FAccordion,Z.FAvatar,Z.FButtonEdit,Z.FButtonGroup,Z.FCalendar,Z.FCapsule,Z.FCheckbox,Z.FCheckboxGroup,Z.FComboList,Z.FComboTree,Z.FComponent,Z.FColorPicker,Z.FContentContainer,Z.FDatePicker,Z.FDataGrid,Z.FDropdown,Z.FDynamicForm,Z.FEventsEditor,Z.FFilterBar,Z.FFieldSelector,Z.FBindingSelector,Z.FImageCropper,Z.FInputGroup,Z.FLayout,Z.FListNav,Z.FListView,Z.FLookup,Z.FMappingEditor,Z.FNav,Z.FNumberRange,Z.FNumberSpinner,Z.FOrder,Z.FPageHeader,Z.FPageFooter,Z.FPagination,Z.FProgress,Z.FQuerySolution,Z.FRadioGroup,Z.FRate,Z.FResponseToolbar,Z.FResponseLayout,Z.FResponseLayoutEditorSetting,Z.FSearchBox,Z.FSection,Z.FSmokeDetector,Z.FSplitter,Z.FStep,Z.FSwitch,Z.FTabs,Z.FTags,Z.FText,Z.FTimePicker,Z.FTransfer,Z.FTreeview,Z.FUploader,Z.FVerifyDetail,Z.FVideo,Z.FTextArea,Z.FSchemaSelector,Z.FTreeGrid$1,Z.FEventParameter,Z.FFilterConditionEditor,Z.FFieldset,Z.FSortConditionEditor,Z.FMenuLookup,Z.FDrawer,Z.FJsonEditor,Z.FPropertyEditor,Z.FExpressionEditor,Z.FCodeEditor,Z.FHtmlTemplate,null,Z.VueUseCore,Z.dataView,null,null,Z.checkbox,Z.FTooltip,Z.FButton))})(this,function(Z,a,Ee,ke,tn,Tt,yt,qo,Ao,Ho,Go,zo,Yo,_n,Tn,Ft,Uo,Xo,Qo,Zo,Ko,Jo,er,nn,tr,nr,or,rr,ar,ir,sr,lr,cr,ur,dr,fr,pr,mr,hr,gr,yr,vr,br,wr,Cr,xr,_r,Tr,Fr,Sr,kr,Vr,Mr,Nr,Ir,Er,Or,Dr,Pr,Br,jr,Rr,Lr,$r,Wr,qr,Ar,Hr,Gr,zr,Yr,Ur,Xr,Qr,Zr,Kr,Jr,ea,Ac,Fn,Fe,Hc,Gc,ta,Sn,na){"use strict";var Wc=Object.defineProperty;var qc=(Z,a,Ee)=>a in Z?Wc(Z,a,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):Z[a]=Ee;var j=(Z,a,Ee)=>qc(Z,typeof a!="symbol"?a+"":a,Ee);const kn={},Vn={};function on(n){const{properties:t,title:e,ignore:o}=n,r=o&&Array.isArray(o),i=Object.keys(t).reduce((s,l)=>((!r||!o.find(c=>c===l))&&(s[l]=t[l].type==="object"&&t[l].properties?on(t[l]):Ee.cloneDeep(t[l].default)),s),{});if(e&&(!r||!o.find(s=>s==="id"))){const s=e.toLowerCase().replace(/-/g,"_");i.id=`${s}_${Math.random().toString().slice(2,6)}`}return i}function oa(n){const{properties:t,title:e,required:o}=n;if(o&&Array.isArray(o)){const r=o.reduce((i,s)=>(i[s]=t[s].type==="object"&&t[s].properties?on(t[s]):Ee.cloneDeep(t[s].default),i),{});if(e&&o.find(i=>i==="id")){const i=e.toLowerCase().replace(/-/g,"_");r.id=`${i}_${Math.random().toString().slice(2,6)}`}return r}return{type:e}}function Mn(n,t={},e){const o=kn[n];if(o){let r=oa(o);const i=Vn[n];return r=i?i({getSchemaByType:Mn},r,t,e):r,r}return null}function ra(n,t){const e=on(t);return Object.keys(e).reduce((o,r)=>(Object.prototype.hasOwnProperty.call(n,r)&&(o[r]&&Ee.isPlainObject(o[r])&&Ee.isPlainObject(n[r]||!n[r])?Object.assign(o[r],n[r]||{}):o[r]=n[r]),o),e),e}function Nn(n,t){return Object.keys(n).filter(o=>n[o]!=null).reduce((o,r)=>{if(t.has(r)){const i=t.get(r);if(typeof i=="string")o[i]=n[r];else{const s=i(r,n[r],n);Object.assign(o,s)}}else o[r]=n[r];return o},{})}function aa(n,t,e=new Map){const o=ra(n,t);return Nn(o,e)}function ia(n={}){function t(f,d,u,p){if(typeof u=="number")return p[f].length===u;if(typeof u=="object"){const h=Object.keys(u)[0],m=u[h];if(h==="not")return Number(p[f].length)!==Number(m);if(h==="moreThan")return Number(p[f].length)>=Number(m);if(h==="lessThan")return Number(p[f].length)<=Number(m)}return!1}function e(f,d,u,p){return p[f]&&p[f].propertyValue&&String(p[f].propertyValue.value)===String(u)}const o=new Map([["length",t],["getProperty",e]]);Object.keys(n).reduce((f,d)=>(f.set(d,n[d]),f),o);function r(f,d){const u=f;return typeof d=="number"?[{target:u,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:u,operator:"getProperty",param:f,value:!!d}]:typeof d=="object"?Object.keys(d).map(p=>{if(p==="length")return{target:u,operator:"length",param:null,value:d[p]};const h=p,m=d[p];return{target:u,operator:"getProperty",param:h,value:m}}):[]}function i(f){return Object.keys(f).reduce((u,p)=>{const h=r(p,f[p]);return u.push(...h),u},[])}function s(f,d){if(o.has(f.operator)){const u=o.get(f.operator);return u&&u(f.target,f.param,f.value,d)||!1}return!1}function l(f,d){return i(f).reduce((h,m)=>h&&s(m,d),!0)}function c(f,d){const u=Object.keys(f),p=u.includes("allOf"),h=u.includes("anyOf"),m=p||h,y=(m?f[m?p?"allOf":"anyOf":"allOf"]:[f]).map(b=>l(b,d));return p?!y.includes(!1):y.includes(!0)}return{parseValueSchema:c}}const ae={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"filter-bar":{type:"filter-bar",name:"筛选条"}},In={},sa={};ia();function Ot(n,t,e=new Map,o=(s,l,c,f)=>l,r={},i=s=>s){return kn[t.title]=t,Vn[t.title]=o,In[t.title]=r,sa[t.title]=i,(s={},l=!0)=>{if(!l)return Nn(s,e);const c=aa(s,t,e),f=Object.keys(n).reduce((d,u)=>(d[u]=n[u].default,d),{});return Object.assign(f,c)}}function rn(n,t){return{customClass:t.class,customStyle:t.style}}function la(){function n(t,e){const{dataSource:o}=t||{};return o===void 0?{}:{}}return{resolve:n}}function ca(){function n(t,e){return t.selectItemById(e)}return{selectItemById:n}}function ua(){function n(t){return t.editor}return{resolve:n}}function da(){function n(t,e){const{columns:o}=e;return t.updateColumns(o)}return{updateColumns:n}}const an=new Map([["appearance",rn]]),fa=new Map([]),pa="root-viewmodel";class ma{constructor(t,e){j(this,"formSchemaUtils");j(this,"controlCreatorUtils");j(this,"designViewModelUtils");this.resolver=t,this.designerHostService=e,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(t){const e=this.createComponentRefNode(t),o=this.createComponentNode(t),r=this.createViewModeNode(t),i=this.formSchemaUtils.getFormSchema();return i.module.viewmodels.push(r),i.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),e}createComponentRefNode(t){const e=this.resolver.getSchemaByType("component-ref");return Object.assign(e,{id:`${t.componentId}-component-ref`,component:`${t.componentId}-component`}),e}createComponentNode(t){const e=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(t);return Object.assign(e,{id:`${t.componentId}-component`,viewModel:`${t.componentId}-component-viewmodel`,componentType:t.componentType,appearance:{class:this.getFormComponentClass()},formColumns:t.formColumns,contents:o}),e}getFormComponentClass(){const{templateId:t}=this.formSchemaUtils.getFormSchema().module;return t==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(t){const e=this.resolver.getSchemaByType("section");Object.assign(e,{id:t.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:t.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:t.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),e.contents=[o];const{selectedFields:i}=t;i==null||i.forEach(l=>{const c=Ee.cloneDeep(l),f=this.resolveControlClassByFormColumns(t),d=this.controlCreatorUtils.setFormFieldProperty(c,"",f);d&&r.push(d)});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;return s==="double-list-in-tab-template"&&(e.appearance.class="f-section-grid f-section-in-main px-0 pt-0",e.fill=!0),[e]}resolveControlClassByFormColumns(t){let e="";switch(t.formColumns){case 1:{e="col-12";break}case 2:{e="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{e="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{e="col-12 col-md-6 col-xl-3 col-el-2";break}}return e}createViewModeNode(t){return{id:`${t.componentId}-component-viewmodel`,code:`${t.componentId}-component-viewmodel`,name:t.componentName,bindTo:t.bindTo,parent:pa,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const e=[],{selectedFields:o}=t;return o==null||o.forEach(r=>{let i="blur";const s=r.type.name;(s===ke.FormSchemaEntityFieldTypeName.Enum||s===ke.FormSchemaEntityFieldTypeName.Boolean)&&(i="change"),e.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:i,fieldSchema:{}})}),e}}function ha(n,t,e,o){var i,s,l,c,f,d;const r=e.parentComponentInstance;if(r&&o){const u=(i=r.schema)==null?void 0:i.type,h={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=e.bindingSourceContext)==null?void 0:s.entityTitle)||((c=(l=e.bindingSourceContext)==null?void 0:l.bindingEntity)==null?void 0:c.name)||"标题",componentType:"form",formColumns:u==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((f=e.bindingSourceContext)==null?void 0:f.bindTo)||"/",selectedFields:(d=e.bindingSourceContext)==null?void 0:d.bindingEntityFields};return new ma(n,o).createComponent(h)}else return t}function ga(n,t,e){return t}const ya={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]},sn={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0}},ln=Ot(sn,ya,an,ha),Gt=a.defineComponent({name:"FResponseForm",props:sn,emits:[],setup(n,t){const e=a.ref(),o=a.computed(()=>{const r=n.customClass.split(" "),i={"drag-container":!0};return r.reduce((s,l)=>(s[l]=!0,s),i),i});return()=>n.visible&&a.withDirectives(a.createVNode("div",{ref:e,class:o.value,style:n.customStyle},[t.slots.default&&t.slots.default()]),[[a.resolveDirective("area-response")]])}}),En={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}},visible:{description:"",type:"boolean",default:!0},required:{description:"",type:"boolean",default:!1},errors:{description:"",type:"object",default:null}},required:["id","type","editor"]},Dt={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number]},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null}},cn=Ot(Dt,En,an,void 0),On=ua();function un(n,t,e){var g;const o=e&&e.getStyles&&e.getStyles()||"",r=e&&e.getDesignerClass&&e.getDesignerClass()||"",i=a.ref();function s(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanMoveComponent?e.checkCanMoveComponent():!0}function l(){return!1}function c(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanDeleteComponent?e.checkCanDeleteComponent():!0}function f(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:e&&e.hideNestedPaddingInDesginerView?e.hideNestedPaddingInDesginerView():!1}function d(V){if(!V||!V.value)return null;if(V.value.schema&&V.value.schema.type==="component")return V.value;const F=a.ref(V==null?void 0:V.value.parent),N=d(F);return N||null}function u(V=t){var R;if(e!=null&&e.getDraggableDesignItemElement)return e.getDraggableDesignItemElement(V);const{componentInstance:F,designerItemElementRef:N}=V;if(!F||!F.value)return null;const{getCustomButtons:w}=F.value;return F.value.canMove||w&&((R=w())!=null&&R.length)?N:u(V.parent)}function p(V){return!!e&&e.canAccepts(V)}function h(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function m(){}function M(V,F){var N;!V||!F||(e!=null&&e.onAcceptMovedChildElement&&e.onAcceptMovedChildElement(V,F),(N=t==null?void 0:t.setupContext)==null||N.emit("dragEnd"))}function x(V,F){const{componentType:N}=V;let w=Mn(N,V,F);e&&e.onResolveNewComponentSchema&&(w=e.onResolveNewComponentSchema(V,w));const R=N.toLowerCase().replace(/-/g,"_");return w&&!w.id&&w.type===N&&(w.id=`${R}_${Math.random().toString().slice(2,6)}`),w}function y(V){V&&e!=null&&e.onChildElementMovedOut&&e.onChildElementMovedOut(V)}function v(...V){if(e&&e.getPropsConfig)return e.getPropsConfig(...V)}function b(V){if(!V)return;const F=t==null?void 0:t.schema,{formSchemaUtils:N}=V;if(F&&N.getExpressions().length){const w=N.getExpressions().findIndex(R=>R.target===F.id);w>-1&&N.getExpressions().splice(w,1)}}function _(V){e&&e.onRemoveComponent&&e.onRemoveComponent(),b(V),t!=null&&t.schema.contents&&t.schema.contents.map(F=>{let N=F.id;F.type==="component-ref"&&(N=F.component);const w=n.value.querySelectorAll(`#${N}-design-item`);w!=null&&w.length&&Array.from(w).map(R=>{var L;(L=R==null?void 0:R.componentInstance)!=null&&L.value.onRemoveComponent&&R.componentInstance.value.onRemoveComponent(V)})})}function S(){if(e&&e.getCustomButtons)return e.getCustomButtons()}function T(V){if(e&&e.onPropertyChanged)return e.onPropertyChanged(V)}return i.value={canMove:s(),canSelectParent:l(),canDelete:c(),canNested:!f(),contents:t==null?void 0:t.schema.contents,elementRef:n,parent:(g=t==null?void 0:t.parent)==null?void 0:g.componentInstance,schema:t==null?void 0:t.schema,styles:o,designerClass:r,canAccepts:p,getBelongedComponentInstance:d,getDraggableDesignItemElement:u,getDraggingDisplayText:h,getPropConfig:v,getDragScopeElement:m,onAcceptMovedChildElement:M,onChildElementMovedOut:y,addNewChildComponentSchema:x,triggerBelongedComponentToMoveWhenMoved:!!e&&e.triggerBelongedComponentToMoveWhenMoved||a.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!e&&e.triggerBelongedComponentToDeleteWhenDeleted||a.ref(!1),onRemoveComponent:_,getCustomButtons:S,onPropertyChanged:T},i}function va(){function n(t,e){var s;if(!t)return!1;const o=((s=t.targetContainer)==null?void 0:s.componentInstance)&&t.targetContainer.componentInstance.value;if(!o)return!1;const r=o.schema.type,i=e==null?void 0:e.formSchemaUtils.getComponentById(o.belongedComponentId);return!((t.componentCategory==="input"||t.componentType==="form-group")&&![ae["response-layout-item"].type,ae["response-form"].type,ae.fieldset.type].includes(r)||(t.componentType===ae.tabs.type||t.componentType===ae.section.type)&&((i==null?void 0:i.componentType)!=="frame"||![ae["content-container"].type,ae["splitter-pane"].type,ae["response-layout-item"].type].includes(r))||t.componentType===ae["query-solution"].type||t.componentType===ae.fieldset.type&&r!==ae["response-form"].type)}return{basalDragulaRuleForContainer:n}}class ba{getTemplateRule(t,e){const o=e==null?void 0:e.formSchemaUtils,r=o==null?void 0:o.getFormTemplateRule(),i={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return i;const s=this.getComponentContext(t),{componentClassList:l}=s;return l.forEach(c=>{if(!c||!r[c])return;const{canMove:f,canDelete:d,canAccept:u}=r[c];i.canMove=i.canMove&&this.resolveRuleValue(f,s),i.canDelete=i.canDelete&&this.resolveRuleValue(d,s),i.canAccept=i.canAccept&&this.resolveRuleValue(u,s)}),i}resolveRuleValue(t,e){return typeof t=="boolean"?t:this.parseRuleValueSchema(t,e)}parseRuleValueSchema(t,e){const o=t.invalidContext||[];let r=!0;for(const i of o){if(i.firstLevelChild){if(i.firstLevelChild.class){const{firstLevelChildClassList:s}=e;if(s&&!s.includes(i.firstLevelChild.class)){r=!1;continue}}if(i.firstLevelChild.type){const{firstLevelChildSchema:s}=e;if(!s||s.type!==i.firstLevelChild.type){r=!1;continue}}}if(i.secondLevelChild){if(i.secondLevelChild.class){const{secondLevelChildClassList:s}=e;if(s&&!s.includes(i.secondLevelChild.class)){r=!1;continue}}if(i.secondLevelChild.type){const{secondLevelChildSchema:s}=e;if(!s||s.type!==i.secondLevelChild.type){r=!1;continue}}}if(i.parent){if(i.parent.class){const{parentClassList:s}=e;if(s&&!s.includes(i.parent.class)){r=!1;continue}}if(i.parent.type){const{parentSchema:s}=e;if(s&&s.type!==i.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(t){var M,x,y,v;const e=t.schema,o=e.appearance&&e.appearance.class||"",r=o.split(" ")||[],i=e.contents||[],s=i.length?i[0]:null,l=s&&s.appearance?s.appearance.class:"",c=l?l.split(" "):[],f=(M=s==null?void 0:s.contents)!=null&&M.length?s==null?void 0:s.contents[0]:null,d=f&&f.appearance?f.appearance.class:"",u=d?d.split(" "):[],p=e.type==="component"?(y=(x=t.parent)==null?void 0:x.parent)==null?void 0:y.schema:(v=t.parent)==null?void 0:v.schema,h=p&&p.appearance&&p.appearance.class||"",m=h?h.split(" "):[];return{componentClass:o,componentClassList:r,childContents:i,firstLevelChildSchema:s,firstLevelChildClass:l,firstLevelChildClassList:c,secondLevelChildSchema:f,secondLevelChildClass:d,secondLevelChildClassList:u,parentSchema:p,parentClass:h,parentClassList:m}}}const wa=a.ref(0);function Dn(){wa.value++}const zt=a.ref(0);function Ca(n,t){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect(),r=o.top>=e.top,i=o.top<=e.bottom;return r&&i}function xa(n){const t=n.querySelector(".component-btn-group");if(!t)return;t.style.display="";const e=t.getBoundingClientRect();if(!(e.top===0&&e.left===0)){const o=t.querySelector("div");if(o){const r=o.getBoundingClientRect();o.style.top=e.top+"px";let i=e.left-r.width;const s=document.querySelector(".editorDiv");if(s){const l=s.getBoundingClientRect();i<l.left&&({left:i}=n.getBoundingClientRect())}o.style.left=i+"px"}}}function _a(n){if(!window.scrollContainerList)return;const t=Array.from(window.scrollContainerList);if(t.length&&t.length===1){const e=t[0],o=document.querySelector(`[id=${e}]`);if(o&&o.contains(n))return o}}function Pn(n){if(!n)return;const t=n.getBoundingClientRect();if(t.width===0&&t.height===0)return;const e=n.querySelector(".component-btn-group");if(e){let o=!0;const r=_a(n);if(r&&(o=Ca(n,r)),!o){e.style.display="none";return}xa(n)}}function Ta(n){if(!n)return;let t;n.className.includes("dgComponentSelected")?t=n:t=n.querySelector(".dgComponentSelected"),t&&Pn(t)}function Fa(n){const{formSchemaUtils:t,formStateMachineUtils:e}=n;function o(c,f=""){return{path:f+c.code,field:c.id,fullPath:c.code}}function r(c,f=""){return t.getViewModelById(c).states.map(u=>o(u,f))}function i(c){const f=t.getRootViewModelId(),d=r(c);if(c===f)return d;const u=r(f,"root-component.");return[...d,...u]}function s(c){return c.binding&&c.binding.path||c.id||""}function l(){return e&&e.getRenderStates()||[]}return{getVariables:i,getControlName:s,getStateMachines:l}}class Sa{constructor(t){j(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);j(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});j(this,"getExpressionConverter",(t,e)=>({convertFrom:(o,r,i,s)=>{const l=i.getExpressionRuleValue(t,e||r);return l&&l.value||""},convertTo:(o,r,i,s,l)=>{var c;if(r==="dataPicking"&&(i!=null&&i.target)){const f=`${i.target}_dataPicking`;((c=i.rules)==null?void 0:c.some(u=>u.id===f&&u.value))?o.dictPickingExpressionId=f:delete o.dictPickingExpressionId}s.updateExpression(i)}}));this.formSchemaService=t}getExpressionRule(t,e){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(s=>s.target===t);if(!r)return"";const i=r.rules.find(s=>s.type===e);return i||""}getContextFormVariables(){const{module:t}=this.formSchemaService.getFormSchema();if(!t.viewmodels||t.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(e);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(i=>{r.push({key:i.code,name:i.name,description:i.name,category:i.category})}),r}createTreeNode(t,e,o="label"){return{id:t.id,name:t.name,bindingPath:t[o],parents:e}}buildEntityFieldsTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var l;const i=this.createTreeNode(r,e);let s=[];(l=r.type)!=null&&l.fields&&(s=this.buildEntityFieldsTreeData(r.type.fields,[...e,r.label])),o.push({data:i,children:s,expanded:!0})}),o}buildChildEntityTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var c,f;const i=this.createTreeNode(r,e),s=this.buildEntityFieldsTreeData((c=r.type)==null?void 0:c.fields,[...e,r.label]),l=this.buildChildEntityTreeData((f=r.type)==null?void 0:f.entities,[...e,r.label]);l!=null&&l.length&&(s==null||s.push(...l)),o.push({data:i,children:s||[],expanded:!0})}),o}getEntitiesTreeData(){const t=this.formSchemaService.getSchemaEntities();if(!(t!=null&&t.length))return[];const e=t[0];if(!(e!=null&&e.type))return[];const o=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),r=this.buildChildEntityTreeData(e.type.entities,[e.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(t,e,o){const r=o==="Field"?t.binding.field:t.id,i=this.getExpressionRule(r,e),s=this.getEntitiesAndVariables(),l={message:["validate","required","dataPicking"].includes(e)&&i?i.message:"",...s};return i.messageType!=null&&(l.messageType=i.messageType),l}buildRule(t,e,o,r){const{expression:i,message:s,messageType:l}=e,c={id:`${t}_${o}`,type:o,value:i};return(o==="validate"||o==="dataPicking"||o==="required")&&(c.message=s),o==="dataPicking"&&(c.messageType=l),o==="validate"&&r&&(c.elementId=r),c}getExpressionData(){const{expressions:t}=this.formSchemaService.getFormSchema().module;return t||[]}updateExpression(t,e,o,r){const i=e==="Field"?t.binding.field:t.id,s=this.buildRule(i,o,r,t.type==="form-group"?t.id:"");let c=this.getExpressionData().find(d=>d.targetType===e&&d.target===i);const f=d=>d.value.trim()==="";if(c){const d=c.rules.find(u=>u.id===s.id);if(d)f(s)?c.rules=c.rules.filter(u=>u.id!==s.id):(Object.assign(d,s),r==="validate"&&t.type==="form-group"&&(d.elementId=t.id));else{if(f(s))return null;c.rules=c.rules||[],c.rules.push(s)}}else{if(f(s))return null;c={target:`${i}`,rules:[s],targetType:e}}return c}getExpressionEditorOptions(t,e,o,r){return o.reduce((i,s)=>{var c,f;const l=e==="Field"?(c=t==null?void 0:t.binding)==null?void 0:c.field:t.id;return i[s]={hide:e==="Field"?!!((f=t==null?void 0:t.binding)!=null&&f.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(l),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(t,s,e),onSubmitModal:d=>{const u=this.updateExpression(t,e,d,s);if(r){const p=this.buildRule(l,d,s);r(p)}return u}}},i},{})}getExpressionInfo(t,e,o){const r=e==="Field"?t.binding.field:t.id,i=this.getExpressionRule(r,o),s={value:i&&i.value,targetId:r,targetType:e,expressionType:o};return i&&i.message&&(s.message=i.message),s}getExpressionConfig(t,e,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(t,e,o,r)}}}getExpressionOptions(t,e,o){const r=this.getExpressionInfo(t,e,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(t,o,e),expressionInfo:r}}}class Bn{constructor(t,e){j(this,"componentId");j(this,"viewModelId");j(this,"eventsEditorUtils");j(this,"formSchemaUtils");j(this,"formMetadataConverter");j(this,"designViewModelUtils");j(this,"designViewModelField");j(this,"controlCreatorUtils");j(this,"designerHostService");j(this,"schemaService",null);j(this,"metadataService",null);j(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=t,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var o;const e=t.binding&&t.binding.type==="Form"&&t.binding.field;if(e){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(i=>i.id===e)}t.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:t.type,name:ae[t.type].name}]}}}}}getAppearanceConfig(t=null,e={},o){const r={title:"外观",description:"Appearance"},i={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const s in e)i[s]=Object.assign(i[s]||{},e[s]);return{...r,properties:{...i},setPropertyRelates(s,l){if(s){switch(s&&s.propertyID){case"class":case"style":{zt.value++;break}}o&&o(s,t,l)}}}}getPropertyEditorParams(t,e=[],o="visible",r={},i={}){const{getVariables:s,getControlName:l,getStateMachines:c}=Fa(this.designerHostService),f=this.getRealTargetType(t),d=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],u={type:"property-editor",propertyTypes:d};return d.map(p=>{switch(p){case"Const":Object.assign(u,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":u.expressionConfig=this.getExpressionOptions(t,f,o);break;case"StateMachine":u.stateMachines=c();break;case"Variable":Object.assign(u,{controlName:l(t),newVariablePrefix:"is",newVariableType:"Boolean",variables:s(this.viewModelId),onBeforeOpenVariables:h=>{h.value=s(this.viewModelId)}},i);break}}),u}getVisibleProperty(t,e=""){return{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(t,e==="gridFieldEditor"?["Const","Expression"]:["Const","Variable","StateMachine","Expression"],"visible")}}}getBehaviorConfig(t,e="",o={},r){const i={title:"行为",description:""},s=this.getVisibleProperty(t,e);for(const c in o)s[c]=Object.assign(s[c]||{},o[c]);const l=this;return{...i,properties:{...s},setPropertyRelates(c,f){if(c){switch(c.propertyID){case"disabled":case"readonly":case"visible":l.afterMutilEditorChanged(t,c);break}r&&r(c,f)}}}}afterMutilEditorChanged(t,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e),this.clearExpression(e,t)}updateElementByParentContainer(t,e){const o=e&&e.parent&&e.parent.schema;if(!o)return;const r=o.contents.findIndex(s=>s.id===t),i=Ee.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,i),Dn()}addNewVariableToViewModel(t,e){const o=t.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const s={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById(e).states.push(s)}updateExpressionValue(t){const e=t.propertyValue;if(!((e&&e.type)==="Expression"&&e.expressionInfo))return;const{expressionId:i,expressionInfo:s}=e,{targetId:l,targetType:c,expressionType:f,value:d,message:u}=s,p=this.formSchemaUtils.getModule();p.expressions??(p.expressions=[]);const{expressions:h}=p;let m=h.find(x=>x.target===l);m||(m={target:l,rules:[],targetType:c},h.push(m));const M=m.rules.find(x=>x.type===f);if(M)M.value=d,M.message=u;else{const x={id:i,type:f,value:d,message:u};m.rules.push(x)}delete e.expressionInfo}clearExpression(t,e){const o=t.propertyValue;if(o&&o.type==="Expression")return;const i=t.propertyID,s=this.formSchemaUtils.getExpressions(),l=e.binding?e.binding.field:e.id,c=s.find(f=>f.target===l);!c||!c.rules||(c.rules=c.rules.filter(f=>f.type!==i))}getExpressionOptions(t,e,o){return new Sa(this.formSchemaUtils).getExpressionOptions(t,e,o)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}}class ka{constructor(){j(this,"label","");j(this,"id","");j(this,"columnInSM",12);j(this,"columnInMD",6);j(this,"columnInLG",3);j(this,"columnInEL",2);j(this,"displayWidthInSM",1);j(this,"displayWidthInMD",1);j(this,"displayWidthInLG",1);j(this,"displayWidthInEL",1);j(this,"displayColumnCountAtBreakPoint","md");j(this,"tagRow",0);j(this,"showTopBorder",0);j(this,"group",1);j(this,"isSupportedClass",!0);j(this,"fieldSetId","")}}function Va(n){let t,e;const o=new Map;let r=[];function i(d,u){const h=d.split(" ").filter(v=>v.startsWith("col-"));if(h.length===0){u.isSupportedClass=!1;return}let m=h.find(v=>/^col-([1-9]|10|11|12)$/.test(v)),M=h.find(v=>/^col-md-([1-9]|10|11|12)$/.test(v)),x=h.find(v=>/^col-xl-([1-9]|10|11|12)$/.test(v)),y=h.find(v=>/^col-el-([1-9]|10|11|12)$/.test(v));m=m||"col-12",u.columnInSM=parseInt(m.replace("col-",""),10),u.displayWidthInSM=u.columnInSM/12,u.displayWidthInSM!==1&&(u.isSupportedClass=!1),M=M||"col-md-"+u.columnInSM,u.columnInMD=parseInt(M.replace("col-md-",""),10),u.displayWidthInMD=u.columnInMD/6,[1,2].includes(u.displayWidthInMD)||(u.isSupportedClass=!1),x=x||"col-xl-"+u.columnInMD,u.columnInLG=parseInt(x.replace("col-xl-",""),10),u.displayWidthInLG=u.columnInLG/3,[1,2,3,4].includes(u.displayWidthInLG)||(u.isSupportedClass=!1),y=y||"col-el-"+u.columnInLG,u.columnInEL=parseInt(y.replace("col-el-",""),10),u.displayWidthInEL=u.columnInEL/2,[1,2,3,4,5,6].includes(u.displayWidthInEL)||(u.isSupportedClass=!1)}function s(d,u,p,h=!1){let m=!1;d.contents.forEach(M=>{if(M.type==="fieldset"){p+=1,s(M,u,p,!0),m=!0;return}m&&(p+=1,m=!1);const x=M.appearance&&M.appearance.class,y=new ka;x?i(x,y):y.isSupportedClass=!1,y.label=M.label||M.id,y.id=M.id,y.group=p,h&&(y.fieldSetId=d.id),e===M.id&&(t=p),o.set(M.id,M),u.push(y)})}function l(d){const u=n.getComponentById(d);if(!u||!u.componentType||!u.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const p=n.selectNode(u,h=>h.type===Tt.DgControl["response-form"].type);return!p||!p.contents||p.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:p}}function c(d,u){u=u||d.id;const{result:p,message:h,formNode:m}=l(u);if(!p)return{result:p,message:h};e=d.id,r=[],o.clear();const M=m.contents[0].type===Tt.DgControl.fieldset.type?0:1;s(m,r,M);const x=r.find(v=>!v.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:x?"customize":"standard"},importData:r}}function f(d,u){u=u;const{result:p,formNode:h}=l(u);if(!p)return"";const m=[];return d.forEach(M=>{var v;const x=o.get(M.id),y=x.appearance&&x.appearance.class;if(y){const _=y.split(" ").filter(N=>!N.startsWith("col-")),S="col-"+M.columnInSM,T="col-md-"+M.columnInMD,g="col-xl-"+M.columnInLG,V="col-el-"+M.columnInEL,F=[S,T,g,V].concat(_);x.appearance.class=F.join(" ")}if(M.fieldSetId){const b=h.contents.find(S=>S.id===M.fieldSetId),_=m.find(S=>S.id===M.fieldSetId);_?(v=_.contents)==null||v.push(x):(m.push(b),b.contents=[x])}else m.push(x)}),h.contents=m,h.id}return{checkCanFindFormNode:l,checkCanOpenLayoutEditor:c,changeFormControlsByResponseLayoutConfig:f,getResonseFormLayoutConfig:s}}function Ma(n,t){function e(c,f=null){if(f)return f;const d=n.getComponentById(t);return n.selectNode(d,u=>u.id===c)}function o(c){const f=n.getComponentById(c);return!(!f||!f.componentType||!f.componentType.startsWith("form"))}function r(c){const f=new Set(c);return Array.from(f).length===1}function i(c){const f=e(c.id),d=Va(n),u=[];d.getResonseFormLayoutConfig(f,u,1);const p=u.map(_=>_.columnInSM),h=u.map(_=>_.columnInMD),m=u.map(_=>_.columnInLG),M=u.map(_=>_.columnInEL),x=r(p)?p[0]:0,y=r(h)?h[0]:0,v=r(m)?m[0]:0,b=r(M)?M[0]:0;return{uniqueColClassInSM:x,uniqueColClassInMD:y,uniqueColClassInLG:v,uniqueColClassInEL:b}}function s(c,f){let d,u,p,h,m=[];if(c){const _=c.split(" "),S=_.filter(T=>T.startsWith("col-"));d=S.find(T=>/^col-([1-9]|10|11|12)$/.test(T)),u=S.find(T=>/^col-md-([1-9]|10|11|12)$/.test(T)),p=S.find(T=>/^col-xl-([1-9]|10|11|12)$/.test(T)),h=S.find(T=>/^col-el-([1-9]|10|11|12)$/.test(T)),m=_.filter(T=>!T.startsWith("col-"))}const M=f.uniqueColClassInSM?"col-"+f.uniqueColClassInSM:d,x=f.uniqueColClassInMD?"col-md-"+f.uniqueColClassInMD:u,y=f.uniqueColClassInLG?"col-xl-"+f.uniqueColClassInLG:p,v=f.uniqueColClassInEL?"col-el-"+f.uniqueColClassInEL:h;return[M,x,y,v].concat(m).join(" ")}function l(c,f,d){c=e(d,c),c.contents.forEach(u=>{if(u.type===Tt.DgControl.fieldset.type){l(u,f,u.id);return}u.appearance||(u.appearance={});const p=u.appearance.class;u.appearance.class=s(p,f)})}return{checkIsInFormComponent:o,assembleUnifiedLayoutContext:i,changeFormControlsByUnifiedLayoutConfig:l}}class Na extends Bn{constructor(t,e){super(t,e)}getPropertyConfig(t,e){const o=this;this.propertyConfig.categories.basic=this.getBasicPropConfig(t);const{checkIsInFormComponent:r,assembleUnifiedLayoutContext:i,changeFormControlsByUnifiedLayoutConfig:s}=Ma(this.formSchemaUtils,this.componentId),l=this.getAppearanceConfig(t),c=r(this.componentId);return l.properties.labelAutoOverflow={title:"控件标签换行",description:"控件标签字数超长时,换行显示。控件标签与输入框在一行展示时,此属性有效。",visible:c,type:"boolean"},l.properties.unifiedLayout={title:"统一布局配置",description:"统一配置卡片区域内所有控件的宽度,只支持标准模式",visible:c,refreshPanelAfterChanged:!0,editor:{type:"response-form-layout-setting",initialState:i(t)}},l.setPropertyRelates=function(f,d){if(f)switch(f&&f.propertyID){case"unifiedLayout":{s(null,f.propertyValue,t.id),o.updateElementByParentContainer(t.id,e);break}case"labelAutoOverflow":{o.setLabelAutoOverflow(t,f.propertyValue);break}}},this.propertyConfig.categories.appearance=l,this.propertyConfig.categories.behavior=this.getBehaviorConfig(t),this.propertyConfig}setLabelAutoOverflow(t,e){const o=this.formSchemaUtils.getComponentById(this.componentId),r=this.formSchemaUtils.selectNode(o,i=>i.id===t.id);r&&r.contents&&r.contents.length&&(r.contents.forEach(i=>{i.appearance||(i.appearance={class:""}),i.appearance.class||(i.appearance.class=""),e?i.appearance.class.includes("farris-group-multi-label")||(i.appearance.class=i.appearance.class+" farris-group-multi-label"):i.appearance.class=i.appearance.class.replace("farris-group-multi-label","").trim()}),Dn())}}function jn(n,t){const e=n.schema,o=new ba,{canMove:r,canAccept:i,canDelete:s}=o.getTemplateRule(n,t);function l(C,k){const{sourceElement:D}=C,{componentInstance:B}=D,O=t==null?void 0:t.formSchemaUtils;if(!O)return!0;const P=O.getComponentById(B.value.belongedComponentId),A=O.getViewModelById(P.viewModel),E=O.getComponentById(n.componentInstance.value.belongedComponentId),I=O.getViewModelById(E.viewModel);return k?A!=null&&A.id&&(I!=null&&I.id)&&A.id!==I.id?A.bindTo===I.bindTo:!0:(A==null?void 0:A.id)===(I==null?void 0:I.id)}function c(C){const{bindingTargetId:k}=C;if(!t)return;const{formSchemaUtils:D,schemaService:B}=t,O=D.getComponentById(n.componentInstance.value.belongedComponentId),P=B.getFieldByIDAndVMID(k,O.viewModel);return!!(P!=null&&P.schemaField)}function f(C){const k=o.getComponentContext(n);if(k&&k.componentClassList&&k.componentClassList.includes("f-form-layout")&&k.componentClassList.includes("farris-form")){if(C.sourceType==="control"&&(C.componentCategory==="input"||C.componentType==="fieldset"))return!0;if(C.sourceType==="move"){if(C.componentType==="form-group")return l(C,!0);if(C.componentType==="fieldset")return l(C,!1)}return C.sourceType==="field"&&C.componentCategory==="input"?c(C):!1}return!0}function d(C){return!(!va().basalDragulaRuleForContainer(C,t)||!i||!f(C))}function u(C){var I;const k=C.componentInstance,D=k.value.schema,B=t==null?void 0:t.formSchemaUtils,O=t==null?void 0:t.designViewModelUtils,P=B.getViewModelIdByComponentId(k.value.belongedComponentId),A=O.getDgViewModel(P),E=k.value.parent;if(E&&Tt.DgControl.fieldset&&((I=E.schema)==null?void 0:I.type)===Tt.DgControl.fieldset.type&&A){const H={groupId:null,groupName:null};switch(D.binding.type){case yt.FormBindingType.Form:{A.changeField(D.binding.field,H);break}case yt.FormBindingType.Variable:{B.modifyViewModelFieldById(P,D.binding.field,H,!0);break}}}}function p(C,k,D){const B=k.fields.find(I=>I.id===C),O=t==null?void 0:t.designViewModelUtils,P=O.getDgViewModel(k.id),A=P.fields.find(I=>I.id===C);P.removeField([C]);const E=O.getDgViewModel(D);E.addField(A),B.fieldSchema&&E.changeField(A.id,B.fieldSchema)}function h(C,k,D,B=[]){const O=k.id,P=C.binding.field,A=k.fields.findIndex(I=>I.id===P);if(A>-1&&(D.fields.push(k.fields[A]),k.fields.splice(A,1)),O==="root-viewmodel"&&D.id!=="root-viewmodel"){C.binding.path&&!C.binding.path.includes("root-component.")&&(C.binding.path="root-component."+C.binding.path);return}if(D.id==="root-viewmodel"&&O!=="root-viewmodel"&&C.binding.path&&C.binding.path.includes("root-component.")){C.binding.path=C.binding.path.replace("root-component.","");return}const E=k.states.find(I=>I.id===P);E&&(D.states=D.states?D.states:[],D.states.findIndex(I=>I.id===E.id)<0&&(D.states.push(E),B.push(E.id)))}function m(C,k,D,B=[]){var A;if(!C)return;const O=k.id==="root-viewmodel"&&D.id!=="root-viewmodel",P=D.id==="root-viewmodel"&&k.id!=="root-viewmodel";Object.keys(C).forEach(E=>{if(E==="binding")return;const I=C[E];if(I&&typeof I=="object"&&I.type===yt.FormBindingType.Variable&&I.field){if(O){I.path&&!I.path.includes("root-component.")&&(I.path="root-component."+I.path);return}if(P&&I.path&&I.path.includes("root-component.")){I.path=I.path.replace("root-component.","");return}const H=k.states.find($=>$.id===I.field);if(H){B.push(H.id),D.states=D.states?D.states:[];const $=D.states.find(W=>W.code===H.code);if($)I.field=$.id;else{const W=Object.assign({},{newId:ke.useGuid().guid()},H);D.states.push(W),I.field=W.newId}}}}),(A=D.states)!=null&&A.length&&D.states.map(E=>{E.newId&&(E.id=E.newId,delete E.newId)})}function M(C,k,D){if(C&&(k(C,D),C.contents))for(const B of C.contents)M(B,k,D)}function x(C=[],k){if(!C.length)return;const D=t==null?void 0:t.formSchemaUtils,B=D.getComponentByViewModelId(k),O=[],P=(E,I)=>{E&&(Object.keys(E).forEach(H=>{const $=E[H];$&&typeof $=="object"&&$.type===yt.FormBindingType.Variable&&C.includes($.field)&&!I.includes($.field)&&I.push($.field)}),E.editor&&P(E.editor,I))};M(B,P,O);const A=D.getViewModelById(k);C.forEach(E=>{O.includes(E)||(A.states=A.states.filter(I=>I.id!==E))})}function y(C){const k=ke.useGuid().guid(),D=Object.assign({},C,{id:k,code:C.code+k.slice(0,4),name:C.name+k.slice(0,4)}),P=(t==null?void 0:t.formSchemaUtils).getCommands().find(A=>A.id===C.cmpId);return P&&P.refedHandlers.push({host:k,handler:C.handlerName}),D}function v(C,k,D){var H,$,W;const B={},O=C.type==="form-group"&&C.editor?C.editor.type:C.type,P=(H=tn.schemaMap[O])==null?void 0:H.events;if(!P)return;Object.keys(C).forEach(z=>{const X=Object.keys(P).find(K=>K===z);if(X&&C[X]){const K=k.commands.find(Q=>Q.code===C[X]);if(K){let Q=B[K.code];Q||(Q=y(K),B[K.code]=Q,D.commands.push(Q)),C[X]=Q.code}}});const E=(t==null?void 0:t.designViewModelUtils).getDgViewModel(D.id),I=["valueChanging","valueChanged"];if((($=C.binding)==null?void 0:$.type)===yt.FormBindingType.Form){const z=(W=D.fields)==null?void 0:W.find(X=>X.id===C.binding.field);z&&I.forEach(X=>{if(z[X]){const K=k.commands.find(Q=>Q.code===z[X]);if(!K)return;if(B[K.code])E.changeField(z.id,{[X]:B[K.code].code});else{const Q=y(K);B[K.code]=Q,D.commands.push(Q),E.changeField(z.id,{[X]:Q.code})}}})}}function b(C){const k=t==null?void 0:t.formSchemaUtils,D=C.componentInstance,B=D.value.schema,O=k.getViewModelIdByComponentId(D.value.belongedComponentId),P=k.getViewModelById(O),A=k.getComponentById(n.componentInstance.value.belongedComponentId),E=k.getViewModelById(A.viewModel);if(O!==E.id){const I=B.binding.type,H=B.binding.field,$=[];switch(I){case yt.FormBindingType.Form:{p(H,P,E.id);break}case yt.FormBindingType.Variable:{h(B,P,E,$);break}}m(B,P,E,$),m(B.editor,P,E,$),v(B,P,E),O!=="root-viewmodel"&&x($,O)}}function _(C){if(!C||!C.componentInstance)return;const D=C.componentInstance.value.schema;!D.binding||!D.binding.field||(u(C),b(C))}function S(){return e.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function T(C){let k="";switch(C){case 1:{k="col-12";break}case 2:{k="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{k="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{k="col-12 col-md-6 col-xl-3 col-el-2";break}}return k}function g(C){const k=n.componentInstance.value.getBelongedComponentInstance(n.componentInstance);if(k&&k.schema&&k.schema.componentType){const{formColumns:D}=k.schema;let B=T(D);B=t==null?void 0:t.formSchemaUtils.getControlClassByFormUnifiedLayout(B,k.schema.id,n.schema),C.appearance||(C.appearance={}),C.appearance.class=B}}function V(C,k,D,B){const{bindingSourceContext:O,parentComponentInstance:P}=C;if(O!=null&&O.entityFieldNode&&P){const A=t==null?void 0:t.designViewModelUtils,I=(t==null?void 0:t.formSchemaUtils).getViewModelIdByComponentId(P.belongedComponentId),H=A.getDgViewModel(I);H.removeField([O.entityFieldNode.id]),H.addField(O.designViewModelField),k&&H.changeField(O.entityFieldNode.id,{editor:{$type:k},groupId:D,groupName:B})}}function F(C,k){var P,A,E;const D=e;if((D.appearance&&D.appearance.class||"").split(" ").includes("f-form-layout")&&C.componentCategory==="input"){const{label:I}=C;let H;return(P=C.bindingSourceContext)!=null&&P.entityFieldNode?H=(t==null?void 0:t.controlCreatorUtils).setFormFieldProperty((A=C.bindingSourceContext)==null?void 0:A.entityFieldNode,k==null?void 0:k.type):(H=tn.getSchemaByType("form-group"),H.editor=k,H.label=I),g(H),V(C,(E=H.editor)==null?void 0:E.type),H}return k}function N(){return r}function w(){return s}function R(){return!1}function L(C){return new Na(C,t).getPropertyConfig(e,n.componentInstance.value)}return{canAccepts:d,checkCanDeleteComponent:w,checkCanMoveComponent:N,getStyles:S,getPropsConfig:L,hideNestedPaddingInDesginerView:R,onAcceptMovedChildElement:_,onResolveNewComponentSchema:F,moveInputBetweenComponent:b,resolveFormGroupAppearance:g,syncFieldToViewModel:V}}const Ia=a.defineComponent({name:"FResponseFormDesign",directives:{"area-response":ke.areaResponseDirective},props:Dt,emits:[],setup(n,t){const e=a.ref(),o=a.inject("design-item-context"),r=a.inject("designer-host-service"),i=jn(o,r),s=un(e,o,i);a.onMounted(()=>{e.value.componentInstance=s}),t.expose(s.value);const l=a.computed(()=>{const c=n.customClass.split(" "),f={"drag-container":!0};return c.reduce((d,u)=>(d[u]=!0,d),f),f});return()=>a.withDirectives(a.createVNode("div",{ref:e,class:l.value,style:n.customClass,"data-dragref":`${o.schema.id}-container`,"data-associate":`${o.schema.id}-component`},[t.slots.default&&t.slots.default()]),[[a.resolveDirective("area-response")]])}}),Ea={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""}},Rn=a.defineComponent({name:"FDynamicFormLabel",props:Ea,emits:[],setup(n,t){a.ref(n.title||n.text);const e=a.ref(n.required),o=a.ref(n.text),r=a.ref(n.valid),i=a.ref(n.inValidTip);a.watch(()=>n.text,()=>{o.value=n.text}),a.watch(()=>n.required,(c,f)=>{c!==f&&(e.value=c)}),a.watch([()=>n.valid,()=>n.inValidTip],([c,f])=>{r.value=c,i.value=f});const s=a.computed(()=>r.value?o.value:i.value),l=a.computed(()=>r.value?"":"color:red");return()=>o.value&&a.createVNode("label",{class:"col-form-label",title:s.value,style:l.value},[!r.value&&a.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:i.value},null),e.value&&a.createVNode("span",{class:"farris-label-info text-danger"},[a.createTextVNode("*")]),a.createVNode("span",{class:"farris-label-text"},[o.value])])}}),ie={},se={},le={},ce={};let Ln=!1;function Oa(){Ln||(Ln=!0,Ao.register(ie,se,le,ce),qo.register(ie,se,le,ce),Ho.register(ie,se,le,ce),Go.register(ie,se,le,ce),zo.register(ie,se,le,ce),Yo.register(ie,se,le,ce),_n.register(ie,se,le,ce),Tn.register(ie,se,le,ce),_n.register(ie,se,le,ce),Tn.register(ie,se,le,ce),Ft.register(ie,se,le,ce),Uo.register(ie,se,le,ce),Xo.register(ie,se,le,ce),Zo.register(ie,se,le,ce),Qo.register(ie,se,le,ce),Ko.register(ie,se,le,ce),Jo.register(ie,se,le,ce),er.register(ie,se,le,ce),nn.register(ie,se,le,ce),tr.register(ie,se,le,ce),Kr.register(ie,se,le,ce),nr.register(ie,se,le,ce),or.register(ie,se,le,ce),Gr.register(ie,se,le,ce),ar.register(ie,se,le,ce),ir.register(ie,se,le,ce),sr.register(ie,se,le,ce),cr.register(ie,se,le,ce),lr.register(ie,se,le,ce),ur.register(ie,se,le,ce),dr.register(ie,se,le,ce),fr.register(ie,se,le,ce),pr.register(ie,se,le,ce),mr.register(ie,se,le,ce),hr.register(ie,se,le,ce),gr.register(ie,se,le,ce),yr.register(ie,se,le,ce),vr.register(ie,se,le,ce),br.register(ie,se,le,ce),wr.register(ie,se,le,ce),Cr.register(ie,se,le,ce),xr.register(ie,se,le,ce),Tr.register(ie,se,le,ce),Fr.register(ie,se,le,ce),_r.register(ie,se,le,ce),qr.register(ie,se,le),Sr.register(ie,se,le,ce),kr.register(ie,se,le,ce),Vr.register(ie,se,le,ce),Mr.register(ie,se,le,ce),Nr.register(ie,se,le,ce),Ir.register(ie,se,le,ce),Yr.register(ie,se,le,ce),Er.register(ie,se,le,ce),Or.register(ie,se,le,ce),Dr.register(ie,se,le,ce),Pr.register(ie,se,le,ce),Br.register(ie,se,le,ce),jr.register(ie,se,le,ce),Lr.register(ie,se,le,ce),Rr.register(ie,se,le,ce),$r.register(ie,se,le,ce),Wr.register(ie,se,le,ce),Ar.register(ie,se,le,ce),rr.register(ie,se,le,ce),Hr.register(ie,se,le,ce),zr.register(ie,se,le,ce),Ur.register(ie,se,le,ce),Xr.register(ie,se,le,ce),Qr.register(ie,se,le,ce),Zr.register(ie,se,le,ce),Jr.register(ie,se,le,ce),ea.register(ie,se,le,ce))}function $n(){Oa();function n(s){const l=ie[s];if(!l)throw new Error(`Could not find the editor of type '${s}'`);return l}function t(s,l){const c=se[s];return c?c(l):{}}function e(s){switch(s){case"check-box":return"onChangeValue";case"switch":return"onModelValueChanged";case"check-group":return"onChangeValue";case"combo-list":case"combo-tree":return"onChange";case"combo-lookup":return"";case"date-picker":return"onDatePicked";case"date-range":return"";case"datetime-picker":return"";case"time-picker":return"onValueChange";case"datetime-range":return"";case"month-picker":return"";case"month-range":return"";case"year-picker":return"";case"year-range":return"";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-editor":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":case"item-collection-editor":case"response-form-layout-setting":case"response-layout-editor-setting":case"response-layout-splitter":case"menu-lookup":case"json-editor":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onChange";case"query-solution-config":case"solution-preset":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged"}}function o(s){switch(s){case"combo-list":case"input-group":case"textarea":return"onClear"}}function r(s){switch(s){case"input-group":case"textarea":return"onMousedownEvent"}}function i(s){switch(s){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:t,resolveEditorType:n,getChangeFunctionName:e,getClearFunctionName:o,getMousedownFunctionName:r,getMouseupFunctionName:i}}const Da={errors:{type:Object,default:null}},Pa=a.defineComponent({name:"FValidationMessage",props:Da,emits:[],setup(n,t){const e=a.ref(n.errors);a.watch(()=>n.errors,i=>{e.value=i});const o=a.ref(!0),r=a.computed(()=>{if(e.value){const i=Object.keys(e.value).map(s=>{var l;return(l=e.value[s])==null?void 0:l.name});return i.length?i.join(" "):""}return""});return()=>r.value&&a.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>o.value=!o.value},[!o.value&&a.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),o.value&&a.createVNode("span",{class:"f-feedback-message"},[r.value])])}}),Lt=a.defineComponent({name:"FDynamicFormGroup",props:Dt,emits:["change","update:modelValue"],setup(n,t){var T;const e=a.ref(n.id),o=a.ref(n.customClass),r=a.ref(n.editor),i=a.ref(n.label),s=a.ref(n.modelValue),l=a.ref(n.readonly),c=a.ref(((T=n.editor)==null?void 0:T.required)||n.required),f=a.ref(n.showLabel),d=a.ref(n.visible);a.ref(n.type);const u=a.ref(),p=a.ref(n.errors),{resolveEditorProps:h,resolveEditorType:m,getChangeFunctionName:M,getClearFunctionName:x}=$n(),y=a.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":l.value}));function v(g,V,F){s.value=V!==void 0?V:g,t.emit("update:modelValue",s.value),t.emit("change",s.value,{newValue:g,newModelValue:V,parameters:F})}function b(){t.emit("update:modelValue","")}const _=a.computed(()=>{const g=r.value.type||"input-group",V=m(g),F=h(g,r.value),N=M(g),w=x(r.value.type);return w&&(F[w]=b),F[N]=v,(F.id==null||F.id==="")&&(F.id=e.value),g==="number-range"&&r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"?(r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"&&(F.onBeginValueChange=r.value.onBeginValueChange),r.value.onEndValueChange&&typeof r.value.onEndValueChange=="function"&&(F.onEndValueChange=r.value.onEndValueChange)):g==="lookup"&&r.value["onUpdate:idValue"]&&typeof r.value["onUpdate:idValue"]=="function"?F["onUpdate:idValue"]=r.value["onUpdate:idValue"]:g==="property-editor"&&(F.onBeforeOpenVariables=r.value.onBeforeOpenVariables),()=>a.createVNode(V,a.mergeProps({ref:u},F,{modelValue:s.value,"onUpdate:modelValue":R=>s.value=R}),t.slots)});function S(){return a.createVNode(Pa,{id:`${e.value}-validation-message`,errors:p.value},null)}return a.watch([()=>n.id,()=>n.customClass,()=>n.editor,()=>n.label,()=>n.modelValue,()=>n.readonly,()=>n.required,()=>n.showLabel,()=>n.visible,()=>n.errors],([g,V,F,N,w,R,L,C,k,D])=>{var B;e.value=g,o.value=V,r.value=F,i.value=N,s.value=w,l.value=R,c.value=((B=r.value)==null?void 0:B.required)||L,f.value=C,d.value=k,p.value=D}),t.expose({editorRef:u}),()=>d.value&&a.createVNode("div",{id:`${e.value}-input-group`,class:o.value,style:n.customStyle},[a.createVNode("div",{class:"farris-group-wrap"},[a.createVNode("div",{class:y.value},[f.value&&a.createVNode(Rn,{id:`${e.value}-lable`,required:c.value,text:i.value,title:i.value},null),a.createVNode("div",{class:"farris-input-wrap"},[_.value(),S()])])])])}}),Wn={},qn={},Ba={id:{Type:String,default:""},autocomplete:{Type:String,default:"off"},customClass:{Type:String,default:""},disabled:{Type:Boolean,default:!1},editable:{Type:Boolean,default:!0},enableClear:{Type:Boolean,default:!0},enableTitle:{Type:Boolean,default:!0},enableViewPassword:{Type:Boolean,default:!0},forcePlaceholder:{Type:Boolean,default:!1},groupText:{Type:String,default:""},type:{Type:String,default:"text"},max:{type:[Number,String]},min:{type:[Number,String]},maxLength:{Type:Number||void 0,default:void 0},minLength:{Type:Number||void 0,default:void 0},modelValue:{Type:String||Boolean,default:""},showBorder:{Type:Boolean,default:!0},step:{Type:Number,default:1},placeholder:{Type:String,default:""},precision:{Type:Number,default:0},readonly:{Type:Boolean,default:!1},showButtonWhenDisabled:{Type:Boolean,default:!1},tabIndex:{Type:Number,default:0},textAlign:{Type:String,default:"left"},useExtendInfo:{Type:Boolean,default:!1},extendInfo:{Type:String,default:""},value:{Type:String,default:""},autoHeight:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},rows:{type:Number,default:2},showCount:{type:Boolean,default:!1},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},updateOn:{type:String,default:"blur"},formatValidation:{type:Object,default:{}}};function ja(n,t){const e=a.ref(n.groupText),o=a.computed(()=>n.showButtonWhenDisabled&&(n.readonly||n.disabled)),r=a.computed(()=>n.enableClear||!!n.groupText);return{appendedButtonClass:a.computed(()=>({"input-group-append":!0,"append-force-show":o.value})),appendedContent:e,shouldShowAppendedButton:r}}function Ra(n,t,e,o){const{appendedContent:r}=o,i=a.ref(n.enableViewPassword),s=a.computed(()=>n.type==="password"),l='<span class="f-icon f-icon-eye" style="color: rgb(56, 143, 255);"></span>',c='<span class="f-icon f-icon-eye"></span>',f=a.ref(!1);a.watch(()=>[n.readonly,n.disabled],([p,h])=>{s.value&&(e.value=p||h?"password":e.value,r.value=p||h?c:r.value)});function d(){return f.value=!f.value,e.value=f.value?"text":"password",r.value=f.value?l:c,!1}function u(){e.value=s.value?"password":"text",r.value=s.value?i.value?c:"":r.value}return u(),{isPassword:s,onClickAppendedButton:d}}function La(n,t,e,o,r){const{appendedButtonClass:i,appendedContent:s}=e,l=a.computed(()=>n.showButtonWhenDisabled&&(!n.editable||!n.readonly)&&!n.disabled),c=a.computed(()=>s.value&&!t.slots.groupTextTemplate),f=a.computed(()=>!!t.slots.groupTextTemplate),{clearButtonClass:d,clearButtonStyle:u,onClearValue:p,shouldShowClearButton:h}=o;function m(){return a.createVNode("span",{id:"clearIcon",class:d.value,style:u.value,onClick:g=>p(g)},[a.createVNode("i",{class:"f-icon modal_close"},null)])}function M(g){t.emit("iconMouseEnter",g)}function x(g){t.emit("iconMouseLeave",g)}function y(g){l.value&&t.emit("clickHandle",{originalEvent:g}),g.stopPropagation()}const v=n.type==="password"?r.onClickAppendedButton:y;function b(){return a.createVNode("span",{class:"input-group-text",onMouseenter:g=>M(g),onMouseleave:g=>x(g),innerHTML:s.value,onClick:g=>v(g)},null)}function _(){return t.slots.groupTextTemplate&&t.slots.groupTextTemplate()}function S(){return c.value?b:f.value?_:""}const T=S();return()=>a.createVNode("div",{class:i.value},[h.value&&m(),T&&T()])}const An=[{key:"none",value:"无"},{key:"cellNumber",value:"手机号"},{key:"tel",value:"座机号/传真号"},{key:"telOrCell",value:"手机号/座机号/传真号"},{key:"postCode",value:"邮编"},{key:"email",value:"电子邮箱"},{key:"idCode",value:"身份证号"},{key:"carCode",value:"车牌号"},{key:"subjectCode",value:"10位数字会计科目代码"},{key:"custom",value:"自定义"}];function $a(n){switch(n){case"none":return"";case"cellNumber":return"^1[0-9]{10}$";case"tel":return"^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$";case"telOrCell":return"^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$|^1[0-9]{10}$";case"postCode":return"^[1-9]\\d{5}(?!\\d)$";case"workCode":return"^\\d{8}$";case"email":return"^[A-Za-z\\d]+([-_.][A-Za-z\\d]+)*@([A-Za-z\\d]+[-.])+[A-Za-z]{2,5}$";case"idCode":return"^[1-9]\\d{5}[1-9]\\d{3}((0[1-9])|(1[0-2]))(0[1-9]|([1|2][0-9])|3[0-1])((\\d{4})|\\d{3}X)$";case"carCode":return"^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][·\\s]?[A-HJ-NP-Z0-9]{4,5}[挂学警港澳]?|粤[Z港澳][·\\s]?[港澳][0-9A-HJ-NP-Z]{4}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?([DF][0-9A-HJ-NP-Z][0-9]{4}|[0-9]{5}[DF])[挂港澳]?|[使领][0-9]{3}[·\\s]?[0-9]{3}|临[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?[0-9A-Z]{4,5}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z]?[·\\s]?警[0-9A-Z]{4}|[军海空][A-Z][·\\s]?[0-9]{4,5}|WJ(?:[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]|\\d{2})[·\\s]?[0-9A-Z]{4,5})$";case"carCodeNew":return"^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$";case"subjectCode":return"^\\d{10}$"}return""}function Wa(n){var t;return"请输入正确的"+((t=An.find(e=>e.key===n))==null?void 0:t.value)}const qa={convertTo:(n,t,e,o)=>{n.editor.formatValidation||(n.editor.formatValidation={type:"none"}),n.editor.formatValidation.type=e,n.editor.formatValidation.expression=$a(e),n.editor.formatValidation.message=Wa(e)},convertFrom:(n,t,e)=>n.editor.formatValidation?t==="type"?n.editor.formatValidation[t]||"none":n.editor.formatValidation[t]:"none"},Hn={convertTo:(n,t,e,o)=>{n.editor.formatValidation||(n.editor.formatValidation={type:"none"}),n.editor.formatValidation[t]=e},convertFrom:(n,t,e)=>n.editor.formatValidation?n.editor.formatValidation[t]:n.editor[t]};class Aa extends yt.InputBaseProperty{constructor(t,e){super(t,e)}getPropertyConfig(t,e){return super.getPropertyConfig(t,e),this.propertyConfig.categories.formatValidation=this.getFormatValidation(t),this.propertyConfig}getEditorProperties(t){var o,r;let e;if(((o=t==null?void 0:t.binding)==null?void 0:o.type)==="Form"){const i=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(r=i==null?void 0:i.schemaField)!=null&&r.type&&(e=i.schemaField.type.length)}return this.getComponentConfig(t,{},{maxLength:{description:"文本字数最大长度",title:"最大长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,max:e}},enableViewPassword:{description:"",title:"启用密码",visible:!1,type:"boolean"}})}getFormatValidation(t){var o,r,i;const e={title:"输入格式校验",description:"输入格式校验",properties:{type:{title:"输入类型",type:"enum",description:"输入类型",defaultValue:"",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:An},refreshPanelAfterChanged:!0,$converter:qa}}};return(o=t.editor.formatValidation)!=null&&o.type&&((r=t.editor.formatValidation)==null?void 0:r.type)!=="none"&&(e.properties.message={title:"输入错误提示",type:"string",description:"输入错误提示",$converter:Hn}),((i=t.editor.formatValidation)==null?void 0:i.type)==="custom"&&(e.properties.expression={title:"匹配正则",type:"string",description:"匹配正则",$converter:Hn}),e}}function Ha(n,t){const e=n.schema;function o(r,i){return new Aa(r,t).getPropertyConfig(e,i)}return{getPropsConfig:o}}const Ga=a.defineComponent({name:"FInputGroupDesign",props:Ba,emits:["updateExtendInfo","clear","valueChange","clickHandle","blurHandle","focusHandle","enterHandle","iconMouseEnter","iconMouseLeave","keyupHandle","keydownHandle","inputClick"],setup(n,t){const e=a.ref(n.modelValue),o=a.ref(n.modelValue),r=ke.useTextBoxDesign(n,t,e,o),{inputGroupClass:i,inputType:s,inputGroupStyle:l}=r,c=ja(n),{shouldShowAppendedButton:f}=c,d=ke.useClear(n,t,r),{onMouseEnter:u,onMouseLeave:p}=d,h=Ra(n,t,s,c),m=a.ref(),M=a.inject("designer-host-service"),x=a.inject("design-item-context"),y=Ha(x,M),v=Tt.useDesignerComponent(m,x,y);a.onMounted(()=>{m.value.componentInstance=v}),t.expose(v.value);const b=La(n,t,c,d,h),_=a.ref();return()=>a.createVNode("div",{id:"inputGroup",ref:m,class:i.value,style:l.value,onMouseenter:u,onMouseleave:p},[a.createVNode("input",{ref:_,class:"form-control",readonly:!0,placeholder:n.placeholder},null),f.value&&b()])}});function za(){function n(s,l){const c=qn[s];return c?c(l):{}}function t(s){return Wn[s]||Ga}function e(s){}function o(s){}function r(s){}function i(s){}return{getChangeFunctionName:e,getClearFunctionName:o,resolveEditorProps:n,resolveEditorType:t,getMousedownFunctionName:r,getMouseupFunctionName:i}}const Rt=class Rt{static getEditorTypesByMDataType(t,e=""){let o=Rt.fieldControlTypeMapping[t];if(e==="data-grid-column"&&(o!=null&&o.length)){const r=[ae["check-group"].type,ae["radio-group"].type];o=o.filter(i=>!r.includes(i.key))}return o}static getAllInputTypes(){const t=[];for(const e in Rt.fieldControlTypeMapping)Rt.fieldControlTypeMapping[e].forEach(o=>{t.find(r=>r.key===o.key&&r.value===o.value)||t.push({key:o.key,value:o.value})});return t}static mappingDomPropAndSchemaProp(t,e){var i;const o=(i=t.editor)==null?void 0:i.type,r=[];return(t.type===ae["data-grid-column"].type||t.type===ae["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&r.push({domField:"title",schemaField:"name"}),r.push({domField:"label",schemaField:"name"}),r.push({domField:"editor.required",schemaField:"require"}),r.push({domField:"editor.readonly",schemaField:"readonly"}),(o===ae["input-group"].type||o===ae.textarea.type||o===ae["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),o===ae["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(t.type===ae["data-grid-column"].type||t.type===ae["tree-grid-column"].type)&&r.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===ae["combo-list"].type||o===ae["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),(t.type===ae["data-grid-column"].type||t.type===ae["tree-grid-column"].type)&&r.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===ae["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),o===ae["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),o===ae.lookup.type&&(r.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),r.push({domField:"editor.valueField",schemaField:"editor.valueField"}),r.push({domField:"editor.textField",schemaField:"editor.textField"}),r.push({domField:"editor.displayType",schemaField:"editor.displayType"}),r.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),r.push({domField:"editor.helpId",schemaField:"editor.helpId"})),r.push({domField:"path",schemaField:"bindingPath"}),r.push({domField:"binding.path",schemaField:"bindingField"}),r.push({domField:"binding.fullPath",schemaField:"path"}),(t.type===ae["data-grid-column"].type||t.type===ae["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};j(Rt,"fieldControlTypeMapping",{String:[{key:ae["input-group"].type,value:ae["input-group"].name},{key:ae.lookup.type,value:ae.lookup.name},{key:ae["date-picker"].type,value:ae["date-picker"].name},{key:ae["check-group"].type,value:ae["check-group"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name},{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae.textarea.type,value:ae.textarea.name},{key:ae["time-picker"].type,value:ae["time-picker"].name}],Text:[{key:ae.textarea.type,value:ae.textarea.name},{key:ae.lookup.type,value:ae.lookup.name}],Decimal:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Integer:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Number:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],BigNumber:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Date:[{key:ae["date-picker"].type,value:ae["date-picker"].name}],DateTime:[{key:ae["date-picker"].type,value:ae["date-picker"].name}],Boolean:[{key:ae.switch.type,value:ae.switch.name},{key:ae["check-box"].type,value:ae["check-box"].name}],Enum:[{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name}],Object:[{key:ae.lookup.type,value:ae.lookup.name},{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name}]});let Gn=Rt;var dn=(n=>(n.Form="Form",n.Variable="Variable",n))(dn||{}),vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ya={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(){return function(){function e(o,r,i){function s(f,d){if(!r[f]){if(!o[f]){var u=typeof Yt=="function"&&Yt;if(!d&&u)return u(f,!0);if(l)return l(f,!0);var p=new Error("Cannot find module '"+f+"'");throw p.code="MODULE_NOT_FOUND",p}var h=r[f]={exports:{}};o[f][0].call(h.exports,function(m){var M=o[f][1][m];return s(M||m)},h,h.exports,e,o,r,i)}return r[f].exports}for(var l=typeof Yt=="function"&&Yt,c=0;c<i.length;c++)s(i[c]);return s}return e}()({1:[function(e,o,r){var i={},s="(?:^|\\s)",l="(?:\\s|$)";function c(u){var p=i[u];return p?p.lastIndex=0:i[u]=p=new RegExp(s+u+l,"g"),p}function f(u,p){var h=u.className;h.length?c(p).test(h)||(u.className+=" "+p):u.className=p}function d(u,p){u.className=u.className.replace(c(p)," ").trim()}o.exports={add:f,rm:d}},{}],2:[function(e,o,r){(function(i){var s=e("contra/emitter"),l=e("crossvent"),c=e("./classes"),f=document,d=f.documentElement;function u(w,R){var L=arguments.length;L===1&&Array.isArray(w)===!1&&(R=w,w=[]);var C,k,D,B,O,P,A,E,I,H=null,$,W,z=!1,X=0,K,Q=R||{};Q.moves===void 0&&(Q.moves=v),Q.accepts===void 0&&(Q.accepts=v),Q.invalid===void 0&&(Q.invalid=mt),Q.containers===void 0&&(Q.containers=w||[]),Q.isContainer===void 0&&(Q.isContainer=y),Q.copy===void 0&&(Q.copy=!1),Q.copySortSource===void 0&&(Q.copySortSource=!1),Q.revertOnSpill===void 0&&(Q.revertOnSpill=!1),Q.removeOnSpill===void 0&&(Q.removeOnSpill=!1),Q.direction===void 0&&(Q.direction="vertical"),Q.ignoreInputTextSelection===void 0&&(Q.ignoreInputTextSelection=!0),Q.mirrorContainer===void 0&&(Q.mirrorContainer=f.body);var de=s({containers:Q.containers,start:Oe,end:dt,cancel:je,remove:Ge,destroy:Y,canMove:Se,dragging:!1});return Q.removeOnSpill===!0&&de.on("over",xt).on("out",gt),xe(),de;function he(q){return de.containers.indexOf(q)!==-1||Q.isContainer(q)}function xe(q){var ee=q?"remove":"add";m(d,ee,"mousedown",G),m(d,ee,"mouseup",_e)}function De(q){var ee=q?"remove":"add";m(d,ee,"mousemove",te)}function Re(q){var ee=q?"remove":"add";l[ee](d,"selectstart",ue),l[ee](d,"click",ue)}function Y(){xe(!0),_e({})}function ue(q){$&&q.preventDefault()}function G(q){B=q.clientX,O=q.clientY;var ee=M(q)!==1||q.metaKey||q.ctrlKey;if(!ee){var oe=q.target,ne=ve(oe);ne&&($=ne,De(),q.type==="mousedown"&&(T(oe)?oe.focus():q.preventDefault()))}}function te(q){if($){if(M(q)===0){_e({});return}if(!(q.clientX!==void 0&&Math.abs(q.clientX-B)<=(Q.slideFactorX||0)&&q.clientY!==void 0&&Math.abs(q.clientY-O)<=(Q.slideFactorY||0))){if(Q.ignoreInputTextSelection){var ee=N("clientX",q)||0,oe=N("clientY",q)||0,ne=f.elementFromPoint(ee,oe);if(T(ne))return}var be=$;De(!0),Re(),dt(),ot(be),c.add(E||D,"gu-transit"),_t(),Mt(),X=0,ft(q)}}}function ve(q){if(!(de.dragging&&C)&&!he(q)){for(var ee=q;S(q)&&he(S(q))===!1;)if(Q.invalid(q,ee)||(q=S(q),!q))return;var oe=S(q);if(oe&&!Q.invalid(q,ee)){var ne=Q.moves(q,oe,ee,V(q));if(ne)return{item:q,source:oe}}}}function Se(q){return!!ve(q)}function Oe(q){var ee=ve(q);ee&&ot(ee)}function ot(q){Ne(q.item,q.source)&&(E=q.item.cloneNode(!0),de.emit("cloned",E,q.item,"copy")),k=q.source,D=q.item,P=A=V(q.item),de.dragging=!0,de.emit("drag",D,k)}function mt(){return!1}function dt(){if(de.dragging){var q=E||D;Ie(q,S(q))}}function J(){$=!1,De(!0),Re(!0)}function _e(q){if(J(),!!de.dragging){var ee=E||D,oe=N("clientX",q)||0,ne=N("clientY",q)||0,be=x(C,oe,ne),ye=Ct(be,oe,ne);ye&&(E&&Q.copySortSource||!E||ye!==k)?Ie(ee,ye):Q.removeOnSpill?Ge():je()}}function Ie(q,ee){var oe=S(q);E&&Q.copySortSource&&ee===k&&oe.removeChild(D),ht(ee)?de.emit("cancel",q,k):de.emit("drop",q,ee,k,A),it()}function Ge(){if(de.dragging){var q=E||D,ee=S(q);ee&&ee.removeChild(q),de.emit(E?"cancel":"remove",q,ee,k),it()}}function je(q){if(de.dragging){var ee=arguments.length>0?q:Q.revertOnSpill,oe=E||D,ne=S(oe),be=ht(ne);be===!1&&ee&&(E?ne&&ne.removeChild(E):k.insertBefore(oe,P)),be||ee?de.emit("cancel",oe,k,k):de.emit("drop",oe,ne,k,A),it()}}function it(){var q=E||D;J(),re(),fe(),q&&c.rm(q,"gu-transit"),I&&clearTimeout(I),de.dragging=!1,H&&de.emit("out",q,H,k),de.emit("dragend",q,X),k=D=E=P=A=I=H=null}function ht(q,ee){var oe;return ee!==void 0?oe=ee:C?oe=A:oe=V(E||D),q===k&&oe===P}function Ct(q,ee,oe){for(var ne=q;ne&&!be();)ne=S(ne);return ne;function be(){var ye=he(ne);if(ye===!1)return!1;var Be=ge(ne,q),Te=we(ne,Be,ee,oe),$e=ht(ne,Te);return $e?!0:Q.accepts(D,ne,k,Te)}}function ft(q){if(!C)return;q.preventDefault();var ee=N("clientX",q)||0,oe=N("clientY",q)||0;C.style.left=ee-2+"px",C.style.top=oe-2+"px";var ne=E||D,be=x(C,ee,oe),ye=Ct(be,ee,oe),Be=ye!==null&&ye!==H;(Be||ye===null)&&(me(),H=ye,st()),pe(be,oe);var Te=S(ne);if(ye===k&&E&&!Q.copySortSource){Te&&Te.removeChild(ne);return}var $e,rt=ge(ye,be);if(z=Pe(rt,ye),rt!==null)$e=we(ye,rt,ee,oe);else if(Q.revertOnSpill===!0&&!E)$e=P,ye=k;else{E&&Te&&Te.removeChild(ne),E&&W&&(W.style.display="none");return}W.style.display="block",Vt($e,ne,Be),$e?Je(rt,$e):U(ye);function Xe(Ce){de.emit(Ce,ne,H,k)}function st(){Be&&Xe("over")}function me(){H&&Xe("out")}}function Vt(q,ee,oe){(q===ee||q===V(ee))&&(A=V(ee)),(q===null&&oe||q!==ee&&q!==V(ee))&&(A=q)}function xt(q){c.rm(q,"gu-hide")}function gt(q){de.dragging&&c.add(q,"gu-hide")}function Mt(){C||(C=document.createElement("div"),C.style="background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;",C.innerHTML=Q.getMirrorText&&Q.getMirrorText(D)||"控件",c.add(C,"gu-mirror"),Q.mirrorContainer.appendChild(C),m(d,"add","mousemove",ft),c.add(Q.mirrorContainer,"gu-unselectable"),de.emit("cloned",C,D,"mirror"))}function _t(){if(W=document.createElement("div"),c.add(W,"gu-insertion"),D){var q=D.getBoundingClientRect();W.style.left=q.left+"px",W.style.top=q.top+"px"}z=!1,Q.mirrorContainer.appendChild(W)}function re(){C&&(c.rm(Q.mirrorContainer,"gu-unselectable"),m(d,"remove","mousemove",ft),S(C).removeChild(C),C=null)}function fe(){W&&(S(W).removeChild(W),W=null)}function ge(q,ee){for(var oe=ee;oe!==q&&S(oe)!==q;)oe=S(oe);return oe===d?null:oe}function Pe(q,ee){if(!ee)return z;var oe=q||ee&&ee.lastElementChild;if(!oe)return!0;var ne=getComputedStyle(q),be=/^inline/.test(ne.getPropertyValue("display"))||/^(left|right)$/.test(ne.getPropertyValue("float"));if(be)return!0;if(ee){var ye=getComputedStyle(ee),Be=ye.getPropertyValue("display");if(/flex$/.test(Be)){var Te=ye.getPropertyValue("flex-direction")||"row";if(Te==="row"||Te==="row-reverse")return!ze(ee)}return!1}return!0}function ze(q){if(!q.children||!q.children.length)return!1;for(const ee of Array.from(q.children)){const ne=(ee.className&&ee.className.split(" ")||[]).filter(be=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(be));if(!ne.length)return!1;for(const be of ne){const ye=be.slice(be.lastIndexOf("-")+1);if(parseInt(ye,10)!==12)return!1}}return!0}function Je(q,ee){const oe=ee.getBoundingClientRect();if(W.style.left=oe.left+"px",W.style.top=oe.top+"px",z){if(W.style.height=oe.height+"px",W.style.width="4px",q){const ne=q.getBoundingClientRect();ne.top!==oe.top&&(W.style.left=ne.right+"px",W.style.top=ne.top+"px",W.style.height=ne.height+"px")}}else if(W.style.height="4px",W.style.width=oe.width+"px",K){const ne=K.getBoundingClientRect();oe.top<ne.top&&(W.style.display="none")}ee===D&&D&&(W.style.display="none")}function U(q){A=null;var ee=q.lastElementChild;if(ee){var oe=ee.getBoundingClientRect();z?(W.style.left=oe.right+"px",W.style.top=oe.top+"px",W.style.height=oe.height+"px",W.style.width="4px"):(W.style.left=oe.left+"px",W.style.top=oe.bottom+"px",W.style.height="4px",W.style.width=oe.width+"px"),ee===D&&D&&(W.style.display="none")}else W.style.display="none"}function pe(q,ee){if(!Q.mirrorContainer.contains(q)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(K=p(q),!K||!K.contains(q)))return;const oe=document.querySelector(".dgComponentSelected"),ne=K.getBoundingClientRect();if(ee-30<ne.top&&K.scrollTop>0){let be=K.scrollTop<10?K.scrollTop:10;K.scrollBy(0,-1*be),oe&&K.contains(oe)&&(X=X+-1*be)}if(ee+30>ne.bottom&&K.scrollTop<K.scrollHeight-K.clientHeight){const be=K.scrollHeight-K.clientHeight-K.scrollTop;let ye=be<10?be:10;K.scrollBy(0,ye),oe&&K.contains(oe)&&(X=X+ye)}}function we(q,ee,oe,ne){var be=Q.direction==="horizontal",ye=Q.direction==="mixed",Be=ee!==q?$e():Te();return Be;function Te(){var Xe=q.children.length,st,me,Ce;for(st=0;st<Xe;st++)if(me=q.children[st],Ce=me.getBoundingClientRect(),be&&Ce.left+Ce.width/2>oe||!ye&&!be&&Ce.top+Ce.height/2>ne||ye&&Ce.left+Ce.width>oe&&Ce.top+Ce.height>ne)return me;return null}function $e(){var Xe=ee.getBoundingClientRect();if(ye){var st=ne-Xe.top,me=oe-Xe.left,Ce=Xe.bottom-ne,et=Xe.right-oe,Ze=Math.min(me,et,st,Ce),tt;return z?tt=et<me:tt=Ce===Ze||et===Ze||me===Ze,rt(tt)}return rt(be?oe>Xe.left+b(Xe)/2:ne>Xe.top+_(Xe)/2)}function rt(Xe){return Xe?V(ee):ee}}function Ne(q,ee){return typeof Q.copy=="boolean"?Q.copy:Q.copy(q,ee)}}function p(w){const R=Array.from(window.scrollContainerList);if(R.length===1){const C=Array.from(window.scrollContainerList)[0];return document.getElementById(C)}const L=h(R);for(const C of L)if(C.contains(w))return C;return null}function h(w){const R=[];return w.forEach(L=>{const C=document.getElementById(L);C&&R.push(C)}),R.sort((L,C)=>L.contains(C)?1:C.contains(L)?-1:0),R}function m(w,R,L,C){var k={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},D={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},B={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};i.navigator.pointerEnabled?l[R](w,D[L],C):i.navigator.msPointerEnabled?l[R](w,B[L],C):(l[R](w,k[L],C),l[R](w,L,C))}function M(w){if(w.touches!==void 0)return w.touches.length;if(w.which!==void 0&&w.which!==0)return w.which;if(w.buttons!==void 0)return w.buttons;var R=w.button;if(R!==void 0)return R&1?1:R&2?3:R&4?2:0}function x(w,R,L){w=w||{};var C=w.className||"",k;return w.className+=" gu-hide",k=f.elementFromPoint(R,L),w.className=C,k}function y(){return!1}function v(){return!0}function b(w){return w.width||w.right-w.left}function _(w){return w.height||w.bottom-w.top}function S(w){return w.parentNode===f?null:w.parentNode}function T(w){return w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.tagName==="SELECT"||g(w)}function g(w){return!w||w.contentEditable==="false"?!1:w.contentEditable==="true"?!0:g(S(w))}function V(w){return w.nextElementSibling||R();function R(){var L=w;do L=L.nextSibling;while(L&&L.nodeType!==1);return L}}function F(w){return w.targetTouches&&w.targetTouches.length?w.targetTouches[0]:w.changedTouches&&w.changedTouches.length?w.changedTouches[0]:w}function N(w,R){var L=F(R),C={pageX:"clientX",pageY:"clientY"};return w in C&&!(w in L)&&C[w]in L&&(w=C[w]),L[w]}o.exports=u}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(e,o,r){o.exports=function(s,l){return Array.prototype.slice.call(s,l)}},{}],4:[function(e,o,r){var i=e("ticky");o.exports=function(l,c,f){l&&i(function(){l.apply(f||null,c||[])})}},{ticky:10}],5:[function(e,o,r){var i=e("atoa"),s=e("./debounce");o.exports=function(c,f){var d=f||{},u={};return c===void 0&&(c={}),c.on=function(p,h){return u[p]?u[p].push(h):u[p]=[h],c},c.once=function(p,h){return h._once=!0,c.on(p,h),c},c.off=function(p,h){var m=arguments.length;if(m===1)delete u[p];else if(m===0)u={};else{var M=u[p];if(!M)return c;M.splice(M.indexOf(h),1)}return c},c.emit=function(){var p=i(arguments);return c.emitterSnapshot(p.shift()).apply(this,p)},c.emitterSnapshot=function(p){var h=(u[p]||[]).slice(0);return function(){var m=i(arguments),M=this||c;if(p==="error"&&d.throws!==!1&&!h.length)throw m.length===1?m[0]:m;return h.forEach(function(y){d.async?s(y,m,M):y.apply(M,m),y._once&&c.off(p,y)}),c}},c}},{"./debounce":4,atoa:3}],6:[function(e,o,r){(function(i){var s=e("custom-event"),l=e("./eventmap"),c=i.document,f=p,d=m,u=[];i.addEventListener||(f=h,d=M),o.exports={add:f,remove:d,fabricate:x};function p(S,T,g,V){return S.addEventListener(T,g,V)}function h(S,T,g){return S.attachEvent("on"+T,v(S,T,g))}function m(S,T,g,V){return S.removeEventListener(T,g,V)}function M(S,T,g){var V=b(S,T,g);if(V)return S.detachEvent("on"+T,V)}function x(S,T,g){var V=l.indexOf(T)===-1?N():F();S.dispatchEvent?S.dispatchEvent(V):S.fireEvent("on"+T,V);function F(){var w;return c.createEvent?(w=c.createEvent("Event"),w.initEvent(T,!0,!0)):c.createEventObject&&(w=c.createEventObject()),w}function N(){return new s(T,{detail:g})}}function y(S,T,g){return function(F){var N=F||i.event;N.target=N.target||N.srcElement,N.preventDefault=N.preventDefault||function(){N.returnValue=!1},N.stopPropagation=N.stopPropagation||function(){N.cancelBubble=!0},N.which=N.which||N.keyCode,g.call(S,N)}}function v(S,T,g){var V=b(S,T,g)||y(S,T,g);return u.push({wrapper:V,element:S,type:T,fn:g}),V}function b(S,T,g){var V=_(S,T,g);if(V){var F=u[V].wrapper;return u.splice(V,1),F}}function _(S,T,g){var V,F;for(V=0;V<u.length;V++)if(F=u[V],F.element===S&&F.type===T&&F.fn===g)return V}}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(e,o,r){(function(i){var s=[],l="",c=/^on/;for(l in i)c.test(l)&&s.push(l.slice(2));o.exports=s}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(e,o,r){(function(i){var s=i.CustomEvent;function l(){try{var c=new s("cat",{detail:{foo:"bar"}});return c.type==="cat"&&c.detail.foo==="bar"}catch{}return!1}o.exports=l()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(f,d){var u=document.createEvent("CustomEvent");return d?u.initCustomEvent(f,d.bubbles,d.cancelable,d.detail):u.initCustomEvent(f,!1,!1,void 0),u}:function(f,d){var u=document.createEventObject();return u.type=f,d?(u.bubbles=!!d.bubbles,u.cancelable=!!d.cancelable,u.detail=d.detail):(u.bubbles=!1,u.cancelable=!1,u.detail=void 0),u}}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(e,o,r){var i=o.exports={},s,l;function c(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=c}catch{s=c}try{typeof clearTimeout=="function"?l=clearTimeout:l=f}catch{l=f}})();function d(_){if(s===setTimeout)return setTimeout(_,0);if((s===c||!s)&&setTimeout)return s=setTimeout,setTimeout(_,0);try{return s(_,0)}catch{try{return s.call(null,_,0)}catch{return s.call(this,_,0)}}}function u(_){if(l===clearTimeout)return clearTimeout(_);if((l===f||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(_);try{return l(_)}catch{try{return l.call(null,_)}catch{return l.call(this,_)}}}var p=[],h=!1,m,M=-1;function x(){!h||!m||(h=!1,m.length?p=m.concat(p):M=-1,p.length&&y())}function y(){if(!h){var _=d(x);h=!0;for(var S=p.length;S;){for(m=p,p=[];++M<S;)m&&m[M].run();M=-1,S=p.length}m=null,h=!1,u(_)}}i.nextTick=function(_){var S=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)S[T-1]=arguments[T];p.push(new v(_,S)),p.length===1&&!h&&d(y)};function v(_,S){this.fun=_,this.array=S}v.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function b(){}i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(_){return[]},i.binding=function(_){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(_){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],10:[function(e,o,r){(function(i){var s=typeof i=="function",l;s?l=function(c){i(c)}:l=function(c){setTimeout(c,0)},o.exports=l}).call(this,e("timers").setImmediate)},{timers:11}],11:[function(e,o,r){(function(i,s){var l=e("process/browser.js").nextTick,c=Function.prototype.apply,f=Array.prototype.slice,d={},u=0;r.setTimeout=function(){return new p(c.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new p(c.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(h){h.close()};function p(h,m){this._id=h,this._clearFn=m}p.prototype.unref=p.prototype.ref=function(){},p.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(h,m){clearTimeout(h._idleTimeoutId),h._idleTimeout=m},r.unenroll=function(h){clearTimeout(h._idleTimeoutId),h._idleTimeout=-1},r._unrefActive=r.active=function(h){clearTimeout(h._idleTimeoutId);var m=h._idleTimeout;m>=0&&(h._idleTimeoutId=setTimeout(function(){h._onTimeout&&h._onTimeout()},m))},r.setImmediate=typeof i=="function"?i:function(h){var m=u++,M=arguments.length<2?!1:f.call(arguments,1);return d[m]=!0,l(function(){d[m]&&(M?h.apply(null,M):h.call(null),r.clearImmediate(m))}),m},r.clearImmediate=typeof s=="function"?s:function(h){delete d[h]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Ya);const Ua={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},Xa={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},fn=a.defineComponent({name:"Toast",props:Xa,emits:["close","click"],setup:(n,t)=>{const e=a.ref(n.animate),o="fadeOut",r=a.computed(()=>n.options),i=a.ref(!1),s=a.computed(()=>{const y={animated:i.value,toast:!0};return y[n.animate]=!1,y[o]=i.value,y[r.value.type]=!0,r.value.theme&&(y[r.value.theme]=!0),y}),l=a.computed(()=>{const b=`f-icon-${r.value&&r.value.type?r.value.type.replace("toasty-type-",""):"default"}`,_={"f-icon":!0};return _[b]=!0,_}),c=a.computed(()=>r.value.title||r.value.message),f=a.computed(()=>r.value.title&&r.value.message),d=a.computed(()=>!r.value.title&&r.value.message),u=a.computed(()=>n.showCloseButton),p=a.computed(()=>!!r.value.buttons||!!t.slots.default);function h(y){y.stopPropagation(),y.preventDefault(),i.value=!1,setTimeout(()=>{t.emit("close",r.value)},200)}function m(y,v){}function M(y){return`f-preten-link ${y.customClass?y.customClass:""}`}a.watch(e,()=>{e.value});const x=()=>{var y;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((y=r.value.buttons)==null?void 0:y.map(v=>a.createVNode("span",{class:M(v),onClick:b=>void 0},[v.text]))),t.slots.default&&t.slots.default()])])};return()=>a.createVNode("div",{class:s.value,style:"min-height:44px"},[u.value&&a.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:h},[a.createVNode("span",{class:"f-icon modal_close"},null)]),c.value&&a.createVNode("section",{class:"modal-tips"},[a.createVNode("div",{class:"float-left modal-tips-iconwrap"},[a.createVNode("span",{class:l.value},null)]),a.createVNode("div",{class:"modal-tips-content"},[f.value&&a.createVNode(a.Fragment,null,[a.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:r.value.title},null),a.createVNode("p",{class:"toast-msg",innerHTML:r.value.message},null),p.value&&x()]),d.value&&(r.value.buttons?a.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[a.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null),a.createVNode("div",{class:"after-toast-title text-right ml-auto"},[x()])]):a.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null))])])])}}),Ut=a.defineComponent({name:"Notify",props:Ua,emits:["close","empty"],setup(n,t){const e=a.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=a.ref(),i=a.ref(n.options),s=a.ref(n.showCloseButton),l=a.computed(()=>n.position||"bottom-right"),c=a.computed(()=>n.timeout!=null?n.timeout:3e3),f=a.computed(()=>{const p=n.bottom?n.bottom:o.bottom,h=n.top?n.top:o.top,m={transition:"all 0.2s ease",left:l.value.indexOf("left")>-1?`${n.left?n.left:o.left}px`:"",right:l.value.indexOf("right")>-1?`${n.right?n.right:o.right}px`:"",top:l.value.indexOf("top")>-1?`${h}px`:"",bottom:l.value.indexOf("bottom")>-1?`${p}px`:""};return l.value.indexOf("center")>-1&&(m.left="50%",m.marginLeft="calc(-24rem / 2)",l.value==="center-center"&&(m.top="50%",m.transform="translate(-50%, -50%)")),m});function d(p){t.emit("close")}c.value&&setTimeout(()=>{d()},c.value),t.expose({closeToast:d,container:r,notifyPosition:l});function u(p,h){d()}return()=>a.createVNode("div",{class:e.value,style:f.value,ref:r},[a.createVNode(fn,{options:i.value,showCloseButton:s.value,animate:n.animate,onClose:p=>u(p,i.value)},null)])}});class zn{constructor(){j(this,"notifyRefs",[]);j(this,"globalConfig",a.reactive({}))}escapeAllHtml(t){if(typeof t!="string"||!t)return"";const e=document.createElement("div");return e.textContent=t||"",e.innerHTML.replace(/ /g,"&nbsp;").replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(t){const e=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...t}),i=document.createElement("div");i.style.display="contents";const s=a.createApp({setup(){var f;const l=a.ref();function c(){l.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(r,l),s.unmount()},220)}if(r.position.indexOf("top")>-1){const d=e.getNotifyInstances(r.position),u=d[d.length-1];if(u){const p=u.value.container.getBoundingClientRect();r.top=p.bottom}}return r.safeHtml&&((f=r.options)!=null&&f.message)&&(r.options.message=e.escapeAllHtml(r.options.message)),a.onUnmounted(()=>{document.body.removeChild(i)}),a.onMounted(()=>{e.updateNotifyPositionForCreate(r,l)}),()=>a.createVNode(a.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[a.createVNode(Ut,a.mergeProps({ref:l},r,{onClose:c}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(i),s.mount(i),s}getNotifyInstances(t){return this.notifyRefs.filter(e=>e.value.notifyPosition===t)}updateNotifyPositionForCreate(t,e){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;t.position.indexOf("bottom")>-1&&this.getNotifyInstances(t.position).forEach(r=>{const i=r.value.container.getBoundingClientRect();r.value.container.style.bottom=i.height+o-i.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,e]}updateNotifyPositionForClose(t,e){const o=this.notifyRefs.indexOf(e);if(t.position.indexOf("top")>-1){const r=this.getNotifyInstances(t.position),i=r.indexOf(e);r.slice(i+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,e){let o="",r="",i,s,l;typeof e=="string"?o=e:e&&(o=e.message||"",r=e.title||"",s=e.position||null,l=e.showCloseButton!=null?e.showCloseButton:null,i=e.timeout!=null?e.timeout:null);const f={options:{type:t,message:o,title:r}};return s!=null&&(f.position=s),l!=null&&(f.showCloseButton=l),i!=null&&(f.timeout=i),f}info(t){const e=this.buildNotifyProps("info",t);return this.show(e)}success(t){const e=this.buildNotifyProps("success",t);return this.show(e)}warning(t){const e=this.buildNotifyProps("warning",t);return this.show(e)}error(t){const e=this.buildNotifyProps("error",t);return this.show(e)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const Qa=Symbol("NOTIFY_SERVICE_TOKEN");Ut.install=n=>{n.component(Ut.name,Ut),n.component(fn.name,fn);const t=new zn;n.provide(Qa,t),n.provide("FNotifyService",t)};const Yn=new Map([["appearance",rn],["column","columnOption"]]);function Za(n,t,e){var u;const o=e.parentComponentInstance,r=o.schema.type,i=String(((u=o.schema.appearance)==null?void 0:u.class)||"").split(" "),s=r==="section"||r==="tab-page",l=i.includes("f-page-content-nav"),c=i.includes("f-page-main"),f=n.getSchemaByType("component");f.id=`${t.id}-component`,f.componentType="data-grid";let d="";return d+=s?"f-struct-data-grid-in-card f-struct-is-subgrid":"",d+=l?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",d+=c?"f-struct-data-grid f-struct-wrapper":"",f.appearance={class:d},f.contents=[t],f}function Ka(n,t,e){const o=e.parentComponentInstance,r=String(o.schema.appearance.class||"").split(" "),i=r.includes("f-page-content-nav"),s=r.includes("f-page-main"),l=n.getSchemaByType("section");l.id=`${t.id}-section`;let c="";return c+=i?"f-section-in-nav ":"",c+=s?"f-section-in-managelist ":"",c+="f-section-grid",l.appearance={class:c},l.contents=[t],l}function Ja(n,t,e){const o=n.getSchemaByType("content-container");return o.id=`${t.id}-layout`,o.appearance={class:"f-grid-is-sub f-utils-flex-column"},o.contents=[t],o}function Un(n,t,e){const r=e.parentComponentInstance.schema.type,i=r==="section"||r==="tab-page";t.appearance={class:"f-component-grid"};const l=(i?Ja:Ka)(n,t,e);return Za(n,l,e)}const Xn={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tree-grid.schema.json",title:"tree-grid",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"tree-grid"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},fit:{type:"boolean",default:!1},showStripe:{type:"boolean",default:!0},showBorder:{type:"boolean",default:!1},showTreeNodeIcons:{type:"boolean",default:!1},showSetting:{type:"boolean",default:!1},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},dataSource:{description:"",type:"string",default:""},columns:{description:"",type:"array",default:[]},identifyField:{description:"",type:"string"},editable:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},cell:{type:"object",properties:{highlightFocusingCell:{description:"",type:"boolean",default:!1},mergeCell:{description:"",type:"boolean",default:!1},showEditableIcon:{description:"",type:"boolean",default:!1}}},column:{type:"object",properties:{fitColumns:{description:"",type:"boolean",default:!1},fitMode:{description:"",type:"string",default:"average"},groups:{description:"",type:"array",default:[]},reorderColumn:{description:"Enable to drag column to reorder",type:"boolean",default:!1},resizeColumn:{type:"boolean",default:!0},resizeColumnOnDoubleClick:{description:"",type:"boolean",default:!0}}},command:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},commands:{type:"array",default:[]},commandColumnWidth:{description:"",type:"number",default:120},onClickDeleteCommand:{description:"",type:"string",default:""},onClickEditCommand:{description:"",type:"string",default:""}}},contextMenu:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},customizaiton:{type:"object",properties:{enableScheme:{description:"",type:"boolean",default:!1},enableSetting:{description:"",type:"boolean",default:!1}}},edit:{type:"obejct",properties:{mode:{description:"",type:"string",default:"cell",enum:["cell","row","card"]},selectOnEditing:{description:"",type:"boolean",default:!1},onAppendRow:{description:"",type:"string",default:""},onBeforeEdit:{description:"",type:"string",default:""}}},filter:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},filterStyle:{description:"",type:"string",default:"filter-column",enum:["filter-column","filter-row"]},mode:{description:"",type:"string",default:"server",enum:["client","server"]},showSummary:{description:"",type:"boolean",default:!0},onFilterChange:{description:"",type:"string",default:""}}},footer:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customFooterStyle:{description:"",type:"object"},footerDataCommand:{description:"",type:"string",default:""},footerDataFrom:{description:"",type:"string",default:"client"},footerHeight:{description:"",type:"number",default:29},footerPosition:{description:"",type:"string",default:"bottom"},footerTemplate:{description:"",type:"string",default:""}}},group:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customGroupRow:{description:"",type:"object"},customGroupRowStyle:{description:"",type:"obejct"},customSummaryStyle:{description:"",type:"obejct"},groupColSpan:{description:"",type:"number",default:1},groupFields:{description:"",type:"array",default:[]},showGroupedColumn:{description:"",type:"boolean",default:!0},showGroupPanel:{description:"",type:"boolean",default:!1},showSummary:{description:"",type:"boolean",default:!1},summaryPosition:{description:"",type:"string",default:"separate",enum:["separate","merge-to-group"]},disableGroupOnEditing:{description:"",type:"boolean",default:!0},expandGroupRows:{description:"",type:"boolean",default:!0}}},header:{type:"object",properties:{wrapHeadings:{description:"",type:"boolean",default:!1}}},pagination:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},disablePagination:{description:"",type:"string",default:""},contentTemplate:{description:"",type:"string",default:""},index:{description:"",type:"number",default:1},mode:{description:"",type:"string",default:"server",enum:["server","client"]},showGoto:{description:"",type:"boolean",default:!1},showIndex:{description:"",type:"boolean",default:!0},showLimits:{description:"",type:"boolean",default:!1},showPageInfo:{description:"",type:"boolean",default:!0},size:{description:"",type:"number",default:20},sizeLimits:{description:"",type:"array",default:[10,20,30,50,100]},onPageChange:{description:"",type:"string",default:""},onPageSizeChange:{description:"",type:"string",default:""}}},row:{type:"object",properties:{customRowStyle:{description:"",type:"object"},disable:{description:"",type:"obejct"},height:{description:"",type:"number",default:30},showHovering:{type:"boolean",default:!0},wrapContent:{type:"boolean",default:!1}}},rowNumber:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},heading:{description:"",type:"string",default:"序号"},width:{description:"",type:"number",default:36},onClickRow:{description:"",type:"string",default:""},onDoubleClickRow:{description:"",type:"string",default:""}}},selection:{type:"object",properties:{enableSelectRow:{description:"允许选中行",type:"boolean",default:!0},enable:{description:"",type:"boolean",default:!0},checkOnSelect:{description:"",type:"boolean",default:!1},clearSelectionOnEmpty:{description:"",type:"boolean",default:!0},customSelectionItem:{description:"",type:"object"},focusSelection:{description:"",type:"string",default:"current",enum:["current","all"]},keepSelectingOnClick:{description:"",type:"boolean",default:!0},keepSelectingOnPaging:{description:"",type:"boolean",default:!0},multiSelect:{description:"",type:"boolean",default:!1},selectionMode:{description:"",type:"string",default:"default"},selectOnCheck:{description:"",type:"boolean",default:!1},selectOnEditing:{description:"",type:"boolean",default:!1},showCheckbox:{description:"",type:"boolean",default:!1},showCheckAll:{description:"",type:"boolean",default:!1},showSelection:{description:"",type:"boolean",default:!1},onBeforeSelect:{description:"",type:"string",default:""},onBeforeUnCheck:{description:"",type:"",default:""},onBeforeUnSelect:{description:"",type:"string",default:""},onCheckAll:{description:"",type:"string",default:""},onChecked:{description:"",type:"string",default:""},onSelectionChange:{description:"",type:"string",default:""},onUnCheckAll:{description:"",type:"string",default:""},onUnChecked:{description:"",type:"string",default:""},onCheckedChange:{description:"",type:"string"}}},sort:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},fields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},multiSort:{description:"",type:"boolean",default:!1}}},summary:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customSummaryStyle:{description:"",type:"object"},groupFields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},position:{description:"",type:"boolean",default:"bottom",enum:["bottom","top","both"]}}},toolbar:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},visualization:{autoHeight:{description:"",type:"boolean",default:!1},emptyDataHeight:{description:"",type:"number",default:36},emptyTemplate:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:300},scrollBarShowMode:{description:"",type:"string",default:"auto"},showBorder:{description:"",type:"boolean",default:!1},showScrollArrow:{description:"",type:"boolean",default:!1},striped:{description:"",type:"boolean",default:!0},useBlankWhenDataIsEmpty:{description:"",type:"boolean",default:!1}},onSelectionChange:{description:"行切换事件",type:"string",default:""}},required:["id","type","columns"],events:{onSelectionChange:"行切换事件",onClickRow:"行点击事件"}},pn={autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:32,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1}},ei=Ot(pn,Xn,Yn,Un),ti=ca(),ni=la(),Qn=Object.assign({},pn,{componentId:{type:String,default:""}}),oi=Ot(Qn,Xn,Yn,Un),ri=da();var nt=(n=>(n[n.readonly=0]="readonly",n[n.editable=1]="editable",n[n.editing=2]="editing",n))(nt||{}),lt=(n=>(n[n.initial=0]="initial",n[n.editing=1]="editing",n))(lt||{}),$t=(n=>(n[n.data=0]="data",n[n.group=1]="group",n[n.summary=2]="summary",n))($t||{}),Ke=(n=>(n[n.none=0]="none",n[n.filterable=1]="filterable",n[n.sortable=2]="sortable",n[n.filtered=4]="filtered",n[n.sorted=8]="sorted",n[n.ascending=16]="ascending",n[n.descending=32]="descending",n))(Ke||{});function ai(n,t){var h;const e=String(Date.now()),o=((h=n.rowOption)==null?void 0:h.height)||28,r=a.ref(t.value.primaryColumnsWidth);function i(m){const M={};return m.reduce((x,y,v)=>{const b=v<m.length-1?m[v+1]:null;return v===0&&(x[y.field]={left:0}),y.actualWidth!==void 0&&(x[y.field].width=y.actualWidth),b&&(x[b.field]={left:x[y.field].left+(y.actualWidth||0)}),x},M),M}function s(m,M,x){const y=o*(x+1),b=M[m.field].left-y+(M[m.field].width||0),_=m.parent.height?`${m.parent.height}px`:"";return{left:`${y}px`,width:`${b}px`,height:`${_}`}}function l(m,M,x){return{right:"0px",height:`${m.parent.height?`${m.parent.height}px`:""}`}}function c(m,M){const x=m.parent.height?`${m.parent.height}px`:"";return{left:`${M[m.field].left}px`,height:`${x}`,width:isNaN(Number(M[m.field].width))?"100%":`${M[m.field].width}px`}}function f(m,M,x){const v=(M.spanned||[]).reduce((_,S)=>_+(S.parent.height||0),0)+(m.height||0);return{top:`${m.top}px`,left:`${x[M.field].left}px`,width:`${x[M.field].width}px`,height:`${v}px`,padding:`calc(${v/2}px - 1rem) 0`}}function d(m,M){return`${e}_${m.type}_r_${m.index}_c_${M}_${m.refreshKey||""}`}function u(m){return`${e}_${m.type}_r_${m.index}_${m.refreshKey||""}`}function p(m){const M=m.height?`${m.height}px`:"";return{top:`${m.top}px`,width:isNaN(r.value)?"100%":`${r.value}px`,height:`${M}`}}return a.watch(t,()=>{r.value=t.value.primaryColumnsWidth}),{calculateCellPositionInRow:i,cellKey:d,cellPosition:c,groupCellPosition:s,rowKey:u,rowPosition:p,rowSpanCellPosition:f,summaryCellPosition:l}}function ii(n,t,e){const{hasChildrenField:o}=e,r=a.ref("#9399a0"),i=a.ref(28);function s(){return[].concat(...t.value.filter(p=>p.raw.__fv_descendant_index__.length!==0).map(p=>[...p.raw.__fv_descendant_index__.slice(-1)]).flat()).sort((p,h)=>Number(p)-Number(h))}function l(d){const u=new Array(t.value.length).fill(0);if(n.showLines){const p=s();t.value.forEach((h,m)=>{const M=p.includes(m),x=h.raw[o.value];u[m]=`repeating-linear-gradient(90deg, ${r.value} 0 1px, transparent 0px 2px) ${x?"-10px":"0px"} ${i.value/2}px/20px 1px no-repeat,repeating-linear-gradient(${r.value} 0 1px, transparent 0px 2px) 0px 0px/1px ${M?"50%":"100%"} no-repeat`}),u[0]=""}return u[d]}function c(d,u,p){return p[d].parents.set(d,!0).forEach(m=>{p[m].childsLength=p[m].childWithLines.filter(M=>u[M].visible).length}),u}function f(d){const h=d.raw.__fv_parent_index__===void 0||d.raw.__fv_parent_index__===-1?0:8,m=0,M=d.raw[o.value],x=`${d.layer*10+d.layer*h+m}px`,y=d.visible||Ee.isUndefined(d.visible)?{paddingLeft:`calc(${x} + 0.75rem)`,background:l(d.index),display:"flex",width:"100%",position:"relative"}:{display:"none"};return M||(y.paddingLeft=`calc(${x} + 2rem)`),y}return{hierarchyCellContentStyle:f,handleCollapsedPaddingBottom:c}}function si(n,t,e){const o=a.ref(n.iconField);function r(i,s){if(o.value)return i.raw[n.iconField];let l="";return i.raw[e.value]!==!0?l=t.value.leafnodes:l=i.collapse?t.value.fold:t.value.unfold,l}return{treeNodeIconsClass:r}}function li(n,t,e,o,r,i,s,l){const{dataView:c,hasRealChildren:f,reOrderVisibleIndex:d}=o,{collapseField:u,hasChildrenField:p}=r,{reCalculateVisualDataRows:h,updateVirticalScroll:m}=i;function M(x){if(x.raw[p.value]){const v=c.value[x.raw.__fv_index__];v[u.value]=!v[u.value],o.toggleChildrenVisibiltyByCollapseStatus(v),v[p.value]=f(v),d(),h(),m()}t.emit("expandNode",{row:x})}return{toggleTreeNode:M}}function ci(n){function t(r){return{}}function e(r){const{valign:i,align:s}=r;return{"d-flex":!0,"h-100":!0,"w-100":!0,"justify-content-start":s!=="center"&&s!=="right","justify-content-center":s==="center","justify-content-right":s==="right","align-items-start":i!=="middle"&&i!=="bottom","align-items-center":i==="middle","align-items-end":i==="bottom"}}function o(r){const{align:i,showEllipsis:s}=r;return{"w-100":!0,"text-left":i!=="center"&&i!=="right","text-center":i==="center","text-right":i==="right","text-truncate":s}}return{cellContentPosition:t,cellContentClass:e,cellContentClassWithEllipsis:o}}function ui(n,t,e,o,r,i,s,l,c,f,d,u,p){const{onClickCell:h}=i,{gridCellClass:m,gridHierarchyCellClass:M,gridRowClass:x,onClickRow:y,onMouseoverRow:v,onMouseoutRow:b}=l,{enableMultiSelect:_,select:S,unSelect:T,selectItem:g}=c;a.ref(n.cellHeight);const V=a.ref(n.treeNodeIconsData||{}),{hasChildrenField:F,shouldShowCheckBox:N,shouldShowIcon:w}=s,{toggleTreeNode:R}=li(n,t,o,r,s,d),{toggleSelectHierarchyItem:L}=f,{cellKey:C,cellPosition:k,rowKey:D,rowPosition:B}=ai(n,e),{cellContentClass:O,cellContentPosition:P,cellContentClassWithEllipsis:A}=ci(),{hierarchyCellContentStyle:E}=ii(n,o,s),{treeNodeIconsClass:I}=si(n,V,F);function H(G,te){const ve=G.raw[F.value];return{"fv-tree-node-toggle":ve&&G.collapse,"fv-tree-node-toggle-minus":ve&&!G.collapse}}function $(G,te){G.stopPropagation(),R(te)}function W(G){G.stopPropagation()}function z(G,te){return a.createVNode("div",{class:H(G),onClick:ve=>$(ve,G),onDblclick:W},null)}function X(G,te){return w.value&&a.createVNode("div",{id:"treeNodeIcons",class:I(G,te)},null)}function K(G){_.value?(G.checked?S(G):T(G),L(G)):g(G)}function Q(G,te){return N.value&&a.createVNode(ta.FCheckbox,{id:"checkbox_for_"+C(G,te.index),indeterminate:G.indeterminate,disabled:G.disabled,checked:G.checked,"onUpdate:checked":ve=>G.checked=ve,onChange:()=>K(G)},null)}function de(G,te){return a.createVNode("span",{title:te.data,style:"user-select:none"},[t.slots.cellTemplate?t.slots.cellTemplate({cell:te,row:G}):te.mode===nt.editing?te.getEditor(te):te.formatter?te.formatter(te,G):te.data!=null?te.data.toString():te.data])}function he(G,te){return a.createVNode("div",{class:A(te)},[te.showTips?a.createVNode(Sn,null,{default:()=>de(G,te),contentTemplate:()=>de(G,te)}):de(G,te)])}function xe(G,te,ve){const Se=E(G);return a.createVNode("div",{ref:te.setRef,key:C(G,te.index),class:"fv-grid-hierarchy-cell",style:k(te,ve)},[a.createVNode("div",{class:O(te),style:Se},[z(G),X(G,te),Q(G,te),he(G,te)])])}function De(G,te,ve){return a.createVNode("div",{ref:te.setRef,key:C(G,te.index),class:m(te),style:k(te,ve),onClick:Se=>h(Se,te,G,te.column)},[a.createVNode("div",{class:O(te)},[a.createVNode("div",{class:A(te)},[te.showTips?a.createVNode(Sn,null,{default:()=>de(G,te),contentTemplate:()=>de(G,te)}):de(G,te)])])])}function Re(G,te){return te==="left"&&e.value.leftColumns.length>0&&e.value.leftColumns[0].field===G.field||te==="primary"&&e.value.primaryColumns.length>0&&e.value.primaryColumns[0].field===G.field}function Y(G,te){t.emit("dblclickNode",{$event:G,node:te.raw})}function ue(G,te,ve="primary",Se){return a.createVNode("div",{ref:G.setRef,key:D(G),class:x(G,Se),style:B(G),onMouseover:Oe=>v(Oe,G),onMouseout:Oe=>b(Oe,G),onClick:Oe=>y(Oe,G),onDblclick:Oe=>Y(Oe,G)},[Object.values(G.data).filter(Oe=>te[Oe.field]&&Oe.rowSpan===1).map(Oe=>Re(Oe,ve)?xe(G,Oe,te):De(G,Oe,te))])}return{renderDataRow:ue}}function di(n,t,e){const{horizontalScrollThumbStyle:o,onMouseDownScrollThumb:r,shouldShowHorizontalScrollbar:i}=e;function s(){return i.value&&a.createVNode("div",{class:"fv-grid-horizontal-scroll"},[a.createVNode("div",{class:"fv-grid-horizontal-scroll-thumb",style:o.value,onMousedown:l=>r(l,t,"horizontal")},null)])}return{renderHorizontalScrollbar:s}}function fi(){function n(o,r){switch(o.command){case"edit":case"remove":return r.status===lt.initial;case"accept":case"cancel":return r.status===lt.editing;default:return!o.hidden}}function t(o,r,i){switch(o.onClick(r,i.dataIndex,i),o.command){case"edit":i.status,lt.editing;break;case"accept":case"cancel":i.status,lt.initial;break}}function e(o,r){return o.commands&&o.commands.map(i=>n(i,r)&&a.createVNode(na,{class:"ml-2",type:i.type,size:i.size||"small",onClick:s=>t(i,s,r),style:{"margin-bottom":"3px"}},{default:()=>[a.createTextVNode(" "),i.text,a.createTextVNode(" ")]}))}return{renderCommandColumn:e}}function pi(n){const t=a.ref(n.minHeight),e=a.ref(n.minWidth),o=a.ref(n.height),r=a.ref(n.width),i=a.computed(()=>o.value<=0?0:Math.max(o.value,t.value)),s=a.computed(()=>r.value<=0?0:Math.max(r.value,e.value));return a.watch([()=>n.height,()=>n.width,()=>n.minHeight,()=>n.minWidth],([c,f,d,u])=>{t.value=Number(d),e.value=Number(u),o.value=Number(c),r.value=Number(f)}),{containerStyleObject:a.computed(()=>({height:i.value>0?`${i.value}px`:n.fit?"100%":"",width:s.value>0?`${s.value}px`:n.fit?"100%":"",flex:"1 1 0"}))}}a.ref([{name:"七天",selectable:!0},{name:"一个月",selectable:!0},{name:"三个月",selectable:!0},{name:"半年",selectable:!0}]);function mi(n){const e=a.ref(n.commandOption.enable||!1),o=a.ref(n.commandOption.commands||[]);function r(i){if(e.value&&!(i.value.findIndex(l=>l.dataType==="commands")>-1)){const l={field:"__commands__",title:"操作",width:120,fixed:"right",dataType:"commands",commands:o.value,visible:!0};i.value.push(l)}}return{applyCommands:r}}function hi(n,t){var f;const e=a.ref((f=n.columnOption)==null?void 0:f.groups);function o(d,u,p,h,m){const M={actualWidth:0,children:[],depth:1,field:d.field,layer:1,left:0,parent:p,resizable:!0,title:d.title||"",status:Ke.none,popoverRef:a.ref(),showPopover:!1,column:null,sortType:"none"},x=h||M;if(d.group){let y=1;d.group.reduce((v,b)=>{if(typeof b=="string"){const _=u.get(b);_&&(m.fieldToRootMap.set(b,x),v.actualWidth+=_.actualWidth,v.children.push(_))}else{const _=o(b,u,v,x,m);y=Math.max(y,_.depth),v.actualWidth+=_.actualWidth,v.children.push(_)}return v},M),M.depth+=y}return t.value.headerDepth=Math.max(t.value.headerDepth,M.depth),M}function r(d){const u={groupedCells:new Map,fieldToRootMap:new Map};return e.value&&e.value.reduce((p,h)=>{const m=o(h,d,null,null,u);return p.groupedCells.set(h.field,m),p},u),u}function i(d){if(!d||d.length===0)return 0;const u=d[0];return u.children&&u.children.length>0&&(u.left=i(u.children)),u.left}function s(d,u){const p=t.value.headerDepth;d.forEach(h=>{h.layer=u?u.layer+1:1;const m=h.children&&h.children.length===0;h.depth=m?p-(h.layer-1):1,h.left=m?h.left:i(h.children),h.children&&s(h.children,h)})}function l(d,u){const p=new Map;return d.forEach(h=>{const m=u.fieldToRootMap.get(h.field),M=m!=null;M&&!p.has(m.field)&&p.set(m.field,m),M||p.set(h.field,h)}),s(Array.from(p.values())),p}function c(d){let u=new Map,p=0;if(d.reduce((h,m)=>{let M=Ke.none;M=m.filterable?M|Ke.filterable:M,M=m.sort&&m.sort!=="none"?M|Ke.sorted|(m.sort==="asc"?Ke.ascending:Ke.descending):M;const x=m.field;return h.set(x,{actualWidth:m.actualWidth||0,children:[],depth:1,layer:1,left:p,field:x,parent:null,resizable:m.resizable===void 0?!0:m.resizable,title:m.title,status:M,popoverRef:a.ref(),showPopover:!1,column:m,filterValue:null,sortType:m.sort||"none",showSetting:m.showSetting,draggable:m.draggable}),p+=m.actualWidth||0,h},u),e.value){const h=r(u);u=l(u,h)}return u}return{getGridHeaderCells:c}}function gi(n,t){var v;ke.useGuid();const{idField:e}=t,o=a.ref(n.summary),r=a.ref(n.group),i=a.ref(((v=n.group)==null?void 0:v.groupFields)||[]),s=a.computed(()=>{var b;return(b=n.group)==null?void 0:b.enable}),l=a.computed(()=>{var b;return(b=n.group)==null?void 0:b.showGroupPanel}),c=a.computed(()=>{const b=o.value;return(b==null?void 0:b.groupFields)||[]}),f=a.computed(()=>{const b=r.value;return b&&b.showSummary}),d=a.ref(0),u=new Map;let p=[];function h(b,_,S,T,g){const V=T[S];V&&(_.reduce((F,N,w)=>{var C;const R=N[V];let L=F.get(R);if(!L){const k=c.value.reduce((D,B)=>(D.set(B,0),D),new Map);L={field:V,title:((C=g.get(V))==null?void 0:C.title)||V,value:R,layer:S,details:[],groupSummaries:k},F.set(R,L)}return c.value&&c.value.forEach(k=>{if(L){const D=L.groupSummaries.get(k)||0;L.groupSummaries.set(k,D+N[k])}}),L.details.push(N),F},b),S<T.length-1&&b.forEach((F,N)=>{F.nestGroup=new Map,h(F.nestGroup,F.details,S+1,T,g),F.details=[]}))}function m(b,_){return n.group&&n.group.formatter?n.group.formatter(b.value,{...b,total:_}):`${b.title}:${b.value} (${_})`}function M(b,_){const S=[];return b.forEach(T=>{const g={[e.value]:`group_of_${_?_[e.value]+"_":""}${T.field}_${T.value}`,__fv_data_grid_group_collapse__:!1,__fv_data_grid_group_field__:T.field,__fv_data_grid_group_layer__:T.layer,__fv_data_grid_group_row__:!0,__fv_data_grid_group_value__:T.value};let V=0;if(S.push(g),T.nestGroup){const F=M(T.nestGroup,g);S.push(...F),V+=F.length}if(T.details&&T.details.length&&(S.push(...T.details),V+=T.details.length),f.value){const F={__fv_data_grid_group_field__:T.field,__fv_data_grid_group_layer__:T.layer,__fv_data_grid_group_summary__:!0};F[e.value]=`summary_of_${T.field}_${T.value}`,F[T.field]=Array.from(T.groupSummaries.entries()).reduce((N,[w,R])=>`${N} ${w} total:${R} `,""),S.push(F)}T.groupSummaries&&T.groupSummaries.size&&T.groupSummaries.forEach((F,N)=>{g[N]=F}),g[T.field]=m(T,V),g.value=T.value}),S.forEach((T,g)=>{T.__fv_data_index__=g}),S}function x(b,_,S){return!b||b.length===0||!_.length?_:(b.join(","),u.clear(),p=[],_=_.filter(T=>!T.__fv_data_grid_group_row__),h(u,_,0,b,S),p=M(u),p)}function y(b){return{"f-icon":!0,"f-icon-arrow-chevron-down":!0,"fv-grid-group-row-icon-collapse":b.collapse}}return{collpaseGroupIconClass:y,generateGroupData:x,groupFields:i,shouldGroupingData:s,showGroupPanel:l,groupRowSize:d}}function yi(n,t,e,o){const r=a.ref(0),i=a.ref(!!n.hierarchy),{idField:s}=o,{collapseField:l,hasChildrenField:c,parentIdField:f}=e,d=new Map,u=new Map,p=new Map;function h($,W){u.clear(),$.reduce((z,X)=>{const K=X[f.value]!==void 0?X[f.value]:"";if(K&&W.has(K)){const de=W.get(K),he=isNaN(Number(de.__fv_layer__))?1:Number(de.__fv_layer__);X.__fv_layer__=he+1,X.__fv_parent_index__=de.__fv_index__,de.__fv_hasChildren__=!0}else X.__fv_layer__=1;const Q=z.has(K)?z.get(K):[];return Q.push(X),z.set(K,Q),z},u)}function m($){p.clear(),$.reduce((W,z)=>{const X=z[s.value];return W.set(X,z),W},p)}function M($){$.forEach(W=>{const z=W[s.value];W.__fv_children_index__.map(K=>$[K]).forEach(K=>{K.__fv_parents__=new Map([...W.__fv_parents__.entries(),[z,!0]])})})}function x($){$.forEach(W=>{const z=new Set(W.__fv_children_index__);W.__fv_children_index__=[...z].sort((X,K)=>X-K)})}function y($){$.forEach(W=>{const z=W.__fv_parents__;Array.from(z.keys()).map(X=>p.get(X)).forEach(X=>{X.__fv_children_index__.push(W.__fv_index__)})}),x($)}function v($){$.forEach(W=>{W.__fv_child_with_lines__=[],W.__fv_child_length__=W.__fv_descendant_index__.length,W.__fv_descendant_index__.map(z=>$[z]).reduce((z,X)=>(z.__fv_child_length__+=X.__fv_children_index__.length,z.__fv_child_with_lines__.push(...X.__fv_children_index__,X.__fv_index__),z),W)})}function b($,W){return{id:$,index:W,parentId:"",parentIndex:-1,parents:new Map,children:new Map,descendant:new Map,collapsed:!1,visibleInHierarchy:!0}}function _($,W,z){Array.from(W.keys()).forEach(X=>{W.get(X).reduce((Q,de)=>{const he=de[s.value],xe=$.get(de[s.value]),De=$.get(X),Re=z.get(X);return De&&Re&&(De.children.set(he,xe),De.children.set(he,xe),xe.parentId=X,xe.parentIndex=De.index,xe.parents.set(X,De)),Q},$)})}function S($){$.children.forEach(z=>{z.parents=new Map([...$.parents.entries(),[$.id,$]]),S(z)})}function T($,W){$.filter(z=>z[f.value]===void 0||z[f.value]==="").forEach(z=>{const X=z[s.value],K=W.get(X);S(K)})}function g($){Array.from($.values()).forEach(W=>{Array.from(W.parents.values()).forEach(z=>{z.descendant.set(W.id,W)})})}function V($){d.clear(),$.forEach((W,z)=>{const X=W[s.value];d.set(X,b(X,z))}),m($),h($,p),_(d,u,p),T($,d),g(d)}function F($){const W=$[s.value],z=d.get(W);return z&&z.children.size>0}function N($){return $[c.value]&&!F($)}function w($){const W=$[s.value],z=d.get(W);return z&&z.visibleInHierarchy}function R(){r.value=Date.now()}function L($,W){W.forEach(z=>{const X=d.get(z[s.value]),K=d.get($),Q=p.get($);K&&Q&&(X.visibleInHierarchy=!Q[l.value]&&K.visibleInHierarchy)}),R()}function C($){if(u.has($)){const z=u.get($);L($,z),z.map(X=>X[s.value]).forEach(X=>C(X))}}function k($){const W=$[s.value];C(W)}function D($,W,z=0){$.forEach(X=>{const K=N(X),Q=X.__fv_layer__<=z,de=W==="ToCollapse"?X.__fv_layer__<=z:!(X.__fv_layer__<=z),he=Q?de:X[l.value];X[l.value]=K||he});for(const[X,K]of u.entries())L(X,K);return $}function B($,W){D($,"ToCollapse",W)}function O($,W){D($,"ToExpand",W)}function P($){$.forEach((W,z)=>{var de;const X=W[s.value],K=u.has(X)?(de=u.get(X))==null?void 0:de.map(he=>he.__fv_index__):[],Q=b(X,z);W.__fv_graph_node__=Q,W.__fv_children_index__=K,W.__fv_descendant_index__=[...K],W.__fv_parents__=new Map,N(W)&&(W[l.value]=!0)})}function A($){var X,K;V(t.value),P($),M($),y($),n.showLines&&v($);const z=((X=n.hierarchy)==null?void 0:X.collapseTo)!==void 0?Number((K=n.hierarchy)==null?void 0:K.collapseTo):0;return D($,"ToCollapse",z),$}function E($,W,z){const K=z.value[$][s.value],Q=d.get(K);if(Q){const de=d.get(Q.parentId);let he=z.value.length-1;if(de){const xe=Array.from(de.children.keys()).indexOf(Q.id);if(xe===de.children.size-1){const Re=Array.from(de.descendant.values())[de.descendant.size-1];he=z.value.findIndex(ue=>ue[s.value]===Re.id)+1}else{const Re=Array.from(de.children.values())[xe+1];he=z.value.findIndex(ue=>ue[s.value]===Re.id)}W[c.value]=!1,W[f.value]=de.id,z.value.splice(he,0,W)}}}function I($,W,z){const X=z.value[$],K=X[s.value];if(d.get(K)){const he=z.value.findIndex(xe=>xe[s.value]===K)+1;X[c.value]=!0,X[l.value]=!1,W[c.value]=!1,W[f.value]=K,z.value.splice(he,0,W)}}function H($,W){const z=$[s.value],X=d.get(z),K=Array.from(X.descendant.keys());K.unshift(z);const Q=d.get(X.parentId);if(Q&&(Q.children.delete(z),Q.children.size===0)){const he=W.find(xe=>xe[s.value]===X.parentId);he[c.value]=!1,he[l.value]=!1}return W.filter(he=>K.indexOf(he.id)===-1)}return{checkVisibleInHierarchy:r,collapseTo:B,expandTo:O,generateHierarchyData:A,hasRealChildren:F,insertSibling:E,insertChild:I,isVisibleInTree:w,shouldStratifyData:i,toggleChildrenVisibiltyByCollapseStatus:k,trimmedOriginalData:H}}function vi(n,t,e,o,r){var Je;const i=new Map,s=new Map,l=new Map,c=new Map,f=new Map,d=a.ref([]),u=a.ref([]),p=gi(n,r),{generateGroupData:h,groupFields:m,shouldGroupingData:M}=p,x=a.ref(n.data),y=yi(n,x,o,r),{collapseTo:v,expandTo:b,generateHierarchyData:_,hasRealChildren:S,insertSibling:T,insertChild:g,isVisibleInTree:V,shouldStratifyData:F,toggleChildrenVisibiltyByCollapseStatus:N,trimmedOriginalData:w,checkVisibleInHierarchy:R}=y,{idField:L,reviseIdentifyField:C}=r,k=a.ref(n.newDataItem),D=a.ref(n.data||[]),B=a.ref(n.data),{flatTreeData:O}=Xl(n);function P(U){return O(U)}if(n.hierarchy&&n.data&&((Je=n.data[0])!=null&&Je.children)){const U=P(n.data);x.value=U,D.value=U,B.value=U}const A=a.ref(n.summary),E=a.computed(()=>{const U=A.value;return(U==null?void 0:U.groupFields)||[]});let I=new Map;const H=a.ref(D.value.length),$=a.ref(n.pagination);function W(){return $.value&&$.value.enable&&$.value.size>0?$.value.size:D.value.length}const z=a.ref(1),X=a.computed(()=>$.value&&$.value.enable&&$.value.mode!=="server"),K=a.computed(()=>$.value&&$.value.enable&&$.value.mode==="server"),Q=new zn;function de(U,pe){const we=Math.ceil(U.length/pe);let Ne=0;const q=[],ee=[],oe=[];for(;Ne<we;){const ne=U.slice(Ne*pe,(Ne+1)*pe),be=h(m.value,ne,t);ee[Ne]=be.filter(ye=>ye.__fv_data_grid_group_row__).length,q.push(...be),Ne++}return ee.reduce((ne,be,ye)=>(ne=ne+be,oe.push(ne),ne),0),{groupData:q,groupRowSizeList:ee,accumulateGroupRowSize:oe}}function he(){var be;D.value=x.value,X.value&&(H.value=D.value.length),M.value&&!X.value&&(D.value=h(m.value,x.value,t)),I=E.value.reduce((ye,Be)=>(ye.set(Be,0),ye),I);const U=0,pe=W(),we=(z.value-1)*pe;let q=we>D.value.length-1||K.value?U:we,ee=K.value?D.value.length:Math.min(q+pe,D.value.length);if(M.value&&X.value){const{accumulateGroupRowSize:ye,groupData:Be,groupRowSizeList:Te}=de(x.value,pe);D.value=Be;const $e=Te[z.value-1];q+=z.value-2<0?0:ye[z.value-2],ee=q+pe+$e}let oe=0;const ne=[];if(D.value.length){C(D.value);const ye=L.value!==n.idField;for(let Be=q;Be<ee;Be++){const Te=D.value[Be];Te.__fv_data_grid_group_row__?(oe=0,Te.__fv_data_index__=""):Te.__fv_data_grid_group_summary__?Te.__fv_data_index__="":(oe++,Te.__fv_data_index__=oe+(z.value-1)*pe),Te.__fv_index__=Be,Te.__fv_visible_index__=Be,n.rowOption&&n.rowOption.disabledField&&(Te.__fv_disabled__=Te[(be=n.rowOption)==null?void 0:be.disabledField]),ye&&(Te[L.value]=Be),E.value.forEach($e=>{const rt=I.get($e)||0;I.set($e,rt+Te[$e])}),ne.push(Te)}}return F.value&&_(ne),B.value=[...ne],ne}const xe=a.ref(he()),De=a.computed(()=>(R.value,xe.value.filter(U=>F.value?U.__fv_visible__!==!1&&V(U):U.__fv_visible__!==!1)));function Re(){De.value.forEach((U,pe)=>(U.__fv_visible_index__=pe,U))}function Y(U,pe,we=!1){const q=(we?he():[...B.value]).filter(ne=>e.apply(ne)),ee=U&&U.length?q.filter(ne=>U.reduce((be,ye)=>be&&ye.filter(ne),!0)):q,oe=pe&&pe.length?ee.sort((ne,be)=>{const ye=[...pe],Be=ye.shift();let Te=Be.compare(ne[Be.field],be[Be.field]);for(;Te===0&&ye.length!==0;){const $e=ye.shift();$e&&(Te=$e.compare(ne[$e.field],be[$e.field]))}return Te}):ee;return xe.value=oe.map((ne,be)=>{if(ne.__fv_data_grid_group_row__){const ye=`group_of_${ne.__fv_data_grid_group_field__}_${ne.__fv_data_grid_group_value__}`;ne.__fv_data_grid_group_collapse__=!!i.get(ye)}return ne.__fv_index__=be,ne.__fv_visible_index__=be,ne}),xe.value}function ue(U){return f.clear(),u.value=U,u.value.reduce((pe,we)=>(pe.set(we.field,we),pe),f),Y([],u.value)}function G(U,pe){return f.set(U,pe),u.value=Array.from(f.values()),Y([],u.value)}function te(U){return f.delete(U),u.value=Array.from(f.values()),Y([],u.value)}function ve(U,pe){return s.set(U,pe),d.value=Array.from(s.values()),Y([],Array.from(f.values()))}function Se(U){return s.delete(U),d.value=Array.from(s.values()),Y([],Array.from(f.values()),!0)}function Oe(){return s.clear(),d.value=[],Y([],Array.from(f.values()),!0)}function ot(U,pe){const we=`group_of_${U}_${pe}`;i.set(we,!0);const Ne=q=>q[U]!==pe;return l.set(`collapse_${U}_${pe}`,{field:U,fieldName:U,fieldType:"string",filterValue:pe,filter:Ne}),Y(Array.from(l.values()),Array.from(f.values()))}function mt(U){v(xe.value,U)}function dt(U){b(xe.value,U)}function J(U,pe){const we=`group_of_${U}_${pe}`;return i.set(we,!1),l.delete(`collapse_${U}_${pe}`),Y(Array.from(l.values()),Array.from(f.values()),!0)}function _e(U){const pe=U.raw[L.value],we=Ne=>!Ne.__fv_parents__.has(pe);c.set(`fold_${pe}`,{field:"id",fieldName:"id",fieldType:"string",filterValue:String(pe),filter:we}),Y(Array.from(c.values()),Array.from(f.values())),_(xe.value)}function Ie(U){const pe=U[L.value];c.delete(`fold_${pe}`)}function Ge(U){Ie(U.raw),Y(Array.from(c.values()),Array.from(f.values()),!0),_(xe.value)}function je(){const U=he();xe.value=U,n.hierarchy&&(Y(Array.from(c.values()),Array.from(f.values())),_(xe.value))}function it(U){const we=n.hierarchy&&U&&U.length&&U[0].children?P(U):U;x.value=we,je()}function ht(U,pe,we){return(U&&U.length?xe.value.filter((q,ee)=>U.reduce((oe,ne)=>oe&&ne.filter(q),!0)):xe.value).slice(pe,we)}function Ct(U){const pe=W(),we=Math.ceil(H.value/pe);0<=U&&U<=we&&(z.value=U,je())}function ft(U){x.value.push(Ee.cloneDeep(U)),xe.value=he()}function Vt(U=0){if(!(U>-1))return!1;const we=k.value();n.hierarchy?T(U,we,x):x.value.splice(U,0,we),je()}function xt(U=0){if(!(U>-1&&n.hierarchy))return!1;const we=k.value(),Ne=x.value[U];Ie(Ne),g(U,we,x),je()}function gt(U){const pe=U?U-1:0;x.value.splice(pe,1),je()}function Mt(U){const pe=x.value.findIndex(we=>we[L.value]===U);pe!==-1&&(x.value.splice(pe,1),je())}function _t(U){const pe=U>-1?x.value[U]:null;if(!(pe&&pe.deletable!==!1))return!1;x.value=w(pe,x.value),je()}function re(){const U=l.size>0?Array.from(l.values()):[];return Y(U,Array.from(f.values()))}function fe(U){$.value.size=U}function ge(U){$.value&&(fe(U),je())}function Pe(U,pe){const we=x.value[Number(U)-1];we.editable!==!1?(we.name=pe,je()):Q.show({showCloseButton:!1,timeout:3e3,animate:"fadeIn",toasts:[{type:"string",title:"提示",msg:"当前节点禁止编辑"}]})}function ze(U){return U.map(we=>{const Ne=B.value.findIndex(q=>""+q[L.value]==""+we);return Ne>-1?B.value[Ne]:null}).filter(we=>we!=null)}return{addFilter:ve,addNewDataItem:ft,addSorter:G,updatePageSize:fe,changePageSizeTo:ge,collapse:ot,collapseTo:mt,dataView:xe,editDataItem:Pe,expand:J,expandTo:dt,filters:d,fold:_e,getRange:ht,getSelectionItems:ze,hasRealChildren:S,insertNewChildDataItem:xt,insertNewDataItem:Vt,isVisibleInTree:V,load:it,navigatePageTo:Ct,pageIndex:z,rawView:B,refresh:re,removeAllFilter:Oe,removeDataItem:gt,removeDataItemById:Mt,removeFilter:Se,removeHierarchyDataItem:_t,removeSorter:te,reOrderVisibleIndex:Re,setSorters:ue,sorters:u,summaries:I,toggleChildrenVisibiltyByCollapseStatus:N,totalItems:H,unFold:Ge,updateDataView:je,visibleDataItems:De}}const Zn={conditions:{type:Array,default:[]},fields:{type:Array,default:[]},key:{type:String,default:""},isControlInline:{type:Boolean,default:!0}};class Kn{constructor(t={value:[]}){j(this,"editorType","check-box");j(this,"value");j(this,"valueType","boolean");const o=(Array.isArray(t.value)?t.value:typeof t.value=="string"?t.value.split(","):[]).map(r=>JSON.parse(r));this.value=o}clear(){this.value=[]}setValue(t){this.value=t}getValue(){return this.value}getDisplayText(){return this.value.map(t=>t?"是":"否").join(",")}isEmpty(){return this.value.length===0}}class Jn{constructor(t={textValue:"",value:"",valueField:""}){j(this,"editorType","combo-lookup");j(this,"textValue");j(this,"value");j(this,"valueField");j(this,"valueType","text");this.textValue=t.textValue,this.value=t.value,this.valueField=t.valueField}clear(){this.value="",this.valueField="",this.textValue=""}getPropValue(t,e){if(e.length>1){const o=e.shift();return t[o]?this.getPropValue(t[o],e):null}return t[e[0]]}getTextValue(t){const e=t.split("."),o=this.value.split(",").map(r=>this.getPropValue(r,Ee.cloneDeep(e)));return o&&o.length?o.join(","):""}getValue(){const t=this.valueField.split("."),e=this.value.split(",").map(o=>this.getPropValue(o,Ee.cloneDeep(t)));return e&&e.length?e.join(","):""}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.valueField}}function Ye(n){const t=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&t==="[object Date]"?new n.constructor(+n):typeof n=="number"||t==="[object Number]"||typeof n=="string"||t==="[object String]"?new Date(n):new Date(NaN)}function We(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function eo(n,t){const e=Ye(n);return isNaN(t)?We(n,NaN):(t&&e.setDate(e.getDate()+t),e)}const to=6048e5,bi=864e5,wi=6e4,Ci=36e5,xi=1e3;let _i={};function Pt(){return _i}function bt(n,t){var l,c,f,d;const e=Pt(),o=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??e.weekStartsOn??((d=(f=e.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,r=Ye(n),i=r.getDay(),s=(i<o?7:0)+i-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function Bt(n){return bt(n,{weekStartsOn:1})}function no(n){const t=Ye(n),e=t.getFullYear(),o=We(n,0);o.setFullYear(e+1,0,4),o.setHours(0,0,0,0);const r=Bt(o),i=We(n,0);i.setFullYear(e,0,4),i.setHours(0,0,0,0);const s=Bt(i);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function oo(n){const t=Ye(n);return t.setHours(0,0,0,0),t}function Xt(n){const t=Ye(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Ti(n,t){const e=oo(n),o=oo(t),r=+e-Xt(e),i=+o-Xt(o);return Math.round((r-i)/bi)}function Fi(n){const t=no(n),e=We(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Bt(e)}function Si(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ki(n){if(!Si(n)&&typeof n!="number")return!1;const t=Ye(n);return!isNaN(Number(t))}function Vi(n){const t=Ye(n),e=We(n,0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Mi={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ni=(n,t,e)=>{let o;const r=Mi[n];return typeof r=="string"?o=r:t===1?o=r.one:o=r.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+o:o+" ago":o};function mn(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Ii={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ei={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Oi={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Di={date:mn({formats:Ii,defaultWidth:"full"}),time:mn({formats:Ei,defaultWidth:"full"}),dateTime:mn({formats:Oi,defaultWidth:"full"})},Pi={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Bi=(n,t,e,o)=>Pi[n];function Wt(n){return(t,e)=>{const o=e!=null&&e.context?String(e.context):"standalone";let r;if(o==="formatting"&&n.formattingValues){const s=n.defaultFormattingWidth||n.defaultWidth,l=e!=null&&e.width?String(e.width):s;r=n.formattingValues[l]||n.formattingValues[s]}else{const s=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[s]}const i=n.argumentCallback?n.argumentCallback(t):t;return r[i]}}const ji={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ri={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Li={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$i={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Wi={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},qi={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ai={ordinalNumber:(n,t)=>{const e=Number(n),o=e%100;if(o>20||o<10)switch(o%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Wt({values:ji,defaultWidth:"wide"}),quarter:Wt({values:Ri,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Wt({values:Li,defaultWidth:"wide"}),day:Wt({values:$i,defaultWidth:"wide"}),dayPeriod:Wt({values:Wi,defaultWidth:"wide",formattingValues:qi,defaultFormattingWidth:"wide"})};function qt(n){return(t,e={})=>{const o=e.width,r=o&&n.matchPatterns[o]||n.matchPatterns[n.defaultMatchWidth],i=t.match(r);if(!i)return null;const s=i[0],l=o&&n.parsePatterns[o]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(l)?Gi(l,u=>u.test(s)):Hi(l,u=>u.test(s));let f;f=n.valueCallback?n.valueCallback(c):c,f=e.valueCallback?e.valueCallback(f):f;const d=t.slice(s.length);return{value:f,rest:d}}}function Hi(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Gi(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function zi(n){return(t,e={})=>{const o=t.match(n.matchPattern);if(!o)return null;const r=o[0],i=t.match(n.parsePattern);if(!i)return null;let s=n.valueCallback?n.valueCallback(i[0]):i[0];s=e.valueCallback?e.valueCallback(s):s;const l=t.slice(r.length);return{value:s,rest:l}}}const Yi=/^(\d+)(th|st|nd|rd)?/i,Ui=/\d+/i,Xi={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Qi={any:[/^b/i,/^(a|c)/i]},Zi={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ki={any:[/1/i,/2/i,/3/i,/4/i]},Ji={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},es={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ts={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},os={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},rs={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},as={ordinalNumber:zi({matchPattern:Yi,parsePattern:Ui,valueCallback:n=>parseInt(n,10)}),era:qt({matchPatterns:Xi,defaultMatchWidth:"wide",parsePatterns:Qi,defaultParseWidth:"any"}),quarter:qt({matchPatterns:Zi,defaultMatchWidth:"wide",parsePatterns:Ki,defaultParseWidth:"any",valueCallback:n=>n+1}),month:qt({matchPatterns:Ji,defaultMatchWidth:"wide",parsePatterns:es,defaultParseWidth:"any"}),day:qt({matchPatterns:ts,defaultMatchWidth:"wide",parsePatterns:ns,defaultParseWidth:"any"}),dayPeriod:qt({matchPatterns:os,defaultMatchWidth:"any",parsePatterns:rs,defaultParseWidth:"any"})},ro={code:"en-US",formatDistance:Ni,formatLong:Di,formatRelative:Bi,localize:Ai,match:as,options:{weekStartsOn:0,firstWeekContainsDate:1}};function is(n){const t=Ye(n);return Ti(t,Vi(t))+1}function ao(n){const t=Ye(n),e=+Bt(t)-+Fi(t);return Math.round(e/to)+1}function hn(n,t){var d,u,p,h;const e=Ye(n),o=e.getFullYear(),r=Pt(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=We(n,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=bt(s,t),c=We(n,0);c.setFullYear(o,0,i),c.setHours(0,0,0,0);const f=bt(c,t);return e.getTime()>=l.getTime()?o+1:e.getTime()>=f.getTime()?o:o-1}function ss(n,t){var l,c,f,d;const e=Pt(),o=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??e.firstWeekContainsDate??((d=(f=e.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,r=hn(n,t),i=We(n,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),bt(i,t)}function io(n,t){const e=Ye(n),o=+bt(e,t)-+ss(e,t);return Math.round(o/to)+1}function Me(n,t){const e=n<0?"-":"",o=Math.abs(n).toString().padStart(t,"0");return e+o}const wt={y(n,t){const e=n.getFullYear(),o=e>0?e:1-e;return Me(t==="yy"?o%100:o,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Me(e+1,2)},d(n,t){return Me(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Me(n.getHours()%12||12,t.length)},H(n,t){return Me(n.getHours(),t.length)},m(n,t){return Me(n.getMinutes(),t.length)},s(n,t){return Me(n.getSeconds(),t.length)},S(n,t){const e=t.length,o=n.getMilliseconds(),r=Math.trunc(o*Math.pow(10,e-3));return Me(r,t.length)}},jt={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},so={G:function(n,t,e){const o=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(o,{width:"abbreviated"});case"GGGGG":return e.era(o,{width:"narrow"});case"GGGG":default:return e.era(o,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const o=n.getFullYear(),r=o>0?o:1-o;return e.ordinalNumber(r,{unit:"year"})}return wt.y(n,t)},Y:function(n,t,e,o){const r=hn(n,o),i=r>0?r:1-r;if(t==="YY"){const s=i%100;return Me(s,2)}return t==="Yo"?e.ordinalNumber(i,{unit:"year"}):Me(i,t.length)},R:function(n,t){const e=no(n);return Me(e,t.length)},u:function(n,t){const e=n.getFullYear();return Me(e,t.length)},Q:function(n,t,e){const o=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return Me(o,2);case"Qo":return e.ordinalNumber(o,{unit:"quarter"});case"QQQ":return e.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(o,{width:"wide",context:"formatting"})}},q:function(n,t,e){const o=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return Me(o,2);case"qo":return e.ordinalNumber(o,{unit:"quarter"});case"qqq":return e.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(o,{width:"wide",context:"standalone"})}},M:function(n,t,e){const o=n.getMonth();switch(t){case"M":case"MM":return wt.M(n,t);case"Mo":return e.ordinalNumber(o+1,{unit:"month"});case"MMM":return e.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(o,{width:"wide",context:"formatting"})}},L:function(n,t,e){const o=n.getMonth();switch(t){case"L":return String(o+1);case"LL":return Me(o+1,2);case"Lo":return e.ordinalNumber(o+1,{unit:"month"});case"LLL":return e.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(o,{width:"wide",context:"standalone"})}},w:function(n,t,e,o){const r=io(n,o);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Me(r,t.length)},I:function(n,t,e){const o=ao(n);return t==="Io"?e.ordinalNumber(o,{unit:"week"}):Me(o,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):wt.d(n,t)},D:function(n,t,e){const o=is(n);return t==="Do"?e.ordinalNumber(o,{unit:"dayOfYear"}):Me(o,t.length)},E:function(n,t,e){const o=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(o,{width:"short",context:"formatting"});case"EEEE":default:return e.day(o,{width:"wide",context:"formatting"})}},e:function(n,t,e,o){const r=n.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Me(i,2);case"eo":return e.ordinalNumber(i,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});case"eeee":default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,o){const r=n.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Me(i,t.length);case"co":return e.ordinalNumber(i,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});case"cccc":default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const o=n.getDay(),r=o===0?7:o;switch(t){case"i":return String(r);case"ii":return Me(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(o,{width:"short",context:"formatting"});case"iiii":default:return e.day(o,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const o=n.getHours();let r;switch(o===12?r=jt.noon:o===0?r=jt.midnight:r=o/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const o=n.getHours();let r;switch(o>=17?r=jt.evening:o>=12?r=jt.afternoon:o>=4?r=jt.morning:r=jt.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let o=n.getHours()%12;return o===0&&(o=12),e.ordinalNumber(o,{unit:"hour"})}return wt.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):wt.H(n,t)},K:function(n,t,e){const o=n.getHours()%12;return t==="Ko"?e.ordinalNumber(o,{unit:"hour"}):Me(o,t.length)},k:function(n,t,e){let o=n.getHours();return o===0&&(o=24),t==="ko"?e.ordinalNumber(o,{unit:"hour"}):Me(o,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):wt.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):wt.s(n,t)},S:function(n,t){return wt.S(n,t)},X:function(n,t,e){const o=n.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return co(o);case"XXXX":case"XX":return St(o);case"XXXXX":case"XXX":default:return St(o,":")}},x:function(n,t,e){const o=n.getTimezoneOffset();switch(t){case"x":return co(o);case"xxxx":case"xx":return St(o);case"xxxxx":case"xxx":default:return St(o,":")}},O:function(n,t,e){const o=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+lo(o,":");case"OOOO":default:return"GMT"+St(o,":")}},z:function(n,t,e){const o=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+lo(o,":");case"zzzz":default:return"GMT"+St(o,":")}},t:function(n,t,e){const o=Math.trunc(n.getTime()/1e3);return Me(o,t.length)},T:function(n,t,e){const o=n.getTime();return Me(o,t.length)}};function lo(n,t=""){const e=n>0?"-":"+",o=Math.abs(n),r=Math.trunc(o/60),i=o%60;return i===0?e+String(r):e+String(r)+t+Me(i,2)}function co(n,t){return n%60===0?(n>0?"-":"+")+Me(Math.abs(n)/60,2):St(n,t)}function St(n,t=""){const e=n>0?"-":"+",o=Math.abs(n),r=Me(Math.trunc(o/60),2),i=Me(o%60,2);return e+r+t+i}const uo=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},fo=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},gn={p:fo,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],o=e[1],r=e[2];if(!r)return uo(n,t);let i;switch(o){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",uo(o,t)).replace("{{time}}",fo(r,t))}},ls=/^D+$/,cs=/^Y+$/,us=["D","DD","YY","YYYY"];function po(n){return ls.test(n)}function mo(n){return cs.test(n)}function yn(n,t,e){const o=ds(n,t,e);if(console.warn(o),us.includes(n))throw new RangeError(o)}function ds(n,t,e){const o=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${o} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const fs=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ps=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ms=/^'([^]*?)'?$/,hs=/''/g,gs=/[a-zA-Z]/;function ho(n,t,e){var d,u,p,h;const o=Pt(),r=o.locale??ro,i=o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=o.weekStartsOn??((h=(p=o.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??0,l=Ye(n);if(!ki(l))throw new RangeError("Invalid time value");let c=t.match(ps).map(m=>{const M=m[0];if(M==="p"||M==="P"){const x=gn[M];return x(m,r.formatLong)}return m}).join("").match(fs).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const M=m[0];if(M==="'")return{isToken:!1,value:ys(m)};if(so[M])return{isToken:!0,value:m};if(M.match(gs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");return{isToken:!1,value:m}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const f={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return c.map(m=>{if(!m.isToken)return m.value;const M=m.value;(mo(M)||po(M))&&yn(M,t,String(n));const x=so[M[0]];return x(l,M,r.localize,f)}).join("")}function ys(n){const t=n.match(ms);return t?t[1].replace(hs,"'"):n}function vs(){return Object.assign({},Pt())}function bs(n){let e=Ye(n).getDay();return e===0&&(e=7),e}function ws(n,t){const e=t instanceof Date?We(t,0):new t(0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}const Cs=10;class go{constructor(){j(this,"subPriority",0)}validate(t,e){return!0}}class xs extends go{constructor(t,e,o,r,i){super(),this.value=t,this.validateValue=e,this.setValue=o,this.priority=r,i&&(this.subPriority=i)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,o){return this.setValue(t,e,this.value,o)}}class _s extends go{constructor(){super(...arguments);j(this,"priority",Cs);j(this,"subPriority",-1)}set(e,o){return o.timestampIsSet?e:We(e,ws(e,Date))}}class Ve{run(t,e,o,r){const i=this.parse(t,e,o,r);return i?{setter:new xs(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,e,o){return!0}}class Ts extends Ve{constructor(){super(...arguments);j(this,"priority",140);j(this,"incompatibleTokens",["R","u","t","T"])}parse(e,o,r){switch(o){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});case"GGGG":default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}}set(e,o,r){return o.era=r,e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}}const Ae={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},ct={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function He(n,t){return n&&{value:t(n.value),rest:n.rest}}function Le(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function ut(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const o=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,i=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:o*(r*Ci+i*wi+s*xi),rest:t.slice(e[0].length)}}function yo(n){return Le(Ae.anyDigitsSigned,n)}function qe(n,t){switch(n){case 1:return Le(Ae.singleDigit,t);case 2:return Le(Ae.twoDigits,t);case 3:return Le(Ae.threeDigits,t);case 4:return Le(Ae.fourDigits,t);default:return Le(new RegExp("^\\d{1,"+n+"}"),t)}}function Qt(n,t){switch(n){case 1:return Le(Ae.singleDigitSigned,t);case 2:return Le(Ae.twoDigitsSigned,t);case 3:return Le(Ae.threeDigitsSigned,t);case 4:return Le(Ae.fourDigitsSigned,t);default:return Le(new RegExp("^-?\\d{1,"+n+"}"),t)}}function vn(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function vo(n,t){const e=t>0,o=e?t:1-t;let r;if(o<=50)r=n||100;else{const i=o+50,s=Math.trunc(i/100)*100,l=n>=i%100;r=n+s-(l?100:0)}return e?r:1-r}function bo(n){return n%400===0||n%4===0&&n%100!==0}class Fs extends Ve{constructor(){super(...arguments);j(this,"priority",130);j(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,o,r){const i=s=>({year:s,isTwoDigitYear:o==="yy"});switch(o){case"y":return He(qe(4,e),i);case"yo":return He(r.ordinalNumber(e,{unit:"year"}),i);default:return He(qe(o.length,e),i)}}validate(e,o){return o.isTwoDigitYear||o.year>0}set(e,o,r){const i=e.getFullYear();if(r.isTwoDigitYear){const l=vo(r.year,i);return e.setFullYear(l,0,1),e.setHours(0,0,0,0),e}const s=!("era"in o)||o.era===1?r.year:1-r.year;return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class Ss extends Ve{constructor(){super(...arguments);j(this,"priority",130);j(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,o,r){const i=s=>({year:s,isTwoDigitYear:o==="YY"});switch(o){case"Y":return He(qe(4,e),i);case"Yo":return He(r.ordinalNumber(e,{unit:"year"}),i);default:return He(qe(o.length,e),i)}}validate(e,o){return o.isTwoDigitYear||o.year>0}set(e,o,r,i){const s=hn(e,i);if(r.isTwoDigitYear){const c=vo(r.year,s);return e.setFullYear(c,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),bt(e,i)}const l=!("era"in o)||o.era===1?r.year:1-r.year;return e.setFullYear(l,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),bt(e,i)}}class ks extends Ve{constructor(){super(...arguments);j(this,"priority",130);j(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,o){return Qt(o==="R"?4:o.length,e)}set(e,o,r){const i=We(e,0);return i.setFullYear(r,0,4),i.setHours(0,0,0,0),Bt(i)}}class Vs extends Ve{constructor(){super(...arguments);j(this,"priority",130);j(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,o){return Qt(o==="u"?4:o.length,e)}set(e,o,r){return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}}class Ms extends Ve{constructor(){super(...arguments);j(this,"priority",120);j(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,o,r){switch(o){case"Q":case"QQ":return qe(o.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,o){return o>=1&&o<=4}set(e,o,r){return e.setMonth((r-1)*3,1),e.setHours(0,0,0,0),e}}class Ns extends Ve{constructor(){super(...arguments);j(this,"priority",120);j(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,o,r){switch(o){case"q":case"qq":return qe(o.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,o){return o>=1&&o<=4}set(e,o,r){return e.setMonth((r-1)*3,1),e.setHours(0,0,0,0),e}}class Is extends Ve{constructor(){super(...arguments);j(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);j(this,"priority",110)}parse(e,o,r){const i=s=>s-1;switch(o){case"M":return He(Le(Ae.month,e),i);case"MM":return He(qe(2,e),i);case"Mo":return He(r.ordinalNumber(e,{unit:"month"}),i);case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}}validate(e,o){return o>=0&&o<=11}set(e,o,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}}class Es extends Ve{constructor(){super(...arguments);j(this,"priority",110);j(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,o,r){const i=s=>s-1;switch(o){case"L":return He(Le(Ae.month,e),i);case"LL":return He(qe(2,e),i);case"Lo":return He(r.ordinalNumber(e,{unit:"month"}),i);case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}}validate(e,o){return o>=0&&o<=11}set(e,o,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}}function Os(n,t,e){const o=Ye(n),r=io(o,e)-t;return o.setDate(o.getDate()-r*7),o}class Ds extends Ve{constructor(){super(...arguments);j(this,"priority",100);j(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,o,r){switch(o){case"w":return Le(Ae.week,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return qe(o.length,e)}}validate(e,o){return o>=1&&o<=53}set(e,o,r,i){return bt(Os(e,r,i),i)}}function Ps(n,t){const e=Ye(n),o=ao(e)-t;return e.setDate(e.getDate()-o*7),e}class Bs extends Ve{constructor(){super(...arguments);j(this,"priority",100);j(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,o,r){switch(o){case"I":return Le(Ae.week,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return qe(o.length,e)}}validate(e,o){return o>=1&&o<=53}set(e,o,r){return Bt(Ps(e,r))}}const js=[31,28,31,30,31,30,31,31,30,31,30,31],Rs=[31,29,31,30,31,30,31,31,30,31,30,31];class Ls extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"subPriority",1);j(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,o,r){switch(o){case"d":return Le(Ae.date,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return qe(o.length,e)}}validate(e,o){const r=e.getFullYear(),i=bo(r),s=e.getMonth();return i?o>=1&&o<=Rs[s]:o>=1&&o<=js[s]}set(e,o,r){return e.setDate(r),e.setHours(0,0,0,0),e}}class $s extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"subpriority",1);j(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,o,r){switch(o){case"D":case"DD":return Le(Ae.dayOfYear,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return qe(o.length,e)}}validate(e,o){const r=e.getFullYear();return bo(r)?o>=1&&o<=366:o>=1&&o<=365}set(e,o,r){return e.setMonth(0,r),e.setHours(0,0,0,0),e}}function bn(n,t,e){var u,p,h,m;const o=Pt(),r=(e==null?void 0:e.weekStartsOn)??((p=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:p.weekStartsOn)??o.weekStartsOn??((m=(h=o.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,i=Ye(n),s=i.getDay(),c=(t%7+7)%7,f=7-r,d=t<0||t>6?t-(s+f)%7:(c+f)%7-(s+f)%7;return eo(i,d)}class Ws extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,o,r){switch(o){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,o){return o>=0&&o<=6}set(e,o,r,i){return e=bn(e,r,i),e.setHours(0,0,0,0),e}}class qs extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,o,r,i){const s=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(o){case"e":case"ee":return He(qe(o.length,e),s);case"eo":return He(r.ordinalNumber(e,{unit:"day"}),s);case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,o){return o>=0&&o<=6}set(e,o,r,i){return e=bn(e,r,i),e.setHours(0,0,0,0),e}}class As extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,o,r,i){const s=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(o){case"c":case"cc":return He(qe(o.length,e),s);case"co":return He(r.ordinalNumber(e,{unit:"day"}),s);case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}}validate(e,o){return o>=0&&o<=6}set(e,o,r,i){return e=bn(e,r,i),e.setHours(0,0,0,0),e}}function Hs(n,t){const e=Ye(n),o=bs(e),r=t-o;return eo(e,r)}class Gs extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,o,r){const i=s=>s===0?7:s;switch(o){case"i":case"ii":return qe(o.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return He(r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return He(r.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return He(r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),i);case"iiii":default:return He(r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),i)}}validate(e,o){return o>=1&&o<=7}set(e,o,r){return e=Hs(e,r),e.setHours(0,0,0,0),e}}class zs extends Ve{constructor(){super(...arguments);j(this,"priority",80);j(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,o,r){switch(o){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,o,r){return e.setHours(vn(r),0,0,0),e}}class Ys extends Ve{constructor(){super(...arguments);j(this,"priority",80);j(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,o,r){switch(o){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,o,r){return e.setHours(vn(r),0,0,0),e}}class Us extends Ve{constructor(){super(...arguments);j(this,"priority",80);j(this,"incompatibleTokens",["a","b","t","T"])}parse(e,o,r){switch(o){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,o,r){return e.setHours(vn(r),0,0,0),e}}class Xs extends Ve{constructor(){super(...arguments);j(this,"priority",70);j(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,o,r){switch(o){case"h":return Le(Ae.hour12h,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return qe(o.length,e)}}validate(e,o){return o>=1&&o<=12}set(e,o,r){const i=e.getHours()>=12;return i&&r<12?e.setHours(r+12,0,0,0):!i&&r===12?e.setHours(0,0,0,0):e.setHours(r,0,0,0),e}}class Qs extends Ve{constructor(){super(...arguments);j(this,"priority",70);j(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,o,r){switch(o){case"H":return Le(Ae.hour23h,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return qe(o.length,e)}}validate(e,o){return o>=0&&o<=23}set(e,o,r){return e.setHours(r,0,0,0),e}}class Zs extends Ve{constructor(){super(...arguments);j(this,"priority",70);j(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,o,r){switch(o){case"K":return Le(Ae.hour11h,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return qe(o.length,e)}}validate(e,o){return o>=0&&o<=11}set(e,o,r){return e.getHours()>=12&&r<12?e.setHours(r+12,0,0,0):e.setHours(r,0,0,0),e}}class Ks extends Ve{constructor(){super(...arguments);j(this,"priority",70);j(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,o,r){switch(o){case"k":return Le(Ae.hour24h,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return qe(o.length,e)}}validate(e,o){return o>=1&&o<=24}set(e,o,r){const i=r<=24?r%24:r;return e.setHours(i,0,0,0),e}}class Js extends Ve{constructor(){super(...arguments);j(this,"priority",60);j(this,"incompatibleTokens",["t","T"])}parse(e,o,r){switch(o){case"m":return Le(Ae.minute,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return qe(o.length,e)}}validate(e,o){return o>=0&&o<=59}set(e,o,r){return e.setMinutes(r,0,0),e}}class el extends Ve{constructor(){super(...arguments);j(this,"priority",50);j(this,"incompatibleTokens",["t","T"])}parse(e,o,r){switch(o){case"s":return Le(Ae.second,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return qe(o.length,e)}}validate(e,o){return o>=0&&o<=59}set(e,o,r){return e.setSeconds(r,0),e}}class tl extends Ve{constructor(){super(...arguments);j(this,"priority",30);j(this,"incompatibleTokens",["t","T"])}parse(e,o){const r=i=>Math.trunc(i*Math.pow(10,-o.length+3));return He(qe(o.length,e),r)}set(e,o,r){return e.setMilliseconds(r),e}}class nl extends Ve{constructor(){super(...arguments);j(this,"priority",10);j(this,"incompatibleTokens",["t","T","x"])}parse(e,o){switch(o){case"X":return ut(ct.basicOptionalMinutes,e);case"XX":return ut(ct.basic,e);case"XXXX":return ut(ct.basicOptionalSeconds,e);case"XXXXX":return ut(ct.extendedOptionalSeconds,e);case"XXX":default:return ut(ct.extended,e)}}set(e,o,r){return o.timestampIsSet?e:We(e,e.getTime()-Xt(e)-r)}}class ol extends Ve{constructor(){super(...arguments);j(this,"priority",10);j(this,"incompatibleTokens",["t","T","X"])}parse(e,o){switch(o){case"x":return ut(ct.basicOptionalMinutes,e);case"xx":return ut(ct.basic,e);case"xxxx":return ut(ct.basicOptionalSeconds,e);case"xxxxx":return ut(ct.extendedOptionalSeconds,e);case"xxx":default:return ut(ct.extended,e)}}set(e,o,r){return o.timestampIsSet?e:We(e,e.getTime()-Xt(e)-r)}}class rl extends Ve{constructor(){super(...arguments);j(this,"priority",40);j(this,"incompatibleTokens","*")}parse(e){return yo(e)}set(e,o,r){return[We(e,r*1e3),{timestampIsSet:!0}]}}class al extends Ve{constructor(){super(...arguments);j(this,"priority",20);j(this,"incompatibleTokens","*")}parse(e){return yo(e)}set(e,o,r){return[We(e,r),{timestampIsSet:!0}]}}const il={G:new Ts,y:new Fs,Y:new Ss,R:new ks,u:new Vs,Q:new Ms,q:new Ns,M:new Is,L:new Es,w:new Ds,I:new Bs,d:new Ls,D:new $s,E:new Ws,e:new qs,c:new As,i:new Gs,a:new zs,b:new Ys,B:new Us,h:new Xs,H:new Qs,K:new Zs,k:new Ks,m:new Js,s:new el,S:new tl,X:new nl,x:new ol,t:new rl,T:new al},sl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ll=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cl=/^'([^]*?)'?$/,ul=/''/g,dl=/\S/,fl=/[a-zA-Z]/;function wo(n,t,e,o){var M,x,y,v;const r=vs(),i=r.locale??ro,s=r.firstWeekContainsDate??((x=(M=r.locale)==null?void 0:M.options)==null?void 0:x.firstWeekContainsDate)??1,l=r.weekStartsOn??((v=(y=r.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0;if(t==="")return n===""?Ye(e):We(e,NaN);const c={firstWeekContainsDate:s,weekStartsOn:l,locale:i},f=[new _s],d=t.match(ll).map(b=>{const _=b[0];if(_ in gn){const S=gn[_];return S(b,i.formatLong)}return b}).join("").match(sl),u=[];for(let b of d){mo(b)&&yn(b,t,n),po(b)&&yn(b,t,n);const _=b[0],S=il[_];if(S){const{incompatibleTokens:T}=S;if(Array.isArray(T)){const V=u.find(F=>T.includes(F.token)||F.token===_);if(V)throw new RangeError(`The format string mustn't contain \`${V.fullToken}\` and \`${b}\` at the same time`)}else if(S.incompatibleTokens==="*"&&u.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);u.push({token:_,fullToken:b});const g=S.run(n,b,i.match,c);if(!g)return We(e,NaN);f.push(g.setter),n=g.rest}else{if(_.match(fl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(b==="''"?b="'":_==="'"&&(b=pl(b)),n.indexOf(b)===0)n=n.slice(b.length);else return We(e,NaN)}}if(n.length>0&&dl.test(n))return We(e,NaN);const p=f.map(b=>b.priority).sort((b,_)=>_-b).filter((b,_,S)=>S.indexOf(b)===_).map(b=>f.filter(_=>_.priority===b).sort((_,S)=>S.subPriority-_.subPriority)).map(b=>b[0]);let h=Ye(e);if(isNaN(h.getTime()))return We(e,NaN);const m={};for(const b of p){if(!b.validate(h,c))return We(e,NaN);const _=b.set(h,m,c);Array.isArray(_)?(h=_[0],Object.assign(m,_[1])):h=_}return We(e,h)}function pl(n){return n.match(cl)[1].replace(ul,"'")}class Co{constructor(t={value:"",displayFormat:"",valueFormat:""}){j(this,"editorType","date-picker");j(this,"value");j(this,"valueType","datetime");j(this,"displayFormat","");j(this,"valueFormat","");this.value=t.value,this.displayFormat=t.displayFormat,this.valueFormat=t.valueFormat}setValue(t){this.value=t.formatted}getValue(){return this.value}getDisplayText(){if(typeof this.value=="string"&&this.value){const t=wo(this.value,this.valueFormat,new Date);return ho(t,this.displayFormat)}return this.getValue()}isEmpty(){return!this.value}clear(){this.value=void 0}}class Zt{constructor(t={begin:"",end:""}){j(this,"editorType","date-range");j(this,"begin","");j(this,"end","");j(this,"valueType","datetime");this.begin=t.begin,this.end=t.end}clear(){this.begin="",this.end=""}getValue(){return!this.begin||!this.end?"":`${this.begin}~${this.end}`}getDisplayText(){return this.getValue()}setValue(t){t.dataRange?(this.begin=t.dataRange.split(t.delimiter)[0],this.end=t.dataRange.split(t.delimiter)[1]):this.clear()}isEmpty(){return!this.begin||!this.end}}class xo{constructor(t={value:"",displayFormat:"",valueFormat:""}){j(this,"editorType","datetime-picker");j(this,"value");j(this,"valueType","datetime");j(this,"displayFormat","");j(this,"valueFormat","");this.value=t.value,this.displayFormat=t.displayFormat,this.valueFormat=t.valueFormat}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){if(typeof this.value=="string"&&this.value){const t=wo(this.value,this.valueFormat,new Date);return ho(t,this.displayFormat)}return this.getValue()}setValue(t){this.value=t.formatted}isEmpty(){return!this.value}}class _o{constructor(t={value:"",valueList:[]}){j(this,"editorType","combo-list");j(this,"value");j(this,"valueType","enum");j(this,"valueList",[]);this.value=t.value,this.valueList=t.valueList}clear(){this.value="",this.valueList=[]}getValue(){return this.value}getDisplayText(){var r,i;const t=typeof this.value;let e="",o=[];switch(t){case"string":o=this.value.split(",")||[],e=this.valueList.filter(s=>o.indexOf(s.value)>-1).map(s=>s.name).join(",");break;case"boolean":e=((r=this.valueList.find(s=>s.value===this.value))==null?void 0:r.name)||"";break;case"number":e=((i=this.valueList.find(s=>s.value===this.value))==null?void 0:i.name)||"";break}return e}setValue(t){this.value=t.value}isEmpty(){return!this.value&&this.value!==!1&&this.value!==0}}class ml{constructor(t={value:"",displayText:"",displayField:"",isInputText:!1}){j(this,"editorType","input-group");j(this,"value");j(this,"valueType","text");j(this,"displayText");j(this,"valueField");j(this,"isInputText");this.value=t.value,this.displayText=t.displayText,this.valueField=t.displayField,this.isInputText=t.isInputText}clear(){this.value="",this.displayText="",this.valueField=""}getPropValue(t,e){if(e.length>1){const o=e.shift();return t[o]?this.getPropValue(t[o],e):""}return t[e[0]]}getTextValue(t){const e=t.split("."),o=this.value.map(r=>this.getPropValue(r,Ee.cloneDeep(e)));return o&&o.length?o.join(","):""}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.displayText&&!this.value.length}}class To{constructor(t={mapFields:[],value:"",valueField:"",isInputText:!1,helpId:""}){j(this,"editorType","lookup");j(this,"helpId");j(this,"mapFields");j(this,"value");j(this,"valueField");j(this,"valueType","text");j(this,"isInputText");this.value=t.value,this.valueField=t.valueField,this.mapFields=t.mapFields,this.isInputText=t.isInputText,this.helpId=t.helpId}clear(){this.value="",this.mapFields=[]}getValue(){return this.mapFields.map(t=>ke.resolveField(t,this.valueField||"id")).join(",")}getDisplayText(){return this.value}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.mapFields.length}}class Fo{constructor(t={value:""}){j(this,"editorType","month-picker");j(this,"value");j(this,"valueType","datetime");this.value=t.value}setValue(t){this.value=t.formatted}getValue(){return this.value}getDisplayText(){return this.getValue()}clear(){this.value=void 0}isEmpty(){return!this.value}}class So{constructor(t={begin:"",end:""}){j(this,"editorType","month-range");j(this,"begin");j(this,"end");j(this,"valueType","datetime");this.begin=t.begin,this.end=t.end}clear(){this.begin="",this.end=""}getValue(){return!this.begin||!this.end?"":`${this.begin}~${this.end}`}getDisplayText(){return this.getValue()}setValue(t){t.dataRange?(this.begin=t.dataRange.split(t.delimiter)[0],this.end=t.dataRange.split(t.delimiter)[1]):this.clear()}isEmpty(){return!this.begin||!this.end}}class ko{constructor(t={begin:null,end:null}){j(this,"editorType","number-range");j(this,"begin");j(this,"end");j(this,"valueType","number");this.begin=t.begin==null?null:parseFloat(t.begin),this.end=t.end==null?null:parseFloat(t.end)}clear(){this.begin=null,this.end=null}getValue(){return{begin:this.begin,end:this.end}}getDisplayText(){return(this.begin===null?"":this.begin)+"~"+(this.end===null?"":this.end)}setValue(t){this.begin=t.begin==null?null:parseFloat(t.begin),this.end=t.end==null?null:parseFloat(t.end)}isEmpty(){return this.begin==null&&this.end==null}}class Vo{constructor(t={value:""}){j(this,"editorType","number-spinner");j(this,"value");j(this,"valueType","number");const e=parseFloat(t.value);this.value=isNaN(e)?null:e}clear(){this.value=null}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=isNaN(parseFloat(t))?null:t}isEmpty(){return this.value==null||isNaN(this.value)}}class Mo{constructor(t={value:null,valueList:[]}){j(this,"editorType","radio-group");j(this,"value");j(this,"valueType","enum");j(this,"valueList",[]);this.value=t.value,this.valueList=t.valueList}clear(){this.value=void 0,this.valueList=[]}getValue(){return this.value}getDisplayText(){var t;return((t=this.valueList.find(e=>e.value===this.value))==null?void 0:t.name)||""}setValue(t){this.value=t}isEmpty(){return!this.value&&this.value!==0&&this.value!==!1}}class Kt{constructor(t={value:""}){j(this,"editorType","text");j(this,"value");j(this,"valueType","text");this.value=t.value}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=t}isEmpty(){return!this.value}}function No(){function n(t,e){switch(t){case"check-box":return new Kn(e);case"combo-list":return new _o(e);case"combo-lookup":return new Jn(e);case"input-group":return new ml(e);case"date-picker":return new Co(e);case"date-range":return new Zt(e);case"datetime-picker":return new xo(e);case"datetime-range":return new Zt(e);case"lookup":return new To(e);case"month-picker":return new Fo(e);case"month-range":return new So(e);case"number-range":return new ko(e);case"number-spinner":return new Vo(e);case"radio-group":return new Mo(e);default:return new Kt(e)}}return{createConditionValue:n}}function Io(n,t){const e=a.ref(n.fields),o=a.ref([]),r=new Map,{createConditionValue:i}=No();function s(d){switch(d.editor?d.editor.type:"input-group"){case"date-range":d.editor.type="date-picker";break;case"datetime-range":d.editor.type="datetime-picker";break;case"number-range":d.editor.type="number-spinner";break}return d.editor}function l(d){return d.map(p=>Object.assign({},p)).map(p=>(p.editor=s(p),p))}function c(d=!0){e.value.reduce((u,p)=>(d||(p.editor=s(p)),u.set(p.labelCode,p),u),r)}function f(d){return d.forEach(u=>{if(u){const p=r.get(u.fieldCode);p.controlType&&(u.value=i(p.controlType,u.value))}}),d}return{convertToSingleControl:l,fields:e,fieldMap:r,fieldConditions:o,loadFieldConfigs:c,initialConditionValue:f}}function hl(n,t,e){const o=a.ref(null),r=a.ref(e),i=a.ref(0);function s(d,u){let p=null;return function(){const h=arguments;p?(clearTimeout(p),p=setTimeout(()=>{p=null,d(...h)},200)):(d(...h),p=setTimeout(()=>{p=null},200))}}function l(){r.value&&(o.value=new ResizeObserver(s(d=>{const u=d[0];i.value=u.contentRect.width})),o.value.observe(r.value))}function c(d){let p="col-12";return d>250*6?p="col-2":d>250*4?p="col-3":d>250*3?p="col-4":d>250*2&&(p="col-6"),p}const f=a.computed(()=>c(i.value));return a.watch([e],([d])=>{r.value=d,l()}),{conditionClass:f,resizeObserver:o}}const Eo=a.defineComponent({name:"FConditionFields",props:Zn,emits:["valueChange","blur","focus","click","input"],setup(n,t){const e=a.ref(),o=a.ref(n.key);a.ref(n.isControlInline);const r=a.ref(n.conditions),i=Io(n),{initialConditionValue:s,fieldMap:l,loadFieldConfigs:c}=i,f=hl(n,t,e),{conditionClass:d,resizeObserver:u}=f;c(!0),s(r.value),a.onBeforeUnmount(()=>{var x;(x=u.value)==null||x.unobserve(e.value)}),a.watch(()=>n.conditions,()=>{r.value=n.conditions,s(r.value)});const p=a.computed(()=>({"f-utils-flex-row-wrap":!0,"farris-form":!0,"condition-div":!0,"farris-form-controls-inline":n.isControlInline})),h=a.computed(()=>"col-12 col-md-6 col-xl-3 col-el-2 ");function m(x,y,v,b){x.value.editorType==="combo-list"&&b.newValue?x.value.valueList=b.newValue.map(_=>({name:_.name,value:_.value})):x.value.editorType==="radio-group"&&(x.value.valueList=[v.data.find(_=>_.value===y)]),t.emit("valueChange",y,x)}function M(){return r.value.map(x=>{var S,T,g,V,F,N;const y=(S=l.get(x.fieldCode))==null?void 0:S.editor,v=(T=l.get(x.fieldCode))==null?void 0:T.id;let b=!0;((g=x.value)==null?void 0:g.editorType)==="lookup"&&y?(y.idValue=(V=x.value.mapFields)==null?void 0:V.map(w=>w.id).join(","),y.onClear=()=>{x.value.mapFields=[],m(x,"")},y["onUpdate:dataMapping"]=w=>{x.value.mapFields=w.items,m(x,x.value.getValue())},b=!1):((F=x.value)==null?void 0:F.editorType)==="number-range"&&y&&(y.beginValue=x.value.begin,y.onBeginValueChange=w=>{x.value.begin=w,m(x,w)},y.endValue=x.value.end,y.onEndValueChange=w=>{x.value.end=w,m(x,w)},b=!1);let _=((N=y==null?void 0:y.appearance)==null?void 0:N.class)||h.value;return y!=null&&y.multiLineLabel&&(_=_+" farris-group-multi-label"),a.createVNode(nn.FDynamicFormGroup,{id:v,key:v,customClass:_,label:(y==null?void 0:y.showLabel)===!1?" ":x.fieldName,editor:y,required:y==null?void 0:y.required,modelValue:x.value.value,"onUpdate:modelValue":w=>x.value.value=w,onChange:(w,R)=>{b&&m(x,w,y,R)}},null)})}return()=>a.withDirectives(a.createVNode("div",{class:p.value,key:o.value,ref:e},[M()]),[[a.resolveDirective("area-response")]])}});var At=(n=>(n[n.Value=0]="Value",n[n.SmartHelp=1]="SmartHelp",n[n.Enum=2]="Enum",n[n.Express=3]="Express",n))(At||{}),at=(n=>(n.Equal="0",n.NotEqual="1",n.Greater="2",n.GreaterOrEqual="3",n.Less="4",n.LessOrEqual="5",n.Like="6",n.LikeStartWith="7",n.LikeEndWith="8",n.In="9",n.NotIn="10",n))(at||{});const gl=[{value:"0",name:"等于"},{value:"1",name:"不等于"},{value:"2",name:"大于"},{value:"3",name:"大于等于"},{value:"4",name:"小于"},{value:"5",name:"小于等于"},{value:"6",name:"包含"},{value:"7",name:"开始是"},{value:"8",name:"结束是"}],yl={"button-edit":["0","1"," 6","7","8"],"check-box":["0"],"combo-list":["0","1"],"combo-lookup":["0","1"," 6","7","8"],"date-picker":["0","1","2","3","4","5"],"date-range":[],"datetime-picker":["0","1","2","3","4","5"],"datetime-range":[],"month-picker":["0","1","2","3","4","5"],"month-range":[],"year-picker":["0","1","2","3","4","5"],"year-range":[],"input-group":["0","1","6","7","8"],lookup:["0","1"],"number-range":[],"number-spinner":["0"," 1","2","3","4","5"],"radio-group":["0"],text:["0","1"," 6","7","8"]};function vl(n,t,e){const{fieldMap:o}=e;function r(i){const s=o.get(i.fieldCode);if(!s)return[];const l=s.editor.type,c=new Set(yl[l]);return gl.filter(d=>c.has(d.value))}return{getCompareOperators:r}}function Oo(){const n=a.ref({relation:0,items:[],children:[],path:[],groupId:0,level:0}),t=new Map,e=new Map;let o=0;function r(){return{id:"",fieldCode:"",fieldName:"",compareType:at.Equal,valueType:At.Value,value:new Kt,relation:0,conditionId:Date.now()}}function i(F,N){return{relation:F,items:[],children:[],path:[],groupId:++o,level:N}}function s(){const F=Object.assign({},n.value);e.forEach((N,w)=>{N.groupId===F.groupId&&e.set(w,F)}),t.forEach((N,w)=>{N.groupId===F.groupId&&t.set(w,F)}),n.value=F}function l(F){const N=new Map;let w=0;return F.forEach((R,L)=>{var C,k;if(w+=((C=R.lBracket)==null?void 0:C.length)||0,N.set(L,w),w-=((k=R.rBracket)==null?void 0:k.length)||0,w<0)throw new Error("The right bracket is out of range.")}),N}function c(F,N,w,R,L){for(let C=0;C<N;C++){const k=F+(C+1),D=i(L,k);w.children.push(D),e.set(D.groupId,w),w=w.children[w.children.length-1],R.push(w)}return w}function f(F,N,w,R,L){for(let B=N;B<=0;B++)R.pop();const C=R[R.length-1];if(!C)throw new Error("The group path is out of range");const k=F+N,D=i(L,k);return C.children.push(D),e.set(D.groupId,C),w=C.children[C.children.length-1],R.push(w),w}function d(F,N,w,R){w.pop();const L=w[w.length-1],C=i(R,F);return L.children.push(C),e.set(C.groupId,L),N=L.children[L.children.length-1],w.push(N),N}function u(F,N,w,R,L,C){let k=F[F.length-1];if(!k)throw new Error("The group path is out of range");const D=N.get(R)||0,B=N.get(w)||0;if(w<0||w===R)return F[F.length-1];const O=D-B,P=L&&L.relation!==void 0?L.relation:1;return k=O>0?c(B,O,k,F,P):k,k=O<0?f(B,O,k,F,P):k,k=O===0&&B>0&&D>0&&L&&C&&!!L.rBracket&&!!C.lBracket?d(B,k,F,P):k,k}function p(F){const w={relation:F.length&&F[0].relation!==void 0?F[0].relation:1,items:[],children:[],path:[],groupId:0,level:0},R=[w],L=l(F);return F.forEach((C,k)=>{const D=k-1,B=F[D],O=u(R,L,D,k,B,C);O.items.push(C),t.set(C.conditionId,O)}),n.value=w,w}function h(){const F=r();t.set(F.conditionId,n.value),n.value.items.push(F)}function m(F){if(!F)return;const N=t.get(F.conditionId);if(N){const w=N.items.findIndex(L=>L.conditionId===F.conditionId)+1,R=r();t.set(R.conditionId,N),N.items.splice(w,0,R),s()}}function M(F,N,w,R){F.reduce((L,C)=>{const k=C.conditionId!==void 0,D=C.groupId!==void 0;if(k){const B=C;w.push(B),L.items.set(B.conditionId,B)}if(D){const B=C;R.push(B),L.groups.set(B.groupId,B)}return L},N)}function x(F,N,w,R,L){F&&(F.items=N.length?F.items.filter(C=>!w.has(C.conditionId)):F.items,F.children=R.length?F.children.filter(C=>!L.has(C.groupId)):F.children)}function y(F,N,w){N.forEach(R=>{F.items.push(R),t.set(R.conditionId,F)}),w.forEach(R=>{F.children.push(R),e.set(R.groupId,F)})}function v(F){const N=F[0],w=N.conditionId!==void 0?t.get(N.conditionId):e.get(N.groupId),R={items:new Map,groups:new Map},L=[],C=[];if(w){M(F,R,L,C),x(w,L,R.items,C,R.groups);const k=i(w.relation,w.level+1);y(k,L,C),w.children.push(k),e.set(k.groupId,w),s()}}function b(F){const N=[...F.items],w=[...F.children],R=e.get(F.groupId);R&&(R.children=R.children.filter(L=>L.groupId!==F.groupId),e.delete(F.groupId),N.forEach(L=>{R.items.push(L),t.set(L.conditionId,R)}),w.forEach(L=>{R.children.push(L),e.set(L.groupId,R)}),s())}function _(F){F.relation=F.relation===1?2:1,s()}let S;function T(F){const{relation:N}=F;return(F.children&&F.children.length?F.children.map((R,L,C)=>{const k=S(R);return k[0].lBracket=(k[0].lBracket||"")+"(",k[k.length-1].rBracket=(k[k.length-1].rBracket||"")+")",k[k.length-1].relation=L<C.length-1?N:0,k}):[]).flat()}S=(F=n.value)=>{const{relation:N}=F,w=F.items.map((L,C,k)=>(L.lBracket=C===0?"(":"",L.rBracket=C===k.length-1?")":"",L.relation=C<k.length-1?N||1:0,L)),R=T(F);return[...w,...R]};function g(F){const N=F||n.value;if(N.children.length&&N.children.forEach(w=>{g(w)}),N.level===0&&!N.items.length&&N.children.length===1){const w=N.children[0];n.value.relation=w.relation,b(w)}else N.items.length===0&&N.children.length<=1&&b(N)}function V(F){const N=t.get(F.conditionId);N&&(N.items=N.items.filter(w=>w.conditionId!==F.conditionId),t.delete(F.conditionId),g(),s())}return{addCondition:h,changeGroupRelation:_,conditionGroupMap:t,getConditions:S,group:v,groupParentMap:e,insertConditionTo:m,loadConditionGroup:p,refresh:s,removeCondition:V,rootGroup:n,unGroup:b}}function bl(n,t,e){const o=a.ref(new Set),r=a.ref(new Set),{conditionGroupMap:i,groupParentMap:s}=e;let l,c;function f(y){let v=l.level<=y.level?l:y,b=l.level>y.level?l:y;const _=[];for(;b&&v&&b!==v;)b.level>v.level?(_.push(b),b=s.get(b.groupId)):b.level===v.level&&(v=s.get(v.groupId),v&&_.unshift(v));return _}function d(y){r.value.add(y.groupId),y.items.forEach(v=>o.value.add(v.conditionId)),y.children.forEach(v=>d(v))}function u(y){const{conditionId:v}=y;o.value.add(v),l=o.value.size===0?i.get(v):l;const b=i.get(y.conditionId);f(b).forEach(S=>d(S))}const p=a.computed(()=>o.value.size===0&&r.value.size===1),h=function(y){r.value.delete(y.groupId),y.items.forEach(b=>c(b)),y.children.forEach(b=>!p.value&&h(b));const v=s.get(y.groupId);v&&r.value.has(v.groupId)&&h(v)};c=function(y){const{conditionId:v}=y;if(o.value.has(v)&&o.value.delete(v),r.value.size>0){const b=i.get(v);b&&r.value.has(b.groupId)&&h(b)}};function m(y){const{conditionId:v}=y;o.value.size===0&&(l=i.get(v)),o.value.has(v)?c(y):u(y)}function M(){const y=[];return l&&(l.items.filter(v=>o.value.has(v.conditionId)).forEach(v=>y.push(v)),l.children.filter(v=>r.value.has(v.groupId)).forEach(v=>y.push(v))),y}function x(){o.value.clear(),r.value.clear()}return{clear:x,getSelectedGroupItem:M,selectedItems:o,toggleSelect:m}}const wn=a.defineComponent({name:"FConditionList",props:Zn,emits:["valueChange","labelCodeChange","compareTypeChange"],setup(n,t){const e=a.ref(n.key),o=a.ref(n.conditions),r=Io(n),{convertToSingleControl:i,fields:s,fieldMap:l,loadFieldConfigs:c}=r,f=Oo(),{addCondition:d,changeGroupRelation:u,getConditions:p,group:h,insertConditionTo:m,loadConditionGroup:M,refresh:x,removeCondition:y,rootGroup:v,unGroup:b}=f,{createConditionValue:_}=No(),S=bl(n,t,f),{selectedItems:T,toggleSelect:g}=S,{getCompareOperators:V}=vl(n,t,r);c(!1),s.value=i(s.value),M(o.value);function F(I){var $;const H=(($=l.get(I.fieldCode))==null?void 0:$.editor)||{type:"text"};I.value=_(H.type,void 0),t.emit("labelCodeChange",I)}function N(I,H){t.emit("compareTypeChange",H)}function w(){}t.expose({getConditions:p});function R(I,H){t.emit("valueChange",I,H)}function L(I){return a.createVNode("div",{class:"condition-list-item-type mr-3"},[a.createVNode(Ft,{"value-field":"labelCode","text-field":"name","id-field":"id",data:s.value,modelValue:I.fieldCode,"onUpdate:modelValue":H=>I.fieldCode=H,onChange:H=>F(I)},null)])}function C(I){return a.createVNode("div",{class:"condition-list-item-compare mr-3"},[a.createVNode(Ft,{"value-field":"value","text-field":"name","id-field":"id",data:V(I),modelValue:I.compareType,"onUpdate:modelValue":H=>I.compareType=H,onChange:H=>N(H,I)},null)])}function k(I){var H;return a.createVNode("div",{class:"condition-list-item-control mr-3"},[a.createVNode(Lt,{editor:(H=l.get(I.fieldCode))==null?void 0:H.editor,showLabel:!1,modelValue:I.value.value,"onUpdate:modelValue":$=>I.value.value=$,onChange:$=>{R($,I)}},null)])}function D(I){return[a.createVNode("div",{class:"condition-list-item-extend"},[a.createVNode("span",{class:"f-icon f-icon-plus-sm mr-2",onClick:()=>m(I)},null),a.createVNode("span",{class:"f-icon f-icon-minus-sm",onClick:()=>y(I)},null)]),a.createVNode("div",{class:"custom-control custom-checkbox"},[a.createVNode("input",{title:"selection",class:"custom-control-input",type:"checkbox",checked:T.value.has(I.conditionId)},null),a.createVNode("label",{class:"custom-control-label",onClick:()=>g(I)},null)])]}function B(I){return I.items.map(H=>a.createVNode("div",{class:"condition-list-item",key:H.conditionId},[L(H),C(H),k(H),D(H)]))}function O(I){return a.createVNode("div",{class:"condition-list-relation"},[a.createVNode("span",{class:"condition-list-relation-close f-icon-filter-cancel btn-link",onClick:()=>b(I)},null),a.createVNode("span",{class:"condition-list-relation-text btn-link",onClick:()=>u(I)},[I.relation===1?"与":"或"])])}function P(I){return a.createVNode("div",{class:"condition-list-content"},[a.createVNode("div",{class:"condition-list-content-group"},[B(I),I.children&&I.children.map(H=>P(H))]),O(I)])}function A(){h(S.getSelectedGroupItem()),S.clear()}function E(){return a.createVNode("div",{class:"condition-list-bottom"},[a.createVNode("div",{class:"add-condition-btn mb-1 mr-3",onClick:d},[a.createVNode("span",{class:"f-icon f-icon-filter-add"},null),a.createVNode("span",{class:"ml-1"},[a.createTextVNode("添加条件")])]),a.createVNode("div",{class:"add-condition-btn mb-1",onClick:A},[a.createVNode("span",{class:"f-icon f-icon-filter-grouping"},null),a.createVNode("span",{class:"ml-1"},[a.createTextVNode("生成条件组")])]),a.createVNode("div",{class:"condition-list-reset add-condition-btn",onClick:w},[a.createTextVNode("重置")])])}return()=>a.createVNode("div",{class:"condition-list",key:e.value},[a.createVNode("div",{class:"condition-list-body"},[P(v.value)]),E()])}});wn.install=n=>{n.component(Eo.name,Eo).component(wn.name,wn)};const wl=["equal","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","contain","startWidth","endWidth","in","notIn"],Cl={equal:(n,t,e)=>n&&n[t]===e,notEqual:(n,t,e)=>n&&n[t]!==e,contain:(n,t,e)=>n?(n[t]||"").indexOf(e)>-1:!1,startWidth:(n,t,e)=>n?(n[t]||"").startsWith(e):!1,endWidth:(n,t,e)=>n?(n[t]||"").endsWith(e):!1},xl={equal:(n,t,e)=>n&&n[t]===e,in:(n,t,e)=>{if(n){const o=n[t];return e.indexOf(o)>-1}return!1},notEqual:(n,t,e)=>n&&n[t]!==e},_l={equal:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()===o}return!1},notEqual:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()!==o}return!1},greaterThan:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()>o}return!1},greaterThanOrEqual:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()>=o}return!1},lessThan:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()<o}return!1},lessThanOrEqual:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()<=o}return!1}},Tl={equal:(n,t,e)=>n?String(e).split(",").includes(String(n[t])):!1,in:(n,t,e)=>{if(n){const o=n[t];return e.indexOf(o)>-1}return!1},notEqual:(n,t,e)=>n?String(e).split(",").findIndex(r=>r===String(n[t]))===-1:!1},Fl={equal:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):o===r}return!1},notEqual:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?!0:o!==r}return!1},greaterThan:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):r>o}return!1},greaterThanOrEqual:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):r>=o}return!1},lessThan:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):r<o}return!1},lessThanOrEqual:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):r<=o}return!1}},Sl=new Map([["boolean",xl],["datetime",_l],["enum",Tl],["number",Fl],["text",Cl]]);function kl(){const n=a.ref([]),t=new Map,{loadConditionGroup:e}=Oo();function o(x,y){switch(x){case"check-box":return new Kn({value:y});case"combo-list":return new _o({value:y});case"combo-lookup":return new Jn({value:y});case"input-group":return new Kt({value:y});case"date-picker":return new Co({value:y});case"date-range":return new Zt({value:y});case"datetime-picker":return new xo({value:y});case"datetime-range":return new Zt({value:y});case"lookup":return new To({value:y});case"month-picker":return new Fo({value:y});case"month-range":return new So({value:y});case"number-range":return new ko({value:y});case"number-spinner":return new Vo({value:y});case"radio-group":return new Mo({value:y});default:return new Kt({value:y})}}const r=new Map([["boolean","check-box"],["date","date-picker"],["datetime","datetime-picker"],["number","number-spinner"],["string","text"],["text","text"],["enum","combo-list"],["reference","lookup"]]),i=new Map([["boolean",at.In],["date",at.Equal],["datetime",at.Equal],["number",at.Equal],["string",at.Equal],["text",at.Equal],["enum",at.In],["reference",at.Equal]]);function s(x){var v;const y=x.dataType||"string";return((v=x.editor)==null?void 0:v.type)||r.get(y)||"text"}function l(x){var N,w,R,L,C;const y=`field_filter_${x.field}`,v=Date.now(),b=x.field,_=((N=x.column)==null?void 0:N.title)||"",S=((w=x.column)==null?void 0:w.dataType)||"string",T=i.get(S)||at.Equal,g=((L=(R=x.column)==null?void 0:R.editor)==null?void 0:L.type)||r.get(S)||"text",V=o(g,(C=x.column)==null?void 0:C.filter),F=g==="lookup"||g==="combo-lookup"?At.SmartHelp:g==="combo-list"?At.Enum:At.Value;t.set(y,{id:y,fieldCode:b,fieldName:_,compareType:T,valueType:F,value:V,conditionId:v}),n.value=Array.from(t.values())}function c(x){const y=`field_filter_${x.field}`;t.delete(y),n.value=Array.from(t.values())}function f(x){t.delete(x),n.value=Array.from(t.values())}function d(){t.clear(),n.value=[]}function u(x){const{valueType:y}=x.value,v=x.compareType||"0",b=wl[Number(v)];return Sl.get(y)[b]}function p(x){const y=x.relation===2?0:1,v=x.items.map(_=>{const S=u(_);return g=>S(g,_.fieldCode,_.value.getValue())}),b=x.children&&x.children.length?x.children.map(_=>p(_)):[];return{relation:y,filterFunctions:v,children:b}}function h(){const x=e(n.value);return p(x)}function m(x,y){const v=y.filterFunctions.map(_=>_(x)),b=y.children.map(_=>m(x,_));return y.relation===1?v.every(_=>_)&&b.every(_=>_):v.includes(!0)||b.includes(!0)}function M(x){const y=h();return m(x,y)}return{addColumnFilter:l,apply:M,clearCondition:d,conditions:n,getFilterEditorType:s,removeColumnFilter:c,removeCondition:f}}function Vl(n){a.ref(n.selection.showCheckbox||!1);const t=a.computed(()=>{var s;return((s=n.hierarchy)==null?void 0:s.collapseField)||"__fv_collapse__"}),e=a.computed(()=>{var s;return((s=n.hierarchy)==null?void 0:s.hasChildrenField)||"__fv_hasChildren__"}),o=a.computed(()=>{var s;return((s=n.hierarchy)==null?void 0:s.parentIdField)||"parent"}),r=a.computed(()=>n.hierarchy&&n.selection.showCheckbox),i=a.computed(()=>(n.treeNodeIconsData.fold||n.iconField)&&n.showTreeNodeIcons);return{collapseField:t,hasChildrenField:e,parentIdField:o,shouldShowCheckBox:r,shouldShowIcon:i}}function Ml(n,t,e,o,r,i,s,l,c){var _t;const{dataView:f,visibleDataItems:d}=t,{getVisualData:u,maxVisibleRowIndex:p,minVisibleRowIndex:h}=r,m=a.computed(()=>o.value.primaryColumnsWidth),M=a.computed(()=>o.value.leftColumnsWidth),x=a.computed(()=>o.value.rightColumnsWidth),y=((_t=n.rowOption)==null?void 0:_t.height)||28,v=a.ref(0),b=a.ref(0);let _=0,S=i.value-1;const T=a.ref(0),g=a.ref(0),V=a.ref(0),F=a.ref(n.virtualized),N=24,w=1.5;let R=null;function L(){const re=d.value;if(re.length<=0)return 0;const fe=p.value<re.length?re[p.value]:re[re.length-1];return fe.__fv_data_position__>re.length*y?re.length*y:(fe.__fv_data_position__||0)+(fe.__fv_data_height__||0)+Math.max(re.length-1-p.value,0)*y}const C=a.computed(()=>{const re=L();d.value;let fe=g.value/Math.max(re,g.value),ge=Math.floor(fe*g.value);for(;g.value>0&&ge<N;)fe*=w,ge=Math.floor(fe*g.value);return ge}),k=a.computed(()=>Math.floor(V.value/Math.max(m.value,V.value)*T.value)),D=0,B=0,O=a.computed(()=>T.value-(M.value+m.value+x.value+l.value));function P(re){const ge=Math.floor(re/y)+1,Pe=d.value;return Pe.length>ge?Pe[ge].__fv_visible_index__-1:0}function A(re,fe,ge){let Pe=re,ze=fe;const Je=fe-re+1;if(Je<s+i.value+s){const U=s+i.value+s-Je,pe=fe+U<=ge,we=0+U<=re;if(pe)ze+=U,S=ze;else if(we)Pe-=U,_=Pe;else{const Ne=ge-fe,q=U-Ne;ze=Math.min(fe+Ne,ge),Pe=Math.max(re-q,0)}}return{actualStart:Pe,actualEnd:ze}}function E(re){var Ne,q;const fe=d.value;if(!fe.length){e.value=[];return}const ge=(Ne=n.pagination)!=null&&Ne.enable?0:Math.max(_-s,0),Pe=fe[fe.length-1].__fv_visible_index__,ze=(q=n.pagination)!=null&&q.enable?fe.length-1:Math.min(S+s,Pe),{actualStart:Je,actualEnd:U}=A(ge,ze,Pe),pe=fe[Je-1],we=u(Je,U,pe,re);we.length&&(e.value=[...we])}const I=a.computed(()=>L()>g.value),H=a.computed(()=>Math.floor(m.value)>V.value);function $(re,fe){let ge=re;const Pe=ge>D,ze=I.value;ze&&ge<g.value-fe&&(ge=g.value-fe),(!ze||Pe)&&(ge=D),v.value!==ge&&(v.value=ge)}function W(){F.value&&(_=P(Math.abs(v.value)),S=_+i.value-1,(_<h.value||S>p.value-s/2)&&E())}function z(re){let fe=v.value+re;fe>D&&(fe=D);const ge=L();$(fe,ge),W()}function X(re){if(!H.value){b.value=0;return}let fe=b.value+re;fe>B&&(fe=B),fe<O.value&&(fe=O.value),b.value!==fe&&(b.value=fe)}function K(){Math.abs(b.value)+V.value>m.value&&(b.value=Math.min(V.value-m.value,0))}function Q(){v.value=0,_=0,S=i.value-1,E()}function de(){const re=L();$(v.value,re)}a.watch([V,m],()=>{X(0)}),a.watch(g,(re,fe)=>{re!==fe&&re>=f.value.length*y&&z(0)});function he(re){let{deltaX:fe}=re,ge=-1*re.deltaY;return typeof fe>"u"&&(fe=-1*re.wheelDeltaX/6),typeof ge>"u"&&(ge=re.wheelDeltaY/6),re.deltaMode&&re.deltaMode===1&&(fe*=10,ge*=10),re.shiftKey?{deltaY:-ge,deltaX:-fe}:{deltaX:fe,deltaY:ge}}function xe(re){if(n.disabled||!I.value||re.target.tagName==="TEXTAREA")return;re.preventDefault(),re.stopPropagation();const{deltaX:fe,deltaY:ge}=he(re);z(ge),X(fe)}const De=a.computed(()=>({height:`${f.value.length*y}px`,width:`${M.value}px`,transform:`translateY(${v.value}px)`})),Re=a.computed(()=>({transform:`translateY(${v.value}px)`})),Y=a.computed(()=>({height:`${(n.autoHeight?d.value:f.value).length*y}px`,width:`${m.value}px`,transform:`translate(${b.value}px, ${v.value}px)`})),ue=a.computed(()=>({transform:`translate(${b.value}px, ${v.value}px)`})),G=a.computed(()=>({height:`${f.value.length*y}px`,width:`${x.value}px`,transform:`translateY(${v.value}px)`})),te=a.computed(()=>({transform:`translateY(${v.value}px)`})),ve=a.computed(()=>({height:`${f.value.length*y}px`,width:`${l.value}px`,transform:`translateY(${v.value}px)`})),Se=a.computed(()=>({width:`${M.value}px`})),Oe=a.computed(()=>({transform:`translateX(${b.value}px)`})),ot=a.computed(()=>({width:`${x.value}px`})),mt=a.computed(()=>{const re=L();return $(v.value,re),v.value/(g.value-re)*(g.value-C.value)}),dt=a.computed(()=>({width:"8px",height:`${C.value}px`,top:`${mt.value}px`})),J=a.computed(()=>b.value/O.value*(T.value-k.value)),_e=a.computed(()=>({height:"8px",width:`${k.value}px`,left:`${J.value}px`})),Ie=a.ref(!1),Ge=a.ref(-1),je=a.ref(-1),it=a.ref();function ht(re){if(Ie.value&&je.value!==-1){const fe=je.value-re.pageX,ge=T.value-k.value;if(Math.abs(fe)<=ge){const Pe=fe/(V.value-k.value)*(m.value-V.value);X(Pe),je.value=re.pageX}}}function Ct(re){if(Ie.value&&Ge.value!==-1){const fe=Ge.value-re.pageY,ge=L(),Pe=ge-C.value;if(Math.abs(fe)<=Pe){const ze=fe/(g.value-C.value)*(ge-g.value);z(ze),Ge.value=re.pageY}}}function ft(re){Ie.value=!1,Ge.value=-1,je.value=-1,document.removeEventListener("mouseup",ft),R&&(document.removeEventListener("mousemove",R),R=null),document.body.style.userSelect="",it.value&&(it.value.style.opacity=null)}function Vt(re,fe,ge){var Je;Ie.value=!0;const Pe=(Je=re.target)==null?void 0:Je.parentElement;Pe&&(Pe.style.opacity="1",it.value=Pe);const ze=ge==="horizontal"?ht:Ct;R||(R=Ee.throttle(ze,50)),ge==="vertical"&&(Ge.value=re.pageY),ge==="horizontal"&&(je.value=re.pageX),fe.value&&(fe.value,document.addEventListener("mousemove",R),document.addEventListener("mouseup",ft),document.body.style.userSelect="none")}function xt(re){const fe=f.value.length*y-g.value;let ge=re*y;ge>=fe&&(ge=fe),z(-ge-v.value)}function gt(){xt(f.value.length)}function Mt(re){z(re-v.value)}return{dataGridWidth:T,fitHorizontalScroll:K,gridDataStyle:Y,gridHeaderColumnsStyle:Oe,gridMergedDataStyle:ue,gridSideStyle:ve,horizontalScrollThumbStyle:_e,leftFixedGridDataStyle:De,leftFixedGridHeaderColumnsStyle:Se,leftFixedGridMergedDataStyle:Re,offsetX:b,offsetY:v,onMouseDownScrollThumb:Vt,onWheel:xe,reCalculateVisualDataRows:E,resetScroll:Q,rightFixedGridDataStyle:G,rightFixedGridHeaderColumnsStyle:ot,rightFixedGridMergedDataStyle:te,shouldShowHorizontalScrollbar:H,shouldShowVirticalScrollbar:I,updateVirticalScroll:de,updateVisibleRowsOnLatestVisibleScope:W,verticalScrollThumbStyle:dt,viewPortWidth:V,viewPortHeight:g,scrollToBottom:gt,scrollToRowByIndex:xt,scrollTo:Mt}}function Nl(n){var i;const{isUndefined:t}=ke.useCommonUtils(),e=((i=n.rowOption)==null?void 0:i.height)||28;function o(s,l){const c=s.pre;if(c){let f=c.__fv_data_position__,d=c.__fv_data_height__;(t(f)||n.virtualized&&n.hierarchy&&c.__fv_visible_index__*e!==f)&&(f=c.__fv_visible_index__*e),t(d)&&(d=e);const u=s.visible?f+d:c.__fv_data_position__;s.top=u,l.__fv_data_position__=u}else s.top=0,l.__fv_data_position__=0}function r(s,l,c){if(s&&!l.ref){l.ref=s;const f=l.parent;l.cellHeight!==s.offsetHeight&&(l.cellHeight=s.offsetHeight),l.cellHeight&&l.cellHeight>(f.height||0)&&(f.height=l.cellHeight,c.__fv_data_height__=f.height),o(f,c)}}return{updateRowPosition:o,updateVisualInfomation:r}}function Il(){function n(t,e){var s,l;if(!e.data||!e.data.length)return"";const o=Object.prototype.hasOwnProperty.call(e,"valueField")&&e.valueField||"value",r=Object.prototype.hasOwnProperty.call(e,"textField")&&e.textField||"name";if(t!=null&&t.includes(",")){const c=t.split(",");if(!e.data.filter(p=>c.includes(p[o])).length)return"";const d=(s=e.data)==null?void 0:s.reduce((p,h)=>(p[h[o]]=h,p),{});return c.map(p=>{var h;return(h=d[p])==null?void 0:h[r]}).join(",")||t}const i=(l=e.data)==null?void 0:l.find(c=>c[o]===t);return(i==null?void 0:i[r])||t||""}return{renderEnumColumn:n}}function El(){function n(t,e){return t?e==null?void 0:e.trueText:e==null?void 0:e.falseText}return{renderText:n}}function Ol(){const{formatTo:n}=ke.useDateFormat();function t(o,r){if(o){let i="yyyy-MM-dd";if(typeof r=="string"?i=r:typeof r=="object"&&(i=r.format||"yyyy-MM-dd"),i=i.replace("YYYY","yyyy").replace("-DD","-dd"),typeof r=="object"&&r.dateRange){const s=r.dateRangeDatesDelimiter||"~";let[l,c]=o.split(s);return l=n(l,i),c=n(c,i),l+s+c}return n(o,i)}return o}function e(o,r){const i=r.dateFormat||"yyyy-MM-dd";return n(o,i)}return{renderDateColumn:e,renderDateTimeColumn:t}}function Dl(){const{formatTo:n}=ke.useNumberFormat();function t(e,o){const r={precision:o.precision,prefix:o.prefix||"",suffix:o.suffix||"",decimalSeparator:o.decimal||".",groupSeparator:o.thousand||""};return n(e,r)||e}return{renderNumberColumn:t}}function Pl(){function n(t,e){if(t){const o={};return e!=null&&e.width&&(o.width=`${e.width}px`),e!=null&&e.height&&(o.height=`${e.height}px`),a.createVNode("img",{src:t,style:o},null)}return t}return{renderImageColumn:n}}function Bl(){const{renderText:n}=El(),{renderEnumColumn:t}=Il(),{renderNumberColumn:e}=Dl(),{renderDateColumn:o,renderDateTimeColumn:r}=Ol(),{renderImageColumn:i}=Pl();function s(f){return f}function l(f,d){return d.customFormat?new Function(`return ${d.customFormat}`)():f}function c(f,d,u){const p=ke.resolveField(d.raw,f.field),h=u.options||u;return u.type==="none"?p:u.type==="custom"?l(p,u):u.type==="enum"?t(p,h):u.type==="number"?e(p,h):u.type==="boolean"?n(p,h):u.type==="date"?o(p,h):u.type==="datetime"?r(p,u):u.type==="image"?i(p,h):p}return{renderFormatColumn:c}}function jl(n,t,e){var x;const o=a.ref(n.mergeCell);(x=a.ref(n.rowOption).value)!=null&&x.wrapContent;const{updateVisualInfomation:i}=e,{renderCommandColumn:s}=fi(),{renderFormatColumn:l}=Bl();function c(y,v,b,_,S,T=1){const g={colSpan:T,rowSpan:1,index:b,field:y,data:ke.resolveField(_,y),editingData:ke.resolveField(_,y),parent:S,mode:v,align:"left",valign:"start",showEllipsis:!0,getEditor:V=>V.data,setRef:V=>i(V,g,_),update:()=>{},accept:()=>{},cancel:()=>{},updateData:()=>{}};return g}function f(y,v,b){return y.getEditor=_=>t.getEditor(_,v,_.parent),y.setRef=_=>i(_,y,b),y.update=_=>{_!==void 0&&(y.editingData=_)},y.accept=()=>{ke.setFieldValue(y.editingData,b,v.field),y.data=ke.resolveField(b,v.field)},y.cancel=()=>{y.editingData=y.data},y.updateData=_=>{ke.setFieldValue(ke.resolveField(_,v.field),b,v.field),y.data=ke.resolveField(b,v.field),y.editingData=ke.resolveField(b,v.field)},y}function d(y,v){v.dataType==="commands"?y.formatter=(b,_)=>s(v,_):v.formatter&&(y.formatter=(b,_)=>typeof v.formatter=="function"?v.formatter(b,_):l(v,_,v.formatter))}function u(y,v,b){const _=v&&v.data[b];if(_&&_.data===y.data){const T=_&&_.spannedBy||_;T.rowSpan++,T.spanned=T.spanned||[],T.spanned.push(y),y.colSpan=0,y.rowSpan=0,y.spannedBy=T}}function p(y,v,b){o.value&&u(y,v,b.field)}function h(y,v){v.showEllipsis!==void 0&&(y.showEllipsis=v.showEllipsis),y.showTips=v.showTips,y.column=v,y.align=v.align||"left",y.valign=v.valign||"middle",y.mode=n.editable?nt.editable:nt.readonly}function m(y,v,b,_){h(y,v),f(y,v,_),d(y,v),p(y,b,v)}function M(y,v,b,_,S){const T=n.editable?nt.editable:nt.readonly,g=c(y.field,T,v,b,_);return m(g,y,S,b),g}return{createCellByColumn:M,createCellByField:c,updateCellByColumn:m}}function Rl(n,t,e,o,r,i,s){var b,_;const l=a.ref(n.rowOption),c=((b=l.value)==null?void 0:b.height)||28,f=((_=l.value)==null?void 0:_.wrapContent)||!1,{idField:d}=r,{collapseField:u}=o,{updateRowPosition:p}=i,{createCellByColumn:h}=s,m=(S,T,g,V)=>{ke.setFieldValue(ke.resolveField(S,V),T,V),g.data[V].data=ke.resolveField(T,V),g.data[V].editingData=ke.resolveField(T,V)};function M(S,T,g,V,F,N){var H,$,W;const{__fv_data_grid_group_field__:w,__fv_data_grid_group_value__:R,__fv_data_index__:L}=g,C=g.__fv_data_grid_group_layer__||(g.__fv_parents__?(H=g.__fv_parents__)==null?void 0:H.size:0)||0,k=typeof g.parent=="number"?Number(g.parent):-1,D=g.__fv_data_grid_group_collapse__||g[u.value],B=g.__fv_visible__===void 0?!0:g.__fv_visible__,O=g.__fv_checked__,P=g.__fv_indeterminate__,A=g.__fv_disabled__||g[(($=n.rowOption)==null?void 0:$.disabledField)||"disabled"],E=n.hierarchy&&t.isVisibleInTree(g),I={collapse:D,data:{},dataIndex:L,groupField:w,groupValue:R,layer:C,index:T,parentIndex:k,pre:V,top:N,type:S,raw:g,checked:O,disabled:A,indeterminate:P,setRef:z=>{I.ref=z},visible:B&&E||B&&!n.hierarchy,status:lt.initial,updateCell:(z,X)=>{m(z,g,I,X)},updateCells:(z,X)=>{X.forEach(K=>{m(z,g,I,K)})}};return V||(g.__fv_data_position__=0),f||(I.height=c,g.__fv_data_height__=I.height,p(I,g)),(W=l.value)!=null&&W.customRowStatus&&(l.value.customRowStatus(I),g.__fv_disabled__=I.disabled),I}function x(S,T,g,V,F,N){const w=M($t.data,F,T,g,V,N);return S.forEach((R,L)=>{w.data[R.field]=h(R,L,T,w,V)}),w}function y(S,T,g,V,F){return Object.assign(S,{index:T,dataIndex:g,top:V,pre:F})}function v(S,T,g,V,F,N){const w=S.__fv_data_index__,R=S[d.value],L=e.getEditingSnapshot(R);return L===null?x(N,S,T,g,V,F):y(L,V,w,F,T)}return{createEmptyRow:M,createNewRowFromDataItem:x,renderDataRow:v}}function Ll(n,t,e,o,r){var A;const{idField:i}=e,s=a.ref(n.editable),l=a.ref(n.editOption),c=a.ref(((A=n.rowOption)==null?void 0:A.wrapContent)||!1),{onClickRow:f,onClickRowExcludeDblclick:d}=o,u=new Map([["boolean","check-box"],["datetime","date-picker"],["enum","combo-list"],["number","number-spinner"],["string","input-group"],["text","text"],["commands","commands-editor"]]);let p,h,m,M,x;function y(E){return h&&h.raw[i.value]===E?h:null}const v=a.reactive({});function b(E,I,H={}){E.mode=nt.editing,p=E,h=I,m=ke.resolveField(I==null?void 0:I.raw,E.field),M=H;for(const $ in v)delete v[$]}function _(E){E.accept(),E.mode=nt.editable,p=null;const I={};h&&(Object.keys(h).forEach(H=>{I[H]=h==null?void 0:h[H]}),h=null),t.emit("endEditCell",{cell:E,row:I,newValue:ke.resolveField(I==null?void 0:I.raw,E.field),oldValue:m,column:M,editor:v})}function S(E){const I=Promise.resolve(!0);return E?I.then(()=>Ee.isUndefined(n.beforeEndEditCell)?!0:typeof n.beforeEndEditCell=="function"?n.beforeEndEditCell({cell:E,row:h,newValue:E.editingData,oldValue:m}):()=>!0).then(H=>(H&&(_(E),h&&(h=null)),H)):I}function T(E){if(x&&x!==E.target){x=null;return}if(document.body.classList.contains("lookup-modal-open"))return;const H=E.target;if(H!=null&&H.closest(".popover"))return;const $=H.closest(".fv-grid-cell");p&&p.ref&&p.ref===$||S(p).then(z=>{z&&document.body.removeEventListener("click",T,!0)})}function g(E,I,H){return Promise.resolve().then(()=>{var W;const $=(W=H.editor)==null?void 0:W.readonly;return!Ee.isUndefined(n.beforeEditCell)&&typeof n.beforeEditCell=="function"?n.beforeEditCell({row:E,cell:I,rawData:E.raw,column:H}):!$}).then($=>{$&&(b(I,E,H),document.body.removeEventListener("click",T,!0),document.body.addEventListener("click",T,!0))})}function V(E,I,H,$={}){E.stopPropagation(),d(E,H),s.value&&l.value.editMode==="cell"&&I.mode===nt.editable&&S(p).then(()=>{p||g(H,I,$)})}function F(E,I,H,$={}){E.stopPropagation(),f(E,H),s.value&&l.value.editMode==="cell"&&I.mode===nt.editable&&S(p).then(()=>{p||g(H,I,$)})}function N(E){E.stopPropagation(),x=E.target}function w(E){E.stopPropagation(),x&&(x=null)}function R(E){Object.values(E.data).filter(I=>I.mode===nt.editable&&I.field!=="__commands__").forEach(I=>{I.mode=nt.editing}),E.status=lt.editing,h=E}function L(E,I){Object.values(E.data).filter(H=>H.mode===nt.editing).forEach(H=>{I?H.accept():H.cancel(),H.mode=nt.editable}),E.status=lt.initial,h===E&&(h=null)}function C(E){s.value&&l.value.editMode==="row"&&h!==E&&(h&&L(h,!1),R(E))}function k(E){L(E,!0),E.status=lt.initial}function D(E){L(E,!1),E.status=lt.initial}function B(E,I,H){const $=I.dataType,W=I.editor||{type:u.get($)||"input-group"};return!c.value&&W.type==="text"&&(W.type="input-group"),W?(W.type==="input-group"&&(W.textAlign=I.align!=="center"&&I.align!=="right"?"left":I.align,W.updateOn="change"),W.type,W.context={rowData:H.raw,column:I,cell:E,editor:v},W.readonly=!1,a.createVNode(nn.FDynamicFormInput,{focusOnCreated:n.focusOnEditingCell,selectOnCreated:n.selectOnEditingCell,editor:W,modelValue:E.editingData,"onUpdate:modelValue":z=>E.editingData=z,id:I.id,onMousedown:z=>N(z),onMouseup:z=>w(z)},null)):E.data}function O(){S(p)}a.watch(()=>n.editable,()=>{s.value=n.editable}),a.watch(()=>{var E;return(E=n.editOption)==null?void 0:E.editMode},E=>{l.value.editMode=E});function P(){p=null,h=null,M=null,x=null,document.body.removeEventListener("click",T,!0)}return{clear:P,onClickOutOfCell:T,onClickCell:F,onClickCellByKeyboard:V,onEditingRow:C,acceptEditingRow:k,cancelEditingRow:D,getEditingSnapshot:y,getEditor:B,endEditCell:O,onMousedownCell:N,onMouseupCell:w}}function $l(n){const t=a.ref(n.idField);function e(o){if(o&&o.length){const r=o[0];Object.keys(r).includes(t.value)||(t.value="__fv_indetify__")}}return{idField:t,reviseIdentifyField:e}}function Wl(n,t,e,o){const{idField:r}=o,{currentSelectedDataId:i,multiSelectOnClickRow:s,multiSelectOnClickRowWithShift:l,selectItem:c,selectedValues:f,toggleSelectItem:d,updateSelectAllStatus:u,enableSelectRow:p,multiSelectMode:h,isSingleSelect:m}=e,M=a.ref(0),x=a.ref(-1);function y(C){i.value=C}function v(C){return p.value&&(l.value?f.value.includes(C.raw[r.value]):C.raw[r.value]===i.value)}function b(C,k){var O;const D=k??C.dataIndex,B={"fv-grid-row":C.type===$t.data,"fv-grid-group-row":C.type===$t.group,"fv-grid-summary-row":C.type===$t.summary,"fv-grid-row-hover":D===x.value,"fv-grid-row-selected":v(C),"fv-grid-row-odd":D%2>0,"fv-grid-row-even":D%2===0,"fv-grid-disabled":C.disabled};if((O=n.rowOption)!=null&&O.customRowStyle){const P=n.rowOption.customRowStyle(C.raw)||{};return Object.assign({},B,P)}return B}function _(C){var D;const k={"fv-grid-cell":!0};if((D=n.rowOption)!=null&&D.customCellStyle){const B=n.rowOption.customCellStyle(C)||{};return Object.assign({},k,B)}return k}function S(C){var D;const k={"fv-grid-hierarchy-cell":!0};if((D=n.rowOption)!=null&&D.customCellStyle){const B=n.rowOption.customCellStyle(C)||{};return Object.assign({},k,B)}return k}function T(C,k){var O,P;if(l.value&&!C.shiftKey||m.value){(O=n.selection)!=null&&O.keepSelectingOnClick?c(k):d(k,(P=n.selection)==null?void 0:P.keepSelectingOnClick),u();return}if(l.value&&C.shiftKey||s.value){d(k),u();return}y(k.raw[r.value])}function g(C,k){k.disabled||(T(C,k),t.emit("clickRow",k.index,k.raw))}function V(C){M.value+=1,setTimeout(()=>{M.value===1&&t.emit("clickRow",C.index,C.raw),M.value=0},250),M.value>1&&(t.emit("doubleClickRow",C.index,C.raw),M.value=0)}function F(C,k){k.disabled||(T(C,k),V(k))}function N(C){C.disabled||V(C)}function w(C,k){}function R(C,k){}function L(C,k){var O;const D=k??C.dataIndex,B={"fv-grid-sidebar-row":!0,"fv-grid-sidebar-row-hover":D===x.value,"fv-grid-sidebar-row-selected":v(C),"fv-grid-sidebar-row-odd":D%2>0,"fv-grid-sidebar-row-even":D%2===0,"d-flex":!0,"align-items-center":!0};if((O=n.rowOption)!=null&&O.customRowStyle){const P=n.rowOption.customRowStyle(C.raw)||{};return Object.assign({},B,P)}return B}return{activeRowById:y,clickRowItem:N,gridCellClass:_,gridHierarchyCellClass:S,gridRowClass:b,onClickRow:F,onClickRowExcludeDblclick:g,onMouseoverRow:w,sidebarRowClass:L,onMouseoutRow:R}}function ql(n,t,e,o,r){const{idField:i}=e,{dataView:s,getSelectionItems:l}=t,c=a.ref(""),f=a.computed(()=>n.selection.enableSelectRow),d=a.ref(n.selection.multiSelect??!1),u=a.ref(n.selection.multiSelectMode||"DependOnCheck"),p=a.ref(n.selection.showCheckbox),h=a.ref(n.selection.showSelectAll),m=a.ref(n.selectionValues||[]),M=a.ref(!!m.value.length&&o.value.length===m.value.length),x=a.ref(!!m.value.length&&o.value.length!==m.value.length);a.watch(()=>n.selection.showSelectAll,(Y,ue)=>{Y!==ue&&(h.value=Y)});function y(){const Y=s.value.every(G=>m.value.includes(G[i.value])),ue=s.value.every(G=>!m.value.includes(G[i.value]));Y&&(M.value=!0,x.value=!1),ue&&(M.value=!1,x.value=!1),!Y&&!ue&&(M.value=!1,x.value=!0)}function v(){return l(m.value)}function b(){const Y=o.value.reduce((G,te)=>(G.set(te.raw[i.value],te),G),new Map);return m.value.map(G=>Y.get(G)).filter(G=>!!G)}function _(Y){var G;const ue=Y.raw.__fv_children_index__;if(ue&&ue.length){const te=ue.map(ve=>s.value[ve]);(G=m.value)!=null&&G.length&&te.some(Se=>!m.value.includes(Se[i.value]))&&(Y.indeterminate=!0,Y.raw.__fv_indeterminate__=!0)}}const S=a.computed(()=>f.value&&d.value),T=a.computed(()=>f.value&&!d.value&&!p.value),g=a.computed(()=>!!n.hierarchy),V=a.computed(()=>{const Y=p.value&&u.value==="DependOnCheck";return S.value&&Y}),F=a.computed(()=>S.value&&!p.value),N=a.computed(()=>S.value&&p.value&&u.value==="OnCheckAndClick");a.computed(()=>N.value);function w(){const Y=l(m.value);r.emit("selectionChange",Y)}function R(Y){r.emit("unSelectItem",Y)}function L(){const Y=o.value.filter(G=>G.indeterminate).map(G=>G.raw[i.value]);o.value.forEach(G=>{G.checked=!1,G.indeterminate=!1,G.raw.__fv_checked__=!1,G.raw.__fv_indeterminate__=!1}),b().forEach(G=>{G.checked=!0,G.raw.__fv_checked__=!0}),Y.forEach(G=>{const te=o.value.find(ve=>ve.raw[i.value]===G);_(te)})}a.watch(()=>o.value,()=>{L()}),a.watch(()=>n.selectionValues,Y=>{m.value=Y,L()},{immediate:!0}),a.watch(()=>n.selection,Y=>{d.value=!!Y.multiSelect,u.value=Y.multiSelectMode||"DependOnCheck",p.value=!!Y.showCheckbox});const C=a.computed(()=>!d.value);function k(Y){return Y.raw[i.value]}function D(Y){return m.value.findIndex(G=>G===k(Y))}function B(){b().forEach(G=>{G.checked=!1}),l(m.value).forEach(G=>{G.__fv_checked__=!1}),m.value=[],c.value="",y()}function O(Y){const ue=Y;ue.__fv_checked__=!0,ue.__fv_indeterminate__=!1;const G=new Set(m.value);G.add(ue[i.value]),m.value=Array.from(G.values())}function P(Y){const ue=Y;ue.__fv_checked__=!1,ue.__fv_indeterminate__=!1,m.value=m.value.filter(G=>G!==ue[i.value])}function A(Y){const ue=Y.raw;ue.__fv_checked__=!0,ue.__fv_indeterminate__=!1;const G=new Set(m.value);G.add(ue[i.value]),m.value=Array.from(G.values()),Y.checked=!0,Y.indeterminate=!1}function E(Y){const ue=Y.raw;ue.__fv_checked__=!1,ue.__fv_indeterminate__=!1,m.value=m.value.filter(G=>G!==ue[i.value]),Y.checked=!1,Y.indeterminate=!1}function I(Y){A(Y),c.value=Y.raw[i.value]}function H(Y){E(Y),c.value=""}function $(Y){Y.__fv_checked__=!1,Y.__fv_indeterminate__=!0,m.value=m.value.filter(ue=>ue!==Y[i.value])}function W(Y){const ue=Y.raw;ue.__fv_checked__=!1,ue.__fv_indeterminate__=!0,m.value=m.value.filter(G=>G!==ue[i.value]),Y.checked=!1,Y.indeterminate=!0}function z(Y){C.value&&B(),Y.checked?E(Y):A(Y),w()}function X(Y,ue=!0){const G=Y.checked;C.value&&B(),ue?Y.checked?H(Y):I(Y):G?H(Y):I(Y),w(),Y.checked||R(Y)}function K(Y){Y.raw[i.value]!==c.value&&(B(),I(Y),w())}function Q(Y){const ue=o.value.find(G=>G.raw[i.value]===Y);ue&&K(ue)}function de(Y){const ue=o.value.filter(ve=>Y.includes(ve.raw[i.value])),G=ue.map(ve=>ve.raw[i.value]),te=s.value.filter(ve=>{const Se=ve[i.value];return!G.includes(Se)&&Y.includes(Se)});(ue.length||te.length)&&(B(),T.value&&(c.value=Y[0])),ue.forEach(ve=>{I(ve)}),te.forEach(ve=>{O(ve)}),w()}function he(Y){for(const ue of Y){if(!m.value.includes(ue))continue;const G=o.value.find(te=>te.raw[i.value]===ue);if(G)H(G);else{const te=s.value.find(ve=>ve[i.value]===ue);te&&P(te)}}m.value=m.value.filter(ue=>!Y.includes(ue))}function xe(){o.value.forEach(Y=>{A(Y)}),w()}function De(){o.value.forEach(Y=>{E(Y)}),w()}function Re(){return o.value.find(Y=>Y.raw[i.value]===c.value)}return{clearSelection:B,currentSelectedDataId:c,enableMultiSelect:d,enableSelectRow:f,findIndexInSelectedItems:D,getSelectedItems:v,getSelectionRow:Re,indeterminate:W,indeterminateDataItem:$,isSelectingHirarchyItem:g,multiSelectMode:u,multiSelectOnClickRow:N,multiSelectOnClickRowWithShift:F,multiSelectOnlyOnCheck:V,select:I,selectAll:xe,selectedValues:m,selectDataItem:O,selectItem:K,selectItemById:Q,selectItemByIds:de,showCheckBox:p,showSelectAll:h,toggleSelectItem:X,toggleSelectItemWithoutRow:z,unSelect:H,unSelectAll:De,unSelectDataItem:P,unSelectItemByIds:he,updateSelectAllStatus:y,selectAllStatus:M,indeterminateStatus:x,isSingleSelect:T}}function Al(n,t){var x,y;const e=String(Date.now()),o=50,{showCheckBox:r,showSelectAll:i}=t,s=a.ref(((x=n.rowNumber)==null?void 0:x.enable)??!1),l=a.computed(()=>n.hierarchy&&r.value&&n.selection.enableSelectRow&&n.selection.multiSelect?!1:r.value),c=a.ref(s.value?((y=n.rowNumber)==null?void 0:y.width)??32:0),f=a.ref(l.value?o:0),d=a.computed(()=>{var v;return s.value?((v=n.rowNumber)==null?void 0:v.heading)??"序号":""}),u=a.computed(()=>(l.value&&!n.hierarchy?Number(f.value):0)+(s.value?Number(c.value):0));a.watch(()=>n.rowNumber,v=>{v&&v.enable!==void 0&&(s.value=v.enable),v&&v.width!==void 0&&(c.value=v.width)});function p(v){return{top:`${v.top}px`,width:`${u.value}px`,height:`${v.height||""}px`}}const h=a.computed(()=>({width:`${u.value}px`}));function m(v){return`${e}_${v.type}_r_${v.index}_${v.refreshKey||""}`}function M(v){return`${e}_${v.type}_r_${v.index}_${v.refreshKey||""}`}return{showRowNumer:s,showSidebarCheckBox:l,sidebarCellPosition:p,sidebarCornerCellStyle:h,sidebarTitle:d,sidebarWidth:u,rowKey:M,cellKey:m}}const Hl={ascend:(n,t)=>n===t?0:n===!1?-1:1,decend:(n,t)=>n===t?0:n===!0?-1:1},Gl={ascend:(n,t)=>{const e=new Date(new Date(n).toLocaleDateString()).valueOf(),o=new Date(new Date(t).toLocaleDateString()).valueOf();return e===o?0:e<o?-1:1},decend:(n,t)=>{const e=new Date(new Date(n).toLocaleDateString()).valueOf(),o=new Date(new Date(t).toLocaleDateString()).valueOf();return e===o?0:e<o?1:-1}},zl={ascend:(n,t)=>n===t?0:n<t?-1:1,decend:(n,t)=>n===t?0:n<t?1:-1},Yl={ascend:(n,t)=>n===t?0:n<t?-1:1,decend:(n,t)=>n===t?0:n<t?1:-1};function Ul(n){const t=new Map([["boolean","boolean-sorter"],["date","datetime-sorter"],["datetime","datetime-sorter"],["number","numeric-sorter"],["string","text-sorter"],["text","text-sorter"],["enum","text-sorter"],["reference","text-sorter"]]),e=new Map([["boolean-sorter",Hl],["datetime-sorter",Gl],["numeric-sorter",zl],["text-sorter",Yl]]);function o(s){const l=(s==null?void 0:s.dataType)||"string",c=t.get(l)||"text-sorter";return e.get(c)||(s==null?void 0:s.sorter)}function r(s){return o(s.column)}function i(s,l){const c=r(s),f=(s.status&Ke.sortable)===Ke.sortable&&(s.status&Ke.sorted)===Ke.sorted,d=(s.status&Ke.ascending)===Ke.ascending,u=(s.status&Ke.descending)===Ke.descending;if(f&&c){const p=d?c.ascend:u?c.decend:void 0;p?l.addSorter(s.field,{field:s.field,compare:p}):l.removeSorter(s.field)}else l.removeSorter(s.field)}return{getSorterByColumn:o,updateSorter:i}}function Xl(n){const t="parent",e="layer",o="hasChildren",r=(i,s=1,l=[],c=null)=>(i=i||[],i.reduce((f,d)=>(d.id=d.id||d.data[n.idField],d[t]=c,d[e]=s,d[o]=!1,d.data&&Object.keys(d.data).forEach(u=>{Object.keys(d).includes(u)||(d[u]=d.data[u])}),l.push(d),d.children&&d.children.length&&(d[o]=!0,r(d.children,s+1,l,d.id)),f),l),l);return{flatTreeData:r}}function Ql(n,t,e,o,r,i,s,l,c,f,d,u,p,h,m,M,x){const{calculateCellPositionInRow:y}=i,{columnContext:v,hasLeftFixedColumn:b,hasRightFixedColumn:_}=s,{gridDataStyle:S,leftFixedGridDataStyle:T,rightFixedGridDataStyle:g}=h,{renderDataRow:V}=ui(n,t,v,x,l,c,f,d,u,p,h),F=[V];function N(k,D){const B=y(k);return x.value.filter(O=>O.visible!==!1).map((O,P)=>F[O.type](O,B,D,P))}function w(){return a.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[a.createVNode("div",{class:"fv-grid-data",style:T.value},[N(v.value.leftColumns.filter(k=>k.visible),"left")])])}function R(){return a.createVNode("div",{ref:e,class:"fv-grid-content-primary"},[a.createVNode("div",{class:"fv-grid-data",style:S.value},[N(v.value.primaryColumns.filter(k=>k.visible),"primary")])])}function L(){return a.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[a.createVNode("div",{class:"fv-grid-data",style:g.value},[N(v.value.rightColumns.filter(k=>k.visible),"right")])])}function C(){const k=[];return b.value&&k.push(w()),k.push(R()),_.value&&k.push(L()),k}return{renderDataArea:C}}const Jt=a.defineComponent({name:"FTreeGrid",props:pn,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode"],setup(n,t){var Xe,st;const o=((Xe=n.rowOption)==null?void 0:Xe.height)||28,r=a.ref(20),i=a.ref(n.columns),s=Fe.useIdentify(n),{idField:l}=s,c=a.ref(),f=a.ref(),d=a.ref(),u=a.ref(),p=a.ref(),h=a.ref([]),m=a.ref(!1),M=a.ref(((st=n.rowOption)==null?void 0:st.wrapContent)||!1),x=Fe.useGroupData(n,s),y=Fe.useFilter(),v=Fe.useHierarchy(n),{collapseField:b}=v,{showLoading:_,renderLoading:S}=Fe.useLoading(n,c),T=Fe.useDataView(n,new Map,y,v,s),{dataView:g}=T,V=Fe.useSelection(n,T,s,h,t),F=Fe.useSelectHierarchyItem(n,h,T,s,V,t),N=a.computed(()=>n.disabled),w=a.computed(()=>n.virtualized?Math.min(T.dataView.value.length,r.value):T.dataView.value.length),{containerStyleObject:R}=Fe.useDataViewContainerStyle(n),L=Fe.useCommandColumn(n),{applyCommands:C}=L;C(i);const k=Fe.useColumn(n),D=Fe.useSort(n),{applyColumnSorter:B,columnContext:O,updateColumnRenderContext:P}=k;B(T,D);const A=Fe.useGroupColumn(n,O),E=Fe.useRow(n,t,V,s),I=Fe.useEdit(n,t,s,E,h),H=Fe.useVisualDataBound(n),$=Fe.useVisualDataCell(n,I,H),W=Fe.useVisualDataRow(n,T,I,v,s,H,$),z=Fe.useVisualData(n,i,T,w,0,W),{getVisualData:X}=z,K=Fe.useCellPosition(n,O),Q=Fe.useSidebar(n,V),{sidebarWidth:de}=Q,he=Fe.useVirtualScroll(n,T,h,O,z,w,0,de),{onWheel:xe,dataGridWidth:De,viewPortHeight:Re,viewPortWidth:Y,resetScroll:ue,updateVisibleRowsOnLatestVisibleScope:G}=he,te=Fe.useFitColumn(n,O,f,Y,A),{calculateColumnsSize:ve}=te,Se=Fe.useFilterHistory(),Oe=Fe.useColumnFilter(f,p,T,Se,he),ot=Fe.useDragColumn(n,t,k,T,A,x,he),mt=a.computed(()=>({"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-grid-horizontal-bordered":n.showHorizontalLines,"fv-datagrid-strip":n.showStripe})),dt=a.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":m.value,"fv-grid-wrap-content":M.value})),{renderDataArea:J}=Ql(n,t,d,u,p,K,k,T,I,v,E,V,F,he,z,H,h),{renderGridHeader:_e,renderGridColumnResizeOverlay:Ie,shouldShowHeader:Ge}=Fe.getColumnHeader(n,t,f,u,p,k,T,ot,Oe,y,Se,te,A,V,Q,D,he,Y,h),{renderDataGridSidebar:je}=Fe.getSidebar(n,E,V,Q,he),{renderDisableMask:it}=Fe.getDisableMask(),{renderHorizontalScrollbar:ht}=Fe.getHorizontalScrollbar(n,f,he),{renderVerticalScrollbar:Ct}=Fe.getVerticalScrollbar(n,f,he);function ft(){var me,Ce,et;if(f.value&&f.value.clientHeight>0&&((me=f.value)==null?void 0:me.clientWidth)>0){const Ze=Math.ceil(f.value.clientHeight/o);Ze>r.value&&(r.value=Ze,G()),Re.value=((Ce=d.value)==null?void 0:Ce.clientHeight)||0,De.value=((et=f.value)==null?void 0:et.clientWidth)||0,ve()}}a.onMounted(()=>{f.value&&(r.value=Math.max(Math.ceil(f.value.clientHeight/o),r.value),h.value=X(0,w.value+0-1),Fn.useResizeObserver(f.value,ft),ve(),a.nextTick(()=>{f.value&&(De.value=f.value.clientWidth),d.value&&(Y.value=d.value.clientWidth,Re.value=d.value.clientHeight)})),_.value&&S()}),a.onUnmounted(()=>{}),a.watch(Y,()=>{f.value&&ve()});function Vt(me){T.collapseTo(me),T.reOrderVisibleIndex(),ue()}function xt(me){T.expandTo(me),T.reOrderVisibleIndex(),ue()}function gt(){const me=V.getSelectionRow();return me?me.dataIndex-1:-1}function Mt(){const me=gt();T.insertNewDataItem(me),h.value=X(0,w.value+0-1)}function _t(){const me=gt();T.insertNewChildDataItem(me),h.value=X(0,w.value+0-1)}function re(){const me=gt(),Ce=F.getNextSelectableHierarchyItemId(me);T.removeHierarchyDataItem(me),h.value=X(0,w.value+0-1),Ce&&V.selectItemById(Ce)}function fe(me){I.onEditingRow(me)}function ge(me){I.acceptEditingRow(me)}function Pe(me){I.cancelEditingRow(me)}function ze(me){me&&(i.value=me,C(i),P(i.value),B(T,D),ve())}function Je(me){me&&(T.load(me),T.reOrderVisibleIndex(),ue())}function U(me){V.selectItemById(me)}function pe(me){const Ce=h.value.find(et=>et.raw[s.idField.value]===me);Ce&&E.clickRowItem(Ce)}function we(me){E.activeRowById(me)}function Ne(me){V.selectItemByIds(me)}function q(){return V.getSelectedItems()}function ee(){V.clearSelection()}const oe=a.computed(()=>!h.value||!h.value.length),{renderEmpty:ne}=Fe.getEmpty(t);function be(){return V.getSelectionRow()}function ye(me){V.unSelectItemByIds(me)}function Be(){return V.currentSelectedDataId.value}function Te(me,Ce,et){const Ze=g.value.find(tt=>tt[l.value]===me);if(Ze){if(Object.keys(Ze).forEach(Qe=>{Object.prototype.hasOwnProperty.call(Ce,Qe)&&(Ze[Qe]=Ce[Qe])}),et){const{collapseField:Qe,disabledField:Nt,checkedField:It,visibleField:Et}=et;Qe&&!Ee.isUndefined(Ce[Qe])&&(Ze.__fv_collapse__=Ce[Qe]),It&&!Ee.isUndefined(Ce[It])&&(Ze.__fv_checked__=Ce[It]),Nt&&!Ee.isUndefined(Ce[Nt])&&(Ze.__fv_disabled__=Ce[Nt]),Et&&!Ee.isUndefined(Ce[Et])&&(Ze.__fv_visible__=Ce[Et])}const tt=h.value.find(Qe=>Qe.raw[l.value]===me),Wo=h.value.findIndex(Qe=>Qe.raw[l.value]===me);if(tt){if(tt.raw=Ze,Object.keys(tt.data).forEach(Qe=>{tt.data[Qe].updateData(Ze)}),et){const{collapseField:Qe,disabledField:Nt,checkedField:It,visibleField:Et}=et;Qe&&!Ee.isUndefined(Ce[Qe])&&(tt.collapse=Ce[Qe]),It&&!Ee.isUndefined(Ce[It])&&(tt.checked=Ce[It]),Nt&&!Ee.isUndefined(Ce[Nt])&&(tt.disabled=Ce[Nt]),Et&&!Ee.isUndefined(Ce[Et])&&(tt.visible=Ce[Et])}h.value=[...h.value.slice(0,Wo),tt,...h.value.slice(Wo+1)]}}}function $e(me){const Ce=T.dataView.value.find(et=>et[l.value]===me);return Ce?Ce[b.value]:""}function rt(){return b.value}return t.expose({activeRowById:we,addNewDataItem:Mt,addNewChildDataItem:_t,collapseTo:Vt,expandTo:xt,removeDataItem:re,editDataItem:fe,acceptDataItem:ge,cancelDataItem:Pe,updateColumns:ze,updateDataSource:Je,selectItemById:U,selectItemByIds:Ne,getSelectedItems:q,clearSelection:ee,getSelectionRow:be,clickRowItemById:pe,unSelectItemByIds:ye,getCurrentRowId:Be,reassignRowData:Te,getCollapseField:rt,getCollapseStatusById:$e}),()=>a.createVNode("div",{ref:c,class:mt.value,style:R.value,onWheel:xe},[f.value&&Ge.value&&_e(),a.createVNode("div",{ref:f,class:dt.value,onMouseover:()=>m.value=!0,onMouseleave:()=>m.value=!1},[f.value&&je(h),f.value&&J(),f.value&&oe.value&&ne(),f.value&&ht(),f.value&&Ct()]),Ie(),N.value&&it()])}}),Zl={id:{type:String,default:""},componentId:{type:String,default:""},type:{type:String,default:""},canDelete:{type:Boolean,default:!0},canMove:{type:Boolean,default:!0},canSelectParent:{type:Boolean,default:!0},customButtons:{type:Array,default:[]},customClass:{type:String,default:""},customStyle:{type:String,default:""},modelValue:{type:Object},ignore:{type:Boolean,default:!1},completeFormSchema:{type:Object}},Kl={id:{type:String}},Jl=a.defineComponent({name:"FDesignerPlaceholder",props:Kl,emits:[],setup(n){const t=a.computed(()=>({"drag-and-drop-alert":!0,"no-drag":!0,"w-100":!0})),e=a.computed(()=>({height:"60px",display:"flex","justify-content":"center","align-items":"center",margin:0,padding:".75rem 1.25rem",border:"1px solid transparent","border-radius":"3px",color:"#315585","background-color":"#dfedff","border-color":"#d2e6ff"}));return()=>a.createVNode("div",{class:t.value,style:e.value,role:"alert","data-noattach":"true","data-position":"0"},[a.createTextVNode("拖拽组件到这里")])}});function ec(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!a.isVNode(n)}const Cn=a.defineComponent({name:"FDesignerItem",props:Zl,emits:["selectionChange","dragEnd"],setup(n,t){const e=a.ref(`${n.modelValue.id}-component`),o=a.ref(n.canMove),r=a.ref(n.canDelete),i=a.ref(!1),s=a.ref(n.modelValue),l=a.ref(n.componentId||""),c=a.ref(""),f=a.ref(""),d=a.ref(n.customClass),u=a.ref(),p=a.inject("canvas-dragula"),h=a.ref(),m=a.inject("design-item-context"),M={designerItemElementRef:u,componentInstance:h,schema:s.value,parent:m,setupContext:t};a.provide("design-item-context",M);const x=a.inject("useFormSchema"),y=a.inject("designer-host-service"),v=a.computed(()=>{var A;const B=n.modelValue.appearance&&n.modelValue.appearance.class||"",O=((A=h.value)==null?void 0:A.getCustomButtons)&&h.value.getCustomButtons();let P={"farris-component":!0,"flex-fill":s.value.id==="root-component","position-relative":o.value&&r.value||(O==null?void 0:O.length),"farris-nested":i.value,"can-move":o.value,"d-none":u.value&&u.value.classList.contains("d-none"),dgComponentSelected:u.value&&u.value.classList.contains("dgComponentSelected"),dgComponentFocused:u.value&&u.value.classList.contains("dgComponentFocused")};return P[`farris-component-${s.value.type}`]=!0,P=ke.getCustomClass(P,B),P=ke.getCustomClass(P,f.value),P=ke.getCustomClass(P,d.value),P}),b=a.computed(()=>{const B={},O=n.modelValue.appearance&&n.modelValue.appearance.style||"";return O&&O.split(";").reduce((P,A)=>{const[E,I]=A.split(":");return P[E]=I,P},B),c.value&&c.value.split(";").reduce((P,A)=>{const[E,I]=A.split(":");return E&&(P[E]=I),P},B),B});function _(B,O){var E,I;if(B&&(B.preventDefault(),B.stopPropagation()),h.value.triggerBelongedComponentToDeleteWhenDeleted){const H=h.value.getBelongedComponentInstance(h);if(H&&H.parent){const $=a.ref(H==null?void 0:H.parent),W=$.value.contents.findIndex(z=>z.id===H.schema.id);(I=(E=$.value)==null?void 0:E.contents)==null||I.splice(W,1),zt.value++}return}h.value.onRemoveComponent(y);let P=m,A=H=>H.id===O.id;if(O.type==="component"&&(P=m==null?void 0:m.parent,A=H=>H.component===O.id),P&&P.schema.contents){const H=P.schema.contents.findIndex(A);P.schema.contents.splice(H,1),zt.value++,t.emit("selectionChange")}}function S(B){return r.value&&a.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:O=>{_(O,B)}},[a.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function T(){return o.value&&a.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[a.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function g(){var O;const B=((O=h.value)==null?void 0:O.getCustomButtons)&&h.value.getCustomButtons();return B&&!!B.length&&B.map(P=>a.createVNode("div",{role:"button",class:`btn component-settings-button ${P.class||""}`,title:P.title,ref:P.id,onClick:A=>P.onClick&&P.onClick(A)},[a.createVNode("i",{class:P.icon},null)]))}function V(B){return a.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[a.createVNode("div",null,[S(B),T(),g()])])}function F(B,O,P,A){t.emit("selectionChange",B,O,P,A)}function N(){t.emit("dragEnd")}function w(B){let O;const P=B.type,A=Wn[P],E=qn[P],I=E?E(B):{};I.customClass=n.ignore?I.customClass:"",I.componentId=l.value,I.id=B.id;const H=B.contents&&B.contents.length===0;return B.contents&&!!B.contents.length&&A?a.createVNode(A,a.mergeProps({ref:h},I),ec(O=B.contents.map(W=>a.createVNode(Cn,{key:W.id,modelValue:W,"onUpdate:modelValue":z=>W=z,componentId:l.value,onSelectionChange:F,onDragEnd:N,"complete-form-schema":n.completeFormSchema},null)))?O:{default:()=>[O]}):A?H?a.createVNode(A,a.mergeProps({ref:h},I),{default:()=>[a.createVNode(Jl,null,null)]}):a.createVNode(A,a.mergeProps({ref:h},I),null):a.createVNode("div",null,null)}function R(B){if(B.type==="component-ref"){const A=(n.completeFormSchema?n.completeFormSchema:x==null?void 0:x.getFormSchema()).module.components.find(I=>I.id===B.component),E=a.ref(A);if(A)return a.createVNode(Cn,{key:A.id,modelValue:E.value,"onUpdate:modelValue":I=>E.value=I,componentId:A.id,"complete-form-schema":n.completeFormSchema,onSelectionChange:F,onDragEnd:N},null)}}a.watch(()=>n.modelValue,B=>{s.value=B,e.value=`${B.id}-component`,a.triggerRef(u)},{deep:!0});function L(B){window.scrollContainerList||(window.scrollContainerList=new Set);const O=B.getAttribute("id");O&&window.scrollContainerList.add(O)}function C(B){const O=B==null?void 0:B.target;L(O),Ta(O)}function k(){var B,O;if(u.value){(O=(B=s.value)==null?void 0:B.contents)!=null&&O.length&&u.value.addEventListener("scroll",C);const P=u.value.querySelector(".drag-container");P&&P.addEventListener("scroll",C)}}a.onMounted(()=>{if(u.value&&h.value&&h.value.schema){const B=u.value.querySelector(`[data-dragref='${h.value.schema.id}-container']`);p&&B&&p.attachComponents(B,s.value),i.value=h.value.canNested!==void 0?h.value.canNested:i.value,r.value=h.value.canDelete!==void 0?h.value.canDelete:r.value,o.value=h.value.canMove!==void 0?h.value.canMove:o.value,c.value=h.value.styles||"",f.value=h.value.designerClass||"",u.value&&(u.value.componentInstance=h,u.value.designItemContext=M),h.value.belongedComponentId=l.value}k(),zt.value++}),a.onBeforeUnmount(()=>{u.value&&u.value.removeEventListener("scroll",C)});function D(B){B&&(B.preventDefault(),B.stopPropagation());let O=M.designerItemElementRef;const P=u.value;if(P){const A=document.getElementsByClassName("dgComponentFocused");A&&A.length===1&&A[0]===u.value||(Array.from(A).forEach(I=>I.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(I=>I.classList.remove("dgComponentSelected")),P.classList.add("dgComponentFocused"),t.emit("selectionChange",s.value.type,s.value,l.value,h.value),h.value.getDraggableDesignItemElement&&(O=h.value.getDraggableDesignItemElement(M),O&&O.value&&O.value.classList.add("dgComponentSelected")))}Pn(O==null?void 0:O.value)}return()=>s.value.type==="component-ref"?R(s.value):a.createVNode("div",{id:`${s.value.id}-design-item`,ref:u,class:v.value,style:b.value,onClick:D},[V(s.value),w(s.value)])}});function tc(n,t,e,o,r="data-grid-column"){const{columnContext:i,hasLeftFixedColumn:s,hasRightFixedColumn:l}=e,{gridHeaderColumnsStyle:c,leftFixedGridHeaderColumnsStyle:f,rightFixedGridHeaderColumnsStyle:d}=o,u=i.value.defaultColumnWidth,p=32,h=new Map([[0,0]]);function m(N,w){const R=h.get(w)||0,L={height:`${N.depth*p}px`,left:`${N.left}px`,top:`${(N.layer-1)*p}px`,width:`${N.actualWidth}px`,padding:0};return i.value.headerDepth>1&&(L["line-height"]=`${N.depth*p}px`),h.set(w+1,R+(N.actualWidth||u)),L}const M=a.computed(()=>({"fv-grid-header":!0,"fv-grid-header-group-columns":i.value.headerDepth>1})),x=a.computed(()=>({height:`${i.value.headerDepth*p}px`})),y=function(N){return t.showSetting&&!!N.showSetting};function v(){return a.createVNode("span",{class:"fv-grid-settings-icon d-flex align-items-center"},[a.createVNode("i",{class:"f-icon f-icon-home-setup"},null)])}function b(N,w,R,L){var C;(C=n==null?void 0:n.setupContext)==null||C.emit("selectionChange",N,w,R,L)}function _(N){var R,L;return"w-100 d-flex align-items-center justify-content-"+(((R=N.column)==null?void 0:R.halign)==="center"?"center":((L=N.column)==null?void 0:L.halign)==="right"?"end pr-2":"start pl-2")}function S(N,w,R){var C;const L=a.ref(N.column);return a.createVNode("div",{class:"fv-grid-header-cell",style:m(N,R)},[a.createVNode(Cn,{modelValue:L.value,"onUpdate:modelValue":k=>L.value=k,customClass:_(N),canAdd:!1,canDelete:!1,canMove:!1,key:(C=L.value)==null?void 0:C.id,type:r,componentId:t.componentId,onSelectionChange:b},null),y(N)&&v(),N.resizable&&a.createVNode("span",{class:"fv-column-resize-bar"},null)])}function T(N){return N.map((w,R)=>{const L=[];if(L.push(S(w,N,R)),w.children&&w.children.length){const C=T(w.children);L.push(...C)}return L})}function g(){return a.createVNode("div",{class:"fv-grid-header-left-fixed"},[a.createVNode("div",{class:"fv-grid-header-columns",style:f.value},[T(i.value.leftHeaderColumns)])])}function V(){return a.createVNode("div",{class:"fv-grid-header-right-fixed"},[a.createVNode("div",{class:"fv-grid-header-columns",style:d.value},[T(i.value.rightHeaderColumns)])])}function F(){return a.createVNode("div",{class:M.value,style:x.value},[s.value&&g(),a.createVNode("div",{class:"fv-grid-header-primary"},[a.createVNode("div",{class:"fv-grid-header-columns",style:c.value},[T(i.value.primaryHeaderColumns)])]),l.value&&V()])}return{renderGridHeader:F}}class nc extends Bn{constructor(t,e){super(t,e)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){var s,l,c;const e=(c=(l=(s=this.formSchemaUtils.getFormSchema())==null?void 0:s.module)==null?void 0:l.entity[0])==null?void 0:c.entities[0],o=this.assembleSchemaEntityToTree(e,0),r=this,i=super.getBasicPropConfig(t);this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{...i.properties,dataSource:{description:"绑定数据源",title:"绑定数据源",editor:{type:"combo-tree",textField:"name",valueField:"label",data:o,editable:!1},readonly:!0}},setPropertyRelates(f,d){switch(f&&f.propertyID){case"dataSource":{const u=r.formSchemaUtils.getViewModelById(r.viewModelId);if(u){const p=o.find(h=>h.label===f.propertyValue);u.bindTo=p.bindTo}r.designViewModelUtils.assembleDesignViewModel();break}}}}}getAppearanceProperties(t){var e,o;this.propertyConfig.categories.appearance={title:"外观",properties:{columns:{title:"列设置",description:"列设置",$converter:"/converter/items-count.converter",editor:{type:"grid-field-editor",viewModelId:this.viewModelId,gridData:t,gridType:"tree-grid-column"},refreshPanelAfterChanged:!0},fit:{title:"适配父组件尺寸",type:"boolean",description:"是否适配父组件尺寸",visible:!1},showStripe:{title:"显示条纹",type:"boolean",description:"是否显示条纹"},showBorder:{title:"显示边框",type:"boolean",description:"是否显示边框"}},setPropertyRelates(r,i){switch(r&&r.propertyID){case"useBlankWhenDataIsEmpty":t.emptyDataHeight=t.useBlankWhenDataIsEmpty?36:240;break;case"fields":t.fields=r.propertyValue||[];break}}},this.propertyConfig.categories.pagination={title:"分页",$converter:"/converter/pagination.converter",properties:{enable:{title:"启用分页",type:"boolean",refreshPanelAfterChanged:!0,editor:{readonly:!0}},showIndex:{visible:((e=t.pagination)==null?void 0:e.enable)||!1,title:"显示页码",type:"boolean"},showLimits:{visible:((o=t.pagination)==null?void 0:o.enable)||!1,title:"显示每页记录数",type:"boolean"}}}}getEventPropConfig(t){const e=[{label:"onSelectionChange",name:"行切换事件"},{label:"onClickRow",name:"行点击事件"}],o=this,r=o.eventsEditorUtils.formProperties(t,o.viewModelId,e),i={};i[o.viewModelId]={type:"events-editor",editor:{initialData:r}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:i,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(s,l){const c=s.propertyValue;delete t[o.viewModelId],c&&(c.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(t,o.viewModelId,c.events,c)),t.remoteSort=!!t.columnSorted}}}assembleSchemaEntityToTree(t,e,o,r="",i=[]){const s=r?`${r}/${t.label}`:"/";return i.push({id:t.id,name:t.name,label:t.label,layer:e,parent:o&&o.id,bindTo:s.replace("//","/")}),t.type.entities&&t.type.entities.length&&t.type.entities.map(l=>this.assembleSchemaEntityToTree(l,e+1,t,s,i)),i}}function oc(n,t){const e=n.schema,o=a.ref(!0),r=a.ref(!0);function i(d){return d&&d.sourceType==="control"?d.componentCategory==="input":!1}function s(){return!1}function l(){return!1}function c(){return!0}function f(d){return new nc(d,t).getPropertyConfig(e)}return{canAccepts:i,checkCanDeleteComponent:s,checkCanMoveComponent:l,hideNestedPaddingInDesginerView:c,triggerBelongedComponentToMoveWhenMoved:o,triggerBelongedComponentToDeleteWhenDeleted:r,getPropsConfig:f}}function rc(n,t,e,o,r){const{getGridHeaderCells:i}=r,s=120,l=50,c=a.computed(()=>{var g;return((g=n.rowNumber)==null?void 0:g.enable)||!1}),f=a.computed(()=>{var g,V;return((g=n.selection)==null?void 0:g.multiSelect)||((V=n.selection)==null?void 0:V.showCheckbox)||!1}),d=a.computed(()=>{var g;return 0+(c.value?((g=n.rowNumber)==null?void 0:g.width)||32:0)+(f.value?l:0)}),u=a.computed(()=>{var g;return(g=n.columnOption)==null?void 0:g.fitColumns}),p=a.computed(()=>{var g;return u.value&&((g=n.columnOption)==null?void 0:g.fitMode)||"none"});function h(g,V,F){const N=parseInt(g.width,10)/100;return F*N}function m(g,V,F){return typeof g.width=="string"?h(g,V,F):g.width||s}function M(g,V){const F=[],N=[];let w=0;g.value.primaryColumns.forEach(C=>{typeof C.width=="string"?N.push(C):(C.width=C.width||s,w+=C.width,F.push(C))});const R=V*(F.length/g.value.primaryColumns.length);F.forEach(C=>{const k=R*(C.width/w);C.actualWidth=k,g.value.primaryColumnsWidth+=C.actualWidth});const L=V-R;N.forEach(C=>{const k=h(C,g.value,L);C.actualWidth=k,g.value.primaryColumnsWidth+=C.actualWidth})}function x(g,V){const F=[],N=[],w=new WeakMap;let R=0,L=0;if(g.value.primaryColumns.forEach(k=>{if(typeof k.width=="string"){const D=h(k,g.value,V);w.set(k,D),R+=D,N.push(k)}else k.width=k.width||s,L+=k.width,F.push(k)}),V-R>L){const k=V-R;N.forEach(D=>{D.actualWidth=w.get(D)||s,g.value.primaryColumnsWidth+=D.actualWidth}),F.forEach(D=>{D.actualWidth=k*(D.width/L),g.value.primaryColumnsWidth+=D.actualWidth})}else M(g,V)}function y(g,V){g.value.primaryColumns.forEach(F=>{F.actualWidth=m(F,g.value,V),g.value.primaryColumnsWidth+=F.actualWidth})}const v={expand:x,none:y,percentage:M};function b(g){g.value.leftHeaderColumns=Array.from(i(g.value.leftColumns).values()),g.value.primaryHeaderColumns=Array.from(i(g.value.primaryColumns).values()),g.value.rightHeaderColumns=Array.from(i(g.value.rightColumns).values())}function _(g){g.value.leftColumnsWidth=0,g.value.primaryColumnsWidth=0,g.value.rightColumnsWidth=0,g.value.leftColumns.forEach(V=>{g.value.leftColumnsWidth+=V.actualWidth||0}),g.value.primaryColumns.forEach(V=>{g.value.primaryColumnsWidth+=V.actualWidth||0}),g.value.rightColumns.forEach(V=>{g.value.rightColumnsWidth+=V.actualWidth||0}),g.value=Object.assign({},g.value)}function S(g,V,F){var D;let N=0;const w=g.value.primaryColumns,R=g.value.rightColumns;g.value.rightColumns.forEach(B=>{B.actualWidth=m(B,g.value,V),N+=B.actualWidth});const L=F-N,C=v[p.value];if(C&&C(g,L),g.value.primaryColumnsWidth+N<=F)return g.value.primaryColumns=[...w,...R],g.value.primaryColumnsWidth+=N,g.value.rightColumns=[],g.value.rightColumnsWidth=0,!0;const k=new Map;return k.set("primary",[]),k.set("right",[]),g.value.primaryColumns.reduce((B,O)=>{var P,A;return O.fixed==="right"?(P=B.get("right"))==null||P.push(O):(A=B.get("primary"))==null||A.push(O),B},k),(D=k.get("right"))!=null&&D.length&&(g.value.primaryColumns=[...k.get("primary")||[]],g.value.rightColumns=[...k.get("right")||[]]),g.value.primaryColumnsWidth=0,g.value.rightColumnsWidth=0,!1}function T(){if(e.value){t.value.leftColumnsWidth=0,t.value.primaryColumnsWidth=0,t.value.rightColumnsWidth=0;const g=e.value.clientWidth-d.value;t.value.leftColumns.forEach(F=>{F.actualWidth=m(F,t.value,g),t.value.leftColumnsWidth+=F.actualWidth});const V=g-t.value.leftColumnsWidth;if(S(t,g,V))o.value=V;else{t.value.rightColumns.forEach(w=>{w.actualWidth=m(w,t.value,g),t.value.rightColumnsWidth+=w.actualWidth});const F=g-t.value.leftColumnsWidth-t.value.rightColumnsWidth,N=v[p.value];N&&N(t,F),o.value=F}b(t),t.value=Object.assign({},t.value)}}return a.watch(()=>{var g;return(g=n.columnOption)==null?void 0:g.fitColumns},(g,V)=>{g!==V&&g&&T()}),a.watch(p,(g,V)=>{g!==V&&u.value&&T()}),{calculateColumnHeaders:b,calculateColumnsSize:T,calculateColumnsWidth:_}}const ac="";function ic(n){const e={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]},o=a.ref(e);function r(){o.value={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]}}const i=a.ref(n.summary),s=a.computed(()=>{const b=i.value;return(b==null?void 0:b.groupFields)||[]});function l(){o.value.rightColumns.forEach(S=>{S.showSetting=!1}),o.value.primaryColumns.forEach(S=>{S.showSetting=!1});const b=o.value.rightColumns,_=o.value.primaryColumns;b.length>0?b[b.length-1].showSetting=!0:_.length>0&&(_[_.length-1].showSetting=!0)}function c(b){r();const _=new Map;return s.value&&s.value.reduce((S,T)=>(S.set(T,!0),S),_),b.reduce((S,T)=>(T.filter=T.filter||ac,T.fixed==="left"?(o.value.leftColumns.push(T),o.value.leftColumnsMap.set(T.field,T),o.value.leftColumnsWidth+=T.actualWidth):T.fixed==="right"?(o.value.rightColumns.push(T),o.value.rightColumnsMap.set(T.field,T),o.value.rightColumnsWidth+=T.actualWidth):(o.value.primaryColumns.push(T),o.value.primaryColumnsMap.set(T.field,T),o.value.primaryColumnsWidth+=T.actualWidth),_.has(T.field)&&o.value.summaryColumns.push(T),S),o),l(),o}c(n.columns);const f=a.computed(()=>o.value.leftColumns.length>0),d=a.computed(()=>o.value.rightColumns.length>0);function u(b,_){return _.sortable&&_.sort&&_.sort!=="none"&&b.push(_),b}function p(b,_){return b.sortOrder=b.sortOrder||0,_.sortOrder=_.sortOrder||0,b.sortOrder===_.sortOrder?0:b.sortOrder<_.sortOrder?-1:1}function h(b,_){return b.sortOrder=b.sortOrder||0,_.sortOrder=_.sortOrder||0,b.sortOrder===_.sortOrder?0:b.sortOrder<_.sortOrder?1:-1}function m(b,_){return _.filterable&&b.push(_),b}function M(){const b=[];return o.value.leftColumns.reduce(m,b),o.value.primaryColumns.reduce(m,b),o.value.rightColumns.reduce(m,b),b}function x(){const b=[];o.value.leftColumns.reduce(u,b),o.value.primaryColumns.reduce(u,b),o.value.rightColumns.reduce(u,b);const _=Math.max(...b.map(S=>S.sortOrder||0));return b.sort(h).map(S=>{const T=S.sortOrder||_+1;return S.sortOrder=T,S}).sort(p).map((S,T)=>{const g=T+1;return S.sortOrder=g,S})}function y(b,_,S){const T=b.map(g=>{const V=S.getSorterByColumn(g),F=g.sort==="asc",N=g.sort==="desc",w=F?V.ascend:N?V.decend:void 0;return{field:g.field,compare:w}});_.setSorters(T)}function v(b,_){const S=x();y(S,b,_)}return{applyColumnSorter:v,collectionFilterableColumns:M,applySortableColumns:y,collectionSortableColumns:x,columnContext:o,hasLeftFixedColumn:f,hasRightFixedColumn:d,updateColumnRenderContext:c,updateColumnSettingIcon:l}}function sc(n,t,e,o,r,i,s,l){const c=a.ref(o.value-1+r),f=a.ref(0),{renderDataRow:d}=i,u=d,p=d;function h(x){let y=d;return x.__fv_data_grid_group_row__&&(y=u),x.__fv_data_grid_group_summary__&&(y=p),y}function m(x,y,v,b){const{dataView:_}=e,S=[];if(_.value.length>0){const T=b?Date.now().toString():"";let g=x,V=0;const F=y-x+1;for(;S.length<F&&g<_.value.length;){const N=_.value[g],w=_.value[g-1]||v,R=S[V-1],L=w?(w.__fv_data_position__||0)+(w.__fv_data_height__||0):0,k=h(N)(N,w,R,g,L,t.value,S);k.refreshKey=T,S.push(k),V++,g++}}return f.value=S.length>0?S[0].index:0,c.value=S.length>0?S[S.length-1].index:0,S}function M(x,y,v){const b=y.groupField||"",{groupValue:_}=y;e[x](b,_);const{dataView:S}=e,T=v[0].index,g=Math.min(T+o.value+r+1,S.value.length-1);return m(T,g)}return{getVisualData:m,maxVisibleRowIndex:c,minVisibleRowIndex:f,toggleGroupRow:M}}const lc=a.defineComponent({name:"FTreeGridDesign",props:Qn,emits:[],setup(n,t){var te,ve;const e=a.ref(),o=0,r=((te=n.rowOption)==null?void 0:te.height)||28,i=a.ref(20),s=a.ref(n.columns),l=$l(n),c=a.ref(),f=a.ref(),d=a.ref([]),u=a.ref(!1),p=a.ref(((ve=n.rowOption)==null?void 0:ve.wrapContent)||!1),h=a.inject("designer-host-service"),m=a.inject("design-item-context"),M=oc(m,h),x=un(e,m,M);x.value.designerClass="f-utils-fill-flex-column";const y=kl(),v=Vl(n),b=vi(n,new Map,y,v,l),_=ql(n,b,l,d,t),S=a.computed(()=>b.dataView.value.length),{containerStyleObject:T}=pi(n),g=mi(n),{applyCommands:V}=g;V(s);const F=ic(n),{applyColumnSorter:N,columnContext:w,updateColumnRenderContext:R}=F,L=Ul(),C=hi(n,w),k=Wl(n,t,_,l),D=Ll(n,t,l,k),B=Nl(n),O=jl(n,D,B),P=Rl(n,b,D,v,l,B,O),A=sc(n,s,b,S,o,P),{getVisualData:E}=A,I=Al(n,_),{sidebarWidth:H}=I;d.value=E(0,S.value+o-1);const $=Ml(n,b,d,w,A,S,o,H),{onWheel:W,dataGridWidth:z,viewPortHeight:X,viewPortWidth:K,updateVisibleRowsOnLatestVisibleScope:Q}=$,de=rc(n,w,c,K,C),{calculateColumnsSize:he}=de,xe=a.computed(()=>({"drag-container":!0,"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-datagrid-strip":n.showStripe})),De=a.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":u.value,"fv-grid-wrap-content":p.value})),{renderGridHeader:Re}=tc(m,n,F,$,"tree-grid-column"),{renderHorizontalScrollbar:Y}=di(n,c,$);function ue(){var Oe,ot;const Se=Math.ceil(c.value.clientHeight/r);Se>i.value&&(i.value=Se,Q()),X.value=((Oe=f.value)==null?void 0:Oe.clientHeight)||0,z.value=((ot=c.value)==null?void 0:ot.clientWidth)||0,he()}a.onMounted(()=>{e.value.componentInstance=x,c.value&&(i.value=Math.max(Math.ceil(c.value.clientHeight/r),i.value),d.value=E(0,S.value+o-1),Fn.useResizeObserver(c.value,ue),he(),a.nextTick(()=>{c.value&&(z.value=c.value.clientWidth),f.value&&(K.value=f.value.clientWidth,X.value=f.value.clientHeight)}))});function G(Se){Se&&(s.value=Se,V(s),R(s.value),N(b,L),he())}return a.watch(()=>n.columns,Se=>{G(Se)}),a.watch(K,()=>{c.value&&he()}),t.expose(x.value),()=>a.createVNode("div",{ref:e,class:xe.value,style:T.value,onWheel:W,dragref:`${m.schema.id}-container`},[c.value&&Re(),a.createVNode("div",{ref:c,class:De.value,onMouseover:()=>{u.value=!0},onMouseleave:()=>{u.value=!1}},[Y()])])}});Jt.register=(n,t,e,o)=>{n["tree-grid"]=Jt,t["tree-grid"]=ei,o["tree-grid"]={bindingResolver:ni,selectionItemResolver:ti,updateColumnsResolver:ri}},Jt.registerDesigner=(n,t,e)=>{n["tree-grid"]=lc,t["tree-grid"]=oi},ke.withInstall(Jt);const cc=new Map([["appearance",rn]]);function uc(n,t,e){return t}Ot({direction:{type:String,default:"horizontal"},fill:{type:Boolean,default:!1},height:{type:Number,default:0},clickable:{type:Boolean,default:!0},steps:{type:Array,default:[{id:"1",title:"审批中(示例)",description:"正在审批"},{id:"2",title:"复核中(示例)",description:"等待复核"}]},activeIndex:{type:Number,default:0},onClick:{type:Function,default:()=>{}}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/step.schema.json",title:"step",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for step",type:"string"},type:{description:"The type string of step",type:"string",default:"step"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},cc,uc,{title:"step",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}});const dc={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60}};class Ue{constructor(t,e){this.x=t,this.y=e}static getTransformInfo(t){const o=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),i=parseInt(o[5],10);return{x:r,y:i}}return{x:0,y:0}}static fromEvent(t,e=null){if(this.isMouseEvent(t))return new Ue(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new Ue(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let o=0;o<t.changedTouches.length;o++)if(t.changedTouches[o].target===e)return new Ue(t.changedTouches[o].clientX,t.changedTouches[o].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const e=new Ue(0,0);if(window){const o=window.getComputedStyle(t);if(o){const r=parseInt(o.getPropertyValue("left"),10),i=parseInt(o.getPropertyValue("top"),10);e.x=isNaN(r)?0:r,e.y=isNaN(i)?0:i}return e}return null}static copy(t){return new Ue(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class kt{constructor(t,e){this.width=t,this.height=e}static getCurrent(t){const e=new kt(0,0);if(window){const o=window.getComputedStyle(t);return o&&(e.width=parseInt(o.getPropertyValue("width"),10),e.height=parseInt(o.getPropertyValue("height"),10)),e}return null}static copy(t){return new kt(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function fc(n,t){const e=a.ref(),o=a.ref(),r=a.ref(),i=a.ref(),s=a.ref(),l=a.ref(),c=a.ref(),f=a.ref(),d=a.ref(),u=a.ref(),p=a.ref(),h=a.ref(n.resizeable),m=a.ref(),M=a.ref(n.draggable),x=a.ref(!1);function y(){const O=o.value||document.body,P=window.getComputedStyle(O);if(!P||!e.value)return;const A=Ue.getTransformInfo(e.value),E={};c.value&&(E.deltaL=e.value.offsetLeft-c.value.x,E.deltaT=e.value.offsetTop-c.value.y);const I=P.getPropertyValue("position");E.width=O.clientWidth,E.height=O.clientHeight,E.pr=parseInt(P.getPropertyValue("padding-right"),10),E.pb=parseInt(P.getPropertyValue("padding-bottom"),10),E.position=P.getPropertyValue("position"),I==="static"&&(O.style.position="relative"),E.translateX=A.x,E.translateY=A.y,u.value=E}function v(O){if(e.value){i.value=kt.getCurrent(e.value),s.value=Ue.getCurrent(e.value),l.value=i.value?kt.copy(i.value):null,c.value=s.value?Ue.copy(s.value):null,y();const P=O.target.getAttribute("type")||"";f.value={n:!!P.match(/n/),s:!!P.match(/s/),w:!!P.match(/w/),e:!!P.match(/e/)}}}function b(){var O,P,A,E;if(e.value){const I=e.value;f.value&&((f.value.n||f.value.s)&&((O=l.value)!=null&&O.height)&&(I.style.height=l.value.height+"px"),(f.value.w||f.value.e)&&((P=l.value)!=null&&P.width)&&(I.style.width=l.value.width+"px"),c.value&&((A=c.value)!=null&&A.x&&(I.style.left=c.value.x+"px"),(E=c.value)!=null&&E.y&&(I.style.top=c.value.y+"px")))}}function _(){const O=n.minHeight?n.minHeight:1,P=n.minWidth?n.minWidth:1;l.value&&c.value&&f.value&&i.value&&(l.value.height<O&&(l.value.height=O,f.value.n&&s.value&&(c.value.y=s.value.y+(i.value.height-O))),l.value.width<P&&(l.value.width=P,f.value.w&&s.value&&(c.value.x=s.value.x+(i.value.width-P))),n.maxHeight&&l.value.height>n.maxHeight&&(l.value.height=n.maxHeight,s.value&&f.value.n&&(c.value.y=s.value.y+(i.value.height-n.maxHeight))),n.maxWidth&&l.value.width>n.maxWidth&&(l.value.width=n.maxWidth,f.value.w&&s.value&&(c.value.x=s.value.x+(i.value.width-n.maxWidth))))}function S(){if(o.value){const O=u.value;if(c.value&&l.value&&f.value&&i.value){const P=O.width-O.pr-O.deltaL-O.translateX-c.value.x,A=O.height-O.pb-O.deltaT-O.translateY-c.value.y;f.value.n&&c.value.y+O.translateY<0&&s.value&&(c.value.y=-O.translateY,l.value.height=i.value.height+s.value.y+O.translateY),f.value.w&&c.value.x+O.translateX<0&&s.value&&(c.value.x=-O.translateX,l.value.width=i.value.width+s.value.x+O.translateX),l.value.width>P&&(l.value.width=P),l.value.height>A&&(l.value.height=A)}}}function T(O){if(!r.value||!i.value||!s.value||!f.value)return;O.subtract(r.value);const P=O.x,A=O.y;f.value.n?(c.value.y=s.value.y+A,l.value.height=i.value.height-A):f.value.s&&(l.value.height=i.value.height+A),f.value.e?l.value.width=i.value.width+P:f.value.w&&(l.value.width=i.value.width-P,c.value.x=s.value.x+P),S(),_(),b()}function g(O){if(!d.value)return;const P=Ue.fromEvent(O);P&&T(P)}function V(){if(e.value){const{width:O,height:P,x:A,y:E}=e.value.getBoundingClientRect(),I=Ue.getTransformInfo(e.value);return{size:{width:O,height:P},position:{x:A-I.x,y:E-I.y}}}return null}function F(O){if(e.value){const P=V();p.value=P}r.value=void 0,i.value=null,s.value=null,l.value=null,c.value=null,f.value=null,d.value=null,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",F)}function N(){document.addEventListener("mousemove",g),document.addEventListener("mouseup",F)}function w(O){O instanceof MouseEvent&&O.button===2||M.value&&(document.body.click(),O.stopPropagation(),O.preventDefault(),r.value=Ue.fromEvent(O),d.value=O.target,v(O),N())}function R(O){return e.value=O,h.value&&a.createVNode(a.Fragment,null,[a.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:P=>w(P)},null)])}function L(O=!0){document.body.click();const P=o.value||document.body,A=kt.getCurrent(P),E=e.value;O&&E&&(m.value=V(),m.value.transform=E.style.transform),A&&E&&(l.value=A,l.value.height-=14,l.value.width-=14,E.style.height=l.value.height+"px",E.style.width=l.value.width+"px",E.style.left="7px",E.style.top="7px",E.style.transform="",p.value={size:l.value,position:{x:0,y:0}},M.value=!1,x.value=!0)}function C(){var O,P;if(document.body.click(),m.value){const A={width:m.value.size.width||0,height:m.value.size.height||0},E={x:(window.innerWidth-A.width)/2,y:(window.innerHeight-A.height)/2};(O=l.value)==null||O.set(A),(P=c.value)==null||P.set(E);const I=e.value;I.style.height=A.height+"px",I.style.width=A.width+"px",I.style.left=`${E.x}px`,I.style.top=`${E.y}px`,I.style.transform="",p.value={size:A,position:E},M.value=n.draggable,x.value=!1}}function k(){if(e.value){const O=kt.getCurrent(e.value);if(O){const{width:P,height:A}=O;e.value.style.left=`${(window.innerWidth-P)/2}px`,e.value.style.top=`${(window.innerHeight-A)/2}px`,e.value.style.transform=""}}}function D(){const O=()=>{x.value?L(!1):k(),document.body.click()};return window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)}}const B=D();return{renderResizeBar:R,boundingElement:o,resizedEventParam:p,maximize:L,restore:C,allowDrag:M,isMaximized:x,unWindowResizeHandle:B}}function pc(n,t,e){const o=a.ref(),r=a.ref(n.draggable),i=a.ref(n.lockAxis),s=a.ref(),l=a.ref(),c=a.ref(!1),f=a.ref(new Ue(0,0)),d=a.ref(new Ue(0,0)),u=a.ref(new Ue(0,0)),p=a.ref(new Ue(0,0));a.watch(()=>e.value,g=>{s.value.style.cursor=g?"move":"default"});function h(g,V){if(V.tagName==="BUTTON")return!1;if(V===g)return!0;for(const F in V.children)if(Object.prototype.hasOwnProperty.call(V.children,F)&&h(g,V.children[F]))return!0;return!1}function m(){var N,w;let g=u.value.x+d.value.x,V=u.value.y+d.value.y;i.value==="x"?(g=((N=f.value)==null?void 0:N.x)||0,u.value.x=0):i.value==="y"&&(V=((w=f.value)==null?void 0:w.y)||0,u.value.y=0);const F=`translate3d(${Math.round(g)}px, ${Math.round(V)}px, 0px)`;o.value&&(o.value.style.transform=F),p.value.x=g,p.value.y=V}function M(){if(!l.value||!o.value)return null;const g=l.value.getBoundingClientRect(),V=o.value.getBoundingClientRect(),F={top:g.top<V.top,right:g.right>V.right,bottom:g.bottom>V.bottom,left:g.left<V.left};return F.top||(u.value.y-=V.top-g.top),F.bottom||(u.value.y-=V.bottom-g.bottom),F.right||(u.value.x-=V.right-g.right),F.left||(u.value.x-=V.left-g.left),m(),F}function x(g){g&&(f.value&&g.subtract(f.value),u.value.set(g),m(),M())}function y(g){c.value&&r.value&&(g.stopPropagation(),g.preventDefault(),x(Ue.fromEvent(g,s.value)))}function v(){var g;c.value&&(c.value=!1,d.value.add(u.value),u.value.reset(),(g=o.value)==null||g.classList.remove("ng-dragging"),t.emit("stopMove"),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v))}function b(){!c.value&&s.value&&(c.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",y),document.addEventListener("mouseup",v))}function _(){if(o.value){const g=Ue.getTransformInfo(o.value);d.value.set(g);return}d.value.reset()}function S(g){if(!e.value||g instanceof MouseEvent&&g.button===2)return;const V=g.target||g.srcElement;s.value!==void 0&&V&&!h(V,s.value)||r.value!==!1&&(document.body.click(),g.stopPropagation(),g.preventDefault(),f.value=Ue.fromEvent(g,o.value),_(),b())}function T(g,V,F){if(r.value&&V){if(g)s.value=g;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const N=V.querySelector(n.dragHandle);N&&(s.value=N)}}o.value=V,l.value=F,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",S)):r.value=!1}}return{registerDraggle:T,resetTranslate:_}}function Do(n,t){if(n){const e=o=>{o.key.toLowerCase()===n.toLowerCase()&&t({event:o,key:n})};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}}function mc(n,t){const e=a.ref(n.enableEsc);let o=null;return e.value?(o=Do("Escape",r=>{t.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function hc(n,t){const e=a.ref(n.enableEnter);let o=null;return e.value?(o=Do("Enter",r=>{t.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const Ht=a.defineComponent({name:"FModal",props:dc,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(n,t){const e=a.ref(n.width||300),o=a.ref(n.height||200),r=a.ref(n.modelValue),i=a.ref(""),s=a.ref(n.class),l=a.ref(n.fitContent),c=a.ref(n.showHeader),f=a.ref(""),d=a.ref(n.showCloseButton),u=a.ref(n.showMaxButton),p=a.ref(!1),h=a.ref(n.dialogType),m=a.ref(n.src),M=a.ref(""),x=a.ref(n.showButtons),y=a.ref(n.title),v=a.ref(n.containment||null),b=a.ref(),_=a.ref(!1);function S(J,_e){Promise.resolve().then(()=>{var Ie;return(Ie=n.beforeClose)==null?void 0:Ie.call(n)}).then(Ie=>{Ie&&(r.value=!1,t.emit("update:modelValue",!1),_e!=null&&t.emit(_e?"accept":"cancel"),t.emit("closed",J))})}const T=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:J=>{S(J,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:J=>{S(J,!0)}}],g=a.ref(n.buttons&&n.buttons.length?n.buttons:T),V=a.computed(()=>!!f.value),F=a.computed(()=>!!x.value&&!!g.value),N=a.ref(),w=a.ref(),R=a.ref(!1),{renderResizeBar:L,maximize:C,restore:k,boundingElement:D,resizedEventParam:B,allowDrag:O,unWindowResizeHandle:P}=fc(n),{registerDraggle:A}=pc(n,t,O);function E(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function I(){const J=document.querySelectorAll(".farris-modal").length;(!J||J-1<=0)&&document.body.classList.remove("modal-open"),b.value&&b.value.classList.remove("show")}a.watch(()=>n.title,(J,_e)=>{J!==_e&&(y.value=J)}),a.watch(()=>n.modelValue,(J,_e)=>{J!==_e&&(r.value=J,r.value&&n.draggable&&a.nextTick(()=>{w.value&&!v.value&&(v.value=w.value.parentElement,D.value=v.value,A(N.value,w.value,D.value))}),J||(v.value&&(v.value=null),I())),r.value&&(_.value=E())}),a.watch(()=>n.showHeader,(J,_e)=>{J!==_e&&(c.value=J)}),a.watch(()=>n.showButtons,(J,_e)=>{J!==_e&&(x.value=J)}),a.watch(()=>B.value,(J,_e)=>{const Ie=J||{},Ge=_e||{};JSON.stringify(Ie)!==JSON.stringify(Ge)&&t.emit("resize",{newSize:J,oldSize:_e,isMaximized:R.value})});const H=a.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),$=a.computed(()=>{var Ie;const J={modal:!0,"farris-modal":!0,fade:!0};J["f-modal-fitContent"]=!!l.value,J.show=!!H.value;const _e=(Ie=n.maskClass)==null?void 0:Ie.split(" ");return _e==null||_e.reduce((Ge,je)=>(Ge[je]=!0,Ge),J),J}),W=a.computed(()=>{var Ie;const J={"modal-dialog":!0},_e=(Ie=s.value)==null?void 0:Ie.split(" ");return _e==null||_e.reduce((Ge,je)=>(Ge[je]=!0,Ge),J),J}),z=a.computed(()=>{const J={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-e.value)/2}px`,width:`${e.value}px`,height:l.value?"auto":`${o.value}px`};return n.mask||(J.pointerEvents="auto"),J}),X=a.computed(()=>{const J={display:"block"};return n.mask||(J.pointerEvents="none",J.backgroundColor="transparent"),_.value&&(J.backgroundColor="transparent"),J}),K=a.computed(()=>({"modal-content":!0,"modal-content-has-header":c.value})),Q=a.computed(()=>{const J={display:c.value?"":"none"};return J["pointer-events"]=O.value?"auto":"none",J}),de=a.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:R.value})),he=a.computed(()=>({"modal-body":!0,"f-utils-flex-column":h.value==="iframe","f-utils-fill":!0}));function xe(){return{height:`${n.footerHeight||60}px`}}const De=a.computed(()=>{const J={textAlgin:M.value},_e=xe();return Object.assign(J,_e)});function Re(J){if(J.stopPropagation(),R.value){R.value=!1,k();return}C(),R.value=!0}async function Y(J,_e){J.handle&&await J.handle(_e,J)&&t.emit("closed",_e)}function ue(J){J.width&&(e.value=J.width),J.height&&(o.value=J.height),J.buttons&&(g.value=J.buttons),J.title&&(y.value=J.title)}let G=null,te=null;a.onBeforeMount(()=>{_.value=E()}),a.onMounted(()=>{w.value&&!v.value&&(v.value=w.value.parentElement,D.value=v.value,A(N.value,w.value,D.value)),H.value&&document.body.classList.add("modal-open"),G=mc(n,t),te=hc(n,t)}),a.onUnmounted(()=>{P&&P(),G&&G.remove(),te&&te.remove()}),t.expose({modalElementRef:w,updateModalOptions:ue,close:S,maxDialog:Re,isMaximized:R});function ve(){return a.createVNode("ul",null,[p.value&&a.createVNode("li",{class:"f-btn-icon f-bare"},[a.createVNode("span",{class:"f-icon modal_minimize"},null)]),u.value&&a.createVNode("li",{onClick:Re,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[a.createVNode("span",{class:de.value},null)]),d.value&&a.createVNode("li",{class:"f-btn-icon f-bare",onClick:J=>S(J,!1),style:"pointer-events: auto;"},[a.createVNode("span",{class:"f-icon modal_close"},null)])])}function Se(){return a.createVNode("div",{class:"modal-footer",style:De.value},[g.value&&g.value.map(J=>{const _e=a.ref(J.disabled);return a.createVNode("button",{name:J.name,type:"button",disabled:_e.value,class:J.class+(J.iconClass?" btn-icontext":""),onClick:Ie=>{Y(J,Ie)}},[!!J.iconClass&&a.createVNode("i",{class:J.iconClass},null),J.text])})])}function Oe(){return a.createVNode("div",{ref:N,class:"modal-header",style:Q.value},[t.slots.headerTemplate?t.slots.headerTemplate():a.createVNode("div",{class:"modal-title"},[V.value&&a.createVNode("span",{class:f.value,style:"margin-right: 8px"},null),a.createVNode("span",{class:"modal-title-label"},[y.value])]),a.createVNode("div",{class:"actions"},[ve()])])}function ot(){return t.slots.footerTemplate?t.slots.footerTemplate():F.value&&Se()}function mt(J){if(J.stopPropagation(),n.allowClickMaskToClose){if(J.target!==b.value)return;S(J,!1)}}function dt(){var J,_e;return a.createVNode("div",{id:i.value,class:W.value,style:z.value,ref:w},[a.createVNode("div",{class:K.value},[c.value&&Oe(),a.createVNode("div",{class:he.value},[(_e=(J=t.slots).default)==null?void 0:_e.call(J),h.value==="iframe"&&a.createVNode("iframe",{title:i.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:m.value},null)]),ot()]),!l.value&&w.value&&!R.value&&L(w.value)])}return()=>a.createVNode(a.Teleport,{to:"body"},{default:()=>[H.value&&a.createVNode(a.Transition,{name:"fade",appear:!0},{default:()=>[a.createVNode("div",{ref:b,class:$.value,style:X.value,onClick:mt},[dt()])]})]})}});function Po(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function gc(n){const t=document.createElement("div");t.style.display="contents";const e=a.createApp({setup(o,r){a.onUnmounted(()=>{document.body.removeChild(t)});const i=a.ref(),s=a.ref(n.class||""),l=a.ref(!!n.showButtons),c=a.ref(!!n.showHeader),f=a.ref(n.showCloseButton==null?!0:n.showCloseButton),d=a.ref(!0),u=a.ref(n.title||""),p=n.acceptCallback||(()=>{}),h=n.rejectCallback||(()=>{}),m=n.closedCallback||(b=>{}),M=n.resizeHandle||(b=>{}),x=n.stopMoveHandle||(b=>{}),y=Po(n),v=b=>{d.value=!1,e.unmount(),m(b)};return a.onMounted(()=>{}),r.expose({modalRef:i}),()=>a.createVNode(Ht,{ref:i,class:s.value,modelValue:d.value,"onUpdate:modelValue":b=>d.value=b,title:u.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":c.value,"show-buttons":l.value,"show-close-button":f.value,"show-max-button":!1,onAccept:p,onCancel:h,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:v,onResize:M,onStopMove:x},{default:()=>[y&&y(e)]})}});return document.body.appendChild(t),e.mount(t),e}class Bo{constructor(t){j(this,"appContext",null);j(this,"modalRef",a.ref());j(this,"activeModalIndex",a.ref(0));j(this,"modalRefs",{});j(this,"isUseEscCloseModal",a.ref(!1));j(this,"activeModalInstance",a.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(t,e){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<t&&(t=o-14),r<e&&(e=r-14),{width:t,height:e}}static show(t){const e=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return gc(e)}close(t){var e,o;t?(o=t.value)==null||o.close():(e=this.getCurrentModal())==null||e.close()}open(t){const e=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const o=a.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),r=a.ref(!0),i=o.value.acceptCallback||(()=>{}),s=o.value.rejectCallback||(()=>{}),l=o.value.closedCallback||((S,T)=>{}),c=o.value.resizeHandle||(S=>{}),f=t.stopMoveHandle||(S=>{});let d;const u=Po(o.value),p=S=>{var g;r.value=!1;const T=(g=S==null?void 0:S.target)==null?void 0:g.classList.contains("modal_close");l(S,this.isUseEscCloseModal.value?"esc":T?"icon":"button")},h=S=>{p(S),d&&a.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],a.render(null,e),d=null,this.modalRef.value=null,this.modalRefs){const T=Object.keys(this.modalRefs).map(g=>Number(g));T.length>0?this.activeModalIndex.value=Math.max(...T):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},m=S=>{var T;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((T=this.activeModalInstance.value)==null||T.close(S==null?void 0:S.event))},{width:M,height:x}=o.value,y=this.adaptToWindow(M||500,x||320);Object.assign(o.value,y);const v=()=>a.createVNode(Ht,a.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":S=>r.value=S},o.value,{onAccept:i,onCancel:s,onClosed:h,onResize:c,onEsc:m,onStopMove:f}),{default:()=>[u&&u(this.app)]});return d=(S=>{const T=a.h(v,S);return T.appContext=this.appContext,a.render(T,e),T})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:S=>{o.value={...o.value,...S},d&&a.render(a.cloneVNode(d,{...o}),e)},destroy:h,modalRef:this.activeModalInstance,close:this.close}}}const yc=Symbol("FModalService");Ht.install=n=>{n.component(Ht.name,Ht);const t=new Bo(n);n.provide(yc,t),n.provide("FModalService",t)};var jo=(n=>(n.SimpleField="SimpleField",n.ComplexField="ComplexField",n))(jo||{});function vc(n,t,e){function o(){const s=e.componentId;if(!s)return!1;const l=n.formSchemaUtils.getViewModelIdByComponentId(s);if(!l)return!1;const{schema:c}=t,{designViewModelUtils:f}=n,d=f.getDgViewModel(l),u=d==null?void 0:d.fields.find(p=>p.id===c.binding.field);return!(!u||u.$type!==jo.SimpleField)}function r(){const{schema:s}=t;return!!n.formSchemaUtils.getVariableById(s.binding.field)}function i(){var c;const{schema:s}=t;let l=!0;if(!n||!((c=s.binding)!=null&&c.field))return l;switch(s.binding.type){case dn.Form:{l=o();break}case dn.Variable:l=r()}return l}return{checkBindingFieldValidation:i}}const bc=a.defineComponent({name:"FDynamicFormGroupDesign",props:Dt,emits:["change","update:modelValue"],setup(n,t){var b;const e=a.ref(n.id),o=a.ref(n.customClass),r=a.ref(n.editor),i=a.ref(n.label),s=a.ref(n.modelValue),l=a.ref(!0),c=a.ref(((b=n.editor)==null?void 0:b.required)===!0),f=a.ref(n.showLabel);a.ref(n.type);const d=a.ref(),u=a.inject("designer-host-service"),p=a.inject("design-item-context"),{resolveEditorProps:h,resolveEditorType:m}=za(),M=a.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":l.value,"form-group-in-canvas":!0})),x=a.computed(()=>{const _=r.value.type||"input-group",S=m(_),T=h(_,r.value);return()=>a.createVNode(S,a.mergeProps({ref:d},T,{modelValue:s.value,"onUpdate:modelValue":g=>s.value=g}),null)});a.watch([()=>n.id,()=>n.customClass,()=>n.editor,()=>n.label,()=>n.modelValue,()=>n.readonly,()=>n.showLabel],([_,S,T,g,V,F,N])=>{var w;e.value=_,o.value=S,r.value={...T},i.value=g,s.value=V,l.value=F,c.value=((w=r.value)==null?void 0:w.required)===!0,f.value=N},{deep:!0});const{checkBindingFieldValidation:y}=vc(u,p,n);function v(){const _=y();return a.createVNode(Rn,{id:`${e.value}-lable`,required:c.value,text:i.value,title:i.value,valid:_,inValidTip:"绑定信息已失效,请切换绑定或移除控件"},null)}return t.expose({editorRef:d}),()=>a.createVNode("div",{id:`${e.value}-input-group`,class:o.value},[a.createVNode("div",{class:"farris-group-wrap"},[a.createVNode("div",{class:M.value},[f.value&&v(),a.createVNode("div",{class:"farris-input-wrap"},[x.value()])])])])}});function wc(n,t){function e(){return!0}function o(){return!0}function r(){return!1}function i(){return!0}function s(d){var x;const u=t==null?void 0:t.designViewModelUtils,p=t==null?void 0:t.formSchemaUtils,h=(x=n==null?void 0:n.componentInstance.value)==null?void 0:x.belongedComponentId;if(!h||!u||!p)return;const m=p.getViewModelIdByComponentId(h),M=u.getDgViewModel(m);M&&M.removeField([d])}function l(d){const u=t==null?void 0:t.formSchemaUtils;if(u.getExpressions().length){const p=u.getExpressions().findIndex(h=>h.target===d);p>-1&&u.getExpressions().splice(p,1)}}function c(){var u,p;const d=(u=n==null?void 0:n.parent)==null?void 0:u.componentInstance.value;((p=d==null?void 0:d.schema)==null?void 0:p.type)===Tt.DgControl["response-layout-item"].type&&(d!=null&&d.schema.appearance.class)&&(d.schema.appearance.class=d.schema.appearance.class.replace("f-form-layout",""),d.schema.appearance.class=d.schema.appearance.class.replace("farris-form",""),d.schema.appearance.class=d.schema.appearance.class.replace("farris-form-controls-inline",""),d.schema.appearance.class=d.schema.appearance.class.replace("farris-form-auto",""),d.schema.appearance.class=d.schema.appearance.class.trim().replace(" "," "))}function f(){const{schema:d}=n,u=d.binding&&d.binding.field;u&&(s(u),l(u),c())}return{canAccepts:r,checkCanDeleteComponent:o,checkCanMoveComponent:e,hideNestedPaddingInDesginerView:i,onRemoveComponent:f}}const Cc=a.defineComponent({name:"FFormGroupDesign",props:Dt,emits:[],setup(n,t){const e=a.ref(),o=a.inject("design-item-context"),r=a.inject("designer-host-service"),i=wc(o,r),s=un(e,o,i);return a.onMounted(()=>{e.value.componentInstance=s,s.value.getPropConfig=(...l)=>{var f,d,u;let c=In[n.editor.type];return c&&Object.keys(c).length===0&&((f=e.value)!=null&&f.editorRef)&&((u=(d=e.value)==null?void 0:d.editorRef)!=null&&u.getPropConfig)&&(c=e.value.editorRef.getPropConfig(...l,s.value)),c}}),t.expose(s.value),()=>a.createVNode(bc,a.mergeProps(n,{ref:e}),null)}}),Ro={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},xc=Ot(Ro,En,an,void 0),Lo=a.defineComponent({name:"FDynamicFormInput",props:Ro,emits:["change","update:modelValue","mousedown","mouseup"],setup(n,t){const e=a.ref(n.id),o=a.ref(n.editor),r=a.ref(n.modelValue),{resolveEditorProps:i,resolveEditorType:s,getChangeFunctionName:l,getMousedownFunctionName:c,getMouseupFunctionName:f}=$n();function d(m,M){r.value=M!==void 0?M:m,t.emit("update:modelValue",r.value),t.emit("change",r.value)}function u(m){t.emit("mousedown",m)}function p(m){t.emit("mouseup",m)}const h=a.computed(()=>{const m=s(o.value.type),M=i(o.value.type,o.value);M.focusOnCreated=n.focusOnCreated,M.selectOnCreated=n.selectOnCreated;const x=l(o.value.type);M[x]=d;const y=c(o.value.type);M[y]=u;const v=f(o.value.type);return M[v]=p,(M.id==null||M.id==="")&&(M.id=e.value),()=>a.createVNode(m,a.mergeProps(M,{modelValue:r.value,"onUpdate:modelValue":b=>r.value=b}),null)});return a.watch([()=>n.id,()=>n.editor,()=>n.modelValue],([m,M,x])=>{e.value=m,o.value=M,r.value=x}),()=>h.value()}}),_c={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/grid-field-editor.schema.json",title:"response-form-layout-setting",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"response-form-layout-setting"},initialState:{description:"",type:"object"}},required:["id","type"]},$o={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}},Tc=tn.createPropsResolver($o,_c,fa,ga),Fc={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function xn(){return new DOMException("The request is not allowed","NotAllowedError")}async function Sc(n){if(!navigator.clipboard)throw xn();return navigator.clipboard.writeText(n)}async function kc(n){const t=document.createElement("span");t.textContent=n,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const e=window.getSelection(),o=window.document.createRange();e==null||e.removeAllRanges(),o.selectNode(t),e==null||e.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{e==null||e.removeAllRanges(),window.document.body.removeChild(t)}if(!r)throw xn()}async function Vc(n){try{await Sc(n)}catch(t){try{await kc(n)}catch(e){throw e||t||xn()}}}function Mc(){async function n(t){await Vc(t)}return{onCopy:n}}function Nc(n,t,e,o){const r=a.ref(14),i=a.ref(140),s=a.ref(""),l=a.ref(o.value.length),c=a.computed(()=>o.value),f=a.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function d(u){if(u.currentTarget){const p=u.currentTarget.value||"";l.value=p.length}}return()=>a.createVNode(a.Fragment,null,[a.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:f.value,rows:"4",maxlength:i.value,onInput:u=>d(u)},[c.value]),a.createVNode("span",{class:"textarea-wordcount",title:s.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[l.value+" / "+i.value])])}function Ic(n,t,e,o){const r=Nc(n,t,e,o),i=new Map([["text-area",r]]);function s(l){return i.get(l)||null}return{getEditorRender:s}}function Ec(){const n=a.ref(!1),t=a.ref("复制成功");return{feedbackStyle:a.computed(()=>{const o={position:"absolute",left:"50%",top:"50%",width:"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease"};return o.opacity=n.value?"0.8":"0",o.display=n.value?"":"none",o}),feedbackMessage:t,toShowFeedback:n}}function Oc(n,t){const e=t.getEditorRender(n.promptEditorType);return()=>e&&e()}function Dc(n){const t=a.computed(()=>!!n.value&&!!n.value.date),e=a.computed(()=>`发生时间 : ${n.value&&n.value.date||""}`),o=a.computed(()=>!!n.value&&!!n.value.detail),r=a.computed(()=>"详细信息 : "+(n.value&&n.value.detail||"")),i="exp_switch_"+new Date().getTime();return()=>a.createVNode("div",{class:"toast-msg-detail"},[t.value&&a.createVNode("div",null,[e.value]),o.value&&a.createVNode("div",{class:"exception_wrap"},[a.createVNode("input",{type:"checkbox",id:i,class:"d-none exp_switch"},null),a.createVNode("div",{class:"exception_error_msg"},[a.createVNode("label",{class:"swith",htmlFor:i},null),a.createVNode("div",{innerHTML:r.value},null)])])])}function Pc(n){return()=>a.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function Bc(n,t,e,o){const r=a.ref(n.exceptionInfo),i=a.computed(()=>{const p={"f-icon":!0},h=`f-icon-${t.value}`;return p[h]=!0,p}),s=a.computed(()=>e.value||r.value&&r.value.message),l=a.computed(()=>o.value),c=a.computed(()=>!!o.value),f=a.computed(()=>!!r.value);function d(){return f.value?Dc(r):c.value?Pc(l):()=>null}const u=d();return()=>a.createVNode(a.Fragment,null,[a.createVNode("div",{class:"float-left modal-tips-iconwrap"},[a.createVNode("span",{class:i.value},null)]),a.createVNode("div",{class:"modal-tips-content"},[a.createVNode("p",{class:"toast-msg-title",innerHTML:s.value},null),u()])])}function jc(n,t,e){const{onCopy:o}=t,{toShowFeedback:r}=e,i=a.ref("复制成功"),s=a.ref("复制详细信息"),l=a.ref(n.exceptionInfo||{date:"",message:"",detail:""}),c=a.computed(()=>l.value&&l.value.detail||"");function f(d){o(c.value).catch(u=>{i.value="复制失败"}).finally(()=>{r.value=!0,setTimeout(()=>{r.value=!1},700)})}return()=>a.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[a.createVNode("span",{onClick:f,style:"cursor: pointer;"},[s.value])])}function Rc(n,t,e,o){const r=a.ref(n.type),i=a.ref(n.buttons),s=a.ref(n.exceptionInfo),l=a.ref(n.okButtonText),c=a.ref(n.cancelButtonText),f=a.ref(!0),d=a.ref(!0),u=a.computed(()=>!!(i.value&&i.value.length)),p=a.computed(()=>s.value&&s.value.date&&s.value.message&&s.value.detail),h=a.computed(()=>!(i.value&&i.value.length)&&(l.value||c.value)),m=a.computed(()=>d.value&&l.value),M=a.computed(()=>f.value&&c.value),x=jc(n,e,o);function y(b){r.value==="question"&&t.emit("reject"),t.emit("close")}function v(b){r.value==="question"&&t.emit("accept"),t.emit("close")}return()=>a.createVNode("div",{class:"modal-footer"},[p.value&&x(),h.value&&M.value&&a.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:y},[c.value]),h.value&&m.value&&a.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:v},[l.value]),u.value&&i.value.length&&i.value.map(b=>a.createVNode("button",{type:"button",onClick:b.handle,class:b.class},[b.iconClass&&a.createVNode("span",{class:b.iconClass},null),b.text]))])}const en=a.defineComponent({name:"FMessageBox",props:Fc,emits:["accept","reject","close"],setup(n,t){const e=a.ref(n.type),o=a.ref(n.title),r=a.ref(n.detail),i=a.computed(()=>{const x={"modal-tips":!0,"d-flex":!0,"flex-row":!0},y=`messager-type-${e.value}`;return x[y]=!0,x}),s=a.computed(()=>{const x={};return e.value==="prompt"?x.padding="0.5rem 0.5rem 1rem 1.5rem":e.value==="error"&&(x.padding="0.5rem 1.5rem 1rem 1.5rem"),x}),l=Mc(),c=Ic(n,e,o,r),f=Ec(),{feedbackStyle:d,feedbackMessage:u}=f;function p(){return a.createVNode("div",{style:d.value},[u.value])}function h(){switch(e.value){case"prompt":return Oc(n,c);default:return Bc(n,e,o,r)}}const m=h(),M=Rc(n,t,l,f);return()=>a.createVNode("div",{class:"farris-messager"},[a.createVNode("section",{class:i.value,style:s.value},[m()]),M(),p()])}});class pt{static show(t){const e=a.reactive({...t}),o=!1,r=e.type==="error"||e.type==="prompt",i=e.type==="error"?"错误提示":e.type==="prompt"&&e.title||"",s=e.acceptCallback||(()=>{}),l=e.rejectCallback||(()=>{});let c=null,f=new Bo(c);const d=()=>{c&&(c==null||c.destroy(),f=null)};return c=f==null?void 0:f.open({class:"modal-message modal-message-type-info",title:i,showButtons:o,showHeader:r,width:e.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>a.createVNode(en,a.mergeProps(e,{onAccept:s,onReject:l,onClose:d}),null)}),f==null?void 0:f.getCurrentModal()}static info(t,e){const o=a.reactive({type:"info",title:t,detail:e,okButtonText:"知道了",cancelButtonText:""});pt.show(o)}static warning(t,e){const o=a.reactive({type:"warning",title:t,detail:e,okButtonText:"知道了",cancelButtonText:""});pt.show(o)}static success(t,e){const o=a.reactive({type:"success",title:t,detail:e,okButtonText:"关闭",cancelButtonText:""});pt.show(o)}static error(t,e,o){const r=a.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:o,message:t,detail:e}});pt.show(r)}static prompt(t,e){const o=a.reactive({type:"prompt",title:t,detail:e,okButtonText:"确定",cancelButtonText:"取消"});pt.show(o)}static question(t,e,o,r){const i=a.reactive({type:"question",title:t,detail:e,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});pt.show(i)}}en.install=n=>{n.component(en.name,en),n.provide("FMessageBoxService",pt)};const Lc=a.defineComponent({name:"FResponseFormLayoutSetting",props:$o,emits:["change"],setup(n,t){const e=[1],o=[1,2],r=[1,2,3,4],i=[1,2,3,4,6];let s=[],l=[],c=[],f=[];const d=a.ref(n.initialState),u=a.ref(-1),p=a.ref(-1),h=a.ref(-1),m=a.ref(-1);function M(){const v="自定义",b=12/d.value.uniqueColClassInSM;e.includes(b)?u.value=b:(s.push({value:0,name:v}),u.value=0);const _=12/d.value.uniqueColClassInMD;o.includes(_)?p.value=_:(l.push({value:0,name:v}),p.value=0);const S=12/d.value.uniqueColClassInLG;r.includes(S)?h.value=S:(c.push({value:0,name:v}),h.value=0);const T=12/d.value.uniqueColClassInEL;i.includes(T)?m.value=T:(f.push({value:0,name:v}),m.value=0),s=[...s],l=[...l],c=[...c],f=[...f]}function x(){e.forEach(v=>{s.push({value:v,name:v+""})}),o.forEach(v=>{l.push({value:v,name:v+""})}),r.forEach(v=>{c.push({value:v,name:v+""})}),i.forEach(v=>{f.push({value:v,name:v+""})})}function y(){pt.question("应用统一布局,将重置区域内部所有控件的宽度样式,确定应用?","",()=>{d.value.uniqueColClassInSM=u.value===0?null:12/u.value,d.value.uniqueColClassInMD=p.value===0?null:12/p.value,d.value.uniqueColClassInLG=h.value===0?null:12/h.value,d.value.uniqueColClassInEL=m.value===0?null:12/m.value,t.emit("change",d.value)},()=>{})}return a.onMounted(()=>{x(),M()}),()=>a.createVNode("div",null,[a.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[a.createVNode("div",{class:"form-group farris-form-group screenGroup"},[a.createVNode("span",{class:"screenName"},[a.createTextVNode(" 小屏幕 ")]),a.createVNode("div",{class:"d-flex ml-2 screen-input"},[a.createVNode(Ft,{data:s,idField:"value",valueField:"value",editable:!1,enableClear:!1,modelValue:u.value,"onUpdate:modelValue":v=>u.value=v},null),a.createVNode("span",{class:"ml-2 columnText"},[a.createTextVNode("列")])])]),a.createVNode("div",{class:"form-group farris-form-group screenGroup"},[a.createVNode("span",{class:"screenName"},[a.createTextVNode("中等屏幕")]),a.createVNode("div",{class:"d-flex ml-2 screen-input"},[a.createVNode(Ft,{data:l,idField:"value",valueField:"value",editable:!1,enableClear:!1,modelValue:p.value,"onUpdate:modelValue":v=>p.value=v},null),a.createVNode("span",{class:"ml-2 columnText"},[a.createTextVNode("列")])])]),a.createVNode("div",{class:"form-group farris-form-group screenGroup"},[a.createVNode("span",{class:"screenName"},[a.createTextVNode("大屏幕")]),a.createVNode("div",{class:"d-flex ml-2 screen-input"},[a.createVNode(Ft,{data:c,idField:"value",valueField:"value",editable:!1,enableClear:!1,modelValue:h.value,"onUpdate:modelValue":v=>h.value=v},null),a.createVNode("span",{class:"ml-2 columnText"},[a.createTextVNode("列")])])]),a.createVNode("div",{class:"form-group farris-form-group screenGroup"},[a.createVNode("span",{class:"screenName"},[a.createTextVNode("极大屏幕")]),a.createVNode("div",{class:"d-flex ml-2 screen-input"},[a.createVNode(Ft,{data:f,idField:"value",valueField:"value",editable:!1,enableClear:!1,modelValue:m.value,"onUpdate:modelValue":v=>m.value=v},null),a.createVNode("span",{class:"ml-2 columnText"},[a.createTextVNode("列")])])])]),a.createVNode("div",{class:"applyBtn"},[a.createVNode("button",{class:"btn f-rt-btn btn-primary",type:"button",onClick:()=>y()},[a.createTextVNode("应用")])])])}}),$c={install(n){n.component(Gt.name,Gt).component(Lt.name,Lt)},register(n,t,e,o){n["form-group"]=Lt,t["form-group"]=cn,n["response-form"]=Gt,t["response-form"]=ln,n["form-input"]=Lo,t["form-input"]=xc,o["form-group"]={editorResolver:On},n["response-form-layout-setting"]=Lc,t["response-form-layout-setting"]=Tc},registerDesigner(n,t,e){n["form-group"]=Cc,t["form-group"]=cn,n["response-form"]=Ia,t["response-form"]=ln}};Z.FDynamicFormGroup=Lt,Z.FDynamicFormInput=Lo,Z.FResponseForm=Gt,Z.default=$c,Z.dynamicFormGroupProps=Dt,Z.editorResolver=On,Z.formGroupPropsResolver=cn,Z.formPropsResolver=ln,Z.responseFormProps=sn,Z.useDesignerRules=jn,Object.defineProperties(Z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(Z,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue"),require("lodash-es"),require("../common/index.umd.js"),require("../dynamic-resolver/index.umd.js"),require("../designer-canvas/index.umd.js"),require("../property-panel/index.umd.js"),require("../accordion/index.umd.js"),require("../avatar/index.umd.js"),require("../../designer/button-edit/index.umd.js"),require("../button-group/index.umd.js"),require("../calendar/index.umd.js"),require("../capsule/index.umd.js"),require("../../designer/checkbox/index.umd.js"),require("../../designer/checkbox-group/index.umd.js"),require("../combo-list/index.umd.js"),require("../combo-tree/index.umd.js"),require("../component/index.umd.js"),require("../color-picker/index.umd.js"),require("../content-container/index.umd.js"),require("../date-picker/index.umd.js"),require("../../designer/data-grid/index.umd.js"),require("../dropdown/index.umd.js"),require("../dynamic-form/index.umd.js"),require("../events-editor/index.umd.js"),require("../filter-bar/index.umd.js"),require("../field-selector/index.umd.js"),require("../binding-selector/index.umd.js"),require("../image-cropper/index.umd.js"),require("../../designer/input-group/index.umd.js"),require("../layout/index.umd.js"),require("../list-nav/index.umd.js"),require("../list-view/index.umd.js"),require("../lookup/index.umd.js"),require("../mapping-editor/index.umd.js"),require("../nav/index.umd.js"),require("../number-range/index.umd.js"),require("../number-spinner/index.umd.js"),require("../order/index.umd.js"),require("../page-header/index.umd.js"),require("../page-footer/index.umd.js"),require("../pagination/index.umd.js"),require("../progress/index.umd.js"),require("../query-solution/index.umd.js"),require("../../designer/radio-group/index.umd.js"),require("../rate/index.umd.js"),require("../response-toolbar/index.umd.js"),require("../response-layout/index.umd.js"),require("../response-layout-editor/index.umd.js"),require("../search-box/index.umd.js"),require("../section/index.umd.js"),require("../smoke-detector/index.umd.js"),require("../splitter/index.umd.js"),require("../step/index.umd.js"),require("../switch/index.umd.js"),require("../tabs/index.umd.js"),require("../tags/index.umd.js"),require("../text/index.umd.js"),require("../time-picker/index.umd.js"),require("../transfer/index.umd.js"),require("../tree-view/index.umd.js"),require("../uploader/index.umd.js"),require("../verify-detail/index.umd.js"),require("../video/index.umd.js"),require("../textarea/index.umd.js"),require("../schema-selector/index.umd.js"),require("../tree-grid/index.umd.js"),require("../event-parameter/index.umd.js"),require("../filter-condition-editor/index.umd.js"),require("../fieldset/index.umd.js"),require("../sort-condition-editor/index.umd.js"),require("../menu-lookup/index.umd.js"),require("../drawer/index.umd.js"),require("../json-editor/index.umd.js"),require("../property-editor/index.umd.js"),require("../expression-editor/index.umd.js"),require("../code-editor/index.umd.js"),require("../html-template/index.umd.js"),require("../external-container/index.umd.js"),require("@vueuse/core"),require("../data-view/index.umd.js"),require("../modal/index.umd.js"),require("../condition/index.umd.js"),require("../checkbox/index.umd.js"),require("../tooltip/index.umd.js"),require("../button/index.umd.js"),require("../notify/index.umd.js")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es","../common/index.umd.js","../dynamic-resolver/index.umd.js","../designer-canvas/index.umd.js","../property-panel/index.umd.js","../accordion/index.umd.js","../avatar/index.umd.js","../../designer/button-edit/index.umd.js","../button-group/index.umd.js","../calendar/index.umd.js","../capsule/index.umd.js","../../designer/checkbox/index.umd.js","../../designer/checkbox-group/index.umd.js","../combo-list/index.umd.js","../combo-tree/index.umd.js","../component/index.umd.js","../color-picker/index.umd.js","../content-container/index.umd.js","../date-picker/index.umd.js","../../designer/data-grid/index.umd.js","../dropdown/index.umd.js","../dynamic-form/index.umd.js","../events-editor/index.umd.js","../filter-bar/index.umd.js","../field-selector/index.umd.js","../binding-selector/index.umd.js","../image-cropper/index.umd.js","../../designer/input-group/index.umd.js","../layout/index.umd.js","../list-nav/index.umd.js","../list-view/index.umd.js","../lookup/index.umd.js","../mapping-editor/index.umd.js","../nav/index.umd.js","../number-range/index.umd.js","../number-spinner/index.umd.js","../order/index.umd.js","../page-header/index.umd.js","../page-footer/index.umd.js","../pagination/index.umd.js","../progress/index.umd.js","../query-solution/index.umd.js","../../designer/radio-group/index.umd.js","../rate/index.umd.js","../response-toolbar/index.umd.js","../response-layout/index.umd.js","../response-layout-editor/index.umd.js","../search-box/index.umd.js","../section/index.umd.js","../smoke-detector/index.umd.js","../splitter/index.umd.js","../step/index.umd.js","../switch/index.umd.js","../tabs/index.umd.js","../tags/index.umd.js","../text/index.umd.js","../time-picker/index.umd.js","../transfer/index.umd.js","../tree-view/index.umd.js","../uploader/index.umd.js","../verify-detail/index.umd.js","../video/index.umd.js","../textarea/index.umd.js","../schema-selector/index.umd.js","../tree-grid/index.umd.js","../event-parameter/index.umd.js","../filter-condition-editor/index.umd.js","../fieldset/index.umd.js","../sort-condition-editor/index.umd.js","../menu-lookup/index.umd.js","../drawer/index.umd.js","../json-editor/index.umd.js","../property-editor/index.umd.js","../expression-editor/index.umd.js","../code-editor/index.umd.js","../html-template/index.umd.js","../external-container/index.umd.js","@vueuse/core","../data-view/index.umd.js","../modal/index.umd.js","../condition/index.umd.js","../checkbox/index.umd.js","../tooltip/index.umd.js","../button/index.umd.js","../notify/index.umd.js"],a):(Z=typeof globalThis<"u"?globalThis:Z||self,a(Z["dynamic-form"]={},Z.Vue,Z.LodashES,Z.common,Z.dynamicResolver,Z.designerCanvas,Z.propertyPanel,Z.FAccordion,Z.FAvatar,Z.FButtonEdit,Z.FButtonGroup,Z.FCalendar,Z.FCapsule,Z.FCheckbox,Z.FCheckboxGroup,Z.FComboList,Z.FComboTree,Z.FComponent,Z.FColorPicker,Z.FContentContainer,Z.FDatePicker,Z.FDataGrid,Z.FDropdown,Z.FDynamicForm,Z.FEventsEditor,Z.FFilterBar,Z.FFieldSelector,Z.FBindingSelector,Z.FImageCropper,Z.FInputGroup,Z.FLayout,Z.FListNav,Z.FListView,Z.FLookup,Z.FMappingEditor,Z.FNav,Z.FNumberRange,Z.FNumberSpinner,Z.FOrder,Z.FPageHeader,Z.FPageFooter,Z.FPagination,Z.FProgress,Z.FQuerySolution,Z.FRadioGroup,Z.FRate,Z.FResponseToolbar,Z.FResponseLayout,Z.FResponseLayoutEditorSetting,Z.FSearchBox,Z.FSection,Z.FSmokeDetector,Z.FSplitter,Z.FStep,Z.FSwitch,Z.FTabs,Z.FTags,Z.FText,Z.FTimePicker,Z.FTransfer,Z.FTreeview,Z.FUploader,Z.FVerifyDetail,Z.FVideo,Z.FTextArea,Z.FSchemaSelector,Z.FTreeGrid$1,Z.FEventParameter,Z.FFilterConditionEditor,Z.FFieldset,Z.FSortConditionEditor,Z.FMenuLookup,Z.FDrawer,Z.FJsonEditor,Z.FPropertyEditor,Z.FExpressionEditor,Z.FCodeEditor,Z.FHtmlTemplate,null,Z.VueUseCore,Z.dataView,null,null,Z.checkbox,Z.FTooltip,Z.FButton))})(this,function(Z,a,Ee,ke,tn,Tt,yt,Wo,qo,Ao,Ho,Go,zo,_n,Tn,Ft,Yo,Uo,Xo,Qo,Zo,Ko,Jo,nn,er,tr,nr,or,rr,ar,ir,sr,lr,cr,ur,dr,fr,pr,mr,hr,gr,yr,vr,br,wr,Cr,xr,_r,Tr,Fr,Sr,kr,Vr,Mr,Nr,Ir,Er,Or,Dr,Pr,Br,jr,Rr,Lr,$r,Wr,qr,Ar,Hr,Gr,zr,Yr,Ur,Xr,Qr,Zr,Kr,Jr,Ac,Fn,Fe,Hc,Gc,ea,ta,na){"use strict";var Wc=Object.defineProperty;var qc=(Z,a,Ee)=>a in Z?Wc(Z,a,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):Z[a]=Ee;var j=(Z,a,Ee)=>qc(Z,typeof a!="symbol"?a+"":a,Ee);const Sn={},kn={};function on(n){const{properties:t,title:e,ignore:o}=n,r=o&&Array.isArray(o),i=Object.keys(t).reduce((s,l)=>((!r||!o.find(c=>c===l))&&(s[l]=t[l].type==="object"&&t[l].properties?on(t[l]):Ee.cloneDeep(t[l].default)),s),{});if(e&&(!r||!o.find(s=>s==="id"))){const s=e.toLowerCase().replace(/-/g,"_");i.id=`${s}_${Math.random().toString().slice(2,6)}`}return i}function oa(n){const{properties:t,title:e,required:o}=n;if(o&&Array.isArray(o)){const r=o.reduce((i,s)=>(i[s]=t[s].type==="object"&&t[s].properties?on(t[s]):Ee.cloneDeep(t[s].default),i),{});if(e&&o.find(i=>i==="id")){const i=e.toLowerCase().replace(/-/g,"_");r.id=`${i}_${Math.random().toString().slice(2,6)}`}return r}return{type:e}}function Vn(n,t={},e){const o=Sn[n];if(o){let r=oa(o);const i=kn[n];return r=i?i({getSchemaByType:Vn},r,t,e):r,r}return null}function ra(n,t){const e=on(t);return Object.keys(e).reduce((o,r)=>(Object.prototype.hasOwnProperty.call(n,r)&&(o[r]&&Ee.isPlainObject(o[r])&&Ee.isPlainObject(n[r]||!n[r])?Object.assign(o[r],n[r]||{}):o[r]=n[r]),o),e),e}function Mn(n,t){return Object.keys(n).filter(o=>n[o]!=null).reduce((o,r)=>{if(t.has(r)){const i=t.get(r);if(typeof i=="string")o[i]=n[r];else{const s=i(r,n[r],n);Object.assign(o,s)}}else o[r]=n[r];return o},{})}function aa(n,t,e=new Map){const o=ra(n,t);return Mn(o,e)}function ia(n={}){function t(f,d,u,p){if(typeof u=="number")return p[f].length===u;if(typeof u=="object"){const h=Object.keys(u)[0],m=u[h];if(h==="not")return Number(p[f].length)!==Number(m);if(h==="moreThan")return Number(p[f].length)>=Number(m);if(h==="lessThan")return Number(p[f].length)<=Number(m)}return!1}function e(f,d,u,p){return p[f]&&p[f].propertyValue&&String(p[f].propertyValue.value)===String(u)}const o=new Map([["length",t],["getProperty",e]]);Object.keys(n).reduce((f,d)=>(f.set(d,n[d]),f),o);function r(f,d){const u=f;return typeof d=="number"?[{target:u,operator:"length",param:null,value:Number(d)}]:typeof d=="boolean"?[{target:u,operator:"getProperty",param:f,value:!!d}]:typeof d=="object"?Object.keys(d).map(p=>{if(p==="length")return{target:u,operator:"length",param:null,value:d[p]};const h=p,m=d[p];return{target:u,operator:"getProperty",param:h,value:m}}):[]}function i(f){return Object.keys(f).reduce((u,p)=>{const h=r(p,f[p]);return u.push(...h),u},[])}function s(f,d){if(o.has(f.operator)){const u=o.get(f.operator);return u&&u(f.target,f.param,f.value,d)||!1}return!1}function l(f,d){return i(f).reduce((h,m)=>h&&s(m,d),!0)}function c(f,d){const u=Object.keys(f),p=u.includes("allOf"),h=u.includes("anyOf"),m=p||h,y=(m?f[m?p?"allOf":"anyOf":"allOf"]:[f]).map(b=>l(b,d));return p?!y.includes(!1):y.includes(!0)}return{parseValueSchema:c}}const ae={button:{type:"button",name:"按钮"},"response-toolbar":{type:"response-toolbar",name:"工具栏"},"response-toolbar-item":{type:"response-toolbar-item",name:"按钮"},"content-container":{type:"content-container",name:"容器"},"input-group":{type:"input-group",name:"文本"},textarea:{type:"textarea",name:"多行文本"},lookup:{type:"lookup",name:"帮助"},"number-spinner":{type:"number-spinner",name:"数值"},"date-picker":{type:"date-picker",name:"日期"},switch:{type:"switch",name:"开关"},"radio-group":{type:"radio-group",name:"单选组"},"check-box":{type:"check-box",name:"复选框"},"check-group":{type:"check-group",name:"复选框组"},"combo-list":{type:"combo-list",name:"下拉列表"},"response-form":{type:"response-form",name:"卡片面板"},"response-layout":{type:"response-layout",name:"布局容器",icon:"response-layout-3"},"response-layout-item":{type:"response-layout-item",name:"布局",icon:"response-layout-1"},"tree-grid":{type:"tree-grid",name:"树表格"},"tree-grid-column":{type:"tree-grid-column",name:"树表格列"},"data-grid":{type:"data-grid",name:"表格"},"data-grid-column":{type:"data-grid-column",name:"表格列"},module:{type:"Module",name:"模块"},component:{type:"component",name:"组件"},tabs:{type:"tabs",name:"标签页"},"tab-page":{type:"tab-page",name:"标签页项",dependentParentControl:"Tab"},"tab-toolbar-item":{type:"tab-toolbar-item",name:"标签页工具栏按钮"},"html-template":{type:"html-template",name:"模板容器"},"time-picker":{type:"time-picker",name:"时间选择"},section:{type:"section",name:"分组面板"},"section-toolbar":{type:"section-toolbar",name:"分组面板工具栏"},"section-toolbar-item":{type:"section-toolbar-item",name:"分组面板按钮"},splitter:{type:"splitter",name:"分栏面板"},"splitter-pane":{type:"splitter-pane",name:"分栏面板项",dependentParentControl:"Splitter"},"component-ref":{type:"component-ref",name:"组件引用节点"},uploader:{type:"uploader",name:"附件上传"},"page-header":{type:"page-header",name:"页头"},"page-footer":{type:"page-footer",name:"页脚"},"tab-toolbar":{type:"tab-toolbar",name:"标签页工具栏"},fieldset:{type:"fieldset",name:"分组"},"query-solution":{type:"query-solution",name:"筛选方案"},drawer:{type:"drawer",name:"抽屉"},"external-container":{type:"external-container",name:"外部容器",icon:"content-container"},"list-nav":{type:"list-nav",name:"列表导航"},"filter-bar":{type:"filter-bar",name:"筛选条"}},Nn={},sa={};ia();function Ot(n,t,e=new Map,o=(s,l,c,f)=>l,r={},i=s=>s){return Sn[t.title]=t,kn[t.title]=o,Nn[t.title]=r,sa[t.title]=i,(s={},l=!0)=>{if(!l)return Mn(s,e);const c=aa(s,t,e),f=Object.keys(n).reduce((d,u)=>(d[u]=n[u].default,d),{});return Object.assign(f,c)}}function rn(n,t){return{customClass:t.class,customStyle:t.style}}function la(){function n(t,e){const{dataSource:o}=t||{};return o===void 0?{}:{}}return{resolve:n}}function ca(){function n(t,e){return t.selectItemById(e)}return{selectItemById:n}}function ua(){function n(t){return t.editor}return{resolve:n}}function da(){function n(t,e){const{columns:o}=e;return t.updateColumns(o)}return{updateColumns:n}}const an=new Map([["appearance",rn]]),fa=new Map([]),pa="root-viewmodel";class ma{constructor(t,e){j(this,"formSchemaUtils");j(this,"controlCreatorUtils");j(this,"designViewModelUtils");this.resolver=t,this.designerHostService=e,this.formSchemaUtils=this.designerHostService.formSchemaUtils,this.controlCreatorUtils=this.designerHostService.controlCreatorUtils,this.designViewModelUtils=this.designerHostService.designViewModelUtils}createComponent(t){const e=this.createComponentRefNode(t),o=this.createComponentNode(t),r=this.createViewModeNode(t),i=this.formSchemaUtils.getFormSchema();return i.module.viewmodels.push(r),i.module.components.push(o),this.designViewModelUtils.assembleDesignViewModel(),e}createComponentRefNode(t){const e=this.resolver.getSchemaByType("component-ref");return Object.assign(e,{id:`${t.componentId}-component-ref`,component:`${t.componentId}-component`}),e}createComponentNode(t){const e=this.resolver.getSchemaByType("component"),o=this.createFormComponentContents(t);return Object.assign(e,{id:`${t.componentId}-component`,viewModel:`${t.componentId}-component-viewmodel`,componentType:t.componentType,appearance:{class:this.getFormComponentClass()},formColumns:t.formColumns,contents:o}),e}getFormComponentClass(){const{templateId:t}=this.formSchemaUtils.getFormSchema().module;return t==="double-list-in-tab-template"?"f-struct-wrapper f-utils-fill-flex-column":"f-struct-wrapper"}createFormComponentContents(t){const e=this.resolver.getSchemaByType("section");Object.assign(e,{id:t.componentId+"-form-section",appearance:{class:"f-section-form f-section-in-mainsubcard"},mainTitle:t.componentName});const o=this.resolver.getSchemaByType("response-form"),r=[];Object.assign(o,{id:t.componentId+"-form",appearance:{class:"f-form-layout farris-form farris-form-controls-inline"},contents:r}),e.contents=[o];const{selectedFields:i}=t;i==null||i.forEach(l=>{const c=Ee.cloneDeep(l),f=this.resolveControlClassByFormColumns(t),d=this.controlCreatorUtils.setFormFieldProperty(c,"",f);d&&r.push(d)});const{templateId:s}=this.formSchemaUtils.getFormSchema().module;return s==="double-list-in-tab-template"&&(e.appearance.class="f-section-grid f-section-in-main px-0 pt-0",e.fill=!0),[e]}resolveControlClassByFormColumns(t){let e="";switch(t.formColumns){case 1:{e="col-12";break}case 2:{e="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{e="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{e="col-12 col-md-6 col-xl-3 col-el-2";break}}return e}createViewModeNode(t){return{id:`${t.componentId}-component-viewmodel`,code:`${t.componentId}-component-viewmodel`,name:t.componentName,bindTo:t.bindTo,parent:pa,fields:this.assembleViewModelFields(t),commands:[],states:[],enableValidation:!0}}assembleViewModelFields(t){const e=[],{selectedFields:o}=t;return o==null||o.forEach(r=>{let i="blur";const s=r.type.name;(s===ke.FormSchemaEntityFieldTypeName.Enum||s===ke.FormSchemaEntityFieldTypeName.Boolean)&&(i="change"),e.push({type:"Form",id:r.id,fieldName:r.bindingField,groupId:null,groupName:null,updateOn:i,fieldSchema:{}})}),e}}function ha(n,t,e,o){var i,s,l,c,f,d;const r=e.parentComponentInstance;if(r&&o){const u=(i=r.schema)==null?void 0:i.type,h={componentId:`form-${Math.random().toString(36).slice(2,6)}`,componentName:((s=e.bindingSourceContext)==null?void 0:s.entityTitle)||((c=(l=e.bindingSourceContext)==null?void 0:l.bindingEntity)==null?void 0:c.name)||"标题",componentType:"form",formColumns:u==="splitter-pane"?1:4,parentContainerId:r.schema.id,bindTo:((f=e.bindingSourceContext)==null?void 0:f.bindTo)||"/",selectedFields:(d=e.bindingSourceContext)==null?void 0:d.bindingEntityFields};return new ma(n,o).createComponent(h)}else return t}function ga(n,t,e){return t}const ya={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/response-form.schema.json",title:"response-form",description:"A Farris Data Collection Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"response-form"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},contents:{description:"",type:"array",default:[]},visible:{description:"",type:"boolean",default:!0},labelAutoOverflow:{description:"",type:"boolean",default:!1}},required:["id","type","contents"]},sn={customClass:{type:String,default:""},customStyle:{type:String,defaut:""},visible:{type:Boolean,default:!0}},ln=Ot(sn,ya,an,ha),Gt=a.defineComponent({name:"FResponseForm",props:sn,emits:[],setup(n,t){const e=a.ref(),o=a.computed(()=>{const r=n.customClass.split(" "),i={"drag-container":!0};return r.reduce((s,l)=>(s[l]=!0,s),i),i});return()=>n.visible&&a.withDirectives(a.createVNode("div",{ref:e,class:o.value,style:n.customStyle},[t.slots.default&&t.slots.default()]),[[a.resolveDirective("area-response")]])}}),In={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/form-group.schema.json",title:"form-group",description:"A Farris Input Component",type:"object",properties:{id:{description:"The unique identifier for a form group",type:"string"},type:{description:"The type string of form group component",type:"string",default:"form-group"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},enableLinkLabel:{description:"",type:"boolean",default:!1},editor:{description:"",type:"obejct",default:null},label:{description:"",type:"string",default:""},lableWidth:{description:"",type:"number"},binding:{description:"",type:"object",default:{}},visible:{description:"",type:"boolean",default:!0},required:{description:"",type:"boolean",default:!1},errors:{description:"",type:"object",default:null}},required:["id","type","editor"]},Dt={id:{type:String,default:""},customClass:{type:String,default:""},customStyle:{type:String,default:""},editor:{type:Object,default:{}},label:{type:String,default:""},modelValue:{type:[String,Boolean,Array,Number]},visible:{type:Boolean,default:!0},required:{type:Boolean,default:!1},showLabel:{type:Boolean,default:!0},type:{type:String,default:"input-group"},componentId:{type:String,default:""},errors:{type:Object,default:null}},cn=Ot(Dt,In,an,void 0),En=ua();function un(n,t,e){var g;const o=e&&e.getStyles&&e.getStyles()||"",r=e&&e.getDesignerClass&&e.getDesignerClass()||"",i=a.ref();function s(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanMoveComponent?e.checkCanMoveComponent():!0}function l(){return!1}function c(){return(t==null?void 0:t.schema.componentType)==="frame"?!1:e&&e.checkCanDeleteComponent?e.checkCanDeleteComponent():!0}function f(){return(t==null?void 0:t.schema.componentType)==="frame"?!0:e&&e.hideNestedPaddingInDesginerView?e.hideNestedPaddingInDesginerView():!1}function d(V){if(!V||!V.value)return null;if(V.value.schema&&V.value.schema.type==="component")return V.value;const F=a.ref(V==null?void 0:V.value.parent),N=d(F);return N||null}function u(V=t){var R;if(e!=null&&e.getDraggableDesignItemElement)return e.getDraggableDesignItemElement(V);const{componentInstance:F,designerItemElementRef:N}=V;if(!F||!F.value)return null;const{getCustomButtons:w}=F.value;return F.value.canMove||w&&((R=w())!=null&&R.length)?N:u(V.parent)}function p(V){return!!e&&e.canAccepts(V)}function h(){return(t==null?void 0:t.schema.label)||(t==null?void 0:t.schema.title)||(t==null?void 0:t.schema.name)}function m(){}function M(V,F){var N;!V||!F||(e!=null&&e.onAcceptMovedChildElement&&e.onAcceptMovedChildElement(V,F),(N=t==null?void 0:t.setupContext)==null||N.emit("dragEnd"))}function x(V,F){const{componentType:N}=V;let w=Vn(N,V,F);e&&e.onResolveNewComponentSchema&&(w=e.onResolveNewComponentSchema(V,w));const R=N.toLowerCase().replace(/-/g,"_");return w&&!w.id&&w.type===N&&(w.id=`${R}_${Math.random().toString().slice(2,6)}`),w}function y(V){V&&e!=null&&e.onChildElementMovedOut&&e.onChildElementMovedOut(V)}function v(...V){if(e&&e.getPropsConfig)return e.getPropsConfig(...V)}function b(V){if(!V)return;const F=t==null?void 0:t.schema,{formSchemaUtils:N}=V;if(F&&N.getExpressions().length){const w=N.getExpressions().findIndex(R=>R.target===F.id);w>-1&&N.getExpressions().splice(w,1)}}function _(V){e&&e.onRemoveComponent&&e.onRemoveComponent(),b(V),t!=null&&t.schema.contents&&t.schema.contents.map(F=>{let N=F.id;F.type==="component-ref"&&(N=F.component);const w=n.value.querySelectorAll(`#${N}-design-item`);w!=null&&w.length&&Array.from(w).map(R=>{var L;(L=R==null?void 0:R.componentInstance)!=null&&L.value.onRemoveComponent&&R.componentInstance.value.onRemoveComponent(V)})})}function S(){if(e&&e.getCustomButtons)return e.getCustomButtons()}function T(V){if(e&&e.onPropertyChanged)return e.onPropertyChanged(V)}return i.value={canMove:s(),canSelectParent:l(),canDelete:c(),canNested:!f(),contents:t==null?void 0:t.schema.contents,elementRef:n,parent:(g=t==null?void 0:t.parent)==null?void 0:g.componentInstance,schema:t==null?void 0:t.schema,styles:o,designerClass:r,canAccepts:p,getBelongedComponentInstance:d,getDraggableDesignItemElement:u,getDraggingDisplayText:h,getPropConfig:v,getDragScopeElement:m,onAcceptMovedChildElement:M,onChildElementMovedOut:y,addNewChildComponentSchema:x,triggerBelongedComponentToMoveWhenMoved:!!e&&e.triggerBelongedComponentToMoveWhenMoved||a.ref(!1),triggerBelongedComponentToDeleteWhenDeleted:!!e&&e.triggerBelongedComponentToDeleteWhenDeleted||a.ref(!1),onRemoveComponent:_,getCustomButtons:S,onPropertyChanged:T},i}function va(){function n(t,e){var s;if(!t)return!1;const o=((s=t.targetContainer)==null?void 0:s.componentInstance)&&t.targetContainer.componentInstance.value;if(!o)return!1;const r=o.schema.type,i=e==null?void 0:e.formSchemaUtils.getComponentById(o.belongedComponentId);return!((t.componentCategory==="input"||t.componentType==="form-group")&&![ae["response-layout-item"].type,ae["response-form"].type,ae.fieldset.type].includes(r)||(t.componentType===ae.tabs.type||t.componentType===ae.section.type)&&((i==null?void 0:i.componentType)!=="frame"||![ae["content-container"].type,ae["splitter-pane"].type,ae["response-layout-item"].type].includes(r))||t.componentType===ae["query-solution"].type||t.componentType===ae.fieldset.type&&r!==ae["response-form"].type)}return{basalDragulaRuleForContainer:n}}class ba{getTemplateRule(t,e){const o=e==null?void 0:e.formSchemaUtils,r=o==null?void 0:o.getFormTemplateRule(),i={canAccept:!0,canDelete:!0,canMove:!0};if(!r)return i;const s=this.getComponentContext(t),{componentClassList:l}=s;return l.forEach(c=>{if(!c||!r[c])return;const{canMove:f,canDelete:d,canAccept:u}=r[c];i.canMove=i.canMove&&this.resolveRuleValue(f,s),i.canDelete=i.canDelete&&this.resolveRuleValue(d,s),i.canAccept=i.canAccept&&this.resolveRuleValue(u,s)}),i}resolveRuleValue(t,e){return typeof t=="boolean"?t:this.parseRuleValueSchema(t,e)}parseRuleValueSchema(t,e){const o=t.invalidContext||[];let r=!0;for(const i of o){if(i.firstLevelChild){if(i.firstLevelChild.class){const{firstLevelChildClassList:s}=e;if(s&&!s.includes(i.firstLevelChild.class)){r=!1;continue}}if(i.firstLevelChild.type){const{firstLevelChildSchema:s}=e;if(!s||s.type!==i.firstLevelChild.type){r=!1;continue}}}if(i.secondLevelChild){if(i.secondLevelChild.class){const{secondLevelChildClassList:s}=e;if(s&&!s.includes(i.secondLevelChild.class)){r=!1;continue}}if(i.secondLevelChild.type){const{secondLevelChildSchema:s}=e;if(!s||s.type!==i.secondLevelChild.type){r=!1;continue}}}if(i.parent){if(i.parent.class){const{parentClassList:s}=e;if(s&&!s.includes(i.parent.class)){r=!1;continue}}if(i.parent.type){const{parentSchema:s}=e;if(s&&s.type!==i.parent.type){r=!1;continue}}}r=!0;break}return!r}getComponentContext(t){var M,x,y,v;const e=t.schema,o=e.appearance&&e.appearance.class||"",r=o.split(" ")||[],i=e.contents||[],s=i.length?i[0]:null,l=s&&s.appearance?s.appearance.class:"",c=l?l.split(" "):[],f=(M=s==null?void 0:s.contents)!=null&&M.length?s==null?void 0:s.contents[0]:null,d=f&&f.appearance?f.appearance.class:"",u=d?d.split(" "):[],p=e.type==="component"?(y=(x=t.parent)==null?void 0:x.parent)==null?void 0:y.schema:(v=t.parent)==null?void 0:v.schema,h=p&&p.appearance&&p.appearance.class||"",m=h?h.split(" "):[];return{componentClass:o,componentClassList:r,childContents:i,firstLevelChildSchema:s,firstLevelChildClass:l,firstLevelChildClassList:c,secondLevelChildSchema:f,secondLevelChildClass:d,secondLevelChildClassList:u,parentSchema:p,parentClass:h,parentClassList:m}}}const wa=a.ref(0);function On(){wa.value++}const zt=a.ref(0);function Ca(n,t){const e=t.getBoundingClientRect(),o=n.getBoundingClientRect(),r=o.top>=e.top,i=o.top<=e.bottom;return r&&i}function xa(n){const t=n.querySelector(".component-btn-group");if(!t)return;t.style.display="";const e=t.getBoundingClientRect();if(!(e.top===0&&e.left===0)){const o=t.querySelector("div");if(o){const r=o.getBoundingClientRect();o.style.top=e.top+"px";let i=e.left-r.width;const s=document.querySelector(".editorDiv");if(s){const l=s.getBoundingClientRect();i<l.left&&({left:i}=n.getBoundingClientRect())}o.style.left=i+"px"}}}function _a(n){if(!window.scrollContainerList)return;const t=Array.from(window.scrollContainerList);if(t.length&&t.length===1){const e=t[0],o=document.querySelector(`[id=${e}]`);if(o&&o.contains(n))return o}}function Dn(n){if(!n)return;const t=n.getBoundingClientRect();if(t.width===0&&t.height===0)return;const e=n.querySelector(".component-btn-group");if(e){let o=!0;const r=_a(n);if(r&&(o=Ca(n,r)),!o){e.style.display="none";return}xa(n)}}function Ta(n){if(!n)return;let t;n.className.includes("dgComponentSelected")?t=n:t=n.querySelector(".dgComponentSelected"),t&&Dn(t)}function Fa(n){const{formSchemaUtils:t,formStateMachineUtils:e}=n;function o(c,f=""){return{path:f+c.code,field:c.id,fullPath:c.code}}function r(c,f=""){return t.getViewModelById(c).states.map(u=>o(u,f))}function i(c){const f=t.getRootViewModelId(),d=r(c);if(c===f)return d;const u=r(f,"root-component.");return[...d,...u]}function s(c){return c.binding&&c.binding.path||c.id||""}function l(){return e&&e.getRenderStates()||[]}return{getVariables:i,getControlName:s,getStateMachines:l}}class Sa{constructor(t){j(this,"sessionVariables",[{key:"CurrentSysOrgName",name:"当前组织Name",description:"当前组织Name"},{key:"CurrentSysOrgId",name:"当前组织Id",description:"当前组织Id"},{key:"CurrentUserName",name:"当前用户Name",description:"当前用户Name"},{key:"CurrentUserCode",name:"当前用户Code",description:"当前用户Code"},{key:"CurrentUserId",name:"当前用户Id",description:"当前用户Id"},{key:"CurrentLanguage",name:"当前语言编号",description:"当前登录的语言编号,例如简体中文返回'zh-CHS',英文返回'en',繁体中文'zh-CHT'"}]);j(this,"expressionNames",{compute:"计算表达式",dependency:"依赖表达式",validate:"验证表达式",dataPicking:"帮助前表达式",visible:"可见表达式",readonly:"只读表达式",required:"必填表达式"});j(this,"getExpressionConverter",(t,e)=>({convertFrom:(o,r,i,s)=>{const l=i.getExpressionRuleValue(t,e||r);return l&&l.value||""},convertTo:(o,r,i,s,l)=>{var c;if(r==="dataPicking"&&(i!=null&&i.target)){const f=`${i.target}_dataPicking`;((c=i.rules)==null?void 0:c.some(u=>u.id===f&&u.value))?o.dictPickingExpressionId=f:delete o.dictPickingExpressionId}s.updateExpression(i)}}));this.formSchemaService=t}getExpressionRule(t,e){const o=this.formSchemaService.getExpressions();if(!o)return"";const r=o.find(s=>s.target===t);if(!r)return"";const i=r.rules.find(s=>s.type===e);return i||""}getContextFormVariables(){const{module:t}=this.formSchemaService.getFormSchema();if(!t.viewmodels||t.viewmodels.length===0)return[];const e=this.formSchemaService.getRootViewModelId(),o=this.formSchemaService.getViewModelById(e);if(!o||!o.states||o.states.length===0)return[];const r=[];return o.states.forEach(i=>{r.push({key:i.code,name:i.name,description:i.name,category:i.category})}),r}createTreeNode(t,e,o="label"){return{id:t.id,name:t.name,bindingPath:t[o],parents:e}}buildEntityFieldsTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var l;const i=this.createTreeNode(r,e);let s=[];(l=r.type)!=null&&l.fields&&(s=this.buildEntityFieldsTreeData(r.type.fields,[...e,r.label])),o.push({data:i,children:s,expanded:!0})}),o}buildChildEntityTreeData(t=null,e){const o=[];return t==null||t.forEach(r=>{var c,f;const i=this.createTreeNode(r,e),s=this.buildEntityFieldsTreeData((c=r.type)==null?void 0:c.fields,[...e,r.label]),l=this.buildChildEntityTreeData((f=r.type)==null?void 0:f.entities,[...e,r.label]);l!=null&&l.length&&(s==null||s.push(...l)),o.push({data:i,children:s||[],expanded:!0})}),o}getEntitiesTreeData(){const t=this.formSchemaService.getSchemaEntities();if(!(t!=null&&t.length))return[];const e=t[0];if(!(e!=null&&e.type))return[];const o=this.buildEntityFieldsTreeData(e.type.fields,[e.code]),r=this.buildChildEntityTreeData(e.type.entities,[e.code]);return r!=null&&r.length&&(o==null||o.push(...r)),{entityCode:e.code,fields:[{data:this.createTreeNode(e,[],"code"),children:o||[]}]}}getEntitiesAndVariables(){return{entities:this.getEntitiesTreeData(),variables:{session:{name:"系统变量",items:this.sessionVariables,visible:!1},forms:{name:"表单变量",items:this.getContextFormVariables(),visible:!0}}}}onBeforeOpenExpression(t,e,o){const r=o==="Field"?t.binding.field:t.id,i=this.getExpressionRule(r,e),s=this.getEntitiesAndVariables(),l={message:["validate","required","dataPicking"].includes(e)&&i?i.message:"",...s};return i.messageType!=null&&(l.messageType=i.messageType),l}buildRule(t,e,o,r){const{expression:i,message:s,messageType:l}=e,c={id:`${t}_${o}`,type:o,value:i};return(o==="validate"||o==="dataPicking"||o==="required")&&(c.message=s),o==="dataPicking"&&(c.messageType=l),o==="validate"&&r&&(c.elementId=r),c}getExpressionData(){const{expressions:t}=this.formSchemaService.getFormSchema().module;return t||[]}updateExpression(t,e,o,r){const i=e==="Field"?t.binding.field:t.id,s=this.buildRule(i,o,r,t.type==="form-group"?t.id:"");let c=this.getExpressionData().find(d=>d.targetType===e&&d.target===i);const f=d=>d.value.trim()==="";if(c){const d=c.rules.find(u=>u.id===s.id);if(d)f(s)?c.rules=c.rules.filter(u=>u.id!==s.id):(Object.assign(d,s),r==="validate"&&t.type==="form-group"&&(d.elementId=t.id));else{if(f(s))return null;c.rules=c.rules||[],c.rules.push(s)}}else{if(f(s))return null;c={target:`${i}`,rules:[s],targetType:e}}return c}getExpressionEditorOptions(t,e,o,r){return o.reduce((i,s)=>{var c,f;const l=e==="Field"?(c=t==null?void 0:t.binding)==null?void 0:c.field:t.id;return i[s]={hide:e==="Field"?!!((f=t==null?void 0:t.binding)!=null&&f.field):!1,description:"",title:this.expressionNames[s],type:"string",$converter:this.getExpressionConverter(l),editor:{type:"expression-editor",singleExpand:!1,dialogTitle:`${this.expressionNames[s]}编辑器`,showMessage:s==="validate"||s==="dataPicking"||s==="required",showMessageType:s==="dataPicking",beforeOpen:()=>this.onBeforeOpenExpression(t,s,e),onSubmitModal:d=>{const u=this.updateExpression(t,e,d,s);if(r){const p=this.buildRule(l,d,s);r(p)}return u}}},i},{})}getExpressionInfo(t,e,o){const r=e==="Field"?t.binding.field:t.id,i=this.getExpressionRule(r,o),s={value:i&&i.value,targetId:r,targetType:e,expressionType:o};return i&&i.message&&(s.message=i.message),s}getExpressionConfig(t,e,o=["compute","dependency","validate"],r){return{description:"表达式",title:"表达式",properties:{...this.getExpressionEditorOptions(t,e,o,r)}}}getExpressionOptions(t,e,o){const r=this.getExpressionInfo(t,e,o);return{dialogTitle:`${this.expressionNames[o]}编辑器`,singleExpand:!1,showMessage:o==="required",beforeOpen:()=>this.onBeforeOpenExpression(t,o,e),expressionInfo:r}}}class Pn{constructor(t,e){j(this,"componentId");j(this,"viewModelId");j(this,"eventsEditorUtils");j(this,"formSchemaUtils");j(this,"formMetadataConverter");j(this,"designViewModelUtils");j(this,"designViewModelField");j(this,"controlCreatorUtils");j(this,"designerHostService");j(this,"schemaService",null);j(this,"metadataService",null);j(this,"propertyConfig",{type:"object",categories:{}});var o;this.componentId=t,this.designerHostService=e,this.eventsEditorUtils=e.eventsEditorUtils,this.formSchemaUtils=e.formSchemaUtils,this.formMetadataConverter=e.formMetadataConverter,this.viewModelId=((o=this.formSchemaUtils)==null?void 0:o.getViewModelIdByComponentId(t))||"",this.designViewModelUtils=e.designViewModelUtils,this.controlCreatorUtils=e.controlCreatorUtils,this.metadataService=e.metadataService,this.schemaService=e.schemaService}getTableInfo(){var t;return(t=this.schemaService)==null?void 0:t.getTableInfoByViewModelId(this.viewModelId)}setDesignViewModelField(t){var o;const e=t.binding&&t.binding.type==="Form"&&t.binding.field;if(e){if(!this.designViewModelField){const r=this.designViewModelUtils.getDgViewModel(this.viewModelId);this.designViewModelField=r.fields.find(i=>i.id===e)}t.updateOn=(o=this.designViewModelField)==null?void 0:o.updateOn}}getBasicPropConfig(t){return{description:"Basic Information",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"combo-list",textField:"name",valueField:"value",idField:"value",editable:!1,data:[{value:t.type,name:ae[t.type].name}]}}}}}getAppearanceConfig(t=null,e={},o){const r={title:"外观",description:"Appearance"},i={class:{title:"class样式",type:"string",description:"组件的CSS样式",$converter:"/converter/appearance.converter"},style:{title:"style样式",type:"string",description:"组件的样式",$converter:"/converter/appearance.converter"}};for(const s in e)i[s]=Object.assign(i[s]||{},e[s]);return{...r,properties:{...i},setPropertyRelates(s,l){if(s){switch(s&&s.propertyID){case"class":case"style":{zt.value++;break}}o&&o(s,t,l)}}}}getPropertyEditorParams(t,e=[],o="visible",r={},i={}){const{getVariables:s,getControlName:l,getStateMachines:c}=Fa(this.designerHostService),f=this.getRealTargetType(t),d=e&&e.length>0?e:["Const","Variable","StateMachine","Expression"],u={type:"property-editor",propertyTypes:d};return d.map(p=>{switch(p){case"Const":Object.assign(u,{constType:"enum",constEnums:[{id:!0,name:"是"},{id:!1,name:"否"}]},r);break;case"Expression":u.expressionConfig=this.getExpressionOptions(t,f,o);break;case"StateMachine":u.stateMachines=c();break;case"Variable":Object.assign(u,{controlName:l(t),newVariablePrefix:"is",newVariableType:"Boolean",variables:s(this.viewModelId),onBeforeOpenVariables:h=>{h.value=s(this.viewModelId)}},i);break}}),u}getVisibleProperty(t,e=""){return{visible:{title:"是否可见",type:"boolean",description:"运行时组件是否可见",editor:this.getPropertyEditorParams(t,e==="gridFieldEditor"?["Const","Expression"]:["Const","Variable","StateMachine","Expression"],"visible")}}}getBehaviorConfig(t,e="",o={},r){const i={title:"行为",description:""},s=this.getVisibleProperty(t,e);for(const c in o)s[c]=Object.assign(s[c]||{},o[c]);const l=this;return{...i,properties:{...s},setPropertyRelates(c,f){if(c){switch(c.propertyID){case"disabled":case"readonly":case"visible":l.afterMutilEditorChanged(t,c);break}r&&r(c,f)}}}}afterMutilEditorChanged(t,e){this.addNewVariableToViewModel(e,this.viewModelId),this.updateExpressionValue(e),this.clearExpression(e,t)}updateElementByParentContainer(t,e){const o=e&&e.parent&&e.parent.schema;if(!o)return;const r=o.contents.findIndex(s=>s.id===t),i=Ee.cloneDeep(o.contents[r]);o.contents.splice(r,1),o.contents.splice(r,0,i),On()}addNewVariableToViewModel(t,e){const o=t.propertyValue;if(!(o&&typeof o=="object")||!(o.type==="Variable"&&o.isNewVariable))return;const s={id:o.field,category:"locale",code:o.fullPath,name:o.fullPath,type:o.newVariableType||"String"};delete o.newVariableType,delete o.isNewVariable,this.formSchemaUtils.getVariableByCode(s.code)||this.formSchemaUtils.getViewModelById(e).states.push(s)}updateExpressionValue(t){const e=t.propertyValue;if(!((e&&e.type)==="Expression"&&e.expressionInfo))return;const{expressionId:i,expressionInfo:s}=e,{targetId:l,targetType:c,expressionType:f,value:d,message:u}=s,p=this.formSchemaUtils.getModule();p.expressions??(p.expressions=[]);const{expressions:h}=p;let m=h.find(x=>x.target===l);m||(m={target:l,rules:[],targetType:c},h.push(m));const M=m.rules.find(x=>x.type===f);if(M)M.value=d,M.message=u;else{const x={id:i,type:f,value:d,message:u};m.rules.push(x)}delete e.expressionInfo}clearExpression(t,e){const o=t.propertyValue;if(o&&o.type==="Expression")return;const i=t.propertyID,s=this.formSchemaUtils.getExpressions(),l=e.binding?e.binding.field:e.id,c=s.find(f=>f.target===l);!c||!c.rules||(c.rules=c.rules.filter(f=>f.type!==i))}getExpressionOptions(t,e,o){return new Sa(this.formSchemaUtils).getExpressionOptions(t,e,o)}getRealTargetType(t){return["response-toolbar-item","tab-toolbar-item","section-toolbar-item"].indexOf(t.type)>-1?"Button":t.binding&&t.binding.field?"Field":"Container"}}class ka{constructor(){j(this,"label","");j(this,"id","");j(this,"columnInSM",12);j(this,"columnInMD",6);j(this,"columnInLG",3);j(this,"columnInEL",2);j(this,"displayWidthInSM",1);j(this,"displayWidthInMD",1);j(this,"displayWidthInLG",1);j(this,"displayWidthInEL",1);j(this,"displayColumnCountAtBreakPoint","md");j(this,"tagRow",0);j(this,"showTopBorder",0);j(this,"group",1);j(this,"isSupportedClass",!0);j(this,"fieldSetId","")}}function Va(n){let t,e;const o=new Map;let r=[];function i(d,u){const h=d.split(" ").filter(v=>v.startsWith("col-"));if(h.length===0){u.isSupportedClass=!1;return}let m=h.find(v=>/^col-([1-9]|10|11|12)$/.test(v)),M=h.find(v=>/^col-md-([1-9]|10|11|12)$/.test(v)),x=h.find(v=>/^col-xl-([1-9]|10|11|12)$/.test(v)),y=h.find(v=>/^col-el-([1-9]|10|11|12)$/.test(v));m=m||"col-12",u.columnInSM=parseInt(m.replace("col-",""),10),u.displayWidthInSM=u.columnInSM/12,u.displayWidthInSM!==1&&(u.isSupportedClass=!1),M=M||"col-md-"+u.columnInSM,u.columnInMD=parseInt(M.replace("col-md-",""),10),u.displayWidthInMD=u.columnInMD/6,[1,2].includes(u.displayWidthInMD)||(u.isSupportedClass=!1),x=x||"col-xl-"+u.columnInMD,u.columnInLG=parseInt(x.replace("col-xl-",""),10),u.displayWidthInLG=u.columnInLG/3,[1,2,3,4].includes(u.displayWidthInLG)||(u.isSupportedClass=!1),y=y||"col-el-"+u.columnInLG,u.columnInEL=parseInt(y.replace("col-el-",""),10),u.displayWidthInEL=u.columnInEL/2,[1,2,3,4,5,6].includes(u.displayWidthInEL)||(u.isSupportedClass=!1)}function s(d,u,p,h=!1){let m=!1;d.contents.forEach(M=>{if(M.type==="fieldset"){p+=1,s(M,u,p,!0),m=!0;return}m&&(p+=1,m=!1);const x=M.appearance&&M.appearance.class,y=new ka;x?i(x,y):y.isSupportedClass=!1,y.label=M.label||M.id,y.id=M.id,y.group=p,h&&(y.fieldSetId=d.id),e===M.id&&(t=p),o.set(M.id,M),u.push(y)})}function l(d){const u=n.getComponentById(d);if(!u||!u.componentType||!u.componentType.startsWith("form"))return{result:!1,message:"只可以在响应式表单组件中调整响应式布局配置"};const p=n.selectNode(u,h=>h.type===Tt.DgControl["response-form"].type);return!p||!p.contents||p.contents.length===0?{result:!1,message:"Form区域内没有控件,请先添加控件"}:{result:!0,message:"",formNode:p}}function c(d,u){u=u||d.id;const{result:p,message:h,formNode:m}=l(u);if(!p)return{result:p,message:h};e=d.id,r=[],o.clear();const M=m.contents[0].type===Tt.DgControl.fieldset.type?0:1;s(m,r,M);const x=r.find(v=>!v.isSupportedClass);return{defaultState:{defaultGroupNumber:t||1,model:x?"customize":"standard"},importData:r}}function f(d,u){u=u;const{result:p,formNode:h}=l(u);if(!p)return"";const m=[];return d.forEach(M=>{var v;const x=o.get(M.id),y=x.appearance&&x.appearance.class;if(y){const _=y.split(" ").filter(N=>!N.startsWith("col-")),S="col-"+M.columnInSM,T="col-md-"+M.columnInMD,g="col-xl-"+M.columnInLG,V="col-el-"+M.columnInEL,F=[S,T,g,V].concat(_);x.appearance.class=F.join(" ")}if(M.fieldSetId){const b=h.contents.find(S=>S.id===M.fieldSetId),_=m.find(S=>S.id===M.fieldSetId);_?(v=_.contents)==null||v.push(x):(m.push(b),b.contents=[x])}else m.push(x)}),h.contents=m,h.id}return{checkCanFindFormNode:l,checkCanOpenLayoutEditor:c,changeFormControlsByResponseLayoutConfig:f,getResonseFormLayoutConfig:s}}function Ma(n,t){function e(c,f=null){if(f)return f;const d=n.getComponentById(t);return n.selectNode(d,u=>u.id===c)}function o(c){const f=n.getComponentById(c);return!(!f||!f.componentType||!f.componentType.startsWith("form"))}function r(c){const f=new Set(c);return Array.from(f).length===1}function i(c){const f=e(c.id),d=Va(n),u=[];d.getResonseFormLayoutConfig(f,u,1);const p=u.map(_=>_.columnInSM),h=u.map(_=>_.columnInMD),m=u.map(_=>_.columnInLG),M=u.map(_=>_.columnInEL),x=r(p)?p[0]:0,y=r(h)?h[0]:0,v=r(m)?m[0]:0,b=r(M)?M[0]:0;return{uniqueColClassInSM:x,uniqueColClassInMD:y,uniqueColClassInLG:v,uniqueColClassInEL:b}}function s(c,f){let d,u,p,h,m=[];if(c){const _=c.split(" "),S=_.filter(T=>T.startsWith("col-"));d=S.find(T=>/^col-([1-9]|10|11|12)$/.test(T)),u=S.find(T=>/^col-md-([1-9]|10|11|12)$/.test(T)),p=S.find(T=>/^col-xl-([1-9]|10|11|12)$/.test(T)),h=S.find(T=>/^col-el-([1-9]|10|11|12)$/.test(T)),m=_.filter(T=>!T.startsWith("col-"))}const M=f.uniqueColClassInSM?"col-"+f.uniqueColClassInSM:d,x=f.uniqueColClassInMD?"col-md-"+f.uniqueColClassInMD:u,y=f.uniqueColClassInLG?"col-xl-"+f.uniqueColClassInLG:p,v=f.uniqueColClassInEL?"col-el-"+f.uniqueColClassInEL:h;return[M,x,y,v].concat(m).join(" ")}function l(c,f,d){c=e(d,c),c.contents.forEach(u=>{if(u.type===Tt.DgControl.fieldset.type){l(u,f,u.id);return}u.appearance||(u.appearance={});const p=u.appearance.class;u.appearance.class=s(p,f)})}return{checkIsInFormComponent:o,assembleUnifiedLayoutContext:i,changeFormControlsByUnifiedLayoutConfig:l}}class Na extends Pn{constructor(t,e){super(t,e)}getPropertyConfig(t,e){const o=this;this.propertyConfig.categories.basic=this.getBasicPropConfig(t);const{checkIsInFormComponent:r,assembleUnifiedLayoutContext:i,changeFormControlsByUnifiedLayoutConfig:s}=Ma(this.formSchemaUtils,this.componentId),l=this.getAppearanceConfig(t),c=r(this.componentId);return l.properties.labelAutoOverflow={title:"控件标签换行",description:"控件标签字数超长时,换行显示。控件标签与输入框在一行展示时,此属性有效。",visible:c,type:"boolean"},l.properties.unifiedLayout={title:"统一布局配置",description:"统一配置卡片区域内所有控件的宽度,只支持标准模式",visible:c,refreshPanelAfterChanged:!0,editor:{type:"response-form-layout-setting",initialState:i(t)}},l.setPropertyRelates=function(f,d){if(f)switch(f&&f.propertyID){case"unifiedLayout":{s(null,f.propertyValue,t.id),o.updateElementByParentContainer(t.id,e);break}case"labelAutoOverflow":{o.setLabelAutoOverflow(t,f.propertyValue);break}}},this.propertyConfig.categories.appearance=l,this.propertyConfig.categories.behavior=this.getBehaviorConfig(t),this.propertyConfig}setLabelAutoOverflow(t,e){const o=this.formSchemaUtils.getComponentById(this.componentId),r=this.formSchemaUtils.selectNode(o,i=>i.id===t.id);r&&r.contents&&r.contents.length&&(r.contents.forEach(i=>{i.appearance||(i.appearance={class:""}),i.appearance.class||(i.appearance.class=""),e?i.appearance.class.includes("farris-group-multi-label")||(i.appearance.class=i.appearance.class+" farris-group-multi-label"):i.appearance.class=i.appearance.class.replace("farris-group-multi-label","").trim()}),On())}}function Bn(n,t){const e=n.schema,o=new ba,{canMove:r,canAccept:i,canDelete:s}=o.getTemplateRule(n,t);function l(C,k){const{sourceElement:D}=C,{componentInstance:B}=D,O=t==null?void 0:t.formSchemaUtils;if(!O)return!0;const P=O.getComponentById(B.value.belongedComponentId),A=O.getViewModelById(P.viewModel),E=O.getComponentById(n.componentInstance.value.belongedComponentId),I=O.getViewModelById(E.viewModel);return k?A!=null&&A.id&&(I!=null&&I.id)&&A.id!==I.id?A.bindTo===I.bindTo:!0:(A==null?void 0:A.id)===(I==null?void 0:I.id)}function c(C){const{bindingTargetId:k}=C;if(!t)return;const{formSchemaUtils:D,schemaService:B}=t,O=D.getComponentById(n.componentInstance.value.belongedComponentId),P=B.getFieldByIDAndVMID(k,O.viewModel);return!!(P!=null&&P.schemaField)}function f(C){const k=o.getComponentContext(n);if(k&&k.componentClassList&&k.componentClassList.includes("f-form-layout")&&k.componentClassList.includes("farris-form")){if(C.sourceType==="control"&&(C.componentCategory==="input"||C.componentType==="fieldset"))return!0;if(C.sourceType==="move"){if(C.componentType==="form-group")return l(C,!0);if(C.componentType==="fieldset")return l(C,!1)}return C.sourceType==="field"&&C.componentCategory==="input"?c(C):!1}return!0}function d(C){return!(!va().basalDragulaRuleForContainer(C,t)||!i||!f(C))}function u(C){var I;const k=C.componentInstance,D=k.value.schema,B=t==null?void 0:t.formSchemaUtils,O=t==null?void 0:t.designViewModelUtils,P=B.getViewModelIdByComponentId(k.value.belongedComponentId),A=O.getDgViewModel(P),E=k.value.parent;if(E&&Tt.DgControl.fieldset&&((I=E.schema)==null?void 0:I.type)===Tt.DgControl.fieldset.type&&A){const H={groupId:null,groupName:null};switch(D.binding.type){case yt.FormBindingType.Form:{A.changeField(D.binding.field,H);break}case yt.FormBindingType.Variable:{B.modifyViewModelFieldById(P,D.binding.field,H,!0);break}}}}function p(C,k,D){const B=k.fields.find(I=>I.id===C),O=t==null?void 0:t.designViewModelUtils,P=O.getDgViewModel(k.id),A=P.fields.find(I=>I.id===C);P.removeField([C]);const E=O.getDgViewModel(D);E.addField(A),B.fieldSchema&&E.changeField(A.id,B.fieldSchema)}function h(C,k,D,B=[]){const O=k.id,P=C.binding.field,A=k.fields.findIndex(I=>I.id===P);if(A>-1&&(D.fields.push(k.fields[A]),k.fields.splice(A,1)),O==="root-viewmodel"&&D.id!=="root-viewmodel"){C.binding.path&&!C.binding.path.includes("root-component.")&&(C.binding.path="root-component."+C.binding.path);return}if(D.id==="root-viewmodel"&&O!=="root-viewmodel"&&C.binding.path&&C.binding.path.includes("root-component.")){C.binding.path=C.binding.path.replace("root-component.","");return}const E=k.states.find(I=>I.id===P);E&&(D.states=D.states?D.states:[],D.states.findIndex(I=>I.id===E.id)<0&&(D.states.push(E),B.push(E.id)))}function m(C,k,D,B=[]){var A;if(!C)return;const O=k.id==="root-viewmodel"&&D.id!=="root-viewmodel",P=D.id==="root-viewmodel"&&k.id!=="root-viewmodel";Object.keys(C).forEach(E=>{if(E==="binding")return;const I=C[E];if(I&&typeof I=="object"&&I.type===yt.FormBindingType.Variable&&I.field){if(O){I.path&&!I.path.includes("root-component.")&&(I.path="root-component."+I.path);return}if(P&&I.path&&I.path.includes("root-component.")){I.path=I.path.replace("root-component.","");return}const H=k.states.find($=>$.id===I.field);if(H){B.push(H.id),D.states=D.states?D.states:[];const $=D.states.find(W=>W.code===H.code);if($)I.field=$.id;else{const W=Object.assign({},{newId:ke.useGuid().guid()},H);D.states.push(W),I.field=W.newId}}}}),(A=D.states)!=null&&A.length&&D.states.map(E=>{E.newId&&(E.id=E.newId,delete E.newId)})}function M(C,k,D){if(C&&(k(C,D),C.contents))for(const B of C.contents)M(B,k,D)}function x(C=[],k){if(!C.length)return;const D=t==null?void 0:t.formSchemaUtils,B=D.getComponentByViewModelId(k),O=[],P=(E,I)=>{E&&(Object.keys(E).forEach(H=>{const $=E[H];$&&typeof $=="object"&&$.type===yt.FormBindingType.Variable&&C.includes($.field)&&!I.includes($.field)&&I.push($.field)}),E.editor&&P(E.editor,I))};M(B,P,O);const A=D.getViewModelById(k);C.forEach(E=>{O.includes(E)||(A.states=A.states.filter(I=>I.id!==E))})}function y(C){const k=ke.useGuid().guid(),D=Object.assign({},C,{id:k,code:C.code+k.slice(0,4),name:C.name+k.slice(0,4)}),P=(t==null?void 0:t.formSchemaUtils).getCommands().find(A=>A.id===C.cmpId);return P&&P.refedHandlers.push({host:k,handler:C.handlerName}),D}function v(C,k,D){var H,$,W;const B={},O=C.type==="form-group"&&C.editor?C.editor.type:C.type,P=(H=tn.schemaMap[O])==null?void 0:H.events;if(!P)return;Object.keys(C).forEach(G=>{const X=Object.keys(P).find(K=>K===G);if(X&&C[X]){const K=k.commands.find(Q=>Q.code===C[X]);if(K){let Q=B[K.code];Q||(Q=y(K),B[K.code]=Q,D.commands.push(Q)),C[X]=Q.code}}});const E=(t==null?void 0:t.designViewModelUtils).getDgViewModel(D.id),I=["valueChanging","valueChanged"];if((($=C.binding)==null?void 0:$.type)===yt.FormBindingType.Form){const G=(W=D.fields)==null?void 0:W.find(X=>X.id===C.binding.field);G&&I.forEach(X=>{if(G[X]){const K=k.commands.find(Q=>Q.code===G[X]);if(!K)return;if(B[K.code])E.changeField(G.id,{[X]:B[K.code].code});else{const Q=y(K);B[K.code]=Q,D.commands.push(Q),E.changeField(G.id,{[X]:Q.code})}}})}}function b(C){const k=t==null?void 0:t.formSchemaUtils,D=C.componentInstance,B=D.value.schema,O=k.getViewModelIdByComponentId(D.value.belongedComponentId),P=k.getViewModelById(O),A=k.getComponentById(n.componentInstance.value.belongedComponentId),E=k.getViewModelById(A.viewModel);if(O!==E.id){const I=B.binding.type,H=B.binding.field,$=[];switch(I){case yt.FormBindingType.Form:{p(H,P,E.id);break}case yt.FormBindingType.Variable:{h(B,P,E,$);break}}m(B,P,E,$),m(B.editor,P,E,$),v(B,P,E),O!=="root-viewmodel"&&x($,O)}}function _(C){if(!C||!C.componentInstance)return;const D=C.componentInstance.value.schema;!D.binding||!D.binding.field||(u(C),b(C))}function S(){return e.componentType?"display:inherit;flex-direction:inherit;margin-bottom:10px":""}function T(C){let k="";switch(C){case 1:{k="col-12";break}case 2:{k="col-12 col-md-6 col-xl-6 col-el-6";break}case 3:{k="col-12 col-md-6 col-xl-4 col-el-4";break}case 4:{k="col-12 col-md-6 col-xl-3 col-el-2";break}}return k}function g(C){const k=n.componentInstance.value.getBelongedComponentInstance(n.componentInstance);if(k&&k.schema&&k.schema.componentType){const{formColumns:D}=k.schema;let B=T(D);B=t==null?void 0:t.formSchemaUtils.getControlClassByFormUnifiedLayout(B,k.schema.id,n.schema),C.appearance||(C.appearance={}),C.appearance.class=B}}function V(C,k,D,B){const{bindingSourceContext:O,parentComponentInstance:P}=C;if(O!=null&&O.entityFieldNode&&P){const A=t==null?void 0:t.designViewModelUtils,I=(t==null?void 0:t.formSchemaUtils).getViewModelIdByComponentId(P.belongedComponentId),H=A.getDgViewModel(I);H.removeField([O.entityFieldNode.id]),H.addField(O.designViewModelField),k&&H.changeField(O.entityFieldNode.id,{editor:{$type:k},groupId:D,groupName:B})}}function F(C,k){var P,A,E;const D=e;if((D.appearance&&D.appearance.class||"").split(" ").includes("f-form-layout")&&C.componentCategory==="input"){const{label:I}=C;let H;return(P=C.bindingSourceContext)!=null&&P.entityFieldNode?H=(t==null?void 0:t.controlCreatorUtils).setFormFieldProperty((A=C.bindingSourceContext)==null?void 0:A.entityFieldNode,k==null?void 0:k.type):(H=tn.getSchemaByType("form-group"),H.editor=k,H.label=I),g(H),V(C,(E=H.editor)==null?void 0:E.type),H}return k}function N(){return r}function w(){return s}function R(){return!1}function L(C){return new Na(C,t).getPropertyConfig(e,n.componentInstance.value)}return{canAccepts:d,checkCanDeleteComponent:w,checkCanMoveComponent:N,getStyles:S,getPropsConfig:L,hideNestedPaddingInDesginerView:R,onAcceptMovedChildElement:_,onResolveNewComponentSchema:F,moveInputBetweenComponent:b,resolveFormGroupAppearance:g,syncFieldToViewModel:V}}const Ia=a.defineComponent({name:"FResponseFormDesign",directives:{"area-response":ke.areaResponseDirective},props:Dt,emits:[],setup(n,t){const e=a.ref(),o=a.inject("design-item-context"),r=a.inject("designer-host-service"),i=Bn(o,r),s=un(e,o,i);a.onMounted(()=>{e.value.componentInstance=s}),t.expose(s.value);const l=a.computed(()=>{const c=n.customClass.split(" "),f={"drag-container":!0};return c.reduce((d,u)=>(d[u]=!0,d),f),f});return()=>a.withDirectives(a.createVNode("div",{ref:e,class:l.value,style:n.customClass,"data-dragref":`${o.schema.id}-container`,"data-associate":`${o.schema.id}-component`},[t.slots.default&&t.slots.default()]),[[a.resolveDirective("area-response")]])}}),Ea={id:{type:String},required:{type:Boolean,default:!1},text:{type:String,default:""},title:{type:String},valid:{type:Boolean,default:!0},inValidTip:{type:String,default:""}},jn=a.defineComponent({name:"FDynamicFormLabel",props:Ea,emits:[],setup(n,t){a.ref(n.title||n.text);const e=a.ref(n.required),o=a.ref(n.text),r=a.ref(n.valid),i=a.ref(n.inValidTip);a.watch(()=>n.text,()=>{o.value=n.text}),a.watch(()=>n.required,(c,f)=>{c!==f&&(e.value=c)}),a.watch([()=>n.valid,()=>n.inValidTip],([c,f])=>{r.value=c,i.value=f});const s=a.computed(()=>r.value?o.value:i.value),l=a.computed(()=>r.value?"":"color:red");return()=>o.value&&a.createVNode("label",{class:"col-form-label",title:s.value,style:l.value},[!r.value&&a.createVNode("span",{class:"f-icon f-icon-warning mr-1",style:"color: red; min-width: 16px;",title:i.value},null),e.value&&a.createVNode("span",{class:"farris-label-info text-danger"},[a.createTextVNode("*")]),a.createVNode("span",{class:"farris-label-text"},[o.value])])}}),ie={},se={},le={},ce={};let Rn=!1;function Oa(){Rn||(Rn=!0,qo.register(ie,se,le,ce),Wo.register(ie,se,le,ce),Ao.register(ie,se,le,ce),Ho.register(ie,se,le,ce),Go.register(ie,se,le,ce),zo.register(ie,se,le,ce),_n.register(ie,se,le,ce),Tn.register(ie,se,le,ce),_n.register(ie,se,le,ce),Tn.register(ie,se,le,ce),Ft.register(ie,se,le,ce),Yo.register(ie,se,le,ce),Uo.register(ie,se,le,ce),Qo.register(ie,se,le,ce),Xo.register(ie,se,le,ce),Zo.register(ie,se,le,ce),Ko.register(ie,se,le,ce),Jo.register(ie,se,le,ce),nn.register(ie,se,le,ce),er.register(ie,se,le,ce),Zr.register(ie,se,le,ce),tr.register(ie,se,le,ce),nr.register(ie,se,le,ce),Hr.register(ie,se,le,ce),rr.register(ie,se,le,ce),ar.register(ie,se,le,ce),ir.register(ie,se,le,ce),lr.register(ie,se,le,ce),sr.register(ie,se,le,ce),cr.register(ie,se,le,ce),ur.register(ie,se,le,ce),dr.register(ie,se,le,ce),fr.register(ie,se,le,ce),pr.register(ie,se,le,ce),mr.register(ie,se,le,ce),hr.register(ie,se,le,ce),gr.register(ie,se,le,ce),yr.register(ie,se,le,ce),vr.register(ie,se,le,ce),br.register(ie,se,le,ce),wr.register(ie,se,le,ce),Cr.register(ie,se,le,ce),_r.register(ie,se,le,ce),Tr.register(ie,se,le,ce),xr.register(ie,se,le,ce),Wr.register(ie,se,le),Fr.register(ie,se,le,ce),Sr.register(ie,se,le,ce),kr.register(ie,se,le,ce),Vr.register(ie,se,le,ce),Mr.register(ie,se,le,ce),Nr.register(ie,se,le,ce),zr.register(ie,se,le,ce),Ir.register(ie,se,le,ce),Er.register(ie,se,le,ce),Or.register(ie,se,le,ce),Dr.register(ie,se,le,ce),Pr.register(ie,se,le,ce),Br.register(ie,se,le,ce),Rr.register(ie,se,le,ce),jr.register(ie,se,le,ce),Lr.register(ie,se,le,ce),$r.register(ie,se,le,ce),qr.register(ie,se,le,ce),or.register(ie,se,le,ce),Ar.register(ie,se,le,ce),Gr.register(ie,se,le,ce),Yr.register(ie,se,le,ce),Ur.register(ie,se,le,ce),Xr.register(ie,se,le,ce),Qr.register(ie,se,le,ce),Kr.register(ie,se,le,ce),Jr.register(ie,se,le,ce))}function Ln(){Oa();function n(s){const l=ie[s];if(!l)throw new Error(`Could not find the editor of type '${s}'`);return l}function t(s,l){const c=se[s];return c?c(l):{}}function e(s){switch(s){case"check-box":return"onChangeValue";case"switch":return"onModelValueChanged";case"check-group":return"onChangeValue";case"combo-list":case"combo-tree":return"onChange";case"combo-lookup":return"";case"date-picker":return"onDatePicked";case"date-range":return"";case"datetime-picker":return"";case"time-picker":return"onValueChange";case"datetime-range":return"";case"month-picker":return"";case"month-range":return"";case"year-picker":return"";case"year-range":return"";case"input-group":return"onChange";case"lookup":case"sort-condition-editor":case"filter-condition-editor":case"code-editor":return"onUpdate:modelValue";case"number-range":return"onValueChange";case"number-spinner":return"onValueChange";case"radio-group":return"onChangeValue";case"text":return"";case"events-editor":return"onSavedCommandListChanged";case"grid-field-editor":case"item-collection-editor":case"response-form-layout-setting":case"response-layout-editor-setting":case"response-layout-splitter":case"menu-lookup":case"json-editor":return"onChange";case"field-selector":case"binding-selector":return"onFieldSelected";case"schema-selector":return"onSchemaSelected";case"mapping-editor":return"onMappingFieldsChanged";case"textarea":return"onChange";case"query-solution-config":case"solution-preset":return"onFieldsChanged";case"property-editor":return"onValueChange";case"expression-editor":return"onExpressionChanged"}}function o(s){switch(s){case"combo-list":case"input-group":case"textarea":return"onClear"}}function r(s){switch(s){case"input-group":case"textarea":return"onMousedownEvent"}}function i(s){switch(s){case"input-group":case"textarea":return"onMouseupEvent"}}return{resolveEditorProps:t,resolveEditorType:n,getChangeFunctionName:e,getClearFunctionName:o,getMousedownFunctionName:r,getMouseupFunctionName:i}}const Da={errors:{type:Object,default:null}},Pa=a.defineComponent({name:"FValidationMessage",props:Da,emits:[],setup(n,t){const e=a.ref(n.errors);a.watch(()=>n.errors,i=>{e.value=i});const o=a.ref(!0),r=a.computed(()=>{if(e.value){const i=Object.keys(e.value).map(s=>{var l;return(l=e.value[s])==null?void 0:l.name});return i.length?i.join(" "):""}return""});return()=>r.value&&a.createVNode("div",{class:"farris-feedback f-state-invalid",onClick:()=>o.value=!o.value},[!o.value&&a.createVNode("span",{class:"f-icon f-icon-message_warning f-feedback-icon"},null),o.value&&a.createVNode("span",{class:"f-feedback-message"},[r.value])])}}),Lt=a.defineComponent({name:"FDynamicFormGroup",props:Dt,emits:["change","update:modelValue"],setup(n,t){var T;const e=a.ref(n.id),o=a.ref(n.customClass),r=a.ref(n.editor),i=a.ref(n.label),s=a.ref(n.modelValue),l=a.ref(n.readonly),c=a.ref(((T=n.editor)==null?void 0:T.required)||n.required),f=a.ref(n.showLabel),d=a.ref(n.visible);a.ref(n.type);const u=a.ref(),p=a.ref(n.errors),{resolveEditorProps:h,resolveEditorType:m,getChangeFunctionName:M,getClearFunctionName:x}=Ln(),y=a.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":l.value}));function v(g,V,F){s.value=V!==void 0?V:g,t.emit("update:modelValue",s.value),t.emit("change",s.value,{newValue:g,newModelValue:V,parameters:F})}function b(){t.emit("update:modelValue","")}const _=a.computed(()=>{const g=r.value.type||"input-group",V=m(g),F=h(g,r.value),N=M(g),w=x(r.value.type);return w&&(F[w]=b),F[N]=v,(F.id==null||F.id==="")&&(F.id=e.value),g==="number-range"&&r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"?(r.value.onBeginValueChange&&typeof r.value.onBeginValueChange=="function"&&(F.onBeginValueChange=r.value.onBeginValueChange),r.value.onEndValueChange&&typeof r.value.onEndValueChange=="function"&&(F.onEndValueChange=r.value.onEndValueChange)):g==="lookup"&&r.value["onUpdate:idValue"]&&typeof r.value["onUpdate:idValue"]=="function"?F["onUpdate:idValue"]=r.value["onUpdate:idValue"]:g==="property-editor"&&(F.onBeforeOpenVariables=r.value.onBeforeOpenVariables),()=>a.createVNode(V,a.mergeProps({ref:u},F,{modelValue:s.value,"onUpdate:modelValue":R=>s.value=R}),t.slots)});function S(){return a.createVNode(Pa,{id:`${e.value}-validation-message`,errors:p.value},null)}return a.watch([()=>n.id,()=>n.customClass,()=>n.editor,()=>n.label,()=>n.modelValue,()=>n.readonly,()=>n.required,()=>n.showLabel,()=>n.visible,()=>n.errors],([g,V,F,N,w,R,L,C,k,D])=>{var B;e.value=g,o.value=V,r.value=F,i.value=N,s.value=w,l.value=R,c.value=((B=r.value)==null?void 0:B.required)||L,f.value=C,d.value=k,p.value=D}),t.expose({editorRef:u}),()=>d.value&&a.createVNode("div",{id:`${e.value}-input-group`,class:o.value,style:n.customStyle},[a.createVNode("div",{class:"farris-group-wrap"},[a.createVNode("div",{class:y.value},[f.value&&a.createVNode(jn,{id:`${e.value}-lable`,required:c.value,text:i.value,title:i.value},null),a.createVNode("div",{class:"farris-input-wrap"},[_.value(),S()])])])])}}),$n={},Wn={},Ba={id:{Type:String,default:""},autocomplete:{Type:String,default:"off"},customClass:{Type:String,default:""},disabled:{Type:Boolean,default:!1},editable:{Type:Boolean,default:!0},enableClear:{Type:Boolean,default:!0},enableTitle:{Type:Boolean,default:!0},enableViewPassword:{Type:Boolean,default:!0},forcePlaceholder:{Type:Boolean,default:!1},groupText:{Type:String,default:""},type:{Type:String,default:"text"},max:{type:[Number,String]},min:{type:[Number,String]},maxLength:{Type:Number||void 0,default:void 0},minLength:{Type:Number||void 0,default:void 0},modelValue:{Type:String||Boolean,default:""},showBorder:{Type:Boolean,default:!0},step:{Type:Number,default:1},placeholder:{Type:String,default:""},precision:{Type:Number,default:0},readonly:{Type:Boolean,default:!1},showButtonWhenDisabled:{Type:Boolean,default:!1},tabIndex:{Type:Number,default:0},textAlign:{Type:String,default:"left"},useExtendInfo:{Type:Boolean,default:!1},extendInfo:{Type:String,default:""},value:{Type:String,default:""},autoHeight:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},rows:{type:Number,default:2},showCount:{type:Boolean,default:!1},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1},updateOn:{type:String,default:"blur"},formatValidation:{type:Object,default:{}}};function ja(n,t){const e=a.ref(n.groupText),o=a.computed(()=>n.showButtonWhenDisabled&&(n.readonly||n.disabled)),r=a.computed(()=>n.enableClear||!!n.groupText);return{appendedButtonClass:a.computed(()=>({"input-group-append":!0,"append-force-show":o.value})),appendedContent:e,shouldShowAppendedButton:r}}function Ra(n,t,e,o){const{appendedContent:r}=o,i=a.ref(n.enableViewPassword),s=a.computed(()=>n.type==="password"),l='<span class="f-icon f-icon-eye" style="color: rgb(56, 143, 255);"></span>',c='<span class="f-icon f-icon-eye"></span>',f=a.ref(!1);a.watch(()=>[n.readonly,n.disabled],([p,h])=>{s.value&&(e.value=p||h?"password":e.value,r.value=p||h?c:r.value)});function d(){return f.value=!f.value,e.value=f.value?"text":"password",r.value=f.value?l:c,!1}function u(){e.value=s.value?"password":"text",r.value=s.value?i.value?c:"":r.value}return u(),{isPassword:s,onClickAppendedButton:d}}function La(n,t,e,o,r){const{appendedButtonClass:i,appendedContent:s}=e,l=a.computed(()=>n.showButtonWhenDisabled&&(!n.editable||!n.readonly)&&!n.disabled),c=a.computed(()=>s.value&&!t.slots.groupTextTemplate),f=a.computed(()=>!!t.slots.groupTextTemplate),{clearButtonClass:d,clearButtonStyle:u,onClearValue:p,shouldShowClearButton:h}=o;function m(){return a.createVNode("span",{id:"clearIcon",class:d.value,style:u.value,onClick:g=>p(g)},[a.createVNode("i",{class:"f-icon modal_close"},null)])}function M(g){t.emit("iconMouseEnter",g)}function x(g){t.emit("iconMouseLeave",g)}function y(g){l.value&&t.emit("clickHandle",{originalEvent:g}),g.stopPropagation()}const v=n.type==="password"?r.onClickAppendedButton:y;function b(){return a.createVNode("span",{class:"input-group-text",onMouseenter:g=>M(g),onMouseleave:g=>x(g),innerHTML:s.value,onClick:g=>v(g)},null)}function _(){return t.slots.groupTextTemplate&&t.slots.groupTextTemplate()}function S(){return c.value?b:f.value?_:""}const T=S();return()=>a.createVNode("div",{class:i.value},[h.value&&m(),T&&T()])}const qn=[{key:"none",value:"无"},{key:"cellNumber",value:"手机号"},{key:"tel",value:"座机号/传真号"},{key:"telOrCell",value:"手机号/座机号/传真号"},{key:"postCode",value:"邮编"},{key:"email",value:"电子邮箱"},{key:"idCode",value:"身份证号"},{key:"carCode",value:"车牌号"},{key:"subjectCode",value:"10位数字会计科目代码"},{key:"custom",value:"自定义"}];function $a(n){switch(n){case"none":return"";case"cellNumber":return"^1[0-9]{10}$";case"tel":return"^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$";case"telOrCell":return"^(0[0-9]{2,3}\\-)?([2-9][0-9]{6,7})+(\\-[0-9]{1,4})?$|^1[0-9]{10}$";case"postCode":return"^[1-9]\\d{5}(?!\\d)$";case"workCode":return"^\\d{8}$";case"email":return"^[A-Za-z\\d]+([-_.][A-Za-z\\d]+)*@([A-Za-z\\d]+[-.])+[A-Za-z]{2,5}$";case"idCode":return"^[1-9]\\d{5}[1-9]\\d{3}((0[1-9])|(1[0-2]))(0[1-9]|([1|2][0-9])|3[0-1])((\\d{4})|\\d{3}X)$";case"carCode":return"^([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][·\\s]?[A-HJ-NP-Z0-9]{4,5}[挂学警港澳]?|粤[Z港澳][·\\s]?[港澳][0-9A-HJ-NP-Z]{4}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?([DF][0-9A-HJ-NP-Z][0-9]{4}|[0-9]{5}[DF])[挂港澳]?|[使领][0-9]{3}[·\\s]?[0-9]{3}|临[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z][·\\s]?[0-9A-Z]{4,5}|[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼][A-Z]?[·\\s]?警[0-9A-Z]{4}|[军海空][A-Z][·\\s]?[0-9]{4,5}|WJ(?:[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]|\\d{2})[·\\s]?[0-9A-Z]{4,5})$";case"carCodeNew":return"^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF][A-HJ-NP-Z0-9][0-9]{4}))$";case"subjectCode":return"^\\d{10}$"}return""}function Wa(n){var t;return"请输入正确的"+((t=qn.find(e=>e.key===n))==null?void 0:t.value)}const qa={convertTo:(n,t,e,o)=>{n.editor.formatValidation||(n.editor.formatValidation={type:"none"}),n.editor.formatValidation.type=e,n.editor.formatValidation.expression=$a(e),n.editor.formatValidation.message=Wa(e)},convertFrom:(n,t,e)=>n.editor.formatValidation?t==="type"?n.editor.formatValidation[t]||"none":n.editor.formatValidation[t]:"none"},An={convertTo:(n,t,e,o)=>{n.editor.formatValidation||(n.editor.formatValidation={type:"none"}),n.editor.formatValidation[t]=e},convertFrom:(n,t,e)=>n.editor.formatValidation?n.editor.formatValidation[t]:n.editor[t]};class Aa extends yt.InputBaseProperty{constructor(t,e){super(t,e)}getPropertyConfig(t,e){return super.getPropertyConfig(t,e),this.propertyConfig.categories.formatValidation=this.getFormatValidation(t),this.propertyConfig}getEditorProperties(t){var o,r;let e;if(((o=t==null?void 0:t.binding)==null?void 0:o.type)==="Form"){const i=this.schemaService.getFieldByIDAndVMID(t.binding.field,this.viewModelId);(r=i==null?void 0:i.schemaField)!=null&&r.type&&(e=i.schemaField.type.length)}return this.getComponentConfig(t,{},{maxLength:{description:"文本字数最大长度",title:"最大长度",type:"number",editor:{nullable:!0,min:0,useThousands:!1,max:e}},enableViewPassword:{description:"",title:"启用密码",visible:!1,type:"boolean"}})}getFormatValidation(t){var o,r,i;const e={title:"输入格式校验",description:"输入格式校验",properties:{type:{title:"输入类型",type:"enum",description:"输入类型",defaultValue:"",editor:{type:"combo-list",textField:"value",valueField:"key",idField:"key",editable:!1,data:qn},refreshPanelAfterChanged:!0,$converter:qa}}};return(o=t.editor.formatValidation)!=null&&o.type&&((r=t.editor.formatValidation)==null?void 0:r.type)!=="none"&&(e.properties.message={title:"输入错误提示",type:"string",description:"输入错误提示",$converter:An}),((i=t.editor.formatValidation)==null?void 0:i.type)==="custom"&&(e.properties.expression={title:"匹配正则",type:"string",description:"匹配正则",$converter:An}),e}}function Ha(n,t){const e=n.schema;function o(r,i){return new Aa(r,t).getPropertyConfig(e,i)}return{getPropsConfig:o}}const Ga=a.defineComponent({name:"FInputGroupDesign",props:Ba,emits:["updateExtendInfo","clear","valueChange","clickHandle","blurHandle","focusHandle","enterHandle","iconMouseEnter","iconMouseLeave","keyupHandle","keydownHandle","inputClick"],setup(n,t){const e=a.ref(n.modelValue),o=a.ref(n.modelValue),r=ke.useTextBoxDesign(n,t,e,o),{inputGroupClass:i,inputType:s,inputGroupStyle:l}=r,c=ja(n),{shouldShowAppendedButton:f}=c,d=ke.useClear(n,t,r),{onMouseEnter:u,onMouseLeave:p}=d,h=Ra(n,t,s,c),m=a.ref(),M=a.inject("designer-host-service"),x=a.inject("design-item-context"),y=Ha(x,M),v=Tt.useDesignerComponent(m,x,y);a.onMounted(()=>{m.value.componentInstance=v}),t.expose(v.value);const b=La(n,t,c,d,h),_=a.ref();return()=>a.createVNode("div",{id:"inputGroup",ref:m,class:i.value,style:l.value,onMouseenter:u,onMouseleave:p},[a.createVNode("input",{ref:_,class:"form-control",readonly:!0,placeholder:n.placeholder},null),f.value&&b()])}});function za(){function n(s,l){const c=Wn[s];return c?c(l):{}}function t(s){return $n[s]||Ga}function e(s){}function o(s){}function r(s){}function i(s){}return{getChangeFunctionName:e,getClearFunctionName:o,resolveEditorProps:n,resolveEditorType:t,getMousedownFunctionName:r,getMouseupFunctionName:i}}const Rt=class Rt{static getEditorTypesByMDataType(t,e=""){let o=Rt.fieldControlTypeMapping[t];if(e==="data-grid-column"&&(o!=null&&o.length)){const r=[ae["check-group"].type,ae["radio-group"].type];o=o.filter(i=>!r.includes(i.key))}return o}static getAllInputTypes(){const t=[];for(const e in Rt.fieldControlTypeMapping)Rt.fieldControlTypeMapping[e].forEach(o=>{t.find(r=>r.key===o.key&&r.value===o.value)||t.push({key:o.key,value:o.value})});return t}static mappingDomPropAndSchemaProp(t,e){var i;const o=(i=t.editor)==null?void 0:i.type,r=[];return(t.type===ae["data-grid-column"].type||t.type===ae["tree-grid-column"].type)&&e&&e.categoryId&&e.categoryId.indexOf("gridFieldEditor")<0&&r.push({domField:"title",schemaField:"name"}),r.push({domField:"label",schemaField:"name"}),r.push({domField:"editor.required",schemaField:"require"}),r.push({domField:"editor.readonly",schemaField:"readonly"}),(o===ae["input-group"].type||o===ae.textarea.type||o===ae["number-spinner"].type)&&r.push({domField:"editor.maxLength",schemaField:"type.length"}),o===ae["number-spinner"].type&&r.push({domField:"editor.precision",schemaField:"type.precision"}),(t.type===ae["data-grid-column"].type||t.type===ae["tree-grid-column"].type)&&r.push({domField:"formatter.precision",schemaField:"type.precision"}),(o===ae["combo-list"].type||o===ae["radio-group"].type)&&r.push({domField:"editor.data",schemaField:"type.enumValues"}),(t.type===ae["data-grid-column"].type||t.type===ae["tree-grid-column"].type)&&r.push({domField:"formatter.data",schemaField:"type.enumValues"}),o===ae["date-picker"].type&&(r.push({domField:"editor.displayFormat",schemaField:"editor.format"}),r.push({domField:"editor.fieldType",schemaField:"type.name"})),o===ae["number-spinner"].type&&(r.push({domField:"editor.max",schemaField:"editor.maxValue"}),r.push({domField:"editor.min",schemaField:"editor.minValue"})),o===ae.lookup.type&&(r.push({domField:"editor.dataSource",schemaField:"editor.dataSource"}),r.push({domField:"editor.valueField",schemaField:"editor.valueField"}),r.push({domField:"editor.textField",schemaField:"editor.textField"}),r.push({domField:"editor.displayType",schemaField:"editor.displayType"}),r.push({domField:"editor.mapFields",schemaField:"editor.mapFields"}),r.push({domField:"editor.helpId",schemaField:"editor.helpId"})),r.push({domField:"path",schemaField:"bindingPath"}),r.push({domField:"binding.path",schemaField:"bindingField"}),r.push({domField:"binding.fullPath",schemaField:"path"}),(t.type===ae["data-grid-column"].type||t.type===ae["tree-grid-column"].type)&&r.push({domField:"field",schemaField:"bindingPath"}),r}};j(Rt,"fieldControlTypeMapping",{String:[{key:ae["input-group"].type,value:ae["input-group"].name},{key:ae.lookup.type,value:ae.lookup.name},{key:ae["date-picker"].type,value:ae["date-picker"].name},{key:ae["check-group"].type,value:ae["check-group"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name},{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae.textarea.type,value:ae.textarea.name},{key:ae["time-picker"].type,value:ae["time-picker"].name}],Text:[{key:ae.textarea.type,value:ae.textarea.name},{key:ae.lookup.type,value:ae.lookup.name}],Decimal:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Integer:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Number:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],BigNumber:[{key:ae["number-spinner"].type,value:ae["number-spinner"].name}],Date:[{key:ae["date-picker"].type,value:ae["date-picker"].name}],DateTime:[{key:ae["date-picker"].type,value:ae["date-picker"].name}],Boolean:[{key:ae.switch.type,value:ae.switch.name},{key:ae["check-box"].type,value:ae["check-box"].name}],Enum:[{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name}],Object:[{key:ae.lookup.type,value:ae.lookup.name},{key:ae["combo-list"].type,value:ae["combo-list"].name},{key:ae["radio-group"].type,value:ae["radio-group"].name}]});let Hn=Rt;var dn=(n=>(n.Form="Form",n.Variable="Variable",n))(dn||{}),vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yt(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ya={exports:{}};(function(n,t){(function(e){n.exports=e()})(function(){return function(){function e(o,r,i){function s(f,d){if(!r[f]){if(!o[f]){var u=typeof Yt=="function"&&Yt;if(!d&&u)return u(f,!0);if(l)return l(f,!0);var p=new Error("Cannot find module '"+f+"'");throw p.code="MODULE_NOT_FOUND",p}var h=r[f]={exports:{}};o[f][0].call(h.exports,function(m){var M=o[f][1][m];return s(M||m)},h,h.exports,e,o,r,i)}return r[f].exports}for(var l=typeof Yt=="function"&&Yt,c=0;c<i.length;c++)s(i[c]);return s}return e}()({1:[function(e,o,r){var i={},s="(?:^|\\s)",l="(?:\\s|$)";function c(u){var p=i[u];return p?p.lastIndex=0:i[u]=p=new RegExp(s+u+l,"g"),p}function f(u,p){var h=u.className;h.length?c(p).test(h)||(u.className+=" "+p):u.className=p}function d(u,p){u.className=u.className.replace(c(p)," ").trim()}o.exports={add:f,rm:d}},{}],2:[function(e,o,r){(function(i){var s=e("contra/emitter"),l=e("crossvent"),c=e("./classes"),f=document,d=f.documentElement;function u(w,R){var L=arguments.length;L===1&&Array.isArray(w)===!1&&(R=w,w=[]);var C,k,D,B,O,P,A,E,I,H=null,$,W,G=!1,X=0,K,Q=R||{};Q.moves===void 0&&(Q.moves=v),Q.accepts===void 0&&(Q.accepts=v),Q.invalid===void 0&&(Q.invalid=mt),Q.containers===void 0&&(Q.containers=w||[]),Q.isContainer===void 0&&(Q.isContainer=y),Q.copy===void 0&&(Q.copy=!1),Q.copySortSource===void 0&&(Q.copySortSource=!1),Q.revertOnSpill===void 0&&(Q.revertOnSpill=!1),Q.removeOnSpill===void 0&&(Q.removeOnSpill=!1),Q.direction===void 0&&(Q.direction="vertical"),Q.ignoreInputTextSelection===void 0&&(Q.ignoreInputTextSelection=!0),Q.mirrorContainer===void 0&&(Q.mirrorContainer=f.body);var pe=s({containers:Q.containers,start:Oe,end:dt,cancel:je,remove:Ge,destroy:Y,canMove:Se,dragging:!1});return Q.removeOnSpill===!0&&pe.on("over",xt).on("out",gt),xe(),pe;function he(q){return pe.containers.indexOf(q)!==-1||Q.isContainer(q)}function xe(q){var ee=q?"remove":"add";m(d,ee,"mousedown",z),m(d,ee,"mouseup",_e)}function De(q){var ee=q?"remove":"add";m(d,ee,"mousemove",oe)}function Re(q){var ee=q?"remove":"add";l[ee](d,"selectstart",ue),l[ee](d,"click",ue)}function Y(){xe(!0),_e({})}function ue(q){$&&q.preventDefault()}function z(q){B=q.clientX,O=q.clientY;var ee=M(q)!==1||q.metaKey||q.ctrlKey;if(!ee){var ne=q.target,te=ve(ne);te&&($=te,De(),q.type==="mousedown"&&(T(ne)?ne.focus():q.preventDefault()))}}function oe(q){if($){if(M(q)===0){_e({});return}if(!(q.clientX!==void 0&&Math.abs(q.clientX-B)<=(Q.slideFactorX||0)&&q.clientY!==void 0&&Math.abs(q.clientY-O)<=(Q.slideFactorY||0))){if(Q.ignoreInputTextSelection){var ee=N("clientX",q)||0,ne=N("clientY",q)||0,te=f.elementFromPoint(ee,ne);if(T(te))return}var be=$;De(!0),Re(),dt(),ot(be),c.add(E||D,"gu-transit"),_t(),Mt(),X=0,ft(q)}}}function ve(q){if(!(pe.dragging&&C)&&!he(q)){for(var ee=q;S(q)&&he(S(q))===!1;)if(Q.invalid(q,ee)||(q=S(q),!q))return;var ne=S(q);if(ne&&!Q.invalid(q,ee)){var te=Q.moves(q,ne,ee,V(q));if(te)return{item:q,source:ne}}}}function Se(q){return!!ve(q)}function Oe(q){var ee=ve(q);ee&&ot(ee)}function ot(q){Ne(q.item,q.source)&&(E=q.item.cloneNode(!0),pe.emit("cloned",E,q.item,"copy")),k=q.source,D=q.item,P=A=V(q.item),pe.dragging=!0,pe.emit("drag",D,k)}function mt(){return!1}function dt(){if(pe.dragging){var q=E||D;Ie(q,S(q))}}function J(){$=!1,De(!0),Re(!0)}function _e(q){if(J(),!!pe.dragging){var ee=E||D,ne=N("clientX",q)||0,te=N("clientY",q)||0,be=x(C,ne,te),ye=Ct(be,ne,te);ye&&(E&&Q.copySortSource||!E||ye!==k)?Ie(ee,ye):Q.removeOnSpill?Ge():je()}}function Ie(q,ee){var ne=S(q);E&&Q.copySortSource&&ee===k&&ne.removeChild(D),ht(ee)?pe.emit("cancel",q,k):pe.emit("drop",q,ee,k,A),it()}function Ge(){if(pe.dragging){var q=E||D,ee=S(q);ee&&ee.removeChild(q),pe.emit(E?"cancel":"remove",q,ee,k),it()}}function je(q){if(pe.dragging){var ee=arguments.length>0?q:Q.revertOnSpill,ne=E||D,te=S(ne),be=ht(te);be===!1&&ee&&(E?te&&te.removeChild(E):k.insertBefore(ne,P)),be||ee?pe.emit("cancel",ne,k,k):pe.emit("drop",ne,te,k,A),it()}}function it(){var q=E||D;J(),re(),de(),q&&c.rm(q,"gu-transit"),I&&clearTimeout(I),pe.dragging=!1,H&&pe.emit("out",q,H,k),pe.emit("dragend",q,X),k=D=E=P=A=I=H=null}function ht(q,ee){var ne;return ee!==void 0?ne=ee:C?ne=A:ne=V(E||D),q===k&&ne===P}function Ct(q,ee,ne){for(var te=q;te&&!be();)te=S(te);return te;function be(){var ye=he(te);if(ye===!1)return!1;var Be=ge(te,q),Te=we(te,Be,ee,ne),$e=ht(te,Te);return $e?!0:Q.accepts(D,te,k,Te)}}function ft(q){if(!C)return;q.preventDefault();var ee=N("clientX",q)||0,ne=N("clientY",q)||0;C.style.left=ee-2+"px",C.style.top=ne-2+"px";var te=E||D,be=x(C,ee,ne),ye=Ct(be,ee,ne),Be=ye!==null&&ye!==H;(Be||ye===null)&&(me(),H=ye,st()),fe(be,ne);var Te=S(te);if(ye===k&&E&&!Q.copySortSource){Te&&Te.removeChild(te);return}var $e,rt=ge(ye,be);if(G=Pe(rt,ye),rt!==null)$e=we(ye,rt,ee,ne);else if(Q.revertOnSpill===!0&&!E)$e=P,ye=k;else{E&&Te&&Te.removeChild(te),E&&W&&(W.style.display="none");return}W.style.display="block",Vt($e,te,Be),$e?Je(rt,$e):U(ye);function Xe(Ce){pe.emit(Ce,te,H,k)}function st(){Be&&Xe("over")}function me(){H&&Xe("out")}}function Vt(q,ee,ne){(q===ee||q===V(ee))&&(A=V(ee)),(q===null&&ne||q!==ee&&q!==V(ee))&&(A=q)}function xt(q){c.rm(q,"gu-hide")}function gt(q){pe.dragging&&c.add(q,"gu-hide")}function Mt(){C||(C=document.createElement("div"),C.style="background: grey; color: white; height: 24px; text-align: center; padding: 3px 10px; min-width: 100px;border-radius: 4px; box-shadow: 0 0 6px grey;",C.innerHTML=Q.getMirrorText&&Q.getMirrorText(D)||"控件",c.add(C,"gu-mirror"),Q.mirrorContainer.appendChild(C),m(d,"add","mousemove",ft),c.add(Q.mirrorContainer,"gu-unselectable"),pe.emit("cloned",C,D,"mirror"))}function _t(){if(W=document.createElement("div"),c.add(W,"gu-insertion"),D){var q=D.getBoundingClientRect();W.style.left=q.left+"px",W.style.top=q.top+"px"}G=!1,Q.mirrorContainer.appendChild(W)}function re(){C&&(c.rm(Q.mirrorContainer,"gu-unselectable"),m(d,"remove","mousemove",ft),S(C).removeChild(C),C=null)}function de(){W&&(S(W).removeChild(W),W=null)}function ge(q,ee){for(var ne=ee;ne!==q&&S(ne)!==q;)ne=S(ne);return ne===d?null:ne}function Pe(q,ee){if(!ee)return G;var ne=q||ee&&ee.lastElementChild;if(!ne)return!0;var te=getComputedStyle(q),be=/^inline/.test(te.getPropertyValue("display"))||/^(left|right)$/.test(te.getPropertyValue("float"));if(be)return!0;if(ee){var ye=getComputedStyle(ee),Be=ye.getPropertyValue("display");if(/flex$/.test(Be)){var Te=ye.getPropertyValue("flex-direction")||"row";if(Te==="row"||Te==="row-reverse")return!ze(ee)}return!1}return!0}function ze(q){if(!q.children||!q.children.length)return!1;for(const ee of Array.from(q.children)){const te=(ee.className&&ee.className.split(" ")||[]).filter(be=>/^col(-md|-xl|-el){0,1}-([1-9]|10|11|12)$/.test(be));if(!te.length)return!1;for(const be of te){const ye=be.slice(be.lastIndexOf("-")+1);if(parseInt(ye,10)!==12)return!1}}return!0}function Je(q,ee){const ne=ee.getBoundingClientRect();if(W.style.left=ne.left+"px",W.style.top=ne.top+"px",G){if(W.style.height=ne.height+"px",W.style.width="4px",q){const te=q.getBoundingClientRect();te.top!==ne.top&&(W.style.left=te.right+"px",W.style.top=te.top+"px",W.style.height=te.height+"px")}}else if(W.style.height="4px",W.style.width=ne.width+"px",K){const te=K.getBoundingClientRect();ne.top<te.top&&(W.style.display="none")}ee===D&&D&&(W.style.display="none")}function U(q){A=null;var ee=q.lastElementChild;if(ee){var ne=ee.getBoundingClientRect();G?(W.style.left=ne.right+"px",W.style.top=ne.top+"px",W.style.height=ne.height+"px",W.style.width="4px"):(W.style.left=ne.left+"px",W.style.top=ne.bottom+"px",W.style.height="4px",W.style.width=ne.width+"px"),ee===D&&D&&(W.style.display="none")}else W.style.display="none"}function fe(q,ee){if(!Q.mirrorContainer.contains(q)||!window.scrollContainerList||!Array.from(window.scrollContainerList).length||(K=p(q),!K||!K.contains(q)))return;const ne=document.querySelector(".dgComponentSelected"),te=K.getBoundingClientRect();if(ee-30<te.top&&K.scrollTop>0){let be=K.scrollTop<10?K.scrollTop:10;K.scrollBy(0,-1*be),ne&&K.contains(ne)&&(X=X+-1*be)}if(ee+30>te.bottom&&K.scrollTop<K.scrollHeight-K.clientHeight){const be=K.scrollHeight-K.clientHeight-K.scrollTop;let ye=be<10?be:10;K.scrollBy(0,ye),ne&&K.contains(ne)&&(X=X+ye)}}function we(q,ee,ne,te){var be=Q.direction==="horizontal",ye=Q.direction==="mixed",Be=ee!==q?$e():Te();return Be;function Te(){var Xe=q.children.length,st,me,Ce;for(st=0;st<Xe;st++)if(me=q.children[st],Ce=me.getBoundingClientRect(),be&&Ce.left+Ce.width/2>ne||!ye&&!be&&Ce.top+Ce.height/2>te||ye&&Ce.left+Ce.width>ne&&Ce.top+Ce.height>te)return me;return null}function $e(){var Xe=ee.getBoundingClientRect();if(ye){var st=te-Xe.top,me=ne-Xe.left,Ce=Xe.bottom-te,et=Xe.right-ne,Ze=Math.min(me,et,st,Ce),tt;return G?tt=et<me:tt=Ce===Ze||et===Ze||me===Ze,rt(tt)}return rt(be?ne>Xe.left+b(Xe)/2:te>Xe.top+_(Xe)/2)}function rt(Xe){return Xe?V(ee):ee}}function Ne(q,ee){return typeof Q.copy=="boolean"?Q.copy:Q.copy(q,ee)}}function p(w){const R=Array.from(window.scrollContainerList);if(R.length===1){const C=Array.from(window.scrollContainerList)[0];return document.getElementById(C)}const L=h(R);for(const C of L)if(C.contains(w))return C;return null}function h(w){const R=[];return w.forEach(L=>{const C=document.getElementById(L);C&&R.push(C)}),R.sort((L,C)=>L.contains(C)?1:C.contains(L)?-1:0),R}function m(w,R,L,C){var k={mouseup:"touchend",mousedown:"touchstart",mousemove:"touchmove"},D={mouseup:"pointerup",mousedown:"pointerdown",mousemove:"pointermove"},B={mouseup:"MSPointerUp",mousedown:"MSPointerDown",mousemove:"MSPointerMove"};i.navigator.pointerEnabled?l[R](w,D[L],C):i.navigator.msPointerEnabled?l[R](w,B[L],C):(l[R](w,k[L],C),l[R](w,L,C))}function M(w){if(w.touches!==void 0)return w.touches.length;if(w.which!==void 0&&w.which!==0)return w.which;if(w.buttons!==void 0)return w.buttons;var R=w.button;if(R!==void 0)return R&1?1:R&2?3:R&4?2:0}function x(w,R,L){w=w||{};var C=w.className||"",k;return w.className+=" gu-hide",k=f.elementFromPoint(R,L),w.className=C,k}function y(){return!1}function v(){return!0}function b(w){return w.width||w.right-w.left}function _(w){return w.height||w.bottom-w.top}function S(w){return w.parentNode===f?null:w.parentNode}function T(w){return w.tagName==="INPUT"||w.tagName==="TEXTAREA"||w.tagName==="SELECT"||g(w)}function g(w){return!w||w.contentEditable==="false"?!1:w.contentEditable==="true"?!0:g(S(w))}function V(w){return w.nextElementSibling||R();function R(){var L=w;do L=L.nextSibling;while(L&&L.nodeType!==1);return L}}function F(w){return w.targetTouches&&w.targetTouches.length?w.targetTouches[0]:w.changedTouches&&w.changedTouches.length?w.changedTouches[0]:w}function N(w,R){var L=F(R),C={pageX:"clientX",pageY:"clientY"};return w in C&&!(w in L)&&C[w]in L&&(w=C[w]),L[w]}o.exports=u}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./classes":1,"contra/emitter":5,crossvent:6}],3:[function(e,o,r){o.exports=function(s,l){return Array.prototype.slice.call(s,l)}},{}],4:[function(e,o,r){var i=e("ticky");o.exports=function(l,c,f){l&&i(function(){l.apply(f||null,c||[])})}},{ticky:10}],5:[function(e,o,r){var i=e("atoa"),s=e("./debounce");o.exports=function(c,f){var d=f||{},u={};return c===void 0&&(c={}),c.on=function(p,h){return u[p]?u[p].push(h):u[p]=[h],c},c.once=function(p,h){return h._once=!0,c.on(p,h),c},c.off=function(p,h){var m=arguments.length;if(m===1)delete u[p];else if(m===0)u={};else{var M=u[p];if(!M)return c;M.splice(M.indexOf(h),1)}return c},c.emit=function(){var p=i(arguments);return c.emitterSnapshot(p.shift()).apply(this,p)},c.emitterSnapshot=function(p){var h=(u[p]||[]).slice(0);return function(){var m=i(arguments),M=this||c;if(p==="error"&&d.throws!==!1&&!h.length)throw m.length===1?m[0]:m;return h.forEach(function(y){d.async?s(y,m,M):y.apply(M,m),y._once&&c.off(p,y)}),c}},c}},{"./debounce":4,atoa:3}],6:[function(e,o,r){(function(i){var s=e("custom-event"),l=e("./eventmap"),c=i.document,f=p,d=m,u=[];i.addEventListener||(f=h,d=M),o.exports={add:f,remove:d,fabricate:x};function p(S,T,g,V){return S.addEventListener(T,g,V)}function h(S,T,g){return S.attachEvent("on"+T,v(S,T,g))}function m(S,T,g,V){return S.removeEventListener(T,g,V)}function M(S,T,g){var V=b(S,T,g);if(V)return S.detachEvent("on"+T,V)}function x(S,T,g){var V=l.indexOf(T)===-1?N():F();S.dispatchEvent?S.dispatchEvent(V):S.fireEvent("on"+T,V);function F(){var w;return c.createEvent?(w=c.createEvent("Event"),w.initEvent(T,!0,!0)):c.createEventObject&&(w=c.createEventObject()),w}function N(){return new s(T,{detail:g})}}function y(S,T,g){return function(F){var N=F||i.event;N.target=N.target||N.srcElement,N.preventDefault=N.preventDefault||function(){N.returnValue=!1},N.stopPropagation=N.stopPropagation||function(){N.cancelBubble=!0},N.which=N.which||N.keyCode,g.call(S,N)}}function v(S,T,g){var V=b(S,T,g)||y(S,T,g);return u.push({wrapper:V,element:S,type:T,fn:g}),V}function b(S,T,g){var V=_(S,T,g);if(V){var F=u[V].wrapper;return u.splice(V,1),F}}function _(S,T,g){var V,F;for(V=0;V<u.length;V++)if(F=u[V],F.element===S&&F.type===T&&F.fn===g)return V}}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{"./eventmap":7,"custom-event":8}],7:[function(e,o,r){(function(i){var s=[],l="",c=/^on/;for(l in i)c.test(l)&&s.push(l.slice(2));o.exports=s}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],8:[function(e,o,r){(function(i){var s=i.CustomEvent;function l(){try{var c=new s("cat",{detail:{foo:"bar"}});return c.type==="cat"&&c.detail.foo==="bar"}catch{}return!1}o.exports=l()?s:typeof document<"u"&&typeof document.createEvent=="function"?function(f,d){var u=document.createEvent("CustomEvent");return d?u.initCustomEvent(f,d.bubbles,d.cancelable,d.detail):u.initCustomEvent(f,!1,!1,void 0),u}:function(f,d){var u=document.createEventObject();return u.type=f,d?(u.bubbles=!!d.bubbles,u.cancelable=!!d.cancelable,u.detail=d.detail):(u.bubbles=!1,u.cancelable=!1,u.detail=void 0),u}}).call(this,typeof vt<"u"?vt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],9:[function(e,o,r){var i=o.exports={},s,l;function c(){throw new Error("setTimeout has not been defined")}function f(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=c}catch{s=c}try{typeof clearTimeout=="function"?l=clearTimeout:l=f}catch{l=f}})();function d(_){if(s===setTimeout)return setTimeout(_,0);if((s===c||!s)&&setTimeout)return s=setTimeout,setTimeout(_,0);try{return s(_,0)}catch{try{return s.call(null,_,0)}catch{return s.call(this,_,0)}}}function u(_){if(l===clearTimeout)return clearTimeout(_);if((l===f||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(_);try{return l(_)}catch{try{return l.call(null,_)}catch{return l.call(this,_)}}}var p=[],h=!1,m,M=-1;function x(){!h||!m||(h=!1,m.length?p=m.concat(p):M=-1,p.length&&y())}function y(){if(!h){var _=d(x);h=!0;for(var S=p.length;S;){for(m=p,p=[];++M<S;)m&&m[M].run();M=-1,S=p.length}m=null,h=!1,u(_)}}i.nextTick=function(_){var S=new Array(arguments.length-1);if(arguments.length>1)for(var T=1;T<arguments.length;T++)S[T-1]=arguments[T];p.push(new v(_,S)),p.length===1&&!h&&d(y)};function v(_,S){this.fun=_,this.array=S}v.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={};function b(){}i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(_){return[]},i.binding=function(_){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(_){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],10:[function(e,o,r){(function(i){var s=typeof i=="function",l;s?l=function(c){i(c)}:l=function(c){setTimeout(c,0)},o.exports=l}).call(this,e("timers").setImmediate)},{timers:11}],11:[function(e,o,r){(function(i,s){var l=e("process/browser.js").nextTick,c=Function.prototype.apply,f=Array.prototype.slice,d={},u=0;r.setTimeout=function(){return new p(c.call(setTimeout,window,arguments),clearTimeout)},r.setInterval=function(){return new p(c.call(setInterval,window,arguments),clearInterval)},r.clearTimeout=r.clearInterval=function(h){h.close()};function p(h,m){this._id=h,this._clearFn=m}p.prototype.unref=p.prototype.ref=function(){},p.prototype.close=function(){this._clearFn.call(window,this._id)},r.enroll=function(h,m){clearTimeout(h._idleTimeoutId),h._idleTimeout=m},r.unenroll=function(h){clearTimeout(h._idleTimeoutId),h._idleTimeout=-1},r._unrefActive=r.active=function(h){clearTimeout(h._idleTimeoutId);var m=h._idleTimeout;m>=0&&(h._idleTimeoutId=setTimeout(function(){h._onTimeout&&h._onTimeout()},m))},r.setImmediate=typeof i=="function"?i:function(h){var m=u++,M=arguments.length<2?!1:f.call(arguments,1);return d[m]=!0,l(function(){d[m]&&(M?h.apply(null,M):h.call(null),r.clearImmediate(m))}),m},r.clearImmediate=typeof s=="function"?s:function(h){delete d[h]}}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":9,timers:11}]},{},[2])(2)})})(Ya);const Ua={showCloseButton:{type:Boolean,default:!0},position:{type:String,default:"top-center"},timeout:{type:Number,default:3e3},theme:{type:String,default:"bootstrap"},left:{type:Number},right:{type:Number},top:{type:Number},bottom:{type:Number},id:{type:String},animate:{type:String,default:"fadeIn"},options:{type:Object},safeHtml:{type:Boolean,default:!0}},Xa={showCloseButton:{type:Boolean,default:!0},animate:{type:String,default:"fadeIn"},options:{type:Object}},fn=a.defineComponent({name:"Toast",props:Xa,emits:["close","click"],setup:(n,t)=>{const e=a.ref(n.animate),o="fadeOut",r=a.computed(()=>n.options),i=a.ref(!1),s=a.computed(()=>{const y={animated:i.value,toast:!0};return y[n.animate]=!1,y[o]=i.value,y[r.value.type]=!0,r.value.theme&&(y[r.value.theme]=!0),y}),l=a.computed(()=>{const b=`f-icon-${r.value&&r.value.type?r.value.type.replace("toasty-type-",""):"default"}`,_={"f-icon":!0};return _[b]=!0,_}),c=a.computed(()=>r.value.title||r.value.message),f=a.computed(()=>r.value.title&&r.value.message),d=a.computed(()=>!r.value.title&&r.value.message),u=a.computed(()=>n.showCloseButton),p=a.computed(()=>!!r.value.buttons||!!t.slots.default);function h(y){y.stopPropagation(),y.preventDefault(),i.value=!1,setTimeout(()=>{t.emit("close",r.value)},200)}function m(y,v){}function M(y){return`f-preten-link ${y.customClass?y.customClass:""}`}a.watch(e,()=>{e.value});const x=()=>{var y;return a.createVNode(a.Fragment,null,[a.createVNode("div",{class:"after-toast-msg text-right"},[!t.slots.default&&((y=r.value.buttons)==null?void 0:y.map(v=>a.createVNode("span",{class:M(v),onClick:b=>void 0},[v.text]))),t.slots.default&&t.slots.default()])])};return()=>a.createVNode("div",{class:s.value,style:"min-height:44px"},[u.value&&a.createVNode("button",{title:"关闭",class:"toast-close f-btn-icon f-bare",onClick:h},[a.createVNode("span",{class:"f-icon modal_close"},null)]),c.value&&a.createVNode("section",{class:"modal-tips"},[a.createVNode("div",{class:"float-left modal-tips-iconwrap"},[a.createVNode("span",{class:l.value},null)]),a.createVNode("div",{class:"modal-tips-content"},[f.value&&a.createVNode(a.Fragment,null,[a.createVNode("h5",{class:"toast-title modal-tips-title",innerHTML:r.value.title},null),a.createVNode("p",{class:"toast-msg",innerHTML:r.value.message},null),p.value&&x()]),d.value&&(r.value.buttons?a.createVNode("div",{class:"toast-title-btns-wrapper d-flex"},[a.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null),a.createVNode("div",{class:"after-toast-title text-right ml-auto"},[x()])]):a.createVNode("h5",{class:"toast-title modal-tips-title only-toast-msg",innerHTML:r.value.message},null))])])])}}),Ut=a.defineComponent({name:"Notify",props:Ua,emits:["close","empty"],setup(n,t){const e=a.computed(()=>({"farris-notify":!0})),o={left:12,right:12,top:20,bottom:12},r=a.ref(),i=a.ref(n.options),s=a.ref(n.showCloseButton),l=a.computed(()=>n.position||"bottom-right"),c=a.computed(()=>n.timeout!=null?n.timeout:3e3),f=a.computed(()=>{const p=n.bottom?n.bottom:o.bottom,h=n.top?n.top:o.top,m={transition:"all 0.2s ease",left:l.value.indexOf("left")>-1?`${n.left?n.left:o.left}px`:"",right:l.value.indexOf("right")>-1?`${n.right?n.right:o.right}px`:"",top:l.value.indexOf("top")>-1?`${h}px`:"",bottom:l.value.indexOf("bottom")>-1?`${p}px`:""};return l.value.indexOf("center")>-1&&(m.left="50%",m.marginLeft="calc(-24rem / 2)",l.value==="center-center"&&(m.top="50%",m.transform="translate(-50%, -50%)")),m});function d(p){t.emit("close")}c.value&&setTimeout(()=>{d()},c.value),t.expose({closeToast:d,container:r,notifyPosition:l});function u(p,h){d()}return()=>a.createVNode("div",{class:e.value,style:f.value,ref:r},[a.createVNode(fn,{options:i.value,showCloseButton:s.value,animate:n.animate,onClose:p=>u(p,i.value)},null)])}});class Gn{constructor(){j(this,"notifyRefs",[]);j(this,"globalConfig",a.reactive({}))}escapeAllHtml(t){if(typeof t!="string"||!t)return"";const e=document.createElement("div");return e.textContent=t||"",e.innerHTML.replace(/ /g,"&nbsp;").replace(/\\n/g,"<br>").replace(/\\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;").replace(/\\r/g,"")}createNotifyInstance(t){const e=this,r=Object.assign({timeout:3e3,position:"bottom-right",showCloseButton:!0,safeHtml:!0},this.globalConfig,{...t}),i=document.createElement("div");i.style.display="contents";const s=a.createApp({setup(){var f;const l=a.ref();function c(){l.value.container.style.transform="scale(0)",setTimeout(()=>{e.updateNotifyPositionForClose(r,l),s.unmount()},220)}if(r.position.indexOf("top")>-1){const d=e.getNotifyInstances(r.position),u=d[d.length-1];if(u){const p=u.value.container.getBoundingClientRect();r.top=p.bottom}}return r.safeHtml&&((f=r.options)!=null&&f.message)&&(r.options.message=e.escapeAllHtml(r.options.message)),a.onUnmounted(()=>{document.body.removeChild(i)}),a.onMounted(()=>{e.updateNotifyPositionForCreate(r,l)}),()=>a.createVNode(a.Transition,{mode:"out-in",name:"fade",appear:!0},{default:()=>[a.createVNode(Ut,a.mergeProps({ref:l},r,{onClose:c}),null)]})}});return s.provide("NotifyService",this),document.body.appendChild(i),s.mount(i),s}getNotifyInstances(t){return this.notifyRefs.filter(e=>e.value.notifyPosition===t)}updateNotifyPositionForCreate(t,e){if(this.notifyRefs&&this.notifyRefs.length){const o=window.innerHeight;t.position.indexOf("bottom")>-1&&this.getNotifyInstances(t.position).forEach(r=>{const i=r.value.container.getBoundingClientRect();r.value.container.style.bottom=i.height+o-i.bottom+"px"})}this.notifyRefs=[...this.notifyRefs,e]}updateNotifyPositionForClose(t,e){const o=this.notifyRefs.indexOf(e);if(t.position.indexOf("top")>-1){const r=this.getNotifyInstances(t.position),i=r.indexOf(e);r.slice(i+1).forEach(s=>{s.value.container.style.top=s.value.container.offsetTop-s.value.container.offsetHeight+"px"})}o>-1&&this.notifyRefs.splice(o,1)}show(t){return this.createNotifyInstance(t)}buildNotifyProps(t,e){let o="",r="",i,s,l;typeof e=="string"?o=e:e&&(o=e.message||"",r=e.title||"",s=e.position||null,l=e.showCloseButton!=null?e.showCloseButton:null,i=e.timeout!=null?e.timeout:null);const f={options:{type:t,message:o,title:r}};return s!=null&&(f.position=s),l!=null&&(f.showCloseButton=l),i!=null&&(f.timeout=i),f}info(t){const e=this.buildNotifyProps("info",t);return this.show(e)}success(t){const e=this.buildNotifyProps("success",t);return this.show(e)}warning(t){const e=this.buildNotifyProps("warning",t);return this.show(e)}error(t){const e=this.buildNotifyProps("error",t);return this.show(e)}close(t){t&&t.unmount()}closeAll(){this.notifyRefs.forEach(t=>{t==null||t.value.closeToast()}),this.notifyRefs.length=0}}const Qa=Symbol("NOTIFY_SERVICE_TOKEN");Ut.install=n=>{n.component(Ut.name,Ut),n.component(fn.name,fn);const t=new Gn;n.provide(Qa,t),n.provide("FNotifyService",t)};const zn=new Map([["appearance",rn],["column","columnOption"]]);function Za(n,t,e){var u;const o=e.parentComponentInstance,r=o.schema.type,i=String(((u=o.schema.appearance)==null?void 0:u.class)||"").split(" "),s=r==="section"||r==="tab-page",l=i.includes("f-page-content-nav"),c=i.includes("f-page-main"),f=n.getSchemaByType("component");f.id=`${t.id}-component`,f.componentType="data-grid";let d="";return d+=s?"f-struct-data-grid-in-card f-struct-is-subgrid":"",d+=l?"f-struct-data-grid-in-nav f-struct-wrapper f-utils-fill-flex-column":"",d+=c?"f-struct-data-grid f-struct-wrapper":"",f.appearance={class:d},f.contents=[t],f}function Ka(n,t,e){const o=e.parentComponentInstance,r=String(o.schema.appearance.class||"").split(" "),i=r.includes("f-page-content-nav"),s=r.includes("f-page-main"),l=n.getSchemaByType("section");l.id=`${t.id}-section`;let c="";return c+=i?"f-section-in-nav ":"",c+=s?"f-section-in-managelist ":"",c+="f-section-grid",l.appearance={class:c},l.contents=[t],l}function Ja(n,t,e){const o=n.getSchemaByType("content-container");return o.id=`${t.id}-layout`,o.appearance={class:"f-grid-is-sub f-utils-flex-column"},o.contents=[t],o}function Yn(n,t,e){const r=e.parentComponentInstance.schema.type,i=r==="section"||r==="tab-page";t.appearance={class:"f-component-grid"};const l=(i?Ja:Ka)(n,t,e);return Za(n,l,e)}const Un={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/tree-grid.schema.json",title:"tree-grid",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"tree-grid"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},fit:{type:"boolean",default:!1},showStripe:{type:"boolean",default:!0},showBorder:{type:"boolean",default:!1},showTreeNodeIcons:{type:"boolean",default:!1},showSetting:{type:"boolean",default:!1},size:{description:"",type:"object",properties:{width:{type:"number"},height:{type:"number"}},default:null},dataSource:{description:"",type:"string",default:""},columns:{description:"",type:"array",default:[]},identifyField:{description:"",type:"string"},editable:{description:"",type:"boolean",default:!1},disabled:{description:"",type:"boolean",default:!1},visible:{description:"",type:"boolean",default:!0},cell:{type:"object",properties:{highlightFocusingCell:{description:"",type:"boolean",default:!1},mergeCell:{description:"",type:"boolean",default:!1},showEditableIcon:{description:"",type:"boolean",default:!1}}},column:{type:"object",properties:{fitColumns:{description:"",type:"boolean",default:!1},fitMode:{description:"",type:"string",default:"average"},groups:{description:"",type:"array",default:[]},reorderColumn:{description:"Enable to drag column to reorder",type:"boolean",default:!1},resizeColumn:{type:"boolean",default:!0},resizeColumnOnDoubleClick:{description:"",type:"boolean",default:!0}}},command:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},commands:{type:"array",default:[]},commandColumnWidth:{description:"",type:"number",default:120},onClickDeleteCommand:{description:"",type:"string",default:""},onClickEditCommand:{description:"",type:"string",default:""}}},contextMenu:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},customizaiton:{type:"object",properties:{enableScheme:{description:"",type:"boolean",default:!1},enableSetting:{description:"",type:"boolean",default:!1}}},edit:{type:"obejct",properties:{mode:{description:"",type:"string",default:"cell",enum:["cell","row","card"]},selectOnEditing:{description:"",type:"boolean",default:!1},onAppendRow:{description:"",type:"string",default:""},onBeforeEdit:{description:"",type:"string",default:""}}},filter:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},filterStyle:{description:"",type:"string",default:"filter-column",enum:["filter-column","filter-row"]},mode:{description:"",type:"string",default:"server",enum:["client","server"]},showSummary:{description:"",type:"boolean",default:!0},onFilterChange:{description:"",type:"string",default:""}}},footer:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customFooterStyle:{description:"",type:"object"},footerDataCommand:{description:"",type:"string",default:""},footerDataFrom:{description:"",type:"string",default:"client"},footerHeight:{description:"",type:"number",default:29},footerPosition:{description:"",type:"string",default:"bottom"},footerTemplate:{description:"",type:"string",default:""}}},group:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customGroupRow:{description:"",type:"object"},customGroupRowStyle:{description:"",type:"obejct"},customSummaryStyle:{description:"",type:"obejct"},groupColSpan:{description:"",type:"number",default:1},groupFields:{description:"",type:"array",default:[]},showGroupedColumn:{description:"",type:"boolean",default:!0},showGroupPanel:{description:"",type:"boolean",default:!1},showSummary:{description:"",type:"boolean",default:!1},summaryPosition:{description:"",type:"string",default:"separate",enum:["separate","merge-to-group"]},disableGroupOnEditing:{description:"",type:"boolean",default:!0},expandGroupRows:{description:"",type:"boolean",default:!0}}},header:{type:"object",properties:{wrapHeadings:{description:"",type:"boolean",default:!1}}},pagination:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},disablePagination:{description:"",type:"string",default:""},contentTemplate:{description:"",type:"string",default:""},index:{description:"",type:"number",default:1},mode:{description:"",type:"string",default:"server",enum:["server","client"]},showGoto:{description:"",type:"boolean",default:!1},showIndex:{description:"",type:"boolean",default:!0},showLimits:{description:"",type:"boolean",default:!1},showPageInfo:{description:"",type:"boolean",default:!0},size:{description:"",type:"number",default:20},sizeLimits:{description:"",type:"array",default:[10,20,30,50,100]},onPageChange:{description:"",type:"string",default:""},onPageSizeChange:{description:"",type:"string",default:""}}},row:{type:"object",properties:{customRowStyle:{description:"",type:"object"},disable:{description:"",type:"obejct"},height:{description:"",type:"number",default:30},showHovering:{type:"boolean",default:!0},wrapContent:{type:"boolean",default:!1}}},rowNumber:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},heading:{description:"",type:"string",default:"序号"},width:{description:"",type:"number",default:36},onClickRow:{description:"",type:"string",default:""},onDoubleClickRow:{description:"",type:"string",default:""}}},selection:{type:"object",properties:{enableSelectRow:{description:"允许选中行",type:"boolean",default:!0},enable:{description:"",type:"boolean",default:!0},checkOnSelect:{description:"",type:"boolean",default:!1},clearSelectionOnEmpty:{description:"",type:"boolean",default:!0},customSelectionItem:{description:"",type:"object"},focusSelection:{description:"",type:"string",default:"current",enum:["current","all"]},keepSelectingOnClick:{description:"",type:"boolean",default:!0},keepSelectingOnPaging:{description:"",type:"boolean",default:!0},multiSelect:{description:"",type:"boolean",default:!1},selectionMode:{description:"",type:"string",default:"default"},selectOnCheck:{description:"",type:"boolean",default:!1},selectOnEditing:{description:"",type:"boolean",default:!1},showCheckbox:{description:"",type:"boolean",default:!1},showCheckAll:{description:"",type:"boolean",default:!1},showSelection:{description:"",type:"boolean",default:!1},onBeforeSelect:{description:"",type:"string",default:""},onBeforeUnCheck:{description:"",type:"",default:""},onBeforeUnSelect:{description:"",type:"string",default:""},onCheckAll:{description:"",type:"string",default:""},onChecked:{description:"",type:"string",default:""},onSelectionChange:{description:"",type:"string",default:""},onUnCheckAll:{description:"",type:"string",default:""},onUnChecked:{description:"",type:"string",default:""},onCheckedChange:{description:"",type:"string"}}},sort:{type:"object",properties:{enable:{description:"",type:"boolean",default:!1},fields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},multiSort:{description:"",type:"boolean",default:!1}}},summary:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1},customSummaryStyle:{description:"",type:"object"},groupFields:{description:"",type:"array",default:[]},mode:{description:"",type:"string",default:"client",enum:["client","server"]},position:{description:"",type:"boolean",default:"bottom",enum:["bottom","top","both"]}}},toolbar:{description:"",type:"object",properties:{enable:{description:"",type:"boolean",default:!1}}},visualization:{autoHeight:{description:"",type:"boolean",default:!1},emptyDataHeight:{description:"",type:"number",default:36},emptyTemplate:{description:"",type:"string",default:""},maxHeight:{description:"",type:"number",default:300},scrollBarShowMode:{description:"",type:"string",default:"auto"},showBorder:{description:"",type:"boolean",default:!1},showScrollArrow:{description:"",type:"boolean",default:!1},striped:{description:"",type:"boolean",default:!0},useBlankWhenDataIsEmpty:{description:"",type:"boolean",default:!1}},onSelectionChange:{description:"行切换事件",type:"string",default:""}},required:["id","type","columns"],events:{onSelectionChange:"行切换事件",onClickRow:"行点击事件"}},pn={autoCheckChildren:{type:Boolean,default:!1},columns:{type:Array,default:[]},columnOption:{type:Object},commandOption:{type:Object,default:{enable:!1,commands:[]}},data:{type:Array,default:[]},disabled:{type:Boolean,default:!1},disabledField:{type:String,default:"disabled"},displayField:{type:String,default:"name"},editable:{type:Boolean,default:!1},editOption:{type:Object,default:{selectOnEditing:!1,editMode:"cell"}},fit:{type:Boolean,default:!1},header:{type:Object},height:{type:Number,default:-1},hierarchy:{type:Object,default:{cascadeOption:{autoCancelParent:!0,autoCheckChildren:!1,autoCheckParent:!1,selectionRange:"All"},parentIdField:"parent"}},id:{type:String,default:""},idField:{type:String,default:"id",require:!0},loading:{type:Boolean,default:!1},minHeight:{type:Number,default:300},minWidth:{type:Number,default:400},newDataItem:{type:Function,default:()=>{}},pagination:{type:Object,default:{enable:!1,size:-1}},rowNumber:{type:Object,default:{enable:!0,width:32,heading:"序号"}},rowOption:{type:Object,default:{wrapContent:!1}},selection:{type:Object,default:{enableSelectRow:!0,multiSelect:!1,multiSelectMode:"DependOnCheck",showCheckbox:!1,showSelectAll:!1,showSelection:!0}},selectionValues:{type:Array,default:[]},showBorder:{type:Boolean,default:!1},showHeader:{type:Boolean,default:!0},showHorizontalLines:{type:Boolean,default:!0},showLines:{type:Boolean,default:!1},showOptions:{type:Boolean,default:!1},showScrollBar:{type:String,default:"auto"},showSetting:{type:Boolean,default:!1},showStripe:{type:Boolean,default:!0},showTreeNodeIcons:{type:Boolean,default:!1},showVerticallLines:{type:Boolean,default:!1},treeNodeIconsData:{type:[Object,String],default:{}},width:{type:Number,default:-1},virtualized:{type:Boolean,default:!1}},ei=Ot(pn,Un,zn,Yn),ti=ca(),ni=la(),Xn=Object.assign({},pn,{componentId:{type:String,default:""}}),oi=Ot(Xn,Un,zn,Yn),ri=da();var nt=(n=>(n[n.readonly=0]="readonly",n[n.editable=1]="editable",n[n.editing=2]="editing",n))(nt||{}),lt=(n=>(n[n.initial=0]="initial",n[n.editing=1]="editing",n))(lt||{}),$t=(n=>(n[n.data=0]="data",n[n.group=1]="group",n[n.summary=2]="summary",n))($t||{}),Ke=(n=>(n[n.none=0]="none",n[n.filterable=1]="filterable",n[n.sortable=2]="sortable",n[n.filtered=4]="filtered",n[n.sorted=8]="sorted",n[n.ascending=16]="ascending",n[n.descending=32]="descending",n))(Ke||{});function ai(n,t){var h;const e=String(Date.now()),o=((h=n.rowOption)==null?void 0:h.height)||28,r=a.ref(t.value.primaryColumnsWidth);function i(m){const M={};return m.reduce((x,y,v)=>{const b=v<m.length-1?m[v+1]:null;return v===0&&(x[y.field]={left:0}),y.actualWidth!==void 0&&(x[y.field].width=y.actualWidth),b&&(x[b.field]={left:x[y.field].left+(y.actualWidth||0)}),x},M),M}function s(m,M,x){const y=o*(x+1),b=M[m.field].left-y+(M[m.field].width||0),_=m.parent.height?`${m.parent.height}px`:"";return{left:`${y}px`,width:`${b}px`,height:`${_}`}}function l(m,M,x){return{right:"0px",height:`${m.parent.height?`${m.parent.height}px`:""}`}}function c(m,M){const x=m.parent.height?`${m.parent.height}px`:"";return{left:`${M[m.field].left}px`,height:`${x}`,width:isNaN(Number(M[m.field].width))?"100%":`${M[m.field].width}px`}}function f(m,M,x){const v=(M.spanned||[]).reduce((_,S)=>_+(S.parent.height||0),0)+(m.height||0);return{top:`${m.top}px`,left:`${x[M.field].left}px`,width:`${x[M.field].width}px`,height:`${v}px`,padding:`calc(${v/2}px - 1rem) 0`}}function d(m,M){return`${e}_${m.type}_r_${m.index}_c_${M}_${m.refreshKey||""}`}function u(m){return`${e}_${m.type}_r_${m.index}_${m.refreshKey||""}`}function p(m){const M=m.height?`${m.height}px`:"";return{top:`${m.top}px`,width:isNaN(r.value)?"100%":`${r.value}px`,height:`${M}`}}return a.watch(t,()=>{r.value=t.value.primaryColumnsWidth}),{calculateCellPositionInRow:i,cellKey:d,cellPosition:c,groupCellPosition:s,rowKey:u,rowPosition:p,rowSpanCellPosition:f,summaryCellPosition:l}}function ii(n,t,e){const{hasChildrenField:o}=e,r=a.ref("#9399a0"),i=a.ref(28);function s(){return[].concat(...t.value.filter(p=>p.raw.__fv_descendant_index__.length!==0).map(p=>[...p.raw.__fv_descendant_index__.slice(-1)]).flat()).sort((p,h)=>Number(p)-Number(h))}function l(d){const u=new Array(t.value.length).fill(0);if(n.showLines){const p=s();t.value.forEach((h,m)=>{const M=p.includes(m),x=h.raw[o.value];u[m]=`repeating-linear-gradient(90deg, ${r.value} 0 1px, transparent 0px 2px) ${x?"-10px":"0px"} ${i.value/2}px/20px 1px no-repeat,repeating-linear-gradient(${r.value} 0 1px, transparent 0px 2px) 0px 0px/1px ${M?"50%":"100%"} no-repeat`}),u[0]=""}return u[d]}function c(d,u,p){return p[d].parents.set(d,!0).forEach(m=>{p[m].childsLength=p[m].childWithLines.filter(M=>u[M].visible).length}),u}function f(d){const h=d.raw.__fv_parent_index__===void 0||d.raw.__fv_parent_index__===-1?0:8,m=0,M=d.raw[o.value],x=`${d.layer*10+d.layer*h+m}px`,y=d.visible||Ee.isUndefined(d.visible)?{paddingLeft:`calc(${x} + 0.75rem)`,background:l(d.index),display:"flex",width:"100%",position:"relative"}:{display:"none"};return M||(y.paddingLeft=`calc(${x} + 2rem)`),y}return{hierarchyCellContentStyle:f,handleCollapsedPaddingBottom:c}}function si(n,t,e){const o=a.ref(n.iconField);function r(i,s){if(o.value)return i.raw[n.iconField];let l="";return i.raw[e.value]!==!0?l=t.value.leafnodes:l=i.collapse?t.value.fold:t.value.unfold,l}return{treeNodeIconsClass:r}}function li(n,t,e,o,r,i,s,l){const{dataView:c,hasRealChildren:f,reOrderVisibleIndex:d}=o,{collapseField:u,hasChildrenField:p}=r,{reCalculateVisualDataRows:h,updateVirticalScroll:m}=i;function M(x){if(x.raw[p.value]){const v=c.value[x.raw.__fv_index__];v[u.value]=!v[u.value],o.toggleChildrenVisibiltyByCollapseStatus(v),v[p.value]=f(v),d(),h(),m()}t.emit("expandNode",{row:x})}return{toggleTreeNode:M}}function ci(n){function t(r){return{}}function e(r){const{valign:i,align:s}=r;return{"d-flex":!0,"h-100":!0,"w-100":!0,"justify-content-start":s!=="center"&&s!=="right","justify-content-center":s==="center","justify-content-right":s==="right","align-items-start":i!=="middle"&&i!=="bottom","align-items-center":i==="middle","align-items-end":i==="bottom"}}function o(r){const{align:i,showEllipsis:s}=r;return{"w-100":!0,"text-left":i!=="center"&&i!=="right","text-center":i==="center","text-right":i==="right","text-truncate":s}}return{cellContentPosition:t,cellContentClass:e,cellContentClassWithEllipsis:o}}function ui(n,t,e,o,r,i,s,l,c,f,d,u,p){const{onClickCell:h}=i,{gridCellClass:m,gridHierarchyCellClass:M,gridRowClass:x,onClickRow:y,onMouseoverRow:v,onMouseoutRow:b}=l,{enableMultiSelect:_,select:S,unSelect:T,selectItem:g}=c;a.ref(n.cellHeight);const V=a.ref(n.treeNodeIconsData||{}),{hasChildrenField:F,shouldShowCheckBox:N,shouldShowIcon:w}=s,{toggleTreeNode:R}=li(n,t,o,r,s,d),{toggleSelectHierarchyItem:L}=f,{cellKey:C,cellPosition:k,rowKey:D,rowPosition:B}=ai(n,e),{cellContentClass:O,cellContentPosition:P,cellContentClassWithEllipsis:A}=ci(),{hierarchyCellContentStyle:E}=ii(n,o,s),{treeNodeIconsClass:I}=si(n,V,F);function H(z,oe){const ve=z.raw[F.value];return{"fv-tree-node-toggle":ve&&z.collapse,"fv-tree-node-toggle-minus":ve&&!z.collapse}}function $(z,oe){z.stopPropagation(),R(oe)}function W(z){z.stopPropagation()}function G(z,oe){return a.createVNode("div",{class:H(z),onClick:ve=>$(ve,z),onDblclick:W},null)}function X(z,oe){return w.value&&a.createVNode("div",{id:"treeNodeIcons",class:I(z,oe)},null)}function K(z){_.value?(z.checked?S(z):T(z),L(z)):g(z)}function Q(z,oe){return N.value&&a.createVNode(ea.FCheckbox,{id:"checkbox_for_"+C(z,oe.index),indeterminate:z.indeterminate,disabled:z.disabled,checked:z.checked,"onUpdate:checked":ve=>z.checked=ve,onChange:()=>K(z)},null)}function pe(z,oe){return a.createVNode("span",{style:"user-select:none"},[t.slots.cellTemplate?t.slots.cellTemplate({cell:oe,row:z}):oe.mode===nt.editing?oe.getEditor(oe):oe.formatter?oe.formatter(oe,z):oe.showTips?a.createVNode(ta,null,{default:()=>oe.data,contentTemplate:()=>oe.data}):oe.data])}function he(z,oe){return a.createVNode("div",{class:A(oe)},[pe(z,oe)])}function xe(z,oe,ve){const Se=E(z);return a.createVNode("div",{ref:oe.setRef,key:C(z,oe.index),class:"fv-grid-hierarchy-cell",style:k(oe,ve)},[a.createVNode("div",{class:O(oe),style:Se},[G(z),X(z,oe),Q(z,oe),he(z,oe)])])}function De(z,oe,ve){return a.createVNode("div",{ref:oe.setRef,key:C(z,oe.index),class:m(oe),style:k(oe,ve),onClick:Se=>h(Se,oe,z,oe.column)},[a.createVNode("div",{class:O(oe)},[a.createVNode("div",{class:A(oe)},[pe(z,oe)])])])}function Re(z,oe){return oe==="left"&&e.value.leftColumns.length>0&&e.value.leftColumns[0].field===z.field||oe==="primary"&&e.value.primaryColumns.length>0&&e.value.primaryColumns[0].field===z.field}function Y(z,oe){t.emit("dblclickNode",{$event:z,node:oe.raw})}function ue(z,oe,ve="primary",Se){return a.createVNode("div",{ref:z.setRef,key:D(z),class:x(z,Se),style:B(z),onMouseover:Oe=>v(Oe,z),onMouseout:Oe=>b(Oe,z),onClick:Oe=>y(Oe,z),onDblclick:Oe=>Y(Oe,z)},[Object.values(z.data).filter(Oe=>oe[Oe.field]&&Oe.rowSpan===1).map(Oe=>Re(Oe,ve)?xe(z,Oe,oe):De(z,Oe,oe))])}return{renderDataRow:ue}}function di(n,t,e){const{horizontalScrollThumbStyle:o,onMouseDownScrollThumb:r,shouldShowHorizontalScrollbar:i}=e;function s(){return i.value&&a.createVNode("div",{class:"fv-grid-horizontal-scroll"},[a.createVNode("div",{class:"fv-grid-horizontal-scroll-thumb",style:o.value,onMousedown:l=>r(l,t,"horizontal")},null)])}return{renderHorizontalScrollbar:s}}function fi(){function n(o,r){switch(o.command){case"edit":case"remove":return r.status===lt.initial;case"accept":case"cancel":return r.status===lt.editing;default:return!o.hidden}}function t(o,r,i){switch(o.onClick(r,i.dataIndex,i),o.command){case"edit":i.status,lt.editing;break;case"accept":case"cancel":i.status,lt.initial;break}}function e(o,r){return o.commands&&o.commands.map(i=>n(i,r)&&a.createVNode(na,{class:"ml-2",type:i.type,size:i.size||"small",onClick:s=>t(i,s,r),style:{"margin-bottom":"3px"}},{default:()=>[a.createTextVNode(" "),i.text,a.createTextVNode(" ")]}))}return{renderCommandColumn:e}}function pi(n){const t=a.ref(n.minHeight),e=a.ref(n.minWidth),o=a.ref(n.height),r=a.ref(n.width),i=a.computed(()=>o.value<=0?0:Math.max(o.value,t.value)),s=a.computed(()=>r.value<=0?0:Math.max(r.value,e.value));return a.watch([()=>n.height,()=>n.width,()=>n.minHeight,()=>n.minWidth],([c,f,d,u])=>{t.value=Number(d),e.value=Number(u),o.value=Number(c),r.value=Number(f)}),{containerStyleObject:a.computed(()=>({height:i.value>0?`${i.value}px`:n.fit?"100%":"",width:s.value>0?`${s.value}px`:n.fit?"100%":"",flex:"1 1 0"}))}}a.ref([{name:"七天",selectable:!0},{name:"一个月",selectable:!0},{name:"三个月",selectable:!0},{name:"半年",selectable:!0}]);function mi(n){const e=a.ref(n.commandOption.enable||!1),o=a.ref(n.commandOption.commands||[]);function r(i){if(e.value&&!(i.value.findIndex(l=>l.dataType==="commands")>-1)){const l={field:"__commands__",title:"操作",width:120,fixed:"right",dataType:"commands",commands:o.value,visible:!0};i.value.push(l)}}return{applyCommands:r}}function hi(n,t){var f;const e=a.ref((f=n.columnOption)==null?void 0:f.groups);function o(d,u,p,h,m){const M={actualWidth:0,children:[],depth:1,field:d.field,layer:1,left:0,parent:p,resizable:!0,title:d.title||"",status:Ke.none,popoverRef:a.ref(),showPopover:!1,column:null,sortType:"none"},x=h||M;if(d.group){let y=1;d.group.reduce((v,b)=>{if(typeof b=="string"){const _=u.get(b);_&&(m.fieldToRootMap.set(b,x),v.actualWidth+=_.actualWidth,v.children.push(_))}else{const _=o(b,u,v,x,m);y=Math.max(y,_.depth),v.actualWidth+=_.actualWidth,v.children.push(_)}return v},M),M.depth+=y}return t.value.headerDepth=Math.max(t.value.headerDepth,M.depth),M}function r(d){const u={groupedCells:new Map,fieldToRootMap:new Map};return e.value&&e.value.reduce((p,h)=>{const m=o(h,d,null,null,u);return p.groupedCells.set(h.field,m),p},u),u}function i(d){if(!d||d.length===0)return 0;const u=d[0];return u.children&&u.children.length>0&&(u.left=i(u.children)),u.left}function s(d,u){const p=t.value.headerDepth;d.forEach(h=>{h.layer=u?u.layer+1:1;const m=h.children&&h.children.length===0;h.depth=m?p-(h.layer-1):1,h.left=m?h.left:i(h.children),h.children&&s(h.children,h)})}function l(d,u){const p=new Map;return d.forEach(h=>{const m=u.fieldToRootMap.get(h.field),M=m!=null;M&&!p.has(m.field)&&p.set(m.field,m),M||p.set(h.field,h)}),s(Array.from(p.values())),p}function c(d){let u=new Map,p=0;if(d.reduce((h,m)=>{let M=Ke.none;M=m.filterable?M|Ke.filterable:M,M=m.sort&&m.sort!=="none"?M|Ke.sorted|(m.sort==="asc"?Ke.ascending:Ke.descending):M;const x=m.field;return h.set(x,{actualWidth:m.actualWidth||0,children:[],depth:1,layer:1,left:p,field:x,parent:null,resizable:m.resizable===void 0?!0:m.resizable,title:m.title,status:M,popoverRef:a.ref(),showPopover:!1,column:m,filterValue:null,sortType:m.sort||"none",showSetting:m.showSetting,draggable:m.draggable}),p+=m.actualWidth||0,h},u),e.value){const h=r(u);u=l(u,h)}return u}return{getGridHeaderCells:c}}function gi(n,t){var v;ke.useGuid();const{idField:e}=t,o=a.ref(n.summary),r=a.ref(n.group),i=a.ref(((v=n.group)==null?void 0:v.groupFields)||[]),s=a.computed(()=>{var b;return(b=n.group)==null?void 0:b.enable}),l=a.computed(()=>{var b;return(b=n.group)==null?void 0:b.showGroupPanel}),c=a.computed(()=>{const b=o.value;return(b==null?void 0:b.groupFields)||[]}),f=a.computed(()=>{const b=r.value;return b&&b.showSummary}),d=a.ref(0),u=new Map;let p=[];function h(b,_,S,T,g){const V=T[S];V&&(_.reduce((F,N,w)=>{var C;const R=N[V];let L=F.get(R);if(!L){const k=c.value.reduce((D,B)=>(D.set(B,0),D),new Map);L={field:V,title:((C=g.get(V))==null?void 0:C.title)||V,value:R,layer:S,details:[],groupSummaries:k},F.set(R,L)}return c.value&&c.value.forEach(k=>{if(L){const D=L.groupSummaries.get(k)||0;L.groupSummaries.set(k,D+N[k])}}),L.details.push(N),F},b),S<T.length-1&&b.forEach((F,N)=>{F.nestGroup=new Map,h(F.nestGroup,F.details,S+1,T,g),F.details=[]}))}function m(b,_){return n.group&&n.group.formatter?n.group.formatter(b.value,{...b,total:_}):`${b.title}:${b.value} (${_})`}function M(b,_){const S=[];return b.forEach(T=>{const g={[e.value]:`group_of_${_?_[e.value]+"_":""}${T.field}_${T.value}`,__fv_data_grid_group_collapse__:!1,__fv_data_grid_group_field__:T.field,__fv_data_grid_group_layer__:T.layer,__fv_data_grid_group_row__:!0,__fv_data_grid_group_value__:T.value};let V=0;if(S.push(g),T.nestGroup){const F=M(T.nestGroup,g);S.push(...F),V+=F.length}if(T.details&&T.details.length&&(S.push(...T.details),V+=T.details.length),f.value){const F={__fv_data_grid_group_field__:T.field,__fv_data_grid_group_layer__:T.layer,__fv_data_grid_group_summary__:!0};F[e.value]=`summary_of_${T.field}_${T.value}`,F[T.field]=Array.from(T.groupSummaries.entries()).reduce((N,[w,R])=>`${N} ${w} total:${R} `,""),S.push(F)}T.groupSummaries&&T.groupSummaries.size&&T.groupSummaries.forEach((F,N)=>{g[N]=F}),g[T.field]=m(T,V),g.value=T.value}),S.forEach((T,g)=>{T.__fv_data_index__=g}),S}function x(b,_,S){return!b||b.length===0||!_.length?_:(b.join(","),u.clear(),p=[],_=_.filter(T=>!T.__fv_data_grid_group_row__),h(u,_,0,b,S),p=M(u),p)}function y(b){return{"f-icon":!0,"f-icon-arrow-chevron-down":!0,"fv-grid-group-row-icon-collapse":b.collapse}}return{collpaseGroupIconClass:y,generateGroupData:x,groupFields:i,shouldGroupingData:s,showGroupPanel:l,groupRowSize:d}}function yi(n,t,e,o){const r=a.ref(0),i=a.ref(!!n.hierarchy),{idField:s}=o,{collapseField:l,hasChildrenField:c,parentIdField:f}=e,d=new Map,u=new Map,p=new Map;function h($,W){u.clear(),$.reduce((G,X)=>{const K=X[f.value]!==void 0?X[f.value]:"";if(K&&W.has(K)){const pe=W.get(K),he=isNaN(Number(pe.__fv_layer__))?1:Number(pe.__fv_layer__);X.__fv_layer__=he+1,X.__fv_parent_index__=pe.__fv_index__,pe.__fv_hasChildren__=!0}else X.__fv_layer__=1;const Q=G.has(K)?G.get(K):[];return Q.push(X),G.set(K,Q),G},u)}function m($){p.clear(),$.reduce((W,G)=>{const X=G[s.value];return W.set(X,G),W},p)}function M($){$.forEach(W=>{const G=W[s.value];W.__fv_children_index__.map(K=>$[K]).forEach(K=>{K.__fv_parents__=new Map([...W.__fv_parents__.entries(),[G,!0]])})})}function x($){$.forEach(W=>{const G=new Set(W.__fv_children_index__);W.__fv_children_index__=[...G].sort((X,K)=>X-K)})}function y($){$.forEach(W=>{const G=W.__fv_parents__;Array.from(G.keys()).map(X=>p.get(X)).forEach(X=>{X.__fv_children_index__.push(W.__fv_index__)})}),x($)}function v($){$.forEach(W=>{W.__fv_child_with_lines__=[],W.__fv_child_length__=W.__fv_descendant_index__.length,W.__fv_descendant_index__.map(G=>$[G]).reduce((G,X)=>(G.__fv_child_length__+=X.__fv_children_index__.length,G.__fv_child_with_lines__.push(...X.__fv_children_index__,X.__fv_index__),G),W)})}function b($,W){return{id:$,index:W,parentId:"",parentIndex:-1,parents:new Map,children:new Map,descendant:new Map,collapsed:!1,visibleInHierarchy:!0}}function _($,W,G){Array.from(W.keys()).forEach(X=>{W.get(X).reduce((Q,pe)=>{const he=pe[s.value],xe=$.get(pe[s.value]),De=$.get(X),Re=G.get(X);return De&&Re&&(De.children.set(he,xe),De.children.set(he,xe),xe.parentId=X,xe.parentIndex=De.index,xe.parents.set(X,De)),Q},$)})}function S($){$.children.forEach(G=>{G.parents=new Map([...$.parents.entries(),[$.id,$]]),S(G)})}function T($,W){$.filter(G=>G[f.value]===void 0||G[f.value]==="").forEach(G=>{const X=G[s.value],K=W.get(X);S(K)})}function g($){Array.from($.values()).forEach(W=>{Array.from(W.parents.values()).forEach(G=>{G.descendant.set(W.id,W)})})}function V($){d.clear(),$.forEach((W,G)=>{const X=W[s.value];d.set(X,b(X,G))}),m($),h($,p),_(d,u,p),T($,d),g(d)}function F($){const W=$[s.value],G=d.get(W);return G&&G.children.size>0}function N($){return $[c.value]&&!F($)}function w($){const W=$[s.value],G=d.get(W);return G&&G.visibleInHierarchy}function R(){r.value=Date.now()}function L($,W){W.forEach(G=>{const X=d.get(G[s.value]),K=d.get($),Q=p.get($);K&&Q&&(X.visibleInHierarchy=!Q[l.value]&&K.visibleInHierarchy)}),R()}function C($){if(u.has($)){const G=u.get($);L($,G),G.map(X=>X[s.value]).forEach(X=>C(X))}}function k($){const W=$[s.value];C(W)}function D($,W,G=0){$.forEach(X=>{const K=N(X),Q=X.__fv_layer__<=G,pe=W==="ToCollapse"?X.__fv_layer__<=G:!(X.__fv_layer__<=G),he=Q?pe:X[l.value];X[l.value]=K||he});for(const[X,K]of u.entries())L(X,K);return $}function B($,W){D($,"ToCollapse",W)}function O($,W){D($,"ToExpand",W)}function P($){$.forEach((W,G)=>{var pe;const X=W[s.value],K=u.has(X)?(pe=u.get(X))==null?void 0:pe.map(he=>he.__fv_index__):[],Q=b(X,G);W.__fv_graph_node__=Q,W.__fv_children_index__=K,W.__fv_descendant_index__=[...K],W.__fv_parents__=new Map,N(W)&&(W[l.value]=!0)})}function A($){var X,K;V(t.value),P($),M($),y($),n.showLines&&v($);const G=((X=n.hierarchy)==null?void 0:X.collapseTo)!==void 0?Number((K=n.hierarchy)==null?void 0:K.collapseTo):0;return D($,"ToCollapse",G),$}function E($,W,G){const K=G.value[$][s.value],Q=d.get(K);if(Q){const pe=d.get(Q.parentId);let he=G.value.length-1;if(pe){const xe=Array.from(pe.children.keys()).indexOf(Q.id);if(xe===pe.children.size-1){const Re=Array.from(pe.descendant.values())[pe.descendant.size-1];he=G.value.findIndex(ue=>ue[s.value]===Re.id)+1}else{const Re=Array.from(pe.children.values())[xe+1];he=G.value.findIndex(ue=>ue[s.value]===Re.id)}W[c.value]=!1,W[f.value]=pe.id,G.value.splice(he,0,W)}}}function I($,W,G){const X=G.value[$],K=X[s.value];if(d.get(K)){const he=G.value.findIndex(xe=>xe[s.value]===K)+1;X[c.value]=!0,X[l.value]=!1,W[c.value]=!1,W[f.value]=K,G.value.splice(he,0,W)}}function H($,W){const G=$[s.value],X=d.get(G),K=Array.from(X.descendant.keys());K.unshift(G);const Q=d.get(X.parentId);if(Q&&(Q.children.delete(G),Q.children.size===0)){const he=W.find(xe=>xe[s.value]===X.parentId);he[c.value]=!1,he[l.value]=!1}return W.filter(he=>K.indexOf(he.id)===-1)}return{checkVisibleInHierarchy:r,collapseTo:B,expandTo:O,generateHierarchyData:A,hasRealChildren:F,insertSibling:E,insertChild:I,isVisibleInTree:w,shouldStratifyData:i,toggleChildrenVisibiltyByCollapseStatus:k,trimmedOriginalData:H}}function vi(n,t,e,o,r){var Je;const i=new Map,s=new Map,l=new Map,c=new Map,f=new Map,d=a.ref([]),u=a.ref([]),p=gi(n,r),{generateGroupData:h,groupFields:m,shouldGroupingData:M}=p,x=a.ref(n.data),y=yi(n,x,o,r),{collapseTo:v,expandTo:b,generateHierarchyData:_,hasRealChildren:S,insertSibling:T,insertChild:g,isVisibleInTree:V,shouldStratifyData:F,toggleChildrenVisibiltyByCollapseStatus:N,trimmedOriginalData:w,checkVisibleInHierarchy:R}=y,{idField:L,reviseIdentifyField:C}=r,k=a.ref(n.newDataItem),D=a.ref(n.data||[]),B=a.ref(n.data),{flatTreeData:O}=Xl(n);function P(U){return O(U)}if(n.hierarchy&&n.data&&((Je=n.data[0])!=null&&Je.children)){const U=P(n.data);x.value=U,D.value=U,B.value=U}const A=a.ref(n.summary),E=a.computed(()=>{const U=A.value;return(U==null?void 0:U.groupFields)||[]});let I=new Map;const H=a.ref(D.value.length),$=a.ref(n.pagination);function W(){return $.value&&$.value.enable&&$.value.size>0?$.value.size:D.value.length}const G=a.ref(1),X=a.computed(()=>$.value&&$.value.enable&&$.value.mode!=="server"),K=a.computed(()=>$.value&&$.value.enable&&$.value.mode==="server"),Q=new Gn;function pe(U,fe){const we=Math.ceil(U.length/fe);let Ne=0;const q=[],ee=[],ne=[];for(;Ne<we;){const te=U.slice(Ne*fe,(Ne+1)*fe),be=h(m.value,te,t);ee[Ne]=be.filter(ye=>ye.__fv_data_grid_group_row__).length,q.push(...be),Ne++}return ee.reduce((te,be,ye)=>(te=te+be,ne.push(te),te),0),{groupData:q,groupRowSizeList:ee,accumulateGroupRowSize:ne}}function he(){var be;D.value=x.value,X.value&&(H.value=D.value.length),M.value&&!X.value&&(D.value=h(m.value,x.value,t)),I=E.value.reduce((ye,Be)=>(ye.set(Be,0),ye),I);const U=0,fe=W(),we=(G.value-1)*fe;let q=we>D.value.length-1||K.value?U:we,ee=K.value?D.value.length:Math.min(q+fe,D.value.length);if(M.value&&X.value){const{accumulateGroupRowSize:ye,groupData:Be,groupRowSizeList:Te}=pe(x.value,fe);D.value=Be;const $e=Te[G.value-1];q+=G.value-2<0?0:ye[G.value-2],ee=q+fe+$e}let ne=0;const te=[];if(D.value.length){C(D.value);const ye=L.value!==n.idField;for(let Be=q;Be<ee;Be++){const Te=D.value[Be];Te.__fv_data_grid_group_row__?(ne=0,Te.__fv_data_index__=""):Te.__fv_data_grid_group_summary__?Te.__fv_data_index__="":(ne++,Te.__fv_data_index__=ne+(G.value-1)*fe),Te.__fv_index__=Be,Te.__fv_visible_index__=Be,n.rowOption&&n.rowOption.disabledField&&(Te.__fv_disabled__=Te[(be=n.rowOption)==null?void 0:be.disabledField]),ye&&(Te[L.value]=Be),E.value.forEach($e=>{const rt=I.get($e)||0;I.set($e,rt+Te[$e])}),te.push(Te)}}return F.value&&_(te),B.value=[...te],te}const xe=a.ref(he()),De=a.computed(()=>(R.value,xe.value.filter(U=>F.value?U.__fv_visible__!==!1&&V(U):U.__fv_visible__!==!1)));function Re(){De.value.forEach((U,fe)=>(U.__fv_visible_index__=fe,U))}function Y(U,fe,we=!1){const q=(we?he():[...B.value]).filter(te=>e.apply(te)),ee=U&&U.length?q.filter(te=>U.reduce((be,ye)=>be&&ye.filter(te),!0)):q,ne=fe&&fe.length?ee.sort((te,be)=>{const ye=[...fe],Be=ye.shift();let Te=Be.compare(te[Be.field],be[Be.field]);for(;Te===0&&ye.length!==0;){const $e=ye.shift();$e&&(Te=$e.compare(te[$e.field],be[$e.field]))}return Te}):ee;return xe.value=ne.map((te,be)=>{if(te.__fv_data_grid_group_row__){const ye=`group_of_${te.__fv_data_grid_group_field__}_${te.__fv_data_grid_group_value__}`;te.__fv_data_grid_group_collapse__=!!i.get(ye)}return te.__fv_index__=be,te.__fv_visible_index__=be,te}),xe.value}function ue(U){return f.clear(),u.value=U,u.value.reduce((fe,we)=>(fe.set(we.field,we),fe),f),Y([],u.value)}function z(U,fe){return f.set(U,fe),u.value=Array.from(f.values()),Y([],u.value)}function oe(U){return f.delete(U),u.value=Array.from(f.values()),Y([],u.value)}function ve(U,fe){return s.set(U,fe),d.value=Array.from(s.values()),Y([],Array.from(f.values()))}function Se(U){return s.delete(U),d.value=Array.from(s.values()),Y([],Array.from(f.values()),!0)}function Oe(){return s.clear(),d.value=[],Y([],Array.from(f.values()),!0)}function ot(U,fe){const we=`group_of_${U}_${fe}`;i.set(we,!0);const Ne=q=>q[U]!==fe;return l.set(`collapse_${U}_${fe}`,{field:U,fieldName:U,fieldType:"string",filterValue:fe,filter:Ne}),Y(Array.from(l.values()),Array.from(f.values()))}function mt(U){v(xe.value,U)}function dt(U){b(xe.value,U)}function J(U,fe){const we=`group_of_${U}_${fe}`;return i.set(we,!1),l.delete(`collapse_${U}_${fe}`),Y(Array.from(l.values()),Array.from(f.values()),!0)}function _e(U){const fe=U.raw[L.value],we=Ne=>!Ne.__fv_parents__.has(fe);c.set(`fold_${fe}`,{field:"id",fieldName:"id",fieldType:"string",filterValue:String(fe),filter:we}),Y(Array.from(c.values()),Array.from(f.values())),_(xe.value)}function Ie(U){const fe=U[L.value];c.delete(`fold_${fe}`)}function Ge(U){Ie(U.raw),Y(Array.from(c.values()),Array.from(f.values()),!0),_(xe.value)}function je(){const U=he();xe.value=U,n.hierarchy&&(Y(Array.from(c.values()),Array.from(f.values())),_(xe.value))}function it(U){const we=n.hierarchy&&U&&U.length&&U[0].children?P(U):U;x.value=we,je()}function ht(U,fe,we){return(U&&U.length?xe.value.filter((q,ee)=>U.reduce((ne,te)=>ne&&te.filter(q),!0)):xe.value).slice(fe,we)}function Ct(U){const fe=W(),we=Math.ceil(H.value/fe);0<=U&&U<=we&&(G.value=U,je())}function ft(U){x.value.push(Ee.cloneDeep(U)),xe.value=he()}function Vt(U=0){if(!(U>-1))return!1;const we=k.value();n.hierarchy?T(U,we,x):x.value.splice(U,0,we),je()}function xt(U=0){if(!(U>-1&&n.hierarchy))return!1;const we=k.value(),Ne=x.value[U];Ie(Ne),g(U,we,x),je()}function gt(U){const fe=U?U-1:0;x.value.splice(fe,1),je()}function Mt(U){const fe=x.value.findIndex(we=>we[L.value]===U);fe!==-1&&(x.value.splice(fe,1),je())}function _t(U){const fe=U>-1?x.value[U]:null;if(!(fe&&fe.deletable!==!1))return!1;x.value=w(fe,x.value),je()}function re(){const U=l.size>0?Array.from(l.values()):[];return Y(U,Array.from(f.values()))}function de(U){$.value.size=U}function ge(U){$.value&&(de(U),je())}function Pe(U,fe){const we=x.value[Number(U)-1];we.editable!==!1?(we.name=fe,je()):Q.show({showCloseButton:!1,timeout:3e3,animate:"fadeIn",toasts:[{type:"string",title:"提示",msg:"当前节点禁止编辑"}]})}function ze(U){return U.map(we=>{const Ne=B.value.findIndex(q=>""+q[L.value]==""+we);return Ne>-1?B.value[Ne]:null}).filter(we=>we!=null)}return{addFilter:ve,addNewDataItem:ft,addSorter:z,updatePageSize:de,changePageSizeTo:ge,collapse:ot,collapseTo:mt,dataView:xe,editDataItem:Pe,expand:J,expandTo:dt,filters:d,fold:_e,getRange:ht,getSelectionItems:ze,hasRealChildren:S,insertNewChildDataItem:xt,insertNewDataItem:Vt,isVisibleInTree:V,load:it,navigatePageTo:Ct,pageIndex:G,rawView:B,refresh:re,removeAllFilter:Oe,removeDataItem:gt,removeDataItemById:Mt,removeFilter:Se,removeHierarchyDataItem:_t,removeSorter:oe,reOrderVisibleIndex:Re,setSorters:ue,sorters:u,summaries:I,toggleChildrenVisibiltyByCollapseStatus:N,totalItems:H,unFold:Ge,updateDataView:je,visibleDataItems:De}}const Qn={conditions:{type:Array,default:[]},fields:{type:Array,default:[]},key:{type:String,default:""},isControlInline:{type:Boolean,default:!0}};class Zn{constructor(t={value:[]}){j(this,"editorType","check-box");j(this,"value");j(this,"valueType","boolean");const o=(Array.isArray(t.value)?t.value:typeof t.value=="string"?t.value.split(","):[]).map(r=>JSON.parse(r));this.value=o}clear(){this.value=[]}setValue(t){this.value=t}getValue(){return this.value}getDisplayText(){return this.value.map(t=>t?"是":"否").join(",")}isEmpty(){return this.value.length===0}}class Kn{constructor(t={textValue:"",value:"",valueField:""}){j(this,"editorType","combo-lookup");j(this,"textValue");j(this,"value");j(this,"valueField");j(this,"valueType","text");this.textValue=t.textValue,this.value=t.value,this.valueField=t.valueField}clear(){this.value="",this.valueField="",this.textValue=""}getPropValue(t,e){if(e.length>1){const o=e.shift();return t[o]?this.getPropValue(t[o],e):null}return t[e[0]]}getTextValue(t){const e=t.split("."),o=this.value.split(",").map(r=>this.getPropValue(r,Ee.cloneDeep(e)));return o&&o.length?o.join(","):""}getValue(){const t=this.valueField.split("."),e=this.value.split(",").map(o=>this.getPropValue(o,Ee.cloneDeep(t)));return e&&e.length?e.join(","):""}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.valueField}}function Ye(n){const t=Object.prototype.toString.call(n);return n instanceof Date||typeof n=="object"&&t==="[object Date]"?new n.constructor(+n):typeof n=="number"||t==="[object Number]"||typeof n=="string"||t==="[object String]"?new Date(n):new Date(NaN)}function We(n,t){return n instanceof Date?new n.constructor(t):new Date(t)}function Jn(n,t){const e=Ye(n);return isNaN(t)?We(n,NaN):(t&&e.setDate(e.getDate()+t),e)}const eo=6048e5,bi=864e5,wi=6e4,Ci=36e5,xi=1e3;let _i={};function Pt(){return _i}function bt(n,t){var l,c,f,d;const e=Pt(),o=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??e.weekStartsOn??((d=(f=e.locale)==null?void 0:f.options)==null?void 0:d.weekStartsOn)??0,r=Ye(n),i=r.getDay(),s=(i<o?7:0)+i-o;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function Bt(n){return bt(n,{weekStartsOn:1})}function to(n){const t=Ye(n),e=t.getFullYear(),o=We(n,0);o.setFullYear(e+1,0,4),o.setHours(0,0,0,0);const r=Bt(o),i=We(n,0);i.setFullYear(e,0,4),i.setHours(0,0,0,0);const s=Bt(i);return t.getTime()>=r.getTime()?e+1:t.getTime()>=s.getTime()?e:e-1}function no(n){const t=Ye(n);return t.setHours(0,0,0,0),t}function Xt(n){const t=Ye(n),e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),+n-+e}function Ti(n,t){const e=no(n),o=no(t),r=+e-Xt(e),i=+o-Xt(o);return Math.round((r-i)/bi)}function Fi(n){const t=to(n),e=We(n,0);return e.setFullYear(t,0,4),e.setHours(0,0,0,0),Bt(e)}function Si(n){return n instanceof Date||typeof n=="object"&&Object.prototype.toString.call(n)==="[object Date]"}function ki(n){if(!Si(n)&&typeof n!="number")return!1;const t=Ye(n);return!isNaN(Number(t))}function Vi(n){const t=Ye(n),e=We(n,0);return e.setFullYear(t.getFullYear(),0,1),e.setHours(0,0,0,0),e}const Mi={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Ni=(n,t,e)=>{let o;const r=Mi[n];return typeof r=="string"?o=r:t===1?o=r.one:o=r.other.replace("{{count}}",t.toString()),e!=null&&e.addSuffix?e.comparison&&e.comparison>0?"in "+o:o+" ago":o};function mn(n){return(t={})=>{const e=t.width?String(t.width):n.defaultWidth;return n.formats[e]||n.formats[n.defaultWidth]}}const Ii={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ei={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Oi={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Di={date:mn({formats:Ii,defaultWidth:"full"}),time:mn({formats:Ei,defaultWidth:"full"}),dateTime:mn({formats:Oi,defaultWidth:"full"})},Pi={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Bi=(n,t,e,o)=>Pi[n];function Wt(n){return(t,e)=>{const o=e!=null&&e.context?String(e.context):"standalone";let r;if(o==="formatting"&&n.formattingValues){const s=n.defaultFormattingWidth||n.defaultWidth,l=e!=null&&e.width?String(e.width):s;r=n.formattingValues[l]||n.formattingValues[s]}else{const s=n.defaultWidth,l=e!=null&&e.width?String(e.width):n.defaultWidth;r=n.values[l]||n.values[s]}const i=n.argumentCallback?n.argumentCallback(t):t;return r[i]}}const ji={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Ri={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Li={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},$i={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Wi={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},qi={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Ai={ordinalNumber:(n,t)=>{const e=Number(n),o=e%100;if(o>20||o<10)switch(o%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:Wt({values:ji,defaultWidth:"wide"}),quarter:Wt({values:Ri,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Wt({values:Li,defaultWidth:"wide"}),day:Wt({values:$i,defaultWidth:"wide"}),dayPeriod:Wt({values:Wi,defaultWidth:"wide",formattingValues:qi,defaultFormattingWidth:"wide"})};function qt(n){return(t,e={})=>{const o=e.width,r=o&&n.matchPatterns[o]||n.matchPatterns[n.defaultMatchWidth],i=t.match(r);if(!i)return null;const s=i[0],l=o&&n.parsePatterns[o]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(l)?Gi(l,u=>u.test(s)):Hi(l,u=>u.test(s));let f;f=n.valueCallback?n.valueCallback(c):c,f=e.valueCallback?e.valueCallback(f):f;const d=t.slice(s.length);return{value:f,rest:d}}}function Hi(n,t){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)&&t(n[e]))return e}function Gi(n,t){for(let e=0;e<n.length;e++)if(t(n[e]))return e}function zi(n){return(t,e={})=>{const o=t.match(n.matchPattern);if(!o)return null;const r=o[0],i=t.match(n.parsePattern);if(!i)return null;let s=n.valueCallback?n.valueCallback(i[0]):i[0];s=e.valueCallback?e.valueCallback(s):s;const l=t.slice(r.length);return{value:s,rest:l}}}const Yi=/^(\d+)(th|st|nd|rd)?/i,Ui=/\d+/i,Xi={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Qi={any:[/^b/i,/^(a|c)/i]},Zi={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ki={any:[/1/i,/2/i,/3/i,/4/i]},Ji={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},es={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ts={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ns={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},os={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},rs={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},as={ordinalNumber:zi({matchPattern:Yi,parsePattern:Ui,valueCallback:n=>parseInt(n,10)}),era:qt({matchPatterns:Xi,defaultMatchWidth:"wide",parsePatterns:Qi,defaultParseWidth:"any"}),quarter:qt({matchPatterns:Zi,defaultMatchWidth:"wide",parsePatterns:Ki,defaultParseWidth:"any",valueCallback:n=>n+1}),month:qt({matchPatterns:Ji,defaultMatchWidth:"wide",parsePatterns:es,defaultParseWidth:"any"}),day:qt({matchPatterns:ts,defaultMatchWidth:"wide",parsePatterns:ns,defaultParseWidth:"any"}),dayPeriod:qt({matchPatterns:os,defaultMatchWidth:"any",parsePatterns:rs,defaultParseWidth:"any"})},oo={code:"en-US",formatDistance:Ni,formatLong:Di,formatRelative:Bi,localize:Ai,match:as,options:{weekStartsOn:0,firstWeekContainsDate:1}};function is(n){const t=Ye(n);return Ti(t,Vi(t))+1}function ro(n){const t=Ye(n),e=+Bt(t)-+Fi(t);return Math.round(e/eo)+1}function hn(n,t){var d,u,p,h;const e=Ye(n),o=e.getFullYear(),r=Pt(),i=(t==null?void 0:t.firstWeekContainsDate)??((u=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(p=r.locale)==null?void 0:p.options)==null?void 0:h.firstWeekContainsDate)??1,s=We(n,0);s.setFullYear(o+1,0,i),s.setHours(0,0,0,0);const l=bt(s,t),c=We(n,0);c.setFullYear(o,0,i),c.setHours(0,0,0,0);const f=bt(c,t);return e.getTime()>=l.getTime()?o+1:e.getTime()>=f.getTime()?o:o-1}function ss(n,t){var l,c,f,d;const e=Pt(),o=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??e.firstWeekContainsDate??((d=(f=e.locale)==null?void 0:f.options)==null?void 0:d.firstWeekContainsDate)??1,r=hn(n,t),i=We(n,0);return i.setFullYear(r,0,o),i.setHours(0,0,0,0),bt(i,t)}function ao(n,t){const e=Ye(n),o=+bt(e,t)-+ss(e,t);return Math.round(o/eo)+1}function Me(n,t){const e=n<0?"-":"",o=Math.abs(n).toString().padStart(t,"0");return e+o}const wt={y(n,t){const e=n.getFullYear(),o=e>0?e:1-e;return Me(t==="yy"?o%100:o,t.length)},M(n,t){const e=n.getMonth();return t==="M"?String(e+1):Me(e+1,2)},d(n,t){return Me(n.getDate(),t.length)},a(n,t){const e=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.toUpperCase();case"aaa":return e;case"aaaaa":return e[0];case"aaaa":default:return e==="am"?"a.m.":"p.m."}},h(n,t){return Me(n.getHours()%12||12,t.length)},H(n,t){return Me(n.getHours(),t.length)},m(n,t){return Me(n.getMinutes(),t.length)},s(n,t){return Me(n.getSeconds(),t.length)},S(n,t){const e=t.length,o=n.getMilliseconds(),r=Math.trunc(o*Math.pow(10,e-3));return Me(r,t.length)}},jt={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},io={G:function(n,t,e){const o=n.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return e.era(o,{width:"abbreviated"});case"GGGGG":return e.era(o,{width:"narrow"});case"GGGG":default:return e.era(o,{width:"wide"})}},y:function(n,t,e){if(t==="yo"){const o=n.getFullYear(),r=o>0?o:1-o;return e.ordinalNumber(r,{unit:"year"})}return wt.y(n,t)},Y:function(n,t,e,o){const r=hn(n,o),i=r>0?r:1-r;if(t==="YY"){const s=i%100;return Me(s,2)}return t==="Yo"?e.ordinalNumber(i,{unit:"year"}):Me(i,t.length)},R:function(n,t){const e=to(n);return Me(e,t.length)},u:function(n,t){const e=n.getFullYear();return Me(e,t.length)},Q:function(n,t,e){const o=Math.ceil((n.getMonth()+1)/3);switch(t){case"Q":return String(o);case"QQ":return Me(o,2);case"Qo":return e.ordinalNumber(o,{unit:"quarter"});case"QQQ":return e.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return e.quarter(o,{width:"narrow",context:"formatting"});case"QQQQ":default:return e.quarter(o,{width:"wide",context:"formatting"})}},q:function(n,t,e){const o=Math.ceil((n.getMonth()+1)/3);switch(t){case"q":return String(o);case"qq":return Me(o,2);case"qo":return e.ordinalNumber(o,{unit:"quarter"});case"qqq":return e.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return e.quarter(o,{width:"narrow",context:"standalone"});case"qqqq":default:return e.quarter(o,{width:"wide",context:"standalone"})}},M:function(n,t,e){const o=n.getMonth();switch(t){case"M":case"MM":return wt.M(n,t);case"Mo":return e.ordinalNumber(o+1,{unit:"month"});case"MMM":return e.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return e.month(o,{width:"narrow",context:"formatting"});case"MMMM":default:return e.month(o,{width:"wide",context:"formatting"})}},L:function(n,t,e){const o=n.getMonth();switch(t){case"L":return String(o+1);case"LL":return Me(o+1,2);case"Lo":return e.ordinalNumber(o+1,{unit:"month"});case"LLL":return e.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return e.month(o,{width:"narrow",context:"standalone"});case"LLLL":default:return e.month(o,{width:"wide",context:"standalone"})}},w:function(n,t,e,o){const r=ao(n,o);return t==="wo"?e.ordinalNumber(r,{unit:"week"}):Me(r,t.length)},I:function(n,t,e){const o=ro(n);return t==="Io"?e.ordinalNumber(o,{unit:"week"}):Me(o,t.length)},d:function(n,t,e){return t==="do"?e.ordinalNumber(n.getDate(),{unit:"date"}):wt.d(n,t)},D:function(n,t,e){const o=is(n);return t==="Do"?e.ordinalNumber(o,{unit:"dayOfYear"}):Me(o,t.length)},E:function(n,t,e){const o=n.getDay();switch(t){case"E":case"EE":case"EEE":return e.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return e.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return e.day(o,{width:"short",context:"formatting"});case"EEEE":default:return e.day(o,{width:"wide",context:"formatting"})}},e:function(n,t,e,o){const r=n.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Me(i,2);case"eo":return e.ordinalNumber(i,{unit:"day"});case"eee":return e.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return e.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return e.day(r,{width:"short",context:"formatting"});case"eeee":default:return e.day(r,{width:"wide",context:"formatting"})}},c:function(n,t,e,o){const r=n.getDay(),i=(r-o.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Me(i,t.length);case"co":return e.ordinalNumber(i,{unit:"day"});case"ccc":return e.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return e.day(r,{width:"narrow",context:"standalone"});case"cccccc":return e.day(r,{width:"short",context:"standalone"});case"cccc":default:return e.day(r,{width:"wide",context:"standalone"})}},i:function(n,t,e){const o=n.getDay(),r=o===0?7:o;switch(t){case"i":return String(r);case"ii":return Me(r,t.length);case"io":return e.ordinalNumber(r,{unit:"day"});case"iii":return e.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return e.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return e.day(o,{width:"short",context:"formatting"});case"iiii":default:return e.day(o,{width:"wide",context:"formatting"})}},a:function(n,t,e){const r=n.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(n,t,e){const o=n.getHours();let r;switch(o===12?r=jt.noon:o===0?r=jt.midnight:r=o/12>=1?"pm":"am",t){case"b":case"bb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(n,t,e){const o=n.getHours();let r;switch(o>=17?r=jt.evening:o>=12?r=jt.afternoon:o>=4?r=jt.morning:r=jt.night,t){case"B":case"BB":case"BBB":return e.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return e.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return e.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(n,t,e){if(t==="ho"){let o=n.getHours()%12;return o===0&&(o=12),e.ordinalNumber(o,{unit:"hour"})}return wt.h(n,t)},H:function(n,t,e){return t==="Ho"?e.ordinalNumber(n.getHours(),{unit:"hour"}):wt.H(n,t)},K:function(n,t,e){const o=n.getHours()%12;return t==="Ko"?e.ordinalNumber(o,{unit:"hour"}):Me(o,t.length)},k:function(n,t,e){let o=n.getHours();return o===0&&(o=24),t==="ko"?e.ordinalNumber(o,{unit:"hour"}):Me(o,t.length)},m:function(n,t,e){return t==="mo"?e.ordinalNumber(n.getMinutes(),{unit:"minute"}):wt.m(n,t)},s:function(n,t,e){return t==="so"?e.ordinalNumber(n.getSeconds(),{unit:"second"}):wt.s(n,t)},S:function(n,t){return wt.S(n,t)},X:function(n,t,e){const o=n.getTimezoneOffset();if(o===0)return"Z";switch(t){case"X":return lo(o);case"XXXX":case"XX":return St(o);case"XXXXX":case"XXX":default:return St(o,":")}},x:function(n,t,e){const o=n.getTimezoneOffset();switch(t){case"x":return lo(o);case"xxxx":case"xx":return St(o);case"xxxxx":case"xxx":default:return St(o,":")}},O:function(n,t,e){const o=n.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+so(o,":");case"OOOO":default:return"GMT"+St(o,":")}},z:function(n,t,e){const o=n.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+so(o,":");case"zzzz":default:return"GMT"+St(o,":")}},t:function(n,t,e){const o=Math.trunc(n.getTime()/1e3);return Me(o,t.length)},T:function(n,t,e){const o=n.getTime();return Me(o,t.length)}};function so(n,t=""){const e=n>0?"-":"+",o=Math.abs(n),r=Math.trunc(o/60),i=o%60;return i===0?e+String(r):e+String(r)+t+Me(i,2)}function lo(n,t){return n%60===0?(n>0?"-":"+")+Me(Math.abs(n)/60,2):St(n,t)}function St(n,t=""){const e=n>0?"-":"+",o=Math.abs(n),r=Me(Math.trunc(o/60),2),i=Me(o%60,2);return e+r+t+i}const co=(n,t)=>{switch(n){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},uo=(n,t)=>{switch(n){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},gn={p:uo,P:(n,t)=>{const e=n.match(/(P+)(p+)?/)||[],o=e[1],r=e[2];if(!r)return co(n,t);let i;switch(o){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",co(o,t)).replace("{{time}}",uo(r,t))}},ls=/^D+$/,cs=/^Y+$/,us=["D","DD","YY","YYYY"];function fo(n){return ls.test(n)}function po(n){return cs.test(n)}function yn(n,t,e){const o=ds(n,t,e);if(console.warn(o),us.includes(n))throw new RangeError(o)}function ds(n,t,e){const o=n[0]==="Y"?"years":"days of the month";return`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${t}\`) for formatting ${o} to the input \`${e}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const fs=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ps=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ms=/^'([^]*?)'?$/,hs=/''/g,gs=/[a-zA-Z]/;function mo(n,t,e){var d,u,p,h;const o=Pt(),r=o.locale??oo,i=o.firstWeekContainsDate??((u=(d=o.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,s=o.weekStartsOn??((h=(p=o.locale)==null?void 0:p.options)==null?void 0:h.weekStartsOn)??0,l=Ye(n);if(!ki(l))throw new RangeError("Invalid time value");let c=t.match(ps).map(m=>{const M=m[0];if(M==="p"||M==="P"){const x=gn[M];return x(m,r.formatLong)}return m}).join("").match(fs).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const M=m[0];if(M==="'")return{isToken:!1,value:ys(m)};if(io[M])return{isToken:!0,value:m};if(M.match(gs))throw new RangeError("Format string contains an unescaped latin alphabet character `"+M+"`");return{isToken:!1,value:m}});r.localize.preprocessor&&(c=r.localize.preprocessor(l,c));const f={firstWeekContainsDate:i,weekStartsOn:s,locale:r};return c.map(m=>{if(!m.isToken)return m.value;const M=m.value;(po(M)||fo(M))&&yn(M,t,String(n));const x=io[M[0]];return x(l,M,r.localize,f)}).join("")}function ys(n){const t=n.match(ms);return t?t[1].replace(hs,"'"):n}function vs(){return Object.assign({},Pt())}function bs(n){let e=Ye(n).getDay();return e===0&&(e=7),e}function ws(n,t){const e=t instanceof Date?We(t,0):new t(0);return e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),e.setHours(n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()),e}const Cs=10;class ho{constructor(){j(this,"subPriority",0)}validate(t,e){return!0}}class xs extends ho{constructor(t,e,o,r,i){super(),this.value=t,this.validateValue=e,this.setValue=o,this.priority=r,i&&(this.subPriority=i)}validate(t,e){return this.validateValue(t,this.value,e)}set(t,e,o){return this.setValue(t,e,this.value,o)}}class _s extends ho{constructor(){super(...arguments);j(this,"priority",Cs);j(this,"subPriority",-1)}set(e,o){return o.timestampIsSet?e:We(e,ws(e,Date))}}class Ve{run(t,e,o,r){const i=this.parse(t,e,o,r);return i?{setter:new xs(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(t,e,o){return!0}}class Ts extends Ve{constructor(){super(...arguments);j(this,"priority",140);j(this,"incompatibleTokens",["R","u","t","T"])}parse(e,o,r){switch(o){case"G":case"GG":case"GGG":return r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"});case"GGGGG":return r.era(e,{width:"narrow"});case"GGGG":default:return r.era(e,{width:"wide"})||r.era(e,{width:"abbreviated"})||r.era(e,{width:"narrow"})}}set(e,o,r){return o.era=r,e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}}const Ae={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},ct={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function He(n,t){return n&&{value:t(n.value),rest:n.rest}}function Le(n,t){const e=t.match(n);return e?{value:parseInt(e[0],10),rest:t.slice(e[0].length)}:null}function ut(n,t){const e=t.match(n);if(!e)return null;if(e[0]==="Z")return{value:0,rest:t.slice(1)};const o=e[1]==="+"?1:-1,r=e[2]?parseInt(e[2],10):0,i=e[3]?parseInt(e[3],10):0,s=e[5]?parseInt(e[5],10):0;return{value:o*(r*Ci+i*wi+s*xi),rest:t.slice(e[0].length)}}function go(n){return Le(Ae.anyDigitsSigned,n)}function qe(n,t){switch(n){case 1:return Le(Ae.singleDigit,t);case 2:return Le(Ae.twoDigits,t);case 3:return Le(Ae.threeDigits,t);case 4:return Le(Ae.fourDigits,t);default:return Le(new RegExp("^\\d{1,"+n+"}"),t)}}function Qt(n,t){switch(n){case 1:return Le(Ae.singleDigitSigned,t);case 2:return Le(Ae.twoDigitsSigned,t);case 3:return Le(Ae.threeDigitsSigned,t);case 4:return Le(Ae.fourDigitsSigned,t);default:return Le(new RegExp("^-?\\d{1,"+n+"}"),t)}}function vn(n){switch(n){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function yo(n,t){const e=t>0,o=e?t:1-t;let r;if(o<=50)r=n||100;else{const i=o+50,s=Math.trunc(i/100)*100,l=n>=i%100;r=n+s-(l?100:0)}return e?r:1-r}function vo(n){return n%400===0||n%4===0&&n%100!==0}class Fs extends Ve{constructor(){super(...arguments);j(this,"priority",130);j(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(e,o,r){const i=s=>({year:s,isTwoDigitYear:o==="yy"});switch(o){case"y":return He(qe(4,e),i);case"yo":return He(r.ordinalNumber(e,{unit:"year"}),i);default:return He(qe(o.length,e),i)}}validate(e,o){return o.isTwoDigitYear||o.year>0}set(e,o,r){const i=e.getFullYear();if(r.isTwoDigitYear){const l=yo(r.year,i);return e.setFullYear(l,0,1),e.setHours(0,0,0,0),e}const s=!("era"in o)||o.era===1?r.year:1-r.year;return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class Ss extends Ve{constructor(){super(...arguments);j(this,"priority",130);j(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(e,o,r){const i=s=>({year:s,isTwoDigitYear:o==="YY"});switch(o){case"Y":return He(qe(4,e),i);case"Yo":return He(r.ordinalNumber(e,{unit:"year"}),i);default:return He(qe(o.length,e),i)}}validate(e,o){return o.isTwoDigitYear||o.year>0}set(e,o,r,i){const s=hn(e,i);if(r.isTwoDigitYear){const c=yo(r.year,s);return e.setFullYear(c,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),bt(e,i)}const l=!("era"in o)||o.era===1?r.year:1-r.year;return e.setFullYear(l,0,i.firstWeekContainsDate),e.setHours(0,0,0,0),bt(e,i)}}class ks extends Ve{constructor(){super(...arguments);j(this,"priority",130);j(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(e,o){return Qt(o==="R"?4:o.length,e)}set(e,o,r){const i=We(e,0);return i.setFullYear(r,0,4),i.setHours(0,0,0,0),Bt(i)}}class Vs extends Ve{constructor(){super(...arguments);j(this,"priority",130);j(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(e,o){return Qt(o==="u"?4:o.length,e)}set(e,o,r){return e.setFullYear(r,0,1),e.setHours(0,0,0,0),e}}class Ms extends Ve{constructor(){super(...arguments);j(this,"priority",120);j(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,o,r){switch(o){case"Q":case"QQ":return qe(o.length,e);case"Qo":return r.ordinalNumber(e,{unit:"quarter"});case"QQQ":return r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(e,{width:"wide",context:"formatting"})||r.quarter(e,{width:"abbreviated",context:"formatting"})||r.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,o){return o>=1&&o<=4}set(e,o,r){return e.setMonth((r-1)*3,1),e.setHours(0,0,0,0),e}}class Ns extends Ve{constructor(){super(...arguments);j(this,"priority",120);j(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(e,o,r){switch(o){case"q":case"qq":return qe(o.length,e);case"qo":return r.ordinalNumber(e,{unit:"quarter"});case"qqq":return r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(e,{width:"wide",context:"standalone"})||r.quarter(e,{width:"abbreviated",context:"standalone"})||r.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,o){return o>=1&&o<=4}set(e,o,r){return e.setMonth((r-1)*3,1),e.setHours(0,0,0,0),e}}class Is extends Ve{constructor(){super(...arguments);j(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);j(this,"priority",110)}parse(e,o,r){const i=s=>s-1;switch(o){case"M":return He(Le(Ae.month,e),i);case"MM":return He(qe(2,e),i);case"Mo":return He(r.ordinalNumber(e,{unit:"month"}),i);case"MMM":return r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(e,{width:"wide",context:"formatting"})||r.month(e,{width:"abbreviated",context:"formatting"})||r.month(e,{width:"narrow",context:"formatting"})}}validate(e,o){return o>=0&&o<=11}set(e,o,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}}class Es extends Ve{constructor(){super(...arguments);j(this,"priority",110);j(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(e,o,r){const i=s=>s-1;switch(o){case"L":return He(Le(Ae.month,e),i);case"LL":return He(qe(2,e),i);case"Lo":return He(r.ordinalNumber(e,{unit:"month"}),i);case"LLL":return r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(e,{width:"wide",context:"standalone"})||r.month(e,{width:"abbreviated",context:"standalone"})||r.month(e,{width:"narrow",context:"standalone"})}}validate(e,o){return o>=0&&o<=11}set(e,o,r){return e.setMonth(r,1),e.setHours(0,0,0,0),e}}function Os(n,t,e){const o=Ye(n),r=ao(o,e)-t;return o.setDate(o.getDate()-r*7),o}class Ds extends Ve{constructor(){super(...arguments);j(this,"priority",100);j(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(e,o,r){switch(o){case"w":return Le(Ae.week,e);case"wo":return r.ordinalNumber(e,{unit:"week"});default:return qe(o.length,e)}}validate(e,o){return o>=1&&o<=53}set(e,o,r,i){return bt(Os(e,r,i),i)}}function Ps(n,t){const e=Ye(n),o=ro(e)-t;return e.setDate(e.getDate()-o*7),e}class Bs extends Ve{constructor(){super(...arguments);j(this,"priority",100);j(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(e,o,r){switch(o){case"I":return Le(Ae.week,e);case"Io":return r.ordinalNumber(e,{unit:"week"});default:return qe(o.length,e)}}validate(e,o){return o>=1&&o<=53}set(e,o,r){return Bt(Ps(e,r))}}const js=[31,28,31,30,31,30,31,31,30,31,30,31],Rs=[31,29,31,30,31,30,31,31,30,31,30,31];class Ls extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"subPriority",1);j(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(e,o,r){switch(o){case"d":return Le(Ae.date,e);case"do":return r.ordinalNumber(e,{unit:"date"});default:return qe(o.length,e)}}validate(e,o){const r=e.getFullYear(),i=vo(r),s=e.getMonth();return i?o>=1&&o<=Rs[s]:o>=1&&o<=js[s]}set(e,o,r){return e.setDate(r),e.setHours(0,0,0,0),e}}class $s extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"subpriority",1);j(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(e,o,r){switch(o){case"D":case"DD":return Le(Ae.dayOfYear,e);case"Do":return r.ordinalNumber(e,{unit:"date"});default:return qe(o.length,e)}}validate(e,o){const r=e.getFullYear();return vo(r)?o>=1&&o<=366:o>=1&&o<=365}set(e,o,r){return e.setMonth(0,r),e.setHours(0,0,0,0),e}}function bn(n,t,e){var u,p,h,m;const o=Pt(),r=(e==null?void 0:e.weekStartsOn)??((p=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:p.weekStartsOn)??o.weekStartsOn??((m=(h=o.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??0,i=Ye(n),s=i.getDay(),c=(t%7+7)%7,f=7-r,d=t<0||t>6?t-(s+f)%7:(c+f)%7-(s+f)%7;return Jn(i,d)}class Ws extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(e,o,r){switch(o){case"E":case"EE":case"EEE":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,o){return o>=0&&o<=6}set(e,o,r,i){return e=bn(e,r,i),e.setHours(0,0,0,0),e}}class qs extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(e,o,r,i){const s=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(o){case"e":case"ee":return He(qe(o.length,e),s);case"eo":return He(r.ordinalNumber(e,{unit:"day"}),s);case"eee":return r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeeee":return r.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"})}}validate(e,o){return o>=0&&o<=6}set(e,o,r,i){return e=bn(e,r,i),e.setHours(0,0,0,0),e}}class As extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(e,o,r,i){const s=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(o){case"c":case"cc":return He(qe(o.length,e),s);case"co":return He(r.ordinalNumber(e,{unit:"day"}),s);case"ccc":return r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"ccccc":return r.day(e,{width:"narrow",context:"standalone"});case"cccccc":return r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(e,{width:"wide",context:"standalone"})||r.day(e,{width:"abbreviated",context:"standalone"})||r.day(e,{width:"short",context:"standalone"})||r.day(e,{width:"narrow",context:"standalone"})}}validate(e,o){return o>=0&&o<=6}set(e,o,r,i){return e=bn(e,r,i),e.setHours(0,0,0,0),e}}function Hs(n,t){const e=Ye(n),o=bs(e),r=t-o;return Jn(e,r)}class Gs extends Ve{constructor(){super(...arguments);j(this,"priority",90);j(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(e,o,r){const i=s=>s===0?7:s;switch(o){case"i":case"ii":return qe(o.length,e);case"io":return r.ordinalNumber(e,{unit:"day"});case"iii":return He(r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),i);case"iiiii":return He(r.day(e,{width:"narrow",context:"formatting"}),i);case"iiiiii":return He(r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),i);case"iiii":default:return He(r.day(e,{width:"wide",context:"formatting"})||r.day(e,{width:"abbreviated",context:"formatting"})||r.day(e,{width:"short",context:"formatting"})||r.day(e,{width:"narrow",context:"formatting"}),i)}}validate(e,o){return o>=1&&o<=7}set(e,o,r){return e=Hs(e,r),e.setHours(0,0,0,0),e}}class zs extends Ve{constructor(){super(...arguments);j(this,"priority",80);j(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(e,o,r){switch(o){case"a":case"aa":case"aaa":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,o,r){return e.setHours(vn(r),0,0,0),e}}class Ys extends Ve{constructor(){super(...arguments);j(this,"priority",80);j(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(e,o,r){switch(o){case"b":case"bb":case"bbb":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,o,r){return e.setHours(vn(r),0,0,0),e}}class Us extends Ve{constructor(){super(...arguments);j(this,"priority",80);j(this,"incompatibleTokens",["a","b","t","T"])}parse(e,o,r){switch(o){case"B":case"BB":case"BBB":return r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(e,{width:"wide",context:"formatting"})||r.dayPeriod(e,{width:"abbreviated",context:"formatting"})||r.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,o,r){return e.setHours(vn(r),0,0,0),e}}class Xs extends Ve{constructor(){super(...arguments);j(this,"priority",70);j(this,"incompatibleTokens",["H","K","k","t","T"])}parse(e,o,r){switch(o){case"h":return Le(Ae.hour12h,e);case"ho":return r.ordinalNumber(e,{unit:"hour"});default:return qe(o.length,e)}}validate(e,o){return o>=1&&o<=12}set(e,o,r){const i=e.getHours()>=12;return i&&r<12?e.setHours(r+12,0,0,0):!i&&r===12?e.setHours(0,0,0,0):e.setHours(r,0,0,0),e}}class Qs extends Ve{constructor(){super(...arguments);j(this,"priority",70);j(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(e,o,r){switch(o){case"H":return Le(Ae.hour23h,e);case"Ho":return r.ordinalNumber(e,{unit:"hour"});default:return qe(o.length,e)}}validate(e,o){return o>=0&&o<=23}set(e,o,r){return e.setHours(r,0,0,0),e}}class Zs extends Ve{constructor(){super(...arguments);j(this,"priority",70);j(this,"incompatibleTokens",["h","H","k","t","T"])}parse(e,o,r){switch(o){case"K":return Le(Ae.hour11h,e);case"Ko":return r.ordinalNumber(e,{unit:"hour"});default:return qe(o.length,e)}}validate(e,o){return o>=0&&o<=11}set(e,o,r){return e.getHours()>=12&&r<12?e.setHours(r+12,0,0,0):e.setHours(r,0,0,0),e}}class Ks extends Ve{constructor(){super(...arguments);j(this,"priority",70);j(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(e,o,r){switch(o){case"k":return Le(Ae.hour24h,e);case"ko":return r.ordinalNumber(e,{unit:"hour"});default:return qe(o.length,e)}}validate(e,o){return o>=1&&o<=24}set(e,o,r){const i=r<=24?r%24:r;return e.setHours(i,0,0,0),e}}class Js extends Ve{constructor(){super(...arguments);j(this,"priority",60);j(this,"incompatibleTokens",["t","T"])}parse(e,o,r){switch(o){case"m":return Le(Ae.minute,e);case"mo":return r.ordinalNumber(e,{unit:"minute"});default:return qe(o.length,e)}}validate(e,o){return o>=0&&o<=59}set(e,o,r){return e.setMinutes(r,0,0),e}}class el extends Ve{constructor(){super(...arguments);j(this,"priority",50);j(this,"incompatibleTokens",["t","T"])}parse(e,o,r){switch(o){case"s":return Le(Ae.second,e);case"so":return r.ordinalNumber(e,{unit:"second"});default:return qe(o.length,e)}}validate(e,o){return o>=0&&o<=59}set(e,o,r){return e.setSeconds(r,0),e}}class tl extends Ve{constructor(){super(...arguments);j(this,"priority",30);j(this,"incompatibleTokens",["t","T"])}parse(e,o){const r=i=>Math.trunc(i*Math.pow(10,-o.length+3));return He(qe(o.length,e),r)}set(e,o,r){return e.setMilliseconds(r),e}}class nl extends Ve{constructor(){super(...arguments);j(this,"priority",10);j(this,"incompatibleTokens",["t","T","x"])}parse(e,o){switch(o){case"X":return ut(ct.basicOptionalMinutes,e);case"XX":return ut(ct.basic,e);case"XXXX":return ut(ct.basicOptionalSeconds,e);case"XXXXX":return ut(ct.extendedOptionalSeconds,e);case"XXX":default:return ut(ct.extended,e)}}set(e,o,r){return o.timestampIsSet?e:We(e,e.getTime()-Xt(e)-r)}}class ol extends Ve{constructor(){super(...arguments);j(this,"priority",10);j(this,"incompatibleTokens",["t","T","X"])}parse(e,o){switch(o){case"x":return ut(ct.basicOptionalMinutes,e);case"xx":return ut(ct.basic,e);case"xxxx":return ut(ct.basicOptionalSeconds,e);case"xxxxx":return ut(ct.extendedOptionalSeconds,e);case"xxx":default:return ut(ct.extended,e)}}set(e,o,r){return o.timestampIsSet?e:We(e,e.getTime()-Xt(e)-r)}}class rl extends Ve{constructor(){super(...arguments);j(this,"priority",40);j(this,"incompatibleTokens","*")}parse(e){return go(e)}set(e,o,r){return[We(e,r*1e3),{timestampIsSet:!0}]}}class al extends Ve{constructor(){super(...arguments);j(this,"priority",20);j(this,"incompatibleTokens","*")}parse(e){return go(e)}set(e,o,r){return[We(e,r),{timestampIsSet:!0}]}}const il={G:new Ts,y:new Fs,Y:new Ss,R:new ks,u:new Vs,Q:new Ms,q:new Ns,M:new Is,L:new Es,w:new Ds,I:new Bs,d:new Ls,D:new $s,E:new Ws,e:new qs,c:new As,i:new Gs,a:new zs,b:new Ys,B:new Us,h:new Xs,H:new Qs,K:new Zs,k:new Ks,m:new Js,s:new el,S:new tl,X:new nl,x:new ol,t:new rl,T:new al},sl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ll=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cl=/^'([^]*?)'?$/,ul=/''/g,dl=/\S/,fl=/[a-zA-Z]/;function bo(n,t,e,o){var M,x,y,v;const r=vs(),i=r.locale??oo,s=r.firstWeekContainsDate??((x=(M=r.locale)==null?void 0:M.options)==null?void 0:x.firstWeekContainsDate)??1,l=r.weekStartsOn??((v=(y=r.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0;if(t==="")return n===""?Ye(e):We(e,NaN);const c={firstWeekContainsDate:s,weekStartsOn:l,locale:i},f=[new _s],d=t.match(ll).map(b=>{const _=b[0];if(_ in gn){const S=gn[_];return S(b,i.formatLong)}return b}).join("").match(sl),u=[];for(let b of d){po(b)&&yn(b,t,n),fo(b)&&yn(b,t,n);const _=b[0],S=il[_];if(S){const{incompatibleTokens:T}=S;if(Array.isArray(T)){const V=u.find(F=>T.includes(F.token)||F.token===_);if(V)throw new RangeError(`The format string mustn't contain \`${V.fullToken}\` and \`${b}\` at the same time`)}else if(S.incompatibleTokens==="*"&&u.length>0)throw new RangeError(`The format string mustn't contain \`${b}\` and any other token at the same time`);u.push({token:_,fullToken:b});const g=S.run(n,b,i.match,c);if(!g)return We(e,NaN);f.push(g.setter),n=g.rest}else{if(_.match(fl))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");if(b==="''"?b="'":_==="'"&&(b=pl(b)),n.indexOf(b)===0)n=n.slice(b.length);else return We(e,NaN)}}if(n.length>0&&dl.test(n))return We(e,NaN);const p=f.map(b=>b.priority).sort((b,_)=>_-b).filter((b,_,S)=>S.indexOf(b)===_).map(b=>f.filter(_=>_.priority===b).sort((_,S)=>S.subPriority-_.subPriority)).map(b=>b[0]);let h=Ye(e);if(isNaN(h.getTime()))return We(e,NaN);const m={};for(const b of p){if(!b.validate(h,c))return We(e,NaN);const _=b.set(h,m,c);Array.isArray(_)?(h=_[0],Object.assign(m,_[1])):h=_}return We(e,h)}function pl(n){return n.match(cl)[1].replace(ul,"'")}class wo{constructor(t={value:"",displayFormat:"",valueFormat:""}){j(this,"editorType","date-picker");j(this,"value");j(this,"valueType","datetime");j(this,"displayFormat","");j(this,"valueFormat","");this.value=t.value,this.displayFormat=t.displayFormat,this.valueFormat=t.valueFormat}setValue(t){this.value=t.formatted}getValue(){return this.value}getDisplayText(){if(typeof this.value=="string"&&this.value){const t=bo(this.value,this.valueFormat,new Date);return mo(t,this.displayFormat)}return this.getValue()}isEmpty(){return!this.value}clear(){this.value=void 0}}class Zt{constructor(t={begin:"",end:""}){j(this,"editorType","date-range");j(this,"begin","");j(this,"end","");j(this,"valueType","datetime");this.begin=t.begin,this.end=t.end}clear(){this.begin="",this.end=""}getValue(){return!this.begin||!this.end?"":`${this.begin}~${this.end}`}getDisplayText(){return this.getValue()}setValue(t){t.dataRange?(this.begin=t.dataRange.split(t.delimiter)[0],this.end=t.dataRange.split(t.delimiter)[1]):this.clear()}isEmpty(){return!this.begin||!this.end}}class Co{constructor(t={value:"",displayFormat:"",valueFormat:""}){j(this,"editorType","datetime-picker");j(this,"value");j(this,"valueType","datetime");j(this,"displayFormat","");j(this,"valueFormat","");this.value=t.value,this.displayFormat=t.displayFormat,this.valueFormat=t.valueFormat}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){if(typeof this.value=="string"&&this.value){const t=bo(this.value,this.valueFormat,new Date);return mo(t,this.displayFormat)}return this.getValue()}setValue(t){this.value=t.formatted}isEmpty(){return!this.value}}class xo{constructor(t={value:"",valueList:[]}){j(this,"editorType","combo-list");j(this,"value");j(this,"valueType","enum");j(this,"valueList",[]);this.value=t.value,this.valueList=t.valueList}clear(){this.value="",this.valueList=[]}getValue(){return this.value}getDisplayText(){var r,i;const t=typeof this.value;let e="",o=[];switch(t){case"string":o=this.value.split(",")||[],e=this.valueList.filter(s=>o.indexOf(s.value)>-1).map(s=>s.name).join(",");break;case"boolean":e=((r=this.valueList.find(s=>s.value===this.value))==null?void 0:r.name)||"";break;case"number":e=((i=this.valueList.find(s=>s.value===this.value))==null?void 0:i.name)||"";break}return e}setValue(t){this.value=t.value}isEmpty(){return!this.value&&this.value!==!1&&this.value!==0}}class ml{constructor(t={value:"",displayText:"",displayField:"",isInputText:!1}){j(this,"editorType","input-group");j(this,"value");j(this,"valueType","text");j(this,"displayText");j(this,"valueField");j(this,"isInputText");this.value=t.value,this.displayText=t.displayText,this.valueField=t.displayField,this.isInputText=t.isInputText}clear(){this.value="",this.displayText="",this.valueField=""}getPropValue(t,e){if(e.length>1){const o=e.shift();return t[o]?this.getPropValue(t[o],e):""}return t[e[0]]}getTextValue(t){const e=t.split("."),o=this.value.map(r=>this.getPropValue(r,Ee.cloneDeep(e)));return o&&o.length?o.join(","):""}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.displayText&&!this.value.length}}class _o{constructor(t={mapFields:[],value:"",valueField:"",isInputText:!1,helpId:""}){j(this,"editorType","lookup");j(this,"helpId");j(this,"mapFields");j(this,"value");j(this,"valueField");j(this,"valueType","text");j(this,"isInputText");this.value=t.value,this.valueField=t.valueField,this.mapFields=t.mapFields,this.isInputText=t.isInputText,this.helpId=t.helpId}clear(){this.value="",this.mapFields=[]}getValue(){return this.mapFields.map(t=>ke.resolveField(t,this.valueField||"id")).join(",")}getDisplayText(){return this.value}setValue(t){throw new Error("Method not implemented.")}isEmpty(){return!this.mapFields.length}}class To{constructor(t={value:""}){j(this,"editorType","month-picker");j(this,"value");j(this,"valueType","datetime");this.value=t.value}setValue(t){this.value=t.formatted}getValue(){return this.value}getDisplayText(){return this.getValue()}clear(){this.value=void 0}isEmpty(){return!this.value}}class Fo{constructor(t={begin:"",end:""}){j(this,"editorType","month-range");j(this,"begin");j(this,"end");j(this,"valueType","datetime");this.begin=t.begin,this.end=t.end}clear(){this.begin="",this.end=""}getValue(){return!this.begin||!this.end?"":`${this.begin}~${this.end}`}getDisplayText(){return this.getValue()}setValue(t){t.dataRange?(this.begin=t.dataRange.split(t.delimiter)[0],this.end=t.dataRange.split(t.delimiter)[1]):this.clear()}isEmpty(){return!this.begin||!this.end}}class So{constructor(t={begin:null,end:null}){j(this,"editorType","number-range");j(this,"begin");j(this,"end");j(this,"valueType","number");this.begin=t.begin==null?null:parseFloat(t.begin),this.end=t.end==null?null:parseFloat(t.end)}clear(){this.begin=null,this.end=null}getValue(){return{begin:this.begin,end:this.end}}getDisplayText(){return(this.begin===null?"":this.begin)+"~"+(this.end===null?"":this.end)}setValue(t){this.begin=t.begin==null?null:parseFloat(t.begin),this.end=t.end==null?null:parseFloat(t.end)}isEmpty(){return this.begin==null&&this.end==null}}class ko{constructor(t={value:""}){j(this,"editorType","number-spinner");j(this,"value");j(this,"valueType","number");const e=parseFloat(t.value);this.value=isNaN(e)?null:e}clear(){this.value=null}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=isNaN(parseFloat(t))?null:t}isEmpty(){return this.value==null||isNaN(this.value)}}class Vo{constructor(t={value:null,valueList:[]}){j(this,"editorType","radio-group");j(this,"value");j(this,"valueType","enum");j(this,"valueList",[]);this.value=t.value,this.valueList=t.valueList}clear(){this.value=void 0,this.valueList=[]}getValue(){return this.value}getDisplayText(){var t;return((t=this.valueList.find(e=>e.value===this.value))==null?void 0:t.name)||""}setValue(t){this.value=t}isEmpty(){return!this.value&&this.value!==0&&this.value!==!1}}class Kt{constructor(t={value:""}){j(this,"editorType","text");j(this,"value");j(this,"valueType","text");this.value=t.value}clear(){this.value=void 0}getValue(){return this.value}getDisplayText(){return this.getValue()}setValue(t){this.value=t}isEmpty(){return!this.value}}function Mo(){function n(t,e){switch(t){case"check-box":return new Zn(e);case"combo-list":return new xo(e);case"combo-lookup":return new Kn(e);case"input-group":return new ml(e);case"date-picker":return new wo(e);case"date-range":return new Zt(e);case"datetime-picker":return new Co(e);case"datetime-range":return new Zt(e);case"lookup":return new _o(e);case"month-picker":return new To(e);case"month-range":return new Fo(e);case"number-range":return new So(e);case"number-spinner":return new ko(e);case"radio-group":return new Vo(e);default:return new Kt(e)}}return{createConditionValue:n}}function No(n,t){const e=a.ref(n.fields),o=a.ref([]),r=new Map,{createConditionValue:i}=Mo();function s(d){switch(d.editor?d.editor.type:"input-group"){case"date-range":d.editor.type="date-picker";break;case"datetime-range":d.editor.type="datetime-picker";break;case"number-range":d.editor.type="number-spinner";break}return d.editor}function l(d){return d.map(p=>Object.assign({},p)).map(p=>(p.editor=s(p),p))}function c(d=!0){e.value.reduce((u,p)=>(d||(p.editor=s(p)),u.set(p.labelCode,p),u),r)}function f(d){return d.forEach(u=>{if(u){const p=r.get(u.fieldCode);p.controlType&&(u.value=i(p.controlType,u.value))}}),d}return{convertToSingleControl:l,fields:e,fieldMap:r,fieldConditions:o,loadFieldConfigs:c,initialConditionValue:f}}function hl(n,t,e){const o=a.ref(null),r=a.ref(e),i=a.ref(0);function s(d,u){let p=null;return function(){const h=arguments;p?(clearTimeout(p),p=setTimeout(()=>{p=null,d(...h)},200)):(d(...h),p=setTimeout(()=>{p=null},200))}}function l(){r.value&&(o.value=new ResizeObserver(s(d=>{const u=d[0];i.value=u.contentRect.width})),o.value.observe(r.value))}function c(d){let p="col-12";return d>250*6?p="col-2":d>250*4?p="col-3":d>250*3?p="col-4":d>250*2&&(p="col-6"),p}const f=a.computed(()=>c(i.value));return a.watch([e],([d])=>{r.value=d,l()}),{conditionClass:f,resizeObserver:o}}const Io=a.defineComponent({name:"FConditionFields",props:Qn,emits:["valueChange","blur","focus","click","input"],setup(n,t){const e=a.ref(),o=a.ref(n.key);a.ref(n.isControlInline);const r=a.ref(n.conditions),i=No(n),{initialConditionValue:s,fieldMap:l,loadFieldConfigs:c}=i,f=hl(n,t,e),{conditionClass:d,resizeObserver:u}=f;c(!0),s(r.value),a.onBeforeUnmount(()=>{var x;(x=u.value)==null||x.unobserve(e.value)}),a.watch(()=>n.conditions,()=>{r.value=n.conditions,s(r.value)});const p=a.computed(()=>({"f-utils-flex-row-wrap":!0,"farris-form":!0,"condition-div":!0,"farris-form-controls-inline":n.isControlInline})),h=a.computed(()=>"col-12 col-md-6 col-xl-3 col-el-2 ");function m(x,y,v,b){x.value.editorType==="combo-list"&&b.newValue?x.value.valueList=b.newValue.map(_=>({name:_.name,value:_.value})):x.value.editorType==="radio-group"&&(x.value.valueList=[v.data.find(_=>_.value===y)]),t.emit("valueChange",y,x)}function M(){return r.value.map(x=>{var S,T,g,V,F,N;const y=(S=l.get(x.fieldCode))==null?void 0:S.editor,v=(T=l.get(x.fieldCode))==null?void 0:T.id;let b=!0;((g=x.value)==null?void 0:g.editorType)==="lookup"&&y?(y.idValue=(V=x.value.mapFields)==null?void 0:V.map(w=>w.id).join(","),y.onClear=()=>{x.value.mapFields=[],m(x,"")},y["onUpdate:dataMapping"]=w=>{x.value.mapFields=w.items,m(x,x.value.getValue())},b=!1):((F=x.value)==null?void 0:F.editorType)==="number-range"&&y&&(y.beginValue=x.value.begin,y.onBeginValueChange=w=>{x.value.begin=w,m(x,w)},y.endValue=x.value.end,y.onEndValueChange=w=>{x.value.end=w,m(x,w)},b=!1);let _=((N=y==null?void 0:y.appearance)==null?void 0:N.class)||h.value;return y!=null&&y.multiLineLabel&&(_=_+" farris-group-multi-label"),a.createVNode(nn.FDynamicFormGroup,{id:v,key:v,customClass:_,label:(y==null?void 0:y.showLabel)===!1?" ":x.fieldName,editor:y,required:y==null?void 0:y.required,modelValue:x.value.value,"onUpdate:modelValue":w=>x.value.value=w,onChange:(w,R)=>{b&&m(x,w,y,R)}},null)})}return()=>a.withDirectives(a.createVNode("div",{class:p.value,key:o.value,ref:e},[M()]),[[a.resolveDirective("area-response")]])}});var At=(n=>(n[n.Value=0]="Value",n[n.SmartHelp=1]="SmartHelp",n[n.Enum=2]="Enum",n[n.Express=3]="Express",n))(At||{}),at=(n=>(n.Equal="0",n.NotEqual="1",n.Greater="2",n.GreaterOrEqual="3",n.Less="4",n.LessOrEqual="5",n.Like="6",n.LikeStartWith="7",n.LikeEndWith="8",n.In="9",n.NotIn="10",n))(at||{});const gl=[{value:"0",name:"等于"},{value:"1",name:"不等于"},{value:"2",name:"大于"},{value:"3",name:"大于等于"},{value:"4",name:"小于"},{value:"5",name:"小于等于"},{value:"6",name:"包含"},{value:"7",name:"开始是"},{value:"8",name:"结束是"}],yl={"button-edit":["0","1"," 6","7","8"],"check-box":["0"],"combo-list":["0","1"],"combo-lookup":["0","1"," 6","7","8"],"date-picker":["0","1","2","3","4","5"],"date-range":[],"datetime-picker":["0","1","2","3","4","5"],"datetime-range":[],"month-picker":["0","1","2","3","4","5"],"month-range":[],"year-picker":["0","1","2","3","4","5"],"year-range":[],"input-group":["0","1","6","7","8"],lookup:["0","1"],"number-range":[],"number-spinner":["0"," 1","2","3","4","5"],"radio-group":["0"],text:["0","1"," 6","7","8"]};function vl(n,t,e){const{fieldMap:o}=e;function r(i){const s=o.get(i.fieldCode);if(!s)return[];const l=s.editor.type,c=new Set(yl[l]);return gl.filter(d=>c.has(d.value))}return{getCompareOperators:r}}function Eo(){const n=a.ref({relation:0,items:[],children:[],path:[],groupId:0,level:0}),t=new Map,e=new Map;let o=0;function r(){return{id:"",fieldCode:"",fieldName:"",compareType:at.Equal,valueType:At.Value,value:new Kt,relation:0,conditionId:Date.now()}}function i(F,N){return{relation:F,items:[],children:[],path:[],groupId:++o,level:N}}function s(){const F=Object.assign({},n.value);e.forEach((N,w)=>{N.groupId===F.groupId&&e.set(w,F)}),t.forEach((N,w)=>{N.groupId===F.groupId&&t.set(w,F)}),n.value=F}function l(F){const N=new Map;let w=0;return F.forEach((R,L)=>{var C,k;if(w+=((C=R.lBracket)==null?void 0:C.length)||0,N.set(L,w),w-=((k=R.rBracket)==null?void 0:k.length)||0,w<0)throw new Error("The right bracket is out of range.")}),N}function c(F,N,w,R,L){for(let C=0;C<N;C++){const k=F+(C+1),D=i(L,k);w.children.push(D),e.set(D.groupId,w),w=w.children[w.children.length-1],R.push(w)}return w}function f(F,N,w,R,L){for(let B=N;B<=0;B++)R.pop();const C=R[R.length-1];if(!C)throw new Error("The group path is out of range");const k=F+N,D=i(L,k);return C.children.push(D),e.set(D.groupId,C),w=C.children[C.children.length-1],R.push(w),w}function d(F,N,w,R){w.pop();const L=w[w.length-1],C=i(R,F);return L.children.push(C),e.set(C.groupId,L),N=L.children[L.children.length-1],w.push(N),N}function u(F,N,w,R,L,C){let k=F[F.length-1];if(!k)throw new Error("The group path is out of range");const D=N.get(R)||0,B=N.get(w)||0;if(w<0||w===R)return F[F.length-1];const O=D-B,P=L&&L.relation!==void 0?L.relation:1;return k=O>0?c(B,O,k,F,P):k,k=O<0?f(B,O,k,F,P):k,k=O===0&&B>0&&D>0&&L&&C&&!!L.rBracket&&!!C.lBracket?d(B,k,F,P):k,k}function p(F){const w={relation:F.length&&F[0].relation!==void 0?F[0].relation:1,items:[],children:[],path:[],groupId:0,level:0},R=[w],L=l(F);return F.forEach((C,k)=>{const D=k-1,B=F[D],O=u(R,L,D,k,B,C);O.items.push(C),t.set(C.conditionId,O)}),n.value=w,w}function h(){const F=r();t.set(F.conditionId,n.value),n.value.items.push(F)}function m(F){if(!F)return;const N=t.get(F.conditionId);if(N){const w=N.items.findIndex(L=>L.conditionId===F.conditionId)+1,R=r();t.set(R.conditionId,N),N.items.splice(w,0,R),s()}}function M(F,N,w,R){F.reduce((L,C)=>{const k=C.conditionId!==void 0,D=C.groupId!==void 0;if(k){const B=C;w.push(B),L.items.set(B.conditionId,B)}if(D){const B=C;R.push(B),L.groups.set(B.groupId,B)}return L},N)}function x(F,N,w,R,L){F&&(F.items=N.length?F.items.filter(C=>!w.has(C.conditionId)):F.items,F.children=R.length?F.children.filter(C=>!L.has(C.groupId)):F.children)}function y(F,N,w){N.forEach(R=>{F.items.push(R),t.set(R.conditionId,F)}),w.forEach(R=>{F.children.push(R),e.set(R.groupId,F)})}function v(F){const N=F[0],w=N.conditionId!==void 0?t.get(N.conditionId):e.get(N.groupId),R={items:new Map,groups:new Map},L=[],C=[];if(w){M(F,R,L,C),x(w,L,R.items,C,R.groups);const k=i(w.relation,w.level+1);y(k,L,C),w.children.push(k),e.set(k.groupId,w),s()}}function b(F){const N=[...F.items],w=[...F.children],R=e.get(F.groupId);R&&(R.children=R.children.filter(L=>L.groupId!==F.groupId),e.delete(F.groupId),N.forEach(L=>{R.items.push(L),t.set(L.conditionId,R)}),w.forEach(L=>{R.children.push(L),e.set(L.groupId,R)}),s())}function _(F){F.relation=F.relation===1?2:1,s()}let S;function T(F){const{relation:N}=F;return(F.children&&F.children.length?F.children.map((R,L,C)=>{const k=S(R);return k[0].lBracket=(k[0].lBracket||"")+"(",k[k.length-1].rBracket=(k[k.length-1].rBracket||"")+")",k[k.length-1].relation=L<C.length-1?N:0,k}):[]).flat()}S=(F=n.value)=>{const{relation:N}=F,w=F.items.map((L,C,k)=>(L.lBracket=C===0?"(":"",L.rBracket=C===k.length-1?")":"",L.relation=C<k.length-1?N||1:0,L)),R=T(F);return[...w,...R]};function g(F){const N=F||n.value;if(N.children.length&&N.children.forEach(w=>{g(w)}),N.level===0&&!N.items.length&&N.children.length===1){const w=N.children[0];n.value.relation=w.relation,b(w)}else N.items.length===0&&N.children.length<=1&&b(N)}function V(F){const N=t.get(F.conditionId);N&&(N.items=N.items.filter(w=>w.conditionId!==F.conditionId),t.delete(F.conditionId),g(),s())}return{addCondition:h,changeGroupRelation:_,conditionGroupMap:t,getConditions:S,group:v,groupParentMap:e,insertConditionTo:m,loadConditionGroup:p,refresh:s,removeCondition:V,rootGroup:n,unGroup:b}}function bl(n,t,e){const o=a.ref(new Set),r=a.ref(new Set),{conditionGroupMap:i,groupParentMap:s}=e;let l,c;function f(y){let v=l.level<=y.level?l:y,b=l.level>y.level?l:y;const _=[];for(;b&&v&&b!==v;)b.level>v.level?(_.push(b),b=s.get(b.groupId)):b.level===v.level&&(v=s.get(v.groupId),v&&_.unshift(v));return _}function d(y){r.value.add(y.groupId),y.items.forEach(v=>o.value.add(v.conditionId)),y.children.forEach(v=>d(v))}function u(y){const{conditionId:v}=y;o.value.add(v),l=o.value.size===0?i.get(v):l;const b=i.get(y.conditionId);f(b).forEach(S=>d(S))}const p=a.computed(()=>o.value.size===0&&r.value.size===1),h=function(y){r.value.delete(y.groupId),y.items.forEach(b=>c(b)),y.children.forEach(b=>!p.value&&h(b));const v=s.get(y.groupId);v&&r.value.has(v.groupId)&&h(v)};c=function(y){const{conditionId:v}=y;if(o.value.has(v)&&o.value.delete(v),r.value.size>0){const b=i.get(v);b&&r.value.has(b.groupId)&&h(b)}};function m(y){const{conditionId:v}=y;o.value.size===0&&(l=i.get(v)),o.value.has(v)?c(y):u(y)}function M(){const y=[];return l&&(l.items.filter(v=>o.value.has(v.conditionId)).forEach(v=>y.push(v)),l.children.filter(v=>r.value.has(v.groupId)).forEach(v=>y.push(v))),y}function x(){o.value.clear(),r.value.clear()}return{clear:x,getSelectedGroupItem:M,selectedItems:o,toggleSelect:m}}const wn=a.defineComponent({name:"FConditionList",props:Qn,emits:["valueChange","labelCodeChange","compareTypeChange"],setup(n,t){const e=a.ref(n.key),o=a.ref(n.conditions),r=No(n),{convertToSingleControl:i,fields:s,fieldMap:l,loadFieldConfigs:c}=r,f=Eo(),{addCondition:d,changeGroupRelation:u,getConditions:p,group:h,insertConditionTo:m,loadConditionGroup:M,refresh:x,removeCondition:y,rootGroup:v,unGroup:b}=f,{createConditionValue:_}=Mo(),S=bl(n,t,f),{selectedItems:T,toggleSelect:g}=S,{getCompareOperators:V}=vl(n,t,r);c(!1),s.value=i(s.value),M(o.value);function F(I){var $;const H=(($=l.get(I.fieldCode))==null?void 0:$.editor)||{type:"text"};I.value=_(H.type,void 0),t.emit("labelCodeChange",I)}function N(I,H){t.emit("compareTypeChange",H)}function w(){}t.expose({getConditions:p});function R(I,H){t.emit("valueChange",I,H)}function L(I){return a.createVNode("div",{class:"condition-list-item-type mr-3"},[a.createVNode(Ft,{"value-field":"labelCode","text-field":"name","id-field":"id",data:s.value,modelValue:I.fieldCode,"onUpdate:modelValue":H=>I.fieldCode=H,onChange:H=>F(I)},null)])}function C(I){return a.createVNode("div",{class:"condition-list-item-compare mr-3"},[a.createVNode(Ft,{"value-field":"value","text-field":"name","id-field":"id",data:V(I),modelValue:I.compareType,"onUpdate:modelValue":H=>I.compareType=H,onChange:H=>N(H,I)},null)])}function k(I){var H;return a.createVNode("div",{class:"condition-list-item-control mr-3"},[a.createVNode(Lt,{editor:(H=l.get(I.fieldCode))==null?void 0:H.editor,showLabel:!1,modelValue:I.value.value,"onUpdate:modelValue":$=>I.value.value=$,onChange:$=>{R($,I)}},null)])}function D(I){return[a.createVNode("div",{class:"condition-list-item-extend"},[a.createVNode("span",{class:"f-icon f-icon-plus-sm mr-2",onClick:()=>m(I)},null),a.createVNode("span",{class:"f-icon f-icon-minus-sm",onClick:()=>y(I)},null)]),a.createVNode("div",{class:"custom-control custom-checkbox"},[a.createVNode("input",{title:"selection",class:"custom-control-input",type:"checkbox",checked:T.value.has(I.conditionId)},null),a.createVNode("label",{class:"custom-control-label",onClick:()=>g(I)},null)])]}function B(I){return I.items.map(H=>a.createVNode("div",{class:"condition-list-item",key:H.conditionId},[L(H),C(H),k(H),D(H)]))}function O(I){return a.createVNode("div",{class:"condition-list-relation"},[a.createVNode("span",{class:"condition-list-relation-close f-icon-filter-cancel btn-link",onClick:()=>b(I)},null),a.createVNode("span",{class:"condition-list-relation-text btn-link",onClick:()=>u(I)},[I.relation===1?"与":"或"])])}function P(I){return a.createVNode("div",{class:"condition-list-content"},[a.createVNode("div",{class:"condition-list-content-group"},[B(I),I.children&&I.children.map(H=>P(H))]),O(I)])}function A(){h(S.getSelectedGroupItem()),S.clear()}function E(){return a.createVNode("div",{class:"condition-list-bottom"},[a.createVNode("div",{class:"add-condition-btn mb-1 mr-3",onClick:d},[a.createVNode("span",{class:"f-icon f-icon-filter-add"},null),a.createVNode("span",{class:"ml-1"},[a.createTextVNode("添加条件")])]),a.createVNode("div",{class:"add-condition-btn mb-1",onClick:A},[a.createVNode("span",{class:"f-icon f-icon-filter-grouping"},null),a.createVNode("span",{class:"ml-1"},[a.createTextVNode("生成条件组")])]),a.createVNode("div",{class:"condition-list-reset add-condition-btn",onClick:w},[a.createTextVNode("重置")])])}return()=>a.createVNode("div",{class:"condition-list",key:e.value},[a.createVNode("div",{class:"condition-list-body"},[P(v.value)]),E()])}});wn.install=n=>{n.component(Io.name,Io).component(wn.name,wn)};const wl=["equal","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","contain","startWidth","endWidth","in","notIn"],Cl={equal:(n,t,e)=>n&&n[t]===e,notEqual:(n,t,e)=>n&&n[t]!==e,contain:(n,t,e)=>n?(n[t]||"").indexOf(e)>-1:!1,startWidth:(n,t,e)=>n?(n[t]||"").startsWith(e):!1,endWidth:(n,t,e)=>n?(n[t]||"").endsWith(e):!1},xl={equal:(n,t,e)=>n&&n[t]===e,in:(n,t,e)=>{if(n){const o=n[t];return e.indexOf(o)>-1}return!1},notEqual:(n,t,e)=>n&&n[t]!==e},_l={equal:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()===o}return!1},notEqual:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()!==o}return!1},greaterThan:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()>o}return!1},greaterThanOrEqual:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()>=o}return!1},lessThan:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()<o}return!1},lessThanOrEqual:(n,t,e)=>{if(n){const o=new Date(new Date(e).toLocaleDateString()).valueOf();return new Date(new Date(n[t]).toLocaleDateString()).valueOf()<=o}return!1}},Tl={equal:(n,t,e)=>n?String(e).split(",").includes(String(n[t])):!1,in:(n,t,e)=>{if(n){const o=n[t];return e.indexOf(o)>-1}return!1},notEqual:(n,t,e)=>n?String(e).split(",").findIndex(r=>r===String(n[t]))===-1:!1},Fl={equal:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):o===r}return!1},notEqual:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?!0:o!==r}return!1},greaterThan:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):r>o}return!1},greaterThanOrEqual:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):r>=o}return!1},lessThan:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):r<o}return!1},lessThanOrEqual:(n,t,e)=>{if(n){const o=Number.parseFloat(String(e)),r=Number.parseFloat(String(n[t]));return isNaN(o)?isNaN(r):r<=o}return!1}},Sl=new Map([["boolean",xl],["datetime",_l],["enum",Tl],["number",Fl],["text",Cl]]);function kl(){const n=a.ref([]),t=new Map,{loadConditionGroup:e}=Eo();function o(x,y){switch(x){case"check-box":return new Zn({value:y});case"combo-list":return new xo({value:y});case"combo-lookup":return new Kn({value:y});case"input-group":return new Kt({value:y});case"date-picker":return new wo({value:y});case"date-range":return new Zt({value:y});case"datetime-picker":return new Co({value:y});case"datetime-range":return new Zt({value:y});case"lookup":return new _o({value:y});case"month-picker":return new To({value:y});case"month-range":return new Fo({value:y});case"number-range":return new So({value:y});case"number-spinner":return new ko({value:y});case"radio-group":return new Vo({value:y});default:return new Kt({value:y})}}const r=new Map([["boolean","check-box"],["date","date-picker"],["datetime","datetime-picker"],["number","number-spinner"],["string","text"],["text","text"],["enum","combo-list"],["reference","lookup"]]),i=new Map([["boolean",at.In],["date",at.Equal],["datetime",at.Equal],["number",at.Equal],["string",at.Equal],["text",at.Equal],["enum",at.In],["reference",at.Equal]]);function s(x){var v;const y=x.dataType||"string";return((v=x.editor)==null?void 0:v.type)||r.get(y)||"text"}function l(x){var N,w,R,L,C;const y=`field_filter_${x.field}`,v=Date.now(),b=x.field,_=((N=x.column)==null?void 0:N.title)||"",S=((w=x.column)==null?void 0:w.dataType)||"string",T=i.get(S)||at.Equal,g=((L=(R=x.column)==null?void 0:R.editor)==null?void 0:L.type)||r.get(S)||"text",V=o(g,(C=x.column)==null?void 0:C.filter),F=g==="lookup"||g==="combo-lookup"?At.SmartHelp:g==="combo-list"?At.Enum:At.Value;t.set(y,{id:y,fieldCode:b,fieldName:_,compareType:T,valueType:F,value:V,conditionId:v}),n.value=Array.from(t.values())}function c(x){const y=`field_filter_${x.field}`;t.delete(y),n.value=Array.from(t.values())}function f(x){t.delete(x),n.value=Array.from(t.values())}function d(){t.clear(),n.value=[]}function u(x){const{valueType:y}=x.value,v=x.compareType||"0",b=wl[Number(v)];return Sl.get(y)[b]}function p(x){const y=x.relation===2?0:1,v=x.items.map(_=>{const S=u(_);return g=>S(g,_.fieldCode,_.value.getValue())}),b=x.children&&x.children.length?x.children.map(_=>p(_)):[];return{relation:y,filterFunctions:v,children:b}}function h(){const x=e(n.value);return p(x)}function m(x,y){const v=y.filterFunctions.map(_=>_(x)),b=y.children.map(_=>m(x,_));return y.relation===1?v.every(_=>_)&&b.every(_=>_):v.includes(!0)||b.includes(!0)}function M(x){const y=h();return m(x,y)}return{addColumnFilter:l,apply:M,clearCondition:d,conditions:n,getFilterEditorType:s,removeColumnFilter:c,removeCondition:f}}function Vl(n){a.ref(n.selection.showCheckbox||!1);const t=a.computed(()=>{var s;return((s=n.hierarchy)==null?void 0:s.collapseField)||"__fv_collapse__"}),e=a.computed(()=>{var s;return((s=n.hierarchy)==null?void 0:s.hasChildrenField)||"__fv_hasChildren__"}),o=a.computed(()=>{var s;return((s=n.hierarchy)==null?void 0:s.parentIdField)||"parent"}),r=a.computed(()=>n.hierarchy&&n.selection.showCheckbox),i=a.computed(()=>(n.treeNodeIconsData.fold||n.iconField)&&n.showTreeNodeIcons);return{collapseField:t,hasChildrenField:e,parentIdField:o,shouldShowCheckBox:r,shouldShowIcon:i}}function Ml(n,t,e,o,r,i,s,l,c){var _t;const{dataView:f,visibleDataItems:d}=t,{getVisualData:u,maxVisibleRowIndex:p,minVisibleRowIndex:h}=r,m=a.computed(()=>o.value.primaryColumnsWidth),M=a.computed(()=>o.value.leftColumnsWidth),x=a.computed(()=>o.value.rightColumnsWidth),y=((_t=n.rowOption)==null?void 0:_t.height)||28,v=a.ref(0),b=a.ref(0);let _=0,S=i.value-1;const T=a.ref(0),g=a.ref(0),V=a.ref(0),F=a.ref(n.virtualized),N=24,w=1.5;let R=null;function L(){const re=d.value;if(re.length<=0)return 0;const de=p.value<re.length?re[p.value]:re[re.length-1];return de.__fv_data_position__>re.length*y?re.length*y:(de.__fv_data_position__||0)+(de.__fv_data_height__||0)+Math.max(re.length-1-p.value,0)*y}const C=a.computed(()=>{const re=L();d.value;let de=g.value/Math.max(re,g.value),ge=Math.floor(de*g.value);for(;g.value>0&&ge<N;)de*=w,ge=Math.floor(de*g.value);return ge}),k=a.computed(()=>Math.floor(V.value/Math.max(m.value,V.value)*T.value)),D=0,B=0,O=a.computed(()=>T.value-(M.value+m.value+x.value+l.value));function P(re){const ge=Math.floor(re/y)+1,Pe=d.value;return Pe.length>ge?Pe[ge].__fv_visible_index__-1:0}function A(re,de,ge){let Pe=re,ze=de;const Je=de-re+1;if(Je<s+i.value+s){const U=s+i.value+s-Je,fe=de+U<=ge,we=0+U<=re;if(fe)ze+=U,S=ze;else if(we)Pe-=U,_=Pe;else{const Ne=ge-de,q=U-Ne;ze=Math.min(de+Ne,ge),Pe=Math.max(re-q,0)}}return{actualStart:Pe,actualEnd:ze}}function E(re){var Ne,q;const de=d.value;if(!de.length){e.value=[];return}const ge=(Ne=n.pagination)!=null&&Ne.enable?0:Math.max(_-s,0),Pe=de[de.length-1].__fv_visible_index__,ze=(q=n.pagination)!=null&&q.enable?de.length-1:Math.min(S+s,Pe),{actualStart:Je,actualEnd:U}=A(ge,ze,Pe),fe=de[Je-1],we=u(Je,U,fe,re);we.length&&(e.value=[...we])}const I=a.computed(()=>L()>g.value),H=a.computed(()=>Math.floor(m.value)>V.value);function $(re,de){let ge=re;const Pe=ge>D,ze=I.value;ze&&ge<g.value-de&&(ge=g.value-de),(!ze||Pe)&&(ge=D),v.value!==ge&&(v.value=ge)}function W(){F.value&&(_=P(Math.abs(v.value)),S=_+i.value-1,(_<h.value||S>p.value-s/2)&&E())}function G(re){let de=v.value+re;de>D&&(de=D);const ge=L();$(de,ge),W()}function X(re){if(!H.value){b.value=0;return}let de=b.value+re;de>B&&(de=B),de<O.value&&(de=O.value),b.value!==de&&(b.value=de)}function K(){Math.abs(b.value)+V.value>m.value&&(b.value=Math.min(V.value-m.value,0))}function Q(){v.value=0,_=0,S=i.value-1,E()}function pe(){const re=L();$(v.value,re)}a.watch([V,m],()=>{X(0)}),a.watch(g,(re,de)=>{re!==de&&re>=f.value.length*y&&G(0)});function he(re){let{deltaX:de}=re,ge=-1*re.deltaY;return typeof de>"u"&&(de=-1*re.wheelDeltaX/6),typeof ge>"u"&&(ge=re.wheelDeltaY/6),re.deltaMode&&re.deltaMode===1&&(de*=10,ge*=10),re.shiftKey?{deltaY:-ge,deltaX:-de}:{deltaX:de,deltaY:ge}}function xe(re){if(n.disabled||!I.value||re.target.tagName==="TEXTAREA")return;re.preventDefault(),re.stopPropagation();const{deltaX:de,deltaY:ge}=he(re);G(ge),X(de)}const De=a.computed(()=>({height:`${f.value.length*y}px`,width:`${M.value}px`,transform:`translateY(${v.value}px)`})),Re=a.computed(()=>({transform:`translateY(${v.value}px)`})),Y=a.computed(()=>({height:`${(n.autoHeight?d.value:f.value).length*y}px`,width:`${m.value}px`,transform:`translate(${b.value}px, ${v.value}px)`})),ue=a.computed(()=>({transform:`translate(${b.value}px, ${v.value}px)`})),z=a.computed(()=>({height:`${f.value.length*y}px`,width:`${x.value}px`,transform:`translateY(${v.value}px)`})),oe=a.computed(()=>({transform:`translateY(${v.value}px)`})),ve=a.computed(()=>({height:`${f.value.length*y}px`,width:`${l.value}px`,transform:`translateY(${v.value}px)`})),Se=a.computed(()=>({width:`${M.value}px`})),Oe=a.computed(()=>({transform:`translateX(${b.value}px)`})),ot=a.computed(()=>({width:`${x.value}px`})),mt=a.computed(()=>{const re=L();return $(v.value,re),v.value/(g.value-re)*(g.value-C.value)}),dt=a.computed(()=>({width:"8px",height:`${C.value}px`,top:`${mt.value}px`})),J=a.computed(()=>b.value/O.value*(T.value-k.value)),_e=a.computed(()=>({height:"8px",width:`${k.value}px`,left:`${J.value}px`})),Ie=a.ref(!1),Ge=a.ref(-1),je=a.ref(-1),it=a.ref();function ht(re){if(Ie.value&&je.value!==-1){const de=je.value-re.pageX,ge=T.value-k.value;if(Math.abs(de)<=ge){const Pe=de/(V.value-k.value)*(m.value-V.value);X(Pe),je.value=re.pageX}}}function Ct(re){if(Ie.value&&Ge.value!==-1){const de=Ge.value-re.pageY,ge=L(),Pe=ge-C.value;if(Math.abs(de)<=Pe){const ze=de/(g.value-C.value)*(ge-g.value);G(ze),Ge.value=re.pageY}}}function ft(re){Ie.value=!1,Ge.value=-1,je.value=-1,document.removeEventListener("mouseup",ft),R&&(document.removeEventListener("mousemove",R),R=null),document.body.style.userSelect="",it.value&&(it.value.style.opacity=null)}function Vt(re,de,ge){var Je;Ie.value=!0;const Pe=(Je=re.target)==null?void 0:Je.parentElement;Pe&&(Pe.style.opacity="1",it.value=Pe);const ze=ge==="horizontal"?ht:Ct;R||(R=Ee.throttle(ze,50)),ge==="vertical"&&(Ge.value=re.pageY),ge==="horizontal"&&(je.value=re.pageX),de.value&&(de.value,document.addEventListener("mousemove",R),document.addEventListener("mouseup",ft),document.body.style.userSelect="none")}function xt(re){const de=f.value.length*y-g.value;let ge=re*y;ge>=de&&(ge=de),G(-ge-v.value)}function gt(){xt(f.value.length)}function Mt(re){G(re-v.value)}return{dataGridWidth:T,fitHorizontalScroll:K,gridDataStyle:Y,gridHeaderColumnsStyle:Oe,gridMergedDataStyle:ue,gridSideStyle:ve,horizontalScrollThumbStyle:_e,leftFixedGridDataStyle:De,leftFixedGridHeaderColumnsStyle:Se,leftFixedGridMergedDataStyle:Re,offsetX:b,offsetY:v,onMouseDownScrollThumb:Vt,onWheel:xe,reCalculateVisualDataRows:E,resetScroll:Q,rightFixedGridDataStyle:z,rightFixedGridHeaderColumnsStyle:ot,rightFixedGridMergedDataStyle:oe,shouldShowHorizontalScrollbar:H,shouldShowVirticalScrollbar:I,updateVirticalScroll:pe,updateVisibleRowsOnLatestVisibleScope:W,verticalScrollThumbStyle:dt,viewPortWidth:V,viewPortHeight:g,scrollToBottom:gt,scrollToRowByIndex:xt,scrollTo:Mt}}function Nl(n){var i;const{isUndefined:t}=ke.useCommonUtils(),e=((i=n.rowOption)==null?void 0:i.height)||28;function o(s,l){const c=s.pre;if(c){let f=c.__fv_data_position__,d=c.__fv_data_height__;(t(f)||n.virtualized&&n.hierarchy&&c.__fv_visible_index__*e!==f)&&(f=c.__fv_visible_index__*e),t(d)&&(d=e);const u=s.visible?f+d:c.__fv_data_position__;s.top=u,l.__fv_data_position__=u}else s.top=0,l.__fv_data_position__=0}function r(s,l,c){if(s&&!l.ref){l.ref=s;const f=l.parent;l.cellHeight!==s.offsetHeight&&(l.cellHeight=s.offsetHeight),l.cellHeight&&l.cellHeight>(f.height||0)&&(f.height=l.cellHeight,c.__fv_data_height__=f.height),o(f,c)}}return{updateRowPosition:o,updateVisualInfomation:r}}function Il(){function n(t,e){var s,l;if(!e.data||!e.data.length)return"";const o=Object.prototype.hasOwnProperty.call(e,"valueField")&&e.valueField||"value",r=Object.prototype.hasOwnProperty.call(e,"textField")&&e.textField||"name";if(t!=null&&t.includes(",")){const c=t.split(",");if(!e.data.filter(p=>c.includes(p[o])).length)return"";const d=(s=e.data)==null?void 0:s.reduce((p,h)=>(p[h[o]]=h,p),{});return c.map(p=>{var h;return(h=d[p])==null?void 0:h[r]}).join(",")||t}const i=(l=e.data)==null?void 0:l.find(c=>c[o]===t);return(i==null?void 0:i[r])||t||""}return{renderEnumColumn:n}}function El(){function n(t,e){return t?e==null?void 0:e.trueText:e==null?void 0:e.falseText}return{renderText:n}}function Ol(){const{formatTo:n}=ke.useDateFormat();function t(o,r){if(o){let i="yyyy-MM-dd";if(typeof r=="string"?i=r:typeof r=="object"&&(i=r.format||"yyyy-MM-dd"),i=i.replace("YYYY","yyyy").replace("-DD","-dd"),typeof r=="object"&&r.dateRange){const s=r.dateRangeDatesDelimiter||"~";let[l,c]=o.split(s);return l=n(l,i),c=n(c,i),l+s+c}return n(o,i)}return o}function e(o,r){const i=r.dateFormat||"yyyy-MM-dd";return n(o,i)}return{renderDateColumn:e,renderDateTimeColumn:t}}function Dl(){const{formatTo:n}=ke.useNumberFormat();function t(e,o){const r={precision:o.precision,prefix:o.prefix||"",suffix:o.suffix||"",decimalSeparator:o.decimal||".",groupSeparator:o.thousand||""};return n(e,r)||e}return{renderNumberColumn:t}}function Pl(){function n(t,e){if(t){const o={};return e!=null&&e.width&&(o.width=`${e.width}px`),e!=null&&e.height&&(o.height=`${e.height}px`),a.createVNode("img",{src:t,style:o},null)}return t}return{renderImageColumn:n}}function Bl(){const{renderText:n}=El(),{renderEnumColumn:t}=Il(),{renderNumberColumn:e}=Dl(),{renderDateColumn:o,renderDateTimeColumn:r}=Ol(),{renderImageColumn:i}=Pl();function s(f){return f}function l(f,d){return d.customFormat?new Function(`return ${d.customFormat}`)():f}function c(f,d,u){const p=ke.resolveField(d.raw,f.field),h=u.options||u;return u.type==="none"?p:u.type==="custom"?l(p,u):u.type==="enum"?t(p,h):u.type==="number"?e(p,h):u.type==="boolean"?n(p,h):u.type==="date"?o(p,h):u.type==="datetime"?r(p,u):u.type==="image"?i(p,h):p}return{renderFormatColumn:c}}function jl(n,t,e){var x;const o=a.ref(n.mergeCell);(x=a.ref(n.rowOption).value)!=null&&x.wrapContent;const{updateVisualInfomation:i}=e,{renderCommandColumn:s}=fi(),{renderFormatColumn:l}=Bl();function c(y,v,b,_,S,T=1){const g={colSpan:T,rowSpan:1,index:b,field:y,data:ke.resolveField(_,y),editingData:ke.resolveField(_,y),parent:S,mode:v,align:"left",valign:"start",showEllipsis:!0,getEditor:V=>V.data,setRef:V=>i(V,g,_),update:()=>{},accept:()=>{},cancel:()=>{},updateData:()=>{}};return g}function f(y,v,b){return y.getEditor=_=>t.getEditor(_,v,_.parent),y.setRef=_=>i(_,y,b),y.update=_=>{_!==void 0&&(y.editingData=_)},y.accept=()=>{ke.setFieldValue(y.editingData,b,v.field),y.data=ke.resolveField(b,v.field)},y.cancel=()=>{y.editingData=y.data},y.updateData=_=>{ke.setFieldValue(ke.resolveField(_,v.field),b,v.field),y.data=ke.resolveField(b,v.field),y.editingData=ke.resolveField(b,v.field)},y}function d(y,v){v.dataType==="commands"?y.formatter=(b,_)=>s(v,_):v.formatter&&(y.formatter=(b,_)=>typeof v.formatter=="function"?v.formatter(b,_):l(v,_,v.formatter))}function u(y,v,b){const _=v&&v.data[b];if(_&&_.data===y.data){const T=_&&_.spannedBy||_;T.rowSpan++,T.spanned=T.spanned||[],T.spanned.push(y),y.colSpan=0,y.rowSpan=0,y.spannedBy=T}}function p(y,v,b){o.value&&u(y,v,b.field)}function h(y,v){v.showEllipsis!==void 0&&(y.showEllipsis=v.showEllipsis),y.showTips=v.showTips,y.column=v,y.align=v.align||"left",y.valign=v.valign||"middle",y.mode=n.editable?nt.editable:nt.readonly}function m(y,v,b,_){h(y,v),f(y,v,_),d(y,v),p(y,b,v)}function M(y,v,b,_,S){const T=n.editable?nt.editable:nt.readonly,g=c(y.field,T,v,b,_);return m(g,y,S,b),g}return{createCellByColumn:M,createCellByField:c,updateCellByColumn:m}}function Rl(n,t,e,o,r,i,s){var b,_;const l=a.ref(n.rowOption),c=((b=l.value)==null?void 0:b.height)||28,f=((_=l.value)==null?void 0:_.wrapContent)||!1,{idField:d}=r,{collapseField:u}=o,{updateRowPosition:p}=i,{createCellByColumn:h}=s,m=(S,T,g,V)=>{ke.setFieldValue(ke.resolveField(S,V),T,V),g.data[V].data=ke.resolveField(T,V),g.data[V].editingData=ke.resolveField(T,V)};function M(S,T,g,V,F,N){var H,$,W;const{__fv_data_grid_group_field__:w,__fv_data_grid_group_value__:R,__fv_data_index__:L}=g,C=g.__fv_data_grid_group_layer__||(g.__fv_parents__?(H=g.__fv_parents__)==null?void 0:H.size:0)||0,k=typeof g.parent=="number"?Number(g.parent):-1,D=g.__fv_data_grid_group_collapse__||g[u.value],B=g.__fv_visible__===void 0?!0:g.__fv_visible__,O=g.__fv_checked__,P=g.__fv_indeterminate__,A=g.__fv_disabled__||g[(($=n.rowOption)==null?void 0:$.disabledField)||"disabled"],E=n.hierarchy&&t.isVisibleInTree(g),I={collapse:D,data:{},dataIndex:L,groupField:w,groupValue:R,layer:C,index:T,parentIndex:k,pre:V,top:N,type:S,raw:g,checked:O,disabled:A,indeterminate:P,setRef:G=>{I.ref=G},visible:B&&E||B&&!n.hierarchy,status:lt.initial,updateCell:(G,X)=>{m(G,g,I,X)},updateCells:(G,X)=>{X.forEach(K=>{m(G,g,I,K)})}};return V||(g.__fv_data_position__=0),f||(I.height=c,g.__fv_data_height__=I.height,p(I,g)),(W=l.value)!=null&&W.customRowStatus&&(l.value.customRowStatus(I),g.__fv_disabled__=I.disabled),I}function x(S,T,g,V,F,N){const w=M($t.data,F,T,g,V,N);return S.forEach((R,L)=>{w.data[R.field]=h(R,L,T,w,V)}),w}function y(S,T,g,V,F){return Object.assign(S,{index:T,dataIndex:g,top:V,pre:F})}function v(S,T,g,V,F,N){const w=S.__fv_data_index__,R=S[d.value],L=e.getEditingSnapshot(R);return L===null?x(N,S,T,g,V,F):y(L,V,w,F,T)}return{createEmptyRow:M,createNewRowFromDataItem:x,renderDataRow:v}}function Ll(n,t,e,o,r){var A;const{idField:i}=e,s=a.ref(n.editable),l=a.ref(n.editOption),c=a.ref(((A=n.rowOption)==null?void 0:A.wrapContent)||!1),{onClickRow:f,onClickRowExcludeDblclick:d}=o,u=new Map([["boolean","check-box"],["datetime","date-picker"],["enum","combo-list"],["number","number-spinner"],["string","input-group"],["text","text"],["commands","commands-editor"]]);let p,h,m,M,x;function y(E){return h&&h.raw[i.value]===E?h:null}const v=a.reactive({});function b(E,I,H={}){E.mode=nt.editing,p=E,h=I,m=ke.resolveField(I==null?void 0:I.raw,E.field),M=H;for(const $ in v)delete v[$]}function _(E){E.accept(),E.mode=nt.editable,p=null;const I={};h&&(Object.keys(h).forEach(H=>{I[H]=h==null?void 0:h[H]}),h=null),t.emit("endEditCell",{cell:E,row:I,newValue:ke.resolveField(I==null?void 0:I.raw,E.field),oldValue:m,column:M,editor:v})}function S(E){const I=Promise.resolve(!0);return E?I.then(()=>Ee.isUndefined(n.beforeEndEditCell)?!0:typeof n.beforeEndEditCell=="function"?n.beforeEndEditCell({cell:E,row:h,newValue:E.editingData,oldValue:m}):()=>!0).then(H=>(H&&(_(E),h&&(h=null)),H)):I}function T(E){if(x&&x!==E.target){x=null;return}if(document.body.classList.contains("lookup-modal-open"))return;const H=E.target;if(H!=null&&H.closest(".popover"))return;const $=H.closest(".fv-grid-cell");p&&p.ref&&p.ref===$||S(p).then(G=>{G&&document.body.removeEventListener("click",T,!0)})}function g(E,I,H){return Promise.resolve().then(()=>{var W;const $=(W=H.editor)==null?void 0:W.readonly;return!Ee.isUndefined(n.beforeEditCell)&&typeof n.beforeEditCell=="function"?n.beforeEditCell({row:E,cell:I,rawData:E.raw,column:H}):!$}).then($=>{$&&(b(I,E,H),document.body.removeEventListener("click",T,!0),document.body.addEventListener("click",T,!0))})}function V(E,I,H,$={}){E.stopPropagation(),d(E,H),s.value&&l.value.editMode==="cell"&&I.mode===nt.editable&&S(p).then(()=>{p||g(H,I,$)})}function F(E,I,H,$={}){E.stopPropagation(),f(E,H),s.value&&l.value.editMode==="cell"&&I.mode===nt.editable&&S(p).then(()=>{p||g(H,I,$)})}function N(E){E.stopPropagation(),x=E.target}function w(E){E.stopPropagation(),x&&(x=null)}function R(E){Object.values(E.data).filter(I=>I.mode===nt.editable&&I.field!=="__commands__").forEach(I=>{I.mode=nt.editing}),E.status=lt.editing,h=E}function L(E,I){Object.values(E.data).filter(H=>H.mode===nt.editing).forEach(H=>{I?H.accept():H.cancel(),H.mode=nt.editable}),E.status=lt.initial,h===E&&(h=null)}function C(E){s.value&&l.value.editMode==="row"&&h!==E&&(h&&L(h,!1),R(E))}function k(E){L(E,!0),E.status=lt.initial}function D(E){L(E,!1),E.status=lt.initial}function B(E,I,H){const $=I.dataType,W=I.editor||{type:u.get($)||"input-group"};return!c.value&&W.type==="text"&&(W.type="input-group"),W?(W.type==="input-group"&&(W.textAlign=I.align!=="center"&&I.align!=="right"?"left":I.align,W.updateOn="change"),W.type,W.context={rowData:H.raw,column:I,cell:E,editor:v},W.readonly=!1,a.createVNode(nn.FDynamicFormInput,{focusOnCreated:n.focusOnEditingCell,selectOnCreated:n.selectOnEditingCell,editor:W,modelValue:E.editingData,"onUpdate:modelValue":G=>E.editingData=G,id:I.id,onMousedown:G=>N(G),onMouseup:G=>w(G)},null)):E.data}function O(){S(p)}a.watch(()=>n.editable,()=>{s.value=n.editable}),a.watch(()=>{var E;return(E=n.editOption)==null?void 0:E.editMode},E=>{l.value.editMode=E});function P(){p=null,h=null,M=null,x=null,document.body.removeEventListener("click",T,!0)}return{clear:P,onClickOutOfCell:T,onClickCell:F,onClickCellByKeyboard:V,onEditingRow:C,acceptEditingRow:k,cancelEditingRow:D,getEditingSnapshot:y,getEditor:B,endEditCell:O,onMousedownCell:N,onMouseupCell:w}}function $l(n){const t=a.ref(n.idField);function e(o){if(o&&o.length){const r=o[0];Object.keys(r).includes(t.value)||(t.value="__fv_indetify__")}}return{idField:t,reviseIdentifyField:e}}function Wl(n,t,e,o){const{idField:r}=o,{currentSelectedDataId:i,multiSelectOnClickRow:s,multiSelectOnClickRowWithShift:l,selectItem:c,selectedValues:f,toggleSelectItem:d,updateSelectAllStatus:u,enableSelectRow:p,multiSelectMode:h,isSingleSelect:m}=e,M=a.ref(0),x=a.ref(-1);function y(C){i.value=C}function v(C){return p.value&&(l.value?f.value.includes(C.raw[r.value]):C.raw[r.value]===i.value)}function b(C,k){var O;const D=k??C.dataIndex,B={"fv-grid-row":C.type===$t.data,"fv-grid-group-row":C.type===$t.group,"fv-grid-summary-row":C.type===$t.summary,"fv-grid-row-hover":D===x.value,"fv-grid-row-selected":v(C),"fv-grid-row-odd":D%2>0,"fv-grid-row-even":D%2===0,"fv-grid-disabled":C.disabled};if((O=n.rowOption)!=null&&O.customRowStyle){const P=n.rowOption.customRowStyle(C.raw)||{};return Object.assign({},B,P)}return B}function _(C){var D;const k={"fv-grid-cell":!0};if((D=n.rowOption)!=null&&D.customCellStyle){const B=n.rowOption.customCellStyle(C)||{};return Object.assign({},k,B)}return k}function S(C){var D;const k={"fv-grid-hierarchy-cell":!0};if((D=n.rowOption)!=null&&D.customCellStyle){const B=n.rowOption.customCellStyle(C)||{};return Object.assign({},k,B)}return k}function T(C,k){var O,P;if(l.value&&!C.shiftKey||m.value){(O=n.selection)!=null&&O.keepSelectingOnClick?c(k):d(k,(P=n.selection)==null?void 0:P.keepSelectingOnClick),u();return}if(l.value&&C.shiftKey||s.value){d(k),u();return}y(k.raw[r.value])}function g(C,k){k.disabled||(T(C,k),t.emit("clickRow",k.index,k.raw))}function V(C){M.value+=1,setTimeout(()=>{M.value===1&&t.emit("clickRow",C.index,C.raw),M.value=0},250),M.value>1&&(t.emit("doubleClickRow",C.index,C.raw),M.value=0)}function F(C,k){k.disabled||(T(C,k),V(k))}function N(C){C.disabled||V(C)}function w(C,k){}function R(C,k){}function L(C,k){var O;const D=k??C.dataIndex,B={"fv-grid-sidebar-row":!0,"fv-grid-sidebar-row-hover":D===x.value,"fv-grid-sidebar-row-selected":v(C),"fv-grid-sidebar-row-odd":D%2>0,"fv-grid-sidebar-row-even":D%2===0,"d-flex":!0,"align-items-center":!0};if((O=n.rowOption)!=null&&O.customRowStyle){const P=n.rowOption.customRowStyle(C.raw)||{};return Object.assign({},B,P)}return B}return{activeRowById:y,clickRowItem:N,gridCellClass:_,gridHierarchyCellClass:S,gridRowClass:b,onClickRow:F,onClickRowExcludeDblclick:g,onMouseoverRow:w,sidebarRowClass:L,onMouseoutRow:R}}function ql(n,t,e,o,r){const{idField:i}=e,{dataView:s,getSelectionItems:l}=t,c=a.ref(""),f=a.computed(()=>n.selection.enableSelectRow),d=a.ref(n.selection.multiSelect??!1),u=a.ref(n.selection.multiSelectMode||"DependOnCheck"),p=a.ref(n.selection.showCheckbox),h=a.ref(n.selection.showSelectAll),m=a.ref(n.selectionValues||[]),M=a.ref(!!m.value.length&&o.value.length===m.value.length),x=a.ref(!!m.value.length&&o.value.length!==m.value.length);a.watch(()=>n.selection.showSelectAll,(Y,ue)=>{Y!==ue&&(h.value=Y)});function y(){const Y=s.value.every(z=>m.value.includes(z[i.value])),ue=s.value.every(z=>!m.value.includes(z[i.value]));Y&&(M.value=!0,x.value=!1),ue&&(M.value=!1,x.value=!1),!Y&&!ue&&(M.value=!1,x.value=!0)}function v(){return l(m.value)}function b(){const Y=o.value.reduce((z,oe)=>(z.set(oe.raw[i.value],oe),z),new Map);return m.value.map(z=>Y.get(z)).filter(z=>!!z)}function _(Y){var z;const ue=Y.raw.__fv_children_index__;if(ue&&ue.length){const oe=ue.map(ve=>s.value[ve]);(z=m.value)!=null&&z.length&&oe.some(Se=>!m.value.includes(Se[i.value]))&&(Y.indeterminate=!0,Y.raw.__fv_indeterminate__=!0)}}const S=a.computed(()=>f.value&&d.value),T=a.computed(()=>f.value&&!d.value&&!p.value),g=a.computed(()=>!!n.hierarchy),V=a.computed(()=>{const Y=p.value&&u.value==="DependOnCheck";return S.value&&Y}),F=a.computed(()=>S.value&&!p.value),N=a.computed(()=>S.value&&p.value&&u.value==="OnCheckAndClick");a.computed(()=>N.value);function w(){const Y=l(m.value);r.emit("selectionChange",Y)}function R(Y){r.emit("unSelectItem",Y)}function L(){const Y=o.value.filter(z=>z.indeterminate).map(z=>z.raw[i.value]);o.value.forEach(z=>{z.checked=!1,z.indeterminate=!1,z.raw.__fv_checked__=!1,z.raw.__fv_indeterminate__=!1}),b().forEach(z=>{z.checked=!0,z.raw.__fv_checked__=!0}),Y.forEach(z=>{const oe=o.value.find(ve=>ve.raw[i.value]===z);_(oe)})}a.watch(()=>o.value,()=>{L()}),a.watch(()=>n.selectionValues,Y=>{m.value=Y,L()},{immediate:!0}),a.watch(()=>n.selection,Y=>{d.value=!!Y.multiSelect,u.value=Y.multiSelectMode||"DependOnCheck",p.value=!!Y.showCheckbox});const C=a.computed(()=>!d.value);function k(Y){return Y.raw[i.value]}function D(Y){return m.value.findIndex(z=>z===k(Y))}function B(){b().forEach(z=>{z.checked=!1}),l(m.value).forEach(z=>{z.__fv_checked__=!1}),m.value=[],c.value="",y()}function O(Y){const ue=Y;ue.__fv_checked__=!0,ue.__fv_indeterminate__=!1;const z=new Set(m.value);z.add(ue[i.value]),m.value=Array.from(z.values())}function P(Y){const ue=Y;ue.__fv_checked__=!1,ue.__fv_indeterminate__=!1,m.value=m.value.filter(z=>z!==ue[i.value])}function A(Y){const ue=Y.raw;ue.__fv_checked__=!0,ue.__fv_indeterminate__=!1;const z=new Set(m.value);z.add(ue[i.value]),m.value=Array.from(z.values()),Y.checked=!0,Y.indeterminate=!1}function E(Y){const ue=Y.raw;ue.__fv_checked__=!1,ue.__fv_indeterminate__=!1,m.value=m.value.filter(z=>z!==ue[i.value]),Y.checked=!1,Y.indeterminate=!1}function I(Y){A(Y),c.value=Y.raw[i.value]}function H(Y){E(Y),c.value=""}function $(Y){Y.__fv_checked__=!1,Y.__fv_indeterminate__=!0,m.value=m.value.filter(ue=>ue!==Y[i.value])}function W(Y){const ue=Y.raw;ue.__fv_checked__=!1,ue.__fv_indeterminate__=!0,m.value=m.value.filter(z=>z!==ue[i.value]),Y.checked=!1,Y.indeterminate=!0}function G(Y){C.value&&B(),Y.checked?E(Y):A(Y),w()}function X(Y,ue=!0){const z=Y.checked;C.value&&B(),ue?Y.checked?H(Y):I(Y):z?H(Y):I(Y),w(),Y.checked||R(Y)}function K(Y){Y.raw[i.value]!==c.value&&(B(),I(Y),w())}function Q(Y){const ue=o.value.find(z=>z.raw[i.value]===Y);ue&&K(ue)}function pe(Y){const ue=o.value.filter(ve=>Y.includes(ve.raw[i.value])),z=ue.map(ve=>ve.raw[i.value]),oe=s.value.filter(ve=>{const Se=ve[i.value];return!z.includes(Se)&&Y.includes(Se)});(ue.length||oe.length)&&(B(),T.value&&(c.value=Y[0])),ue.forEach(ve=>{I(ve)}),oe.forEach(ve=>{O(ve)}),w()}function he(Y){for(const ue of Y){if(!m.value.includes(ue))continue;const z=o.value.find(oe=>oe.raw[i.value]===ue);if(z)H(z);else{const oe=s.value.find(ve=>ve[i.value]===ue);oe&&P(oe)}}m.value=m.value.filter(ue=>!Y.includes(ue))}function xe(){o.value.forEach(Y=>{A(Y)}),w()}function De(){o.value.forEach(Y=>{E(Y)}),w()}function Re(){return o.value.find(Y=>Y.raw[i.value]===c.value)}return{clearSelection:B,currentSelectedDataId:c,enableMultiSelect:d,enableSelectRow:f,findIndexInSelectedItems:D,getSelectedItems:v,getSelectionRow:Re,indeterminate:W,indeterminateDataItem:$,isSelectingHirarchyItem:g,multiSelectMode:u,multiSelectOnClickRow:N,multiSelectOnClickRowWithShift:F,multiSelectOnlyOnCheck:V,select:I,selectAll:xe,selectedValues:m,selectDataItem:O,selectItem:K,selectItemById:Q,selectItemByIds:pe,showCheckBox:p,showSelectAll:h,toggleSelectItem:X,toggleSelectItemWithoutRow:G,unSelect:H,unSelectAll:De,unSelectDataItem:P,unSelectItemByIds:he,updateSelectAllStatus:y,selectAllStatus:M,indeterminateStatus:x,isSingleSelect:T}}function Al(n,t){var x,y;const e=String(Date.now()),o=50,{showCheckBox:r,showSelectAll:i}=t,s=a.ref(((x=n.rowNumber)==null?void 0:x.enable)??!1),l=a.computed(()=>n.hierarchy&&r.value&&n.selection.enableSelectRow&&n.selection.multiSelect?!1:r.value),c=a.ref(s.value?((y=n.rowNumber)==null?void 0:y.width)??32:0),f=a.ref(l.value?o:0),d=a.computed(()=>{var v;return s.value?((v=n.rowNumber)==null?void 0:v.heading)??"序号":""}),u=a.computed(()=>(l.value&&!n.hierarchy?Number(f.value):0)+(s.value?Number(c.value):0));a.watch(()=>n.rowNumber,v=>{v&&v.enable!==void 0&&(s.value=v.enable),v&&v.width!==void 0&&(c.value=v.width)});function p(v){return{top:`${v.top}px`,width:`${u.value}px`,height:`${v.height||""}px`}}const h=a.computed(()=>({width:`${u.value}px`}));function m(v){return`${e}_${v.type}_r_${v.index}_${v.refreshKey||""}`}function M(v){return`${e}_${v.type}_r_${v.index}_${v.refreshKey||""}`}return{showRowNumer:s,showSidebarCheckBox:l,sidebarCellPosition:p,sidebarCornerCellStyle:h,sidebarTitle:d,sidebarWidth:u,rowKey:M,cellKey:m}}const Hl={ascend:(n,t)=>n===t?0:n===!1?-1:1,decend:(n,t)=>n===t?0:n===!0?-1:1},Gl={ascend:(n,t)=>{const e=new Date(new Date(n).toLocaleDateString()).valueOf(),o=new Date(new Date(t).toLocaleDateString()).valueOf();return e===o?0:e<o?-1:1},decend:(n,t)=>{const e=new Date(new Date(n).toLocaleDateString()).valueOf(),o=new Date(new Date(t).toLocaleDateString()).valueOf();return e===o?0:e<o?1:-1}},zl={ascend:(n,t)=>n===t?0:n<t?-1:1,decend:(n,t)=>n===t?0:n<t?1:-1},Yl={ascend:(n,t)=>n===t?0:n<t?-1:1,decend:(n,t)=>n===t?0:n<t?1:-1};function Ul(n){const t=new Map([["boolean","boolean-sorter"],["date","datetime-sorter"],["datetime","datetime-sorter"],["number","numeric-sorter"],["string","text-sorter"],["text","text-sorter"],["enum","text-sorter"],["reference","text-sorter"]]),e=new Map([["boolean-sorter",Hl],["datetime-sorter",Gl],["numeric-sorter",zl],["text-sorter",Yl]]);function o(s){const l=(s==null?void 0:s.dataType)||"string",c=t.get(l)||"text-sorter";return e.get(c)||(s==null?void 0:s.sorter)}function r(s){return o(s.column)}function i(s,l){const c=r(s),f=(s.status&Ke.sortable)===Ke.sortable&&(s.status&Ke.sorted)===Ke.sorted,d=(s.status&Ke.ascending)===Ke.ascending,u=(s.status&Ke.descending)===Ke.descending;if(f&&c){const p=d?c.ascend:u?c.decend:void 0;p?l.addSorter(s.field,{field:s.field,compare:p}):l.removeSorter(s.field)}else l.removeSorter(s.field)}return{getSorterByColumn:o,updateSorter:i}}function Xl(n){const t="parent",e="layer",o="hasChildren",r=(i,s=1,l=[],c=null)=>(i=i||[],i.reduce((f,d)=>(d.id=d.id||d.data[n.idField],d[t]=c,d[e]=s,d[o]=!1,d.data&&Object.keys(d.data).forEach(u=>{Object.keys(d).includes(u)||(d[u]=d.data[u])}),l.push(d),d.children&&d.children.length&&(d[o]=!0,r(d.children,s+1,l,d.id)),f),l),l);return{flatTreeData:r}}function Ql(n,t,e,o,r,i,s,l,c,f,d,u,p,h,m,M,x){const{calculateCellPositionInRow:y}=i,{columnContext:v,hasLeftFixedColumn:b,hasRightFixedColumn:_}=s,{gridDataStyle:S,leftFixedGridDataStyle:T,rightFixedGridDataStyle:g}=h,{renderDataRow:V}=ui(n,t,v,x,l,c,f,d,u,p,h),F=[V];function N(k,D){const B=y(k);return x.value.filter(O=>O.visible!==!1).map((O,P)=>F[O.type](O,B,D,P))}function w(){return a.createVNode("div",{ref:o,class:"fv-grid-content-left-fixed"},[a.createVNode("div",{class:"fv-grid-data",style:T.value},[N(v.value.leftColumns.filter(k=>k.visible),"left")])])}function R(){return a.createVNode("div",{ref:e,class:"fv-grid-content-primary"},[a.createVNode("div",{class:"fv-grid-data",style:S.value},[N(v.value.primaryColumns.filter(k=>k.visible),"primary")])])}function L(){return a.createVNode("div",{ref:r,class:"fv-grid-content-right-fixed"},[a.createVNode("div",{class:"fv-grid-data",style:g.value},[N(v.value.rightColumns.filter(k=>k.visible),"right")])])}function C(){const k=[];return b.value&&k.push(w()),k.push(R()),_.value&&k.push(L()),k}return{renderDataArea:C}}const Jt=a.defineComponent({name:"FTreeGrid",props:pn,emits:["selectionChange","clickRow","expandNode","unSelectItem","dblclickNode"],setup(n,t){var Xe,st;const o=((Xe=n.rowOption)==null?void 0:Xe.height)||28,r=a.ref(20),i=a.ref(n.columns),s=Fe.useIdentify(n),{idField:l}=s,c=a.ref(),f=a.ref(),d=a.ref(),u=a.ref(),p=a.ref(),h=a.ref([]),m=a.ref(!1),M=a.ref(((st=n.rowOption)==null?void 0:st.wrapContent)||!1),x=Fe.useGroupData(n,s),y=Fe.useFilter(),v=Fe.useHierarchy(n),{collapseField:b}=v,{showLoading:_,renderLoading:S}=Fe.useLoading(n,c),T=Fe.useDataView(n,new Map,y,v,s),{dataView:g}=T,V=Fe.useSelection(n,T,s,h,t),F=Fe.useSelectHierarchyItem(n,h,T,s,V,t),N=a.computed(()=>n.disabled),w=a.computed(()=>n.virtualized?Math.min(T.dataView.value.length,r.value):T.dataView.value.length),{containerStyleObject:R}=Fe.useDataViewContainerStyle(n),L=Fe.useCommandColumn(n),{applyCommands:C}=L;C(i);const k=Fe.useColumn(n),D=Fe.useSort(n),{applyColumnSorter:B,columnContext:O,updateColumnRenderContext:P}=k;B(T,D);const A=Fe.useGroupColumn(n,O),E=Fe.useRow(n,t,V,s),I=Fe.useEdit(n,t,s,E,h),H=Fe.useVisualDataBound(n),$=Fe.useVisualDataCell(n,I,H),W=Fe.useVisualDataRow(n,T,I,v,s,H,$),G=Fe.useVisualData(n,i,T,w,0,W),{getVisualData:X}=G,K=Fe.useCellPosition(n,O),Q=Fe.useSidebar(n,V),{sidebarWidth:pe}=Q,he=Fe.useVirtualScroll(n,T,h,O,G,w,0,pe),{onWheel:xe,dataGridWidth:De,viewPortHeight:Re,viewPortWidth:Y,resetScroll:ue,updateVisibleRowsOnLatestVisibleScope:z}=he,oe=Fe.useFitColumn(n,O,f,Y,A),{calculateColumnsSize:ve}=oe,Se=Fe.useFilterHistory(),Oe=Fe.useColumnFilter(f,p,T,Se,he),ot=Fe.useDragColumn(n,t,k,T,A,x,he),mt=a.computed(()=>({"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-grid-horizontal-bordered":n.showHorizontalLines,"fv-datagrid-strip":n.showStripe})),dt=a.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":m.value,"fv-grid-wrap-content":M.value})),{renderDataArea:J}=Ql(n,t,d,u,p,K,k,T,I,v,E,V,F,he,G,H,h),{renderGridHeader:_e,renderGridColumnResizeOverlay:Ie,shouldShowHeader:Ge}=Fe.getColumnHeader(n,t,f,u,p,k,T,ot,Oe,y,Se,oe,A,V,Q,D,he,Y,h),{renderDataGridSidebar:je}=Fe.getSidebar(n,E,V,Q,he),{renderDisableMask:it}=Fe.getDisableMask(),{renderHorizontalScrollbar:ht}=Fe.getHorizontalScrollbar(n,f,he),{renderVerticalScrollbar:Ct}=Fe.getVerticalScrollbar(n,f,he);function ft(){var me,Ce,et;if(f.value&&f.value.clientHeight>0&&((me=f.value)==null?void 0:me.clientWidth)>0){const Ze=Math.ceil(f.value.clientHeight/o);Ze>r.value&&(r.value=Ze,z()),Re.value=((Ce=d.value)==null?void 0:Ce.clientHeight)||0,De.value=((et=f.value)==null?void 0:et.clientWidth)||0,ve()}}a.onMounted(()=>{f.value&&(r.value=Math.max(Math.ceil(f.value.clientHeight/o),r.value),h.value=X(0,w.value+0-1),Fn.useResizeObserver(f.value,ft),ve(),a.nextTick(()=>{f.value&&(De.value=f.value.clientWidth),d.value&&(Y.value=d.value.clientWidth,Re.value=d.value.clientHeight)})),_.value&&S()}),a.onUnmounted(()=>{}),a.watch(Y,()=>{f.value&&ve()});function Vt(me){T.collapseTo(me),T.reOrderVisibleIndex(),ue()}function xt(me){T.expandTo(me),T.reOrderVisibleIndex(),ue()}function gt(){const me=V.getSelectionRow();return me?me.dataIndex-1:-1}function Mt(){const me=gt();T.insertNewDataItem(me),h.value=X(0,w.value+0-1)}function _t(){const me=gt();T.insertNewChildDataItem(me),h.value=X(0,w.value+0-1)}function re(){const me=gt(),Ce=F.getNextSelectableHierarchyItemId(me);T.removeHierarchyDataItem(me),h.value=X(0,w.value+0-1),Ce&&V.selectItemById(Ce)}function de(me){I.onEditingRow(me)}function ge(me){I.acceptEditingRow(me)}function Pe(me){I.cancelEditingRow(me)}function ze(me){me&&(i.value=me,C(i),P(i.value),B(T,D),ve())}function Je(me){me&&(T.load(me),T.reOrderVisibleIndex(),ue())}function U(me){V.selectItemById(me)}function fe(me){const Ce=h.value.find(et=>et.raw[s.idField.value]===me);Ce&&E.clickRowItem(Ce)}function we(me){E.activeRowById(me)}function Ne(me){V.selectItemByIds(me)}function q(){return V.getSelectedItems()}function ee(){V.clearSelection()}const ne=a.computed(()=>!h.value||!h.value.length),{renderEmpty:te}=Fe.getEmpty(t);function be(){return V.getSelectionRow()}function ye(me){V.unSelectItemByIds(me)}function Be(){return V.currentSelectedDataId.value}function Te(me,Ce,et){const Ze=g.value.find(tt=>tt[l.value]===me);if(Ze){if(Object.keys(Ze).forEach(Qe=>{Object.prototype.hasOwnProperty.call(Ce,Qe)&&(Ze[Qe]=Ce[Qe])}),et){const{collapseField:Qe,disabledField:Nt,checkedField:It,visibleField:Et}=et;Qe&&!Ee.isUndefined(Ce[Qe])&&(Ze.__fv_collapse__=Ce[Qe]),It&&!Ee.isUndefined(Ce[It])&&(Ze.__fv_checked__=Ce[It]),Nt&&!Ee.isUndefined(Ce[Nt])&&(Ze.__fv_disabled__=Ce[Nt]),Et&&!Ee.isUndefined(Ce[Et])&&(Ze.__fv_visible__=Ce[Et])}const tt=h.value.find(Qe=>Qe.raw[l.value]===me),$o=h.value.findIndex(Qe=>Qe.raw[l.value]===me);if(tt){if(tt.raw=Ze,Object.keys(tt.data).forEach(Qe=>{tt.data[Qe].updateData(Ze)}),et){const{collapseField:Qe,disabledField:Nt,checkedField:It,visibleField:Et}=et;Qe&&!Ee.isUndefined(Ce[Qe])&&(tt.collapse=Ce[Qe]),It&&!Ee.isUndefined(Ce[It])&&(tt.checked=Ce[It]),Nt&&!Ee.isUndefined(Ce[Nt])&&(tt.disabled=Ce[Nt]),Et&&!Ee.isUndefined(Ce[Et])&&(tt.visible=Ce[Et])}h.value=[...h.value.slice(0,$o),tt,...h.value.slice($o+1)]}}}function $e(me){const Ce=T.dataView.value.find(et=>et[l.value]===me);return Ce?Ce[b.value]:""}function rt(){return b.value}return t.expose({activeRowById:we,addNewDataItem:Mt,addNewChildDataItem:_t,collapseTo:Vt,expandTo:xt,removeDataItem:re,editDataItem:de,acceptDataItem:ge,cancelDataItem:Pe,updateColumns:ze,updateDataSource:Je,selectItemById:U,selectItemByIds:Ne,getSelectedItems:q,clearSelection:ee,getSelectionRow:be,clickRowItemById:fe,unSelectItemByIds:ye,getCurrentRowId:Be,reassignRowData:Te,getCollapseField:rt,getCollapseStatusById:$e}),()=>a.createVNode("div",{ref:c,class:mt.value,style:R.value,onWheel:xe},[f.value&&Ge.value&&_e(),a.createVNode("div",{ref:f,class:dt.value,onMouseover:()=>m.value=!0,onMouseleave:()=>m.value=!1},[f.value&&je(h),f.value&&J(),f.value&&ne.value&&te(),f.value&&ht(),f.value&&Ct()]),Ie(),N.value&&it()])}}),Zl={id:{type:String,default:""},componentId:{type:String,default:""},type:{type:String,default:""},canDelete:{type:Boolean,default:!0},canMove:{type:Boolean,default:!0},canSelectParent:{type:Boolean,default:!0},customButtons:{type:Array,default:[]},customClass:{type:String,default:""},customStyle:{type:String,default:""},modelValue:{type:Object},ignore:{type:Boolean,default:!1},completeFormSchema:{type:Object}},Kl={id:{type:String}},Jl=a.defineComponent({name:"FDesignerPlaceholder",props:Kl,emits:[],setup(n){const t=a.computed(()=>({"drag-and-drop-alert":!0,"no-drag":!0,"w-100":!0})),e=a.computed(()=>({height:"60px",display:"flex","justify-content":"center","align-items":"center",margin:0,padding:".75rem 1.25rem",border:"1px solid transparent","border-radius":"3px",color:"#315585","background-color":"#dfedff","border-color":"#d2e6ff"}));return()=>a.createVNode("div",{class:t.value,style:e.value,role:"alert","data-noattach":"true","data-position":"0"},[a.createTextVNode("拖拽组件到这里")])}});function ec(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!a.isVNode(n)}const Cn=a.defineComponent({name:"FDesignerItem",props:Zl,emits:["selectionChange","dragEnd"],setup(n,t){const e=a.ref(`${n.modelValue.id}-component`),o=a.ref(n.canMove),r=a.ref(n.canDelete),i=a.ref(!1),s=a.ref(n.modelValue),l=a.ref(n.componentId||""),c=a.ref(""),f=a.ref(""),d=a.ref(n.customClass),u=a.ref(),p=a.inject("canvas-dragula"),h=a.ref(),m=a.inject("design-item-context"),M={designerItemElementRef:u,componentInstance:h,schema:s.value,parent:m,setupContext:t};a.provide("design-item-context",M);const x=a.inject("useFormSchema"),y=a.inject("designer-host-service"),v=a.computed(()=>{var A;const B=n.modelValue.appearance&&n.modelValue.appearance.class||"",O=((A=h.value)==null?void 0:A.getCustomButtons)&&h.value.getCustomButtons();let P={"farris-component":!0,"flex-fill":s.value.id==="root-component","position-relative":o.value&&r.value||(O==null?void 0:O.length),"farris-nested":i.value,"can-move":o.value,"d-none":u.value&&u.value.classList.contains("d-none"),dgComponentSelected:u.value&&u.value.classList.contains("dgComponentSelected"),dgComponentFocused:u.value&&u.value.classList.contains("dgComponentFocused")};return P[`farris-component-${s.value.type}`]=!0,P=ke.getCustomClass(P,B),P=ke.getCustomClass(P,f.value),P=ke.getCustomClass(P,d.value),P}),b=a.computed(()=>{const B={},O=n.modelValue.appearance&&n.modelValue.appearance.style||"";return O&&O.split(";").reduce((P,A)=>{const[E,I]=A.split(":");return P[E]=I,P},B),c.value&&c.value.split(";").reduce((P,A)=>{const[E,I]=A.split(":");return E&&(P[E]=I),P},B),B});function _(B,O){var E,I;if(B&&(B.preventDefault(),B.stopPropagation()),h.value.triggerBelongedComponentToDeleteWhenDeleted){const H=h.value.getBelongedComponentInstance(h);if(H&&H.parent){const $=a.ref(H==null?void 0:H.parent),W=$.value.contents.findIndex(G=>G.id===H.schema.id);(I=(E=$.value)==null?void 0:E.contents)==null||I.splice(W,1),zt.value++}return}h.value.onRemoveComponent(y);let P=m,A=H=>H.id===O.id;if(O.type==="component"&&(P=m==null?void 0:m.parent,A=H=>H.component===O.id),P&&P.schema.contents){const H=P.schema.contents.findIndex(A);P.schema.contents.splice(H,1),zt.value++,t.emit("selectionChange")}}function S(B){return r.value&&a.createVNode("div",{role:"button",class:"btn component-settings-button",title:"删除",ref:"removeComponent",onClick:O=>{_(O,B)}},[a.createVNode("i",{class:"f-icon f-icon-yxs_delete"},null)])}function T(){return o.value&&a.createVNode("div",{role:"button",class:"btn component-settings-button",title:"移动",ref:"moveComponent"},[a.createVNode("i",{"data-dragging-icon":"true",class:"cmp_move f-icon f-icon-yxs_move"},null)])}function g(){var O;const B=((O=h.value)==null?void 0:O.getCustomButtons)&&h.value.getCustomButtons();return B&&!!B.length&&B.map(P=>a.createVNode("div",{role:"button",class:`btn component-settings-button ${P.class||""}`,title:P.title,ref:P.id,onClick:A=>P.onClick&&P.onClick(A)},[a.createVNode("i",{class:P.icon},null)]))}function V(B){return a.createVNode("div",{class:"component-btn-group","data-noattach":"true"},[a.createVNode("div",null,[S(B),T(),g()])])}function F(B,O,P,A){t.emit("selectionChange",B,O,P,A)}function N(){t.emit("dragEnd")}function w(B){let O;const P=B.type,A=$n[P],E=Wn[P],I=E?E(B):{};I.customClass=n.ignore?I.customClass:"",I.componentId=l.value,I.id=B.id;const H=B.contents&&B.contents.length===0;return B.contents&&!!B.contents.length&&A?a.createVNode(A,a.mergeProps({ref:h},I),ec(O=B.contents.map(W=>a.createVNode(Cn,{key:W.id,modelValue:W,"onUpdate:modelValue":G=>W=G,componentId:l.value,onSelectionChange:F,onDragEnd:N,"complete-form-schema":n.completeFormSchema},null)))?O:{default:()=>[O]}):A?H?a.createVNode(A,a.mergeProps({ref:h},I),{default:()=>[a.createVNode(Jl,null,null)]}):a.createVNode(A,a.mergeProps({ref:h},I),null):a.createVNode("div",null,null)}function R(B){if(B.type==="component-ref"){const A=(n.completeFormSchema?n.completeFormSchema:x==null?void 0:x.getFormSchema()).module.components.find(I=>I.id===B.component),E=a.ref(A);if(A)return a.createVNode(Cn,{key:A.id,modelValue:E.value,"onUpdate:modelValue":I=>E.value=I,componentId:A.id,"complete-form-schema":n.completeFormSchema,onSelectionChange:F,onDragEnd:N},null)}}a.watch(()=>n.modelValue,B=>{s.value=B,e.value=`${B.id}-component`,a.triggerRef(u)},{deep:!0});function L(B){window.scrollContainerList||(window.scrollContainerList=new Set);const O=B.getAttribute("id");O&&window.scrollContainerList.add(O)}function C(B){const O=B==null?void 0:B.target;L(O),Ta(O)}function k(){var B,O;if(u.value){(O=(B=s.value)==null?void 0:B.contents)!=null&&O.length&&u.value.addEventListener("scroll",C);const P=u.value.querySelector(".drag-container");P&&P.addEventListener("scroll",C)}}a.onMounted(()=>{if(u.value&&h.value&&h.value.schema){const B=u.value.querySelector(`[data-dragref='${h.value.schema.id}-container']`);p&&B&&p.attachComponents(B,s.value),i.value=h.value.canNested!==void 0?h.value.canNested:i.value,r.value=h.value.canDelete!==void 0?h.value.canDelete:r.value,o.value=h.value.canMove!==void 0?h.value.canMove:o.value,c.value=h.value.styles||"",f.value=h.value.designerClass||"",u.value&&(u.value.componentInstance=h,u.value.designItemContext=M),h.value.belongedComponentId=l.value}k(),zt.value++}),a.onBeforeUnmount(()=>{u.value&&u.value.removeEventListener("scroll",C)});function D(B){B&&(B.preventDefault(),B.stopPropagation());let O=M.designerItemElementRef;const P=u.value;if(P){const A=document.getElementsByClassName("dgComponentFocused");A&&A.length===1&&A[0]===u.value||(Array.from(A).forEach(I=>I.classList.remove("dgComponentFocused")),Array.from(document.getElementsByClassName("dgComponentSelected")).forEach(I=>I.classList.remove("dgComponentSelected")),P.classList.add("dgComponentFocused"),t.emit("selectionChange",s.value.type,s.value,l.value,h.value),h.value.getDraggableDesignItemElement&&(O=h.value.getDraggableDesignItemElement(M),O&&O.value&&O.value.classList.add("dgComponentSelected")))}Dn(O==null?void 0:O.value)}return()=>s.value.type==="component-ref"?R(s.value):a.createVNode("div",{id:`${s.value.id}-design-item`,ref:u,class:v.value,style:b.value,onClick:D},[V(s.value),w(s.value)])}});function tc(n,t,e,o,r="data-grid-column"){const{columnContext:i,hasLeftFixedColumn:s,hasRightFixedColumn:l}=e,{gridHeaderColumnsStyle:c,leftFixedGridHeaderColumnsStyle:f,rightFixedGridHeaderColumnsStyle:d}=o,u=i.value.defaultColumnWidth,p=32,h=new Map([[0,0]]);function m(N,w){const R=h.get(w)||0,L={height:`${N.depth*p}px`,left:`${N.left}px`,top:`${(N.layer-1)*p}px`,width:`${N.actualWidth}px`,padding:0};return i.value.headerDepth>1&&(L["line-height"]=`${N.depth*p}px`),h.set(w+1,R+(N.actualWidth||u)),L}const M=a.computed(()=>({"fv-grid-header":!0,"fv-grid-header-group-columns":i.value.headerDepth>1})),x=a.computed(()=>({height:`${i.value.headerDepth*p}px`})),y=function(N){return t.showSetting&&!!N.showSetting};function v(){return a.createVNode("span",{class:"fv-grid-settings-icon d-flex align-items-center"},[a.createVNode("i",{class:"f-icon f-icon-home-setup"},null)])}function b(N,w,R,L){var C;(C=n==null?void 0:n.setupContext)==null||C.emit("selectionChange",N,w,R,L)}function _(N){var R,L;return"w-100 d-flex align-items-center justify-content-"+(((R=N.column)==null?void 0:R.halign)==="center"?"center":((L=N.column)==null?void 0:L.halign)==="right"?"end pr-2":"start pl-2")}function S(N,w,R){var C;const L=a.ref(N.column);return a.createVNode("div",{class:"fv-grid-header-cell",style:m(N,R)},[a.createVNode(Cn,{modelValue:L.value,"onUpdate:modelValue":k=>L.value=k,customClass:_(N),canAdd:!1,canDelete:!1,canMove:!1,key:(C=L.value)==null?void 0:C.id,type:r,componentId:t.componentId,onSelectionChange:b},null),y(N)&&v(),N.resizable&&a.createVNode("span",{class:"fv-column-resize-bar"},null)])}function T(N){return N.map((w,R)=>{const L=[];if(L.push(S(w,N,R)),w.children&&w.children.length){const C=T(w.children);L.push(...C)}return L})}function g(){return a.createVNode("div",{class:"fv-grid-header-left-fixed"},[a.createVNode("div",{class:"fv-grid-header-columns",style:f.value},[T(i.value.leftHeaderColumns)])])}function V(){return a.createVNode("div",{class:"fv-grid-header-right-fixed"},[a.createVNode("div",{class:"fv-grid-header-columns",style:d.value},[T(i.value.rightHeaderColumns)])])}function F(){return a.createVNode("div",{class:M.value,style:x.value},[s.value&&g(),a.createVNode("div",{class:"fv-grid-header-primary"},[a.createVNode("div",{class:"fv-grid-header-columns",style:c.value},[T(i.value.primaryHeaderColumns)])]),l.value&&V()])}return{renderGridHeader:F}}class nc extends Pn{constructor(t,e){super(t,e)}getPropertyConfig(t){return this.getBasicPropConfig(t),this.getAppearanceProperties(t),this.getEventPropConfig(t),this.propertyConfig}getBasicPropConfig(t){var s,l,c;const e=(c=(l=(s=this.formSchemaUtils.getFormSchema())==null?void 0:s.module)==null?void 0:l.entity[0])==null?void 0:c.entities[0],o=this.assembleSchemaEntityToTree(e,0),r=this,i=super.getBasicPropConfig(t);this.propertyConfig.categories.basic={description:"Basic Information",title:"基本信息",properties:{...i.properties,dataSource:{description:"绑定数据源",title:"绑定数据源",editor:{type:"combo-tree",textField:"name",valueField:"label",data:o,editable:!1},readonly:!0}},setPropertyRelates(f,d){switch(f&&f.propertyID){case"dataSource":{const u=r.formSchemaUtils.getViewModelById(r.viewModelId);if(u){const p=o.find(h=>h.label===f.propertyValue);u.bindTo=p.bindTo}r.designViewModelUtils.assembleDesignViewModel();break}}}}}getAppearanceProperties(t){var e,o;this.propertyConfig.categories.appearance={title:"外观",properties:{columns:{title:"列设置",description:"列设置",$converter:"/converter/items-count.converter",editor:{type:"grid-field-editor",viewModelId:this.viewModelId,gridData:t,gridType:"tree-grid-column"},refreshPanelAfterChanged:!0},fit:{title:"适配父组件尺寸",type:"boolean",description:"是否适配父组件尺寸",visible:!1},showStripe:{title:"显示条纹",type:"boolean",description:"是否显示条纹"},showBorder:{title:"显示边框",type:"boolean",description:"是否显示边框"}},setPropertyRelates(r,i){switch(r&&r.propertyID){case"useBlankWhenDataIsEmpty":t.emptyDataHeight=t.useBlankWhenDataIsEmpty?36:240;break;case"fields":t.fields=r.propertyValue||[];break}}},this.propertyConfig.categories.pagination={title:"分页",$converter:"/converter/pagination.converter",properties:{enable:{title:"启用分页",type:"boolean",refreshPanelAfterChanged:!0,editor:{readonly:!0}},showIndex:{visible:((e=t.pagination)==null?void 0:e.enable)||!1,title:"显示页码",type:"boolean"},showLimits:{visible:((o=t.pagination)==null?void 0:o.enable)||!1,title:"显示每页记录数",type:"boolean"}}}}getEventPropConfig(t){const e=[{label:"onSelectionChange",name:"行切换事件"},{label:"onClickRow",name:"行点击事件"}],o=this,r=o.eventsEditorUtils.formProperties(t,o.viewModelId,e),i={};i[o.viewModelId]={type:"events-editor",editor:{initialData:r}},this.propertyConfig.categories.eventsEditor={title:"事件",hideTitle:!0,properties:i,refreshPanelAfterChanged:!0,tabId:"commands",tabName:"交互",setPropertyRelates(s,l){const c=s.propertyValue;delete t[o.viewModelId],c&&(c.setPropertyRelates=this.setPropertyRelates,o.eventsEditorUtils.saveRelatedParameters(t,o.viewModelId,c.events,c)),t.remoteSort=!!t.columnSorted}}}assembleSchemaEntityToTree(t,e,o,r="",i=[]){const s=r?`${r}/${t.label}`:"/";return i.push({id:t.id,name:t.name,label:t.label,layer:e,parent:o&&o.id,bindTo:s.replace("//","/")}),t.type.entities&&t.type.entities.length&&t.type.entities.map(l=>this.assembleSchemaEntityToTree(l,e+1,t,s,i)),i}}function oc(n,t){const e=n.schema,o=a.ref(!0),r=a.ref(!0);function i(d){return d&&d.sourceType==="control"?d.componentCategory==="input":!1}function s(){return!1}function l(){return!1}function c(){return!0}function f(d){return new nc(d,t).getPropertyConfig(e)}return{canAccepts:i,checkCanDeleteComponent:s,checkCanMoveComponent:l,hideNestedPaddingInDesginerView:c,triggerBelongedComponentToMoveWhenMoved:o,triggerBelongedComponentToDeleteWhenDeleted:r,getPropsConfig:f}}function rc(n,t,e,o,r){const{getGridHeaderCells:i}=r,s=120,l=50,c=a.computed(()=>{var g;return((g=n.rowNumber)==null?void 0:g.enable)||!1}),f=a.computed(()=>{var g,V;return((g=n.selection)==null?void 0:g.multiSelect)||((V=n.selection)==null?void 0:V.showCheckbox)||!1}),d=a.computed(()=>{var g;return 0+(c.value?((g=n.rowNumber)==null?void 0:g.width)||32:0)+(f.value?l:0)}),u=a.computed(()=>{var g;return(g=n.columnOption)==null?void 0:g.fitColumns}),p=a.computed(()=>{var g;return u.value&&((g=n.columnOption)==null?void 0:g.fitMode)||"none"});function h(g,V,F){const N=parseInt(g.width,10)/100;return F*N}function m(g,V,F){return typeof g.width=="string"?h(g,V,F):g.width||s}function M(g,V){const F=[],N=[];let w=0;g.value.primaryColumns.forEach(C=>{typeof C.width=="string"?N.push(C):(C.width=C.width||s,w+=C.width,F.push(C))});const R=V*(F.length/g.value.primaryColumns.length);F.forEach(C=>{const k=R*(C.width/w);C.actualWidth=k,g.value.primaryColumnsWidth+=C.actualWidth});const L=V-R;N.forEach(C=>{const k=h(C,g.value,L);C.actualWidth=k,g.value.primaryColumnsWidth+=C.actualWidth})}function x(g,V){const F=[],N=[],w=new WeakMap;let R=0,L=0;if(g.value.primaryColumns.forEach(k=>{if(typeof k.width=="string"){const D=h(k,g.value,V);w.set(k,D),R+=D,N.push(k)}else k.width=k.width||s,L+=k.width,F.push(k)}),V-R>L){const k=V-R;N.forEach(D=>{D.actualWidth=w.get(D)||s,g.value.primaryColumnsWidth+=D.actualWidth}),F.forEach(D=>{D.actualWidth=k*(D.width/L),g.value.primaryColumnsWidth+=D.actualWidth})}else M(g,V)}function y(g,V){g.value.primaryColumns.forEach(F=>{F.actualWidth=m(F,g.value,V),g.value.primaryColumnsWidth+=F.actualWidth})}const v={expand:x,none:y,percentage:M};function b(g){g.value.leftHeaderColumns=Array.from(i(g.value.leftColumns).values()),g.value.primaryHeaderColumns=Array.from(i(g.value.primaryColumns).values()),g.value.rightHeaderColumns=Array.from(i(g.value.rightColumns).values())}function _(g){g.value.leftColumnsWidth=0,g.value.primaryColumnsWidth=0,g.value.rightColumnsWidth=0,g.value.leftColumns.forEach(V=>{g.value.leftColumnsWidth+=V.actualWidth||0}),g.value.primaryColumns.forEach(V=>{g.value.primaryColumnsWidth+=V.actualWidth||0}),g.value.rightColumns.forEach(V=>{g.value.rightColumnsWidth+=V.actualWidth||0}),g.value=Object.assign({},g.value)}function S(g,V,F){var D;let N=0;const w=g.value.primaryColumns,R=g.value.rightColumns;g.value.rightColumns.forEach(B=>{B.actualWidth=m(B,g.value,V),N+=B.actualWidth});const L=F-N,C=v[p.value];if(C&&C(g,L),g.value.primaryColumnsWidth+N<=F)return g.value.primaryColumns=[...w,...R],g.value.primaryColumnsWidth+=N,g.value.rightColumns=[],g.value.rightColumnsWidth=0,!0;const k=new Map;return k.set("primary",[]),k.set("right",[]),g.value.primaryColumns.reduce((B,O)=>{var P,A;return O.fixed==="right"?(P=B.get("right"))==null||P.push(O):(A=B.get("primary"))==null||A.push(O),B},k),(D=k.get("right"))!=null&&D.length&&(g.value.primaryColumns=[...k.get("primary")||[]],g.value.rightColumns=[...k.get("right")||[]]),g.value.primaryColumnsWidth=0,g.value.rightColumnsWidth=0,!1}function T(){if(e.value){t.value.leftColumnsWidth=0,t.value.primaryColumnsWidth=0,t.value.rightColumnsWidth=0;const g=e.value.clientWidth-d.value;t.value.leftColumns.forEach(F=>{F.actualWidth=m(F,t.value,g),t.value.leftColumnsWidth+=F.actualWidth});const V=g-t.value.leftColumnsWidth;if(S(t,g,V))o.value=V;else{t.value.rightColumns.forEach(w=>{w.actualWidth=m(w,t.value,g),t.value.rightColumnsWidth+=w.actualWidth});const F=g-t.value.leftColumnsWidth-t.value.rightColumnsWidth,N=v[p.value];N&&N(t,F),o.value=F}b(t),t.value=Object.assign({},t.value)}}return a.watch(()=>{var g;return(g=n.columnOption)==null?void 0:g.fitColumns},(g,V)=>{g!==V&&g&&T()}),a.watch(p,(g,V)=>{g!==V&&u.value&&T()}),{calculateColumnHeaders:b,calculateColumnsSize:T,calculateColumnsWidth:_}}const ac="";function ic(n){const e={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]},o=a.ref(e);function r(){o.value={defaultColumnWidth:120,headerDepth:1,leftColumns:[],leftColumnsMap:new Map,leftColumnsWidth:0,leftHeaderColumns:[],primaryColumns:[],primaryColumnsMap:new Map,primaryColumnsWidth:0,primaryHeaderColumns:[],rightColumns:[],rightColumnsMap:new Map,rightColumnsWidth:0,rightHeaderColumns:[],summaryColumns:[]}}const i=a.ref(n.summary),s=a.computed(()=>{const b=i.value;return(b==null?void 0:b.groupFields)||[]});function l(){o.value.rightColumns.forEach(S=>{S.showSetting=!1}),o.value.primaryColumns.forEach(S=>{S.showSetting=!1});const b=o.value.rightColumns,_=o.value.primaryColumns;b.length>0?b[b.length-1].showSetting=!0:_.length>0&&(_[_.length-1].showSetting=!0)}function c(b){r();const _=new Map;return s.value&&s.value.reduce((S,T)=>(S.set(T,!0),S),_),b.reduce((S,T)=>(T.filter=T.filter||ac,T.fixed==="left"?(o.value.leftColumns.push(T),o.value.leftColumnsMap.set(T.field,T),o.value.leftColumnsWidth+=T.actualWidth):T.fixed==="right"?(o.value.rightColumns.push(T),o.value.rightColumnsMap.set(T.field,T),o.value.rightColumnsWidth+=T.actualWidth):(o.value.primaryColumns.push(T),o.value.primaryColumnsMap.set(T.field,T),o.value.primaryColumnsWidth+=T.actualWidth),_.has(T.field)&&o.value.summaryColumns.push(T),S),o),l(),o}c(n.columns);const f=a.computed(()=>o.value.leftColumns.length>0),d=a.computed(()=>o.value.rightColumns.length>0);function u(b,_){return _.sortable&&_.sort&&_.sort!=="none"&&b.push(_),b}function p(b,_){return b.sortOrder=b.sortOrder||0,_.sortOrder=_.sortOrder||0,b.sortOrder===_.sortOrder?0:b.sortOrder<_.sortOrder?-1:1}function h(b,_){return b.sortOrder=b.sortOrder||0,_.sortOrder=_.sortOrder||0,b.sortOrder===_.sortOrder?0:b.sortOrder<_.sortOrder?1:-1}function m(b,_){return _.filterable&&b.push(_),b}function M(){const b=[];return o.value.leftColumns.reduce(m,b),o.value.primaryColumns.reduce(m,b),o.value.rightColumns.reduce(m,b),b}function x(){const b=[];o.value.leftColumns.reduce(u,b),o.value.primaryColumns.reduce(u,b),o.value.rightColumns.reduce(u,b);const _=Math.max(...b.map(S=>S.sortOrder||0));return b.sort(h).map(S=>{const T=S.sortOrder||_+1;return S.sortOrder=T,S}).sort(p).map((S,T)=>{const g=T+1;return S.sortOrder=g,S})}function y(b,_,S){const T=b.map(g=>{const V=S.getSorterByColumn(g),F=g.sort==="asc",N=g.sort==="desc",w=F?V.ascend:N?V.decend:void 0;return{field:g.field,compare:w}});_.setSorters(T)}function v(b,_){const S=x();y(S,b,_)}return{applyColumnSorter:v,collectionFilterableColumns:M,applySortableColumns:y,collectionSortableColumns:x,columnContext:o,hasLeftFixedColumn:f,hasRightFixedColumn:d,updateColumnRenderContext:c,updateColumnSettingIcon:l}}function sc(n,t,e,o,r,i,s,l){const c=a.ref(o.value-1+r),f=a.ref(0),{renderDataRow:d}=i,u=d,p=d;function h(x){let y=d;return x.__fv_data_grid_group_row__&&(y=u),x.__fv_data_grid_group_summary__&&(y=p),y}function m(x,y,v,b){const{dataView:_}=e,S=[];if(_.value.length>0){const T=b?Date.now().toString():"";let g=x,V=0;const F=y-x+1;for(;S.length<F&&g<_.value.length;){const N=_.value[g],w=_.value[g-1]||v,R=S[V-1],L=w?(w.__fv_data_position__||0)+(w.__fv_data_height__||0):0,k=h(N)(N,w,R,g,L,t.value,S);k.refreshKey=T,S.push(k),V++,g++}}return f.value=S.length>0?S[0].index:0,c.value=S.length>0?S[S.length-1].index:0,S}function M(x,y,v){const b=y.groupField||"",{groupValue:_}=y;e[x](b,_);const{dataView:S}=e,T=v[0].index,g=Math.min(T+o.value+r+1,S.value.length-1);return m(T,g)}return{getVisualData:m,maxVisibleRowIndex:c,minVisibleRowIndex:f,toggleGroupRow:M}}const lc=a.defineComponent({name:"FTreeGridDesign",props:Xn,emits:[],setup(n,t){var oe,ve;const e=a.ref(),o=0,r=((oe=n.rowOption)==null?void 0:oe.height)||28,i=a.ref(20),s=a.ref(n.columns),l=$l(n),c=a.ref(),f=a.ref(),d=a.ref([]),u=a.ref(!1),p=a.ref(((ve=n.rowOption)==null?void 0:ve.wrapContent)||!1),h=a.inject("designer-host-service"),m=a.inject("design-item-context"),M=oc(m,h),x=un(e,m,M);x.value.designerClass="f-utils-fill-flex-column";const y=kl(),v=Vl(n),b=vi(n,new Map,y,v,l),_=ql(n,b,l,d,t),S=a.computed(()=>b.dataView.value.length),{containerStyleObject:T}=pi(n),g=mi(n),{applyCommands:V}=g;V(s);const F=ic(n),{applyColumnSorter:N,columnContext:w,updateColumnRenderContext:R}=F,L=Ul(),C=hi(n,w),k=Wl(n,t,_,l),D=Ll(n,t,l,k),B=Nl(n),O=jl(n,D,B),P=Rl(n,b,D,v,l,B,O),A=sc(n,s,b,S,o,P),{getVisualData:E}=A,I=Al(n,_),{sidebarWidth:H}=I;d.value=E(0,S.value+o-1);const $=Ml(n,b,d,w,A,S,o,H),{onWheel:W,dataGridWidth:G,viewPortHeight:X,viewPortWidth:K,updateVisibleRowsOnLatestVisibleScope:Q}=$,pe=rc(n,w,c,K,C),{calculateColumnsSize:he}=pe,xe=a.computed(()=>({"drag-container":!0,"fv-grid":!0,"fv-grid-bordered":n.showBorder,"fv-datagrid-strip":n.showStripe})),De=a.computed(()=>({"fv-grid-content":!0,"fv-grid-content-hover":u.value,"fv-grid-wrap-content":p.value})),{renderGridHeader:Re}=tc(m,n,F,$,"tree-grid-column"),{renderHorizontalScrollbar:Y}=di(n,c,$);function ue(){var Oe,ot;const Se=Math.ceil(c.value.clientHeight/r);Se>i.value&&(i.value=Se,Q()),X.value=((Oe=f.value)==null?void 0:Oe.clientHeight)||0,G.value=((ot=c.value)==null?void 0:ot.clientWidth)||0,he()}a.onMounted(()=>{e.value.componentInstance=x,c.value&&(i.value=Math.max(Math.ceil(c.value.clientHeight/r),i.value),d.value=E(0,S.value+o-1),Fn.useResizeObserver(c.value,ue),he(),a.nextTick(()=>{c.value&&(G.value=c.value.clientWidth),f.value&&(K.value=f.value.clientWidth,X.value=f.value.clientHeight)}))});function z(Se){Se&&(s.value=Se,V(s),R(s.value),N(b,L),he())}return a.watch(()=>n.columns,Se=>{z(Se)}),a.watch(K,()=>{c.value&&he()}),t.expose(x.value),()=>a.createVNode("div",{ref:e,class:xe.value,style:T.value,onWheel:W,dragref:`${m.schema.id}-container`},[c.value&&Re(),a.createVNode("div",{ref:c,class:De.value,onMouseover:()=>{u.value=!0},onMouseleave:()=>{u.value=!1}},[Y()])])}});Jt.register=(n,t,e,o)=>{n["tree-grid"]=Jt,t["tree-grid"]=ei,o["tree-grid"]={bindingResolver:ni,selectionItemResolver:ti,updateColumnsResolver:ri}},Jt.registerDesigner=(n,t,e)=>{n["tree-grid"]=lc,t["tree-grid"]=oi},ke.withInstall(Jt);const cc=new Map([["appearance",rn]]);function uc(n,t,e){return t}Ot({direction:{type:String,default:"horizontal"},fill:{type:Boolean,default:!1},height:{type:Number,default:0},clickable:{type:Boolean,default:!0},steps:{type:Array,default:[{id:"1",title:"审批中(示例)",description:"正在审批"},{id:"2",title:"复核中(示例)",description:"等待复核"}]},activeIndex:{type:Number,default:0},onClick:{type:Function,default:()=>{}}},{$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/step.schema.json",title:"step",description:"A Farris Component",type:"object",properties:{id:{description:"The unique identifier for step",type:"string"},type:{description:"The type string of step",type:"string",default:"step"},appearance:{description:"",type:"object",properties:{class:{type:"string"},style:{type:"string"}},default:{}},binding:{description:"",type:"object",default:{}},disable:{type:"string",default:!1},editable:{description:"",type:"boolean",default:!0},placeholder:{description:"",type:"string",default:""},readonly:{description:"",type:"boolean",default:!1},require:{description:"",type:"boolean",default:!1},tabindex:{description:"",type:"number",default:-1},visible:{description:"",type:"boolean",default:!0}},required:["id","type"]},cc,uc,{title:"step",description:"A Farris Component",type:"object",categories:{basic:{description:"Basic Infomation",title:"基本信息",properties:{id:{description:"组件标识",title:"标识",type:"string",readonly:!0},type:{description:"组件类型",title:"控件类型",type:"select",editor:{type:"waiting for modification",enum:[]}}}}}});const dc={allowClickMaskToClose:{type:Boolean,default:!1},beforeClose:{type:Function,default:()=>!0},class:{type:String,default:""},maskClass:{type:String,default:""},title:{type:String,default:""},width:{type:Number,default:500},height:{type:Number,default:320},buttons:{type:Array,default:[]},modelValue:{type:Boolean,default:!1},mask:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!0},fitContent:{type:Boolean,default:!0},showCloseButton:{type:Boolean,default:!0},showMaxButton:{type:Boolean,default:!1},minHeight:{type:Number},maxHeight:{type:Number},minWidth:{type:Number},maxWidth:{type:Number},containment:{type:Object,default:null},resizeable:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},dragHandle:{type:Object,default:null},closedCallback:{type:Function,default:null},resizeHandle:{type:Function,default:null},render:{type:Function,default:null},acceptCallback:{type:Function,default:null},rejectCallback:{type:Function,default:null},enableEsc:{type:Boolean,default:!0},enableEnter:{type:Boolean,default:!1},dialogType:{type:String,default:""},src:{type:String,default:""},footerHeight:{type:Number,default:60}};class Ue{constructor(t,e){this.x=t,this.y=e}static getTransformInfo(t){const o=window.getComputedStyle(t).getPropertyValue("transform").replace(/[^-\d,]/g,"").split(",");if(o.length>=6){const r=parseInt(o[4],10),i=parseInt(o[5],10);return{x:r,y:i}}return{x:0,y:0}}static fromEvent(t,e=null){if(this.isMouseEvent(t))return new Ue(t.clientX,t.clientY);if(e===null||t.changedTouches.length===1)return new Ue(t.changedTouches[0].clientX,t.changedTouches[0].clientY);for(let o=0;o<t.changedTouches.length;o++)if(t.changedTouches[o].target===e)return new Ue(t.changedTouches[o].clientX,t.changedTouches[o].clientY)}static isMouseEvent(t){return Object.prototype.toString.apply(t).indexOf("MouseEvent")===8}static isIPosition(t){return!!t&&"x"in t&&"y"in t}static getCurrent(t){const e=new Ue(0,0);if(window){const o=window.getComputedStyle(t);if(o){const r=parseInt(o.getPropertyValue("left"),10),i=parseInt(o.getPropertyValue("top"),10);e.x=isNaN(r)?0:r,e.y=isNaN(i)?0:i}return e}return null}static copy(t){return new Ue(0,0).set(t)}get value(){return{x:this.x,y:this.y}}add(t){return this.x+=t.x,this.y+=t.y,this}subtract(t){return this.x-=t.x,this.y-=t.y,this}multiply(t){this.x*=t,this.y*=t}divide(t){this.x/=t,this.y/=t}reset(){return this.x=0,this.y=0,this}set(t){return this.x=t.x,this.y=t.y,this}}class kt{constructor(t,e){this.width=t,this.height=e}static getCurrent(t){const e=new kt(0,0);if(window){const o=window.getComputedStyle(t);return o&&(e.width=parseInt(o.getPropertyValue("width"),10),e.height=parseInt(o.getPropertyValue("height"),10)),e}return null}static copy(t){return new kt(0,0).set(t)}set(t){return this.width=t.width,this.height=t.height,this}}function fc(n,t){const e=a.ref(),o=a.ref(),r=a.ref(),i=a.ref(),s=a.ref(),l=a.ref(),c=a.ref(),f=a.ref(),d=a.ref(),u=a.ref(),p=a.ref(),h=a.ref(n.resizeable),m=a.ref(),M=a.ref(n.draggable),x=a.ref(!1);function y(){const O=o.value||document.body,P=window.getComputedStyle(O);if(!P||!e.value)return;const A=Ue.getTransformInfo(e.value),E={};c.value&&(E.deltaL=e.value.offsetLeft-c.value.x,E.deltaT=e.value.offsetTop-c.value.y);const I=P.getPropertyValue("position");E.width=O.clientWidth,E.height=O.clientHeight,E.pr=parseInt(P.getPropertyValue("padding-right"),10),E.pb=parseInt(P.getPropertyValue("padding-bottom"),10),E.position=P.getPropertyValue("position"),I==="static"&&(O.style.position="relative"),E.translateX=A.x,E.translateY=A.y,u.value=E}function v(O){if(e.value){i.value=kt.getCurrent(e.value),s.value=Ue.getCurrent(e.value),l.value=i.value?kt.copy(i.value):null,c.value=s.value?Ue.copy(s.value):null,y();const P=O.target.getAttribute("type")||"";f.value={n:!!P.match(/n/),s:!!P.match(/s/),w:!!P.match(/w/),e:!!P.match(/e/)}}}function b(){var O,P,A,E;if(e.value){const I=e.value;f.value&&((f.value.n||f.value.s)&&((O=l.value)!=null&&O.height)&&(I.style.height=l.value.height+"px"),(f.value.w||f.value.e)&&((P=l.value)!=null&&P.width)&&(I.style.width=l.value.width+"px"),c.value&&((A=c.value)!=null&&A.x&&(I.style.left=c.value.x+"px"),(E=c.value)!=null&&E.y&&(I.style.top=c.value.y+"px")))}}function _(){const O=n.minHeight?n.minHeight:1,P=n.minWidth?n.minWidth:1;l.value&&c.value&&f.value&&i.value&&(l.value.height<O&&(l.value.height=O,f.value.n&&s.value&&(c.value.y=s.value.y+(i.value.height-O))),l.value.width<P&&(l.value.width=P,f.value.w&&s.value&&(c.value.x=s.value.x+(i.value.width-P))),n.maxHeight&&l.value.height>n.maxHeight&&(l.value.height=n.maxHeight,s.value&&f.value.n&&(c.value.y=s.value.y+(i.value.height-n.maxHeight))),n.maxWidth&&l.value.width>n.maxWidth&&(l.value.width=n.maxWidth,f.value.w&&s.value&&(c.value.x=s.value.x+(i.value.width-n.maxWidth))))}function S(){if(o.value){const O=u.value;if(c.value&&l.value&&f.value&&i.value){const P=O.width-O.pr-O.deltaL-O.translateX-c.value.x,A=O.height-O.pb-O.deltaT-O.translateY-c.value.y;f.value.n&&c.value.y+O.translateY<0&&s.value&&(c.value.y=-O.translateY,l.value.height=i.value.height+s.value.y+O.translateY),f.value.w&&c.value.x+O.translateX<0&&s.value&&(c.value.x=-O.translateX,l.value.width=i.value.width+s.value.x+O.translateX),l.value.width>P&&(l.value.width=P),l.value.height>A&&(l.value.height=A)}}}function T(O){if(!r.value||!i.value||!s.value||!f.value)return;O.subtract(r.value);const P=O.x,A=O.y;f.value.n?(c.value.y=s.value.y+A,l.value.height=i.value.height-A):f.value.s&&(l.value.height=i.value.height+A),f.value.e?l.value.width=i.value.width+P:f.value.w&&(l.value.width=i.value.width-P,c.value.x=s.value.x+P),S(),_(),b()}function g(O){if(!d.value)return;const P=Ue.fromEvent(O);P&&T(P)}function V(){if(e.value){const{width:O,height:P,x:A,y:E}=e.value.getBoundingClientRect(),I=Ue.getTransformInfo(e.value);return{size:{width:O,height:P},position:{x:A-I.x,y:E-I.y}}}return null}function F(O){if(e.value){const P=V();p.value=P}r.value=void 0,i.value=null,s.value=null,l.value=null,c.value=null,f.value=null,d.value=null,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",F)}function N(){document.addEventListener("mousemove",g),document.addEventListener("mouseup",F)}function w(O){O instanceof MouseEvent&&O.button===2||M.value&&(document.body.click(),O.stopPropagation(),O.preventDefault(),r.value=Ue.fromEvent(O),d.value=O.target,v(O),N())}function R(O){return e.value=O,h.value&&a.createVNode(a.Fragment,null,[a.createVNode("div",{class:"fv-resizable-handle fv-resizable-n",type:"n",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-e",type:"e",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-s",type:"s",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-w",type:"w",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-ne",type:"ne",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-se fv-resizable-diagonal",type:"se",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-sw",type:"sw",onMousedown:P=>w(P)},null),a.createVNode("div",{class:"fv-resizable-handle fv-resizable-nw",type:"nw",onMousedown:P=>w(P)},null)])}function L(O=!0){document.body.click();const P=o.value||document.body,A=kt.getCurrent(P),E=e.value;O&&E&&(m.value=V(),m.value.transform=E.style.transform),A&&E&&(l.value=A,l.value.height-=14,l.value.width-=14,E.style.height=l.value.height+"px",E.style.width=l.value.width+"px",E.style.left="7px",E.style.top="7px",E.style.transform="",p.value={size:l.value,position:{x:0,y:0}},M.value=!1,x.value=!0)}function C(){var O,P;if(document.body.click(),m.value){const A={width:m.value.size.width||0,height:m.value.size.height||0},E={x:(window.innerWidth-A.width)/2,y:(window.innerHeight-A.height)/2};(O=l.value)==null||O.set(A),(P=c.value)==null||P.set(E);const I=e.value;I.style.height=A.height+"px",I.style.width=A.width+"px",I.style.left=`${E.x}px`,I.style.top=`${E.y}px`,I.style.transform="",p.value={size:A,position:E},M.value=n.draggable,x.value=!1}}function k(){if(e.value){const O=kt.getCurrent(e.value);if(O){const{width:P,height:A}=O;e.value.style.left=`${(window.innerWidth-P)/2}px`,e.value.style.top=`${(window.innerHeight-A)/2}px`,e.value.style.transform=""}}}function D(){const O=()=>{x.value?L(!1):k(),document.body.click()};return window.addEventListener("resize",O),()=>{window.removeEventListener("resize",O)}}const B=D();return{renderResizeBar:R,boundingElement:o,resizedEventParam:p,maximize:L,restore:C,allowDrag:M,isMaximized:x,unWindowResizeHandle:B}}function pc(n,t,e){const o=a.ref(),r=a.ref(n.draggable),i=a.ref(n.lockAxis),s=a.ref(),l=a.ref(),c=a.ref(!1),f=a.ref(new Ue(0,0)),d=a.ref(new Ue(0,0)),u=a.ref(new Ue(0,0)),p=a.ref(new Ue(0,0));a.watch(()=>e.value,g=>{s.value.style.cursor=g?"move":"default"});function h(g,V){if(V.tagName==="BUTTON")return!1;if(V===g)return!0;for(const F in V.children)if(Object.prototype.hasOwnProperty.call(V.children,F)&&h(g,V.children[F]))return!0;return!1}function m(){var N,w;let g=u.value.x+d.value.x,V=u.value.y+d.value.y;i.value==="x"?(g=((N=f.value)==null?void 0:N.x)||0,u.value.x=0):i.value==="y"&&(V=((w=f.value)==null?void 0:w.y)||0,u.value.y=0);const F=`translate3d(${Math.round(g)}px, ${Math.round(V)}px, 0px)`;o.value&&(o.value.style.transform=F),p.value.x=g,p.value.y=V}function M(){if(!l.value||!o.value)return null;const g=l.value.getBoundingClientRect(),V=o.value.getBoundingClientRect(),F={top:g.top<V.top,right:g.right>V.right,bottom:g.bottom>V.bottom,left:g.left<V.left};return F.top||(u.value.y-=V.top-g.top),F.bottom||(u.value.y-=V.bottom-g.bottom),F.right||(u.value.x-=V.right-g.right),F.left||(u.value.x-=V.left-g.left),m(),F}function x(g){g&&(f.value&&g.subtract(f.value),u.value.set(g),m(),M())}function y(g){c.value&&r.value&&(g.stopPropagation(),g.preventDefault(),x(Ue.fromEvent(g,s.value)))}function v(){var g;c.value&&(c.value=!1,d.value.add(u.value),u.value.reset(),(g=o.value)==null||g.classList.remove("ng-dragging"),t.emit("stopMove"),document.removeEventListener("mousemove",y),document.removeEventListener("mouseup",v))}function b(){!c.value&&s.value&&(c.value=!0,s.value.classList.add("ng-dragging"),document.addEventListener("mousemove",y),document.addEventListener("mouseup",v))}function _(){if(o.value){const g=Ue.getTransformInfo(o.value);d.value.set(g);return}d.value.reset()}function S(g){if(!e.value||g instanceof MouseEvent&&g.button===2)return;const V=g.target||g.srcElement;s.value!==void 0&&V&&!h(V,s.value)||r.value!==!1&&(document.body.click(),g.stopPropagation(),g.preventDefault(),f.value=Ue.fromEvent(g,o.value),_(),b())}function T(g,V,F){if(r.value&&V){if(g)s.value=g;else if(n.dragHandle){if(n.dragHandle instanceof HTMLElement)s.value=n.dragHandle;else if(typeof n.dragHandle=="string"){const N=V.querySelector(n.dragHandle);N&&(s.value=N)}}o.value=V,l.value=F,s.value?(s.value.classList.add("ng-draggable"),s.value.addEventListener("mousedown",S)):r.value=!1}}return{registerDraggle:T,resetTranslate:_}}function Oo(n,t){if(n){const e=o=>{o.key.toLowerCase()===n.toLowerCase()&&t({event:o,key:n})};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}}function mc(n,t){const e=a.ref(n.enableEsc);let o=null;return e.value?(o=Oo("Escape",r=>{t.emit("esc",{event:r.event,type:"esc"})}),{remove:o}):null}function hc(n,t){const e=a.ref(n.enableEnter);let o=null;return e.value?(o=Oo("Enter",r=>{t.emit("enter",{event:r.event,type:"enter"})}),{remove:o}):null}const Ht=a.defineComponent({name:"FModal",props:dc,emits:["update:modelValue","accept","cancel","closed","resize","esc","enter","stopMove"],setup(n,t){const e=a.ref(n.width||300),o=a.ref(n.height||200),r=a.ref(n.modelValue),i=a.ref(""),s=a.ref(n.class),l=a.ref(n.fitContent),c=a.ref(n.showHeader),f=a.ref(""),d=a.ref(n.showCloseButton),u=a.ref(n.showMaxButton),p=a.ref(!1),h=a.ref(n.dialogType),m=a.ref(n.src),M=a.ref(""),x=a.ref(n.showButtons),y=a.ref(n.title),v=a.ref(n.containment||null),b=a.ref(),_=a.ref(!1);function S(J,_e){Promise.resolve().then(()=>{var Ie;return(Ie=n.beforeClose)==null?void 0:Ie.call(n)}).then(Ie=>{Ie&&(r.value=!1,t.emit("update:modelValue",!1),_e!=null&&t.emit(_e?"accept":"cancel"),t.emit("closed",J))})}const T=[{name:"cancel",text:"取消",class:"btn btn-secondary",handle:J=>{S(J,!1)}},{name:"accept",text:"确定",class:"btn btn-primary",handle:J=>{S(J,!0)}}],g=a.ref(n.buttons&&n.buttons.length?n.buttons:T),V=a.computed(()=>!!f.value),F=a.computed(()=>!!x.value&&!!g.value),N=a.ref(),w=a.ref(),R=a.ref(!1),{renderResizeBar:L,maximize:C,restore:k,boundingElement:D,resizedEventParam:B,allowDrag:O,unWindowResizeHandle:P}=fc(n),{registerDraggle:A}=pc(n,t,O);function E(){return!!document.querySelectorAll(".farris-modal").length&&document.body.classList.contains("modal-open")}function I(){const J=document.querySelectorAll(".farris-modal").length;(!J||J-1<=0)&&document.body.classList.remove("modal-open"),b.value&&b.value.classList.remove("show")}a.watch(()=>n.title,(J,_e)=>{J!==_e&&(y.value=J)}),a.watch(()=>n.modelValue,(J,_e)=>{J!==_e&&(r.value=J,r.value&&n.draggable&&a.nextTick(()=>{w.value&&!v.value&&(v.value=w.value.parentElement,D.value=v.value,A(N.value,w.value,D.value))}),J||(v.value&&(v.value=null),I())),r.value&&(_.value=E())}),a.watch(()=>n.showHeader,(J,_e)=>{J!==_e&&(c.value=J)}),a.watch(()=>n.showButtons,(J,_e)=>{J!==_e&&(x.value=J)}),a.watch(()=>B.value,(J,_e)=>{const Ie=J||{},Ge=_e||{};JSON.stringify(Ie)!==JSON.stringify(Ge)&&t.emit("resize",{newSize:J,oldSize:_e,isMaximized:R.value})});const H=a.computed(()=>(r.value&&document.body.classList.add("modal-open"),r.value)),$=a.computed(()=>{var Ie;const J={modal:!0,"farris-modal":!0,fade:!0};J["f-modal-fitContent"]=!!l.value,J.show=!!H.value;const _e=(Ie=n.maskClass)==null?void 0:Ie.split(" ");return _e==null||_e.reduce((Ge,je)=>(Ge[je]=!0,Ge),J),J}),W=a.computed(()=>{var Ie;const J={"modal-dialog":!0},_e=(Ie=s.value)==null?void 0:Ie.split(" ");return _e==null||_e.reduce((Ge,je)=>(Ge[je]=!0,Ge),J),J}),G=a.computed(()=>{const J={position:"absolute",top:`${(window.innerHeight-o.value)/2}px`,left:`${(window.innerWidth-e.value)/2}px`,width:`${e.value}px`,height:l.value?"auto":`${o.value}px`};return n.mask||(J.pointerEvents="auto"),J}),X=a.computed(()=>{const J={display:"block"};return n.mask||(J.pointerEvents="none",J.backgroundColor="transparent"),_.value&&(J.backgroundColor="transparent"),J}),K=a.computed(()=>({"modal-content":!0,"modal-content-has-header":c.value})),Q=a.computed(()=>{const J={display:c.value?"":"none"};return J["pointer-events"]=O.value?"auto":"none",J}),pe=a.computed(()=>({"f-icon":!0,modal_maximize:!0,modalrevert:R.value})),he=a.computed(()=>({"modal-body":!0,"f-utils-flex-column":h.value==="iframe","f-utils-fill":!0}));function xe(){return{height:`${n.footerHeight||60}px`}}const De=a.computed(()=>{const J={textAlgin:M.value},_e=xe();return Object.assign(J,_e)});function Re(J){if(J.stopPropagation(),R.value){R.value=!1,k();return}C(),R.value=!0}async function Y(J,_e){J.handle&&await J.handle(_e,J)&&t.emit("closed",_e)}function ue(J){J.width&&(e.value=J.width),J.height&&(o.value=J.height),J.buttons&&(g.value=J.buttons),J.title&&(y.value=J.title)}let z=null,oe=null;a.onBeforeMount(()=>{_.value=E()}),a.onMounted(()=>{w.value&&!v.value&&(v.value=w.value.parentElement,D.value=v.value,A(N.value,w.value,D.value)),H.value&&document.body.classList.add("modal-open"),z=mc(n,t),oe=hc(n,t)}),a.onUnmounted(()=>{P&&P(),z&&z.remove(),oe&&oe.remove()}),t.expose({modalElementRef:w,updateModalOptions:ue,close:S,maxDialog:Re,isMaximized:R});function ve(){return a.createVNode("ul",null,[p.value&&a.createVNode("li",{class:"f-btn-icon f-bare"},[a.createVNode("span",{class:"f-icon modal_minimize"},null)]),u.value&&a.createVNode("li",{onClick:Re,class:"f-btn-icon f-bare",style:"pointer-events: auto;"},[a.createVNode("span",{class:pe.value},null)]),d.value&&a.createVNode("li",{class:"f-btn-icon f-bare",onClick:J=>S(J,!1),style:"pointer-events: auto;"},[a.createVNode("span",{class:"f-icon modal_close"},null)])])}function Se(){return a.createVNode("div",{class:"modal-footer",style:De.value},[g.value&&g.value.map(J=>{const _e=a.ref(J.disabled);return a.createVNode("button",{name:J.name,type:"button",disabled:_e.value,class:J.class+(J.iconClass?" btn-icontext":""),onClick:Ie=>{Y(J,Ie)}},[!!J.iconClass&&a.createVNode("i",{class:J.iconClass},null),J.text])})])}function Oe(){return a.createVNode("div",{ref:N,class:"modal-header",style:Q.value},[t.slots.headerTemplate?t.slots.headerTemplate():a.createVNode("div",{class:"modal-title"},[V.value&&a.createVNode("span",{class:f.value,style:"margin-right: 8px"},null),a.createVNode("span",{class:"modal-title-label"},[y.value])]),a.createVNode("div",{class:"actions"},[ve()])])}function ot(){return t.slots.footerTemplate?t.slots.footerTemplate():F.value&&Se()}function mt(J){if(J.stopPropagation(),n.allowClickMaskToClose){if(J.target!==b.value)return;S(J,!1)}}function dt(){var J,_e;return a.createVNode("div",{id:i.value,class:W.value,style:G.value,ref:w},[a.createVNode("div",{class:K.value},[c.value&&Oe(),a.createVNode("div",{class:he.value},[(_e=(J=t.slots).default)==null?void 0:_e.call(J),h.value==="iframe"&&a.createVNode("iframe",{title:i.value,class:"f-utils-fill",width:"100%",frameborder:"0",src:m.value},null)]),ot()]),!l.value&&w.value&&!R.value&&L(w.value)])}return()=>a.createVNode(a.Teleport,{to:"body"},{default:()=>[H.value&&a.createVNode(a.Transition,{name:"fade",appear:!0},{default:()=>[a.createVNode("div",{ref:b,class:$.value,style:X.value,onClick:mt},[dt()])]})]})}});function Do(n){if(n.content&&n.content.render)return n.content.render;if(n.render&&typeof n.render=="function")return n.render}function gc(n){const t=document.createElement("div");t.style.display="contents";const e=a.createApp({setup(o,r){a.onUnmounted(()=>{document.body.removeChild(t)});const i=a.ref(),s=a.ref(n.class||""),l=a.ref(!!n.showButtons),c=a.ref(!!n.showHeader),f=a.ref(n.showCloseButton==null?!0:n.showCloseButton),d=a.ref(!0),u=a.ref(n.title||""),p=n.acceptCallback||(()=>{}),h=n.rejectCallback||(()=>{}),m=n.closedCallback||(b=>{}),M=n.resizeHandle||(b=>{}),x=n.stopMoveHandle||(b=>{}),y=Do(n),v=b=>{d.value=!1,e.unmount(),m(b)};return a.onMounted(()=>{}),r.expose({modalRef:i}),()=>a.createVNode(Ht,{ref:i,class:s.value,modelValue:d.value,"onUpdate:modelValue":b=>d.value=b,title:u.value,width:n.width,height:n.height,buttons:n.buttons,"show-header":c.value,"show-buttons":l.value,"show-close-button":f.value,"show-max-button":!1,onAccept:p,onCancel:h,fitContent:n.fitContent==null?!0:n.fitContent,onClosed:v,onResize:M,onStopMove:x},{default:()=>[y&&y(e)]})}});return document.body.appendChild(t),e.mount(t),e}class Po{constructor(t){j(this,"appContext",null);j(this,"modalRef",a.ref());j(this,"activeModalIndex",a.ref(0));j(this,"modalRefs",{});j(this,"isUseEscCloseModal",a.ref(!1));j(this,"activeModalInstance",a.computed(()=>this.modalRefs[this.activeModalIndex.value]));this.app=t,this.appContext=t?t._context:null}getCurrentModal(){return this.activeModalInstance.value}adaptToWindow(t,e){const{width:o,height:r}={width:window.innerWidth,height:window.innerHeight};return o<t&&(t=o-14),r<e&&(e=r-14),{width:t,height:e}}static show(t){const e=Object.assign({title:"",showButtons:!0,showHeader:!0},t);return gc(e)}close(t){var e,o;t?(o=t.value)==null||o.close():(e=this.getCurrentModal())==null||e.close()}open(t){const e=document.createDocumentFragment();t.showMaxButton&&t.fitContent&&(t.showMaxButton=!1);const o=a.shallowRef(Object.assign({title:"",showButtons:!0,showHeader:!0},t)),r=a.ref(!0),i=o.value.acceptCallback||(()=>{}),s=o.value.rejectCallback||(()=>{}),l=o.value.closedCallback||((S,T)=>{}),c=o.value.resizeHandle||(S=>{}),f=t.stopMoveHandle||(S=>{});let d;const u=Do(o.value),p=S=>{var g;r.value=!1;const T=(g=S==null?void 0:S.target)==null?void 0:g.classList.contains("modal_close");l(S,this.isUseEscCloseModal.value?"esc":T?"icon":"button")},h=S=>{p(S),d&&a.nextTick(()=>{if(this.modalRefs[this.activeModalIndex.value]&&delete this.modalRefs[this.activeModalIndex.value],a.render(null,e),d=null,this.modalRef.value=null,this.modalRefs){const T=Object.keys(this.modalRefs).map(g=>Number(g));T.length>0?this.activeModalIndex.value=Math.max(...T):this.activeModalIndex.value=0}this.isUseEscCloseModal.value=!1})},m=S=>{var T;this.isUseEscCloseModal.value=!0,this.activeModalInstance&&((T=this.activeModalInstance.value)==null||T.close(S==null?void 0:S.event))},{width:M,height:x}=o.value,y=this.adaptToWindow(M||500,x||320);Object.assign(o.value,y);const v=()=>a.createVNode(Ht,a.mergeProps({ref:this.modalRef,modelValue:r.value,"onUpdate:modelValue":S=>r.value=S},o.value,{onAccept:i,onCancel:s,onClosed:h,onResize:c,onEsc:m,onStopMove:f}),{default:()=>[u&&u(this.app)]});return d=(S=>{const T=a.h(v,S);return T.appContext=this.appContext,a.render(T,e),T})({...o.value}),this.activeModalIndex.value++,this.modalRefs[this.activeModalIndex.value]=this.modalRef.value,{update:S=>{o.value={...o.value,...S},d&&a.render(a.cloneVNode(d,{...o}),e)},destroy:h,modalRef:this.activeModalInstance,close:this.close}}}const yc=Symbol("FModalService");Ht.install=n=>{n.component(Ht.name,Ht);const t=new Po(n);n.provide(yc,t),n.provide("FModalService",t)};var Bo=(n=>(n.SimpleField="SimpleField",n.ComplexField="ComplexField",n))(Bo||{});function vc(n,t,e){function o(){const s=e.componentId;if(!s)return!1;const l=n.formSchemaUtils.getViewModelIdByComponentId(s);if(!l)return!1;const{schema:c}=t,{designViewModelUtils:f}=n,d=f.getDgViewModel(l),u=d==null?void 0:d.fields.find(p=>p.id===c.binding.field);return!(!u||u.$type!==Bo.SimpleField)}function r(){const{schema:s}=t;return!!n.formSchemaUtils.getVariableById(s.binding.field)}function i(){var c;const{schema:s}=t;let l=!0;if(!n||!((c=s.binding)!=null&&c.field))return l;switch(s.binding.type){case dn.Form:{l=o();break}case dn.Variable:l=r()}return l}return{checkBindingFieldValidation:i}}const bc=a.defineComponent({name:"FDynamicFormGroupDesign",props:Dt,emits:["change","update:modelValue"],setup(n,t){var b;const e=a.ref(n.id),o=a.ref(n.customClass),r=a.ref(n.editor),i=a.ref(n.label),s=a.ref(n.modelValue),l=a.ref(!0),c=a.ref(((b=n.editor)==null?void 0:b.required)===!0),f=a.ref(n.showLabel);a.ref(n.type);const d=a.ref(),u=a.inject("designer-host-service"),p=a.inject("design-item-context"),{resolveEditorProps:h,resolveEditorType:m}=za(),M=a.computed(()=>({"form-group":!0,"farris-form-group":!0,"common-group":!0,"q-state-readonly":l.value,"form-group-in-canvas":!0})),x=a.computed(()=>{const _=r.value.type||"input-group",S=m(_),T=h(_,r.value);return()=>a.createVNode(S,a.mergeProps({ref:d},T,{modelValue:s.value,"onUpdate:modelValue":g=>s.value=g}),null)});a.watch([()=>n.id,()=>n.customClass,()=>n.editor,()=>n.label,()=>n.modelValue,()=>n.readonly,()=>n.showLabel],([_,S,T,g,V,F,N])=>{var w;e.value=_,o.value=S,r.value={...T},i.value=g,s.value=V,l.value=F,c.value=((w=r.value)==null?void 0:w.required)===!0,f.value=N},{deep:!0});const{checkBindingFieldValidation:y}=vc(u,p,n);function v(){const _=y();return a.createVNode(jn,{id:`${e.value}-lable`,required:c.value,text:i.value,title:i.value,valid:_,inValidTip:"绑定信息已失效,请切换绑定或移除控件"},null)}return t.expose({editorRef:d}),()=>a.createVNode("div",{id:`${e.value}-input-group`,class:o.value},[a.createVNode("div",{class:"farris-group-wrap"},[a.createVNode("div",{class:M.value},[f.value&&v(),a.createVNode("div",{class:"farris-input-wrap"},[x.value()])])])])}});function wc(n,t){function e(){return!0}function o(){return!0}function r(){return!1}function i(){return!0}function s(d){var x;const u=t==null?void 0:t.designViewModelUtils,p=t==null?void 0:t.formSchemaUtils,h=(x=n==null?void 0:n.componentInstance.value)==null?void 0:x.belongedComponentId;if(!h||!u||!p)return;const m=p.getViewModelIdByComponentId(h),M=u.getDgViewModel(m);M&&M.removeField([d])}function l(d){const u=t==null?void 0:t.formSchemaUtils;if(u.getExpressions().length){const p=u.getExpressions().findIndex(h=>h.target===d);p>-1&&u.getExpressions().splice(p,1)}}function c(){var u,p;const d=(u=n==null?void 0:n.parent)==null?void 0:u.componentInstance.value;((p=d==null?void 0:d.schema)==null?void 0:p.type)===Tt.DgControl["response-layout-item"].type&&(d!=null&&d.schema.appearance.class)&&(d.schema.appearance.class=d.schema.appearance.class.replace("f-form-layout",""),d.schema.appearance.class=d.schema.appearance.class.replace("farris-form",""),d.schema.appearance.class=d.schema.appearance.class.replace("farris-form-controls-inline",""),d.schema.appearance.class=d.schema.appearance.class.replace("farris-form-auto",""),d.schema.appearance.class=d.schema.appearance.class.trim().replace(" "," "))}function f(){const{schema:d}=n,u=d.binding&&d.binding.field;u&&(s(u),l(u),c())}return{canAccepts:r,checkCanDeleteComponent:o,checkCanMoveComponent:e,hideNestedPaddingInDesginerView:i,onRemoveComponent:f}}const Cc=a.defineComponent({name:"FFormGroupDesign",props:Dt,emits:[],setup(n,t){const e=a.ref(),o=a.inject("design-item-context"),r=a.inject("designer-host-service"),i=wc(o,r),s=un(e,o,i);return a.onMounted(()=>{e.value.componentInstance=s,s.value.getPropConfig=(...l)=>{var f,d,u;let c=Nn[n.editor.type];return c&&Object.keys(c).length===0&&((f=e.value)!=null&&f.editorRef)&&((u=(d=e.value)==null?void 0:d.editorRef)!=null&&u.getPropConfig)&&(c=e.value.editorRef.getPropConfig(...l,s.value)),c}}),t.expose(s.value),()=>a.createVNode(bc,a.mergeProps(n,{ref:e}),null)}}),jo={id:{type:String,default:""},editor:{type:Object,default:{}},modelValue:{type:[String,Boolean,Array,Number]},focusOnCreated:{type:Boolean,default:!1},selectOnCreated:{type:Boolean,default:!1}},xc=Ot(jo,In,an,void 0),Ro=a.defineComponent({name:"FDynamicFormInput",props:jo,emits:["change","update:modelValue","mousedown","mouseup"],setup(n,t){const e=a.ref(n.id),o=a.ref(n.editor),r=a.ref(n.modelValue),{resolveEditorProps:i,resolveEditorType:s,getChangeFunctionName:l,getMousedownFunctionName:c,getMouseupFunctionName:f}=Ln();function d(m,M){r.value=M!==void 0?M:m,t.emit("update:modelValue",r.value),t.emit("change",r.value)}function u(m){t.emit("mousedown",m)}function p(m){t.emit("mouseup",m)}const h=a.computed(()=>{const m=s(o.value.type),M=i(o.value.type,o.value);M.focusOnCreated=n.focusOnCreated,M.selectOnCreated=n.selectOnCreated;const x=l(o.value.type);M[x]=d;const y=c(o.value.type);M[y]=u;const v=f(o.value.type);return M[v]=p,(M.id==null||M.id==="")&&(M.id=e.value),()=>a.createVNode(m,a.mergeProps(M,{modelValue:r.value,"onUpdate:modelValue":b=>r.value=b}),null)});return a.watch([()=>n.id,()=>n.editor,()=>n.modelValue],([m,M,x])=>{e.value=m,o.value=M,r.value=x}),()=>h.value()}}),_c={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://farris-design.gitee.io/grid-field-editor.schema.json",title:"response-form-layout-setting",description:"A Farris Data Grid Component",type:"object",properties:{id:{description:"The unique identifier for a Input Group",type:"string"},type:{description:"The type string of Input Group component",type:"string",default:"response-form-layout-setting"},initialState:{description:"",type:"object"}},required:["id","type"]},Lo={initialState:{type:Object,default:{uniqueColClassInSM:12,uniqueColClassInMD:6,uniqueColClassInLG:3,uniqueColClassInEL:2}}},Tc=tn.createPropsResolver(Lo,_c,fa,ga),Fc={width:{Type:Number,default:400},type:{Type:String,default:"info"},title:{Type:String,default:""},detail:{Type:String,default:""},okButtonText:{Type:String,default:"确定"},cancelButtonText:{Type:String,default:"取消"},exceptionInfo:{Type:Object,default:null},promptEditorType:{Type:String,default:"text-area"},buttons:{type:Object,default:[]}};function xn(){return new DOMException("The request is not allowed","NotAllowedError")}async function Sc(n){if(!navigator.clipboard)throw xn();return navigator.clipboard.writeText(n)}async function kc(n){const t=document.createElement("span");t.textContent=n,t.style.whiteSpace="pre",t.style.webkitUserSelect="auto",t.style.userSelect="all",document.body.appendChild(t);const e=window.getSelection(),o=window.document.createRange();e==null||e.removeAllRanges(),o.selectNode(t),e==null||e.addRange(o);let r=!1;try{r=window.document.execCommand("copy")}finally{e==null||e.removeAllRanges(),window.document.body.removeChild(t)}if(!r)throw xn()}async function Vc(n){try{await Sc(n)}catch(t){try{await kc(n)}catch(e){throw e||t||xn()}}}function Mc(){async function n(t){await Vc(t)}return{onCopy:n}}function Nc(n,t,e,o){const r=a.ref(14),i=a.ref(140),s=a.ref(""),l=a.ref(o.value.length),c=a.computed(()=>o.value),f=a.computed(()=>({"font-size":`${r.value}px`,height:"100%"}));function d(u){if(u.currentTarget){const p=u.currentTarget.value||"";l.value=p.length}}return()=>a.createVNode(a.Fragment,null,[a.createVNode("textarea",{title:"promptMessage",name:"promptMessage",class:"form-control",style:f.value,rows:"4",maxlength:i.value,onInput:u=>d(u)},[c.value]),a.createVNode("span",{class:"textarea-wordcount",title:s.value,style:"position: absolute; bottom: 76px; right: 32px; cursor: pointer; text-align: right;"},[l.value+" / "+i.value])])}function Ic(n,t,e,o){const r=Nc(n,t,e,o),i=new Map([["text-area",r]]);function s(l){return i.get(l)||null}return{getEditorRender:s}}function Ec(){const n=a.ref(!1),t=a.ref("复制成功");return{feedbackStyle:a.computed(()=>{const o={position:"absolute",left:"50%",top:"50%",width:"100px",height:"40px",background:"#303C53","line-height":"40px","text-align":"center","margin-left":"-30px","margin-top":"-50px","border-radius":"10px","box-shadow":"0px 2px 8px 0px",color:"#fff",transition:"all .3s ease"};return o.opacity=n.value?"0.8":"0",o.display=n.value?"":"none",o}),feedbackMessage:t,toShowFeedback:n}}function Oc(n,t){const e=t.getEditorRender(n.promptEditorType);return()=>e&&e()}function Dc(n){const t=a.computed(()=>!!n.value&&!!n.value.date),e=a.computed(()=>`发生时间 : ${n.value&&n.value.date||""}`),o=a.computed(()=>!!n.value&&!!n.value.detail),r=a.computed(()=>"详细信息 : "+(n.value&&n.value.detail||"")),i="exp_switch_"+new Date().getTime();return()=>a.createVNode("div",{class:"toast-msg-detail"},[t.value&&a.createVNode("div",null,[e.value]),o.value&&a.createVNode("div",{class:"exception_wrap"},[a.createVNode("input",{type:"checkbox",id:i,class:"d-none exp_switch"},null),a.createVNode("div",{class:"exception_error_msg"},[a.createVNode("label",{class:"swith",htmlFor:i},null),a.createVNode("div",{innerHTML:r.value},null)])])])}function Pc(n){return()=>a.createVNode("p",{class:"toast-msg-detail",innerHTML:n.value},null)}function Bc(n,t,e,o){const r=a.ref(n.exceptionInfo),i=a.computed(()=>{const p={"f-icon":!0},h=`f-icon-${t.value}`;return p[h]=!0,p}),s=a.computed(()=>e.value||r.value&&r.value.message),l=a.computed(()=>o.value),c=a.computed(()=>!!o.value),f=a.computed(()=>!!r.value);function d(){return f.value?Dc(r):c.value?Pc(l):()=>null}const u=d();return()=>a.createVNode(a.Fragment,null,[a.createVNode("div",{class:"float-left modal-tips-iconwrap"},[a.createVNode("span",{class:i.value},null)]),a.createVNode("div",{class:"modal-tips-content"},[a.createVNode("p",{class:"toast-msg-title",innerHTML:s.value},null),u()])])}function jc(n,t,e){const{onCopy:o}=t,{toShowFeedback:r}=e,i=a.ref("复制成功"),s=a.ref("复制详细信息"),l=a.ref(n.exceptionInfo||{date:"",message:"",detail:""}),c=a.computed(()=>l.value&&l.value.detail||"");function f(d){o(c.value).catch(u=>{i.value="复制失败"}).finally(()=>{r.value=!0,setTimeout(()=>{r.value=!1},700)})}return()=>a.createVNode("span",{style:"width: 100%;color: #2A87FF;padding-left: 37px;"},[a.createVNode("span",{onClick:f,style:"cursor: pointer;"},[s.value])])}function Rc(n,t,e,o){const r=a.ref(n.type),i=a.ref(n.buttons),s=a.ref(n.exceptionInfo),l=a.ref(n.okButtonText),c=a.ref(n.cancelButtonText),f=a.ref(!0),d=a.ref(!0),u=a.computed(()=>!!(i.value&&i.value.length)),p=a.computed(()=>s.value&&s.value.date&&s.value.message&&s.value.detail),h=a.computed(()=>!(i.value&&i.value.length)&&(l.value||c.value)),m=a.computed(()=>d.value&&l.value),M=a.computed(()=>f.value&&c.value),x=jc(n,e,o);function y(b){r.value==="question"&&t.emit("reject"),t.emit("close")}function v(b){r.value==="question"&&t.emit("accept"),t.emit("close")}return()=>a.createVNode("div",{class:"modal-footer"},[p.value&&x(),h.value&&M.value&&a.createVNode("button",{type:"button",class:"btn btn-secondary btn-lg",onClick:y},[c.value]),h.value&&m.value&&a.createVNode("button",{type:"button",class:"btn btn-primary btn-lg",onClick:v},[l.value]),u.value&&i.value.length&&i.value.map(b=>a.createVNode("button",{type:"button",onClick:b.handle,class:b.class},[b.iconClass&&a.createVNode("span",{class:b.iconClass},null),b.text]))])}const en=a.defineComponent({name:"FMessageBox",props:Fc,emits:["accept","reject","close"],setup(n,t){const e=a.ref(n.type),o=a.ref(n.title),r=a.ref(n.detail),i=a.computed(()=>{const x={"modal-tips":!0,"d-flex":!0,"flex-row":!0},y=`messager-type-${e.value}`;return x[y]=!0,x}),s=a.computed(()=>{const x={};return e.value==="prompt"?x.padding="0.5rem 0.5rem 1rem 1.5rem":e.value==="error"&&(x.padding="0.5rem 1.5rem 1rem 1.5rem"),x}),l=Mc(),c=Ic(n,e,o,r),f=Ec(),{feedbackStyle:d,feedbackMessage:u}=f;function p(){return a.createVNode("div",{style:d.value},[u.value])}function h(){switch(e.value){case"prompt":return Oc(n,c);default:return Bc(n,e,o,r)}}const m=h(),M=Rc(n,t,l,f);return()=>a.createVNode("div",{class:"farris-messager"},[a.createVNode("section",{class:i.value,style:s.value},[m()]),M(),p()])}});class pt{static show(t){const e=a.reactive({...t}),o=!1,r=e.type==="error"||e.type==="prompt",i=e.type==="error"?"错误提示":e.type==="prompt"&&e.title||"",s=e.acceptCallback||(()=>{}),l=e.rejectCallback||(()=>{});let c=null,f=new Po(c);const d=()=>{c&&(c==null||c.destroy(),f=null)};return c=f==null?void 0:f.open({class:"modal-message modal-message-type-info",title:i,showButtons:o,showHeader:r,width:e.width||400,fitContent:!0,showMaxButton:!1,draggable:!0,render:()=>a.createVNode(en,a.mergeProps(e,{onAccept:s,onReject:l,onClose:d}),null)}),f==null?void 0:f.getCurrentModal()}static info(t,e){const o=a.reactive({type:"info",title:t,detail:e,okButtonText:"知道了",cancelButtonText:""});pt.show(o)}static warning(t,e){const o=a.reactive({type:"warning",title:t,detail:e,okButtonText:"知道了",cancelButtonText:""});pt.show(o)}static success(t,e){const o=a.reactive({type:"success",title:t,detail:e,okButtonText:"关闭",cancelButtonText:""});pt.show(o)}static error(t,e,o){const r=a.reactive({width:500,type:"error",okButtonText:"关闭",cancelButtonText:"",exceptionInfo:{date:o,message:t,detail:e}});pt.show(r)}static prompt(t,e){const o=a.reactive({type:"prompt",title:t,detail:e,okButtonText:"确定",cancelButtonText:"取消"});pt.show(o)}static question(t,e,o,r){const i=a.reactive({type:"question",title:t,detail:e,okButtonText:"确定",cancelButtonText:"取消",acceptCallback:o,rejectCallback:r});pt.show(i)}}en.install=n=>{n.component(en.name,en),n.provide("FMessageBoxService",pt)};const Lc=a.defineComponent({name:"FResponseFormLayoutSetting",props:Lo,emits:["change"],setup(n,t){const e=[1],o=[1,2],r=[1,2,3,4],i=[1,2,3,4,6];let s=[],l=[],c=[],f=[];const d=a.ref(n.initialState),u=a.ref(-1),p=a.ref(-1),h=a.ref(-1),m=a.ref(-1);function M(){const v="自定义",b=12/d.value.uniqueColClassInSM;e.includes(b)?u.value=b:(s.push({value:0,name:v}),u.value=0);const _=12/d.value.uniqueColClassInMD;o.includes(_)?p.value=_:(l.push({value:0,name:v}),p.value=0);const S=12/d.value.uniqueColClassInLG;r.includes(S)?h.value=S:(c.push({value:0,name:v}),h.value=0);const T=12/d.value.uniqueColClassInEL;i.includes(T)?m.value=T:(f.push({value:0,name:v}),m.value=0),s=[...s],l=[...l],c=[...c],f=[...f]}function x(){e.forEach(v=>{s.push({value:v,name:v+""})}),o.forEach(v=>{l.push({value:v,name:v+""})}),r.forEach(v=>{c.push({value:v,name:v+""})}),i.forEach(v=>{f.push({value:v,name:v+""})})}function y(){pt.question("应用统一布局,将重置区域内部所有控件的宽度样式,确定应用?","",()=>{d.value.uniqueColClassInSM=u.value===0?null:12/u.value,d.value.uniqueColClassInMD=p.value===0?null:12/p.value,d.value.uniqueColClassInLG=h.value===0?null:12/h.value,d.value.uniqueColClassInEL=m.value===0?null:12/m.value,t.emit("change",d.value)},()=>{})}return a.onMounted(()=>{x(),M()}),()=>a.createVNode("div",null,[a.createVNode("div",{class:"f-form-layout farris-form farris-form-controls-inline"},[a.createVNode("div",{class:"form-group farris-form-group screenGroup"},[a.createVNode("span",{class:"screenName"},[a.createTextVNode(" 小屏幕 ")]),a.createVNode("div",{class:"d-flex ml-2 screen-input"},[a.createVNode(Ft,{data:s,idField:"value",valueField:"value",editable:!1,enableClear:!1,modelValue:u.value,"onUpdate:modelValue":v=>u.value=v},null),a.createVNode("span",{class:"ml-2 columnText"},[a.createTextVNode("列")])])]),a.createVNode("div",{class:"form-group farris-form-group screenGroup"},[a.createVNode("span",{class:"screenName"},[a.createTextVNode("中等屏幕")]),a.createVNode("div",{class:"d-flex ml-2 screen-input"},[a.createVNode(Ft,{data:l,idField:"value",valueField:"value",editable:!1,enableClear:!1,modelValue:p.value,"onUpdate:modelValue":v=>p.value=v},null),a.createVNode("span",{class:"ml-2 columnText"},[a.createTextVNode("列")])])]),a.createVNode("div",{class:"form-group farris-form-group screenGroup"},[a.createVNode("span",{class:"screenName"},[a.createTextVNode("大屏幕")]),a.createVNode("div",{class:"d-flex ml-2 screen-input"},[a.createVNode(Ft,{data:c,idField:"value",valueField:"value",editable:!1,enableClear:!1,modelValue:h.value,"onUpdate:modelValue":v=>h.value=v},null),a.createVNode("span",{class:"ml-2 columnText"},[a.createTextVNode("列")])])]),a.createVNode("div",{class:"form-group farris-form-group screenGroup"},[a.createVNode("span",{class:"screenName"},[a.createTextVNode("极大屏幕")]),a.createVNode("div",{class:"d-flex ml-2 screen-input"},[a.createVNode(Ft,{data:f,idField:"value",valueField:"value",editable:!1,enableClear:!1,modelValue:m.value,"onUpdate:modelValue":v=>m.value=v},null),a.createVNode("span",{class:"ml-2 columnText"},[a.createTextVNode("列")])])])]),a.createVNode("div",{class:"applyBtn"},[a.createVNode("button",{class:"btn f-rt-btn btn-primary",type:"button",onClick:()=>y()},[a.createTextVNode("应用")])])])}}),$c={install(n){n.component(Gt.name,Gt).component(Lt.name,Lt)},register(n,t,e,o){n["form-group"]=Lt,t["form-group"]=cn,n["response-form"]=Gt,t["response-form"]=ln,n["form-input"]=Ro,t["form-input"]=xc,o["form-group"]={editorResolver:En},n["response-form-layout-setting"]=Lc,t["response-form-layout-setting"]=Tc},registerDesigner(n,t,e){n["form-group"]=Cc,t["form-group"]=cn,n["response-form"]=Ia,t["response-form"]=ln}};Z.FDynamicFormGroup=Lt,Z.FDynamicFormInput=Ro,Z.FResponseForm=Gt,Z.default=$c,Z.dynamicFormGroupProps=Dt,Z.editorResolver=En,Z.formGroupPropsResolver=cn,Z.formPropsResolver=ln,Z.responseFormProps=sn,Z.useDesignerRules=Bn,Object.defineProperties(Z,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});