@ibiz-template/runtime 0.1.35 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +799 -130
- package/dist/index.system.min.js +1 -1
- package/dist/index.system.min.js.map +1 -1
- package/out/constant/index.d.ts +1 -0
- package/out/constant/index.d.ts.map +1 -1
- package/out/constant/index.js +1 -0
- package/out/constant/value-op.d.ts +82 -0
- package/out/constant/value-op.d.ts.map +1 -0
- package/out/constant/value-op.js +83 -0
- package/out/constant/view-call-tag.d.ts +5 -1
- package/out/constant/view-call-tag.d.ts.map +1 -1
- package/out/constant/view-call-tag.js +4 -0
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.d.ts.map +1 -1
- package/out/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.js +1 -0
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts +3 -3
- package/out/controller/control/form/form-detail/form-item/form-item.controller.d.ts.map +1 -1
- package/out/controller/control/form/form-detail/form-item/form-item.controller.js +13 -8
- package/out/controller/control/form/search-form/search-form.controller.d.ts +2 -2
- package/out/controller/control/form/search-form/search-form.controller.d.ts.map +1 -1
- package/out/controller/control/form/search-form/search-form.controller.js +11 -3
- package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.d.ts +3 -3
- package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.d.ts.map +1 -1
- package/out/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.js +13 -8
- package/out/controller/control/index.d.ts +1 -0
- package/out/controller/control/index.d.ts.map +1 -1
- package/out/controller/control/index.js +1 -0
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts +38 -3
- package/out/controller/control/md-ctrl/md-ctrl.controller.d.ts.map +1 -1
- package/out/controller/control/md-ctrl/md-ctrl.controller.js +110 -3
- package/out/controller/control/medit-view-panel/index.d.ts +3 -0
- package/out/controller/control/medit-view-panel/index.d.ts.map +1 -0
- package/out/controller/control/medit-view-panel/index.js +2 -0
- package/out/controller/control/medit-view-panel/medit-view-panel.controller.d.ts +119 -0
- package/out/controller/control/medit-view-panel/medit-view-panel.controller.d.ts.map +1 -0
- package/out/controller/control/medit-view-panel/medit-view-panel.controller.js +320 -0
- package/out/controller/control/medit-view-panel/medit-view-panel.service.d.ts +11 -0
- package/out/controller/control/medit-view-panel/medit-view-panel.service.d.ts.map +1 -0
- package/out/controller/control/medit-view-panel/medit-view-panel.service.js +9 -0
- package/out/controller/control/search-bar/search-bar-filter.controller.d.ts +65 -0
- package/out/controller/control/search-bar/search-bar-filter.controller.d.ts.map +1 -0
- package/out/controller/control/search-bar/search-bar-filter.controller.js +48 -0
- package/out/controller/control/search-bar/search-bar.controller.d.ts +63 -4
- package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
- package/out/controller/control/search-bar/search-bar.controller.js +143 -9
- package/out/controller/utils/value-rule/value-rule.d.ts +10 -1
- package/out/controller/utils/value-rule/value-rule.d.ts.map +1 -1
- package/out/controller/utils/value-rule/value-rule.js +64 -1
- package/out/engine/md-view.engine.d.ts.map +1 -1
- package/out/engine/md-view.engine.js +2 -23
- package/out/interface/controller/controller/control/i-medit-view-panel.controller.d.ts +14 -0
- package/out/interface/controller/controller/control/i-medit-view-panel.controller.d.ts.map +1 -0
- package/out/interface/controller/controller/control/i-medit-view-panel.controller.js +1 -0
- package/out/interface/controller/controller/control/i-search-bar.controller.d.ts +8 -0
- package/out/interface/controller/controller/control/i-search-bar.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/i-search-form.controller.d.ts +2 -2
- package/out/interface/controller/controller/control/i-search-form.controller.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.d.ts +1 -0
- package/out/interface/controller/controller/control/index.d.ts.map +1 -1
- package/out/interface/controller/controller/control/index.js +1 -0
- package/out/interface/controller/event/control/i-medit-view-panel.event.d.ts +9 -0
- package/out/interface/controller/event/control/i-medit-view-panel.event.d.ts.map +1 -0
- package/out/interface/controller/event/control/i-medit-view-panel.event.js +1 -0
- package/out/interface/controller/event/control/index.d.ts +1 -0
- package/out/interface/controller/event/control/index.d.ts.map +1 -1
- package/out/interface/controller/event/control/index.js +1 -0
- package/out/interface/controller/event/view/i-medit-view9.event.d.ts +10 -0
- package/out/interface/controller/event/view/i-medit-view9.event.d.ts.map +1 -0
- package/out/interface/controller/event/view/i-medit-view9.event.js +1 -0
- package/out/interface/controller/event/view/index.d.ts +1 -0
- package/out/interface/controller/event/view/index.d.ts.map +1 -1
- package/out/interface/controller/event/view/index.js +1 -0
- package/out/interface/controller/state/control/i-medit-view-panel.state.d.ts +29 -0
- package/out/interface/controller/state/control/i-medit-view-panel.state.d.ts.map +1 -0
- package/out/interface/controller/state/control/i-medit-view-panel.state.js +1 -0
- package/out/interface/controller/state/control/i-search-bar.state.d.ts +75 -0
- package/out/interface/controller/state/control/i-search-bar.state.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.d.ts +1 -0
- package/out/interface/controller/state/control/index.d.ts.map +1 -1
- package/out/interface/controller/state/control/index.js +1 -0
- package/out/interface/controller/state/view/i-medit-view9.state.d.ts +11 -0
- package/out/interface/controller/state/view/i-medit-view9.state.d.ts.map +1 -0
- package/out/interface/controller/state/view/i-medit-view9.state.js +1 -0
- package/out/interface/controller/state/view/index.d.ts +1 -0
- package/out/interface/controller/state/view/index.d.ts.map +1 -1
- package/out/interface/controller/state/view/index.js +1 -0
- package/out/service/service/entity/method/method.js +2 -2
- package/package.json +3 -3
- package/src/constant/index.ts +1 -0
- package/src/constant/value-op.ts +82 -0
- package/src/constant/view-call-tag.ts +4 -0
- package/src/controller/control/dashboard/portlet/portlet-part/portlet-part.controller.ts +2 -0
- package/src/controller/control/form/form-detail/form-item/form-item.controller.ts +22 -9
- package/src/controller/control/form/search-form/search-form.controller.ts +11 -3
- package/src/controller/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.controller.ts +18 -13
- package/src/controller/control/index.ts +1 -0
- package/src/controller/control/md-ctrl/md-ctrl.controller.ts +136 -3
- package/src/controller/control/medit-view-panel/index.ts +2 -0
- package/src/controller/control/medit-view-panel/medit-view-panel.controller.ts +375 -0
- package/src/controller/control/medit-view-panel/medit-view-panel.service.ts +10 -0
- package/src/controller/control/search-bar/search-bar-filter.controller.ts +112 -0
- package/src/controller/control/search-bar/search-bar.controller.ts +165 -9
- package/src/controller/utils/value-rule/value-rule.ts +97 -2
- package/src/engine/md-view.engine.ts +2 -27
- package/src/interface/controller/controller/control/i-medit-view-panel.controller.ts +17 -0
- package/src/interface/controller/controller/control/i-search-bar.controller.ts +10 -1
- package/src/interface/controller/controller/control/i-search-form.controller.ts +2 -2
- package/src/interface/controller/controller/control/index.ts +1 -0
- package/src/interface/controller/event/control/i-medit-view-panel.event.ts +9 -0
- package/src/interface/controller/event/control/index.ts +1 -0
- package/src/interface/controller/event/view/i-medit-view9.event.ts +10 -0
- package/src/interface/controller/event/view/index.ts +1 -0
- package/src/interface/controller/state/control/i-medit-view-panel.state.ts +36 -0
- package/src/interface/controller/state/control/i-search-bar.state.ts +86 -0
- package/src/interface/controller/state/control/index.ts +1 -0
- package/src/interface/controller/state/view/i-medit-view9.state.ts +10 -0
- package/src/interface/controller/state/view/index.ts +1 -0
- package/src/service/service/entity/method/method.ts +2 -2
package/dist/index.system.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["@ibiz-template/core","lodash-es","qx-util","qs","ramda","dayjs","dayjs/plugin/minMax","dayjs/plugin/isSameOrBefore","dayjs/plugin/quarterOfYear","dayjs/plugin/weekOfYear","dayjs/plugin/isoWeek","async-validator"],(function(t){"use strict";var e,a,s,i,n,r,o,c,l,h,d,u,p,m,f,g,w,E,v,y,I,D,C,A,b,P,S,x,_,T,L,N,O,M,R,V,k,F,W,B,U,z,j,G,H,K,X,Y,$,q,J,Q,Z,tt,et,at,st,it,nt,rt,ot,ct,lt,ht,dt;return{setters:[function(t){e=t.RuntimeError,a=t.RuntimeModelError,s=t.ModelError,i=t.IBizContext,n=t.DataTypes,r=t.HttpResponse,o=t.HttpError,c=t.CoreConst,l=t.Net,h=t.NOOP,d=t.NoticeError,u=t.isElementSame,p=t.findRecursiveChild,m=t.StringUtil,f=t.recursiveIterate,g=t.debounceAndAsyncMerge,w=t.mergeDefaultInLeft,E=t.isOverlap,v=t.awaitTimeout,y=t.mergeInLeft,I=t.toNumberOrNil},function(t){D=t.isEmpty,C=t.isString,A=t.isArray,b=t.isObject,P=t.debounce,S=t.camelCase,x=t.eq,_=t.gt,T=t.gte,L=t.findIndex,N=t.lt,O=t.lte,M=t.upperFirst,R=t.snakeCase,V=t.kebabCase,k=t.isFunction},function(t){F=t.notNilEmpty,W=t.isNilOrEmpty,B=t.AsyncSeriesHook,U=t.QXEvent,z=t.createUUID,j=t.isArray,G=t.setCookie,H=t.clearCookie,K=t.clearAll,X=t.ascSort,Y=t.descSort},function(t){$=t.default},function(t){q=t.isNil,J=t.mergeRight,Q=t.isEmpty,Z=t.clone,tt=t.equals,et=t.where,at=t.mergeLeft,st=t.isNotNil,it=t.mergeDeepRight},function(t){nt=t.default},function(t){rt=t.default},function(t){ot=t.default},function(t){ct=t.default},function(t){lt=t.default},function(t){ht=t.default},function(t){dt=t.default}],execute:function(){t({calcContentAlignStyle:function(t){const{valignSelf:e,halignSelf:a}=t;let s;if(e||a){switch(s={display:"flex"},e){case"TOP":Object.assign(s,{"align-items":"flex-start"});break;case"MIDDLE":Object.assign(s,{"align-items":"center"});break;case"BOTTOM":Object.assign(s,{"align-items":"flex-end"})}switch(a){case"LEFT":Object.assign(s,{"justify-content":"flex-start"});break;case"CENTER":Object.assign(s,{"justify-content":"center"});break;case"RIGHT":Object.assign(s,{"justify-content":"flex-end"});break;case"JUSTIFY":Object.assign(s,{"justify-content":"space-between"})}}return s},calcDeCodeNameById:He,calcDynaClass:ze,calcGridLayoutPos:function(t){const{layout:e,colXS:a,colXSOffset:s,colSM:i,colSMOffset:n,colMD:r,colMDOffset:o,colLG:c,colLGOffset:l}=t,h=(t,a)=>({span:(t&&-1!==t?t:"TABLE_24COL"===e?24:12)*("TABLE_24COL"===e?1:2),offset:a&&-1!==a?a:void 0});return{xs:h(a,s),sm:h(i,n),md:h(r,o),lg:h(c,l)}},calcLayoutHeightWidth:Ue,calcMainStateOPPrivsStrs:Ge,calcNavParams:Fe,calcResPath:xs,compare:la,compareNumber:ha,contains:da,convertNavData:Me,convertNavDataByArray:Ve,convertObjectToNavParams:Oe,execDELogic:hi,execDELogicAction:ui,execDELogicById:di,execFieldLogics:pi,execUILogic:tr,filterFieldLogics:$e,filterValueRules:La,findChildFormDetails:aa,findDELogic:Ye,findEditItem:ea,findFieldById:qe,findModelChild:We,formatMultiData:ke,generateRules:en,getAppCounterProvider:ws,getAppViewRef:function(t,e){var a,s;let i=t.appViewRefs||[];(null==(s=null==(a=t.viewLayoutPanel)?void 0:a.appViewRefs)?void 0:s.length)&&(i=i.concat(t.viewLayoutPanel.appViewRefs));return i.find((t=>t.name===e||t.id===e))},getChildNodeRSs:ta,getControl:function(t,e){var a,s;let i=t.controls||[];(null==(s=null==(a=t.viewLayoutPanel)?void 0:a.controls)?void 0:s.length)&&(i=i.concat(t.viewLayoutPanel.controls));return i.find((t=>t.name===e||t.codeName===e||t.id===e))},getControlProvider:Ka,getControlsByView:sa,getDeACMode:async function(t,e,a){var s;const i=await ibiz.hub.getAppDataEntity(e,a);return null==(s=i.appDEACModes)?void 0:s.find((e=>e.id===t))},getDefaultValue:sn,getEditorProvider:$a,getFormDetailProvider:Qa,getFormTypeFieldName:Xe,getGridColumnProvider:es,getMatchResPath:Ss,getOriginData:tn,getPanelItemProvider:is,getPortletProvider:ps,getRootNode:Qe,getTreeNode:Ze,getUIActionById:Je,getUIActionProvider:cs,getViewEngines:na,getViewLogics:ia,getViewProvider:async function(t){let e;const{viewType:a,viewStyle:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await ja(i,n);if(t&&(e=hs(t)),e)return e;ibiz.log.error("找不到视图插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=hs("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到视图类型:[".concat(a,"]的视图样式:[").concat(s,"]对应的适配器"),t)}e||(e=hs(a));e||(e=hs("DEFAULT"));return e},getWFContext:Ia,getWFSubmitViewId:function(t,e){var a;const{type:s,sequenceflowview:i,sequenceflowmobview:n}=e,r=(null==(a=t.viewLayoutPanel)?void 0:a.appViewRefs)||t.appViewRefs,o=s?"WFUTILACTION@".concat(s.toUpperCase()):"WFACTION@".concat(ibiz.env.isMob?n:i),c=null==r?void 0:r.find((t=>-1!==t.name.indexOf(o)));return null==c?void 0:c.refAppViewId},handleAllSettled:Ma,hasDeCodeName:Ke,install:function(){const{ibiz:t}=window;t.util=new ro,t.hub=new eo,t.register=new he,t.config=new le,t.auth=new Ci,t.engine=new ao,Ri(),or(),Is(),ibiz.scheduler=new go,ibiz.scheduler.triggerFactory.register("ITEMVISIBLE",((t,e)=>new vo(t,e))),ibiz.scheduler.triggerFactory.register("ITEMENABLE",((t,e)=>new vo(t,e))),ibiz.scheduler.triggerFactory.register("ITEMBLANK",((t,e)=>new vo(t,e))),ibiz.scheduler.triggerFactory.register("TIMER",((t,e)=>new yo(t,e))),ibiz.scheduler.triggerFactory.register("CUSTOM",((t,e)=>new Eo(t,e))),ibiz.scheduler.triggerFactory.register("VIEWEVENT",((t,e)=>new Do(t,e))),ibiz.scheduler.triggerFactory.register("CTRLEVENT",((t,e)=>new Co(t,e))),ibiz.scheduler.executorFactory.register("SCRIPT",((t,e)=>new lo(t,e))),ibiz.scheduler.executorFactory.register("APPDEUILOGIC",((t,e)=>new ho(t,e))),ibiz.scheduler.executorFactory.register("DEUILOGIC",((t,e)=>new ho(t,e))),ibiz.scheduler.executorFactory.register("APPUILOGIC",((t,e)=>new Io(t,e))),ibiz.scheduler.executorFactory.register("APPDEUIACTION",((t,e)=>new Ao(t,e)))},installCommand:Ri,isDataContainer:function(t){return"CONTAINER"===t.itemType&&["CONTAINER_MULTIDATA","CONTAINER_SINGLEDATA"].includes(t.predefinedType)},isValueChange:Zi,matchMainState:je,openRedirectView:ra,parseUserParams:Be,presetAppCounterProvider:Is,presetUIActionProvider:or,registerAppCounterProvider:fs,registerControlProvider:function(t,e){ibiz.register.register("".concat(Ga,"_").concat(t),e)},registerEditorProvider:function(t,e){ibiz.register.register("".concat(Xa,"_").concat(t),e)},registerFormDetailProvider:function(t,e){ibiz.register.register("".concat(qa,"_").concat(t),e)},registerGridColumnProvider:function(t,e){ibiz.register.register("".concat(Za,"_").concat(t),e)},registerPanelItemProvider:function(t,e){ibiz.register.register("".concat(as,"_").concat(t.toUpperCase()),e)},registerPortletProvider:function(t,e){ibiz.register.register("".concat(ds,"_").concat(t),e)},registerUIActionProvider:rs,registerViewProvider:function(t,e){ibiz.register.register("".concat(ls,"_").concat(t),e)},strContain:ua,testCond:ca,toLocalOpenWFRedirectView:oa,verifyDeRules:ga,verifyFormGroupLogic:Ea,verifyPanelGroupLogic:va});var ut=Object.create,pt=Object.defineProperty,mt=Object.getOwnPropertyDescriptor,ft=Object.getOwnPropertyNames,gt=Object.getPrototypeOf,wt=Object.prototype.hasOwnProperty,Et=(t,e)=>function(){return e||(0,t[ft(t)[0]])((e={exports:{}}).exports,e),e.exports},vt=(t,e,a)=>(a=null!=t?ut(gt(t)):{},((t,e,a,s)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of ft(e))wt.call(t,i)||i===a||pt(t,i,{get:()=>e[i],enumerable:!(s=mt(e,i))||s.enumerable});return t})(!e&&t&&t.__esModule?a:pt(a,"default",{value:t,enumerable:!0}),t)),yt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/utils.js"(t){t.__esModule=!0,t.extend=n,t.indexOf=function(t,e){for(var a=0,s=t.length;a<s;a++)if(t[a]===e)return a;return-1},t.escapeExpression=function(t){if("string"!=typeof t){if(t&&t.toHTML)return t.toHTML();if(null==t)return"";if(!t)return t+"";t=""+t}if(!s.test(t))return t;return t.replace(a,i)},t.isEmpty=function(t){return!t&&0!==t||!(!c(t)||0!==t.length)},t.createFrame=function(t){var e=n({},t);return e._parent=t,e},t.blockParams=function(t,e){return t.path=e,t},t.appendContextPath=function(t,e){return(t?t+".":"")+e};var e={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},a=/[&<>"'`=]/g,s=/[&<>"'`=]/;function i(t){return e[t]}function n(t){for(var e=1;e<arguments.length;e++)for(var a in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],a)&&(t[a]=arguments[e][a]);return t}var r=Object.prototype.toString;t.toString=r;var o=function(t){return"function"==typeof t};o(/x/)&&(t.isFunction=o=function(t){return"function"==typeof t&&"[object Function]"===r.call(t)}),t.isFunction=o;var c=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===r.call(t)};t.isArray=c}}),It=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/exception.js"(t,e){t.__esModule=!0;var a=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function s(t,e){var i=e&&e.loc,n=void 0,r=void 0,o=void 0,c=void 0;i&&(n=i.start.line,r=i.end.line,o=i.start.column,c=i.end.column,t+=" - "+n+":"+o);for(var l=Error.prototype.constructor.call(this,t),h=0;h<a.length;h++)this[a[h]]=l[a[h]];Error.captureStackTrace&&Error.captureStackTrace(this,s);try{i&&(this.lineNumber=n,this.endLineNumber=r,Object.defineProperty?(Object.defineProperty(this,"column",{value:o,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:c,enumerable:!0})):(this.column=o,this.endColumn=c))}catch(t){}}s.prototype=new Error,t.default=s,e.exports=t.default}}),Dt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js"(t,e){t.__esModule=!0;var a=yt();t.default=function(t){t.registerHelper("blockHelperMissing",(function(e,s){var i=s.inverse,n=s.fn;if(!0===e)return n(this);if(!1===e||null==e)return i(this);if(a.isArray(e))return e.length>0?(s.ids&&(s.ids=[s.name]),t.helpers.each(e,s)):i(this);if(s.data&&s.ids){var r=a.createFrame(s.data);r.contextPath=a.appendContextPath(s.data.contextPath,s.name),s={data:r}}return n(e,s)}))},e.exports=t.default}}),Ct=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js"(t,e){t.__esModule=!0;var a,s=yt(),i=It(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("each",(function(t,e){if(!e)throw new n.default("Must pass iterator to #each");var a,i=e.fn,r=e.inverse,o=0,c="",l=void 0,h=void 0;function d(e,a,n){l&&(l.key=e,l.index=a,l.first=0===a,l.last=!!n,h&&(l.contextPath=h+e)),c+=i(t[e],{data:l,blockParams:s.blockParams([t[e],e],[h+e,null])})}if(e.data&&e.ids&&(h=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(l=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var u=t.length;o<u;o++)o in t&&d(o,o,o===t.length-1);else if("function"==typeof Symbol&&t[Symbol.iterator]){for(var p=[],m=t[Symbol.iterator](),f=m.next();!f.done;f=m.next())p.push(f.value);for(u=(t=p).length;o<u;o++)d(o,o,o===t.length-1)}else a=void 0,Object.keys(t).forEach((function(t){void 0!==a&&d(a,o-1),a=t,o++})),void 0!==a&&d(a,o-1,!0);return 0===o&&(c=r(this)),c}))},e.exports=t.default}}),At=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js"(t,e){t.__esModule=!0;var a,s=It(),i=(a=s)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new i.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default}}),bt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js"(t,e){t.__esModule=!0;var a,s=yt(),i=It(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("if",(function(t,e){if(2!=arguments.length)throw new n.default("#if requires exactly one argument");return s.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||s.isEmpty(t)?e.inverse(this):e.fn(this)})),t.registerHelper("unless",(function(e,a){if(2!=arguments.length)throw new n.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:a.inverse,inverse:a.fn,hash:a.hash})}))},e.exports=t.default}}),Pt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/log.js"(t,e){t.__esModule=!0,t.default=function(t){t.registerHelper("log",(function(){for(var e=[void 0],a=arguments[arguments.length-1],s=0;s<arguments.length-1;s++)e.push(arguments[s]);var i=1;null!=a.hash.level?i=a.hash.level:a.data&&null!=a.data.level&&(i=a.data.level),e[0]=i,t.log.apply(t,e)}))},e.exports=t.default}}),St=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js"(t,e){t.__esModule=!0,t.default=function(t){t.registerHelper("lookup",(function(t,e,a){return t?a.lookupProperty(t,e):t}))},e.exports=t.default}}),xt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js"(t,e){t.__esModule=!0;var a,s=yt(),i=It(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("with",(function(t,e){if(2!=arguments.length)throw new n.default("#with requires exactly one argument");s.isFunction(t)&&(t=t.call(this));var a=e.fn;if(s.isEmpty(t))return e.inverse(this);var i=e.data;return e.data&&e.ids&&((i=s.createFrame(e.data)).contextPath=s.appendContextPath(e.data.contextPath,e.ids[0])),a(t,{data:i,blockParams:s.blockParams([t],[i&&i.contextPath])})}))},e.exports=t.default}}),_t=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.registerDefaultHelpers=function(t){a.default(t),s.default(t),i.default(t),n.default(t),r.default(t),o.default(t),c.default(t)},t.moveHelperToHooks=function(t,e,a){t.helpers[e]&&(t.hooks[e]=t.helpers[e],a||delete t.helpers[e])};var a=e(Dt()),s=e(Ct()),i=e(At()),n=e(bt()),r=e(Pt()),o=e(St()),c=e(xt())}}),Tt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js"(t,e){t.__esModule=!0;var a=yt();t.default=function(t){t.registerDecorator("inline",(function(t,e,s,i){var n=t;return e.partials||(e.partials={},n=function(i,n){var r=s.partials;s.partials=a.extend({},r,e.partials);var o=t(i,n);return s.partials=r,o}),e.partials[i.args[0]]=i.fn,n}))},e.exports=t.default}}),Lt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators.js"(t){t.__esModule=!0,t.registerDefaultDecorators=function(t){s.default(t)};var e,a=Tt(),s=(e=a)&&e.__esModule?e:{default:e}}}),Nt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/logger.js"(t,e){t.__esModule=!0;var a=yt(),s={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if("string"==typeof t){var e=a.indexOf(s.methodMap,t.toLowerCase());t=e>=0?e:parseInt(t,10)}return t},log:function(t){if(t=s.lookupLevel(t),"undefined"!=typeof console&&s.lookupLevel(s.level)<=t){var e=s.methodMap[t];console[e]||(e="log");for(var a=arguments.length,i=Array(a>1?a-1:0),n=1;n<a;n++)i[n-1]=arguments[n];console[e].apply(console,i)}}};t.default=s,e.exports=t.default}}),Ot=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js"(t){t.__esModule=!0,t.createNewLookupObject=function(){for(var t=arguments.length,a=Array(t),s=0;s<t;s++)a[s]=arguments[s];return e.extend.apply(void 0,[Object.create(null)].concat(a))};var e=yt()}}),Mt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js"(t){t.__esModule=!0,t.createProtoAccessControl=function(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var s=Object.create(null);return s.__proto__=!1,{properties:{whitelist:a.createNewLookupObject(s,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:a.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(t,e,a){return r("function"==typeof t?e.methods:e.properties,a)},t.resetLoggedProperties=function(){Object.keys(n).forEach((function(t){delete n[t]}))};var e,a=Ot(),s=Nt(),i=(e=s)&&e.__esModule?e:{default:e},n=Object.create(null);function r(t,e){return void 0!==t.whitelist[e]?!0===t.whitelist[e]:void 0!==t.defaultValue?t.defaultValue:(function(t){!0!==n[t]&&(n[t]=!0,i.default.log("error",'Handlebars: Access has been denied to resolve the property "'+t+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(e),!1)}}}),Rt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/base.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.HandlebarsEnvironment=l;var a=yt(),s=e(It()),i=_t(),n=Lt(),r=e(Nt()),o=Mt();t.VERSION="4.7.8";t.COMPILER_REVISION=8;t.LAST_COMPATIBLE_COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";function l(t,e,a){this.helpers=t||{},this.partials=e||{},this.decorators=a||{},i.registerDefaultHelpers(this),n.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:r.default,log:r.default.log,registerHelper:function(t,e){if(a.toString.call(t)===c){if(e)throw new s.default("Arg not supported with multiple helpers");a.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(a.toString.call(t)===c)a.extend(this.partials,t);else{if(void 0===e)throw new s.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(a.toString.call(t)===c){if(e)throw new s.default("Arg not supported with multiple decorators");a.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){o.resetLoggedProperties()}};var h=r.default.log;t.log=h,t.createFrame=a.createFrame,t.logger=r.default}}),Vt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(t,e){function a(t){this.string=t}t.__esModule=!0,a.prototype.toString=a.prototype.toHTML=function(){return""+this.string},t.default=a,e.exports=t.default}}),kt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js"(t){t.__esModule=!0,t.wrapHelper=function(t,e){if("function"!=typeof t)return t;return function(){return arguments[arguments.length-1]=e(arguments[arguments.length-1]),t.apply(this,arguments)}}}}),Ft=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/runtime.js"(t){t.__esModule=!0,t.checkRevision=function(t){var e=t&&t[0]||1,a=n.COMPILER_REVISION;if(e>=n.LAST_COMPATIBLE_COMPILER_REVISION&&e<=n.COMPILER_REVISION)return;if(e<n.LAST_COMPATIBLE_COMPILER_REVISION){var s=n.REVISION_CHANGES[a],r=n.REVISION_CHANGES[e];throw new i.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+s+") or downgrade your runtime to an older version ("+r+").")}throw new i.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")},t.template=function(t,e){if(!e)throw new i.default("No environment passed to template");if(!t||!t.main)throw new i.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var s=t.compiler&&7===t.compiler[0];var h={strict:function(t,e,a){if(!t||!(e in t))throw new i.default('"'+e+'" not defined in '+t,{loc:a});return h.lookupProperty(t,e)},lookupProperty:function(t,e){var a=t[e];return null==a||Object.prototype.hasOwnProperty.call(t,e)||c.resultIsAllowed(a,h.protoAccessControl,e)?a:void 0},lookup:function(t,e){for(var a=t.length,s=0;s<a;s++){if(null!=(t[s]&&h.lookupProperty(t[s],e)))return t[s][e]}},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:a.escapeExpression,invokePartial:function(s,n,r){r.hash&&(n=a.extend({},n,r.hash),r.ids&&(r.ids[0]=!0)),s=e.VM.resolvePartial.call(this,s,n,r);var o=a.extend({},r,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),c=e.VM.invokePartial.call(this,s,n,o);if(null==c&&e.compile&&(r.partials[r.name]=e.compile(s,t.compilerOptions,e),c=r.partials[r.name](n,o)),null!=c){if(r.indent){for(var l=c.split("\n"),h=0,d=l.length;h<d&&(l[h]||h+1!==d);h++)l[h]=r.indent+l[h];c=l.join("\n")}return c}throw new i.default("The partial "+r.name+" could not be compiled when running in runtime-only mode")},fn:function(e){var a=t[e];return a.decorator=t[e+"_d"],a},programs:[],program:function(t,e,a,s,i){var n=this.programs[t],r=this.fn(t);return e||i||s||a?n=l(this,t,r,e,a,s,i):n||(n=this.programs[t]=l(this,t,r)),n},data:function(t,e){for(;t&&e--;)t=t._parent;return t},mergeIfNeeded:function(t,e){var s=t||e;return t&&e&&t!==e&&(s=a.extend({},e,t)),s},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:t.compiler};function u(e){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=a.data;u._setup(a),!a.partial&&t.useData&&(s=function(t,e){e&&"root"in e||((e=e?n.createFrame(e):{}).root=t);return e}(e,s));var i=void 0,r=t.useBlockParams?[]:void 0;function o(e){return""+t.main(h,e,h.helpers,h.partials,s,r,i)}return t.useDepths&&(i=a.depths?e!=a.depths[0]?[e].concat(a.depths):a.depths:[e]),(o=d(t.main,o,h,a.depths||[],s,r))(e,a)}return u.isTop=!0,u._setup=function(i){if(i.partial)h.protoAccessControl=i.protoAccessControl,h.helpers=i.helpers,h.partials=i.partials,h.decorators=i.decorators,h.hooks=i.hooks;else{var n=a.extend({},e.helpers,i.helpers);!function(t,e){Object.keys(t).forEach((function(s){var i=t[s];t[s]=function(t,e){var s=e.lookupProperty;return o.wrapHelper(t,(function(t){return a.extend({lookupProperty:s},t)}))}(i,e)}))}(n,h),h.helpers=n,t.usePartial&&(h.partials=h.mergeIfNeeded(i.partials,e.partials)),(t.usePartial||t.useDecorators)&&(h.decorators=a.extend({},e.decorators,i.decorators)),h.hooks={},h.protoAccessControl=c.createProtoAccessControl(i);var l=i.allowCallsToHelperMissing||s;r.moveHelperToHooks(h,"helperMissing",l),r.moveHelperToHooks(h,"blockHelperMissing",l)}},u._child=function(e,a,s,n){if(t.useBlockParams&&!s)throw new i.default("must pass block params");if(t.useDepths&&!n)throw new i.default("must pass parent depths");return l(h,e,t[e],a,0,s,n)},u},t.wrapProgram=l,t.resolvePartial=function(t,e,a){t?t.call||a.name||(a.name=t,t=a.partials[t]):t="@partial-block"===a.name?a.data["partial-block"]:a.partials[a.name];return t},t.invokePartial=function(t,e,s){var r=s.data&&s.data["partial-block"];s.partial=!0,s.ids&&(s.data.contextPath=s.ids[0]||s.data.contextPath);var o=void 0;s.fn&&s.fn!==h&&function(){s.data=n.createFrame(s.data);var t=s.fn;o=s.data["partial-block"]=function(e){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a.data=n.createFrame(a.data),a.data["partial-block"]=r,t(e,a)},t.partials&&(s.partials=a.extend({},s.partials,t.partials))}();void 0===t&&o&&(t=o);if(void 0===t)throw new i.default("The partial "+s.name+" could not be found");if(t instanceof Function)return t(e,s)},t.noop=h;var e,a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}(yt()),s=It(),i=(e=s)&&e.__esModule?e:{default:e},n=Rt(),r=_t(),o=kt(),c=Mt();function l(t,e,a,s,i,n,r){function o(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=r;return!r||e==r[0]||e===t.nullContext&&null===r[0]||(o=[e].concat(r)),a(t,e,t.helpers,t.partials,i.data||s,n&&[i.blockParams].concat(n),o)}return(o=d(a,o,t,r,s,n)).program=e,o.depth=r?r.length:0,o.blockParams=i||0,o}function h(){return""}function d(t,e,s,i,n,r){if(t.decorator){var o={};e=t.decorator(e,o,s,i&&i[0],n,r,i),a.extend(e,o)}return e}}}),Wt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js"(t,e){t.__esModule=!0,t.default=function(t){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var e=globalThis.Handlebars;t.noConflict=function(){return globalThis.Handlebars===t&&(globalThis.Handlebars=e),t}},e.exports=t.default}}),Bt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.runtime.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}t.__esModule=!0;var i=s(Rt()),n=a(Vt()),r=a(It()),o=s(yt()),c=s(Ft()),l=a(Wt());function h(){var t=new i.HandlebarsEnvironment;return o.extend(t,i),t.SafeString=n.default,t.Exception=r.default,t.Utils=o,t.escapeExpression=o.escapeExpression,t.VM=c,t.template=function(e){return c.template(e,t)},t}var d=h();d.create=h,l.default(d),d.default=d,t.default=d,e.exports=t.default}}),Ut=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js"(t,e){t.__esModule=!0;var a={helpers:{helperExpression:function(t){return"SubExpression"===t.type||("MustacheStatement"===t.type||"BlockStatement"===t.type)&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return 1===t.parts.length&&!a.helpers.scopedId(t)&&!t.depth}}};t.default=a,e.exports=t.default}}),zt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js"(t,e){t.__esModule=!0;var a=function(){var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(t,e,a,s,i,n,r){var o=n.length-1;switch(i){case 1:return n[o-1];case 2:this.$=s.prepareProgram(n[o]);break;case 3:case 4:case 5:case 6:case 7:case 8:case 20:case 27:case 28:case 33:case 34:case 40:case 41:this.$=n[o];break;case 9:this.$={type:"CommentStatement",value:s.stripComment(n[o]),strip:s.stripFlags(n[o],n[o]),loc:s.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:n[o],value:n[o],loc:s.locInfo(this._$)};break;case 11:this.$=s.prepareRawBlock(n[o-2],n[o-1],n[o],this._$);break;case 12:this.$={path:n[o-3],params:n[o-2],hash:n[o-1]};break;case 13:this.$=s.prepareBlock(n[o-3],n[o-2],n[o-1],n[o],!1,this._$);break;case 14:this.$=s.prepareBlock(n[o-3],n[o-2],n[o-1],n[o],!0,this._$);break;case 15:this.$={open:n[o-5],path:n[o-4],params:n[o-3],hash:n[o-2],blockParams:n[o-1],strip:s.stripFlags(n[o-5],n[o])};break;case 16:case 17:this.$={path:n[o-4],params:n[o-3],hash:n[o-2],blockParams:n[o-1],strip:s.stripFlags(n[o-5],n[o])};break;case 18:this.$={strip:s.stripFlags(n[o-1],n[o-1]),program:n[o]};break;case 19:var c=s.prepareBlock(n[o-2],n[o-1],n[o],n[o],!1,this._$),l=s.prepareProgram([c],n[o-1].loc);l.chained=!0,this.$={strip:n[o-2].strip,program:l,chain:!0};break;case 21:this.$={path:n[o-1],strip:s.stripFlags(n[o-2],n[o])};break;case 22:case 23:this.$=s.prepareMustache(n[o-3],n[o-2],n[o-1],n[o-4],s.stripFlags(n[o-4],n[o]),this._$);break;case 24:this.$={type:"PartialStatement",name:n[o-3],params:n[o-2],hash:n[o-1],indent:"",strip:s.stripFlags(n[o-4],n[o]),loc:s.locInfo(this._$)};break;case 25:this.$=s.preparePartialBlock(n[o-2],n[o-1],n[o],this._$);break;case 26:this.$={path:n[o-3],params:n[o-2],hash:n[o-1],strip:s.stripFlags(n[o-4],n[o])};break;case 29:this.$={type:"SubExpression",path:n[o-3],params:n[o-2],hash:n[o-1],loc:s.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:n[o],loc:s.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:s.id(n[o-2]),value:n[o],loc:s.locInfo(this._$)};break;case 32:this.$=s.id(n[o-1]);break;case 35:this.$={type:"StringLiteral",value:n[o],original:n[o],loc:s.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(n[o]),original:Number(n[o]),loc:s.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===n[o],original:"true"===n[o],loc:s.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:s.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:s.locInfo(this._$)};break;case 42:this.$=s.preparePath(!0,n[o],this._$);break;case 43:this.$=s.preparePath(!1,n[o],this._$);break;case 44:n[o-2].push({part:s.id(n[o]),original:n[o],separator:n[o-1]}),this.$=n[o-2];break;case 45:this.$=[{part:s.id(n[o]),original:n[o]}];break;case 46:case 48:case 50:case 58:case 64:case 70:case 78:case 82:case 86:case 90:case 94:this.$=[];break;case 47:case 49:case 51:case 59:case 65:case 71:case 79:case 83:case 87:case 91:case 95:case 99:case 101:n[o-1].push(n[o]);break;case 98:case 100:this.$=[n[o]]}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,a=[0],s=[null],i=[],n=this.table,r="",o=0,c=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;i.push(l);var h=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,u,p,m,f,g,w,E,v,y={};;){if(u=a[a.length-1],this.defaultActions[u]?p=this.defaultActions[u]:(null==d&&(v=void 0,"number"!=typeof(v=e.lexer.lex()||1)&&(v=e.symbols_[v]||v),d=v),p=n[u]&&n[u][d]),void 0===p||!p.length||!p[0]){var I="";for(f in E=[],n[u])this.terminals_[f]&&f>2&&E.push("'"+this.terminals_[f]+"'");I=this.lexer.showPosition?"Parse error on line "+(o+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(I,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:l,expected:E})}if(p[0]instanceof Array&&p.length>1)throw new Error("Parse Error: multiple actions possible at state: "+u+", token: "+d);switch(p[0]){case 1:a.push(d),s.push(this.lexer.yytext),i.push(this.lexer.yylloc),a.push(p[1]),d=null,c=this.lexer.yyleng,r=this.lexer.yytext,o=this.lexer.yylineno,l=this.lexer.yylloc;break;case 2:if(g=this.productions_[p[1]][1],y.$=s[s.length-g],y._$={first_line:i[i.length-(g||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(g||1)].first_column,last_column:i[i.length-1].last_column},h&&(y._$.range=[i[i.length-(g||1)].range[0],i[i.length-1].range[1]]),void 0!==(m=this.performAction.call(y,r,c,o,this.yy,p[1],s,i)))return m;g&&(a=a.slice(0,-1*g*2),s=s.slice(0,-1*g),i=i.slice(0,-1*g)),a.push(this.productions_[p[1]][0]),s.push(y.$),i.push(y._$),w=n[a[a.length-2]][a[a.length-1]],a.push(w);break;case 3:return!0}}return!0}},e={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===s.length?this.yylloc.first_column:0)+s[s.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,a,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length&&(!(a=this._input.match(this.rules[n[r]]))||e&&!(a[0].length>e[0].length)||(e=a,s=r,this.options.flex));r++);return e?((i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,n[s],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,a,s){function i(t,a){return e.yytext=e.yytext.substring(t,e.yyleng-a+t)}switch(a){case 0:if("\\\\"===e.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),e.yytext)return 15;break;case 1:case 5:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(i(5,9),"END_RAW_BLOCK");case 6:case 22:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:case 23:return 48;case 21:this.unput(e.yytext),this.popState(),this.begin("com");break;case 24:return 73;case 25:case 26:case 41:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return e.yytext=i(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=i(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 42:return e.yytext=e.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};function a(){this.yy={}}return t.lexer=e,a.prototype=t,t.Parser=a,new a}();t.default=a,e.exports=t.default}}),jt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js"(t,e){t.__esModule=!0;var a,s=It(),i=(a=s)&&a.__esModule?a:{default:a};function n(){this.parents=[]}function r(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function o(t){r.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function c(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}n.prototype={constructor:n,mutating:!1,acceptKey:function(t,e){var a=this.accept(t[e]);if(this.mutating){if(a&&!n.prototype[a.type])throw new i.default('Unexpected node type "'+a.type+'" found when accepting '+e+" on "+t.type);t[e]=a}},acceptRequired:function(t,e){if(this.acceptKey(t,e),!t[e])throw new i.default(t.type+" requires "+e)},acceptArray:function(t){for(var e=0,a=t.length;e<a;e++)this.acceptKey(t,e),t[e]||(t.splice(e,1),e--,a--)},accept:function(t){if(t){if(!this[t.type])throw new i.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var e=this[t.type](t);return this.current=this.parents.shift(),!this.mutating||e?e:!1!==e?t:void 0}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:r,Decorator:r,BlockStatement:o,DecoratorBlock:o,PartialStatement:c,PartialBlockStatement:function(t){c.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:r,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}},t.default=n,e.exports=t.default}}),Gt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js"(t,e){t.__esModule=!0;var a,s=jt(),i=(a=s)&&a.__esModule?a:{default:a};function n(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=t}function r(t,e,a){void 0===e&&(e=t.length);var s=t[e-1],i=t[e-2];return s?"ContentStatement"===s.type?(i||!a?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(s.original):void 0:a}function o(t,e,a){void 0===e&&(e=-1);var s=t[e+1],i=t[e+2];return s?"ContentStatement"===s.type?(i||!a?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(s.original):void 0:a}function c(t,e,a){var s=t[null==e?0:e+1];if(s&&"ContentStatement"===s.type&&(a||!s.rightStripped)){var i=s.value;s.value=s.value.replace(a?/^\s+/:/^[ \t]*\r?\n?/,""),s.rightStripped=s.value!==i}}function l(t,e,a){var s=t[null==e?t.length-1:e-1];if(s&&"ContentStatement"===s.type&&(a||!s.leftStripped)){var i=s.value;return s.value=s.value.replace(a?/\s+$/:/[ \t]+$/,""),s.leftStripped=s.value!==i,s.leftStripped}}n.prototype=new i.default,n.prototype.Program=function(t){var e=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var s=t.body,i=0,n=s.length;i<n;i++){var h=s[i],d=this.accept(h);if(d){var u=r(s,i,a),p=o(s,i,a),m=d.openStandalone&&u,f=d.closeStandalone&&p,g=d.inlineStandalone&&u&&p;d.close&&c(s,i,!0),d.open&&l(s,i,!0),e&&g&&(c(s,i),l(s,i)&&"PartialStatement"===h.type&&(h.indent=/([ \t]+$)/.exec(s[i-1].original)[1])),e&&m&&(c((h.program||h.inverse).body),l(s,i)),e&&f&&(c(s,i),l((h.inverse||h.program).body))}}return t},n.prototype.BlockStatement=n.prototype.DecoratorBlock=n.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,a=t.program&&t.inverse,s=a,i=a;if(a&&a.chained)for(s=a.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var n={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:o(e.body),closeStandalone:r((s||e).body)};if(t.openStrip.close&&c(e.body,null,!0),a){var h=t.inverseStrip;h.open&&l(e.body,null,!0),h.close&&c(s.body,null,!0),t.closeStrip.open&&l(i.body,null,!0),!this.options.ignoreStandalone&&r(e.body)&&o(s.body)&&(l(e.body),c(s.body))}else t.closeStrip.open&&l(e.body,null,!0);return n},n.prototype.Decorator=n.prototype.MustacheStatement=function(t){return t.strip},n.prototype.PartialStatement=n.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}},t.default=n,e.exports=t.default}}),Ht=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js"(t){t.__esModule=!0,t.SourceLocation=function(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}},t.id=function(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t},t.stripFlags=function(t,e){return{open:"~"===t.charAt(2),close:"~"===e.charAt(e.length-3)}},t.stripComment=function(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")},t.preparePath=function(t,e,a){a=this.locInfo(a);for(var i=t?"@":"",n=[],r=0,o=0,c=e.length;o<c;o++){var l=e[o].part,h=e[o].original!==l;if(i+=(e[o].separator||"")+l,h||".."!==l&&"."!==l&&"this"!==l)n.push(l);else{if(n.length>0)throw new s.default("Invalid path: "+i,{loc:a});".."===l&&r++}}return{type:"PathExpression",data:t,depth:r,parts:n,original:i,loc:a}},t.prepareMustache=function(t,e,a,s,i,n){var r=s.charAt(3)||s.charAt(2),o="{"!==r&&"&"!==r;return{type:/\*/.test(s)?"Decorator":"MustacheStatement",path:t,params:e,hash:a,escaped:o,strip:i,loc:this.locInfo(n)}},t.prepareRawBlock=function(t,e,a,s){i(t,a),s=this.locInfo(s);var n={type:"Program",body:e,strip:{},loc:s};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:n,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}},t.prepareBlock=function(t,e,a,n,r,o){n&&n.path&&i(t,n);var c=/\*/.test(t.open);e.blockParams=t.blockParams;var l=void 0,h=void 0;if(a){if(c)throw new s.default("Unexpected inverse block on decorator",a);a.chain&&(a.program.body[0].closeStrip=n.strip),h=a.strip,l=a.program}r&&(r=l,l=e,e=r);return{type:c?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:l,openStrip:t.strip,inverseStrip:h,closeStrip:n&&n.strip,loc:this.locInfo(o)}},t.prepareProgram=function(t,e){if(!e&&t.length){var a=t[0].loc,s=t[t.length-1].loc;a&&s&&(e={source:a.source,start:{line:a.start.line,column:a.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:t,strip:{},loc:e}},t.preparePartialBlock=function(t,e,a,s){return i(t,a),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:a&&a.strip,loc:this.locInfo(s)}};var e,a=It(),s=(e=a)&&e.__esModule?e:{default:e};function i(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var a={loc:t.path.loc};throw new s.default(t.path.original+" doesn't match "+e,a)}}}}),Kt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.parseWithoutProcessing=o,t.parse=function(t,e){var a=o(t,e);return new s.default(e).accept(a)};var a=e(zt()),s=e(Gt()),i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}(Ht()),n=yt();t.parser=a.default;var r={};function o(t,e){return"Program"===t.type?t:(a.default.yy=r,r.locInfo=function(t){return new r.SourceLocation(e&&e.srcName,t)},a.default.parse(t))}n.extend(r,i)}}),Xt=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.Compiler=r,t.precompile=function(t,e,s){if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new a.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);"data"in(e=e||{})||(e.data=!0);e.compat&&(e.useDepths=!0);var i=s.parse(t,e),n=(new s.Compiler).compile(i,e);return(new s.JavaScriptCompiler).compile(n,e)},t.compile=function(t,e,i){void 0===e&&(e={});if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new a.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);"data"in(e=s.extend({},e))||(e.data=!0);e.compat&&(e.useDepths=!0);var n=void 0;function r(){var a=i.parse(t,e),s=(new i.Compiler).compile(a,e),n=(new i.JavaScriptCompiler).compile(s,e,void 0,!0);return i.template(n)}function o(t,e){return n||(n=r()),n.call(this,t,e)}return o._setup=function(t){return n||(n=r()),n._setup(t)},o._child=function(t,e,a,s){return n||(n=r()),n._child(t,e,a,s)},o};var a=e(It()),s=yt(),i=e(Ut()),n=[].slice;function r(){}function o(t,e){if(t===e)return!0;if(s.isArray(t)&&s.isArray(e)&&t.length===e.length){for(var a=0;a<t.length;a++)if(!o(t[a],e[a]))return!1;return!0}}function c(t){if(!t.path.parts){var e=t.path;t.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}r.prototype={compiler:r,equals:function(t){var e=this.opcodes.length;if(t.opcodes.length!==e)return!1;for(var a=0;a<e;a++){var s=this.opcodes[a],i=t.opcodes[a];if(s.opcode!==i.opcode||!o(s.args,i.args))return!1}e=this.children.length;for(a=0;a<e;a++)if(!this.children[a].equals(t.children[a]))return!1;return!0},guid:0,compile:function(t,e){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=e,this.stringParams=e.stringParams,this.trackIds=e.trackIds,e.blockParams=e.blockParams||[],e.knownHelpers=s.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},e.knownHelpers),this.accept(t)},compileProgram:function(t){var e=(new this.compiler).compile(t,this.options),a=this.guid++;return this.usePartial=this.usePartial||e.usePartial,this.children[a]=e,this.useDepths=this.useDepths||e.useDepths,a},accept:function(t){if(!this[t.type])throw new a.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var e=this[t.type](t);return this.sourceNode.shift(),e},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var e=t.body,a=e.length,s=0;s<a;s++)this.accept(e[s]);return this.options.blockParams.shift(),this.isSimple=1===a,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){c(t);var e=t.program,a=t.inverse;e=e&&this.compileProgram(e),a=a&&this.compileProgram(a);var s=this.classifySexpr(t);"helper"===s?this.helperSexpr(t,e,a):"simple"===s?(this.simpleSexpr(t),this.opcode("pushProgram",e),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,e,a),this.opcode("pushProgram",e),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var e=t.program&&this.compileProgram(t.program),a=this.setupFullMustacheParams(t,e,void 0),s=t.path;this.useDecorators=!0,this.opcode("registerDecorator",a.length,s.original)},PartialStatement:function(t){this.usePartial=!0;var e=t.program;e&&(e=this.compileProgram(t.program));var s=t.params;if(s.length>1)throw new a.default("Unsupported number of partial arguments: "+s.length,t);s.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):s.push({type:"PathExpression",parts:[],depth:0}));var i=t.name.original,n="SubExpression"===t.name.type;n&&this.accept(t.name),this.setupFullMustacheParams(t,e,void 0,!0);var r=t.indent||"";this.options.preventIndent&&r&&(this.opcode("appendContent",r),r=""),this.opcode("invokePartial",n,i,r),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){c(t);var e=this.classifySexpr(t);"simple"===e?this.simpleSexpr(t):"helper"===e?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,e,a){var s=t.path,i=s.parts[0],n=null!=e||null!=a;this.opcode("getContext",s.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",a),s.strict=!0,this.accept(s),this.opcode("invokeAmbiguous",i,n)},simpleSexpr:function(t){var e=t.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,e,s){var n=this.setupFullMustacheParams(t,e,s),r=t.path,o=r.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",n.length,o);else{if(this.options.knownHelpersOnly)throw new a.default("You specified knownHelpersOnly, but used the unknown helper "+o,t);r.strict=!0,r.falsy=!0,this.accept(r),this.opcode("invokeHelper",n.length,r.original,i.default.helpers.simpleId(r))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var e=t.parts[0],a=i.default.helpers.scopedId(t),s=!t.depth&&!a&&this.blockParamIndex(e);s?this.opcode("lookupBlockParam",s,t.parts):e?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,a):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var e=t.pairs,a=0,s=e.length;for(this.opcode("pushHash");a<s;a++)this.pushParam(e[a].value);for(;a--;)this.opcode("assignToHash",e[a].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:n.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var e=i.default.helpers.simpleId(t.path),a=e&&!!this.blockParamIndex(t.path.parts[0]),s=!a&&i.default.helpers.helperExpression(t),n=!a&&(s||e);if(n&&!s){var r=t.path.parts[0],o=this.options;o.knownHelpers[r]?s=!0:o.knownHelpersOnly&&(n=!1)}return s?"helper":n?"ambiguous":"simple"},pushParams:function(t){for(var e=0,a=t.length;e<a;e++)this.pushParam(t[e])},pushParam:function(t){var e=null!=t.value?t.value:t.original||"";if(this.stringParams)e.replace&&(e=e.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",e,t.type),"SubExpression"===t.type&&this.accept(t);else{if(this.trackIds){var a=void 0;if(!t.parts||i.default.helpers.scopedId(t)||t.depth||(a=this.blockParamIndex(t.parts[0])),a){var s=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",a,s)}else(e=t.original||e).replace&&(e=e.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,e)}this.accept(t)}},setupFullMustacheParams:function(t,e,a,s){var i=t.params;return this.pushParams(i),this.opcode("pushProgram",e),this.opcode("pushProgram",a),t.hash?this.accept(t.hash):this.opcode("emptyHash",s),i},blockParamIndex:function(t){for(var e=0,a=this.options.blockParams.length;e<a;e++){var i=this.options.blockParams[e],n=i&&s.indexOf(i,t);if(i&&n>=0)return[e,n]}}}}}),Yt=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js"(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(t){if(0<=t&&t<e.length)return e[t];throw new TypeError("Must be between 0 and 63: "+t)},t.decode=function(t){return 65<=t&&t<=90?t-65:97<=t&&t<=122?t-97+26:48<=t&&t<=57?t-48+52:43==t?62:47==t?63:-1}}}),$t=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(t){var e=Yt();t.encode=function(t){var a,s="",i=function(t){return t<0?1+(-t<<1):0+(t<<1)}(t);do{a=31&i,(i>>>=5)>0&&(a|=32),s+=e.encode(a)}while(i>0);return s},t.decode=function(t,a,s){var i,n,r,o,c=t.length,l=0,h=0;do{if(a>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(n=e.decode(t.charCodeAt(a++))))throw new Error("Invalid base64 digit: "+t.charAt(a-1));i=!!(32&n),l+=(n&=31)<<h,h+=5}while(i);s.value=(o=(r=l)>>1,1==(1&r)?-o:o),s.rest=a}}}),qt=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js"(t){t.getArg=function(t,e,a){if(e in t)return t[e];if(3===arguments.length)return a;throw new Error('"'+e+'" is a required argument.')};var e=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,a=/^data:.+\,.+$/;function s(t){var a=t.match(e);return a?{scheme:a[1],auth:a[2],host:a[3],port:a[4],path:a[5]}:null}function i(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}function n(e){var a=e,n=s(e);if(n){if(!n.path)return e;a=n.path}for(var r,o=t.isAbsolute(a),c=a.split(/\/+/),l=0,h=c.length-1;h>=0;h--)"."===(r=c[h])?c.splice(h,1):".."===r?l++:l>0&&(""===r?(c.splice(h+1,l),l=0):(c.splice(h,2),l--));return""===(a=c.join("/"))&&(a=o?"/":"."),n?(n.path=a,i(n)):a}function r(t,e){""===t&&(t="."),""===e&&(e=".");var r=s(e),o=s(t);if(o&&(t=o.path||"/"),r&&!r.scheme)return o&&(r.scheme=o.scheme),i(r);if(r||e.match(a))return e;if(o&&!o.host&&!o.path)return o.host=e,i(o);var c="/"===e.charAt(0)?e:n(t.replace(/\/+$/,"")+"/"+e);return o?(o.path=c,i(o)):c}t.urlParse=s,t.urlGenerate=i,t.normalize=n,t.join=r,t.isAbsolute=function(t){return"/"===t.charAt(0)||e.test(t)},t.relative=function(t,e){""===t&&(t="."),t=t.replace(/\/$/,"");for(var a=0;0!==e.indexOf(t+"/");){var s=t.lastIndexOf("/");if(s<0)return e;if((t=t.slice(0,s)).match(/^([^\/]+:\/)?\/*$/))return e;++a}return Array(a+1).join("../")+e.substr(t.length+1)};var o=!("__proto__"in Object.create(null));function c(t){return t}function l(t){if(!t)return!1;var e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(var a=e-10;a>=0;a--)if(36!==t.charCodeAt(a))return!1;return!0}function h(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}t.toSetString=o?c:function(t){return l(t)?"$"+t:t},t.fromSetString=o?c:function(t){return l(t)?t.slice(1):t},t.compareByOriginalPositions=function(t,e,a){var s=h(t.source,e.source);return 0!==s||0!==(s=t.originalLine-e.originalLine)||0!==(s=t.originalColumn-e.originalColumn)||a||0!==(s=t.generatedColumn-e.generatedColumn)||0!==(s=t.generatedLine-e.generatedLine)?s:h(t.name,e.name)},t.compareByGeneratedPositionsDeflated=function(t,e,a){var s=t.generatedLine-e.generatedLine;return 0!==s||0!==(s=t.generatedColumn-e.generatedColumn)||a||0!==(s=h(t.source,e.source))||0!==(s=t.originalLine-e.originalLine)||0!==(s=t.originalColumn-e.originalColumn)?s:h(t.name,e.name)},t.compareByGeneratedPositionsInflated=function(t,e){var a=t.generatedLine-e.generatedLine;return 0!==a||0!==(a=t.generatedColumn-e.generatedColumn)||0!==(a=h(t.source,e.source))||0!==(a=t.originalLine-e.originalLine)||0!==(a=t.originalColumn-e.originalColumn)?a:h(t.name,e.name)},t.parseSourceMapInput=function(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(t,e,a){if(e=e||"",t&&("/"!==t[t.length-1]&&"/"!==e[0]&&(t+="/"),e=t+e),a){var o=s(a);if(!o)throw new Error("sourceMapURL could not be parsed");if(o.path){var c=o.path.lastIndexOf("/");c>=0&&(o.path=o.path.substring(0,c+1))}e=r(i(o),e)}return n(e)}}}),Jt=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js"(t){var e=qt(),a=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;function i(){this._array=[],this._set=s?new Map:Object.create(null)}i.fromArray=function(t,e){for(var a=new i,s=0,n=t.length;s<n;s++)a.add(t[s],e);return a},i.prototype.size=function(){return s?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(t,i){var n=s?t:e.toSetString(t),r=s?this.has(t):a.call(this._set,n),o=this._array.length;r&&!i||this._array.push(t),r||(s?this._set.set(t,o):this._set[n]=o)},i.prototype.has=function(t){if(s)return this._set.has(t);var i=e.toSetString(t);return a.call(this._set,i)},i.prototype.indexOf=function(t){if(s){var i=this._set.get(t);if(i>=0)return i}else{var n=e.toSetString(t);if(a.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')},i.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)},i.prototype.toArray=function(){return this._array.slice()},t.ArraySet=i}}),Qt=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js"(t){var e=qt();function a(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a.prototype.unsortedForEach=function(t,e){this._array.forEach(t,e)},a.prototype.add=function(t){var a,s,i,n,r,o;a=this._last,s=t,i=a.generatedLine,n=s.generatedLine,r=a.generatedColumn,o=s.generatedColumn,n>i||n==i&&o>=r||e.compareByGeneratedPositionsInflated(a,s)<=0?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))},a.prototype.toArray=function(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=a}}),Zt=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js"(t){var e=$t(),a=qt(),s=Jt().ArraySet,i=Qt().MappingList;function n(t){t||(t={}),this._file=a.getArg(t,"file",null),this._sourceRoot=a.getArg(t,"sourceRoot",null),this._skipValidation=a.getArg(t,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(t){var e=t.sourceRoot,s=new n({file:t.file,sourceRoot:e});return t.eachMapping((function(t){var i={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(i.source=t.source,null!=e&&(i.source=a.relative(e,i.source)),i.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(i.name=t.name)),s.addMapping(i)})),t.sources.forEach((function(i){var n=i;null!==e&&(n=a.relative(e,i)),s._sources.has(n)||s._sources.add(n);var r=t.sourceContentFor(i);null!=r&&s.setSourceContent(i,r)})),s},n.prototype.addMapping=function(t){var e=a.getArg(t,"generated"),s=a.getArg(t,"original",null),i=a.getArg(t,"source",null),n=a.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,s,i,n),null!=i&&(i=String(i),this._sources.has(i)||this._sources.add(i)),null!=n&&(n=String(n),this._names.has(n)||this._names.add(n)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:null!=s&&s.line,originalColumn:null!=s&&s.column,source:i,name:n})},n.prototype.setSourceContent=function(t,e){var s=t;null!=this._sourceRoot&&(s=a.relative(this._sourceRoot,s)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[a.toSetString(s)]=e):this._sourcesContents&&(delete this._sourcesContents[a.toSetString(s)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(t,e,i){var n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}var r=this._sourceRoot;null!=r&&(n=a.relative(r,n));var o=new s,c=new s;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){var s=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=s.source&&(e.source=s.source,null!=i&&(e.source=a.join(i,e.source)),null!=r&&(e.source=a.relative(r,e.source)),e.originalLine=s.line,e.originalColumn=s.column,null!=s.name&&(e.name=s.name))}var l=e.source;null==l||o.has(l)||o.add(l);var h=e.name;null==h||c.has(h)||c.add(h)}),this),this._sources=o,this._names=c,t.sources.forEach((function(e){var s=t.sourceContentFor(e);null!=s&&(null!=i&&(e=a.join(i,e)),null!=r&&(e=a.relative(r,e)),this.setSourceContent(e,s))}),this)},n.prototype._validateMapping=function(t,e,a,s){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0)||e||a||s)&&!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&a))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:a,original:e,name:s}))},n.prototype._serializeMappings=function(){for(var t,s,i,n,r=0,o=1,c=0,l=0,h=0,d=0,u="",p=this._mappings.toArray(),m=0,f=p.length;m<f;m++){if(t="",(s=p[m]).generatedLine!==o)for(r=0;s.generatedLine!==o;)t+=";",o++;else if(m>0){if(!a.compareByGeneratedPositionsInflated(s,p[m-1]))continue;t+=","}t+=e.encode(s.generatedColumn-r),r=s.generatedColumn,null!=s.source&&(n=this._sources.indexOf(s.source),t+=e.encode(n-d),d=n,t+=e.encode(s.originalLine-1-l),l=s.originalLine-1,t+=e.encode(s.originalColumn-c),c=s.originalColumn,null!=s.name&&(i=this._names.indexOf(s.name),t+=e.encode(i-h),h=i)),u+=t}return u},n.prototype._generateSourcesContent=function(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=a.relative(e,t));var s=a.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,s)?this._sourcesContents[s]:null}),this)},n.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=n}}),te=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js"(t){function e(a,s,i,n,r,o){var c=Math.floor((s-a)/2)+a,l=r(i,n[c],!0);return 0===l?c:l>0?s-c>1?e(c,s,i,n,r,o):o==t.LEAST_UPPER_BOUND?s<n.length?s:-1:c:c-a>1?e(a,c,i,n,r,o):o==t.LEAST_UPPER_BOUND?c:a<0?-1:a}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(a,s,i,n){if(0===s.length)return-1;var r=e(-1,s.length,a,s,i,n||t.GREATEST_LOWER_BOUND);if(r<0)return-1;for(;r-1>=0&&0===i(s[r],s[r-1],!0);)--r;return r}}}),ee=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(t){function e(t,e,a){var s=t[e];t[e]=t[a],t[a]=s}function a(t,s,i,n){if(i<n){var r=i-1;e(t,(h=i,d=n,Math.round(h+Math.random()*(d-h))),n);for(var o=t[n],c=i;c<n;c++)s(t[c],o)<=0&&e(t,r+=1,c);e(t,r+1,c);var l=r+1;a(t,s,i,l-1),a(t,s,l+1,n)}var h,d}t.quickSort=function(t,e){a(t,e,0,t.length-1)}}}),ae=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js"(t){var e=qt(),a=te(),s=Jt().ArraySet,i=$t(),n=ee().quickSort;function r(t,a){var s=t;return"string"==typeof t&&(s=e.parseSourceMapInput(t)),null!=s.sections?new l(s,a):new o(s,a)}function o(t,a){var i=t;"string"==typeof t&&(i=e.parseSourceMapInput(t));var n=e.getArg(i,"version"),r=e.getArg(i,"sources"),o=e.getArg(i,"names",[]),c=e.getArg(i,"sourceRoot",null),l=e.getArg(i,"sourcesContent",null),h=e.getArg(i,"mappings"),d=e.getArg(i,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=e.normalize(c)),r=r.map(String).map(e.normalize).map((function(t){return c&&e.isAbsolute(c)&&e.isAbsolute(t)?e.relative(c,t):t})),this._names=s.fromArray(o.map(String),!0),this._sources=s.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map((function(t){return e.computeSourceURL(c,t,a)})),this.sourceRoot=c,this.sourcesContent=l,this._mappings=h,this._sourceMapURL=a,this.file=d}function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function l(t,a){var i=t;"string"==typeof t&&(i=e.parseSourceMapInput(t));var n=e.getArg(i,"version"),o=e.getArg(i,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new s,this._names=new s;var c={line:-1,column:0};this._sections=o.map((function(t){if(t.url)throw new Error("Support for url field in sections not implemented.");var s=e.getArg(t,"offset"),i=e.getArg(s,"line"),n=e.getArg(s,"column");if(i<c.line||i===c.line&&n<c.column)throw new Error("Section offsets must be ordered and non-overlapping.");return c=s,{generatedOffset:{generatedLine:i+1,generatedColumn:n+1},consumer:new r(e.getArg(t,"map"),a)}}))}r.fromSourceMap=function(t,e){return o.fromSourceMap(t,e)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(t,e){var a=t.charAt(e);return";"===a||","===a},r.prototype._parseMappings=function(t,e){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(t,a,s){var i,n=a||null;switch(s||r.GENERATED_ORDER){case r.GENERATED_ORDER:i=this._generatedMappings;break;case r.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var o=this.sourceRoot;i.map((function(t){var a=null===t.source?null:this._sources.at(t.source);return{source:a=e.computeSourceURL(o,a,this._sourceMapURL),generatedLine:t.generatedLine,generatedColumn:t.generatedColumn,originalLine:t.originalLine,originalColumn:t.originalColumn,name:null===t.name?null:this._names.at(t.name)}}),this).forEach(t,n)},r.prototype.allGeneratedPositionsFor=function(t){var s=e.getArg(t,"line"),i={source:e.getArg(t,"source"),originalLine:s,originalColumn:e.getArg(t,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],r=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,a.LEAST_UPPER_BOUND);if(r>=0){var o=this._originalMappings[r];if(void 0===t.column)for(var c=o.originalLine;o&&o.originalLine===c;)n.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++r];else for(var l=o.originalColumn;o&&o.originalLine===s&&o.originalColumn==l;)n.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++r]}return n},t.SourceMapConsumer=r,o.prototype=Object.create(r.prototype),o.prototype.consumer=r,o.prototype._findSourceIndex=function(t){var a,s=t;if(null!=this.sourceRoot&&(s=e.relative(this.sourceRoot,s)),this._sources.has(s))return this._sources.indexOf(s);for(a=0;a<this._absoluteSources.length;++a)if(this._absoluteSources[a]==t)return a;return-1},o.fromSourceMap=function(t,a){var i=Object.create(o.prototype),r=i._names=s.fromArray(t._names.toArray(),!0),l=i._sources=s.fromArray(t._sources.toArray(),!0);i.sourceRoot=t._sourceRoot,i.sourcesContent=t._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=t._file,i._sourceMapURL=a,i._absoluteSources=i._sources.toArray().map((function(t){return e.computeSourceURL(i.sourceRoot,t,a)}));for(var h=t._mappings.toArray().slice(),d=i.__generatedMappings=[],u=i.__originalMappings=[],p=0,m=h.length;p<m;p++){var f=h[p],g=new c;g.generatedLine=f.generatedLine,g.generatedColumn=f.generatedColumn,f.source&&(g.source=l.indexOf(f.source),g.originalLine=f.originalLine,g.originalColumn=f.originalColumn,f.name&&(g.name=r.indexOf(f.name)),u.push(g)),d.push(g)}return n(i.__originalMappings,e.compareByOriginalPositions),i},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),o.prototype._parseMappings=function(t,a){for(var s,r,o,l,h,d=1,u=0,p=0,m=0,f=0,g=0,w=t.length,E=0,v={},y={},I=[],D=[];E<w;)if(";"===t.charAt(E))d++,E++,u=0;else if(","===t.charAt(E))E++;else{for((s=new c).generatedLine=d,l=E;l<w&&!this._charIsMappingSeparator(t,l);l++);if(o=v[r=t.slice(E,l)])E+=r.length;else{for(o=[];E<l;)i.decode(t,E,y),h=y.value,E=y.rest,o.push(h);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");v[r]=o}s.generatedColumn=u+o[0],u=s.generatedColumn,o.length>1&&(s.source=f+o[1],f+=o[1],s.originalLine=p+o[2],p=s.originalLine,s.originalLine+=1,s.originalColumn=m+o[3],m=s.originalColumn,o.length>4&&(s.name=g+o[4],g+=o[4])),D.push(s),"number"==typeof s.originalLine&&I.push(s)}n(D,e.compareByGeneratedPositionsDeflated),this.__generatedMappings=D,n(I,e.compareByOriginalPositions),this.__originalMappings=I},o.prototype._findMapping=function(t,e,s,i,n,r){if(t[s]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[s]);if(t[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[i]);return a.search(t,e,n,r)},o.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var e=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var a=this._generatedMappings[t+1];if(e.generatedLine===a.generatedLine){e.lastGeneratedColumn=a.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(t){var a={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},s=this._findMapping(a,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(t,"bias",r.GREATEST_LOWER_BOUND));if(s>=0){var i=this._generatedMappings[s];if(i.generatedLine===a.generatedLine){var n=e.getArg(i,"source",null);null!==n&&(n=this._sources.at(n),n=e.computeSourceURL(this.sourceRoot,n,this._sourceMapURL));var o=e.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:n,line:e.getArg(i,"originalLine",null),column:e.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(t){return null==t})))},o.prototype.sourceContentFor=function(t,a){if(!this.sourcesContent)return null;var s=this._findSourceIndex(t);if(s>=0)return this.sourcesContent[s];var i,n=t;if(null!=this.sourceRoot&&(n=e.relative(this.sourceRoot,n)),null!=this.sourceRoot&&(i=e.urlParse(this.sourceRoot))){var r=n.replace(/^file:\/\//,"");if("file"==i.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!i.path||"/"==i.path)&&this._sources.has("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(a)return null;throw new Error('"'+n+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(t){var a=e.getArg(t,"source");if((a=this._findSourceIndex(a))<0)return{line:null,column:null,lastColumn:null};var s={source:a,originalLine:e.getArg(t,"line"),originalColumn:e.getArg(t,"column")},i=this._findMapping(s,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(t,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var n=this._originalMappings[i];if(n.source===s.source)return{line:e.getArg(n,"generatedLine",null),column:e.getArg(n,"generatedColumn",null),lastColumn:e.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=o,l.prototype=Object.create(r.prototype),l.prototype.constructor=r,l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var a=0;a<this._sections[e].consumer.sources.length;a++)t.push(this._sections[e].consumer.sources[a]);return t}}),l.prototype.originalPositionFor=function(t){var s={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},i=a.search(s,this._sections,(function(t,e){var a=t.generatedLine-e.generatedOffset.generatedLine;return a||t.generatedColumn-e.generatedOffset.generatedColumn})),n=this._sections[i];return n?n.consumer.originalPositionFor({line:s.generatedLine-(n.generatedOffset.generatedLine-1),column:s.generatedColumn-(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(t){return t.consumer.hasContentsOfAllSources()}))},l.prototype.sourceContentFor=function(t,e){for(var a=0;a<this._sections.length;a++){var s=this._sections[a].consumer.sourceContentFor(t,!0);if(s)return s}if(e)return null;throw new Error('"'+t+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(t){for(var a=0;a<this._sections.length;a++){var s=this._sections[a];if(-1!==s.consumer._findSourceIndex(e.getArg(t,"source"))){var i=s.consumer.generatedPositionFor(t);if(i)return{line:i.line+(s.generatedOffset.generatedLine-1),column:i.column+(s.generatedOffset.generatedLine===i.line?s.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},l.prototype._parseMappings=function(t,a){this.__generatedMappings=[],this.__originalMappings=[];for(var s=0;s<this._sections.length;s++)for(var i=this._sections[s],r=i.consumer._generatedMappings,o=0;o<r.length;o++){var c=r[o],l=i.consumer._sources.at(c.source);l=e.computeSourceURL(i.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var h=null;c.name&&(h=i.consumer._names.at(c.name),this._names.add(h),h=this._names.indexOf(h));var d={source:l,generatedLine:c.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(i.generatedOffset.generatedLine===c.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:h};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}n(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),n(this.__originalMappings,e.compareByOriginalPositions)},t.IndexedSourceMapConsumer=l}}),se=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js"(t){var e=Zt().SourceMapGenerator,a=qt(),s=/(\r?\n)/,i="$$$isSourceNode$$$";function n(t,e,a,s,n){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==a?null:a,this.name=null==n?null:n,this[i]=!0,null!=s&&this.add(s)}n.fromStringWithSourceMap=function(t,e,i){var r=new n,o=t.split(s),c=0,l=function(){return t()+(t()||"");function t(){return c<o.length?o[c++]:void 0}},h=1,d=0,u=null;return e.eachMapping((function(t){if(null!==u){if(!(h<t.generatedLine)){var e=(a=o[c]||"").substr(0,t.generatedColumn-d);return o[c]=a.substr(t.generatedColumn-d),d=t.generatedColumn,p(u,e),void(u=t)}p(u,l()),h++,d=0}for(;h<t.generatedLine;)r.add(l()),h++;if(d<t.generatedColumn){var a=o[c]||"";r.add(a.substr(0,t.generatedColumn)),o[c]=a.substr(t.generatedColumn),d=t.generatedColumn}u=t}),this),c<o.length&&(u&&p(u,l()),r.add(o.splice(c).join(""))),e.sources.forEach((function(t){var s=e.sourceContentFor(t);null!=s&&(null!=i&&(t=a.join(i,t)),r.setSourceContent(t,s))})),r;function p(t,e){if(null===t||void 0===t.source)r.add(e);else{var s=i?a.join(i,t.source):t.source;r.add(new n(t.originalLine,t.originalColumn,s,e,t.name))}}},n.prototype.add=function(t){if(Array.isArray(t))t.forEach((function(t){this.add(t)}),this);else{if(!t[i]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);t&&this.children.push(t)}return this},n.prototype.prepend=function(t){if(Array.isArray(t))for(var e=t.length-1;e>=0;e--)this.prepend(t[e]);else{if(!t[i]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this},n.prototype.walk=function(t){for(var e,a=0,s=this.children.length;a<s;a++)(e=this.children[a])[i]?e.walk(t):""!==e&&t(e,{source:this.source,line:this.line,column:this.column,name:this.name})},n.prototype.join=function(t){var e,a,s=this.children.length;if(s>0){for(e=[],a=0;a<s-1;a++)e.push(this.children[a]),e.push(t);e.push(this.children[a]),this.children=e}return this},n.prototype.replaceRight=function(t,e){var a=this.children[this.children.length-1];return a[i]?a.replaceRight(t,e):"string"==typeof a?this.children[this.children.length-1]=a.replace(t,e):this.children.push("".replace(t,e)),this},n.prototype.setSourceContent=function(t,e){this.sourceContents[a.toSetString(t)]=e},n.prototype.walkSourceContents=function(t){for(var e=0,s=this.children.length;e<s;e++)this.children[e][i]&&this.children[e].walkSourceContents(t);var n=Object.keys(this.sourceContents);for(e=0,s=n.length;e<s;e++)t(a.fromSetString(n[e]),this.sourceContents[n[e]])},n.prototype.toString=function(){var t="";return this.walk((function(e){t+=e})),t},n.prototype.toStringWithSourceMap=function(t){var a={code:"",line:1,column:0},s=new e(t),i=!1,n=null,r=null,o=null,c=null;return this.walk((function(t,e){a.code+=t,null!==e.source&&null!==e.line&&null!==e.column?(n===e.source&&r===e.line&&o===e.column&&c===e.name||s.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:a.line,column:a.column},name:e.name}),n=e.source,r=e.line,o=e.column,c=e.name,i=!0):i&&(s.addMapping({generated:{line:a.line,column:a.column}}),n=null,i=!1);for(var l=0,h=t.length;l<h;l++)10===t.charCodeAt(l)?(a.line++,a.column=0,l+1===h?(n=null,i=!1):i&&s.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:a.line,column:a.column},name:e.name})):a.column++})),this.walkSourceContents((function(t,e){s.setSourceContent(t,e)})),{code:a.code,map:s}},t.SourceNode=n}}),ie=Et({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js"(t){t.SourceMapGenerator=Zt().SourceMapGenerator,t.SourceMapConsumer=ae().SourceMapConsumer,t.SourceNode=se().SourceNode}}),ne=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"(t,e){t.__esModule=!0;var a,s=yt(),i=void 0;try{"function"==typeof define&&define.amd||(a=ie(),i=a.SourceNode)}catch(t){}function n(t,e,a){if(s.isArray(t)){for(var i=[],n=0,r=t.length;n<r;n++)i.push(e.wrap(t[n],a));return i}return"boolean"==typeof t||"number"==typeof t?t+"":t}function r(t){this.srcFile=t,this.source=[]}i||((i=function(t,e,a,s){this.src="",s&&this.add(s)}).prototype={add:function(t){s.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){s.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),r.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,e){this.source.unshift(this.wrap(t,e))},push:function(t,e){this.source.push(this.wrap(t,e))},merge:function(){var t=this.empty();return this.each((function(e){t.add([" ",e,"\n"])})),t},each:function(t){for(var e=0,a=this.source.length;e<a;e++)t(this.source[e])},empty:function(){var t=this.currentLocation||{start:{}};return new i(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var e=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return t instanceof i?t:(t=n(t,this,e),new i(e.start.line,e.start.column,this.srcFile,t))},functionCall:function(t,e,a){return a=this.generateList(a),this.wrap([t,e?"."+e+"(":"(",a,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var e=this,a=[];Object.keys(t).forEach((function(s){var i=n(t[s],e);"undefined"!==i&&a.push([e.quotedString(s),":",i])}));var s=this.generateList(a);return s.prepend("{"),s.add("}"),s},generateList:function(t){for(var e=this.empty(),a=0,s=t.length;a<s;a++)a&&e.add(","),e.add(n(t[a],this));return e},generateArray:function(t){var e=this.generateList(t);return e.prepend("["),e.add("]"),e}},t.default=r,e.exports=t.default}}),re=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var s=Rt(),i=a(It()),n=yt(),r=a(ne());function o(t){this.value=t}function c(){}c.prototype={nameLookup:function(t,e){return this.internalNameLookup(t,e)},depthedLookup:function(t){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(t),")"]},compilerInfo:function(){var t=s.COMPILER_REVISION;return[t,s.REVISION_CHANGES[t]]},appendToBuffer:function(t,e,a){return n.isArray(t)||(t=[t]),t=this.source.wrap(t,e),this.environment.isSimple?["return ",t,";"]:a?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(t,e){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(e),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(t,e,a,s){this.environment=t,this.options=e,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!s,this.name=this.environment.name,this.isChild=!!a,this.context=a||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,e),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var n=t.opcodes,r=void 0,o=void 0,c=void 0,l=void 0;for(c=0,l=n.length;c<l;c++)r=n[c],this.source.currentLocation=r.loc,o=o||r.loc,this[r.opcode].apply(this,r.args);if(this.source.currentLocation=o,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),";\n"]),this.decorators.push("return fn;"),s?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var h=this.createFunctionContext(s);if(this.isChild)return h;var d={compiler:this.compilerInfo(),main:h};this.decorators&&(d.main_d=this.decorators,d.useDecorators=!0);var u=this.context,p=u.programs,m=u.decorators;for(c=0,l=p.length;c<l;c++)p[c]&&(d[c]=p[c],m[c]&&(d[c+"_d"]=m[c],d.useDecorators=!0));return this.environment.usePartial&&(d.usePartial=!0),this.options.data&&(d.useData=!0),this.useDepths&&(d.useDepths=!0),this.useBlockParams&&(d.useBlockParams=!0),this.options.compat&&(d.compat=!0),s?d.compilerOptions=this.options:(d.compiler=JSON.stringify(d.compiler),this.source.currentLocation={start:{line:1,column:0}},d=this.objectLiteral(d),e.srcName?(d=d.toStringWithSourceMap({file:e.destName})).map=d.map&&d.map.toString():d=d.toString()),d},preamble:function(){this.lastContext=0,this.source=new r.default(this.options.srcName),this.decorators=new r.default(this.options.srcName)},createFunctionContext:function(t){var e=this,a="",s=this.stackVars.concat(this.registers.list);s.length>0&&(a+=", "+s.join(", "));var i=0;Object.keys(this.aliases).forEach((function(t){var s=e.aliases[t];s.children&&s.referenceCount>1&&(a+=", alias"+ ++i+"="+t,s.children[0]="alias"+i)})),this.lookupPropertyFunctionIsUsed&&(a+=", "+this.lookupPropertyFunctionVarDeclaration());var n=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths");var r=this.mergeSource(a);return t?(n.push(r),Function.apply(this,n)):this.source.wrap(["function(",n.join(","),") {\n ",r,"}"])},mergeSource:function(t){var e=this.environment.isSimple,a=!this.forceBuffer,s=void 0,i=void 0,n=void 0,r=void 0;return this.source.each((function(t){t.appendToBuffer?(n?t.prepend(" + "):n=t,r=t):(n&&(i?n.prepend("buffer += "):s=!0,r.add(";"),n=r=void 0),i=!0,e||(a=!1))})),a?n?(n.prepend("return "),r.add(";")):i||this.source.push('return "";'):(t+=", buffer = "+(s?"":this.initializeBuffer()),n?(n.prepend("return buffer + "),r.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(s?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(t){var e=this.aliasable("container.hooks.blockHelperMissing"),a=[this.contextName(0)];this.setupHelperArgs(t,0,a);var s=this.popStack();a.splice(1,0,s),this.push(this.source.functionCall(e,"call",a))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var a=this.topStack();e.splice(1,0,a),this.pushSource(["if (!",this.lastHelper,") { ",a," = ",this.source.functionCall(t,"call",e),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack((function(t){return[" != null ? ",t,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,e,a,s){var i=0;s||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[i++])),this.resolvePath("context",t,i,e,a)},lookupBlockParam:function(t,e){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(t,e,a){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,a)},resolvePath:function(t,e,a,s,i){var n=this;if(this.options.strict||this.options.assumeObjects)this.push(function(t,e,a,s,i){var n=e.popStack(),r=a.length;t&&r--;for(;s<r;s++)n=e.nameLookup(n,a[s],i);return t?[e.aliasable("container.strict"),"(",n,", ",e.quotedString(a[s]),", ",JSON.stringify(e.source.currentLocation)," )"]:n}(this.options.strict&&i,this,e,a,t));else for(var r=e.length;a<r;a++)this.replaceStack((function(i){var r=n.nameLookup(i,e[a],t);return s?[" && ",r]:[" != null ? ",r," : ",i]}))},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,e){this.pushContext(),this.pushString(e),"SubExpression"!==e&&("string"==typeof t?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){null!=t?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,e){var a=this.nameLookup("decorators",e,"decorator"),s=this.setupHelperArgs(e,t);this.decorators.push(["fn = ",this.decorators.functionCall(a,"",["fn","props","container",s])," || fn;"])},invokeHelper:function(t,e,a){var s=this.popStack(),i=this.setupHelper(t,e),n=[];a&&n.push(i.name),n.push(s),this.options.strict||n.push(this.aliasable("container.hooks.helperMissing"));var r=["(",this.itemsSeparatedBy(n,"||"),")"],o=this.source.functionCall(r,"call",i.callParams);this.push(o)},itemsSeparatedBy:function(t,e){var a=[];a.push(t[0]);for(var s=1;s<t.length;s++)a.push(e,t[s]);return a},invokeKnownHelper:function(t,e){var a=this.setupHelper(t,e);this.push(this.source.functionCall(a.name,"call",a.callParams))},invokeAmbiguous:function(t,e){this.useRegister("helper");var a=this.popStack();this.emptyHash();var s=this.setupHelper(0,t,e),i=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",t,"helper")," || ",a,")"];this.options.strict||(i[0]="(helper = ",i.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",i,s.paramsInit?["),(",s.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",s.callParams)," : helper))"])},invokePartial:function(t,e,a){var s=[],i=this.setupParams(e,1,s);t&&(e=this.popStack(),delete i.name),a&&(i.indent=JSON.stringify(a)),i.helpers="helpers",i.partials="partials",i.decorators="container.decorators",t?s.unshift(e):s.unshift(this.nameLookup("partials",e,"partial")),this.options.compat&&(i.depths="depths"),i=this.objectLiteral(i),s.push(i),this.push(this.source.functionCall("container.invokePartial","",s))},assignToHash:function(t){var e=this.popStack(),a=void 0,s=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(s=this.popStack(),a=this.popStack());var n=this.hash;a&&(n.contexts[t]=a),s&&(n.types[t]=s),i&&(n.ids[t]=i),n.values[t]=e},pushId:function(t,e,a){"BlockParam"===t?this.pushStackLiteral("blockParams["+e[0]+"].path["+e[1]+"]"+(a?" + "+JSON.stringify("."+a):"")):"PathExpression"===t?this.pushString(e):"SubExpression"===t?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:c,compileChildren:function(t,e){for(var a=t.children,s=void 0,i=void 0,n=0,r=a.length;n<r;n++){s=a[n],i=new this.compiler;var o=this.matchExistingProgram(s);if(null==o){this.context.programs.push("");var c=this.context.programs.length;s.index=c,s.name="program"+c,this.context.programs[c]=i.compile(s,e,this.context,!this.precompile),this.context.decorators[c]=i.decorators,this.context.environments[c]=s,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,s.useDepths=this.useDepths,s.useBlockParams=this.useBlockParams}else s.index=o.index,s.name="program"+o.index,this.useDepths=this.useDepths||o.useDepths,this.useBlockParams=this.useBlockParams||o.useBlockParams}},matchExistingProgram:function(t){for(var e=0,a=this.context.environments.length;e<a;e++){var s=this.context.environments[e];if(s&&s.equals(t))return s}},programExpression:function(t){var e=this.environment.children[t],a=[e.index,"data",e.blockParams];return(this.useBlockParams||this.useDepths)&&a.push("blockParams"),this.useDepths&&a.push("depths"),"container.program("+a.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof o||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new o(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var e=["("],a=void 0,s=void 0,n=void 0;if(!this.isInline())throw new i.default("replaceStack on non-inline");var r=this.popStack(!0);if(r instanceof o)e=["(",a=[r.value]],n=!0;else{s=!0;var c=this.incrStack();e=["((",this.push(c)," = ",r,")"],a=this.topStack()}var l=t.call(this,a);n||this.popStack(),s&&this.stackSlot--,this.push(e.concat(l,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var e=0,a=t.length;e<a;e++){var s=t[e];if(s instanceof o)this.compileStack.push(s);else{var i=this.incrStack();this.pushSource([i," = ",s,";"]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var e=this.isInline(),a=(e?this.inlineStack:this.compileStack).pop();if(!t&&a instanceof o)return a.value;if(!e){if(!this.stackSlot)throw new i.default("Invalid stack pop");this.stackSlot--}return a},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,e=t[t.length-1];return e instanceof o?e.value:e},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var e=this.aliases[t];return e?(e.referenceCount++,e):((e=this.aliases[t]=this.source.wrap(t)).aliasable=!0,e.referenceCount=1,e)},setupHelper:function(t,e,a){var s=[];return{params:s,paramsInit:this.setupHelperArgs(e,t,s,a),name:this.nameLookup("helpers",e,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(s)}},setupParams:function(t,e,a){var s={},i=[],n=[],r=[],o=!a,c=void 0;o&&(a=[]),s.name=this.quotedString(t),s.hash=this.popStack(),this.trackIds&&(s.hashIds=this.popStack()),this.stringParams&&(s.hashTypes=this.popStack(),s.hashContexts=this.popStack());var l=this.popStack(),h=this.popStack();(h||l)&&(s.fn=h||"container.noop",s.inverse=l||"container.noop");for(var d=e;d--;)c=this.popStack(),a[d]=c,this.trackIds&&(r[d]=this.popStack()),this.stringParams&&(n[d]=this.popStack(),i[d]=this.popStack());return o&&(s.args=this.source.generateArray(a)),this.trackIds&&(s.ids=this.source.generateArray(r)),this.stringParams&&(s.types=this.source.generateArray(n),s.contexts=this.source.generateArray(i)),this.options.data&&(s.data="data"),this.useBlockParams&&(s.blockParams="blockParams"),s},setupHelperArgs:function(t,e,a,s){var i=this.setupParams(t,e,a);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),s?(this.useRegister("options"),a.push("options"),["options=",i]):a?(a.push(i),""):i}},function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=c.RESERVED_WORDS={},a=0,s=t.length;a<s;a++)e[t[a]]=!0}(),c.isValidJavaScriptVariableName=function(t){return!c.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)},t.default=c,e.exports=t.default}}),oe=Et({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var s=a(Bt()),i=a(Ut()),n=Kt(),r=Xt(),o=a(re()),c=a(jt()),l=a(Wt()),h=s.default.create;function d(){var t=h();return t.compile=function(e,a){return r.compile(e,a,t)},t.precompile=function(e,a){return r.precompile(e,a,t)},t.AST=i.default,t.Compiler=r.Compiler,t.JavaScriptCompiler=o.default,t.Parser=n.parser,t.parse=n.parse,t.parseWithoutProcessing=n.parseWithoutProcessing,t}var u=d();u.create=d,l.default(u),u.Visitor=c.default,u.default=u,t.default=u,e.exports=t.default}}),ce=Et({"../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(t,e){function a(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function s(t,e){for(var a,s="",i=0,n=-1,r=0,o=0;o<=t.length;++o){if(o<t.length)a=t.charCodeAt(o);else{if(47===a)break;a=47}if(47===a){if(n===o-1||1===r);else if(n!==o-1&&2===r){if(s.length<2||2!==i||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2))if(s.length>2){var c=s.lastIndexOf("/");if(c!==s.length-1){-1===c?(s="",i=0):i=(s=s.slice(0,c)).length-1-s.lastIndexOf("/"),n=o,r=0;continue}}else if(2===s.length||1===s.length){s="",i=0,n=o,r=0;continue}e&&(s.length>0?s+="/..":s="..",i=2)}else s.length>0?s+="/"+t.slice(n+1,o):s=t.slice(n+1,o),i=o-n-1;n=o,r=0}else 46===a&&-1!==r?++r:r=-1}return s}var i={resolve:function(){for(var t,e="",i=!1,n=arguments.length-1;n>=-1&&!i;n--){var r;n>=0?r=arguments[n]:(void 0===t&&(t=process.cwd()),r=t),a(r),0!==r.length&&(e=r+"/"+e,i=47===r.charCodeAt(0))}return e=s(e,!i),i?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(a(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=s(t,!e)).length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return a(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var s=arguments[e];a(s),s.length>0&&(void 0===t?t=s:t+="/"+s)}return void 0===t?".":i.normalize(t)},relative:function(t,e){if(a(t),a(e),t===e)return"";if((t=i.resolve(t))===(e=i.resolve(e)))return"";for(var s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var n=t.length,r=n-s,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var c=e.length-o,l=r<c?r:c,h=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(47===e.charCodeAt(o+d))return e.slice(o+d+1);if(0===d)return e.slice(o+d)}else r>l&&(47===t.charCodeAt(s+d)?h=d:0===d&&(h=0));break}var u=t.charCodeAt(s+d);if(u!==e.charCodeAt(o+d))break;47===u&&(h=d)}var p="";for(d=s+h+1;d<=n;++d)d!==n&&47!==t.charCodeAt(d)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(o+h):(o+=h,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(a(t),0===t.length)return".";for(var e=t.charCodeAt(0),s=47===e,i=-1,n=!0,r=t.length-1;r>=1;--r)if(47===(e=t.charCodeAt(r))){if(!n){i=r;break}}else n=!1;return-1===i?s?"/":".":s&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');a(t);var s,i=0,n=-1,r=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var o=e.length-1,c=-1;for(s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(47===l){if(!r){i=s+1;break}}else-1===c&&(r=!1,c=s+1),o>=0&&(l===e.charCodeAt(o)?-1==--o&&(n=s):(o=-1,n=c))}return i===n?n=c:-1===n&&(n=t.length),t.slice(i,n)}for(s=t.length-1;s>=0;--s)if(47===t.charCodeAt(s)){if(!r){i=s+1;break}}else-1===n&&(r=!1,n=s+1);return-1===n?"":t.slice(i,n)},extname:function(t){a(t);for(var e=-1,s=0,i=-1,n=!0,r=0,o=t.length-1;o>=0;--o){var c=t.charCodeAt(o);if(47!==c)-1===i&&(n=!1,i=o+1),46===c?-1===e?e=o:1!==r&&(r=1):-1!==e&&(r=-1);else if(!n){s=o+1;break}}return-1===e||-1===i||0===r||1===r&&e===i-1&&e===s+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var a=e.dir||e.root,s=e.base||(e.name||"")+(e.ext||"");return a?a===e.root?a+s:a+t+s:s}("/",t)},parse:function(t){a(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var s,i=t.charCodeAt(0),n=47===i;n?(e.root="/",s=1):s=0;for(var r=-1,o=0,c=-1,l=!0,h=t.length-1,d=0;h>=s;--h)if(47!==(i=t.charCodeAt(h)))-1===c&&(l=!1,c=h+1),46===i?-1===r?r=h:1!==d&&(d=1):-1!==r&&(d=-1);else if(!l){o=h+1;break}return-1===r||-1===c||0===d||1===d&&r===c-1&&r===o+1?-1!==c&&(e.base=e.name=0===o&&n?t.slice(1,c):t.slice(o,c)):(0===o&&n?(e.name=t.slice(1,r),e.base=t.slice(1,c)):(e.name=t.slice(o,r),e.base=t.slice(o,c)),e.ext=t.slice(r,c)),o>0?e.dir=t.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i}}),le=class{constructor(){this.view={enableDataInfoBar:!0,expCacheMode:"TABEXPPANEL:"},this.grid={editShowMode:"row",editSaveMode:"cell-blur"},this.appMenu={enableEcho:!0},this.codeList={timeout:36e5}}},he=t("RegisterCenter",class{constructor(){this.providers=new Map}register(t,e){this.providers.set(t,e)}unRegister(t){this.providers.delete(t)}get(t,...e){const a=this.providers.get(t);if(a)return a(...e)}}),de=class{static isHelperName(t){return this.helperNames.includes(t)}static handleJudgmentExecute(t,e,a){return a.fn?e?a.fn(t):a.inverse(t):e?a.hash.yes=!0:a.hash.no=!1}};de.helperNames=["lookup","log","and","camelCase","concat","eq","gt","get","lowerCase","lt","lte","neq","not","or","pascalCase","pluralize","snakeCase","spinalCase","upperCase"];var ue=class{constructor(t,e){t.registerHelper(e,this.onExecute)}},pe=class extends ue{constructor(t){super(t,"and")}onExecute(...t){const e=t[t.length-1];t.pop();const a=t.filter((t=>!!t)).length===t.length;return de.handleJudgmentExecute(this,a,e)}},me=class extends ue{constructor(t){super(t,"camelCase")}onExecute(t){return t?S(t):""}},fe=class extends ue{constructor(t){super(t,"concat")}onExecute(...t){return t.pop(),t.join("")}},ge=class extends ue{constructor(t){super(t,"eq")}onExecute(t,e,a){const s=x(t,e);return de.handleJudgmentExecute(this,s,a)}},we=class extends ue{constructor(t){super(t,"gt")}onExecute(t,e,a){const s=_(t,e);return de.handleJudgmentExecute(this,s,a)}},Ee=class extends ue{constructor(t){super(t,"gte")}onExecute(t,e,a){const s=T(t,e);return de.handleJudgmentExecute(this,s,a)}},ve=class extends ue{constructor(t){super(t,"eqPropertyValue")}onExecute(t,e,a,s){let i=!1;return i=A(t)?!x(L(t,(t=>x(t[e],a))),-1):t.hasOwnProperty(e)&&(i=x(t[e],a)),de.handleJudgmentExecute(this,i,s)}},ye=class extends ue{constructor(t){super(t,"jsonParse")}onExecute(t){return JSON.parse(t)}},Ie=class extends ue{constructor(t){super(t,"jsonStringify")}onExecute(t,e){return JSON.stringify(t,null,"number"==typeof e?e:void 0)}},De=class extends ue{constructor(t){super(t,"lowerCase")}onExecute(t){return t?t.toLowerCase():""}},Ce=class extends ue{constructor(t){super(t,"lt")}onExecute(t,e,a){const s=N(t,e);return de.handleJudgmentExecute(this,s,a)}},Ae=class extends ue{constructor(t){super(t,"lte")}onExecute(t,e,a){const s=O(t,e);return de.handleJudgmentExecute(this,s,a)}},be=class extends ue{constructor(t){super(t,"neq")}onExecute(t,e,a){const s=!x(t,e);return de.handleJudgmentExecute(this,s,a)}},Pe=class extends ue{constructor(t){super(t,"not")}onExecute(t,e){const a=Handlebars.Utils.isEmpty(t);return de.handleJudgmentExecute(this,a,e)}},Se=class extends ue{constructor(t){super(t,"or")}onExecute(...t){var e;const a=t[t.length-1];t.pop();const s=t.find((t=>!!t));if(a.fn){const t=(null==(e=a.data)?void 0:e.root)||{};return s?a.fn(t):a.inverse(t)}return s||""}},xe=class extends ue{constructor(t){super(t,"pascalCase")}onExecute(t){return t?M(t):""}},_e=class extends ue{constructor(t){super(t,"snakeCase")}onExecute(t){return t?R(t):""}},Te=class extends ue{constructor(t){super(t,"spinalCase")}onExecute(t){return t?V(t):""}},Le=class extends ue{constructor(t){super(t,"upperCase")}onExecute(t){return t?t.toUpperCase():""}};var Ne=t("HandlebarsUtil",class{constructor(){this.p=null}get isInit(){return!!this.hsb}async init(){var t;if(!this.isInit)return this.p?this.p:(this.p=Promise.resolve().then((()=>vt(oe(),1))),this.hsb=await this.p,this.p=null,t=this.hsb,new pe(t),new me(t),new fe(t),new ge(t),new we(t),new Ee(t),new ye(t),new Ie(t),new De(t),new Ce(t),new Ae(t),new be(t),new Pe(t),new Se(t),new xe(t),new _e(t),new Te(t),new Le(t),new ve(t),this.hsb)}async render(t,e){this.hsb||await this.init();return this.hsb.compile(t)(e)}syncRender(t,e){if(!this.hsb)throw new Error("handlebars not init");return this.hsb.compile(t)(e)}});function Oe(t){const e=[],a=/^%(.+)%$/;for(const s in t){let i=!0,n=t[s];F(t[s])&&a.test(t[s])&&(i=!1,n=t[s].substring(1,t[s].length-1)),e.push({key:s.toLowerCase(),rawValue:i,value:n})}return e}function Me(t,...e){if(!t||D(t))return{};return Ve(Array.isArray(t)?t:Oe(t),...e)}function Re(t,e){const a=t.find((t=>!W(t)&&(t[e]||Object.prototype.hasOwnProperty.call(t,e))));return{find:!!a,value:null==a?void 0:a[e]}}function Ve(t,...e){const a=/\$\{[^}]*\}/g,s={};for(const i of t)if(i.rawValue)s[i.key.toLowerCase()]=i.value||null;else{const t=i.value.match(a);if(null!==t){let a=i.value;t.forEach((t=>{const{find:s,value:i}=Re(e,t.slice(2,-1));s&&(a=a.replace(t,"".concat(i)))})),s[i.key.toLowerCase()]=a}else{const{find:t,value:a}=Re(e,i.value);t&&(s[i.key.toLowerCase()]=a)}}return s}function ke(t,e){const a={};if(!t)return a;const s=Array.isArray(t)?t:Oe(t),i=e[0];return s.forEach((t=>{const{rawValue:s,value:n}=t;!s&&n&&Object.prototype.hasOwnProperty.call(i,n)&&(a[n]=e.map((t=>t[n])).join(";"))})),a}function Fe(t,e){const{deName:a,navFilter:s,pickupDEFName:i,navContexts:n,navParams:r}=t,{context:o,params:c,data:l,derValue:h}=e,d={},u={},p=h||l.srfkey;p&&(a&&(d[a]=p),s&&(u[s]=p),i&&(u["n_".concat(i.toLowerCase(),"_eq")]=p));const m=Me(n,l,c,o),f=Me(r,l,c,o);return Object.assign(d,m),Object.assign(u,f),{resultContext:d,resultParams:u}}function We(t,e){if(t){const a=t.find((t=>t.id===e));if(a)return a}return null}function Be(t){const e={},a={},s={};for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];if(-1!==i.indexOf(".")){const t=i.split(".");switch(t[0]){case"SRFNAVPARAM":Object.assign(e,{[t[1]]:n});break;case"SRFNAVCTX":Object.assign(a,{[t[1]]:n});break;default:Object.assign(s,{key:n})}}}return{navigateContexts:e,navigateParams:a,other:s}}function Ue(t){const{width:e,height:a,widthMode:s,heightMode:i}=t,n={width:"",height:""};return"FULL"===s?n.width="100%":e&&e>0&&(n.width=e>0&&e<=1?"".concat(100*e,"%"):"".concat(e,"PERCENTAGE"===s?"%":"px")),"FULL"===i?n.height="100%":a&&a>0&&(n.height=a>0&&a<=1?"".concat(100*a,"%"):"".concat(a,"PERCENTAGE"===i?"%":"px")),n}function ze(t,e){const a=[],s=fa.execScriptFn({data:e},t,{singleRowReturn:!0,isAsync:!1});return C(s)?a.push(s):A(s)?a.push(...s):b(s)&&Object.keys(s).forEach((t=>{s[t]&&a.push(t)})),a}function je(t,e){const{mainStateAppDEFieldIds:a,demainStates:s}=t;if(a&&s){const t=[];return a.forEach((a=>{t.push(e[a])})),s.find((e=>{const{stateValue:a,state2Value:s,state3Value:i}=e;let n=!0;const r=[a,s,i];for(let e=0;e<t.length;e++)if("".concat(t[e])!=="".concat(r[e])){n=!1;break}return n}))}}function Ge(t,e){const a=ibiz.hub.getApp().model,{demainStateOPPrivs:s,opprivAllowMode:i}=t,n=(null==s?void 0:s.map((t=>t.name)))||[];let r=[];if(i)r=n;else{r=[...a.deopprivs,...e.deopprivs].filter((t=>!n.includes(t.name))).map((t=>t.name))}return r}function He(t){return t.split(".").pop()}function Ke(t,e){const a=He(e);return F(t[a])}async function Xe(t){return(await ibiz.hub.getAppDataEntity(t)).formTypeAppDEFieldId}function Ye(t,e){var a;return null==(a=e.appDELogics)?void 0:a.find((e=>e.id===t))}function $e(t,e){var a,s;const i=[];return null==(a=t.appDEFields)||a.forEach((t=>{"compute"===e&&t.computeAppDEFLogicId?i.push(t.computeAppDEFLogicId):"change"===e&&t.onChangeAppDEFLogicId?i.push(t.onChangeAppDEFLogicId):"default"===e&&t.defaultValueAppDEFLogicId&&i.push(t.defaultValueAppDEFLogicId)})),(null==(s=t.appDELogics)?void 0:s.filter((t=>i.includes(t.id))))||[]}function qe(t,e){var a;return null==(a=t.appDEFields)?void 0:a.find((t=>t.id===e))}async function Je(t){const[,,e]=t.split("@");return ibiz.hub.getApp(e).getUIAction(t)}function Qe(t){return t.detreeNodes.find((t=>t.rootNode))}function Ze(t,e){return t.detreeNodes.find((t=>t.id===e))}function ta(t,e){const a=e.parentId||Qe(t).id;return t.detreeNodeRSs.filter((t=>{return t.parentDETreeNodeId===a&&(s=t.searchMode,i=e.hasQuery,3===s||(i?1===s:2===s));var s,i}))}function ea(t,e){var a;return null==(a=t.degridEditItems)?void 0:a.find((t=>t.codeName===e))}function aa(t){let e;switch(t.detailType){case"TABPANEL":e=t.deformTabPages;break;case"FORMPAGE":case"TABPAGE":case"GROUPPANEL":e=t.deformDetails}return e||[]}function sa(t){const{viewLayoutPanel:e}=t,a=t.controls||[];return e&&a.push(...e.controls||[]),a}function ia(t){const{viewLayoutPanel:e}=t,a=t.appViewLogics||[];return e&&a.push(...e.appViewLogics||[]),a}function na(t){const{viewLayoutPanel:e}=t,a=t.appViewEngines||[];return e&&a.push(...e.appViewEngines||[]),a}async function ra(t,e,s={},i={}){return async function(t,e,s={},i={}){var n;const r=t.appViewNavContexts||[],o=Me(r,s,e);e=Object.assign(e.clone(),o);const c=t.appViewNavParams||[],l=Me(c,s,e);Object.assign(s,l);const h=t.appDataEntityId,d=He(h);let u=(null==(n=i.data)?void 0:n[0])||{};e[d]=u[d]||e[d]||s[d];const p=t.getDataAppDEActionId,m=ibiz.hub.getApp(t.appId),f=await m.deService.getService(h);ibiz.loading.showRedirect();try{const t=await f.exec(p||"get",e,s);if(t.ok){u=t.data;let a=u.linkurl;if(a)return e.srfprocessinstanceid&&(a+=";srfprocessinstanceid=".concat(e.srfprocessinstanceid)),ibiz.env.dev&&-1!==a.indexOf("appredirectview?")&&(a=a.slice(a.indexOf("appredirectview?"))),a.startsWith("http://")||a.startsWith("https://")?new Promise((t=>{const e=window.open(a,"_blank");e&&(e.callback=()=>{t({ok:!0,data:[]})})})):a.startsWith("appredirectview?")?(await oa(e,a,i),{ok:!0,data:[]}):{ok:!1,data:[]}}}finally{ibiz.loading.hideRedirect()}const g=await ibiz.hub.getAppDataEntity(h,t.appId),w=await async function(t,e,a,s){let i="";const n=e.typeAppDEFieldId;if(n){const{codeName:a}=qe(t,n),i=s[a.toLowerCase()];if(F(i))return"".concat(i);ibiz.log.warn("重定向视图[".concat(e.name,"]自定义类别属性[").concat(n,"]值为空"),s)}const r="".concat(ibiz.env.isMob?"MOB":"","EDITVIEW"),o=a.srfwf;if(F(o))return F(a.wf)?"".concat(r,":").concat(o.toUpperCase(),":").concat(a.wf.toUpperCase()):"".concat(r,":").concat(o.toUpperCase());let c="";if(t.indexTypeAppDEFieldId){const{codeName:e}=qe(t,t.indexTypeAppDEFieldId);c=s[e.toLowerCase()]}if(W(c)&&t.formTypeAppDEFieldId){const{codeName:e}=qe(t,t.formTypeAppDEFieldId);c=s[e.toLowerCase()]}i=F(c)?"".concat(r,":").concat(c.toString().toUpperCase()):"".concat(r);return i}(g,t,s,u),E=w.split(":"),v=2===E.length?w:E.slice(0,2).join(":"),y="".concat(g.name.toUpperCase(),":").concat(w),I=t.redirectAppViewRefs,D=null==I?void 0:I.find((t=>{const e=t.name||t.id;return e===y||e===w||e===v}));if(!D)throw ibiz.log.error("重定向视图引用有:",null==I?void 0:I.map((({refAppViewId:t,name:e,realTitle:a})=>({viewId:t,tag:e,title:a})))),new a(t,"未找到重定向标识[".concat(w,"]或[").concat(y,"]或工作流[").concat(v,"]对应视图"));{const t=D.refAppViewId;if(!t)throw new a(D,"未配置实际引用视图");{const a=await ibiz.commands.execute(Ni.TAG,t,e,s,{...i,data:[u]});if(a)return a}}return{ok:!0,data:[]}}(t,e,s,i)}async function oa(t,a,s={}){const i=a.lastIndexOf("?"),n=decodeURIComponent(a.substring(i+1,a.length)),r=$.parse(n,{delimiter:";"}),o=r.srfdename||"";if(!o)throw new e("重定向参数缺少实体名称");const c=ibiz.hub.getApp(t.srfappid).deName2DeCodeName.get(o.toUpperCase());if(!c)throw new e("未找到指定实体的codeName: ".concat(o));r[c.toLowerCase()]=r[o.toLowerCase()];const l="".concat(c).concat(ibiz.env.isMob?"Mob":"","RedirectView"),h=await ibiz.hub.getAppView(l);if(delete r.srfdename,"undo"!==r.srfwf){const t=r.processDefinitionKey.split("-")[3],e=t.substring(0,t.lastIndexOf("v")),a=t.substring(t.lastIndexOf("v"));r.wf=e,r.wfVersion=a}r.srfprocessinstanceid&&(t.srfprocessinstanceid=r.srfprocessinstanceid,delete r.srfprocessinstanceid),await ibiz.commands.execute(Ni.TAG,h.id,t,r,s)}function ca(t,a,s){if(Object.is(a,"IN"))return da(t,s);if(Object.is(a,"NOTIN"))return!da(t,s);switch(a){case"EQ":return"".concat(t)==="".concat(s);case"NOTEQ":return"".concat(t)!=="".concat(s);case"LT":return la(t,s)<0;case"LTANDEQ":return la(t,s)<=0;case"GT":return la(t,s)>0;case"GTANDEQ":return la(t,s)>=0;case"ISNULL":return W(t);case"ISNOTNULL":return F(t);case"TESTNULL":return q(t);case"IN":return da(t,s);case"NOTIN":return!da(t,s);case"LIKE":return ua(t,s);case"LEFTLIKE":return ua(t,s,"start");case"RIGHTLIKE":return ua(t,s,"end");default:throw new e("值操作:".concat(a,",暂未支持"))}}function la(t,a){const s=Number(t),i=Number(a);if(!Number.isNaN(s)&&!Number.isNaN(i))return ha(s,i);const n=new Date(t).getTime(),r=new Date(a).getTime();if(!Number.isNaN(n)&&!Number.isNaN(r))return ha(n,r);throw new e("".concat(t," 和 ").concat(a," 无法比较大小"))}function ha(t,e){return Number.isNaN(t)&&(t=0),Number.isNaN(e)&&(e=0),t>e?1:t<e?-1:0}function da(t,a){if(!a||"string"!=typeof a)throw new e("范围比较的条件值不存或者不是字符串");if(t){return a.split(",").includes("".concat(t))}return!1}function ua(t,e,a){if(!t||!e)return!1;const s="".concat(t).toUpperCase(),i="".concat(e).toUpperCase(),n=s.indexOf(i);switch(a){case"start":return 0===n;case"end":return n+i.length===s.length;default:return-1!==n}}var pa={singleRowReturn:!1,isAsync:!0},ma=t("ScriptFunction",class{constructor(t,e,a=pa){this.argKeys=[],this.options=a;const s=this.formatCode(e,a);this.calcArgKeys(t,a);const i=new Function(...this.argKeys,s);this.scriptFn=function(...t){return i.apply({},t)}}formatCode(t,e){let a=t;return e.singleRowReturn&&(a="return (".concat(a,")")),e.isAsync&&(a="return (async function() { ".concat(a,"} )();")),a}calcArgKeys(t,e){const a=e.presetParams?Object.keys(e.presetParams):[];a.push(...t);a.push("document","el","selector","env","appSession","topViewSession","viewSession","context","viewParam","activeData","data","app","topView","parentView","view","parent","util"),this.argKeys=Array.from(new Set(a))}convertArgs(t){const{presetParams:e}=this.options,a=e?J(e,t):t;a.document=document,a.selector=t=>document.getElementsByClassName(t);const s=[];return this.argKeys.forEach((t=>{void 0===a[t]&&this.fillDefaultParams(t,a),s.push(a[t])})),s}fillDefaultParams(t,e){const a=e.view;switch(t){case"util":e.util={message:ibiz.message,notification:ibiz.notification,modal:ibiz.modal,confirm:ibiz.confirm,openView:ibiz.openView};break;case"viewParam":e.viewParam=e.params;break;case"env":e.env=ibiz.env;break;case"app":e.app=ibiz.hub.controller;break;case"parent":e.parent=null==a?void 0:a.parentView;break;case"topView":e.topView=null==a?void 0:a.getTopView();break;case"parentView":e.parentView=null==a?void 0:a.parentView;break;case"topViewSession":e.topViewSession=null==a?void 0:a.getTopView().session;break;case"viewSession":e.viewSession=null==a?void 0:a.session;break;case"appSession":e.appSession=ibiz.hub.controller.session}}exec(t){const e=this.convertArgs(t);return this.scriptFn(...e)}}),fa=t("ScriptFactory",class{static createScriptFn(t,e,a){return new ma(t,e,a)}static execScriptFn(t,e,a){return this.createScriptFn(Object.keys(t),e,a).exec(t)}});function ga(t,a,s){const i={isPast:!0,infoMessage:s.ruleInfo};if(function(t){return"GROUP"===t.condType}(s)){const e=s.conds;e&&e.length>0&&(i.isPast=function(t,e,a="AND",s=!1){if(!((null==t?void 0:t.length)>0))return!1;let i="AND"===a;for(let s=0,n=t.length;s<n;s++){const n=e(t[s],s);if("AND"===a){if(!n){i=!1;break}}else if("OR"===a&&n){i=!0;break}}return s?!i:i}(e,(e=>{const{isPast:s,infoMessage:n}=ga(t,a,e);return i.infoMessage=n,s}),s.condOp,!!s.notMode),!i.isPast&&("AND"===s.condOp&&s.notMode||"OR"===s.condOp&&!s.notMode)&&(i.infoMessage=s.ruleInfo))}else{t=(null==s?void 0:s.defname.toLowerCase())||t;try{if(function(t){return"SIMPLE"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){Object.is(n,"CURTIME")&&(s="".concat(new Date));if(Object.is(n,"ENTITYFIELD")){s=r[s=s?s.toLowerCase():""]?r[s]:s}(q(i)||Q(i))&&(i="内容必须符合值规则");const c=ca(t,a,s);if(!c&&o)throw new e(i);return!c}(a[t],s.condOp,s.paramValue,s.ruleInfo,s.paramType,a,s.keyCond);else if(function(t){return"VALUERANGE2"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){W(r)&&(r="值必须符合值范围规则");if(W(t)){if(o)throw new e("值为空");return r="值为空",!0}if(wa(t,/^-?\d*\.?\d+$/,"",o))return!0;const c=Number.parseFloat(t);if(null!==a)if(s){if(c<a){if(o)throw new e(r);return!0}}else if(c<=a){if(o)throw new e(r);return!0}if(null!=i)if(n){if(c>i){if(o)throw new e(r);return!0}}else if(c>=i){if(o)throw new e(r);return!0}return r="",!1}(a[t],s.minValue,s.includeMinValue,s.maxValue,s.includeMaxValue,s.ruleInfo,s.keyCond);else if(function(t){return"REGEX"===t.condType}(s))i.isPast=!wa(a[t],s.regExCode,s.ruleInfo,s.keyCond);else if(function(t){return"STRINGLENGTH"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){W(r)&&(r="内容长度必须符合范围规则");if(W(t)){if(o)throw new e("值为空");return r="值为空",!0}const c=t.length;if(null!==a)if(s){if(c<a){if(o)throw new e(r);return!0}}else if(c<=a){if(o)throw new e(r);return!0}if(null!==i)if(n){if(c>i){if(o)throw new e(r);return!0}}else if(c>=i){if(o)throw new e(r);return!0}return r="",!1}(a[t],s.minValue,s.includeMinValue,s.maxValue,s.includeMaxValue,s.ruleInfo,s.keyCond);else if(function(t){return"SYSVALUERULE"===t.condType}(s)&&(null==s?void 0:s.sysValueRule)){const{ruleType:n,regExCode:r,scriptCode:o,ruleInfo:c}=s.sysValueRule;if(i.infoMessage=s.ruleInfo||c,"REG"===n)i.isPast=!wa(a[t],r,i.infoMessage,s.keyCond);else if("SCRIPT"===n){const{isPast:n,infoMessage:r}=function(t,a,s,i,n){W(i)&&(i="值必须符合脚本规则");const r=a;let o="",c=!0;const l=t=>{c=!1,(null==t?void 0:t.length)>0?t.forEach((t=>{(null==t?void 0:t.message)&&(o+=t.message)})):(null==t?void 0:t.message)&&(o=t.message)};try{const e=fa.execScriptFn({value:t,data:r},s,{isAsync:!1});"boolean"==typeof e&&(c=e)}catch(t){ibiz.log.error(t),l(t)}if(i="",!c&&n)throw new e(i);return{isPast:c,infoMessage:o||i}}(a[t],a,o,i.infoMessage,s.keyCond);i.isPast=n,i.infoMessage=r||i.infoMessage}}}catch(t){i.isPast=!1}i.isPast=s.notMode?!i.isPast:i.isPast}return i}function wa(t,a,s,i){W(s)&&(s="值必须符合正则规则");if(W(t)){if(i)throw new e("值为空");return s="值为空",!0}if(!new RegExp(a).test(t)){if(i)throw new e(s);return!0}return s="",!1}function Ea(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const s=e.defdlogics;if(!s||0===s.length)throw new a(e,"发现空逻辑组,逻辑无法正常执行!");let i=!0;if("AND"===e.groupOP){i=void 0===s.find((e=>!Ea(t,e)))}else if("OR"===e.groupOP){i=void 0!==e.defdlogics.find((e=>Ea(t,e)))}return e.notMode?!i:i}if(function(t){return"SINGLE"===t.logicType}(e))return ca(t[e.defdname.toLowerCase()],e.condOP,e.value);throw new s(e,"未支持的逻辑类型".concat(e.logicType))}function va(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const s=e.panelItemLogics;if(!s||0===s.length)throw new a(e,"发现空逻辑组,逻辑无法正常执行!");let i=!0;if("AND"===e.groupOP){i=void 0===s.find((e=>!va(t,e)))}else if("OR"===e.groupOP){i=void 0!==e.panelItemLogics.find((e=>va(t,e)))}return e.notMode?!i:i}if(function(t){return"SINGLE"===t.logicType}(e))return ca(t[e.dstModelField.toLowerCase()],e.condOp,e.value);throw new s(e,"未支持的逻辑类型".concat(e.logicType))}var ya=t("LayoutPanelUtil",class{constructor(){this.cache=new Map}register(t,e){this.cache.set(t,e)}get(t){return this.cache.get(t)}fill(t){const{viewLayoutPanel:e}=t;if(!e||!0===e.useDefaultLayout){const e=this.calcLayoutTag(t);if(this.cache.has(e)){const a=Z(this.cache.get(e));t.viewLayoutPanel=a,t.appCounterRefs&&(a.appCounterRefs=t.appCounterRefs,delete t.appCounterRefs),t.appViewEngines&&(a.appViewEngines=t.appViewEngines,delete t.appViewEngines),t.appViewLogics&&(a.appViewLogics=t.appViewLogics,delete t.appViewLogics),t.appViewRefs&&(a.appViewRefs=t.appViewRefs,delete t.appViewRefs),t.controls&&(a.controls=t.controls,delete t.controls)}}return t}calcLayoutTag(t){const{viewType:e,viewStyle:a}=t;return"APPINDEXVIEW"===e?this.calcIndexViewLayoutTag(t):"".concat(e,"_").concat(a)}calcIndexViewLayoutTag(t){const{viewType:e,viewStyle:a,blankMode:s,mainMenuAlign:i}=t;let n="";return s?n="BLANK_MODE":i&&(n=i.toUpperCase()),""!==n?"".concat(e,"_").concat(a,"_").concat(n):"".concat(e,"_").concat(a)}});function Ia(t){const e={};return t.param09&&(e.srfprocessinstanceid=t.param09),e}var Da=t("ControlType",(t=>(t.APP_MENU="APPMENU",t.GRID="GRID",t.FORM="FORM",t.SEARCHFORM="SEARCHFORM",t.TOOLBAR="TOOLBAR",t.DRBAR="DRBAR",t.VIEWPANEL="VIEWPANEL",t.PICKUP_VIEW_PANEL="PICKUPVIEWPANEL",t.DATAVIEW="DATAVIEW",t.TREEGRID="TREEGRID",t.WF_EXPBAR="WFEXPBAR",t.TREEVIEW="TREEVIEW",t.TREE_EXP_BAR="TREEEXPBAR",t.TAB_VIEWPANEL="TABVIEWPANEL",t.DRTAB="DRTAB",t.CHART="CHART",t.REPORT_PANEL="REPORTPANEL",t.LIST="LIST",t.MOB_MDCTRL="MOBMDCTRL",t.MULTI_EDIT_VIEWPANEL="MULTIEDITVIEWPANEL",t.WIZARD_PANEL="WIZARDPANEL",t.UPDATE_PANEL="UPDATEPANEL",t.SEARCHBAR="SEARCHBAR",t.DASHBOARD="DASHBOARD",t.CALENDAR="CALENDAR",t.PANEL="PANEL",t.VIEW_LAYOUT_PANEL="VIEWLAYOUTPANEL",t.MAP="MAP",t.GANTT="GANTT",t.TREE_GRIDEX="TREEGRIDEX",t.KANBAN="KANBAN",t.CALENDAR_EXPBAR="CALENDAREXPBAR",t.CHART_EXPBAR="CHARTEXPBAR",t.DATA_VIEW_EXPBAR="DATAVIEWEXPBAR",t.GANTT_EXPBAR="GANTTEXPBAR",t.GRID_EXPBAR="GRIDEXPBAR",t.LIST_EXPBAR="LISTEXPBAR",t.MAP_EXPBAR="MAPEXPBAR",t.STATE_WIZARD_PANEL="STATEWIZARDPANEL",t.TAB_EXP_PANEL="TABEXPPANEL",t.CUSTOM="CUSTOM",t.CAPTIONBAR="CAPTIONBAR",t))(Da||{})),Ca=t("ViewType",(t=>(t.APP_INDEX_VIEW="APPINDEXVIEW",t.DE_GRID_VIEW="DEGRIDVIEW",t.DE_EDIT_VIEW="DEEDITVIEW",t.APP_DATA_UPLOAD_VIEW="APPDATAUPLOADVIEW",t.APP_ERROR_VIEW="APPERRORVIEW",t.APP_FILE_UPLOAD_VIEW="APPFILEUPLOADVIEW",t.APP_FUN_PICKUP_VIEW="APPFUNCPICKUPVIEW",t.APP_LOGIN_VIEW="APPLOGINVIEW",t.APP_LOGOUT_VIEW="APPLOGOUTVIEW",t.APP_PANEL_VIEW="APPPANELVIEW",t.APP_PIC_UPLOAD_VIEW="APPPICUPLOADVIEW",t.APP_PORTAL_VIEW="APPPORTALVIEW",t.APP_REDIRECT_VIEW="APPREDIRECTVIEW",t.APP_START_VIEW="APPSTARTVIEW",t.APP_WELCOME_VIEW="APPWELCOMEVIEW",t.APP_WF_ADD_STEP_AFTER_VIEW="APPWFADDSTEPAFTERVIEW",t.APP_WF_ADD_STEP_BEFORE_VIEW="APPWFADDSTEPBEFOREVIEW",t.APP_WF_REDIRECT_VIEW="APPWFREDIRECTVIEW",t.APP_WF_SENDBAC_VIEW="APPWFSENDBACKVIEW",t.APP_WF_STEP_ACTOR_VIEW="APPWFSTEPACTORVIEW",t.APP_WF_STEP_DATA_VIEW="APPWFSTEPDATAVIEW",t.APP_WF_STEP_TRACE_VIEW="APPWFSTEPTRACEVIEW",t.APP_WF_SUPPLY_INFO_VIEW="APPWFSUPPLYINFOVIEW",t.APP_WF_TAKE_ADVICE_VIEW="APPWFTAKEADVICEVIEW",t.DE_CALENDAR_EXP_VIEW="DECALENDAREXPVIEW",t.DE_CALENDAR_VIEW="DECALENDARVIEW",t.DE_CHART_EXP_VIEW="DECHARTEXPVIEW",t.DE_CHART_VIEW="DECHARTVIEW",t.DE_CHART_VIEW9="DECHARTVIEW9",t.DE_CUSTOM_VIEW="DECUSTOMVIEW",t.DE_DATA_VIEW="DEDATAVIEW",t.DE_DATA_VIEW9="DEDATAVIEW9",t.DE_DATAVIEW_EXP_VIEW="DEDATAVIEWEXPVIEW",t.DE_EDIT_VIEW2="DEEDITVIEW2",t.DE_EDIT_VIEW3="DEEDITVIEW3",t.DE_EDIT_VIEW4="DEEDITVIEW4",t.DE_EDIT_VIEW9="DEEDITVIEW9",t.DE_FORM_PICKUP_DATA_VIEW="DEFORMPICKUPDATAVIEW",t.DE_GANTT_EXP_VIEW="DEGANTTEXPVIEW",t.DE_GANTT_VIEW="DEGANTTVIEW",t.DE_GANTT_VIEW9="DEGANTTVIEW9",t.DE_GRID_EXP_VIEW="DEGRIDEXPVIEW",t.DE_GRID_VIEW2="DEGRIDVIEW2",t.DE_GRID_VIEW4="DEGRIDVIEW4",t.DE_GRID_VIEW8="DEGRIDVIEW8",t.DE_GRID_VIEW9="DEGRIDVIEW9",t.DE_HTML_VIEW="DEHTMLVIEW",t.DE_INDEX_PICKUP_DATA_VIEW="DEINDEXPICKUPDATAVIEW",t.DE_INDEX_VIEW="DEINDEXVIEW",t.DE_KANBAN_VIEW="DEKANBANVIEW",t.DE_KANBAN_VIEW9="DEKANBANVIEW9",t.DE_LIST_EXP_VIEW="DELISTEXPVIEW",t.DE_LIST_VIEW="DELISTVIEW",t.DE_LIST_VIEW9="DELISTVIEW9",t.DE_MAP_EXP_VIEW="DEMAPEXPVIEW",t.DE_MAP_VIEW="DEMAPVIEW",t.DE_MAP_VIEW9="DEMAPVIEW9",t.DE_MD_CUSTOM_VIEW="DEMDCUSTOMVIEW",t.DE_MEDITVIEW9="DEMEDITVIEW9",t.DE_MOB_CALENDAR_EXP_VIEW="DEMOBCALENDAREXPVIEW",t.DE_MOB_CALENDAR_VIEW="DEMOBCALENDARVIEW",t.DE_MOB_CALENDAR_VIEW9="DEMOBCALENDARVIEW9",t.DE_MOB_CHART_EXP_VIEW="DEMOBCHARTEXPVIEW",t.DE_MO_BCHART_VIEW="DEMOBCHARTVIEW",t.D_EMOB_CHART_VIEW9="DEMOBCHARTVIEW9",t.DE_MOB_CUSTOM_VIEW="DEMOBCUSTOMVIEW",t.DE_MOB_DATA_VIEW="DEMOBDATAVIEW",t.DE_MOB_DATA_VIEW_EXP_VIEW="DEMOBDATAVIEWEXPVIEW",t.DE_MOB_EDIT_VIEW="DEMOBEDITVIEW",t.DE_MOB_EDIT_VIEW3="DEMOBEDITVIEW3",t.DE_MOB_EDITVIEW9="DEMOBEDITVIEW9",t.DE_MOB_FORM_PICKUP_MDVIEW="DEMOBFORMPICKUPMDVIEW",t.DE_MOB_GANTT_EXP_VIEW="DEMOBGANTTEXPVIEW",t.DE_MOB_GANTT_VIEW="DEMOBGANTTVIEW",t.DE_MOB_GANTT_VIEW9="DEMOBGANTTVIEW9",t.DE_MOB_HTML_VIEW="DEMOBHTMLVIEW",t.DE_MOB_INDEX_PICKUP_MDVIEW="DEMOBINDEXPICKUPMDVIEW",t.DE_MOB_LIST_EXP_VIEW="DEMOBLISTEXPVIEW",t.DE_MOB_LIST_VIEW="DEMOBLISTVIEW",t.DE_MOB_MAP_VIEW="DEMOBMAPVIEW",t.DE_MOB_MAP_VIEW9="DEMOBMAPVIEW9",t.DE_MOB_MDVIEW="DEMOBMDVIEW",t.DE_MOB_MDVIEW9="DEMOBMDVIEW9",t.DE_MOB_MEDIT_VIEW9="DEMOBMEDITVIEW9",t.DE_MOB_MPICKUP_VIEW="DEMOBMPICKUPVIEW",t.DE_MOB_OPT_VIEW="DEMOBOPTVIEW",t.DE_MOB_PANEL_VIEW="DEMOBPANELVIEW",t.DE_MOB_PANEL_VIEW9="DEMOBPANELVIEW9",t.DE_MOB_PICKUP_LIST_VIEW="DEMOBPICKUPLISTVIEW",t.DE_MOB_PICKUP_MDVIEW="DEMOBPICKUPMDVIEW",t.DE_MOB_PICKUP_TREE_VIEW="DEMOBPICKUPTREEVIEW",t.DE_MOB_PICKUP_VIEW="DEMOBPICKUPVIEW",t.DE_MOB_PORTAL_VIEW="DEMOBPORTALVIEW",t.DE_MOB_PORTAL_VIEW9="DEMOBPORTALVIEW9",t.DE_MOB_REDIRECT_VIEW="DEMOBREDIRECTVIEW",t.DE_MOB_REPORT_VIEW="DEMOBREPORTVIEW",t.DE_MOB_TAB_EXP_VIEW="DEMOBTABEXPVIEW",t.DE_MOB_TAB_EXP_VIEW9="DEMOBTABEXPVIEW9",t.DE_MOB_TAB_SEARCH_VIEW="DEMOBTABSEARCHVIEW",t.DE_MOB_TAB_SEARCH_VIEW9="DEMOBTABSEARCHVIEW9",t.DE_MOB_TREE_EXP_VIEW="DEMOBTREEEXPVIEW",t.DEMOBTREEEXPVIEW9="DEMOBTREEEXPVIEW9",t.DE_MOB_TREE_VIEW="DEMOBTREEVIEW",t.DE_MOB_WFACTION_VIEW="DEMOBWFACTIONVIEW",t.DE_MOB_WF_DATA_REDIRECT_VIEW="DEMOBWFDATAREDIRECTVIEW",t.DE_MOB_WF_DYNAACTIO_NVIEW="DEMOBWFDYNAACTIONVIEW",t.DE_MOB_WFDYNA_EDIT_VIEW="DEMOBWFDYNAEDITVIEW",t.DE_MOB_WF_DYNA_EDIT_VIEW3="DEMOBWFDYNAEDITVIEW3",t.DE_MOB_WF_DYNA_EXP_MDVIEW="DEMOBWFDYNAEXPMDVIEW",t.DE_MO_BWF_DYNA_START_VIEW="DEMOBWFDYNASTARTVIEW",t.DE_MOB_WF_EDIT_VIEW="DEMOBWFEDITVIEW",t.DE_MOB_WF_EDIT_VIEW3="DEMOBWFEDITVIEW3",t.DE_MOB_WF_MDVIEW="DEMOBWFMDVIEW",t.DE_MOB_WF_PROXY_RESULT_VIEW="DEMOBWFPROXYRESULTVIEW",t.DE_MOB_WF_PROXY_START_VIEW="DEMOBWFPROXYSTARTVIEW",t.DE_MOB_WF_START_VIEW="DEMOBWFSTARTVIEW",t.DE_MOB_WIZARD_VIEW="DEMOBWIZARDVIEW",t.DE_MPICKUP_VIEW="DEMPICKUPVIEW",t.DE_MPICKUP_VIEW2="DEMPICKUPVIEW2",t.DE_OPT_VIEW="DEOPTVIEW",t.DE_PANEL_VIEW="DEPANELVIEW",t.DE_PANEL_VIEW9="DEPANELVIEW9",t.DE_PICKUP_DATA_VIEW="DEPICKUPDATAVIEW",t.DE_PICKUP_GRID_VIEW="DEPICKUPGRIDVIEW",t.DE_PICKUP_TREE_VIEW="DEPICKUPTREEVIEW",t.DE_PICKUP_VIEW="DEPICKUPVIEW",t.DE_PICKUP_VIEW2="DEPICKUPVIEW2",t.DE_PICK_UP_VIEW3="DEPICKUPVIEW3",t.DE_PORTAL_VIEW="DEPORTALVIEW",t.DE_PORTAL_VIEW9="DEPORTALVIEW9",t.DE_REDIRECT_VIEW="DEREDIRECTVIEW",t.DE_REPORT_VIEW="DEREPORTVIEW",t.DE_TAB_EXP_VIEW="DETABEXPVIEW",t.DE_TAB_EXP_VIEW9="DETABEXPVIEW9",t.DE_TAB_SEARCH_VIEW="DETABSEARCHVIEW",t.DE_TAB_SEARCH_VIEW9="DETABSEARCHVIEW9",t.DE_TREE_EXP_VIEW="DETREEEXPVIEW",t.DE_TREE_EXP_VIEW2="DETREEEXPVIEW2",t.DE_TREE_EXP_VIEW3="DETREEEXPVIEW3",t.DE_TREE_GRID_EXVIEW="DETREEGRIDEXVIEW",t.DE_TREE_GRID_EXVIEW9="DETREEGRIDEXVIEW9",t.DE_TREE_GRID_VIEW="DETREEGRIDVIEW",t.DE_TREE_GRID_VIEW9="DETREEGRIDVIEW9",t.DE_TREE_VIEW="DETREEVIEW",t.DE_TREE_VIEW9="DETREEVIEW9",t.DE_WF_ACTION_VIEW="DEWFACTIONVIEW",t.DE_WF_DATA_REDIRECT_VIEW="DEWFDATAREDIRECTVIEW",t.DE_WF_DYNA_ACTION_VIEW="DEWFDYNAACTIONVIEW",t.DE_WF_DYNA_EDIT_VIEW="DEWFDYNAEDITVIEW",t.DE_WF_DYNA_EDIT_VIEW3="DEWFDYNAEDITVIEW3",t.DE_WF_DYNA_EXP_GRID_VIEW="DEWFDYNAEXPGRIDVIEW",t.DE_WF_DYNA_START_VIEW="DEWFDYNASTARTVIEW",t.DE_WF_EDIT_PROXY_DATA_VIEW="DEWFEDITPROXYDATAVIEW",t.DE_WF_EDIT_VIEW="DEWFEDITVIEW",t.DE_WF_EDIT_VIEW2="DEWFEDITVIEW2",t.DE_WF_EDIT_VIEW3="DEWFEDITVIEW3",t.DE_WF_EDIT_VIEW9="DEWFEDITVIEW9",t.DE_WF_EXP_VIEW="DEWFEXPVIEW",t.DE_WF_GRID_VIEW="DEWFGRIDVIEW",t.DE_WF_PROXY_DATA_VIEW="DEWFPROXYDATAVIEW",t.DE_WF_PROXY_RESULT_VIEW="DEWFPROXYRESULTVIEW",t.DE_WF_PROXY_START_VIEW="DEWFPROXYSTARTVIEW",t.DE_WF_START_VIEW="DEWFSTARTVIEW",t.DE_WIZARD_VIEW="DEWIZARDVIEW",t))(Ca||{})),Aa=t("ViewMode",(t=>(t.ROUTE="ROUTE",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t.POPOVER="POPOVER",t))(Aa||{})),ba=t("SysUIActionTag",(t=>(t.NEW="New",t.EDIT="Edit",t.REFRESH="Refresh",t.EXIT="Exit",t.SAVE_AND_EXIT="SaveAndExit",t.SAVE_AND_NEW="SaveAndNew",t.SAVE="Save",t.SAVE_ROW="SaveRow",t.REMOVE="Remove",t.REMOVE_AND_EXIT="RemoveAndExit",t.NEW_ROW="NewRow",t.TOGGLE_FILTER="ToggleFilter",t.IMPORT="Import",t.EXPORT_EXCEL="ExportExcel",t.SAVE_AND_START="SaveAndStart",t.VIEW_WF_STEP="ViewWFStep",t.NO="No",t.YES="Yes",t.CANCEL="Cancel",t.OK="Ok",t.SEARCH="Search",t.FINISH="Finish",t.NEXT_STEP="NextStep",t.PREV_STEP="PrevStep",t.ADD_SELECTION="AddSelection",t.REMOVE_SELECTION="RemoveSelection",t.REMOVE_ALL="RemoveAll",t.ADD_ALL="AddAll",t.LOGOUT="Logout",t.LOGIN="Login",t.CANCEL_CHANGES="CancelChanges",t.COPY="Copy",t.VIEW="View",t.TOGGLE_ROW_EDIT="ToggleRowEdit",t.REFRESH_ALL="RefreshAll",t.REFRESH_PARENT="RefreshParent",t.LOAD_MORE="LoadMore",t))(ba||{})),Pa=t("ViewCallTag",(t=>(t.LOAD="Load",t.GET_DATA="GetData",t.GET_ALL_DATA="GetAllData",t.VALIDATE="Validate",t))(Pa||{})),Sa=t("StudioViewEvents",class{});Sa.onViewMounted="onMounted",Sa.onViewDestroyed="onDestroyed";var xa=t("StudioPanelEvents",class{});xa.onClick="onClick",xa.onChange="onChange",xa.onEnter="onEnter",xa.onLeave="onLeave";var _a=t("StudioControlEvents",class{});_a.onBeforeLoad="onBeforeLoad",_a.onLoadSuccess="onLoadSuccess",_a.onLoadError="onLoadError",_a.onBeforeLoadDraft="onBeforeLoadDraft",_a.onLoadDraftSuccess="onLoadDraftSuccess",_a.onLoadDraftError="onLoadDraftError",_a.onBeforeSave="onBeforeSave",_a.onSaveSuccess="onSaveSuccess",_a.onSaveError="onSaveError",_a.onBeforeRemove="onBeforeRemove",_a.onRemoveSuccess="onRemoveSuccess",_a.onRemoveError="onRemoveError",_a.CLICK="onClick";var Ta=t("Modal",class{constructor(t){this.mode="EMBED",this.viewUsage=4,this.ignoreDismissCheck=!1,this.hooks={shouldDismiss:new B,beforeDismiss:new B},this._dismiss=t=>{ibiz.log.error("外部关闭能力未注册",t)},t.mode&&(this.mode=t.mode),t.routeDepth&&(this.routeDepth=t.routeDepth),t.viewUsage&&(this.viewUsage=t.viewUsage),t.dismiss&&(this._dismiss=t.dismiss)}injectDismiss(t){this._dismiss=t}async dismiss(t={ok:!1,data:[]}){const e={allowClose:!0};return!0!==this.ignoreDismissCheck&&await this.hooks.shouldDismiss.call(e),e.allowClose?(await this.hooks.beforeDismiss.call(t),this._dismiss(t),this.destroy(),!0):(ibiz.log.debug("shouldDismiss结果为false,关闭中断。"),!1)}destroy(){this.hooks.shouldDismiss.clear(),this.hooks.beforeDismiss.clear()}});function La(t,e){return t.filter((t=>{const{checkMode:a}=t,s=t.deformItemName||t.degridEditItemName;return 2!==a&&s===e}))}var Na=t("TextUtil",class{constructor(){this.inputElement=null}format(t,e){return t}copy(t){return this.inputElement||(this.inputElement=document.createElement("input"),this.inputElement.style.position="absolute",this.inputElement.style.left="-9999px",document.body.appendChild(this.inputElement)),this.inputElement.value=t,this.inputElement.select(),document.execCommand("copy")}}),Oa=t("RawValueUtil",class{isNumber(t){return/^-?\d+(\.\d+)?$/.test(t)}format(t){let e=t;return void 0!==t&&("true"===t||"false"===t?e="true"===t:this.isNumber(t)&&(e=parseFloat(t))),e}});async function Ma(t,e=!0){const a=await Promise.allSettled(t),s=[],i=[];if(a.forEach((t=>{"fulfilled"===t.status?s.push(t.value):i.push(t.reason)})),i.length>0){const t=1===i.length?i[0]:i;if(e)throw t;ibiz.util.error.handle(t)}return s}var Ra=class{constructor(){this.psModelGroupCondBase=null}parse(t){if(t instanceof Array){const e=this.createPSModelGroupCond();e.parse(t),this.psModelGroupCondBase=e}}testSingleCond(t,e,a){try{if("ISNULL"===t)return null==e;if("ISNOTNULL"===t)return null!=e;if("EQ"===t||"ABSEQ"===t||"GT"===t||"GTANDEQ"===t||"LT"===t||"LTANDEQ"===t||"NOTEQ"===t){let s=-1;if(e==a?s=0:e>a&&(s=1),"EQ"===t||"ABSEQ"===t)return 0===s;if("GT"===t)return s>0;if("GTANDEQ"===t)return s>=0;if("LT"===t)return s<0;if("LTANDEQ"===t)return s<=0;if("NOTEQ"===t)return 0!==s}if("LIKE"===t)return null!=e&&null!=a&&-1!==e.toString().toUpperCase().indexOf(a.toString().toUpperCase());if("LEFTLIKE"===t)return null!=e&&null!=a&&0===e.toString().toUpperCase().indexOf(a.toString().toUpperCase())}catch(t){ibiz.log.error(t)}return!1}getPSModelGroupCondBase(){return this.psModelGroupCondBase}},Va=class{constructor(){this.strCondOp=null}getCondOp(){return this.strCondOp}setCondOp(t){this.strCondOp=t}},ka=class extends Va{parse(t){const e=t.length;let a=!0,s=!1,i=!1;for(let n=0;n<e;n++)if(a){const e=t[n];this.setCondOp(e),a=!1,s=!0}else if(s){const e=t[n];this.setParam(e),s=!1,i=!0}else if(i){const e=t[n];if(e instanceof Object&&!(e instanceof Array)){const t=e;null!=t.type&&this.setValueType(t.type.toString()),null!=t.value&&this.setValue(t.value.toString())}else this.setValue(e);break}}getValueType(){return this.strValueType}setValueType(t){this.strValueType=t}getValue(){return this.strValue}setValue(t){this.strValue=t}getParamType(){return this.strParamType}setParamType(t){this.strParamType=t}getParam(){return this.strParam}setParam(t){this.strParam=t}},Fa=class t extends Va{constructor(){super(...arguments),this.childCondList=[],this.bNotMode=!1}parse(a){const s=a.length;let i=!0,n=!0,r=!1;for(let o=0;o<s;o++){if(i&&n){if("!"===a[o]){this.setNotMode(!0),i=!1;continue}}if(n){const t=a[o];this.setCondOp(t),n=!1,i=!1,r=!0}else if(r){const s=a[o];if(!(s instanceof Array))throw new e("值必须为数组");s.forEach((e=>{if(e.length>0){const a=e[0].toString();if("!"===a||"OR"===a||"AND"===a){const a=new t;a.parse(e),this.childCondList.push(a)}else{const t=new ka;t.parse(e),this.childCondList.push(t)}}}))}}}setNotMode(t){this.bNotMode=t}isNotMode(){return this.bNotMode}getChildPSModelCondBases(){return this.childCondList}},Wa=class extends Fa{},Ba=class extends ka{},Ua=class t extends Ra{test(t,e){return this.testCond(this.getPSModelGroupCondBase(),t,e)}testCond(e,a,s){if(e instanceof Fa){const t=e.getChildPSModelCondBases();if(null==t||Q(t))return!e.isNotMode();const i="AND"===e.getCondOp();let n=i;for(let e=0;e<t.length;e++){const r=t[e];if(this.testCond(r,a,s)){if(!i){n=!0;break}}else if(i){n=!1;break}}return e.isNotMode()?!n:n}if(e instanceof ka){Q(e.getParam())&&ibiz.log.warn("没有指定属性名称",e);const i=a[e.getParam().toLowerCase()];let n=null;const r=e.getValueType(),o=e.getValue();return null==r||Q(r)?n=e.getValue():(Q(o)&&ibiz.log.warn("没有指定上下文参数名称"),t.PARAMTYPE_WEBCONTEXT===r?n=s.data[o.toLowerCase()]:t.PARAMTYPE_DATACONTEXT===r&&(n=s.getValue(o.toLowerCase()))),this.testSingleCond(e.getCondOp(),i,n)}return ibiz.log.warn("无法识别的条件对象",e),!1}createPSModelSingleCond(){return new Ba}createPSModelGroupCond(){return new Wa}};Ua.PARAMTYPE_DATACONTEXT="DATACONTEXT",Ua.PARAMTYPE_WEBCONTEXT="WEBCONTEXT";var za=t("PSDEDQCondEngine",Ua);async function ja(t,e){var a;const s=null==(a=ibiz.hub.getApp(e).model.appPFPluginRefs)?void 0:a.find((e=>e.pluginCode.toLowerCase()===t));if(s)return await ibiz.plugin.loadPlugin(s),"".concat(s.pluginType,"_").concat(s.pluginCode);ibiz.log.error("找不到".concat(t,"的插件模型"))}var Ga=t("CONTROL_PROVIDER_PREFIX","CONTROL");function Ha(t){return ibiz.register.get("".concat(Ga,"_").concat(t))}async function Ka(t){let e;const{controlType:a,controlStyle:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await ja(i,n);if(t&&(e=Ha(t)),e)return e;ibiz.log.error("找不到部件插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=Ha("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到部件类型:[".concat(a,"]的部件样式:[").concat(s,"]对应的适配器"),t)}if(e=Ha(a),e)return e;"DATAINFOBAR"!==a&&ibiz.log.error("找不到部件类型".concat(a,"对应的适配器"))}var Xa=t("EDITOR_PROVIDER_PREFIX","EDITOR");function Ya(t){return ibiz.register.get("".concat(Xa,"_").concat(t))}async function $a(t){let e;const{editorType:a,editorStyle:s,predefinedType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await ja(n,r);if(t&&(e=Ya(t)),e)return e;ibiz.log.error("找不到编辑器插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=Ya("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(a,"]的编辑器样式:[").concat(s,"]对应的适配器"),t)}if(i){let n="".concat(i,"_").concat(a);if(s&&"DEFAULT"!==s&&(n+="_".concat(s)),e=Ya(n),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(a,"]的预置类型:[").concat(i,"]对应的适配器"),t)}if(e=Ya(a),e)return e;ibiz.log.error("找不到编辑器类型".concat(a,"对应的适配器"))}var qa=t("FORMDETAIL_PROVIDER_PREFIX","FORMDETAIL");function Ja(t){return ibiz.register.get("".concat(qa,"_").concat(t))}async function Qa(t){let e;const{detailType:a,sysPFPluginId:s,appId:i}=t;if(s){const t=await ja(s,i);if(t&&(e=Ja(t)),e)return e;ibiz.log.error("找不到表单成员插件".concat(t,"对应的适配器"))}if(e=Ja(a),e)return e;ibiz.log.error("找不到表单成员类型".concat(a,"对应的适配器"))}var Za=t("GRIDCOLUMN_PROVIDER_PREFIX","GRIDCOLUMN");function ts(t){return ibiz.register.get("".concat(Za,"_").concat(t))}async function es(t){let e;const{columnType:a,enableRowEdit:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await ja(i,n);if(t&&(e=ts(t)),e)return e;ibiz.log.error("找不到表格列插件".concat(t,"对应的适配器"))}const r=s?"".concat(a,"_EDIT"):a;if(e=ts(r),e)return e;ibiz.log.error("找不到表格列类型".concat(r,"对应的适配器"))}var as=t("PANELITEM_PROVIDER_PREFIX","PANELITEM");function ss(t){return ibiz.register.get("".concat(as,"_").concat(t.toUpperCase()))}async function is(t){var e;let a;const{itemType:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await ja(i,n);if(t&&(a=ss(t)),a)return a;ibiz.log.error("找不到面板成员插件".concat(t,"对应的适配器"))}if("CONTAINER"===s){const e=t.predefinedType||"DEFAULT";if(a=ss("CONTAINER_".concat(e)),a)return a;ibiz.log.error("找不到面板容器预置类型为".concat(e,"的适配器"))}if("RAWITEM"===s){const s=(null==(e=t.rawItem)?void 0:e.predefinedType)||"DEFAULT";if(a=ss("RAWITEM_".concat(s)),a)return a;ibiz.log.error("找不到面板成员直接内容预置类型为".concat(s,"的适配器"))}if(a=ss(s),a)return a;ibiz.log.error("找不到面板成员类型".concat(s,"对应的适配器"))}var ns=t("UIACTION_PROVIDER_PREFIX","UIACTION");function rs(t,e){ibiz.register.register("".concat(ns,"_").concat(t),e)}function os(t){return ibiz.register.get("".concat(ns,"_").concat(t))}async function cs(t){let a;const{uiactionMode:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await ja(i,n);if(t&&(a=os(t)),a)return a;ibiz.log.error("找不到界面行为插件".concat(t,"对应的适配器"))}if(a=os(s),a)return a;throw new e("找不界面行为模式".concat(s,"对应的适配器"))}var ls=t("VIEW_PROVIDER_PREFIX","VIEW");function hs(t){return ibiz.register.get("".concat(ls,"_").concat(t))}var ds=t("PORTLET_PROVIDER_PREFIX","PORTLET");function us(t){return ibiz.register.get("".concat(ds,"_").concat(t))}async function ps(t){let e;const{portletType:a,sysPFPluginId:s,appId:i}=t;if(s){const t=await ja(s,i);if(t&&(e=us(t)),e)return e;ibiz.log.error("找不到门户部件插件".concat(t,"对应的适配器"))}if(e=us(a),e)return e;ibiz.log.error("找不到门户部件成员类型".concat(a,"对应的适配器"))}var ms=t("APP_COUNTER_PROVIDER_PREFIX","APPCOUNTER");function fs(t,e){ibiz.register.register("".concat(ms,"_").concat(t),e)}function gs(t){return ibiz.register.get("".concat(ms,"_").concat(t))}async function ws(t){let a;const{codeName:s,counterType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await ja(n,r);if(t&&(a=gs(t)),a)return a;ibiz.log.error("找不到系统计数器插件".concat(t,"对应的适配器"))}if("CUSTOM"===i){if(a=gs(s),a)return a;throw new e("找不到自定义系统计数器".concat(s,"对应的适配器"))}if(a=gs(i),a)return a;throw new e("找不系统计数器类型".concat(i,"对应的适配器"))}var Es=t("AppCounter",class{constructor(t){this.model=t,this.destroyed=!1,this.context=i.create(),this.params={},this.evt=new U,this.data={}}get isDestroyed(){return this.destroyed}async init(t,e){this.setParams(t,e),this.interval(),await this.load()}setParams(t,e){t&&(this.context=Z(t)),e&&(this.params=Z(e))}interval(){this.destroyInterval(),this.intervalTimer=setInterval((()=>{this.evt.getSize("change")>0&&this.load()}),this.model.timer||6e3)}destroyInterval(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)}async load(){throw new e("未实现计数器加载方法")}refresh(t,e){return this.setParams(t,e),this.load()}onChange(t,e=!0){this.evt.on("change",t),e&&F(this.data)&&t(this.data)}offChange(t){this.evt.off("change",t)}getCounter(t){return this.data[t.toLowerCase()]||0}destroy(){this.destroyed=!0,this.context.destroy(),this.destroyInterval(),this.evt.reset()}}),vs=t("AppDECounter",class extends Es{async init(t,e){this.appDataEntityId=this.model.appDataEntityId;const s=this.model.getAppDEActionId;if(!s)throw new a(this.model,"未找到获取计数器行为!");this.action=s,await super.init(t,e)}async load(){const t=ibiz.hub.getApp(this.context.srfappid),e=await t.deService.exec(this.appDataEntityId,this.action,this.context,this.params);return e.ok&&(this.data=e.data,this.evt.emit("change",this.data)),this.data}}),ys=t("AppDECounterProvider",class{createCounter(t){return new vs(t)}});function Is(){fs("DEDR",(()=>new ys))}t("DEDQCondUtil",class{static getCond(t){if(this.map.has(t))return this.map.get(t);const e=t.dedqgroupConditions;if(e){const a=new za;return a.parse(["OR",this.calcCond(e)]),this.map.set(t,a),a}return null}static calcCond(t){const e=[];return t.forEach((t=>{const a=[];if("GROUP"===t.condType){const e=t;e.notMode&&a.push("!"),a.push(t.condOp);const s=e.dedqconditions;if(s){const t=this.calcCond(s);a.push(t)}}else{if("SINGLE"!==t.condType)throw new s(t,"暂未支持的查询条件类型: ".concat(t.condType));{const e=t;a.push(e.fieldName),e.condValue||a.push("")}}e.push(a)})),e}}).map=new WeakMap;var Ds=t("DynamicCodeListCache",class{constructor(t){this.cache=new Map,this.isPredefined=!1,this.codeList=t}async init(){return this.initPromise=(async()=>{const{predefinedType:t}=this.codeList;if(t){if(this.isPredefined=!0,!["OPERATOR","RUNTIME"].includes(t))throw new s(this.codeList,"预定义类型".concat(t,"暂不支持"))}else this.initPromise=void 0})(),this.initPromise}convertData(t){const e={},{valueAppDEFieldId:a,textAppDEFieldId:s}=this.codeList,i=a?t[a]:t.srfkey;return e.id=i,e.value=i,e.text=s?t[s]:t.srfmajortext,Object.freeze(e)}async load(t={},e={}){const s=ibiz.hub.getApp(t.srfappid);if(e.size||(e={...e,size:1e4}),this.isPredefined){const t=await s.net.get("/dictionaries/codelist/".concat(this.codeList.codeName),e);return Object.freeze(t.data.items)}const{appDataEntityId:i,appDEDataSetId:n}=this.codeList;if(!i)throw new a(this.codeList,"未配置应用实体");if(!n)throw new a(this.codeList,"未配置数据集");const r=await s.deService.exec(i,n,t,{},e);let o=[];return r.data.length&&(o=r.data.map((t=>this.convertData(t)))),o}async get(t={},e={}){if(this.initPromise&&await this.initPromise,!this.codeList.enableCache)return this.load(t,e);const a=JSON.stringify(t)+JSON.stringify(e);if(this.cache.has(a)){const t=this.cache.get(a);if(t.expirationTime>(new Date).getTime())return t.promise?t.promise:t.items;this.cache.delete(a)}const s=this.load(t,e),{cacheTimeout:i}=this.codeList,n=-1===i||q(i)?ibiz.config.codeList.timeout:this.codeList.cacheTimeout,r={expirationTime:(new Date).getTime()+n,promise:s};this.cache.set(a,r);const o=await s;return r.items=o,delete r.promise,o}});function Cs(t,a){if(null!=a){const{srfkey:t}=a;if(!q(t)&&!Q(t))return!0}throw new e("执行「".concat(t,"」不存在「srfkey」无法处理"))}function As(t,a){const{srfsessionid:s}=a;if(!q(s)&&!Q(s))return!0;throw new e("执行「".concat(t,"」不存在「srfsessionid」无法处理"))}var bs=t("DECache",class{constructor(){this.cacheMap=new Map}forceAdd(t,e){const a=this.getCacheByTag(t).get(e.srfkey);a&&(a.assign(e),ibiz.log.warn("forceAdd",e.srfkey,e))}forceUpdate(t,e){this.getCacheByTag(t).set(e.srfkey,Z(e)),ibiz.log.warn("forceUpdate",e.srfkey,e)}forceDelete(t,e){this.getCacheByTag(t).delete(e),ibiz.log.warn("forceDelete",e)}add(t,e){try{As("add",t),(q(e.srfkey)||Q(e.srfkey))&&(e.srfkey=z()),e.srftempdate=(new Date).getTime();return this.getCacheByTag(t).set(e.srfkey,Z(e)),ibiz.log.warn("add",e.srfkey,e),e}catch(t){return ibiz.log.error(t),null}}get(t,e){try{As("get",t);const a=this.getCacheByTag(t).get(e);return ibiz.log.warn("get",e,a),Z(a)}catch(t){return ibiz.log.error(t),null}}update(t,e){try{As("update",t),Cs("update",e),e.srftempdate=(new Date).getTime();const a=this.getCacheByTag(t),s=a.get(e.srfkey);if(s)return s.assign(e),a.set(e.srfkey,s),ibiz.log.warn("update",e.srfkey,e),Z(s);throw new Error("数据不存在,无法更新!")}catch(t){return ibiz.log.error(t),null}}delete(t,e){try{As("delete",t);const a=this.getCacheByTag(t),s=e;if(a.has(s)){const t=a.get(s);return t.srftempdate=(new Date).getTime(),a.delete(s),ibiz.log.warn("delete",s),t}return null}catch(t){return ibiz.log.error(t),null}}createBatch(t,e){try{As("add",t);const a=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const s=e[t];(q(s.srfkey)||Q(s.srfkey))&&(s.srfkey=z()),s.srftempdate=(new Date).getTime();const i=Z(s);a.set(s.srfkey,i),e[t]=i,ibiz.log.warn("add",s.srfkey,s)}return e}catch(t){ibiz.log.error(t)}return[]}updateBatch(t,e){try{As("update",t);const a=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const s=e[t];Cs("update",s),s.srftempdate=(new Date).getTime();const i=a.get(s.srfkey);if(!i)throw new Error("数据[".concat(s.srfdename,"-").concat(s.srfmajortext,"(").concat(s.srfkey,")]不存在,无法更新!"));i.assign(s),a.set(s.srfkey,i),ibiz.log.warn("update",s.srfkey,s),e[t]=Z(i)}return e}catch(t){return ibiz.log.error(t),null}}deleteBatch(t,e){try{As("delete",t)}catch(t){return ibiz.log.error(t),e}const a=this.getCacheByTag(t),s=[];for(let t=0;t<e.length;t++){const i=e[t];a.has(i)||s.push(i)}if(s.length>0)throw new Error("未找到以下数据「".concat(s.join("、"),"」,无法删除!"));for(let t=0;t<e.length;t++){const s=e[t];a.delete(s),ibiz.log.warn("delete",s)}return[]}checkData(t,e){return-1!==this.getList(t).findIndex((t=>t.srfkey===e))}getList(t){try{As("getList",t);const e=this.getCacheByTag(t);if(!e)return[];const a=e.values();return Array.from(a)}catch(t){return ibiz.log.error(t),[]}}generatePred(t={}){const e={};t.srfkey&&(e.srfkey=tt(t.srfkey)),delete t.srfkey;for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const s=t[a];e[a]=tt(s)}return et(e)}clear(t){const e=t.srfsessionid;this.cacheMap.size>0&&this.cacheMap.delete(e)}getCacheByTag(t){const e=t.srfsessionid;return this.cacheMap.has(e)||this.cacheMap.set(e,new Map),this.cacheMap.get(e)}}),Ps=new RegExp("(?<=\\$\\{)(.*?)(?=\\})","g");function Ss(t,e){const a=(e.requestPaths||[]).map((t=>({path:t,keys:t.match(Ps)||[]}))).filter((e=>{const{keys:a}=e;return 0===a.length||a.every(((e,s)=>s===a.length-1||null!=t[e]))})).sort(((t,e)=>e.keys.length-t.keys.length));if(a.length>0)return a[0]}function xs(t,e){const a=Ss(t,e);if(a){if(a.keys.length>0){let{path:e}=a;return a.keys.forEach(((s,i)=>{e=i===a.keys.length-1?e.replace(new RegExp("/[^/]+/\\$\\{".concat(s,"\\}")),""):e.replace("${".concat(s,"}"),t[s])})),e}return a.path}return""}var _s=t("SearchFilter",class{constructor(t,e){if(this.page=0,this.size=1e3,this.data={},this.sortField="srfordervalue",this.sortMode="ASC",this.context=t,e){if(q(e.page)||Q(e.page)||(this.page=e.page),q(e.size)||Q(e.size)||(this.size=e.size),q(e.query)||Q(e.query)||(this.query=e.query),!q(e.sort)&&!Q(e.sort)){const t=e.sort.split(",");t.length>=1&&([this.sortField]=t),t.length>=2&&(this.sortMode=t[1].toUpperCase())}q(e.srfparentkey)||Q(e.srfparentkey)||(this.srfparentkey=e.srfparentkey),q(e.srfparentdename)||Q(e.srfparentdename)||(this.srfparentdename=e.srfparentdename),this.data={...e},delete this.data.page,delete this.data.size,delete this.data.query,delete this.data.sort,delete this.data.srfparentkey,delete this.data.srfparentdename}}getValue(t){return this.data[t]?this.data[t]:this.context[t]}}),Ts=t("CodeListService",class{constructor(t){this.appModel=t,this.allCodeLists=new Map,this.cache=new Map}getStatic(t){const e=t.codeName;if(this.cache.has(e))return this.cache.get(e);const a=t.codeItems;let s=[];return(null==a?void 0:a.length)&&(s=this.formatStaticItems(a,t.codeItemValueNumber)),this.cache.set(e,Object.freeze(s)),s}setCodeList(t){const{id:e,codeName:a}=t;this.allCodeLists.set(e,t),this.allCodeLists.set(a,t)}getCodeList(t){return this.allCodeLists.get(t)}formatStaticItems(t,e){return t.map((t=>{var a;let s=t.text;t.textLanguageRes&&(s=ibiz.i18n.t(t.textLanguageRes.lanResTag,t.text));const i={text:s,value:e?Number(t.value):t.value,color:t.color,id:t.codeName,textCls:t.textCls,disableSelect:t.disableSelect};return(null==(a=t.codeItems)?void 0:a.length)&&(i.children=this.formatStaticItems(t.codeItems,e)),Object.freeze(i)}))}async getDynamicCodeList(t,e={},a={}){let s;const i=t.codeName;return this.cache.has(i)?s=this.cache.get(i):(s=new Ds(t),this.cache.set(i,s),await s.init()),s.get(e,a)}async get(t,a,s){const i=this.allCodeLists.get(t);if(!i)throw new e("找不到".concat(t,"代码表"));return"STATIC"===i.codeListType?this.getStatic(i):"DYNAMIC"===i.codeListType?this.getDynamicCodeList(i,a,s):[]}}),Ls=t("ConfigService",class{constructor(t,e,a){this.appId=t,this.folder=e,this.tag=a,this.app=ibiz.hub.getApp(t)}async save(t){const e=await this.app.net.put("/configs/".concat(this.folder,"/").concat(this.tag),t);return!!e.ok&&e.data}async load(){const t=await this.app.net.get("/configs/".concat(this.folder,"/").concat(this.tag));return t.ok?t.data:{}}}),Ns=t("CounterService",class{static async getCounter(t,e,a){const s=t.id;if(this.counterMap.has(s)){const t=this.counterMap.get(s);if(!1===t.isDestroyed)return t;this.counterMap.delete(s)}const i=(await ws(t)).createCounter(t);return await i.init(e,a),this.counterMap.set(s,i),i}static async getCounterByRef(t,e,s){const{appCounter:i}=t;if(!i)throw new a(t,"未配置应用计数器!");return this.getCounter(i,e,s)}});Ns.counterMap=new Map;var Os=t("WorkFlowService",class{constructor(t){this.model=t,this.commonBaseUrl="",this.app=ibiz.hub.getApp(t.appId);const e=ibiz.appData.context;this.commonBaseUrl="/wfcore/".concat(e.srfsystemid,"-app-").concat(this.app.model.codeName.toLowerCase(),"/").concat(this.model.name.toLowerCase())}getBaseUrl(){return this.commonBaseUrl}getActiveData(t,e){return e.srfprocessinstanceid&&(t.srfprocessinstanceid=e.srfprocessinstanceid),t}async getWFStep(t){const{processDefinitionKey:e,taskDefinitionKey:a}=t;return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions/").concat(e,"/usertasks/").concat(a))}async getWFLink(t,e){const a=t[this.model.codeName.toLowerCase()],{taskDefinitionKey:s}=t;return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(a,"/usertasks/").concat(s,"/ways"),{activedata:this.getActiveData(e,t)})}async getWFHistory(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.get("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/history"))}async getWFProcessDiagram(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.request("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/processdiagram"),{method:"post",data:{},responseType:"blob"})}async getWFVersion(){return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions2"))}async wfStart(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/process-instances"),{...e,activedata:this.getActiveData(a,t)})}async wfSubmit(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId),{...e,activedata:this.getActiveData(a,t)})}async wfWithdraw(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/withdraw"),{...e,activedata:this.getActiveData(a,t)})}async wfReassign(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/transfer"),{...e,activedata:this.getActiveData(a,t)})}async wfAddStepBefore(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/beforesign"),{...e,activedata:this.getActiveData(a,t)})}async wfAddStepAfter(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/aftersign"),{...e,activedata:this.getActiveData(a,t)})}async wfSendBack(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendback"),{...e,activedata:this.getActiveData(a,t)})}async wfSendCopy(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendcopy"),{...e,activedata:this.getActiveData(a,t)})}async exec(t,a,s={},i={}){switch(t){case"wfstart":return this.wfStart(a,s,i);case"wfsubmit":return this.wfSubmit(a,s,i);case"reassign":return this.wfReassign(a,s,i);case"addstepbefore":return this.wfAddStepBefore(a,s,i);case"addstepafter":return this.wfAddStepAfter(a,s,i);case"sendback":return this.wfSendBack(a,s,i);case"sendcopy":return this.wfSendCopy(a,s,i);default:throw new e("「".concat(t,"」未实现"))}}}),Ms=class{constructor(t){this.model=t}exportData(t,e,a,s){const i=xs(a,this.model),n="".concat(i,"/").concat(this.model.codeName2.toLowerCase(),"/exportdata/").concat(e.toLowerCase(),"/?srfexporttag=").concat(t.codeName);return ibiz.net.request(n,{method:"post",data:s,responseType:"blob"})}},Rs=t("Srfuf",(t=>(t[t.CREATE=0]="CREATE",t[t.UPDATE=1]="UPDATE",t))(Rs||{})),Vs=t("AppDataEntity",class t{get srfuf(){return this.srfkey?1:0}constructor(e,a){let s;Object.defineProperty(this,"_entity",{enumerable:!1,configurable:!0,value:e}),Object.defineProperty(this,"_data",{enumerable:!1,configurable:!0,value:Z(a instanceof t?a._data:a)}),Object.defineProperty(this,"srfdeid",{get:()=>e.id}),Object.defineProperty(this,"srfdecodename",{get:()=>e.codeName});const i=We(e.appDEFields||[],e.keyAppDEFieldId);if(i){const t=i.codeName.toLowerCase();Object.defineProperty(this,"srfkeyfile",{get:()=>t}),Object.defineProperty(this,"srfkey",{set(t){s=t},get(){return this._data[t]||s}}),Object.defineProperty(this,"srfsourcekey",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主键字段"));const n=We(e.appDEFields||[],e.majorAppDEFieldId);if(n){const t=n.codeName.toLowerCase();Object.defineProperty(this,"srfmajorfile",{get:()=>t}),Object.defineProperty(this,"srfmajortext",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主文本字段"));this.defineProperties()}defineProperties(){var t;const{_data:e,convertVal:a}=this,s={};Object.keys(e).forEach((t=>{s[t]={enumerable:!0,set(a){e[t]=a},get:()=>e[t]}})),null==(t=this._entity.appDEFields)||t.forEach((t=>{const i=t.codeName.toLowerCase();s[i]={enumerable:!0,set(s){e[i]=a(s,t.stdDataType)},get:()=>e[i]},e[i]=a(e[i],t.stdDataType)})),Object.defineProperties(this,s)}clone(){const e=new t(this._entity,this._data);return e.srfkey=this.srfkey,e}assign(e){return e instanceof t?Object.assign(this._data,e._data):Object.assign(this._data,e),this}convertVal(t,e){if(null==t)return t;if(q(e))return t;if(n.isNumber(e)){const e=q(t)||""===t?t:Number(t);return Number.isNaN(e)?(ibiz.log.debug("".concat(t,"不能转换成数字")),t):e}return t}}),ks=t("MethodDto",class t{constructor(t,e,a){this.entity=t,this.isLocalMode=e,this.dto=a,this.dtoMap=new Map,a?(this.app=ibiz.hub.getApp(t.appId),this.fields=a.appDEMethodDTOFields||[]):this.fields=[]}async get(t,e){const a={};for(let i=0;i<this.fields.length;i++){const n=this.fields[i],r=n.codeName.toLowerCase();switch(n.type){case"SIMPLE":break;case"DTOS":{if(void 0!==e[r])break;if(!n.refAppDataEntityId)break;const s=await this.getFieldDto(n),i=(await this.app.deService.getService(n.refAppDataEntityId)).local.getList(t);if(i){const e=[];for(let a=0;a<i.length;a++)e.push(await s.get(t,i[a]));a[r]=e}break}default:throw new s(n,"未支持的应用实体方法输入属性类型: ".concat(n.type))}}return{...e,...a}}async sets(t,e){const a=await this.app.deService.getService(this.entity.id);return this.isLocalMode&&a.local.clear(t),Promise.all(e.map((async e=>{const s=this.fields.filter((t=>"DTOS"===t.type)).map((async a=>{if(!a.refAppDataEntityId)return;const s=a.codeName.toLowerCase(),i=await this.getFieldDto(a),n=e[s];n?await i.sets(t,n):await i.sets(t,[])}));for(let t=0;t<s.length;t++)await s[t];const i=new Vs(this.entity,e);return this.isLocalMode&&await a.local.add(t,i),i})))}async getFieldDto(e){if(this.dtoMap.has(e.codeName))return this.dtoMap.get(e.codeName);const a=await ibiz.hub.getAppDataEntity(e.refAppDataEntityId,this.entity.appId),s=We(a.appDEMethodDTOs||[],e.refAppDEMethodDTOId),i=new t(a,!0,s);return this.dtoMap.set(e.codeName,i),i}});function Fs(t){return"BUILTIN"===t.actionType||"DATAQUERY"===t.dataSetType}var Ws=class{constructor(t,e){this.entity=t,this.method=e;const a=e.appDEMethodInput;if(a){const e=We(t.appDEMethodDTOs||[],a.appDEMethodDTOId);e&&(this.dto=new ks(t,this.isLocalMode,e))}}get isLocalMode(){return Fs(this.method)}async handle(t,e){return this.dto?this.dto.get(t,e):e}},Bs=class{constructor(t,e){this.entity=t,this.method=e;const a=e.appDEMethodReturn;if(a){const e=We(t.appDEMethodDTOs||[],a.appDEMethodDTOId);e&&(this.dto=new ks(t,this.isLocalMode,e))}}get isLocalMode(){return Fs(this.method)}async handle(t,e){if(this.dto){return(await this.dto.sets(t,[e]))[0]}return W(e)&&(e={}),new Vs(this.entity,e)}},Us=class{constructor(t,e){this.entity=t,this.method=e,this.app=ibiz.hub.getApp(t.appId),this.input=new Ws(t,e),this.result=new Bs(t,e)}async request(t,e,s,i){const{actionType:n,requestMethod:r}=this.method;if("REMOTE"===n){const e=this.method.codeName.toLowerCase();let n=null;switch(r){case"POST":n=await this.app.net.post(this.mergeRequestPath(t,e),F(s)?s:i);break;case"GET":n=await this.app.net.get(this.mergeRequestPath(t,e),s||i);break;case"PUT":n=await this.app.net.put(this.mergeRequestPath(t,e),F(s)?s:i);break;case"DELETE":n=await this.app.net.delete(this.mergeRequestPath(t,e),s||i);break;default:throw new a(this.method,r?"未支持的请求方式: ".concat(r):"未配置请求方式")}return n}throw new a(this.method,"未支持的行为类型[".concat(n,"]"))}mergeRequestPath(t,e){return"".concat(t,"/").concat(e)}calcPath(t){const e="/".concat(this.entity.codeName2.toLowerCase());return xs(t,this.entity)+e}async getService(){return this.service||(this.service=await this.app.deService.getService(this.entity.id)),this.service}createEntity(t){return t instanceof Vs?t.clone():new Vs(this.entity,t)}},zs=class{constructor(t,e,a,s){this.deLogicParams=t,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default",this.parameters={context:e,data:a,params:s}}get context(){return Object.prototype.hasOwnProperty.call(this.params,"context")?this.params.context:this.parameters.context}get data(){return this.parameters.data}get viewParam(){return Object.prototype.hasOwnProperty.call(this.params,"viewParam")?this.params.viewParam:this.parameters.params}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}setLastReturn(t){this.lastReturn=t}initLastReturnParam(t){Object.defineProperty(this.params,t,{enumerable:!0,configurable:!0,get:()=>this.lastReturn})}isEntityParam(t){const e=this.deLogicParams.get(t);return!(!e||!e.model.entityParam)}},js=class{},Gs=class extends js{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName.toLowerCase()}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,i){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=i[this.value]?i[this.value]:e[this.value];return ca(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return ca(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new s(this.model,"暂未支持条件值类型为[当前时间]");default:return ca(n[this.dstField],this.op,this.value)}}},Hs=class t extends js{constructor(e){super(),this.model=e;const a=e.conds||[];this.conds=a.map((e=>"SINGLE"===e.logicType?new Gs(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,s){let i=!0;if(0===this.conds.length)throw new a(this.model,"界面连接条件逻辑组未配置逻辑项");for(let a=0;a<this.conds.length;a++){const n=this.conds[a].test(t,e,s);if("AND"===this.op&&!1===n){i=!1;break}if("OR"===this.op&&!0===n){i=!0;break}}return this.notMode?!i:i}},Ks=class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const e=this.model.delogicLinkGroupCond;e&&(this.groupCond=new Hs(e))}async exec(t){const{defaultLink:e}=this.model;return!(!e&&this.groupCond)||this.groupCond.test(t,t.context,t.data||{})}},Xs=class{constructor(t){var e;this.model=t,this.links=null==(e=t.links||[])?void 0:e.map((t=>new Ks(t)))}},Ys=class extends Xs{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:s,dstDELogicParamId:i,retDELogicParamId:n}=this.model;if(!e)throw new a(this.model,"未指定应用实体");if(!s)throw new a(this.model,"未指定实体行为");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,s,t.context,r,t.viewParam);c.ok&&(t.params[n]=c.data)}},$s=class extends Xs{async exec(t){}},qs=class extends Xs{async exec(t){t.isEndNode=!0;const{returnParamId:e,returnType:a,rawValue:i}=this.model;if(a)switch(a){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=ibiz.util.rawValue.format(i);break;case"LOGICPARAM":t.result=t.params[e];break;default:throw new s(this.model,"暂未支持的结束节点返回值类型: ".concat(a))}}};function Js(t,e){const{srcDELogicParamId:a,srcFieldName:i,srcValue:n}=e,r=e.srcValueType||"SRCDLPARAM";let o,c=i;switch(r){case"SRCDLPARAM":o=t.params[a],t.isEntityParam(a)&&(c=null==c?void 0:c.toLowerCase());break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return ibiz.util.rawValue.format(n);case"WEBCONTEXT":case"VIEWPARAM":o=t.parameters.params;break;case"APPLICATION":case"SESSION":case"APPDATA":case"DATACONTEXT":o=t.parameters.context;break;case"ENVPARAM":o=Z(ibiz.env);break;default:throw new s(e,"暂未支持源值类型".concat(r))}if(o&&c)try{o=fa.execScriptFn({srcValue:o},"srcValue.".concat(c),{singleRowReturn:!0,isAsync:!1})}catch(t){throw ibiz.log.error("从源参数取属性".concat(c,"报错,源参数:"),o),t}return o}var Qs=class extends Xs{async exec(t){const e=this.model.delogicNodeParams;(null==e?void 0:e.length)&&await Promise.all(e.map((e=>{switch(e.paramAction){case"SETPARAMVALUE":return this.setParamValue(e,t);case"RESETPARAM":return this.resetParam(e,t);case"COPYPARAM":return this.copyParam(e,t);case"BINDPARAM":return this.bindParam(e,t);case"RENEWPARAM":return this.renewParam(e,t);case"APPENDPARAM":return this.appendParam(e,t);case"SORTPARAM":return this.sortParam(e,t);default:throw new s(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))}})))}copyParam(t,e){const{dstDELogicParamId:a}=t,s=Js(e,t);e.params[a]=Z(s)}bindParam(t,e){const a=Js(e,t);e.params[t.dstDELogicParamId]=a}setParamValue(t,e){const{dstFieldName:a,dstDELogicParamId:s}=t;let i=a;e.isEntityParam(s)&&(i=null==i?void 0:i.toLowerCase());const n=Js(e,t);i?e.params[s][i]=n:e.params[s]=n}resetParam(t,e){const{dstDELogicParamId:a}=t;e.resetParam(a)}renewParam(t,e){const{dstDELogicParamId:a}=t;e.renewParam(a)}appendParam(t,e){const{dstDELogicParamId:a,dstIndex:s,srcIndex:i,srcSize:n}=t,r=Js(e,t),o=s||0,c=i||0,l=n||r.length;e.params[a].splice(o,0,...r.slice(c,l))}sortParam(t,e){const{dstDELogicParamId:a,dstFieldName:s,dstSortDir:i}=t,n=s.toLowerCase();e.params[a].sort(((t,e)=>"ASC"===i?t[n]-e[n]:e[n]-t[n]))}},Zs=class extends Xs{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:a,dstDELogicParamId:s,retDELogicParamId:i}=this.model,n=t.params[s],r=ibiz.hub.getApp(t.context.srfappid),o=await r.deService.exec(a,e,t.context,n);o.ok&&(t.params[i]=o.data)}},ti=class extends Xs{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Js(t,this.model);t.params[e]=i}},ei=class extends Xs{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.resetParam(e)}},ai=class extends Xs{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.renewParam(e)}},si=class extends Xs{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Js(t,this.model);t.params[e]=Z(i)}},ii=class extends Xs{async exec(t){const{dstDELogicParamId:e,dstSortDir:s,dstFieldName:i}=this.model;if(!e||!i)throw new a(this.model,"缺少目标参数对象或目标属性配置");const n=i.toLowerCase();t.params[e].sort(((t,e)=>"ASC"===s?t[n]-e[n]:e[n]-t[n]))}},ni=class extends Xs{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s,dstIndex:i,srcIndex:n,srcSize:r}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const o=Js(t,this.model),c=i||0,l=n||0,h=r||o.length;t.params[e].splice(c,0,...o.slice(l,h))}},ri=class extends Xs{async exec(t){const{errorCode:e,errorInfo:a}=this.model;throw new o({response:{status:e,statusText:a}})}},oi=class{constructor(t){this.model=t}calc(t){const e=this.model.id,a=this.model;if(a.default)t.params[e]=t.data||{};else if(a.appGlobalParam)t.params[e]=Z(ibiz.env);else if(a.entityListParam)t.params[e]=[];else{if(a.entityPageParam)throw new s(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[e]={};else if(a.lastReturnParam)t.initLastReturnParam(e);else if(a.appContextParam)t.params[e]=t.parameters.context;else if(a.simpleListParam)t.params[e]=[];else if(a.simpleParam)t.params[e]={};else if(a.cloneParam)t.params[e]=Z(t.data||{});else{if(a.envParam)throw new s(a,"未支持的逻辑参数类型: 系统环境变量");if(a.fileListParam)throw new s(a,"未支持的逻辑参数类型: 文件对象列表变量");if(a.fileParam)throw new s(a,"未支持的逻辑参数类型: 文件对象变量");if(a.filterParam)throw new s(a,"未支持的逻辑参数类型: 过滤器对象变量");if(a.lastParam)throw new s(a,"未支持的逻辑参数类型: 最后数据变量");if(a.originEntity)throw new s(a,"未支持的逻辑参数类型: 原始数据对象");if(a.sessionParam)throw new s(a,"未支持的逻辑参数类型: 操作会话变量")}}}renew(t){const e=this.model.id,a=this.model;if(a.entityListParam||a.simpleListParam||a.entityPageParam)t.params[e]=[];else{if(!a.simpleParam&&!a.entityParam)throw new s(a,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}},ci=class{constructor(t){var e,i;if(this.model=t,this.nodes=new Map,this.params=new Map,t.customCode){if(!t.scriptCode)throw new a(t,"脚本代码模式没有配置脚本代码");this.scriptFn=fa.createScriptFn([],t.scriptCode,{isAsync:!0})}else{if(!(null==(e=t.delogicNodes)?void 0:e.length))throw new a(t,"实体逻辑没有配置逻辑节点");t.delogicNodes.forEach((t=>{const{logicNodeType:e}=t;let a;switch(e){case"BEGIN":a=new $s(t);break;case"END":a=new qs(t);break;case"DEACTION":a=new Ys(t);break;case"PREPAREPARAM":a=new Qs(t);break;case"DEDATASET":a=new Zs(t);break;case"THROWEXCEPTION":a=new ri(t);break;case"BINDPARAM":a=new ti(t);break;case"RESETPARAM":a=new ei(t);break;case"COPYPARAM":a=new si(t);break;case"RENEWPARAM":a=new ai(t);break;case"APPENDPARAM":a=new ni(t);break;case"SORTPARAM":a=new ii(t);break;default:throw new s(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,a)})),null==(i=t.delogicParams)||i.forEach((t=>{this.params.set(t.id,new oi(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.thenId)&&(e.dstNode=this.nodes.get(e.model.thenId))}))}))}}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t,e,s){if(this.scriptFn)return this.scriptFn.exec({context:t,data:e,params:s});const i=new zs(this.params,t,e,s);this.initLogicParams(i);const{startDELogicNodeId:n}=this.model;if(!n||!this.nodes.has(n))throw new a(this.model,"未设置起始节点");{const t=this.nodes.get(n);await this.deepExec(t,i)}return i.isEndNode?i.result:i.params[i.defaultParamName]?i.params[i.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:a}=t;for(let s=0;s<a.length;s++){const i=a[s];if(await i.exec(e)&&i.dstNode&&(await this.deepExec(i.dstNode,e),!1===t.model.parallelOutput))break}}},li=new Map;async function hi(t,e,a,s){li.has(t)||li.set(t,new ci(t));return li.get(t).exec(e,a,s)}async function di(t,a,s,i,n){const r=await async function(t,e,a){return Ye(t,await ibiz.hub.getAppDataEntity(e,a))}(t,a,s.srfappid);if(!r)throw new e("".concat(a,"找不到实体逻辑").concat(t));return hi(r,s,i,n)}async function ui(t,e,a,s){try{const i=await hi(t,e,a,s);return new r(i)}catch(t){if(t instanceof o)return new r(t,500);throw t}}async function pi(t,e,a,s,i){const n=$e(t,e);if(n.length){(await Promise.all(n.map((t=>hi(t,a,s,i))))).forEach((t=>{Object.assign(s,t)}))}}var mi=class extends Us{get isLocalMode(){return Fs(this.method)}async exec(t,e,s){if("DELOGIC"===this.method.actionType){const i=Ye(this.method.appDELogicId,this.entity);if(!i)throw new a(this.method,"缺少实体处理逻辑");return ui(i,Z(t),e?Z(e):{},s?Z(s):{})}let i;switch(e&&!this.isLocalMode&&(e=await this.input.handle(t,e)),e&&!["READ","GETDRAFT"].includes(this.method.actionMode)&&await pi(this.entity,"change",t,e,s||{}),this.method.codeName){case"Create":i=await this.create(t,e,s||{});break;case"Get":i=await this.get(t,s);break;case"GetDraft":i=await this.getDraft(t,s);break;case"Remove":i=await this.remove(t,s);break;case"Update":i=await this.update(t,e,s);break;case"CreateTemp":i=await this.createTemp(t,e);break;case"GetTemp":i=await this.getTemp(t,e);break;case"GetDraftTemp":i=await this.getDraftTemp(t,s);break;case"RemoveTemp":i=await this.removeTemp(t,e);break;case"UpdateTemp":i=await this.updateTemp(t,e);break;default:{let a=this.calcPath(t);this.method.needResourceKey&&(a="".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]||(null==e?void 0:e[this.entity.keyAppDEFieldId])));const n=await this.request(a,t,e,s);n.data=await this.result.handle(t,n.data),i=n}}return await pi(this.entity,"compute",t,i.data,s||{}),i}async create(t,e,a){if(this.isLocalMode)return this.createTemp(t,this.createEntity(e));const s=this.calcPath(t),i=await this.app.net.post(s,e,a);return i.data=await this.result.handle(t,i.data),i}async remove(t,e){if(this.isLocalMode)return this.removeTemp(t,e);const a=this.calcPath(t);return await this.app.net.delete("".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]),e)}async update(t,e,a={}){if(this.isLocalMode)return this.updateTemp(t,this.createEntity(e));const s=this.calcPath(t),i=await this.app.net.put("".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]),e,a);return i.data=await this.result.handle(t,i.data),i}async get(t,e={}){if(this.isLocalMode)return this.getTemp(t,e);const a=this.calcPath(t),s=await this.app.net.get("".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]),e);return s.data=await this.result.handle(t,s.data),s}async getDraft(t,e){if(this.isLocalMode)return this.getDraftTemp(t,e);const a=this.calcPath(t),s=await this.app.net.get("".concat(a,"/getdraft"),e);return s.data=await this.result.handle(t,s.data),s}async createTemp(t,e){try{const a=await this.getService(),s=await a.local.add(t,this.createEntity(e));return new r(s)}catch(t){return new r(t,500)}}async getDraftTemp(t,e){try{const t=this.createEntity({});return t?new r(t):new r(t,500)}catch(t){return new r(t,500)}}async removeTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const a=(await this.getService()).local.delete(t,e);return a?new r(a):new r(a,500)}catch(t){return new r(t,500)}}async updateTemp(t,e){try{const a=(await this.getService()).local.update(t,this.createEntity(e));return a?new r(a):new r(a,500)}catch(t){return new r(t,500)}}async getTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const a=(await this.getService()).local.get(t,e);return a?new r(a):new r(a,500)}catch(t){return new r(t,500)}}async removeBatchTemp(t,e){return new r(!0)}},fi=class extends Us{get isLocalMode(){return Fs(this.method)}async exec(t,e,a){if(this.isLocalMode){const a=await this.searchLocal(null,new _s(t,e));return new r(a,200)}let i;switch(this.method.dataSetType){case"INDEXDE":case"CODELIST":case"MULTIFORM":i=await this.fetchCodeListSet(t,a);break;case"REMOTE":{const s=this.calcPath(t);i=await this.request(s,t,e,a)}break;default:throw new s(this.method,"数据来源类型".concat(this.method.dataSetType,"暂未支持"))}const n=i.data||[];return i.data=n.map((t=>this.createEntity(t))),i.data.length&&await Promise.all(i.data.map((e=>pi(this.entity,"compute",t,e,a)))),i}async selectLocal(t,e={}){let a=(await this.getService()).local.getList(t);a=X(a,"srfordervalue");const s={},i={},n={},r={};e.srfkey&&(s.srfkey=tt(e.srfkey),delete e.srfkey);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const a=e[t];null==a?(i[t]=tt(null),n[t]=tt(void 0),r[t]=tt("")):s[t]=tt(a)}if(!Q(s)){const t=et(s),e=et(i),o=et(n),c=et(r);a=a.filter((a=>{if(Q(i)){if(t(a))return!0}else if(t(a)&&(e(a)||o(a)||c(a)))return!0;return!1}))}return a.map((t=>t.clone()))}async searchLocal(t,e,a=this.entity.quickSearchAppDEFieldIds){const s=await this.getService();let i=[];t?(i=s.local.getList(e.context),i.length>0&&(i=i.filter((a=>t.test(a,e))))):(i=await this.selectLocal(e.context),i.length>0&&e.query&&""!==e.query&&a&&(i=i.filter((t=>{const s=new RegExp(e.query);for(let e=0;e<a.length;e+=1){const i=t[a[e]];if(s.test(i))return!0}return!1})))),q(e.sortField)||Q(e.sortField)||(i="DESC"===e.sortMode?Y(i,e.sortField):X(i,e.sortField));const{page:n,size:r}=e,o=n*r,c=(n+1)*r-1;return i.slice(o,c).map((t=>Z(t)))}async fetchCodeListSet(t,e){const{appCodeListId:s}=this.method;if(!s)throw new a(this.method,"没有指定数据来源代码表");const i=await this.app.codeList.get(s,t,e),{keyAppDEFieldId:n,majorAppDEFieldId:o}=this.entity,c=i.map((t=>({[n]:t.value,[o]:t.text})));return new r(c,200)}},gi=class extends fi{mergeRequestPath(t,e){return"".concat(t,"/ac/").concat(e,"?srfac=ac")}},wi=t("DEService",class{constructor(t){this.model=t,this.methodMap=new Map,this.local=new bs,this.configCache=new Ls(t.appId,"PSAppDataEntity",t.codeName),this.wf=new Os(t),this.file=new Ms(t)}getMethod(t,e=!1){const a=e?"ac-".concat(t):t;if(this.methodMap.has(a))return this.methodMap.get(a);const i=We(this.model.appDEMethods,t);let n=null;switch(i.methodType){case"DEACTION":n=new mi(this.model,i);break;case"FETCH":case"FETCHTEMP":n=e?new gi(this.model,i):new fi(this.model,i);break;default:throw new s(i,"未支持的服务方法类型: ".concat(i.methodType))}return this.methodMap.set(a,n),n}exec(t,a,s,i){const n=this.getMethod(t);if(n)return n.exec(a,s,i);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}execAc(t,a,s,i={}){const n=this.getMethod(t,!0);if(n)return n.exec(a,s,i);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}aiChatSse(t,e,a={},s={}){const i=ibiz.hub.getApp(this.model.appId),n=this.calcSsePath(e);return new Promise(((e,r)=>{i.net.sse("/".concat(n),{srfactag:"AIChat",...a},{headers:{"Content-Type":"application/json"},body:JSON.stringify(s),onmessage:e=>{if(e.data){const a=JSON.parse(e.data);t(a)}},onclose:()=>{e()},onerror:t=>{r(t)}})}))}calcSsePath(t){const e=t[this.model.codeName.toLowerCase()],a="/".concat(this.model.codeName2.toLowerCase(),"/ssechatcompletion").concat(e?"/".concat(e):"");return xs(t,this.model)+a}}),Ei=t("ControlVO",class t{get srfuf(){return q(this.$origin.srfuf)?this.srfkey?1:0:this.$origin.srfuf}get srfkey(){return this.$origin.srfkey}get srfmajortext(){return this.$origin.srfmajortext}get srfdeid(){return this.$origin.srfdeid}get srfdecodename(){return this.$origin.srfdecodename}get srfkeyfile(){return this.$origin.srfkeyfile}get srfmajorfile(){return this.$origin.srfmajorfile}constructor(t={},e=new Map){Object.defineProperty(this,"$origin",{enumerable:!1,configurable:!0,value:t||{}}),Object.defineProperty(this,"$dataUIMap",{enumerable:!1,configurable:!0,value:e||new Map}),this.$dataUIMap.forEach(((t,e)=>{const a=t.dataKey;this.linkProperty(e,a,t)})),Object.keys(t).forEach((t=>{Object.prototype.hasOwnProperty.call(this,t)||this.linkProperty(t,t)}))}linkProperty(t,e,a){const s=!a||a.isOriginField;"srfuf"!==t&&(s||Object.prototype.hasOwnProperty.call(this.$origin,t)?Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return"srfkey"===t?this.$origin[e]||this.$origin[t]:this.$origin[e]},set(t){this.$origin[e]=t}}):Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:null}))}getOrigin(){return this.$origin}setOrigin(e){this.$origin=e instanceof t?e.getOrigin():e}clone(){const e=Z(this.$origin),a=new t(e,this.$dataUIMap);return Object.keys(this).forEach((t=>{a[t]=this[t]})),a}}),vi=t("ControlService",class{constructor(t){this.dataUIMap=new Map,this.model=t}async init(t){this.app=ibiz.hub.getApp(null==t?void 0:t.srfappid),this.initUIDataMap()}initUIDataMap(){}async exec(t,e,a,s){return await this.app.deService.exec(this.model.appDataEntityId,t,e,a,s)}handleResponse(t){return t}toUIData(t){return new Ei(t,this.dataUIMap)}}),yi=t("MDControlService",class extends vi{async fetch(t,e={}){var a;const s=(null==(a=this.model.fetchControlAction)?void 0:a.appDEMethodId)||"fetchdefault";let i=await this.exec(s,t,e);return i=this.handleResponse(i),i}async get(t,e={}){var a;const s=(null==(a=this.model.getControlAction)?void 0:a.appDEMethodId)||"get";let i=await this.exec(s,t,void 0,e);return i=this.handleResponse(i),i}async getDraft(t,e={}){var a;const s=(null==(a=this.model.getDraftControlAction)?void 0:a.appDEMethodId)||"getdraft";let i=await this.exec(s,t,void 0,e);return i=this.handleResponse(i),i}async remove(t,e={}){var a;const s=(null==(a=this.model.removeControlAction)?void 0:a.appDEMethodId)||"remove";return await this.exec(s,t,void 0,e)}async create(t,e){var a;const s=(null==(a=this.model.createControlAction)?void 0:a.appDEMethodId)||"create";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}async update(t,e){var a;const s=(null==(a=this.model.updateControlAction)?void 0:a.appDEMethodId)||"update";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}async exportData(t,a,s={}){throw new e("未实现")}handleResponse(t){const e=super.handleResponse(t);return e.headers&&(e.headers["x-page"]&&(e.page=Number(e.headers["x-page"])),e.headers["x-per-page"]&&(e.size=Number(e.headers["x-per-page"])),e.headers["x-total"]&&(e.total=Number(e.headers["x-total"]))),e.ok&&(j(e.data)?e.data=e.data.map((t=>this.toUIData(t))):e.data=this.toUIData(e.data)),e}}),Ii=t("DeAuthorityService",class{constructor(t){this.entityModel=t}async calcByDataAccessAction(t,e){if(e.srfopprivs&&!e.srfopprivs.includes(t))return!1;return!!await this.calcByDeMainState(t,e)}async calcByDeMainState(t,e){let a=!0;const s=this.entityModel;if(!s.enableDEMainState)return ibiz.log.debug("".concat(s.codeName,"实体不存在或者为启用主状态,返回true")),a;ibiz.log.debug("操作标识".concat(t,"主状态计算开始"),e,s);const i=je(s,e);if(i){ibiz.log.debug("匹配主状态",i);const e=Ge(i,s);ibiz.log.debug("允许的主状态权限集合",e),a=e.includes(t)}else ibiz.log.debug("没匹配主状态,返回false"),a=!1;return ibiz.log.debug("操作标识".concat(t,"权限计算结束:").concat(a)),a}}),Di=t("AuthorityService",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map,this.resCodes=[],this.enablePermission=!1}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const a=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!a)throw new e("未找到应用实体[".concat(t,"]"));const s=this.constructorCache.get(t);let i;i=s?await s(a):new Ii(a),this.cache.set(t,i)}return this.cache.get(t)}async init(t=ibiz.appData){t&&(t.unires&&(this.resCodes=t.unires),!0===t.enablepermissionvalid&&ibiz.env.enablePermission&&(this.enablePermission=!0))}calcByResCode(t){return!this.enablePermission||this.resCodes.includes(t)}async calcByDataAccessAction(t,e,a){if(this.enablePermission){const e=await ibiz.hub.getApp(this.appModel.appId),s=await e.getOPPriv(t,a);if(this.enablePermission&&(null==s?void 0:s.mapSysUniResCode)&&!this.calcByResCode(s.mapSysUniResCode))return!1}if(e&&a){return(await this.getService(a)).calcByDataAccessAction(t,e)}return!0}}),Ci=t("V7AuthService",class{async login(t,e){try{const a=await ibiz.net.post("/v7/login",{loginname:t,password:e}),{data:s}=a;if(s&&s.token){G(c.TOKEN,s.token,0,!0);const t=(new Date).getTime()+1e3*(s.expirein||7199);G(c.TOKEN_EXPIRES,"".concat(t),0,!0)}return!0}catch(t){ibiz.notification.error({title:"登录失败",desc:t.message||""})}return!1}async logout(){try{return await ibiz.net.get("/v7/logout"),H(c.TOKEN),H(c.TOKEN_EXPIRES),!0}catch(t){ibiz.notification.error({title:"登出失败",desc:t.message||""})}return!1}}),Ai=t("TreeNodeData",class{constructor(t,e,a){this.leaf=!1,this.leaf=!0===a.leaf,this.parent=e,this.parent&&(this.context={...this.parent.context}),a.navContext&&(this.context=Object.assign(this.context||{},a.navContext)),a.navParams&&(this.params={...a.navParams}),this.nodeId=t.id}calcIcon(t){const{sysImage:e}=t,a={};return e&&(e.cssClass&&(a.cssClass=e.cssClass),e.imagePath&&(a.imagePath=e.imagePath)),Object.values(a).length>0?a:void 0}}),bi=t("TreeCodeListNodeData",class extends Ai{constructor(t,e,a){super(t,e,a);const{data:s}=a;if(this.deData=s,this.text=s.text,this.value=s.value,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(this.value):t.id+this.value,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=He(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:this.value})}this.srfkey=this.value,this.srfmajortext=this.text,this.icon=this.calcIcon(t)}}),Pi=t("TreeDataSetNodeData",class extends Ai{constructor(t,e,a){super(t,e,a);const{data:s}=a;if(this.deData=s,this.text=s.srfmajortext,this.value=s.srfkey,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(s.srfkey):t.id+s.srfkey,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=He(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:s.srfkey})}this.srfkey=this.deData.srfkey,this.srfmajortext=this.deData.srfmajortext,this.icon=this.calcIcon(t),this.textHtml=this.calcTextHtml(t)}calcIcon(t){const e=super.calcIcon(t)||{},{iconAppDEFieldId:a,detreeNodeDataItems:s}=t;a&&this.deData[a]&&(e.imagePath=this.deData[a]),e&&(this.icon=e);const i=null==s?void 0:s.find((t=>"icon"===t.id));return i&&(e.htmlStr=this.calcDataItemScript(i)),Object.values(e).length>0?e:void 0}calcDataItemScript(t){if(t.customCode&&t.scriptCode)return fa.execScriptFn({data:this.deData},t.scriptCode,{isAsync:!1})}calcTextHtml(t){let e;const{detreeNodeDataItems:a}=t,s=null==a?void 0:a.find((t=>"text"===t.id));return s&&(e=this.calcDataItemScript(s)),e}}),Si=t("TreeStaticNodeData",class extends Ai{constructor(t,e,a){var s,i;super(t,e,a);const n="root"===t.nodeValue?void 0:t.nodeValue;if(this.id=e?"".concat(e.id,":").concat(t.id):t.id,this.id=this.id.toLowerCase(),this.text=t.text,this.value=n,e&&a.parentValueLevel){let t=e;for(let e=1;e<a.parentValueLevel;e++)t=null==t?void 0:t.parent;(null==t?void 0:t.deData)&&(this.deData=t.deData),this.value=n||(null==t?void 0:t.value)}this.srfkey=(null==(s=this.deData)?void 0:s.srfkey)||this.value,this.srfmajortext=(null==(i=this.deData)?void 0:i.srfmajortext)||this.text,this.icon=this.calcIcon(t)}}),xi=t("UIMapField",class{constructor(t,e,a={}){this.isOriginField=!1,this.isRequestNeed=!0,this.uiKey=t,this.dataKey=e,q(a.isOriginField)||(this.isOriginField=a.isOriginField),q(a.dataType)||(this.dataType=a.dataType)}convertVal(t){if(!this.dataType)return t;if(n.isNumber(this.dataType)){const e=q(t)||""===t?t:Number(t);return Number.isNaN(e)?(ibiz.log.debug("".concat(t,"不能转换成数字")),t):e}return t}}),_i=t("CalendarItemData",class{constructor(t,e){this.model=t,this.data=e}get deData(){return this.data}get navId(){return"".concat(this.itemType,"@").concat(this.id)}get itemType(){return this.model.itemType}get bkColor(){const t=this.model.bkcolorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.bkcolor}get beginTime(){const t=this.model.beginTimeAppDEFieldId;return t?this.data[t]:void 0}get color(){const t=this.model.colorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.color}get content(){const t=this.model.contentAppDEFieldId;return t?this.data[t]:void 0}get endTime(){const t=this.model.endTimeAppDEFieldId;return t?this.data[t]:void 0}get icon(){const t=this.model.iconAppDEFieldId;return t?this.data[t]:void 0}get id(){const t=this.model.idAppDEFieldId;return t&&this.data[t]?this.data[t]:this.data.srfkey}get level(){const t=this.model.levelAppDEFieldId;return t?this.data[t]:void 0}get tag2(){const t=this.model.tag2AppDEFieldId;return t?this.data[t]:void 0}get tag(){const t=this.model.tagAppDEFieldId;return t?this.data[t]:void 0}get text(){const t=this.model.textAppDEFieldId;return t?this.data[t]:void 0}get tips(){const t=this.model.tipsAppDEFieldId;return t?this.data[t]:void 0}}),Ti=t("DEServiceUtil",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const a=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!a)throw new e("未找到应用实体[".concat(t,"]"));const s=this.constructorCache.get(t);let i;i=s?await s(a):new wi(a),this.cache.set(t,i)}return this.cache.get(t)}clearTempCache(t){this.cache.forEach((e=>{e.local.clear(t)}))}async exec(t,e,a,s,i){return(await this.getService(t)).exec(e,a,s,i)}}),Li=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,a,i={},n={}){const r=Z(a),o=await ibiz.hub.config.view.get(t);if(!o)throw new e("应用视图[".concat(t,"]不存在"));if((r.srfkey||0===i.srfuf)&&o.appDataEntityId){const t=He(o.appDataEntityId);r.srfkey&&(r[t]=r.srfkey,r.srfkey=void 0),0===i.srfuf&&(r[t]=void 0,delete i.srfuf)}if(o.redirectView){return ra(await ibiz.hub.getAppView(t),r,i,n)}const{openMode:c="INDEXVIEWTAB"}=o;switch(n.openMode||c){case"INDEXVIEWTAB":return n.noWaitRoute?(this.openIndexViewTab(o,r,i),{ok:!0}):this.openIndexViewTab(o,r,i);case"POPUP":throw new s(o,"未支持的视图打开模式: POPUP");case"POPUPMODAL":return this.openModal(o,r,i);case"POPUPAPP":throw new s(o,"未支持的视图打开模式: POPUPAPP");case"POPOVER":return this.openPopover(o,n.event,r,i);case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return this.openDrawer(o,r,i);case"USER":return this.openUserCustom(o,r,i);default:return this.openIndexViewTab(o,r,i)}}openIndexViewTab(t,e,a={}){return ibiz.openView.root(t.id,e,a)}async openModal(t,e,a={}){return ibiz.openView.modal(t.id,e,a)}async openPopover(t,a,s,i={}){if(!a)throw new e("气泡打开缺少event");return ibiz.openView.popover(t.id,a,s,i)}async openDrawer(t,e,a={}){return ibiz.openView.drawer(t.id,e,a)}async openUserCustom(t,e,a={}){return ibiz.openView.custom(t.id,e,a)}};Li.TAG="ibiz.app-view.open";var Ni=t("OpenAppViewCommand",Li),Oi=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,a,i={},n={}){const r=ibiz.hub.getApp(a.srfappid).getAppFunc(t);if(!r)throw new e("找不到叫".concat(t,"的应用功能"));const{navigateContexts:o,navigateParams:c,appFuncType:l}=r,h=a.clone();Object.assign(h,Me(o,i,a));const d=Me(c,i,a);switch(l){case"APPVIEW":return this.openAppView(r,h,d,n);case"OPENHTMLPAGE":return this.openHtmlPage(r);case"PDTAPPFUNC":return this.openPdAppFunc(r,h,d);case"JAVASCRIPT":return this.executeJavaScript(r,h,d);case"CUSTOM":return this.custom(r,h,d);default:throw new s(r,"未支持的应用功能类型: ".concat(l))}}async openAppView(t,a,s,i){if(!t.appViewId)throw new e("应用视图[".concat(t.appViewId,"]不存在"));return ibiz.commands.execute(Ni.TAG,t.appViewId,a,s,i)}openHtmlPage(t){const e=t.htmlPageUrl;window.open(e,"_blank")}openPdAppFunc(t,a,s){throw ibiz.log.warn("openPdAppFunc",t,a,s),new e("未实现")}executeJavaScript(t,a,s){throw ibiz.log.warn("executeJavaScript",t,a,s),new e("未实现")}custom(t,a,s){throw ibiz.log.warn("custom",t,a,s),new e("未实现")}};Oi.TAG="ibiz.app-func.exec";var Mi=t("AppFuncCommand",Oi);function Ri(){new Mi,new Ni}var Vi=t("Application",class{constructor(t){this.model=t,this.deName2DeCodeName=new Map,this.net=new l({baseURL:"".concat(ibiz.env.baseUrl,"/").concat(t.appId)}),this.configCache=new Ls(t.appId,"PSSysApp",t.codeName),this.deService=new Ti(t),this.codeList=new Ts(t),this.authority=new Di(t)}get appId(){return this.model.appId}async init(){await this.authority.init(),await this.loadAppModelStyle()}async loadAppModelStyle(){const t=await ibiz.hub.getAppStyle(this.appId);if(t){const e=document.createElement("style");e.setAttribute("type","text/css"),e.id=this.appId,e.innerHTML=t,document.head.appendChild(e)}}getAppFunc(t){return(this.model.appFuncs||[]).find((e=>e.id===t))||null}async getUIAction(t){const[,e]=t.split("@");if(e){const a=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUIActions.find((e=>e.id===t));if(a)return a}return this.model.appDEUIActions.find((e=>e.id===t))}async getOPPriv(t,e){var a,s;let i=null==(a=this.model.deopprivs)?void 0:a.find((e=>e.name===t));if(!i&&e){i=null==(s=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).deopprivs)?void 0:s.find((e=>e.name===t))}return i}async getDEUILogic(t,e){return(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUILogics.find((e=>e.id===t))}}),ki=class{parse(t){return t}},Fi=class{constructor(){this.appMenu=new ki}},Wi=class{constructor(){this.viewConfigs=new Map}set(t,e){this.viewConfigs.set(t,e)}async get(t){if(!this.viewConfigs.has(t)){const a=await ibiz.hub.getAppView(t);if(!a)throw new e("视图[".concat(t,"]不存在"));this.set(a.id,{id:a.id,codeName:a.codeName,openMode:a.openMode,viewType:a.viewType,width:a.width,height:a.height,appDataEntityId:a.appDataEntityId,redirectView:a.redirectView})}return this.viewConfigs.get(t)}},Bi=class{constructor(){this.view=new Wi}},Ui=t("FormNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Ui||{})),zi=t("GridNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(zi||{})),ji=t("PanelNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(ji||{})),Gi=t("Counter",class{constructor(t){this.callback=t,this.count=0,this.state="Unused",this.reusable=!0}increment(){return"Used"===this.state||(this.count+=1),this.count}decrement(t){if("Used"!==this.state){if(0===this.count)throw new e("错误的调用!decrement不能对count为0调用");this.count-=1,0===this.count&&(t?t():this.callback&&this.callback(),this.reusable||(this.state="Used"))}}destroy(){this.callback=void 0}}),Hi=t("LoadingState",class{constructor(){this.isLoading=!1,this.counter=new Gi(h)}begin(){this.isLoading=!0,this.counter.increment()}end(){this.counter.decrement((()=>{this.isLoading=!1}))}}),Ki=t("CTXState",class{}),Xi=t("CTX",class{constructor(t){this.parent=t,this.isDestroyed=!1,this.evt=new U(3e3),this.controllersMap=new Map,this.state=new Ki}async init(t){this.view=t,this.registerController(t.model.name,t)}destroy(){this.controllersMap.clear(),this.view=null,this.state=null,this.isDestroyed=!0}async setState(t){Object.assign(this.state,t)}startLoading(){this.view.startLoading()}endLoading(){this.isDestroyed||this.view.endLoading()}registerController(t,e){this.controllersMap.set(t,e),this.evt.emit("onRegister",t,e)}getController(t,e=!1){return this.controllersMap.has(t)?this.controllersMap.get(t):this.parent&&e?this.parent.getController(t):void 0}getTopView(){return this.parent?2===this.view.modal.routeDepth?this.view:this.parent.getTopView():this.view}}),Yi=t("ActivityCounter",class extends Gi{constructor(){super(...arguments),this.reusable=!1,this.registration=new Map}enroll(t){"Unused"!==this.state||this.registration.has(t)||(this.registration.set(t,!1),this.increment())}attend(t){this.registration.has(t)&&!1===this.registration.get(t)&&(this.registration.set(t,!0),this.decrement())}}),$i=t("UIActionButtonState",class{constructor(t,e,a){this.disabled=!1,this.visible=!0,this.loading=!1,this.permitted=!0,this.noPermissionHidden=!0,this.noDataDisabled=!1,this.isInit=!1,this.name=t,this.uiActionId=a,this.appId=e}async init(){if(!this.uiActionId)return void(this.isInit=!0);const t=await Je(this.uiActionId);if([,this.appDeName]=this.uiActionId.split("@"),!t)return;const{dataAccessAction:e,noPrivDisplayMode:a,actionTarget:s,uiactionMode:i,uiactionTag:n}=t;this.dataAccessAction=e,1===a?this.noPermissionHidden=!1:6===a&&(this.visible=!1),(s&&"NONE"!==s||"SYS"===i&&["Save","SaveAndExit","SaveAndNew","Edit","Remove","RemoveAndExit"].includes(n))&&(this.noDataDisabled=!0),this.isInit=!0}async calcPermission(t,e){if(!this.dataAccessAction)return;const a=await ibiz.hub.getApp(this.appId);this.appDeName&&e&&!e.includes(this.appDeName)&&ibiz.log.warn("".concat(this.uiActionId,"界面行为的实体").concat(this.appDeName,"和数据的实体").concat(e,"不一致")),this.permitted=await a.authority.calcByDataAccessAction(this.dataAccessAction,t,e)}async update(t,e){this.isInit||await this.init(),await this.calcPermission(t,e),this.permitted?(this.visible=!0,this.disabled=this.noDataDisabled&&!t):(this.disabled=!0,this.visible=!this.noPermissionHidden)}}),qi=t("ButtonContainerState",class{constructor(){Object.defineProperty(this,"children",{enumerable:!1,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:()=>0!==this.children.length&&!!this.children.find((t=>t.visible))})}addState(t,e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e}),this.children.push(e)}setLoading(t){this.children.forEach((e=>{e.setLoading?e.setLoading(t):e.loading=!!t&&e.name===t}))}async update(t,e){await Promise.all(this.children.map((a=>a.update(t,e))))}}),Ji=t("QXEventEx",class extends U{constructor(){super(...arguments),this.anyEventFns=[]}onAll(t){this.anyEventFns.includes(t)||this.anyEventFns.push(t)}emit(t,...e){super.emit(t,...e),this.anyEventFns.forEach((a=>{a(t,...e)}))}async asyncEmit(t,...e){const a=super.asyncEmit(t,...e),s=this.anyEventFns.map((a=>a(t,...e))),i=Promise.all(s),n=await a,r=await i;return n.concat(...r)}reset(){super.reset(),K(this.anyEventFns)}}),Qi=t("ControllerEvent",class{constructor(t){this.getBaseArgs=t,this.isDestroyed=!1,this.evt=new Ji}async emit(t,e){this.isDestroyed||await this.evt.asyncEmit(t,{...this.getBaseArgs(),eventName:t,...e||{}})}on(t,e){this.isDestroyed||this.evt.on(t,e)}off(t,e){this.isDestroyed||this.evt.off(t,e)}onAll(t){this.isDestroyed||this.evt.onAll(t)}destroy(){this.getBaseArgs=void 0,this.evt.reset(),this.isDestroyed=!0}});function Zi(t,e){return(!q(t)&&""!==t||!q(e)&&""!==e)&&t!==e}function tn(t){let e=Array.isArray(t)?t[0]:t;return e&&e instanceof Ei&&(e=e.getOrigin()),e}function en(t,a,s){const i=[];return t.forEach((t=>{const{valueRuleType:n}=t,r=t.sysValueRule,o=t.defvalueRule;if("SYSVALUERULE"===n&&r)"REG"===r.ruleType?i.push({pattern:new RegExp(r.regExCode),message:r.ruleInfo,trigger:"change blur"}):"SCRIPT"===r.ruleType&&i.push({validator:(t,e,a,s)=>{if(!e)return!0;try{fa.execScriptFn({rule:t,value:e,callback:a,source:s},r.scriptCode,{isAsync:!1})}catch(t){return console.error(t),!1}return!0},trigger:"change blur"});else if("DEFVALUERULE"===n&&o){const t=s||a;i.push({validator:(a,s,i,n)=>{if(W(n[t]))return!0;const{isPast:r,infoMessage:c}=ga(t,n,o.groupCond);return r||i(new e(c||o.ruleInfo)),!0},trigger:"change blur"})}})),i}var an=t("ValueExUtil",class{static mergeDefault(t){return at(t,{textSeparator:",",valueSeparator:","})}static toText(t,a){if(q(a)||""===a)return"";const{valueType:s,objectNameField:i,textSeparator:n}=this.mergeDefault(t);if(["OBJECTS","OBJECT"].includes(s)){if(!i)throw new e("缺少objectNameField");const t=i.toLowerCase();return"OBJECTS"===s?a.map((e=>e[t]||"---")).join(n):a[t]}return"SIMPLES"===s?a.join(n):"".concat(a)}});function sn(t,a){var i;const{name:n,valueType:r,defaultValue:o,valueFormat:c}=t,{data:l,context:h,params:d}=a;if(q(r)&&q(o))return;if("RESET"===r)return null;const u=l[n];if(!st(u)){if(!r&&o)return o;switch(r){case"APPDATA":if(Object.prototype.hasOwnProperty.call(d,o))return d[o];if(Object.prototype.hasOwnProperty.call(h,o))return h[o];break;case"OPERATORNAME":return h.srfusername;case"OPERATOR":return h.srfuserid;case"CURTIME":return nt().format(c);case"PARAM":return l[o];case"SESSION":case"APPLICATION":if(!(null==(i=ibiz.appData)?void 0:i.context))throw new e("appdata.context不存在");return ibiz.appData.context[o];case"CONTEXT":return d[o];case"UNIQUEID":return z();default:throw new s({},"默认值类型[".concat(r,"]未支持"))}}}var nn="__self",rn=t("BaseController",class{constructor(t,e,a,s){this.model=t,this.context=e,this.params=a,this.ctx=s,this.state={},this.name="",this.evt=new Qi(this.getEventArgs.bind(this)),this.mountCounter=new Yi(this.mounted.bind(this)),this.childNames=[],this.name=t.name||t.id,this.initState()}get _evt(){return this.evt}initState(){this.state.isCreated=!1,this.state.isMounted=!1,this.state.isDestroyed=!1}getEventArgs(){return{context:this.context,params:this.params,data:[],targetName:this.model.name,view:this.ctx.view}}async created(){this.mountCounter.enroll(nn),await this.onCreated(),this.state.isCreated=!0,this.force((()=>{this.mountSelf()})),ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onCreated")),this._evt.emit("onCreated",void 0)}async onCreated(){this.ctx.evt.on("onForecast",(t=>{this.childNames.includes(t)&&this.mountCounter.enroll(t)})),this.ctx.evt.on("onRegister",((t,e)=>{this.childNames.includes(t)&&e.evt.on("onMounted",(()=>{this.mountCounter.attend(t)}))}))}async mountSelf(){this.mountCounter.registration.get(nn)||this.mountCounter.attend(nn)}async mounted(){await this.onMounted(),this.state.isMounted=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onMounted")),this._evt.emit("onMounted",void 0)}async onMounted(){}async destroyed(){await this.onDestroyed(),this.state.isDestroyed=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onDestroyed")),await this._evt.emit("onDestroyed",void 0),this.evt.destroy()}async onDestroyed(){}force(t){}getController(t,e=!1){return this.ctx.getController(t,e)}getTopView(){return this.ctx.getTopView()}listenNewController(t){this.ctx.evt.on("onRegister",t)}}),on=class t{constructor(t){this.msgGroupId=t,this.viewMsgMap=new Map}async init(t){var a,s;const i=ibiz.hub.getApp(t.srfappid).model,n=null==(a=i.appViewMsgGroups)?void 0:a.find((t=>t.id===this.msgGroupId));if(!n)throw new e("找不到视图消息组".concat(this.msgGroupId,"的模型"));this.msgGroup=n;const r=n.appViewMsgGroupDetails.map((t=>t.appViewMsgId));if(null==(s=i.appViewMsgs)||s.forEach((t=>{const e=r.indexOf(t.id);-1!==e&&(this.viewMsgMap.set(t.id,t),r.splice(e,1))})),r.length)throw new e("没有找到".concat(r.join(","),"视图消息模型"))}getDeFieldName(t,e){var a,s;if(e)return null==(s=null==(a=qe(t,e))?void 0:a.name)?void 0:s.toLowerCase()}static async fetchDataSet(t,e,s){const{appDataEntityId:i,appDEDataSetId:n}=t;if(!n)throw new a(t,"未配置实体数据集");const r=await ibiz.hub.getApp(e.srfappid).deService.exec(i,n,e,s);return r.data.length?r.data:[]}async calcViewMessages(t,e){const a=this.msgGroup.appViewMsgGroupDetails,s=[];return(null==a?void 0:a.length)&&await Promise.all(a.map((async a=>{if(1===this.viewMsgMap.get(a.appViewMsgId).dynamicMode){const i=await this.calcDynaMsgs(a,t,e);s.push(...i)}else{const t=this.calcStaticMsg(a);s.push(t)}}))),s}calcStaticMsg(t){const{position:e}=t,{title:a,message:s,removeMode:i,position:n,messageType:r}=this.viewMsgMap.get(t.appViewMsgId);return{title:a,message:s,position:e||n,messageType:r,removeMode:i}}async calcDynaMsgs(e,s,i){const n=this.viewMsgMap.get(e.appViewMsgId),{appDataEntityId:r,orderValueAppDEFieldId:o,titleAppDEFieldId:c,removeFlagAppDEFieldId:l,msgTypeAppDEFieldId:h,contentAppDEFieldId:d,msgPosAppDEFieldId:u}=n;if(!r)throw new a(n,"未配置应用实体");const p=await ibiz.hub.getAppDataEntity(r,s.srfappid),m={...i},f=this.getDeFieldName(p,o);f&&(m.sort="".concat(f,",asc"));const g=await t.fetchDataSet(n,s,m);if(!g.length)return[];const w=this.calcStaticMsg(e),E=this.getDeFieldName(p,c),v=this.getDeFieldName(p,u),y=this.getDeFieldName(p,d),I=this.getDeFieldName(p,h),D=this.getDeFieldName(p,l);return g.map((t=>{const e={};return v&&!q(t[v])&&(e.position=t[v]),E&&!q(t[E])&&(e.title=t[E]),y&&!q(t[y])&&(e.message=t[y]),I&&!q(t[I])&&(e.messageType=t[I]),D&&!q(t[D])&&(e.removeMode=t[D]),J(w,e)}))}},cn=t("ViewController",class extends rn{constructor(t,e,a,s){super(ibiz.util.layoutPanel.fill(t),i.create({},e),a||{},new Xi(s)),this.session={},this.modal=new Ta({}),this.providers={},this.engines=[],this.slotProps={},this.counters={},this.viewLoading=new Hi,this.isCloseView=!1,this._isActive=!0,s&&s.registerController(this.model.name,this),this.ctx.init(this),this.initEngines()}get _evt(){return this.evt}get parentView(){var t;return null==(t=this.ctx.parent)?void 0:t.view}get isActive(){return this._isActive}onActivated(){this._isActive=!0,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")激活"))}onDeactivated(){this._isActive=!1,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")暂停"))}initEngines(){const t=na(this.model);if(t.length)t.forEach((t=>{const e=ibiz.engine.getEngine(t,this);e&&this.engines.push(e)}));else{const t=ibiz.engine.getEngine({engineCat:"VIEW",engineType:this.model.viewType},this);t&&this.engines.push(t)}}async initCounters(){const t=this.model.viewLayoutPanel,{appCounterRefs:e}=t;if(e&&e.length>0)try{await Promise.all(e.map((async t=>{const e=await Ns.getCounterByRef(t,this.context);this.counters[t.id]=e})))}catch(t){console.error(t)}}initState(){super.initState(),this.state.isLoading=!1,this.state.caption=this.model.caption,this.state.srfactiveviewdata=null,this.state.viewMessages={}}async onCreated(){await super.onCreated(),this.modal.hooks.beforeDismiss.tapPromise((async t=>{st(this.state.closeOK)&&(t.ok=this.state.closeOK),await this._evt.emit("onCloseView",{...t})})),this._evt.emit("onViewInfoChange",{caption:this.model.caption,title:this.model.title}),this.handleContextParams();const t=this.model.viewLayoutPanel;this.childNames.push(t.name);const e=await Ka(t);this.providers[t.name]=e;const a=sa(this.model);a&&await Promise.all(a.map((async t=>{const e=await Ka(t);this.providers[t.name||t.id]=e}))),await this.initCounters();const s=ia(this.model);s.length&&(this.scheduler=ibiz.scheduler.createViewScheduler(s),this.scheduler.defaultParamsCb=()=>this.getEventArgs(),this.scheduler.hasViewEventTrigger&&this.evt.onAll(((t,e)=>{this.scheduler.triggerViewEvent(e)}))),this.initViewMsg(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onCreated())))}async onMounted(){var t;await super.onMounted(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onMounted()))),null==(t=this.scheduler)||t.startTimerTrigger()}async onDestroyed(){await super.onDestroyed(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onDestroyed()))),this.ctx.destroy(),this.context.destroy(),this.engines=[],this.scheduler&&this.scheduler.destroy(),ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")销毁"))}handleContextParams(){this.context.srfappid=this.model.appId,(q(this.context.srfsessionid)||Q(this.context.srfsessionid))&&(this.context.srfsessionid=z());const t=this.model.appViewNavContexts;let e={};F(t)&&(e=Me(t,this.params,this.context)),Object.assign(this.context,e);const a=this.model.appViewNavParams;let s={};F(a)&&(s=Me(a,this.params,this.context)),Object.assign(this.params,s),this.state.isMounted&&this.callUIAction("Refresh")}async call(t,e){let a;for(const s of this.engines)if(a=await s.call(t,e),void 0!==a)break;return a}async callUIAction(t,a){const s=this.call(t,a);if(void 0===s)throw new e("没有引擎支持预置界面行为".concat(t));return s}async closeView(t={ok:!1,data:[]}){await this.modal.dismiss(t)}startLoading(){this.viewLoading.begin(),this.state.isLoading=this.viewLoading.isLoading}endLoading(){this.viewLoading.end(),this.state.isLoading=this.viewLoading.isLoading}setLayoutPanel(t){var e;this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)})),(null==(e=this.scheduler)?void 0:e.hasControlEventTrigger)&&t.evt.on("onControlEvent",(t=>{this.scheduler.triggerControlEvent(t.triggerControlName,t.triggerEventName,t.triggerEvent)}))}async initViewMsg(){const{appViewMsgGroupId:t}=this.model;if(t){this.state.viewMessages={TOP:[],BOTTOM:[],BODY:[],POPUP:[]},this.viewMsgController=new on(t),await this.viewMsgController.init(this.context);(await this.viewMsgController.calcViewMessages(this.context,this.params)).forEach((t=>{["TOP","BOTTOM","BODY","POPUP"].includes(t.position)&&this.state.viewMessages[t.position].push(t)})),this.state.viewMessages.POPUP.length&&this.alertViewMessage(this.state.viewMessages.POPUP)}}async alertViewMessage(t){const[e,...a]=t,s={title:e.title,desc:e.message};"WARN"===e.messageType?await ibiz.modal.warning(s):"ERROR"===e.messageType?await ibiz.modal.error(s):await ibiz.modal.info(s),a.length&&this.alertViewMessage(a)}}),ln=(t("MobViewController",class extends cn{}),t("WFStepTraceViewController",class extends cn{initState(){super.initState(),this.state.historyData=null}async onCreated(){var t;await super.onCreated();const e=ibiz.hub.getApp(this.context.srfappid);if(null==(t=this.ctx.parent)?void 0:t.view.model.appDataEntityId){const t=await e.deService.getService(this.ctx.parent.view.model.appDataEntityId),a=Object.assign(this.context.clone(),this.params),s=await t.wf.getWFHistory(a);s.data&&(this.state.historyData=s.data)}}}),t("EditorController",class{constructor(t,e){this.style={},this.placeHolder="",this.editorParams={},this.model=t,this.parent=e,this.context=e.context,this.params=e.params}get readonly(){return!!this.model.readOnly}async init(){await this.onInit()}async onInit(){if(this.model.placeHolder&&(this.placeHolder=this.model.placeHolder),this.model.editorParams&&Object.keys(this.model.editorParams).forEach((t=>{this.editorParams[t]=this.model.editorParams[t]})),this.model.editorWidth){const t=this.model.editorWidth;this.style.width=t>0&&t<=1?"".concat(100*t,"%"):"".concat(t,"px")}if(this.model.editorHeight){const t=this.model.editorHeight;this.style.height=t>0&&t<=1?"".concat(100*t,"%"):"".concat(t,"px")}}handlePublicParams(t,e,a){const{navigateContexts:s,navigateParams:i}=this.model;let n={};s&&t&&(n=Me(s,t,a,e));const r=Object.assign(e.clone(),n);let o={};return i&&t&&(o=Me(i,t,a,e)),{context:r,params:o}}toObj(t){if(!t)return;return new Function("return (".concat(t,");"))()}toBoolean(t){return Object.is("true",t)}})),hn=(t("CodeListEditorController",class extends ln{async loadCodeList(t){const{context:e,params:s}=this.handlePublicParams(t,this.context,this.params);if(this.model.appCodeListId){const t=await ibiz.hub.getApp(this.context.srfappid);let a=[];return a=await t.codeList.get(this.model.appCodeListId,e,s),a}throw new a(this.model,"编辑器类型[".concat(this.model.editorType,"],未配置代码表"))}}),t("ControlController",class extends rn{constructor(t,e,a,s){super(t,e,a,s),this.controlParams={},this.providers={},this.registerToCtx();const i=ibiz.util.layoutPanel.get("".concat(t.controlType,"_DEFAULT"));i&&(this.controlPanel=i)}get _evt(){return this.evt}get view(){return this.ctx.view}registerToCtx(){this.ctx.registerController(this.model.name||this.model.id,this)}getEventArgs(){return{...super.getEventArgs(),data:this.getData()||[],ctrl:this}}initState(){super.initState(),this.state.isLoading=!1}async onCreated(){if(await super.onCreated(),this.controlPanel){this.childNames.push(this.controlPanel.name);const t=await Ka(this.controlPanel);this.providers[this.controlPanel.name]=t}this.handleControlParams(),this.initControlScheduler(this.model.controlLogics)}async onMounted(){var t;await super.onMounted(),null==(t=this.scheduler)||t.startTimerTrigger()}async onDestroyed(){await super.onDestroyed(),this.scheduler&&this.scheduler.destroy()}getControlType(){return this.model.controlType}getData(){return null}async startLoading(){this.state.isLoading=!0,this.ctx.startLoading()}async endLoading(){this.state.isLoading=!1,this.ctx.endLoading()}handlerAbilityParams(t){const e=this.context.clone(),a={...this.params};let s=this.getData()||[];return(null==t?void 0:t.data)&&(s=Array.isArray(t.data)?t.data:[t.data]),(null==t?void 0:t.context)&&Object.assign(e,t.context),(null==t?void 0:t.viewParam)&&Object.assign(a,t.viewParam),{context:e,params:a,data:s}}setLayoutPanel(t){this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)}))}handleControlParams(){if(!this.model.controlParam)return;const{ctrlParams:t}=this.model.controlParam;let e={};F(t)&&(e=Me(t,this.params,this.context)),Object.assign(this.controlParams,e)}initControlScheduler(t=[]){0!==t.length&&(this.scheduler=ibiz.scheduler.createControlScheduler(t),this.scheduler.defaultParamsCb=()=>this.getEventArgs())}actionNotification(t,e){var a;const{ctrlMsg:s}=this.model,i=null==(a=null==s?void 0:s.ctrlMsgItems)?void 0:a.find((e=>e.name===t));let n,r;if(i&&i.content){r=q(i.timeout)?void 0:i.timeout/1e3;const t={...this.getEventArgs()};(null==e?void 0:e.data)&&(t.data=e.data),n=fa.execScriptFn(t,"`".concat(i.content,"`"),{isAsync:!1,singleRowReturn:!0})}else{const e="CONTROL.".concat(this.model.controlType,".").concat(t).toUpperCase();n=ibiz.i18n.t(e,""),n===e&&(n="")}if(!n&&(null==e?void 0:e.default)&&(n=e.default),!n&&(null==e?void 0:e.error)&&(n=n||e.error.message),n){if(null==e?void 0:e.error)throw ibiz.log.error(e.error),new d(n,r);ibiz.message.success(n,r,0===r)}}})),dn=t("MDControlController",class extends hn{constructor(){super(...arguments),this.fieldIdNameMap=new Map}get _evt(){return this.evt}initState(){super.initState(),this.state.items=[],this.state.selectedData=[],this.state.searchParams={},this.state.noSort=!1,this.state.sortQuery="",this.state.curPage=1,this.state.size=20,this.state.total=0,this.state.isLoaded=!1,this.state.singleSelect=!0,this.state.mdctrlActiveMode=0,this.state.groups=[]}async onCreated(){var t;await super.onCreated(),this.dataEntity=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId),null==(t=this.dataEntity.appDEFields)||t.forEach((t=>{this.fieldIdNameMap.set(t.id,t.name)})),this.onDataChange=this.onDataChange.bind(this),ibiz.mc.command.change.on(this.onDataChange),this.setSort()}async onMounted(){await super.onMounted(),this.state.loadDefault&&this.load({isInitialLoad:!0})}onDestroyed(){return ibiz.mc.command.change.off(this.onDataChange),super.onDestroyed()}onDataChange(t){t.data&&t.data.srfdecodename===this.dataEntity.codeName&&this.refresh()}setSort(t,e){t&&e&&(this.state.sortQuery="".concat(t,",").concat(e))}async getFetchParams(t){const{curPage:e,size:a,sortQuery:s,noSort:i}=this.state,n={...this.params};return a&&(n.page=e-1,n.size=a),!i&&s&&(n.sort=s),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),t&&Object.assign(n,t),n}async load(t={}){if(this.state.isSimple)return[];await this.startLoading();try{const e=!0===t.isInitialLoad,a=!0===t.isLoadMore;e?this.state.curPage=1:a&&(this.state.curPage+=1);const{context:s}=this.handlerAbilityParams(t),i=await this.getFetchParams(null==t?void 0:t.viewParam),n=await this.service.fetch(s,i);"number"==typeof n.total&&(this.state.total=n.total),a?this.state.items.push(...n.data):this.state.items=n.data,await this.afterLoad(t,n.data),this.state.isLoaded=!0,await this._evt.emit("onLoadSuccess",{isInitialLoad:e})}catch(t){throw await this._evt.emit("onLoadError",void 0),this.actionNotification("FETCHERROR",{error:t}),t}finally{await this.endLoading()}return this.actionNotification("FETCHSUCCESS"),this.state.items}async afterLoad(t,e){return e}async refresh(){await this.load({isInitialLoad:!1})}async remove(t){const{context:a,params:s,data:i}=this.handlerAbilityParams(t);if(!(null==i?void 0:i.length))throw new e("未选中数据");if(!0!==(null==t?void 0:t.silent)){if(!await ibiz.confirm.error({title:"数据删除",desc:"确认删除数据?"}))return}await this._evt.emit("onBeforeRemove",void 0),await this.startLoading();let n=!1;try{const e=He(this.model.appDataEntityId);await Ma(i.map((async t=>{if(0!==t.srfuf){const i=a.clone();i[e]=t.srfkey,await this.service.remove(i,s),n=!0}this.afterRemove(t)}))),!0!==(null==t?void 0:t.silent)&&this.actionNotification("REMOVESUCCESS",{data:i,default:"数据[".concat(i.map((t=>t.srfmajortext)).join("、"),"]删除成功!")}),n&&await this.refresh()}catch(t){throw await this._evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t,data:i}),t}finally{await this.endLoading()}this.state.selectedData=[],await this._evt.emit("onRemoveSuccess",void 0)}afterRemove(t){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));-1!==e&&this.state.items.splice(e,1)}getData(){return this.state.selectedData||[]}setActive(t){return this._evt.emit("onActive",{data:[t]})}setSelection(t){const{selectedData:e}=this.state;u(e,t)||(this.state.selectedData=t,this._evt.emit("onSelectionChange",{data:t}))}async onRowClick(t){const{selectedData:e}=this.state,a=e.filter((e=>e.srfkey!==t.srfkey));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a),1===this.state.mdctrlActiveMode&&await this.setActive(t)}async onDbRowClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}async importData(){}async exportData(t){}}),un=t("AppMenuController",class extends hn{initState(){super.initState(),this.state.menuItemsState={}}get routeDepth(){return this.view.modal.routeDepth}async onCreated(){var t;await super.onCreated(),this.app=await ibiz.hub.getApp(this.context.srfappid),null==(t=this.model.appMenuItems)||t.forEach((t=>{this.initMenuItemState(t)}))}async onClickMenuItem(t,s,i=!0){const n=p(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!n)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:s}),!n.appFuncId)throw new a(n,"没有配置应用功能");const r=this.context.clone();this.routeDepth&&i&&Object.assign(r,{toRouteDepth:this.routeDepth+1}),await ibiz.commands.execute(Mi.TAG,n.appFuncId,r,this.params)}initMenuItemState(t){var e;const a={permitted:!0,visible:!0};if(t.hidden)a.visible=!1;else{let s=!0;t.accessKey&&(s=this.app.authority.calcByResCode(t.accessKey));let i=s;if(null==(e=t.appMenuItems)?void 0:e.length){const e=t.appMenuItems.map((t=>this.initMenuItemState(t).visible));i=i&&e.includes(!0)}a.permitted=s,a.visible=i}return this.state.menuItemsState[t.id]=a,a}getAllItems(){const t=[],e=a=>{a.forEach((a=>{t.push(a),a.appMenuItems&&a.appMenuItems.length>0&&e(a.appMenuItems)}))};return e(this.model.appMenuItems),t}getCounter(t){const{counters:e}=this.ctx.view;return e[t]?e[t]:null}}),pn=(t("AppMenuIconViewController",class extends un{async onClickMenuItem(t,s){const i=p(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!i)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:s}),!i.appFuncId)throw new a(i,"没有配置应用功能");const n=this.context.clone();1===this.routeDepth&&Object.assign(n,{toRouteDepth:1}),await ibiz.commands.execute(Mi.TAG,i.appFuncId,n,this.params)}}),t("CalendarService",class extends yi{async search(t,e={}){const{sysCalendarItems:a}=this.model;if(!a)return[];const s=a.map((async a=>{const s=a.appDEDataSetId||"fetchdefault";return this.exec2(s,t,e,void 0,a.appDataEntityId)}));return(await Promise.all(s)).map(((t,e)=>this.setCalendarConfigData(t.data,e))).flat()}setCalendarConfigData(t,a){const{sysCalendarItems:s}=this.model;if(!s)throw new e("未找到日历项模型");const i=s[a];if(!i)throw new e("未找到日历项模型");return t.map((t=>new _i(i,t)))}async exec2(t,e,a={},s={},i=this.model.appDataEntityId){return await this.app.deService.exec(i,t,e,a,s)}}));t("CalendarController",class extends dn{initState(){super.initState(),this.state.selectedDate=new Date,this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new pn(this.model),await this.service.init(this.context)}async load(t={}){const e=!0===t.isInitialLoad,{context:a}=this.handlerAbilityParams(t),s=await this.getFetchParams(null==t?void 0:t.viewParam);let i;await this.startLoading();try{i=await this.service.search(a,s)}finally{await this.endLoading()}return await this.afterLoad(t,i),this.state.isLoaded=!0,this.state.items=i,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),i}getCurSelectDate(t){const{selectedDate:e}=this.state,{start:a,end:s}=t;if(!a||!s){const t=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,1);return{start:nt(t).format("YYYY-MM-DD HH:mm:ss"),end:nt(a).format("YYYY-MM-DD HH:mm:ss")}}return{start:a,end:s}}async getFetchParams(t={}){const{curPage:e,size:a,sortQuery:s,noSort:i}=this.state,n={...this.params};!i&&s&&(n.sort=s),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),a&&(n.page=e-1,n.size=a),t&&Object.assign(n,t);const r=this.getCurSelectDate(n);return Object.assign(n,r),n}async onRowClick(t){const{selectedData:e}=this.state,a=e.filter((e=>e.deData.srfkey!==t.deData.srfkey));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a),1===this.state.mdctrlActiveMode&&await this.setActive(t)}setSelectDate(t){this.state.selectedDate=t}});nt.extend(rt),nt.extend(ot),nt.extend(ct),nt.extend(lt),nt.extend(ht);var mn="$default_group",fn=class{constructor(t,e){this.model=t,this.chartGenerator=e,this.staticOptions={},this.autoCompleteCategory=!0,this.model=t,this.chartGenerator=e;const{chartSeriesEncode:s,caption:i,id:n,userParam:r}=t;if(!t.catalogField)throw new a(t,"缺少分类属性配置");if(!t.valueField)throw new a(t,"缺少值属性配置");this.catalogField=e.getFieldKey(t.catalogField),this.valueField=e.getFieldKey(t.valueField),this.groupField=t.seriesField?e.getFieldKey(t.seriesField):void 0;const{chartXAxisId:o,chartYAxisId:c}=s||{};this.xAxisIndex=I(o),this.yAxisIndex=I(c),this.seriesName=i||n,this.staticOptions=this.calcStaticOptions(),r&&(this.seriesUserParam=Cn(r))}calcStaticOptions(){return{type:this.model.seriesType,name:this.seriesName,emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}}}translateVal(t,e,a=!1){if(q(e))return;if(q(t))return e;const s=this.chartGenerator.codeListMap.get(t);if(null==s?void 0:s.length){const t=s.find((t=>t.value===e));if(t)return t.text}return a?void 0:e}calcGroupData(t){this.groupData={};const e=this.groupData,{seriesCodeListId:a,catalogCodeListId:s}=this.model;return t.forEach((t=>{let i=mn;if(this.groupField){const e=this.translateVal(a,t[this.groupField]);if(q(e))return;i=e}if(!e[i]&&(e[i]=new Map,s&&this.autoCompleteCategory)){this.chartGenerator.codeListMap.get(s).forEach((t=>{e[i].set(t.text,{value:0})}))}const n=this.translateVal(s,t[this.catalogField],!0);n&&(e[i].get(n)||e[i].set(n,{value:0}),e[i].get(n).value+=t[this.valueField],e[i].get(n).deData=t)})),e}calcGroupSeries(t){return Object.keys(t).map((e=>{const a=t[e],s=this.calcSeriesData(a);let i={...this.staticOptions,data:s};return e!==mn&&(i.name=e),this.seriesUserParam&&(i=it(i,this.seriesUserParam)),i}))}calcSeriesData(t){const e=[];return t.forEach(((t,a)=>{var s;e.push([a,t.value,null==(s=t.deData)?void 0:s.srfkey])})),e}calcByData(t){const e=this.dataPreprocess(t),a=this.calcGroupData(e);return this.addTimeData(a),this.calcGroupSeries(a)}getSrfkeyByParams(t){return t.value[2]}dataPreprocess(t){const e=[];t.forEach((t=>{e.push(Z(t))}));const{groupMode:a}=this.model;return a&&e.forEach((t=>{let e="";if("DAY"===a||"YEAR"===a||"MONTH"===a){if("DAY"===a?e="YYYY-MM-DD":"YEAR"===a?e="YYYY":"MONTH"===a&&(e="YYYY-MM"),t[this.catalogField]){const a=nt(t[this.catalogField]).format(e);t[this.catalogField]=a}}else if("QUARTER"===a){if(t[this.catalogField]){const e="".concat(nt(t[this.catalogField]).format("YYYY"),"-").concat(nt(t[this.catalogField]).quarter());t[this.catalogField]=e}}else if("YEARWEEK"===a&&t[this.catalogField]){const e="".concat(nt(t[this.catalogField]).format("YYYY"),"-").concat(nt(t[this.catalogField]).week());t[this.catalogField]=e}})),e}sortTimeData(t){const{groupMode:e}=this.model;Object.keys(t).forEach((a=>{const s=t[a];let i=[];"DAY"===e||"YEAR"===e||"MONTH"===e?i=Array.from(s.keys()).sort(((t,e)=>nt(t).diff(nt(e)))):"QUARTER"!==e&&"YEARWEEK"!==e||(i=Array.from(s.keys()).sort(((t,e)=>{const[a,s]=t.split("-"),[i,n]=e.split("-");return a!==i?parseInt(a,10)-parseInt(i,10):parseInt(s,10)-parseInt(n,10)})));const n=new Map;i.forEach((t=>{n.set(t,s.get(t))})),t[a]=n}))}addTimeData(t){const{groupMode:e}=this.model;if(!e||"CODELIST"===e)return;const a=[];Object.keys(t).forEach((e=>{t[e].forEach(((t,e)=>{a.push(nt(e))}))}));const s=nt.max(a),i=nt.min(a);if("DAY"===e){let e=i;const a=s;for(;null==e?void 0:e.isSameOrBefore(a,"day");){const a=e.format("YYYY-MM-DD");Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e=e.add(1,"day")}}else if("YEAR"===e){let e=i.year();const a=s.year();for(;e<=a;){const a=e.toString();Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e+=1}}else if("MONTH"===e){let e=i.clone().startOf("month");const a=s.clone().startOf("month");for(;e.isSameOrBefore(a);){const a=e.format("YYYY-MM");Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e=e.add(1,"month")}}else if("QUARTER"===e){const e=[];Object.keys(t).forEach((a=>{t[a].forEach(((t,a)=>{e.push(a)}))}));const a=e.reduce(((t,e)=>e<t?e:t),e[0]),s=e.reduce(((t,e)=>e>t?e:t),e[0]),[i]=a.split("-"),[n]=s.split("-");for(let e=parseInt(i,10);e<=parseInt(n,10);e++)for(let a=1;a<=4;a++){const s="".concat(e,"-").concat(a);Object.keys(t).forEach((e=>{t[e].get(s)||t[e].set(s,{value:0})}))}}else if("YEARWEEK"===e){const e=[];Object.keys(t).forEach((a=>{t[a].forEach(((t,a)=>{e.push(a)}))}));const a=e.reduce(((t,e)=>e<t?e:t),e[0]),s=e.reduce(((t,e)=>e>t?e:t),e[0]),[i]=a.split("-"),[n]=s.split("-");for(let e=parseInt(i,10);e<=parseInt(n,10);e++){const a=nt("".concat(e,"-12-31")).isoWeek();for(let s=1;s<=a;s++){const a="".concat(e,"-").concat(s);Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})}))}}}this.sortTimeData(t)}},gn=class extends fn{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex;const{stack:e,step:s}=this.model;return s&&(t.step="middle"),t}},wn=class extends fn{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,this.model,t}},En=class extends fn{calcStaticOptions(){const t=super.calcStaticOptions();return t.label.formatter="{b}: {d}%({c})",t.label.position="outer",t}calcSeriesData(t){return Object.keys(t).map((e=>{var a;const s=t.get(e);return{name:e,value:[s.value,null==(a=s.deData)?void 0:a.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},vn=class extends fn{calcStaticOptions(){const t=super.calcStaticOptions();return t.label.formatter="{b}: {d}%({c})",t.label.position="outside",t}calcSeriesData(t){return Object.keys(t).map((e=>{var a;const s=t.get(e);return{name:e,value:[s.value,null==(a=s.deData)?void 0:a.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},yn=class extends fn{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,t}},In=class{constructor(t){this.indicator={},this.index=t}get indicatorKeys(){return this._indicatorKeys&&this._indicatorKeys.length===Object.keys(this.indicator).length||(this._indicatorKeys=Object.keys(this.indicator).sort()),this._indicatorKeys}updateIndicator(t,e){const a=this.indicator[t];(!a||a.max<e)&&(this.indicator[t]={max:e})}toOptions(){const t=Math.max(...Object.values(this.indicator).map((t=>t.max)));return{indicator:this.indicatorKeys.map((e=>({name:e,max:t})))}}},Dn=class extends fn{calcStaticOptions(){return super.calcStaticOptions()}calcRadarCoordSystem(t){const e=this.calcGroupData(t);this.chartGenerator.radarMap.has(this.catalogField)||this.chartGenerator.radarMap.set(this.catalogField,new In(this.chartGenerator.radarMap.size));const a=this.chartGenerator.radarMap.get(this.catalogField);Object.values(e).forEach((t=>{Object.keys(t).forEach((e=>{a.updateIndicator(e,t.get(e).value)}))}))}calcByData(t){const e=this.groupData,a=this.chartGenerator.radarMap.get(this.catalogField),s=Object.keys(e).map((t=>{const s=e[t],i=a.indicatorKeys.map((t=>s.has(t)?s.get(t):0));return{name:t===mn?this.seriesName:t,value:i}}));let i={...this.staticOptions,data:s};return this.seriesUserParam&&(i=it(i,this.seriesUserParam)),i}getSrfkeyByParams(t){return t.value[1]}};function Cn(t){const e={};return t&&Object.keys(t).forEach((a=>{const s=a.indexOf(".");if(-1===s)return;const i=a.slice(s+1);if(i)try{e[i]=JSON.parse(t[a])}catch(s){e[i]=t[a]}})),e}var An=class{constructor(t){this.model=t,this.staticOptions={tooltip:{show:!0}},this.options={},this.seriesGenerators=[],this.radarMap=new Map,this.codeListMap=new Map;const{dechartTitle:e,dechartLegend:a,chartXAxises:s,chartYAxises:i,userParam:n}=t;e&&(this.staticOptions.title=this.calcTitleOption(e)),a&&(this.staticOptions.legend=this.calcLegendOption(a)),(null==s?void 0:s.length)&&(this.staticOptions.xAxis=this.calcXYAxisOption(s)),(null==i?void 0:i.length)&&(this.staticOptions.yAxis=this.calcXYAxisOption(i)),n&&(this.chartUserParam=Cn(n))}initSeriesGenerators(){var t;null==(t=this.model.dechartSerieses)||t.forEach((t=>{let e;switch(t.seriesType){case"line":e=new gn(t,this);break;case"bar":e=new wn(t,this);break;case"scatter":e=new yn(t,this);break;case"pie":e=new vn(t,this);break;case"funnel":e=new En(t,this);break;case"radar":e=new Dn(t,this);break;default:ibiz.log.error("图表暂未支持序列类型".concat(t.seriesType))}e&&this.seriesGenerators.push(e)}))}calcTitleOption(t){const{showTitle:e,title:a,subTitle:s,titlePos:i}=t,n={show:e,text:a,subtext:s,left:"center"},r=null==i?void 0:i.toLowerCase();return"left"===r||"right"===r?n.left=r:"bottom"!==r&&"top"!==r||(n.top=r),n}calcLegendOption(t){var e;const{showLegend:a,legendPos:s}=t,i={};i.show=a,1===(null==(e=this.model.dechartSerieses)?void 0:e.length)&&(i.show=!1);const n=null==s?void 0:s.toLowerCase();return"left"===n||"right"===n?(i.left=n,i.top="middle",i.orient="vertical"):"bottom"===n&&(i.top=n),i}calcXYAxisOption(t){const e=[];return t.forEach((t=>{const{position:a,dataShowMode:s,userParam:i}=t;let n={type:t.echartsType,name:t.caption,max:t.maxValue,min:t.minValue,position:a,axisLabel:{formatter:t=>1===s?t.length>4?"".concat(t.slice(0,4).split("").join("\n"),"\n..."):t.split("").join("\n"):2===s&&t.length>4?"".concat(t.slice(0,4),"..."):t,rotate:3===s?45:0}};i&&(n=it(n,Cn(i))),e.push(n)})),e}async init(t,e){await this.loadCodeList(t,e),this.entity=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId),this.initSeriesGenerators()}getFieldKey(t){const e=this.entity.appDEFields.find((e=>e.name===t));return e?e.codeName.toLowerCase():t.toLowerCase()}async loadCodeList(t,e){var a;if(this.codeListMap.clear(),!(null==(a=this.model.dechartSerieses)?void 0:a.length))return;const s=ibiz.hub.getApp(t.srfappid),i=async a=>{if(!a||this.codeListMap.has(a))return;const i=await s.codeList.get(a,t,e);this.codeListMap.set(a,i)};await Promise.all(this.model.dechartSerieses.map((async t=>{const{seriesCodeListId:e,catalogCodeListId:a}=t;await i(e),await i(a)})))}calcOptionsByData(t){this.radarMap.clear(),this.options={series:[],radar:[]},this.seriesGenerators.forEach((e=>{"radar"===e.model.seriesType&&e.calcRadarCoordSystem(t)})),this.radarMap.size&&(this.options.radar=[...this.radarMap.values()].map((t=>t.toOptions())));const e=[];return this.seriesGenerators.forEach((a=>{const s=a.calcByData(t);s instanceof Array?e.push(...s):e.push(s)})),this.options.series=e,this.options=it(this.staticOptions,this.options),this.chartUserParam&&(this.options=it(this.options,this.chartUserParam)),this.options}getSrfkeyByParams(t){const a=this.seriesGenerators[t.seriesIndex];if(!a)throw new e("找不到".concat(t.seriesIndex,"序列的generator!"));return a.getSrfkeyByParams(t)}},bn=t("ChartService",class extends yi{}),Pn=(t("ChartController",class extends dn{initState(){super.initState(),this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new bn(this.model),await this.service.init(this.context),this.generator=new An(this.model),await this.generator.init(this.context,this.params),window.addEventListener("resize",this.resizeChart)}async afterLoad(t,e){const a=await super.afterLoad(t,e);return e.forEach((t=>{Object.assign(t,{srfcount:1})})),this.calcOptions(),a}initChart(t){this.chart=t,this.chart.on("click",(t=>{const e=this.generator.getSrfkeyByParams(t),a=this.state.items.find((t=>t.srfkey===e));console.log("实体数据",a)}))}calcOptions(t=this.state.items){this.options=this.generator.calcOptionsByData(t),this.updateChart()}updateChart(){if(!this.chart)throw new e("chart对象没有正确初始化");if(!this.options)throw new e("options还没计算");this.chart.setOption(this.options),this.resizeChart()}resizeChart(){this.chart&&this.chart.resize()}async onDestroyed(){var t;window.removeEventListener("resize",this.resizeChart),await super.onDestroyed(),null==(t=this.chart)||t.dispose()}}),t("CaptionBarController",class extends hn{initState(){super.initState(),this.view.model.capLanguageRes?this.state.caption=ibiz.i18n.t(this.view.model.capLanguageRes.lanResTag,this.view.model.caption):this.state.caption=this.view.model.caption}async onCreated(){await super.onCreated(),this.view.evt.on("onViewInfoChange",(({caption:t,dataInfo:e})=>{this.state.caption="".concat(this.view.model.caption).concat(e?"-".concat(e):"")}))}}),class{constructor(t,e){this.deLogicParams=t,this.parameters=e,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}get context(){return Object.prototype.hasOwnProperty.call(this.params,"context")?this.params.context:this.parameters.context}get data(){return this.parameters.data}get viewParam(){return Object.prototype.hasOwnProperty.call(this.params,"viewParam")?this.params.viewParam:this.parameters.params}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}setLastReturn(t){this.lastReturn=t}initLastReturnParam(t){Object.defineProperty(this.params,t,{enumerable:!0,configurable:!0,get:()=>this.lastReturn})}isEntityParam(t){const e=this.deLogicParams.get(t);return!(!e||!e.model.entityParam)}}),Sn=class{};function xn(t,e){const{srcDEUILogicParamId:a,srcFieldName:i,srcValue:n}=e,r=e.srcValueType||"SRCDLPARAM",o=i;let c;switch(r){case"SRCDLPARAM":c=t.params[a];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return ibiz.util.rawValue.format(n);case"WEBCONTEXT":case"VIEWPARAM":c=t.parameters.params;break;case"APPLICATION":case"SESSION":case"APPDATA":case"DATACONTEXT":c=t.parameters.context;break;case"ENVPARAM":c=Z(ibiz.env);break;default:throw new s(e,"暂未支持源值类型".concat(r))}if(c&&o)try{c=fa.execScriptFn({srcValue:c},"srcValue.".concat(o),{singleRowReturn:!0,isAsync:!1})}catch(t){throw ibiz.log.error("从源参数取属性".concat(o,"报错,源参数:"),c),t}return c}var _n=class extends Sn{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,i){const n=xn(t,{srcDEUILogicParamId:this.dstParam,srcFieldName:this.dstField});switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=i[this.value]?i[this.value]:e[this.value];return ca(n,this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=xn(t,{srcDEUILogicParamId:this.srcParam,srcFieldName:this.value});return ca(n,this.op,e)}case"CURTIME":throw new s(this.model,"暂未支持条件值类型为[当前时间]");default:return ca(n,this.op,this.value)}}},Tn=class t extends Sn{constructor(e){super(),this.model=e;const a=e.deuilogicLinkConds||[];this.conds=a.map((e=>"SINGLE"===e.logicType?new _n(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,s){let i=!0;if(0===this.conds.length)throw new a(this.model,"界面连接条件逻辑组未配置逻辑项");for(let a=0;a<this.conds.length;a++){const n=this.conds[a].test(t,e,s);if("AND"===this.op&&!1===n){i=!1;break}if("OR"===this.op&&!0===n){i=!0;break}}return this.notMode?!i:i}},Ln=class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const{linkMode:e,deuilogicLinkGroupCond:a}=this.model;0===(e||0)&&a&&(this.groupCond=new Tn(a))}async exec(t){const{linkMode:e}=this.model,{context:a,data:i}=t;switch(e||0){case 0:return!this.groupCond||this.groupCond.test(t,a,i&&i.length>0?i[0]:{});case 1:return!0;case 2:throw new s(this.model,"未支持的逻辑连接类型: 异步结束");case 3:throw new s(this.model,"未支持的逻辑连接类型: 异步拒绝");case 9:throw new s(this.model,"未支持的逻辑连接类型: 异常处理");default:throw new s(this.model,"未支持的逻辑连接类型:".concat(e))}}},Nn=class{constructor(t){this.model=t,this.links=(t.deuilogicLinks||[]).map((t=>new Ln(t)))}},On=class extends Nn{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:s,dstDEUILogicParamId:i,retDEUILogicParamId:n}=this.model;if(!e)throw new a(this.model,"未指定应用实体");if(!s)throw new a(this.model,"未指定实体行为");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,s,t.context,r,t.viewParam);c.ok&&(t.params[n]=c.data)}},Mn=class extends Nn{async exec(t){const{dstAppDEUIActionId:e,dstDEUILogicParamId:s}=this.model,{data:i,parameters:n}=t;if(!e)throw new a(this.model,"未配置界面行为");let r=[i];if(s){const e=t.params[s];r=e instanceof Array?e:[e]}await er.execAndResolved(e,{...n,context:t.context,params:t.viewParam,data:r})}},Rn=class extends Nn{async exec(t){}},Vn=class extends Nn{async exec(t){t.isEndNode=!0;const{returnType:e,rawValue:a,returnParamId:i}=this.model;if(e)switch(e){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=ibiz.util.rawValue.format(a);break;case"LOGICPARAM":t.result=t.params[i];break;default:throw new s(this.model,"暂未支持的结束节点返回值类型: ".concat(e))}}},kn=class extends Nn{async exec(t){const e=this.model.deuilogicNodeParams;if(null==e?void 0:e.length)for(const a of e)switch(a.paramAction){case"SETPARAMVALUE":await this.setParamValue(a,t);break;case"RESETPARAM":await this.resetParam(a,t);break;case"COPYPARAM":await this.copyParam(a,t);break;case"BINDPARAM":await this.bindParam(a,t);break;case"RENEWPARAM":await this.renewParam(a,t);break;case"APPENDPARAM":await this.appendParam(a,t);break;case"SORTPARAM":await this.sortParam(a,t);break;default:throw new s(a,"暂未支持逻辑处理参数操作".concat(a.paramAction))}}setParamValue(t,a){const{dstFieldName:s,dstDEUILogicParamId:i}=t;if(!i)throw new e("没有目标参数对象id");let n=s;a.isEntityParam(i)&&(n=null==n?void 0:n.toLowerCase());const r=xn(a,t);if(n)try{fa.execScriptFn({srcVal:r,dstParam:a.params[i]},"dstParam.".concat(s," = srcVal"),{singleRowReturn:!1,isAsync:!1})}catch(t){throw ibiz.log.error("给目标参数属性".concat(s,"赋值报错,目标参数:"),a.params[i]),t}else a.params[i]=r}copyParam(t,e){const{dstDEUILogicParamId:a}=t,s=xn(e,t);e.params[a]=Z(s)}bindParam(t,e){const a=xn(e,t);e.params[t.dstDEUILogicParamId]=a}resetParam(t,e){const{dstDEUILogicParamId:a}=t;e.resetParam(a)}renewParam(t,e){const{dstDEUILogicParamId:a}=t;e.renewParam(a)}appendParam(t,e){const{dstDEUILogicParamId:a,dstIndex:s,srcIndex:i,srcSize:n}=t,r=xn(e,t),o=s||0,c=i||0,l=n||r.length;e.params[a].splice(o,0,...r.slice(c,l))}sortParam(t,e){const{dstDEUILogicParamId:a,dstFieldName:s,dstSortDir:i}=t,n=s;e.params[a].sort(((t,e)=>"ASC"===i?t[n]-e[n]:e[n]-t[n]))}},Fn=class extends Nn{async exec(t){t.isEndNode=!0;const{invokeMethod:s,invokeCtrlId:i,invokeParamId:n}=this.model;if(!i)throw new a(this.model,"没有配置界面对象");if(!n)throw new a(this.model,"没有配置操作参数");if(!s)throw new a(this.model,"没有配置调用方法");const r=t.params[n];if(!r)throw new e("没有找到操作参数".concat(n));const o=t.params[i];if(!o)throw new e("没有找到界面对象".concat(i));if(!o[s]||!k(o[s]))throw new e("没有找到调用方法".concat(s));await o[s](r)}},Wn=class extends Nn{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=xn(t,this.model);t.params[e]=i}},Bn=class extends Nn{constructor(){super(...arguments),this.typeMap={INFO:"info",QUESTION:"success",WARNING:"warning",ERROR:"error"}}async exec(t){const{msgBoxType:e,buttonsType:i,msgBoxParamId:n}=this.model;if(!e)throw new a(this.model,"缺少消息类型的配置");if(!i)throw new a(this.model,"缺少按钮类型的配置");let{title:r}=this.model,{message:o}=this.model;if(n){const e=t.params[n];e.title&&(r=e.title),e.message&&(o=e.message)}const c={type:this.typeMap[e],title:r||"消息",desc:o};let l=[];switch(i){case"YESNO":c.confirmButtonText="是",c.cancelButtonText="否",c.showConfirmButton=!0,c.showCancelButton=!0,l=["yes","no"];break;case"OK":c.confirmButtonText="确定",c.showConfirmButton=!0,c.showCancelButton=!1,l=["ok"];break;case"OKCANCEL":c.confirmButtonText="确定",c.cancelButtonText="取消",c.showConfirmButton=!0,c.showCancelButton=!0,l=["ok","cancel"];break;default:throw new s(this.model,"".concat(i,"暂未支持"))}const h=await ibiz.modal.confirm(c);t.setLastReturn(l[h?0:1])}},Un=class extends Nn{async exec(t){const{dstDEUILogicParamId:e,name:s}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");const i=t.params[e];console.log("逻辑节点".concat(s,"操作参数值:"),i)}},zn=class extends Nn{async exec(t){const{dstDEUILogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.resetParam(e)}},jn=class extends Nn{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=xn(t,this.model);t.params[e]=Z(i)}},Gn=class extends Nn{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s,dstIndex:i,srcIndex:n,srcSize:r}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const o=xn(t,this.model),c=i||0,l=n||0,h=r||o.length;t.params[e].splice(c,0,...o.slice(l,h))}},Hn=class extends Nn{async exec(t){const{dstDEUILogicParamId:e,dstSortDir:s,dstFieldName:i}=this.model;if(!e||!i)throw new a(this.model,"缺少目标参数对象或目标属性配置");const n=i;t.params[e].sort(((t,e)=>"ASC"===s?t[n]-e[n]:e[n]-t[n]))}},Kn=class extends Nn{async exec(t){const{dstDEUILogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.renewParam(e)}},Xn=class extends Nn{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:s,dstDEUILogicParamId:i,retDEUILogicParamId:n}=this.model;if(!i)throw new a(this.model,"缺少配置过滤参数");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(s,e,t.context,r);c.ok&&(t.params[n]=c.data)}},Yn=class extends Nn{async exec(t){const{errorInfo:a}=this.model;throw new e(a)}},$n=class extends Nn{async exec(t){t.isEndNode=!0;const{eventName:s,eventParamId:i,fireCtrlId:n}=this.model;if(!n)throw new a(this.model,"没有配置触发对象");if(!s)throw new a(this.model,"没有配置事件名称参数");if(!i)throw new a(this.model,"没有配置事件参数");const r=t.params[n];if(!r)throw new e("没有找到触发对象".concat(n));const o=t.params[i];if(!o)throw new e("没有找到事件参数对象".concat(i));await r.evt.emit(s,o)}},qn=class extends Nn{async exec(t){const{dstAppDELogicId:s,dstAppDataEntityId:i,dstDEUILogicParamId:n,retDEUILogicParamId:r}=this.model;if(!i)throw new a(this.model,"没有配置实体");if(!s)throw new a(this.model,"没有配置实体逻辑");if(!n)throw new a(this.model,"没有配置传入逻辑参数");const o=t.params[n];if(!o)throw new e("没有找到传入参数".concat(n));const c=await di(s,i,t.context,o,t.params);r&&(t.params[r]=c)}},Jn=class{constructor(t){this.model=t}calc(t){const e=this.model.id,a=this.model,{parameters:i}=t,{context:n,params:r,data:o}=i,c=ibiz.hub.getApp(n.srfappid);if("layoutPanel"!==a.codeName)if(a.default)t.params[e]=o&&o.length>0?o[0]:{};else if(a.activeContainerParam)t.params[e]=i.ctrl||i.view;else if(a.activeCtrlParam)t.params[e]=i.ctrl;else if(a.ctrlParam){const s=i.view.getController(a.codeName.toLowerCase());s?t.params[e]=s:ibiz.log.error("视图逻辑初始化参数,未找到".concat(a.codeName,"指定部件对象"))}else if(a.activeViewParam)t.params[e]=i.view;else if(a.appGlobalParam)t.params[e]=ibiz.env;else if(a.applicationParam)t.params[e]=c;else if(a.entityListParam)t.params[e]=[];else{if(a.entityPageParam)throw new s(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[e]={};else if(a.lastReturnParam)t.initLastReturnParam(e);else if(a.navContextParam)t.params[e]=n;else{if(a.navViewParamParam)throw new s(a,"未支持的逻辑参数类型: 视图路由参数");if(a.routeViewSessionParam)throw new s(a,"未支持的逻辑参数类型: 路由视图会话");if(a.simpleListParam)t.params[e]=[];else if(a.simpleParam)t.params[e]={};else if(a.viewNavDataParam)t.params[e]=r;else if(a.viewSessionParam)throw new s(a,"未支持的逻辑参数类型: 当前视图会话")}}else t.params[e]=i.view.layoutPanel.panelItems}renew(t){const e=this.model.id,a=this.model;if(a.entityListParam||a.simpleListParam||a.entityPageParam)t.params[e]=[];else{if(!a.simpleParam&&!a.entityParam)throw new s(a,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}},Qn=class{constructor(t){var e;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.deuilogicNodes)?void 0:e.length))throw new a(t,"界面逻辑没有配置逻辑节点");t.deuilogicNodes.forEach((t=>{const{logicNodeType:e}=t;let a;switch(e){case"BEGIN":a=new Rn(t);break;case"END":a=new Vn(t);break;case"DEACTION":a=new On(t);break;case"DEUIACTION":a=new Mn(t);break;case"PREPAREJSPARAM":a=new kn(t);break;case"RESETPARAM":a=new zn(t);break;case"COPYPARAM":a=new jn(t);break;case"BINDPARAM":a=new Wn(t);break;case"VIEWCTRLINVOKE":a=new Fn(t);break;case"MSGBOX":a=new Bn(t);break;case"DEBUGPARAM":a=new Un(t);break;case"APPENDPARAM":a=new Gn(t);break;case"SORTPARAM":a=new Hn(t);break;case"RENEWPARAM":a=new Kn(t);break;case"DEDATASET":a=new Xn(t);break;case"THROWEXCEPTION":a=new Yn(t);break;case"VIEWCTRLFIREEVENT":a=new $n(t);break;case"DELOGIC":a=new qn(t);break;default:throw new s(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,a)})),t.deuilogicParams.forEach((t=>{this.params.set(t.id,new Jn(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.dstDEUILogicNodeId)&&(e.dstNode=this.nodes.get(e.model.dstDEUILogicNodeId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t){const e=new Pn(this.params,t);this.initLogicParams(e);const{startDEUILogicNodeId:s}=this.model;if(!s||!this.nodes.has(s))throw new a(this.model,"未设置起始节点");{const t=this.nodes.get(s);await this.deepExec(t,e)}return e.isEndNode?e.result:e.params[e.defaultParamName]?e.params[e.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:a}=t;for(let s=0;s<a.length;s++){const i=a[s];if(await i.exec(e)&&i.dstNode&&(await this.deepExec(i.dstNode,e),!1===t.model.parallelOutput))break}}},Zn=new Map;async function tr(t,a,s){const i=ibiz.hub.getApp(s.context.srfappid),n=await i.getDEUILogic(t,a);if(!n)throw new e("找不到实体".concat(a,"的界面逻辑").concat(t));Zn.has(n)||Zn.set(n,new Qn(n));const r=Zn.get(n);return await r.exec(s),null}var er=t("UIActionUtil",class{static async exec(t,a){const s=await Je(t);if(!s)throw new e("没找到".concat(t,"的界面行为模型"));if("SINGLEDATA"===s.actionTarget){if(!1===await a.view.call("Validate"))return{cancel:!0}}return(await cs(s)).exec(s,a)}static async execAndResolved(t,e){var a,s;const i=await this.exec(t,e);if(i.closeView)e.view.modal.ignoreDismissCheck=!0,e.view.closeView({ok:!0});else if(i.refresh)switch(i.refreshMode){case 1:await e.view.callUIAction("Refresh");break;case 2:await(null==(a=e.view.parentView)?void 0:a.callUIAction("Refresh"));break;case 3:await(null==(s=e.view.getTopView())?void 0:s.callUIAction("Refresh"))}}}),ar=class{async exec(t,e){const{context:s,params:i,data:n}=e,r={refresh:t.reloadData,refreshMode:t.refreshMode,closeView:t.closeEditView},{appDEUILogicId:o,appDataEntityId:c,uilogicAttachMode:l}=t;if("REPLACE"===l){if(!o)throw new a(t,"没有配置实体界面逻辑");return await tr(o,c,e),r}if(!await this.isConfirm(t,e))return this.returnError(r);const h=await this.execAction(t,e);if(Object.assign(r,h),!0===r.cancel)return this.returnError(r);const d=await this.doNextAction(t,{...e,context:r.nextContext||s,data:r.data||n,params:r.nextParams||i});if(d&&(Object.assign(r,d),!0===d.cancel))return this.returnError(r);if("AFTER"===t.uilogicAttachMode){if(!o)throw new a(t,"没有配置实体界面逻辑");await tr(o,c,e)}return r}returnError(t){return Object.assign(t,{refresh:!1,closeView:!1})}async isConfirm(t,e){const a=this.calcMessage("confirm",t,e);return!t.enableConfirm||!a||ibiz.confirm.warning({title:"操作确认",desc:a})}async doNextAction(t,e){const a=t.nextId;if(a)return er.exec(a,e)}async handleParams(t,e,a,s){let i=[];const n=He(t.appDataEntityId);switch(t.actionTarget){case"NONE":i=[];break;case"SINGLEDATA":i=[a[0]];break;case"MULTIDATA":i=a;break;case"MULTIKEY":i=n&&a.length>0?a.map((t=>({[n]:t.srfkey||t[n]}))):[{}];break;case"SINGLEKEY":{const t=a[0]||{};i=n?[{[n]:t.srfkey||t[n]}]:[{}]}}const r=e.clone(),o=[...t.navigateContexts||[]];if(n&&"NONE"!==t.actionTarget){const{valueItem:e,paramItem:a}=t,s=a||n,i=e||"srfkey";o.unshift({key:s,value:i,rawValue:!1})}const c=["MULTIKEY","MULTIDATA"].includes(t.actionTarget)&&a.length>0,l=Me(o,c?ke(o,a):a[0]||{},s,e);Object.assign(r,l);const h=t.navigateParams;return{resultContext:r,resultData:i,resultParams:Me(h,c?ke(h,a):a[0]||{},s,r)}}calcMessage(t,e,a){let s,i;const{confirmMsg:n,cmlanguageRes:r,successMsg:o,smlanguageRes:c}=e;switch(t){case"confirm":s=n,i=r;break;case"success":s=o,i=c}if(i){const t=ibiz.i18n.t(i.lanResTag,i.defaultContent||s);t!==i.lanResTag&&(s=t)}if(s){const{data:t}=a,e={...a};return 1===t.length?[e.data]=t:0===t.length&&delete e.data,fa.execScriptFn(e,"`".concat(s,"`"),{isAsync:!1,singleRowReturn:!0})}}},sr=t("BackendUIActionProvider",class extends ar{async execAction(t,e){const{context:s,params:i,data:n,event:r}=e,o={},c=t.appDataEntityId,l=t.appDEMethodId;if(!c||!l)throw new a(t,"未配置实体或实体行为");const{resultContext:h,resultParams:d,resultData:u}=await this.handleParams(t,s,n,i),p={...d},m=t.frontAppViewId;if(m){const t=await ibiz.commands.execute(Ni.TAG,m,h,d,{event:r});if(!(null==t?void 0:t.ok))return o.cancel=!0,o;(null==t?void 0:t.ok)&&t.data&&(0===u.length&&u.push({}),u.forEach((e=>{e.srfactionparam=t.data})))}const f=ibiz.hub.getApp(null==s?void 0:s.srfappid),g=u.map((t=>{var e;return(null==(e=t.getOrigin)?void 0:e.call(t))||t||{}})).map((t=>Object.assign(t,p))),w=["MULTIKEY","MULTIDATA"].includes(t.actionTarget),E=await f.deService.exec(c,l,h,w?g:g[0],p);if(E.ok){const a=this.calcMessage("success",t,e);a&&ibiz.message.success(a)}return Object.assign(o,{data:j(E.data)?E.data:[E.data],nextContext:h,nextParams:p}),o}}),ir=t("SysUIActionProvider",class extends ar{constructor(){super(...arguments),this.predefinedActionMap=new Map([["EDITVIEW_EXITACTION","Exit"],["EDITVIEW_SAVEANDEXITACTION","SaveAndExit"],["TREEVIEW_REFRESHPARENTACTION","RefreshParent"],["GRIDVIEW_EXPORTXMLACTION","ExportModel"],["GRIDVIEW_EXPORTACTION","ExportExcel"],["EDITVIEW_REMOVEANDEXITACTION","RemoveAndExit"],["GRIDVIEW_PRINTACTION","Print"],["EDITVIEW_NEXTRECORDACTION","NextRecord"],["GRIDVIEW_NEWROWACTION","NewRow"],["EDITVIEW_LASTRECORDACTION","LastRecord"],["EDITVIEW_PREVRECORDACTION","PrevRecord"],["GRIDVIEW_SEARCHBAR","ToggleFilter"],["EDITVIEW_SAVEANDSTARTWFACTION","SaveAndStart"],["EDITVIEW_NEWACTION","New"],["EDITVIEW_PRINTACTION","Print"],["EDITVIEW_COPYACTION","Copy"],["EDITVIEW_HELPACTION","Help"],["EDITVIEW_FIRSTRECORDACTION","FirstRecord"],["GRIDVIEW_REFRESHACTION","Refresh"],["EDITVIEW_SAVEANDNEWACTION","SaveAndNew"],["EDITVIEW_VIEWWFSTEPACTORACTION","ViewWFStep"],["EDITVIEW_SAVEACTION","Save"],["TREEVIEW_REFRESHALLACTION","RefreshAll"],["GRIDVIEW_IMPORTBAR","Import"],["GRIDVIEW_ROWEDITACTION","ToggleRowEdit"],["GRIDVIEW_NEWACTION","New"],["GRIDVIEW_EDITACTION","Edit"],["GRIDVIEW_HELPACTION","Help"],["EDITVIEW_REFRESHACTION","Refresh"],["GRIDVIEW_REMOVEACTION","Remove"],["GRIDVIEW_COPYACTION","Copy"],["GRIDVIEW_VIEWACTION","View"],["GRIDVIEW_SAVEROWACTION","SaveRow"],["APP_LOGIN","Login"],["APP_LOGOUT","logout"]])}async execAction(t,e){const{view:a}=e,s=this.predefinedActionMap.get(t.predefinedType)||t.uiactionTag;if("Exit"===s)return{closeView:!0};return await a.callUIAction(s,e)||{}}}),nr=t("FrontUIActionProvider",class extends ar{async execAction(t,e){const{context:i,params:n,data:r,event:o,noWaitRoute:c}=e;let l={};switch(t.frontProcessType){case"OPENHTMLPAGE":{const e=m.fill(t.htmlPageUrl,i,null==r?void 0:r[0]);window.open(e,"_blank");break}case"TOP":case"WIZARD":{const e=t.frontAppViewId;if(!e)throw new a(t,"未配置打开视图");const{resultContext:s,resultParams:h}=await this.handleParams(t,i,r,n),d=await ibiz.commands.execute(Ni.TAG,e,s,h,{event:o,noWaitRoute:c});(null==d?void 0:d.ok)||(l.cancel=!0),(null==d?void 0:d.ok)&&d.data&&(l.data=d.data,l.nextContext=s,l.nextParams={...n,...h});break}case"OTHER":l=this.doOther(t,e);break;default:throw new s(t,"未支持的前台处理模式[".concat(t.frontProcessType,"]"))}return l}doOther(t,e){const{scriptCode:s}=t,{context:i,params:n,data:r,event:o}=e;if(s){return fa.execScriptFn({context:i,params:n,data:r,el:null==o?void 0:o.target},s)||{}}throw new a(t,"自定义类型缺少配置脚本代码")}}),rr=t("WFWithdrawUIActionProvider",class extends ar{async execAction(t,e){const{view:a}=e;let s=!1;return await ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})&&a&&(await a.call("WFWithdraw",e),s=!0),{refresh:!1,closeView:s}}});function or(){const t=new nr;rs("FRONT",(()=>t));const e=new sr;rs("BACKEND",(()=>e));const a=new ir;rs("SYS",(()=>a));const s=new rr;rs("DEUIACTION_WFWithdraw",(()=>s))}var cr=t("ToolbarController",class extends hn{get _evt(){return this.evt}initState(){super.initState(),this.state.buttonsState=new qi,this.state.viewMode="EMBED",this.state.extraButtons={}}async doUIAction(t,a,s={}){if("DEUIACTION"===t.itemType){const i=t.uiactionId,n=await Je(i);if(!n)throw new e("没有找到界面行为模型".concat(i));const r=["SYS","BACKEND","WFBACKEND"].includes(n.uiactionMode)&&!1!==n.showBusyIndicator;r&&this.state.buttonsState.setLoading(t.id);try{const t=await this.ctx.view.call("GetData")||[],e=this.getEventArgs();e.params=Object.assign(s,e.params),await er.execAndResolved(i,{...e,data:t,event:a})}finally{r&&this.state.buttonsState.setLoading("")}}}async onCreated(){await super.onCreated(),this.state.viewMode=this.ctx.view.modal.mode,f(this.model,(t=>{if("DEUIACTION"===t.itemType){const e=t,a=new $i(e.id,this.context.srfappid,e.uiactionId);this.state.buttonsState.addState(e.id,a)}}),{childrenFields:["detoolbarItems"]}),await this.calcButtonState()}async onItemClick(t,e,a){const s="extra"===t.buttonType;await this._evt.emit("onClick",{event:e,eventArg:t.id,buttonType:s?"extra":"deuiaction"}),s||await this.doUIAction(t,e,a)}async calcButtonState(t,e){let a=t;if(t&&t instanceof Ei&&(a=t.getOrigin()),await this.state.buttonsState.update(a,e),this.scheduler){const t={};a&&(t.data=[a]),f(this.model,(e=>{const a=this.state.buttonsState[e.id];if(a.visible){const s=this.scheduler.triggerItemVisible(e.id,t);void 0!==s&&(a.visible=s)}if(!a.disabled){const s=this.scheduler.triggerItemEnable(e.id,t);void 0!==s&&(a.disabled=!s)}}),{childrenFields:["detoolbarItems"]})}}setExtraButtons(t,e){this.state.extraButtons[t]||(this.state.extraButtons[t]=[]),this.state.extraButtons[t].push(...e)}clearExtraButtons(t){void 0===t?this.state.extraButtons={}:this.state.extraButtons[t]=[]}initControlScheduler(t=[]){const e=[...t];f(this.model,(t=>{t.controlLogics&&e.push(...t.controlLogics)}),{childrenFields:["detoolbarItems"]}),super.initControlScheduler(e)}}),lr=t("ContextMenuController",class extends cr{}),hr=(t("DashboardController",class extends hn{constructor(){super(...arguments),this.providers={},this.portlets={}}initState(){super.initState()}async onCreated(){await super.onCreated(),await this.initPortlets(this.model.controls);const{appDataEntityId:t}=this.view.model;t&&this.view.evt.on("onDataChange",(t=>{const e=tn(t.data);e&&this.dataChangeNotify(e)}))}async initPortlets(t,e){(null==t?void 0:t.length)&&await Promise.all(t.map((async t=>{var a;const s=await ps(t);if(s){this.providers[t.id]=s;const i=await s.createController(t,this,e);this.portlets[t.id]=i,(null==(a=t.controls)?void 0:a.length)&&await this.initPortlets(t.controls,i)}})))}async dataChangeNotify(t){await Ma(Object.values(this.portlets).map((async e=>e.dataChangeNotify(t))))}}),t("CustomDashboardController",class{constructor(t){var e,a;this.customModelData=[],this.layoutColNum=12,this.layoutRowH=80,this.model=null,this.model=t,this.config=new Ls(t.appId,"dynadashboard","dashboard_".concat((null==(e=this.model.appDataEntityId)?void 0:e.toLowerCase())||"app","_").concat(null==(a=this.model.codeName)?void 0:a.toLowerCase()))}async loadCustomModelData(){const t=await this.config.load();return t.model&&(this.customModelData=t.model),t.colNum&&(this.layoutColNum=t.colNum),t.rowH&&(this.layoutRowH=t.rowH),this.customModelData}async saveCustomModelData(t){return await this.config.save({model:t,colNum:this.layoutColNum,rowH:this.layoutRowH})&&(this.customModelData=t),t}}),t("PortletPartState",class{constructor(){this.visible=!0,this.keepAlive=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[]},this.actionGroupState=null}})),dr=t("PortletPartController",class{get context(){return this.dashboard.context}get params(){return this.dashboard.params}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}constructor(t,e,a){this.model=t,this.dashboard=e,this.parent=a,this.state=this.createState()}async init(){await this.onInit()}async onInit(){const{layoutPos:t,sysCss:e}=this.model;if(t){const{width:t,height:e}=Ue(this.model);this.state.layout.width="".concat(t),this.state.layout.height="".concat(e)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),await this.initActionStates()}createState(){return new hr}onDataChange(t){let e=t.data[0];e&&e instanceof Ei&&(e=e.getOrigin()),e&&this.state.actionGroupState.update(e,this.dashboard.view.model.appDataEntityId)}async initActionStates(){var t;const{uiactionGroup:e}=this.model;if(!(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length))return;const a=new qi;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new $i(t.id,this.dashboard.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),this.state.actionGroupState=a;const{appDataEntityId:s}=this.dashboard.view.model;s&&this.dashboard.view.evt.on("onDataChange",this.onDataChange)}async onActionClick(t,e,a=[]){const s=t.uiactionId;await er.execAndResolved(s,{context:this.dashboard.context,params:this.dashboard.params,data:a,view:this.dashboard.view,event:e})}async dataChangeNotify(t){if(this.state.actionGroupState){const{appDataEntityId:e}=this.dashboard.view.model;this.state.actionGroupState.update(t,e)}this.calcDynaClass(t)}calcDynaClass(t){if(this.model.dynaClass){const e=ze(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}}async destroyed(){ibiz.log.debug("".concat(this.model.codeName," onDestroyed")),this.dashboard.view.evt.off("onDataChange",this.onDataChange)}}),ur=(t("ContainerPortletController",class extends dr{}),t("ViewPortletController",class extends dr{}),t("MenuPortletController",class extends dr{}),t("DataViewControlService",class extends yi{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.dedataViewDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new xi(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new xi(e,e);this.dataUIMap.set(e,s)}))}})),pr=t("DataViewControlController",class extends dn{get enableNew(){return!0===this.model.enableCardNew}initState(){super.initState(),this.state.noSort=!0===this.model.noSort,this.state.size=this.model.pagingSize||20,this.state.singleSelect=!0===this.model.singleSelect}async onCreated(){await super.onCreated(),await this.initControlService()}async initControlService(){this.service=new ur(this.model),await this.service.init(this.context)}async initGroupActionStates(){var t;const{groupUIActionGroup:e}=this.model;(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length)&&this.state.groups.forEach((async t=>{const a=new qi;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new $i(t.id,this.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),t.groupActionGroupState=a}))}async onRowClick(t){var e;super.onRowClick(t);const{groupAppDEFieldId:a}=this.model;if(a)if(this.state.groups.forEach((t=>{t.selectedData=[]})),this.state.selectedData.forEach((t=>{const e=t[a],s=this.state.groups.find((t=>t.key===e));s&&s.selectedData.push(t)})),this.state.singleSelect)this.state.groups.forEach((e=>{var a,s;let i=t;-1!==e.selectedData.indexOf(i)?(i&&i instanceof Ei&&(i=i.getOrigin()),i&&(null==(a=e.groupActionGroupState)||a.update(i,this.model.appDataEntityId))):null==(s=e.groupActionGroupState)||s.update(void 0,this.model.appDataEntityId)}));else{const a=this.state.groups.find((e=>-1!==e.children.indexOf(t)));a&&(null==(e=a.groupActionGroupState)||e.update(a.selectedData[0],this.model.appDataEntityId))}}async loadMore(){this.state.total>this.state.items.length&&await this.load({isLoadMore:!0})}async afterLoad(t,e){return await this.initGroupCodeListItems(),await this.handleDataGroup(),await this.initGroupActionStates(),e}getOptItemModel(){let t=null;const{dedataViewItems:e}=this.model;if(e)for(let a=0;a<e.length;a++)"ACTIONITEM"===e[a].itemType&&(t=e[a]);return t}getOptItemAction(t){var e;const s=new qi,i=this.getOptItemModel();if(i){if(!i.deuiactionGroup)throw new a(this.model,"操作项没有配置界面行为组");if(!(null==(e=i.deuiactionGroup.uiactionGroupDetails)?void 0:e.length))return ibiz.log.debug("操作项界面行为组没有配置界面行为"),s;i.deuiactionGroup.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const a=new $i(t.id,this.context.srfappid,e);s.addState(t.id,a)}})),s.update(t.getOrigin())}return s}async onActionClick(t,e,a){const s=t.uiactionId;await er.execAndResolved(s,{context:this.context,params:this.params,data:[e],view:this.view,event:a})}async handleDataGroup(){const{enableGroup:t,groupMode:e,groupAppDEFieldId:s}=this.model;if(t&&e){if(!s)throw new a(this.model,"分组属性没有配置");"AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup()}}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,a=new Map;e.forEach((e=>{const s=e[t];q(s)||(a.has(s)||a.set(s,[]),a.get(s).push(e))}));const s=[];a.forEach(((t,e)=>{s.push({caption:e,key:e,children:[...t]})})),this.state.groups=s}}async initGroupCodeListItems(){const{groupCodeListId:t}=this.model;if(!t)return;const e=ibiz.hub.getApp(this.context.srfappid);this.groupCodeListItems=await e.codeList.get(t,this.context,this.params)}async handleCodeListGroup(){const{groupAppDEFieldId:t,groupCodeListId:e}=this.model;if(!e)throw new a(this.model,"分组代码表没有配置");const{items:s}=this.state,i=new Map;this.groupCodeListItems.forEach((t=>{i.set(t.value,[])})),s.forEach((e=>{const a=e[t],s=i.get(a);s&&s.push(e)}));const n=[];i.forEach(((t,e)=>{const a=this.groupCodeListItems.find((t=>t.value===e));n.push({caption:a.text,key:a.value,children:t})})),this.state.groups=n}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}onClickNew(t,e){const a={...this.params,srfgroup:e};er.execAndResolved("new",{context:this.context,params:a,data:[],view:this.view,event:t})}async onGroupToolbarClick(t,e,a){const s=t.uiactionId,i={...this.params,srfgroup:a.key};await er.execAndResolved(s,{context:this.context,params:i,data:a.selectedData||[],view:this.view,event:e})}}),mr=t("ExpBarControlController",class extends hn{constructor(){super(...arguments),this.navKeyName="srfkey"}get _evt(){return this.evt}get routeDepth(){return this.view.modal.routeDepth}initState(){super.initState(),this.state.query=""}load(){return this.xDataController.load({isInitialLoad:!0})}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}get toolbarController(){return this.view.getController("".concat(this.model.xdataControlName.split("_")[0],"_toolbar"))}get XDataModel(){var t;return null==(t=this.model.controls)?void 0:t.find((t=>t.name===this.model.xdataControlName))}get isCache(){return"CACHE"===this.controlParams.expcache||"NO_CACHE"!==this.controlParams.expcache&&ibiz.config.view.expCacheMode.includes(this.model.controlType)}async onCreated(){var t;await super.onCreated(),this.childNames.push(this.model.xdataControlName);const e=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);if(e){const a=null==(t=e.appDEFields)?void 0:t.filter((t=>t.enableQuickSearch)),s=[];null==a||a.forEach((t=>{(null==t?void 0:t.lnlanguageRes)&&t.lnlanguageRes.lanResTag?s.push(ibiz.i18n.t(t.lnlanguageRes.lanResTag,t.logicName)):(null==t?void 0:t.logicName)&&s.push(t.logicName)})),s.length>0&&(this.state.placeHolder=s.join("、"))}}async onMounted(){super.onMounted(),this.xDataController&&(this.xDataController.evt.on("onActive",(t=>{this.xDataActive(t)})),this.xDataController.evt.on("onLoadSuccess",(t=>{this.xDataLoadSuccess(t)})),this.xDataController.evt.on("onRemoveSuccess",(()=>{this.defaultNavByFirstItem()}))),this.toolbarController&&this.xDataController.evt.on("onSelectionChange",(async t=>{this.toolbarController.calcButtonState(t.data[0],this.model.appDataEntityId)})),this.state.loadDefault&&this.load()}xDataLoadSuccess(t){t.isInitialLoad&&(this.state.srfnav&&this.routeDepth?this.defaultNavBySrfnav():this.defaultNavByFirstItem())}defaultNavBySrfnav(){var t;const e=null==(t=this.xDataController)?void 0:t.state.items.find((t=>t[this.navKeyName]===this.state.srfnav));this.routeDepth&&window.location.hash.split("/").length>2*this.routeDepth+2?(e&&this.xDataController.setSelection([e]),this._evt.emit("onNavViewChange",{navViewMsg:{key:this.state.srfnav,isCache:this.isCache},context:this.context})):e&&(this.xDataController.setActive(e),this.xDataController.setSelection([e]))}defaultNavByFirstItem(){const t=this.xDataController.state.items[0];if(!t)return this.state.srfnav="",void this._evt.emit("onNavViewChange",{navViewMsg:{key:"",isCache:this.isCache}});this.xDataController.setActive(t),this.xDataController.setSelection([t])}xDataActive(t){const{data:e,context:a,params:s}=t,i=this.getNavViewMsg(e[0],a,s);this._evt.emit("onNavViewChange",{navViewMsg:i})}prepareParams(t,e,a,s){const{navDER:i,navFilter:n,navigateContexts:r,navigateParams:o,appDataEntityId:c}=t,l={deName:c?He(c):void 0,navFilter:n,pickupDEFName:null==i?void 0:i.pickupDEFName,navContexts:r,navParams:o},h={context:a,params:s,data:e},{resultContext:d,resultParams:u}=Fe(l,h),p=Object.assign(a.clone(),d,{currentSrfNav:e[this.navKeyName]});this.state.srfnav=e[this.navKeyName];return{context:p,params:{...u}}}calcViewModelId(){var t;if(["GRID","DATAVIEW","LIST"].includes((null==(t=this.XDataModel)?void 0:t.controlType)||""))return this.XDataModel.navAppViewId;throw new e("多节点视图由子类实现")}getNavViewMsg(t,e,a){const s=this.calcViewModelId(),i=this.prepareParams(this.XDataModel,t,e,a);return{key:t[this.navKeyName],context:i.context,params:i.params,viewId:s,isCache:this.isCache}}calcControlHeaderVisible(){const t=!!this.toolbarController;if(!t&&this.layoutPanel){const t=this.layoutPanel.panelItems.control_toolbar;t&&(t.state.visible=!1)}return t||!(!this.model.showTitleBar||!this.model.title)||!!this.model.enableSearch}setLayoutPanel(t){super.setLayoutPanel(t),t.evt.on("onMounted",(()=>{if(!this.calcControlHeaderVisible()){const t=this.layoutPanel.panelItems.control_header;t&&(t.state.visible=!1)}}))}onRouterChange(t){this.state.srfnav!==t.srfnav&&(this.state.srfnav=t.srfnav,this.defaultNavBySrfnav())}}),fr=(t("CalendarExpBarController",class extends mr{constructor(){super(...arguments),this.navKeyName="navId"}getCalendarItemModel(t){const{sysCalendarItems:e}=this.XDataModel;if(e)return e.find((e=>e.itemType===t))}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}defaultNavBySrfnav(){var t;const e=null==(t=this.xDataController)?void 0:t.state.items.find((t=>t.navId===this.state.srfnav));if(super.defaultNavBySrfnav(),!e)return;const a=new Date(e.beginTime);this.xDataController.setSelectDate(a)}getNavViewMsg(t){const e=this.getCalendarItemModel(t.itemType);if(e){const{context:a,params:s}=this.prepareParams(e,t.deData?t.deData:t,this.context,this.params);return a.currentSrfNav=t.navId,this.state.srfnav=t.navId,{key:t.navId,context:a,params:s,viewId:e.navAppViewId}}return{key:t.navId,context:this.context,params:this.params}}}),t("TreeExpBarController",class extends mr{constructor(){super(...arguments),this.navKeyName="id",this.navNodeModelIds=[]}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}getNodeModel(t){const{detreeNodes:e}=this.XDataModel;let a;return e&&e.forEach((e=>{e.id===t&&(a=e)})),a}xDataActive(t){const{nodeData:e}=t;super.xDataActive({...t,data:[e]})}getNavViewMsg(t,a,s){const i=t.id,n=t.deData||t,r=this.getNodeModel(t.nodeId);if(!r)throw new e("找不到".concat(t.nodeId,"的节点模型"));const o=this.prepareParams(r,n,a,s);return o.context.currentSrfNav=i,this.state.srfnav=i,{key:i,viewId:r.navAppViewId,isCache:this.isCache,...o}}defaultNavByFirstItem(){const t=this.xDataController.state.items.find((t=>!(!this.xDataController.model.rootVisible&&this.xDataController.state.rootNodes.includes(t))&&(!!this.state.noNeedNavView||this.navNodeModelIds.includes(t.nodeId))));t&&(this.xDataController.setActive(t),this.xDataController.setSelection([t]))}async onCreated(){await super.onCreated();const{detreeNodes:t}=this.XDataModel;if(null==t||t.forEach((t=>{t.navAppViewId&&this.navNodeModelIds.push(t.id)})),this.state.srfnav){const t=[];this.state.srfnav.split(":").forEach(((e,a)=>{0===a?t.push(e):t.push("".concat(t[a-1],":").concat(e))})),t.pop(),this.defaultExpandedKeys=t}}}),t("FormController",class extends hn{constructor(){super(...arguments),this.details={},this.providers={},this.formItems=[]}get _evt(){return this.evt}get data(){return this.state.data}initState(){super.initState(),this.state.data=new Ei,this.state.isLoaded=!1,this.state.processing=!1,this.state.modified=!1}async dataChangeNotify(t){await Ma(Object.values(this.details).map((async e=>e.dataChangeNotify(t))))}formStateNotify(t){Object.values(this.details).forEach((e=>{e.formStateNotify(t)}))}async onCreated(){await super.onCreated(),await this.initDetailControllers(),this.dataChangeNotify=g(this.dataChangeNotify.bind(this),((t,e)=>[Array.from(new Set([...t[0],...e[0]]))]),200)}async getDraftParams(){const t={};return await Promise.all(this.formItems.map((e=>e.setDefaultValue(!0,t)))),t}async initDetailControllers(t=this.model.deformPages,e=this,a=void 0){await Promise.all(t.map((async t=>{const s=await Qa(t);if(!s)return;e.providers[t.id]=s;const i=await s.createController(t,e,a);e.details[t.id]=i,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(i);const n=aa(t);n.length&&await this.initDetailControllers(n,e,i)})))}getData(){return[this.state.data]}async setDataValue(t,e){if(!Object.prototype.hasOwnProperty.call(this.state.data,t)||Zi(this.state.data[t],e)){this.state.data[t]=e,this.state.processing=!0,this.state.modified=!0,await this._evt.emit("onFormDataChange",void 0);try{await this.dataChangeNotify([t])}finally{this.state.processing=!1}}}async validate(){return-1===(await Promise.all(this.formItems.map((t=>t.validate())))).findIndex((t=>!t))}actionNotification(t,e){super.actionNotification(t,{data:this.data,...e||{}})}})),gr=t("SearchFormService",class extends vi{async getDraft(t,e={}){let a={ok:!0,status:200,data:this.getFilteredData({...e})};return a=this.handleResponse(a),a}initUIDataMap(){f(this.model,(t=>{if("FORMITEM"===t.detailType){const e=t.id.toLowerCase();this.dataUIMap.set(e,new xi(e,e))}}),{childrenFields:["deformPages","deformTabPages","deformDetails"]})}handleResponse(t){const e=super.handleResponse(t);return e.ok&&e.data&&(e.data=this.toUIData(e.data)),e}getFilteredData(t){const e={};return this.dataUIMap.forEach((a=>{void 0!==t[a.dataKey]&&(e[a.dataKey]=t[a.dataKey])})),e}}),wr=(t("SearchFormController",class extends fr{async onCreated(){await super.onCreated(),this.service=new gr(this.model),await this.service.init(this.context),await this.load()}async onMounted(){await super.onMounted(),this.state.loadDefault&&this.load()}async load(){const t={...this.params},e=await this.getDraftParams();let a;Object.assign(t,e),await this.evt.emit("onBeforeLoadDraft",{params:t});try{a=await this.service.getDraft(this.context,t)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}return this.state.data=a.data,w(this.data,e),this.state.isLoaded=!0,this.formStateNotify("DRAFT"),this.actionNotification("GETDRAFTSUCCESS"),this.data}getParams(){return{...this.data.getOrigin()}}async search(){await this.evt.emit("onSearch",void 0)}async onSearchButtonClick(){await this.search()}async reset(){await this.load(),await this.search()}async dataChangeNotify(t){await super.dataChangeNotify(t),this.model.enableAutoSearch&&this.search()}async onKeyUp(t){const e=t||window.event;e&&"Enter"===e.code&&await this.onSearchButtonClick()}}),t("FormDetailState",class{constructor(t){this.parent=t,this.disabled=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[],label:[],labelDyna:[]},this.required=!1,this.showMoreMode=0;let e,a=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get(){if(this.parent){if(!1===this.parent.visible)return!1;if(1===this.showMoreMode&&!1===this.parent.isShowMore)return!1}return a},set:t=>(a=t,!0)}),Object.defineProperty(this,"keepAlive",{enumerable:!0,configurable:!0,get(){return void 0!==e?e:!!this.parent&&this.parent.keepAlive},set:t=>(e=t,!0)})}})),Er=t("FormDetailController",class{get data(){return this.form.data}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}get labelClass(){return[...this.state.class.label,...this.state.class.labelDyna]}constructor(t,e,a){this.model=t,this.form=e,this.parent=a,this.state=this.createState()}async init(){await this.onInit()}async onInit(){this.state.showMoreMode=this.model.showMoreMode;const{layoutPos:t,sysCss:e,labelSysCss:a}=this.model;if(t){const{width:e,height:a}=Ue(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(a)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==a?void 0:a.cssName)&&this.state.class.label.push(a.cssName)}createState(){var t;return new wr(null==(t=this.parent)?void 0:t.state)}async dataChangeNotify(t){this.calcDynamicLogic(t),this.calcDynaClass(this.data)}async formStateNotify(t){this.calcDynamicLogic([],t),this.calcDynaClass(this.data)}calcDynamicLogic(t,e){var a;this.parent&&!this.parent.state.visible||null==(a=this.model.defdgroupLogics)||a.forEach((a=>{const s=a.relatedDetailNames||[];if(e||E(s,t))try{const t=Ea(this.form.data,a);switch(a.logicCat){case"ITEMBLANK":this.state.required=!t;break;case"ITEMENABLE":this.state.disabled=!t;break;case"PANELVISIBLE":this.state.visible=t}}catch(t){ibiz.log.error(t)}}))}force(t){}calcDynaClass(t){if(this.model.dynaClass){const e=ze(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=ze(this.model.labelDynaClass,t);e.length&&(this.state.class.labelDyna=e)}}}),vr=t("FormButtonState",class extends wr{constructor(){super(...arguments),this.loading=!1}}),yr=(t("FormButtonController",class extends Er{createState(){var t;return new vr(null==(t=this.parent)?void 0:t.state)}get data(){return this.form.data}async onClick(t){this.state.loading=!0;try{"UIACTION"===this.model.actionType&&await this.doUIAction(t),await this.doFormItemUpdate()}finally{this.state.loading=!1}}async doUIAction(t){const e=this.model.uiactionId;await er.execAndResolved(e,{context:this.form.context,params:this.form.params,data:[this.data],view:this.form.view,event:t,noWaitRoute:!0})}async doFormItemUpdate(){this.model.deformItemUpdateId&&await this.form.updateFormItem(this.model.deformItemUpdateId)}}),t("FormDruipartState",class extends wr{constructor(){super(...arguments),this.showMask=!1}})),Ir=(t("FormDRUIPartController",class extends Er{constructor(){super(...arguments),this.refreshItems=["srfkey"],this.paramItem="srfkey",this.isNewData=!1}createState(){var t;return new yr(null==(t=this.parent)?void 0:t.state)}async onInit(){if(await super.onInit(),Object.assign(this.state.layout.extraStyle,{overflow:"auto"}),this.model.refreshItems){let t=this.model.refreshItems.split(";");t=t.filter((t=>!!t)),this.refreshItems.push(...t)}this.model.paramItem&&(this.paramItem=this.model.paramItem)}async dataChangeNotify(t){await super.dataChangeNotify(t),E(this.refreshItems,t)&&this.calcViewParams()}async formStateNotify(t){await super.formStateNotify(t),this.isNewData="DRAFT"===t,0!==this.model.maskMode&&(this.state.showMask=this.isNewData),"LOAD"!==t&&"DRAFT"!==t&&"SAVE"!==t||this.calcViewParams()}calcViewParams(){let t=this.form.context.clone();const e=this.model.navigateContexts;F(e)&&(t=Object.assign(t,Me(e,this.form.data,this.form.params,this.form.context)));const a=Me(this.model.navigateParams,this.form.data,this.form.params,this.form.context);if(this.state.viewComponentKey){if(JSON.stringify(this.navContext)!==JSON.stringify(t)||JSON.stringify(this.navParams)!==JSON.stringify(a))this.navContext=t,this.navParams=a,this.force();else if(this.embedView){if(this.isNewData)return;this.embedView.callUIAction("Refresh")}}else this.state.viewComponentKey=z(),this.navContext=t,this.navParams=a}setEmbedView(t){this.embedView=t,this.embedView.evt.on("onMounted",(()=>{this.isNewData||this.embedView.call("Load")})),this.embedView.evt.on("onDataChange",(t=>{["LOAD","LOADDRAFT"].includes(t.actionType)||(ibiz.log.debug("接收到关系界面的数据变更事件",t),this.model.deformItemUpdateId&&this.form.updateFormItem(this.model.deformItemUpdateId))}))}}),t("FormGroupPanelState",class extends wr{constructor(){super(...arguments),this.isShowMore=!1,this.actionGroupState=null}})),Dr=t("FormGroupPanelController",class extends Er{get disableClose(){const{titleBarCloseMode:t}=this.model;return 0===t||void 0===t}get defaultExpansion(){const{titleBarCloseMode:t}=this.model;return this.disableClose||1===t}createState(){var t;return new Ir(null==(t=this.parent)?void 0:t.state)}async onInit(){super.onInit(),await this.initActionStates()}async formStateNotify(t){super.calcDynamicLogic([],t),this.state.actionGroupState&&this.state.actionGroupState.update(this.form.data.getOrigin())}async initActionStates(){var t;const{uiactionGroup:e}=this.model;if(!(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length))return;const a=new qi;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new $i(t.id,this.form.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),this.state.actionGroupState=a}async onActionClick(t,e){const a=t.uiactionId;await er.execAndResolved(a,{context:this.form.context,params:this.form.params,data:[this.data],view:this.form.view,event:e})}}),Cr=t("FormItemState",class extends wr{constructor(t){super(t),this.parent=t,this.error=null,this.enableCondDisabled=!1;let e=!1;Object.defineProperty(this,"disabled",{enumerable:!0,configurable:!0,get(){return!!this.enableCondDisabled||e},set:t=>(e=t,!0)})}}),Ar=(t("FormItemController",class extends Er{constructor(t,e,a){super(t,e,a),this.rules=[],this.context=e.context,this.params=e.params}createState(){var t;return new Cr(null==(t=this.parent)?void 0:t.state)}get name(){return this.model.fieldName||this.model.id}get value(){return this.form.data[this.name]}get valueItemName(){if(this.model.editor)return this.model.editor.valueItemName}get unitName(){return this.model.unitName}get valueFormat(){return this.model.valueFormat}get dataType(){return this.model.dataType}async onInit(){await super.onInit(),this.state.required=!this.model.allowEmpty,this.model.editor&&"HIDDEN"!==this.model.editor.editorType&&(this.editorProvider=await $a(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this),await this.initRules()))}async initRules(){const t=La(this.form.model.deformItemVRs||[],this.name);t&&(this.rules=en(t,this.name,this.valueItemName),this.validator=new dt({[this.name]:this.rules}))}calcEnableCond(){const{enableCond:t}=this.model,e=0===this.data.srfuf;t?(e&&2===t||!e&&1===t)&&(this.state.enableCondDisabled=!0):this.state.enableCondDisabled=!0}async dataChangeNotify(t){await super.dataChangeNotify(t);const{resetItemNames:e}=this.model;let a=!1;e&&e.length>0&&e.forEach((e=>{t.includes(e)&&(a=!0)})),a&&this.setDataValue(null,this.name),(t.includes(this.name)||t.includes(this.valueItemName))&&this.validate(),t.includes(this.name)&&this.model.deformItemUpdateId&&await this.form.updateFormItem(this.model.deformItemUpdateId)}async formStateNotify(t){super.formStateNotify(t),this.calcEnableCond(),"LOAD"===t&&this.setDefaultValue(!1)}calcDynamicLogic(t,e){this.model.hidden||super.calcDynamicLogic(t,e)}async validate(){if(!this.state.visible)return this.state.error=null,!0;if(this.state.required&&W(this.data[this.name]))return this.state.error="请填写".concat(this.model.caption||""),!1;if(this.validator)try{await this.validator.validate(this.data)}catch({errors:t,_fields:e}){return this.state.error=t[0].message,!1}return this.state.error=null,!0}async setDataValue(t,e){e=e||this.name,await this.form.setDataValue(e,t)}setDefaultValue(t,e=this.data){const{createDVT:a,createDV:s,updateDVT:i,updateDV:n}=this.model,r=t?a:i,o=t?s:n,c=sn({name:this.name,valueType:r,defaultValue:o,valueFormat:this.model.valueFormat},{data:e,context:this.context,params:this.params});void 0!==c&&(e[this.name]=c)}}),t("FormMDCtrlContentTypeController",class{constructor(t){this.parent=t,this.model=this.parent.model}get data(){return this.parent.state.contentCtrlData}async onInit(){}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}onDataItemChange(t,e){this.parent.state.contentCtrlData[e]=t,this.parent.setFormDataValue()}onDataRemove(t){t<0||(this.parent.state.contentCtrlData.splice(t,1),this.parent.setFormDataValue())}onDataInsert(t){this.parent.state.contentCtrlData.push(t||{}),this.parent.setFormDataValue()}async initData(){const t=this.model.appDEFieldId||this.model.fieldName||this.model.id;t&&("REPEATER"===this.model.contentType&&"STYLE3"===this.model.detailStyle?this.parent.state.contentCtrlData=this.parent.data[t]||{}:this.parent.state.contentCtrlData=this.parent.data[t]||[])}async validate(){return!0}})),br=t("FormMDCtrlControlController",class extends Ar{async onInit(){const{model:t}=this.parent,{contentControl:a}=t;if(!a)throw new e("表单多数据部件未配置嵌入部件");this.controlModel=a;const s=await Ka(this.controlModel);s&&(this.provider=s)}}),Pr=t("FormMDCtrlDataViewController",class extends br{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onDataViewMounted(t){this.dataViewController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.dataViewController.remove(),this.parent.state.contentCtrlData=this.dataViewController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.dataViewController.load()}async onDataInsert(){}}),Sr=t("EditFormService",class extends vi{async get(t,e={}){var a;let s=await this.exec((null==(a=this.model.getControlAction)?void 0:a.appDEMethodId)||"get",t,void 0,e);return s=this.handleResponse(s),s}async getDraft(t,e={}){var a;let s=await this.exec((null==(a=this.model.getDraftControlAction)?void 0:a.appDEMethodId)||"getdraft",t,void 0,e);return s=this.handleResponse(s),s}async remove(t,e={}){var a;return await this.exec((null==(a=this.model.removeControlAction)?void 0:a.appDEMethodId)||"remove",t,void 0,e)}async create(t,e){var a;const s=e instanceof Ei?e.getOrigin():e,i=this.getFilteredData(s);let n=await this.exec((null==(a=this.model.createControlAction)?void 0:a.appDEMethodId)||"create",t,i);return n=this.handleResponse(n),n}async update(t,e){var a;const s=e instanceof Ei?e.getOrigin():e,i=this.getFilteredData(s);let n=await this.exec((null==(a=this.model.updateControlAction)?void 0:a.appDEMethodId)||"update",t,i);return n=this.handleResponse(n),n}async goBack(t,e){var s;const i=null==(s=this.model.goBackControlAction)?void 0:s.appDEMethodId;if(!i)throw new a(this.model,"缺少返回操作实体行为");let n=await this.exec(i,t,e instanceof Ei?e.getOrigin():e);return n=this.handleResponse(n),n}async updateFormItem(t,e,a={}){let s=await this.exec(t,e,a);return s=this.handleResponse(s),s}async wfStart(t,e,a){var s;const i=(null==(s=this.model.wfstartControlAction)?void 0:s.appDEMethodId)||"wfstart";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(i,t,e,a instanceof Ei?a.getOrigin():a)}async wfSubmit(t,e,a){var s;const i=this.model;let n="";n=e.type?e.type:(null==(s=i.wfsubmitControlAction)?void 0:s.appDEMethodId)||"wfsubmit";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(n,t,e,a instanceof Ei?a.getOrigin():a)}initUIDataMap(){super.initUIDataMap();const t=["srfwfmemo","srfwftransferor","srfactionparam","srffrontuf","srfnextform"];f(this.model,(e=>{if("FORMITEM"===e.detailType||"MDCTRL"===e.detailType){const a=e,s=a.fieldName||a.id.toLowerCase(),i=a.fieldName||e.appDEFieldId;let n;n=i?new xi(s,i,{isOriginField:!0,dataType:a.dataType}):new xi(s,s,{isOriginField:t.includes(s)}),this.dataUIMap.set(s,n)}}),{childrenFields:["deformPages","deformTabPages","deformDetails"]})}handleResponse(t){const e=super.handleResponse(t);return e.ok&&e.data&&(e.data=this.toUIData(e.data)),e}getFilteredData(t){const e={};return this.dataUIMap.forEach((a=>{void 0!==t[a.dataKey]&&(e[a.dataKey]=t[a.dataKey])})),e}}),xr=t("EditFormController",class extends fr{get view(){return this.ctx.view}async onCreated(){await super.onCreated(),this.service=new Sr(this.model),await this.service.init(this.context),this.autoSave=P(this.autoSave.bind(this),500,{trailing:!0})}async onMounted(){await super.onMounted(),this.state.loadDefault&&this.load()}async loadDraft(t){const{context:e,params:a}=this.handlerAbilityParams(t),s=await this.getDraftParams();let i;Object.assign(a,s);try{await this.startLoading(),await this.evt.emit("onBeforeLoadDraft",{params:a}),i=await this.service.getDraft(e,a)}catch(t){throw await this.evt.emit("onLoadDraftError",void 0),this.actionNotification("GETDRAFTERROR",{error:t}),t}finally{await this.endLoading()}return this.state.data=i.data,w(this.data,s),this.formStateNotify("DRAFT"),await this.evt.emit("onLoadDraftSuccess",void 0),this.actionNotification("GETDRAFTSUCCESS"),this.state.isLoaded=!0,this.data}async copy(){const t=Z(this.context),e=Z(this.params),a=(await ibiz.hub.getAppDataEntity(this.model.appDataEntityId)).keyAppDEFieldId;if(a&&this.params[a]){t[He(this.model.appDataEntityId)]=this.params[a],delete e[a],delete this.params[a],delete e.srfcopymode,delete this.params.srfcopymode}let s;try{await this.startLoading(),await this.evt.emit("onBeforeLoad",void 0),s=await this.service.get(t,e)}catch(t){throw await this.evt.emit("onLoadError",void 0),this.actionNotification("GETERROR",{error:t}),t}finally{await this.endLoading()}return s.data.$origin.srfsourcekey=void 0,this.state.modified=!1,this.state.data=s.data,this.formStateNotify("LOAD"),await this.evt.emit("onLoadSuccess",void 0),this.actionNotification("GETSUCCESS"),this.state.isLoaded=!0,this.data}async load(t){if(this.params.srfcopymode)return this.copy();if(!Ke(this.context,this.model.appDataEntityId))return this.loadDraft();const{context:e,params:a}=this.handlerAbilityParams(t),s=Z(a);let i;try{await this.startLoading(),await this.evt.emit("onBeforeLoad",void 0),i=await this.service.get(e,s)}catch(t){throw await this.evt.emit("onLoadError",void 0),this.actionNotification("GETERROR",{error:t}),t}finally{await this.endLoading()}return this.state.modified=!1,this.state.data=i.data,this.formStateNotify("LOAD"),await this.evt.emit("onLoadSuccess",void 0),this.actionNotification("GETSUCCESS"),this.state.isLoaded=!0,this.data}async save(t){if(this.state.processing){return await v(500,this.save.bind(this))}if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading(),await this.evt.emit("onBeforeSave",void 0);const{context:a,data:s}=this.handlerAbilityParams(t),i=s[0],n=0===i.srfuf;let r;try{r=n?await this.service.create(a,i):await this.service.update(a,i)}catch(t){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(n?"CREATE":"UPDATE","ERROR"),{error:t}),t}finally{await this.endLoading()}return r.data&&y(this.data,r.data),this.state.modified=!1,await this.evt.emit("onSaveSuccess",void 0),this.formStateNotify("SAVE"),this.actionNotification("".concat(n?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(this.data.srfmajortext||"","保存成功")}),"ROUTE"===this.view.modal.mode&&ibiz.mc.command.send(this.data.$origin,n?"OBJECTCREATED":"OBJECTUPDATED"),this.data}async remove(t){const{context:e,params:a}=this.handlerAbilityParams(t);let s,i=!1;if(await this.evt.emit("onBeforeRemove",void 0),1===this.data.srfuf){if(i=await ibiz.modal.confirm({title:"提示",desc:"确认删除吗?"}),!i)return!1;await this.startLoading();try{s=await this.service.remove(e,a)}catch(t){throw await this.evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t}),t}finally{await this.endLoading()}i=s.ok}return this.state.data=new Ei,this.state.modified=!1,await this.evt.emit("onRemoveSuccess",void 0),this.actionNotification("REMOVESUCCESS"),"ROUTE"===this.view.modal.mode&&ibiz.mc.command.send(this.data.$origin,"OBJECTREMOVED"),i}async goBack(){let t;await this.startLoading();try{t=await this.service.goBack(this.context,this.data)}finally{await this.endLoading()}t.data&&y(this.data,t.data)}async updateFormItem(t){var a;const s=null==(a=this.model.deformItemUpdates)?void 0:a.find((e=>e.id===t));if(!s)throw new e("没找到".concat(t,"表单项更新"));const{appDEMethodId:i,defiupdateDetails:n,customCode:r,scriptCode:o}=s,c=null==n?void 0:n.map((t=>t.id));let l;if(r&&o)l=fa.execScriptFn({...this.getEventArgs(),data:this.data},o,{isAsync:!1});else{const t={...this.params,...this.data.getOrigin()},e=await this.service.updateFormItem(i,this.context,t);l=e.data}l&&(null==c?void 0:c.length)&&await Promise.all(c.map((t=>this.setDataValue(t,l[t]))))}async wfStart(t){if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading();const{context:a,params:s}=this.handlerAbilityParams(t);try{await this.service.wfStart(a,s,this.data)}catch(t){throw this.actionNotification("WFSTARTERROR",{error:t}),t}finally{await this.endLoading()}this.actionNotification("WFSTARTSUCCESS",{default:"流程启动成功"})}async wfSubmit(t){if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading();const{context:a,params:s}=this.handlerAbilityParams(t);try{await this.service.wfSubmit(a,s,this.data)}catch(t){throw this.actionNotification("WFSUBMITERROR",{error:t}),t}finally{await this.endLoading()}this.actionNotification("WFSUBMITSUCCESS",{default:"流程提交成功"})}async dataChangeNotify(t){await super.dataChangeNotify(t),this.autoSave()}async autoSave(){if(this.model.enableAutoSave)try{await this.save()}catch(t){ibiz.log.error(t)}}}),_r=t("FormMDCtrlFormController",class extends br{constructor(){super(...arguments),this.controlControllerArray=[],this.state={data:[]}}onControlMounted(t,e){const a=t.ctrl;this.controlControllerArray[e]=a,a.load()}async onInit(){super.onInit(),this.service=new Sr(this.model.contentControl),await this.service.init(this.parent.form.context)}async fetch(t,e={}){let a=await this.service.exec("fetchdefault",t,e);return a=this.handleResponse(a),a}handleResponse(t){const e=t;return e.ok&&(A(e.data)?e.data=e.data.map((t=>this.service.toUIData(t))):e.data=this.service.toUIData(e.data)),e}async initData(){const t=await this.fetch(this.parent.form.context,this.parent.form.params);this.state.data=t.data}onDataRemove(t){const e=this.controlControllerArray[t];e&&e.remove()}onFormChange(t,e){const a=this.controlControllerArray[e];a&&(a.save(),this.state.data[e]&&y(this.state.data[e],t[0]),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue())}onFormRemoveSuccess(t){this.state.data.splice(t,1),this.controlControllerArray.splice(t,1),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue()}async onDataInsert(){const t=await this.service.getDraft(this.parent.form.context,this.parent.form.params);if(t.data){const e=await this.service.create(this.parent.form.context,t.data);this.state.data.push(e.data),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue()}}async validate(){return-1===(await Promise.all(this.controlControllerArray.map((t=>t.validate())))).findIndex((t=>!t))}}),Tr=t("FormMDCtrlGridController",class extends br{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onGridMounted(t){this.gridController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.gridController.remove(),this.parent.state.contentCtrlData=this.gridController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.gridController.load()}async onDataInsert(){await this.gridController.newRow(),this.parent.state.contentCtrlData=this.gridController.state.items,this.parent.setFormDataValue()}async onInit(){const{model:t}=this.parent,{contentControl:a}=t;if(!a)throw new e("表单多数据部件未配置嵌入部件");y(a,{enableRowEdit:!0,enableRowNew:!0}),this.controlModel=a;const s=await Ka(this.controlModel);s&&(this.provider=s)}async validate(){const{rows:t}=this.gridController.state;return-1===(await Promise.all(t.map((t=>this.gridController.validate(t))))).findIndex((t=>!t))}}),Lr=t("FormMDCtrlListController",class extends br{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onListMounted(t){this.listController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.listController.remove(),this.parent.state.contentCtrlData=this.listController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.listController.load()}async onDataInsert(){}}),Nr=t("FormMDCtrlRepeaterFormController",class extends Ar{constructor(){super(...arguments),this.formControllerArray=[]}async onDataInsert(){super.onDataInsert({})}onDataRemove(t){t<0||super.onDataRemove(t)}async validate(){const t=this.formControllerArray.map((t=>t.validate()));return-1===(await Promise.all(t)).findIndex((t=>!t))}setFromController(t){this.formControllerArray.push(t)}}),Or=t("FormMDCtrlRepeaterFormOneController",class extends Nr{get data(){return this.parent.state.contentCtrlData}onDataItemChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}}),Mr=t("FormMDCtrlRepeaterGridController",class extends Ar{constructor(){super(...arguments),this.columns=[],this.editorMap={}}async onInit(){this.initColumns(this.model.deformDetails||[])}initColumns(t){t.forEach((async t=>{if("FORMITEM"===t.detailType){const{editor:e,dataType:a}=t,s=await $a(e);if(s){const i=await s.createController(e,{unitName:e.unitName,valueFormat:e.valueFormat,context:this.parent.form.context,params:this.parent.form.params,dataType:a});this.editorMap[t.codeName]={provider:s,controller:i}}this.columns.push({codeName:t.codeName,caption:t.caption})}const e=aa(t);e.length&&this.initColumns(e)}))}rowDataChange(t,e,a){const s=this.data[a];Object.prototype.hasOwnProperty.call(s,e)&&!Zi(s[e],t)||(s[e]=t,this.onDataItemChange(s,a))}}),Rr=t("FormMDCtrlState",class extends wr{constructor(){super(...arguments),this.contentCtrlData=[]}}),Vr=(t("FormMDCtrlController",class extends Er{createState(){var t;return new Rr(null==(t=this.parent)?void 0:t.state)}async onInit(){switch(await super.onInit(),this.model.contentType){case"FORM":this.mdCtrlContentController=new _r(this);break;case"GRID":this.mdCtrlContentController=new Tr(this);break;case"LIST":this.mdCtrlContentController=new Lr(this);break;case"DATAVIEW":this.mdCtrlContentController=new Pr(this);break;case"REPEATER":"DEFAULT"===this.model.detailStyle&&(this.mdCtrlContentController=new Nr(this)),"STYLE3"===this.model.detailStyle&&(this.mdCtrlContentController=new Or(this)),"STYLE2"===this.model.detailStyle&&(this.mdCtrlContentController=new Mr(this))}this.mdCtrlContentController&&await this.mdCtrlContentController.onInit()}setFormDataValue(){const t=this.model.appDEFieldId||this.model.fieldName||this.model.id;t&&this.form.setDataValue(t,this.state.contentCtrlData)}async loadData(){await this.mdCtrlContentController.initData()}async validate(){return this.mdCtrlContentController.validate()}setDefaultValue(){}}),t("FormMDCtrlItemController",class extends xr{constructor(t,e,a,s,i){super(t,e,a,s),this.state.data=i,this.state.isSimple=!0}async initDetailControllers(t=this.model.deformDetails,e=this,a=void 0){await Promise.all(t.map((async t=>{const s=await Qa(t);if(!s)return;e.providers[t.id]=s;const i=await s.createController(t,e,a);e.details[t.id]=i,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(i);const n=aa(t);n.length&&await this.initDetailControllers(n,e,i)})))}}),t("FormPageState",class extends Ir{})),kr=(t("FormPageController",class extends Dr{createState(){var t;return new Vr(null==(t=this.parent)?void 0:t.state)}}),t("FormRawItemState",class extends wr{})),Fr=(t("FormRawItemController",class extends Er{createState(){var t;return new kr(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPageState",class extends wr{})),Wr=(t("FormTabPageController",class extends Er{createState(){var t;return new Fr(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPanelState",class extends wr{})),Br=(t("FormTabPanelController",class extends Er{createState(){var t;return new Wr(null==(t=this.parent)?void 0:t.state)}}),t("GridColumnController",class{constructor(t,e){var a;this.isAdaptiveColumn=!1,this.isCustomCode=!1,this.model=t,this.grid=e,this.isAdaptiveColumn="STAR"===t.widthUnit,this.isAdaptiveColumn&&(this.grid.hasAdaptiveColumn=!0),(null==(a=this.deGridDataItem)?void 0:a.customCode)&&(this.isCustomCode=!0)}get context(){return this.grid.context}get params(){return this.grid.params}get enableRowEdit(){return!(!this.grid.model.enableRowEdit||!this.model.enableRowEdit)}get deGridDataItem(){var t;return null==(t=this.grid.model.degridDataItems)?void 0:t.find((t=>t.id===this.model.id))}get valueFormat(){var t;return null==(t=this.deGridDataItem)?void 0:t.format}get dataType(){var t;return null==(t=this.deGridDataItem)?void 0:t.dataType}async init(){await this.onInit()}async onInit(){}getCustomHtml(t){var e;if(null==(e=this.deGridDataItem)?void 0:e.scriptCode)return fa.execScriptFn({data:t.data},this.deGridDataItem.scriptCode,{singleRowReturn:!0,isAsync:!1})}})),Ur=t("GridRowState",class{constructor(t,e){this.errors={},this.uaColStates={},this.editColStates={},this.showRowEdit=!1,this.modified=!1,this.processing=!1,this.data=t,Object.keys(this.data).forEach((t=>{void 0===this.errors[t]&&(this.errors[t]=null)})),Object.values(e.uaColumns).forEach((t=>{t.initActionStates(this)})),Object.values(e.editColumns).forEach((t=>{this.editColStates[t.fieldName]={disabled:!1,readonly:!1,editable:"all"===ibiz.config.grid.editShowMode,required:!1}}))}}),zr=t("GridService",class extends yi{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.degridDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new xi(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new xi(e,e);this.dataUIMap.set(e,s)}))}async updateGridEditItem(t,e,a={}){const s=await this.app.deService.getService(this.model.appDataEntityId);let i=await s.exec(t,e,a);return i=this.handleResponse(i),i}}),jr=t("GridController",class extends dn{constructor(){super(...arguments),this.hasAdaptiveColumn=!1,this.isMultistageHeader=!1,this.columns={},this.fieldColumns={},this.uaColumns={},this.editColumns={},this.providers={},this.aggTitle="合计"}get groupCodeListItems(){var t;return null==(t=this.groupFieldColumn)?void 0:t.codeListItems}get enableAgg(){return"NONE"!==this.model.aggMode}get allowRowEdit(){return!!this.model.enableRowEdit&&this.state.rowEditOpen}initState(){super.initState(),this.state.rows=[],this.state.noSort=!0===this.model.noSort,this.state.size=this.model.pagingSize||20,this.state.singleSelect=!0===this.model.singleSelect,this.state.columnStates=[],this.state.aggResult={},this.state.rowEditOpen=!1}async onCreated(){await super.onCreated(),this.service=new zr(this.model),await this.service.init(this.context),this.initColumnStates(),await this.initGridColumns(),this.dataChangeNotify=g(this.dataChangeNotify.bind(this),((t,e)=>[t[0],Array.from(new Set([...t[1],...e[1]]))]),200),await this.initGroup()}async initGroup(){if(!this.model.enableGroup)return;const{groupAppDEFieldId:t,groupCodeListId:e,groupMode:s}=this.model;if(this.groupFieldColumn=Object.values(this.fieldColumns).find((e=>e.model.appDEFieldId===t)),!this.groupFieldColumn)throw new a(this.model,"没有配置分组属性的属性列");const i=this.groupFieldColumn.model.id;if(!this.groupFieldColumn.model.appCodeListId)throw new a(this.groupFieldColumn.model,"分组属性的属性列".concat(i,"没有配置代码表"));const n=this.state.columnStates.findIndex((t=>t.key===this.groupFieldColumn.model.codeName));if(-1!==n&&0!==n){if(this.isMultistageHeader)throw new a(this.model,"请将分组属性列".concat(i,"配置为第一列"));const t=this.state.columnStates.splice(n,1);this.state.columnStates.unshift(...t)}if("CODELIST"===s){if(!e)throw new a(this.model,"代码表分组模式需要配置代码表");if(this.groupFieldColumn.model.appCodeListId!==e)throw new a(this.model,"分组代码表与属性列".concat(i,"的代码表不一致"))}}async afterLoad(t,e){return await super.afterLoad(t,e),await Ma(Object.values(this.fieldColumns).map((async t=>{await t.loadCodeList()})),!1),this.state.rows=e.map((t=>{const e=new Ur(t,this);return this.gridStateNotify(e,"LOAD"),e})),this.state.rows.forEach((t=>{Object.values(t.uaColStates).forEach((e=>{e.update(t.data.getOrigin(),this.model.appDataEntityId)}))})),this.calcGroupData(e),this.calcAggResult(e),e}calcGroupData(t){const{enableGroup:e,groupMode:a}=this.model;if(e){const e=new Map,s="CODELIST"===a,i=this.groupFieldColumn.model.id;s&&this.groupCodeListItems.forEach((t=>{e.set(t.value,[])})),t.forEach((t=>{const a=t[i];s||e.has(a)||e.set(a,[]),e.has(a)&&e.get(a).push(t)})),this.state.groups=[],e.forEach(((t,e)=>{const a=this.groupCodeListItems.find((t=>t.value===e));this.state.groups.push({caption:(null==a?void 0:a.text)||"".concat(e),key:e,children:t})}))}}async loadRemoteAgg(){const{aggMode:t,aggAppDataEntityId:e,aggAppDEDataSetId:s}=this.model;if("ALL"!==t)return;if(!s||!e)throw new a(this.model,"缺少配置聚合实体或聚合数据集");const i=await this.getFetchParams(),n=ibiz.hub.getApp(this.context.srfappid),r=await n.deService.exec(e,s,this.context,void 0,i);r.data.length&&([this.state.remoteAggResult]=r.data)}calcAggResult(t){Object.values(this.fieldColumns).forEach((e=>{const a=e.calcFieldAgg(t);a&&(this.state.aggResult[e.model.id]=a)}))}afterRemove(t){super.afterRemove(t);const e=this.state.rows.findIndex((e=>e.data.srfkey===t.srfkey));this.state.rows.splice(e,1),this.state.groups.forEach((e=>{if(e.children.length){const a=e.children.findIndex((e=>e.srfkey===t.srfkey));-1!==a&&e.children.splice(a,1)}}))}async newRow(){const{enableRowEdit:t,enableRowNew:a}=this.model;if(!t||!a||"row"!==ibiz.config.grid.editShowMode)return void ibiz.log.error("不支持新建行");if(this.state.rows.find((t=>t.showRowEdit)))throw new e("请先完成当前行编辑中的行的操作");const s={...this.params},i=this.calcDefaultValue({},!0);let n;Object.assign(s,i);try{n=await this.service.getDraft(this.context,s)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}const r=n.data;w(r,i),this.state.items.unshift(r);const o=new Ur(r,this);this.state.rows.unshift(o),this.gridStateNotify(o,"DRAFT"),this.switchRowEdit(this.state.rows[0],!0),this.actionNotification("GETDRAFTSUCCESS",{data:r})}async save(t){if(this.state.isSimple)return;const a=this.state.rows.find((e=>e.data.srfkey===t.srfkey));if(!a)throw new e("行数据不存在");if(!a.modified)return void ibiz.log.debug("值没有发生改变");if(a.processing)return void await v(500,this.save.bind(this),[t]);if(!await this.validate(a))throw new e("行数据校验不通过,保存取消");let s;await this.startLoading();const i=0===t.srfuf,n=He(this.model.appDataEntityId),r=this.context.clone();r[n]=t.srfkey;try{s=i?await this.service.create(r,t):await this.service.update(r,t)}catch(t){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(i?"CREATE":"UPDATE","ERROR"),{error:t,data:a.data}),t}finally{await this.endLoading()}const o=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(o,1,s.data),a.data=s.data,a.modified=!1,this.actionNotification("".concat(i?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(s.data.srfmajortext||"","保存成功"),data:s.data}),this.gridStateNotify(a,"SAVE"),await this.evt.emit("onSaveSuccess",void 0)}async saveAll(){const t=this.state.rows.filter((t=>t.modified)).map((t=>t.data));t.length&&await Ma(t.map((t=>this.save(t))))}async initColumnsController(t){var e;const a=await es(t);if(!a)return;this.providers[t.codeName]=a;const s=await a.createController(t,this);this.columns[t.codeName]=s,"DEFGRIDCOLUMN"===t.columnType?(this.fieldColumns[t.codeName]=s,t.enableRowEdit&&(this.editColumns[t.codeName]=s)):"UAGRIDCOLUMN"===t.columnType?this.uaColumns[t.codeName]=s:"GROUPGRIDCOLUMN"===t.columnType&&(this.isMultistageHeader=!0,await Promise.all((null==(e=t.degridColumns)?void 0:e.map((async t=>{await this.initColumnsController(t)})))||[]))}initColumnStates(){f(this.model,(t=>{"GROUPGRIDCOLUMN"!==t.columnType&&this.state.columnStates.push({key:t.codeName,caption:t.caption,hidden:!!t.hideDefault,uaColumn:"UAGRIDCOLUMN"===t.columnType})}),{childrenFields:["degridColumns"]}),this.calcColumnFixed()}calcColumnFixed(){const t=this.state.columnStates.filter((t=>!t.hidden)),e=t.length,{frozenFirstColumn:a,frozenLastColumn:s}=this.model;t.forEach(((t,i)=>{t.uaColumn?t.fixed=i+1<=Math.floor(e/2)?"left":"right":a&&i<a?t.fixed="left":s&&i>=e-s&&(t.fixed="right")}))}async initGridColumns(){this.model.degridColumns&&await Promise.all(this.model.degridColumns.map((async t=>this.initColumnsController(t))))}async setRowValue(t,e,a){if(!Object.prototype.hasOwnProperty.call(t.data,e)||Zi(t.data[e],a)){t.data[e]=a,t.modified=!0,t.processing=!0;try{await this.dataChangeNotify(t,[e]),await this.evt.emit("onGridDataChange",{data:this.state.rows.map((t=>t.data))})}finally{t.processing=!1}}}async dataChangeNotify(t,e){await Ma(Object.values(this.editColumns).map((async a=>a.dataChangeNotify(t,e))))}gridStateNotify(t,e){Object.values(this.editColumns).forEach((a=>{a.gridStateNotify(t,e)}))}async validate(t){return-1===(await Promise.all(Object.values(this.editColumns).map((e=>e.validate(t))))).findIndex((t=>!t))}async toggleRowEdit(){if(!this.model.enableRowNew)throw new e("当前表格不支持行编辑,无法切换开启行编辑");this.state.rowEditOpen=!this.state.rowEditOpen}async switchRowEdit(t,a,s=!0){if(!this.allowRowEdit)return;const i=void 0===a?!t.showRowEdit:a;if(t.showRowEdit!==i){if(!1===i)if(s)await this.save(t.data);else{if(0===t.data.srfuf)return t.showRowEdit=!1,this.evt.emit("onRowEditChange",{row:t}),this.remove({data:[t.data],silent:!0});t.cacheData&&(t.data=t.cacheData,delete t.cacheData)}else{if(this.state.rows.find((t=>t.showRowEdit)))throw new e("同时只能有一行开启行编辑");if(1===t.data.srfuf){t.cacheData=Z(t.data);const e=this.calcDefaultValue(t.data,!1);Object.assign(t.data,e)}}t.showRowEdit=i,Object.values(this.editColumns).forEach((e=>{t.editColStates[e.fieldName].editable=i})),this.evt.emit("onRowEditChange",{row:t})}}setSort(t,e){if(t&&e){const a=this.fieldIdNameMap.get(t).toLowerCase();super.setSort(a,e)}else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}async updateGridEditItem(t,a){var s;const i=null==(s=this.model.degridEditItemUpdates)?void 0:s.find((t=>t.id===a));if(!i)throw new e("没找到".concat(a,"编辑列更新"));const{appDEMethodId:n,degeiupdateDetails:r,customCode:o,scriptCode:c}=i,l=r.map((t=>t.id));let h;if(o&&c)h=fa.execScriptFn({...this.getEventArgs(),data:t.data},c,{isAsync:!1});else{const e={...this.params,...t.data.getOrigin()},a=await this.service.updateGridEditItem(n,this.context,e);h=a.data}h&&(null==l?void 0:l.length)&&await Promise.all(l.map((e=>this.setRowValue(t,e,h[e]))))}async loadData(t){const{context:e}=this.handlerAbilityParams(t),a=await this.getFetchParams(null==t?void 0:t.viewParam);let s;await this.startLoading();try{s=await this.service.fetch(e,a)}finally{await this.endLoading()}return s.data}async exportData(t){const a=this.fieldColumns,s=Object.keys(a).map((t=>a[t].model.id)),i=Object.keys(a).map((t=>a[t].model.caption)),n=(r=s,(await(async()=>{var s;const i=null==(s=t.params)?void 0:s.type;let n=[];if("activatedPage"===i&&(n=this.state.rows.map((t=>t.data))),"maxRowCount"===i||"customPage"===i){const{size:e}=this.state,{startPage:a,endPage:s}=t.params,r="customPage"===i?{page:0,offset:(a-1)*e,size:(s-a+1)*e}:{size:1e3,page:0};n=await this.loadData({viewParam:r})}if("selectedRows"===i&&(n=this.getData()),0===n.length)throw new e("无导出数据");return(t=>{const e=new Map;Object.keys(a).forEach((t=>{a[t].codeList&&e.set(t,a[t].codeListItems)}));const s=Z(t.map((t=>t.getOrigin())));return s.forEach((t=>{Object.keys(t).forEach((a=>{var s;e.get(a)&&(t[a]=(null==(s=e.get(a).find((e=>e.value===t[a])))?void 0:s.text)||t[a])}))})),s})(n)})()).map((t=>r.map((e=>t[e])))));var r;if(!ibiz.util.getExportExcel)throw new e("ibiz.util.getExportExcel不存在");const o=await ibiz.util.getExportExcel();if(!o)throw new e("导出模块加载错误");o.exportJsonToExcel({header:i,data:n,filename:this.model.logicName,autoWidth:!0})}calcDefaultValue(t,e){const a={};return Object.values(this.editColumns).forEach((s=>{const{createDV:i,createDVT:n,updateDV:r,updateDVT:o}=s.editItem,c=e?n:o,l=e?i:r,h=sn({name:s.fieldName,valueType:c,defaultValue:l,valueFormat:s.valueFormat},{data:t,context:this.context,params:this.params});void 0!==h&&(a[s.fieldName]=h)})),a}}),Gr=t("GridFieldColumnController",class extends Br{constructor(){super(...arguments),this.codeList=void 0}get isLinkColumn(){return!!this.model.enableLinkView&&!!this.model.linkAppViewId}get hasAction(){return!!this.model.deuiactionId}clickable(t){const e=t.data[this.model.codeName];return(this.isLinkColumn||this.hasAction)&&e}handlePublicParams(t,e,a){const{userParam:s}=this.model;if(!s)return{context:e,params:a};const{navigateContexts:i,navigateParams:n}=Be(s);let r={};i&&t&&(r=Me(i,t,a,e));const o=Object.assign(e.clone(),r);let c={};n&&t&&(c=Me(n,t,a,e));return{context:o,params:{...a,...c}}}async openLinkView(t,e){if(!t.data[this.model.codeName])return;const a=this.model.linkValueItem||"srfkey",i=t.data[a];if(null==i)throw new s(this.model,"未在行数据中取到 ".concat(a," 的值"));const{linkAppViewId:n}=this.model;if(!n)return;const r=Ia(t.data),o=Object.assign(this.context.clone(),{srfkey:i,...r}),c=Z(this.params),{context:l,params:h}=this.handlePublicParams(t.data,o,c),d=await ibiz.commands.execute(Ni.TAG,n,l,h,{event:e});(null==d?void 0:d.ok)&&this.grid.load()}async triggerAction(t,e){const a=this.model.deuiactionId;await er.execAndResolved(a,{context:this.context,params:this.params,data:[t.data],view:this.grid.view,event:e})}async loadCodeList(){const t=this.model.appCodeListId;if(!t)return;const e=ibiz.hub.getApp(this.context.srfappid);this.codeList||(this.codeList=e.codeList.getCodeList(t));const a=await e.codeList.get(t,this.context,this.params);return this.codeListItems=a,a}calcFieldAgg(t){const{aggField:e,aggMode:a,aggValueFormat:i,unitName:n}=this.model;if("NONE"===a)return;const r=e||this.model.id;let o;if(t=t.filter((t=>!q(t[r]))),"PAGE"!==this.grid.model.aggMode)throw"ALL"===this.grid.model.aggMode?new s(this.model,"远程聚合暂未支持"):new s(this.grid.model,"暂未支持聚合模式".concat(this.grid.model.aggMode));switch(a){case"SUM":o=t.map((t=>t[r])).reduce(((t,e)=>t+e),0);break;case"AVG":o=t.map((t=>t[r])).reduce(((t,e)=>t+e),0)/t.length;break;case"MAX":o=Math.max(...t.map((t=>t[r])));break;case"MIN":o=Math.min(...t.map((t=>t[r])));break;default:throw new s(this.model,"暂未支持属性列聚合模式".concat(a))}let c="".concat(o);if(i)try{c=ibiz.util.text.format("".concat(o),i)}catch(t){ibiz.log.error("".concat(o," 值格式化错误"))}return c&&n&&(c+=n),c}formatValue(t=""){if("SIMPLE"!==this.model.valueType)return an.toText(this.model,t);const e="".concat(t);if(!this.valueFormat)return e;return n.isDate(this.dataType)?nt(e).format(this.valueFormat):ibiz.util.text.format(e,this.valueFormat)}}),Hr=(t("GridUAColumnController",class extends Br{initActionStates(t){var e;const{deuiactionGroup:s}=this.model;if(!s)throw new a(this.model,"操作列没有配置界面行为组");if(!(null==(e=s.uiactionGroupDetails)?void 0:e.length))return void ibiz.log.debug("操作列界面行为组没有配置界面行为");const i=new qi;s.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const a=new $i(t.id,this.grid.context.srfappid,e);i.addState(t.id,a)}})),t.uaColStates[this.model.codeName]=i}async onActionClick(t,e,a){const s=t.uiactionId;await er.execAndResolved(s,{context:this.context,params:this.params,data:[e.data],view:this.grid.view,event:a})}}),t("GridFieldEditColumnController",class extends Gr{constructor(){super(...arguments),this.rules=[]}get unitName(){return this.editItem.unitName}get valueFormat(){return this.model.valueFormat}get valueItemName(){if(this.editItem.editor)return this.editItem.editor.valueItemName}get fieldName(){return this.model.dataItemName}async onInit(){await super.onInit();const t=ea(this.grid.model,this.model.codeName);t&&(this.editItem=t,this.editItem.editor&&"HIDDEN"!==this.editItem.editor.editorType&&(this.editorProvider=await $a(this.editItem.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.editItem.editor,this),await this.initRules())))}async initRules(){const t=La(this.grid.model.degridEditItemVRs||[],this.fieldName);t&&(this.rules=en(t,this.fieldName,this.valueItemName),this.validator=new dt({[this.fieldName]:this.rules}))}async setRowValue(t,e,a){a=a||this.fieldName,await this.grid.setRowValue(t,a,e)}async dataChangeNotify(t,a){this.calcColumnDisabled(t);const s=t.editColStates[this.fieldName].required;this.calcColumnRequired(t);if(s!==t.editColStates[this.fieldName].required||a.includes(this.fieldName)||a.includes(this.valueItemName)){if(!await this.validate(t))throw new e("".concat(this.editItem.codeName,"校验报错,").concat(t.errors[this.fieldName]))}a.includes(this.fieldName)&&this.editItem.degridEditItemUpdateId&&await this.grid.updateGridEditItem(t,this.editItem.degridEditItemUpdateId)}gridStateNotify(t,e){this.calcColumnDisabled(t),this.calcColumnReadonly(t),this.calcColumnRequired(t)}calcColumnDisabled(t){let e=this.calcEnableCond(t);if(e&&this.grid.scheduler){const a=this.grid.scheduler.triggerItemEnable(this.fieldName,{data:[t.data]});void 0!==a&&(e=a)}t.editColStates[this.fieldName].disabled=!e}calcColumnRequired(t){let e=!1!==this.editItem.allowEmpty;if(e&&this.grid.scheduler){const a=this.grid.scheduler.triggerItemBlank(this.fieldName,{data:[t.data]});void 0!==a&&(e=a)}t.editColStates[this.fieldName].required=!e}calcColumnReadonly(t){var e;const a=!!(null==(e=this.editItem.editor)?void 0:e.readOnly);t.editColStates[this.fieldName].readonly=a}calcEnableCond(t){const{enableCond:e}=this.editItem,a=0===t.data.srfuf;switch(e){case 0:return!1;case 1:return a;case 2:return!a;default:return!0}}async validate(t){const e=this.fieldName;if("cell"!==ibiz.config.grid.editShowMode&&t.editColStates[e].required&&W(t.data[e]))return t.errors[e]="请填写".concat(this.model.caption||""),!1;if(this.rules.length&&this.validator)try{await this.validator.validate(t.data)}catch(a){const{errors:s}=a;return t.errors[e]=s[0].message,!1}return t.errors[e]=null,!0}}),t("GridGroupColumnController",class extends Br{}),t("ListService",class extends yi{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new xi(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new xi(e,e);this.dataUIMap.set(e,s)}))}})),Kr=(t("ListController",class extends dn{initState(){super.initState(),this.state.noSort=!0===this.model.noSort}async onCreated(){await super.onCreated(),this.state.size=this.model.pagingSize||20,this.service=new Hr(this.model),await this.service.init(this.context)}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}get batchToolbarController(){return this.view.getController("".concat(this.model.name,"_batchtoolbar"))}get quickToolbarController(){return this.view.getController("".concat(this.model.name,"_quicktoolbar"))}setSelection(t){var e,a;super.setSelection(t);const s=null==t?void 0:t[0];null==(e=this.batchToolbarController)||e.calcButtonState(s,this.model.appDataEntityId),null==(a=this.quickToolbarController)||a.calcButtonState(s,this.model.appDataEntityId)}async loadMore(){this.state.total>this.state.items.length&&await this.load({isLoadMore:!0})}async afterLoad(t,e){return await this.handleDataGroup(),e}setData(t){this.state.items=t}getAllData(){return this.state.items}async handleDataGroup(){const{enableGroup:t,groupMode:e}=this.model;t&&e&&("AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup())}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,a=new Map;e.forEach((e=>{const s=a.get(e[t])||[];s.push(e),a.set(e[t],s)}));const s=[];a.forEach(((t,e)=>{s.push({caption:e,key:e,children:[...t]})})),this.state.groups=s}}async handleCodeListGroup(){const{groupAppDEFieldId:t,groupCodeListId:e}=this.model;if(t&&e){const{items:a}=this.state,s=[],i=ibiz.hub.getApp(this.context.srfappid),n=await i.codeList.get(e,this.context,this.params),r=[];n.forEach((e=>{const i=a.filter((a=>a[t]===e.value));s.push({caption:e.text,key:e.value,children:[...i]}),r.push(e.value)}));const o=a.filter((e=>-1===r.indexOf(e[t])));o.length>0&&s.push({caption:"其他",key:"其他",children:[...o]}),this.state.groups=s}}}),t("PanelController",class extends hn{constructor(){super(...arguments),this.panelItems={},this.providers={}}get _evt(){return this.evt}get data(){return this.state.data}initState(){super.initState(),this.state.data={}}setInputData(t){this.inputData=t}getData(){return[this.data]}async onCreated(){var t;await super.onCreated(),await this.initPanelItemControllers(),(null==(t=this.scheduler)?void 0:t.hasControlEventTrigger)&&this._evt.on("onPanelItemEvent",(t=>{this.scheduler.triggerControlEvent(t.panelItemName,t.panelItemEventName,t)}))}async onMounted(){this.load()}async initPanelItemControllers(t=this.model.rootPanelItems,e=this,a=void 0){t&&await Promise.all(t.map((async t=>{var s,i;const n=await is(t);if(!n)return;e.providers[t.id]=n;const r=await n.createController(t,e,a);e.panelItems[t.id]=r,(null==(s=t.panelItems)?void 0:s.length)&&!r.isDataContainer&&await this.initPanelItemControllers(t.panelItems,e,r),(null==(i=t.panelTabPages)?void 0:i.length)&&await this.initPanelItemControllers(t.panelTabPages,e,r)})))}async load(){const t=await this.prepareData();if(!t)throw new e("未获取到面板数据");const a=this.convertData(t);this.state.data=a,this.panelStateNotify("LOAD")}async prepareData(){let t;if(1===this.model.dataMode)this.inputData&&(t=this.inputData);else t=this.inputData||{};return t}convertData(t){return t}dataChangeNotify(t){Object.values(this.panelItems).forEach((e=>{e.dataChangeNotify(t)}))}panelStateNotify(t){Object.values(this.panelItems).forEach((e=>{e.panelStateNotify(t)}))}async setDataValue(t,e){Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e,this.dataChangeNotify([t]))}initControlScheduler(t=[]){const e=[...t];f(this.model,(t=>{t.controlLogics&&e.push(...t.controlLogics)}),{childrenFields:["rootPanelItems","panelItems","panelTabPages"]}),super.initControlScheduler(e)}})),Xr=(t("ViewLayoutPanelController",class extends Kr{async onCreated(){var t;this.preprocessModel(),await super.onCreated(),(null==(t=this.scheduler)?void 0:t.hasControlEventTrigger)&&this.evt.on("onControlEvent",(t=>{this.scheduler.triggerControlEvent(t.triggerControlName,t.triggerEventName,t.triggerEvent)}))}registerToCtx(){}preprocessModel(t){var e;const a=t=>{const e=[];return t.forEach((t=>{"CONTAINER"===t.itemType&&"PANELPART"===t.predefinedType?e.push(...t.panelItems||[]):e.push(t)})),e.forEach((t=>{"CONTAINER"===t.itemType&&this.preprocessModel(t)})),e};t?t.panelItems=a(t.panelItems||[]):(null==(e=this.model.rootPanelItems)?void 0:e.length)&&(this.model.rootPanelItems=a(this.model.rootPanelItems||[]))}}),t("PanelItemState",class{constructor(t){this.parent=t,this.disabled=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[],label:[],labelDyna:[]},this.required=!1;let e,a=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get(){var t;return!1!==(null==(t=this.parent)?void 0:t.visible)&&a},set:t=>(a=t,!0)}),Object.defineProperty(this,"keepAlive",{enumerable:!0,configurable:!0,get(){return void 0!==e?e:!!this.parent&&this.parent.keepAlive},set:t=>(e=t,!0)})}})),Yr=(t("PanelItemController",class{constructor(t,e,a){this.model=t,this.panel=e,this.parent=a,this.dynaLogicResult={visible:!0,disabled:!1,required:!1},this.state=this.createState()}get dataParent(){return this.findDataParent(this)}get data(){return this.dataParent.data}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}get labelClass(){return[...this.state.class.label,...this.state.class.labelDyna]}async init(){await this.onInit()}async onInit(){const{layoutPos:t,sysCss:e,labelSysCss:a}=this.model;if(t){const{width:e,height:a}=Ue(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(a)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==a?void 0:a.cssName)&&this.state.class.label.push(a.cssName)}createState(){var t;return new Xr(null==(t=this.parent)?void 0:t.state)}async dataChangeNotify(t){this.calcDynamicLogic(t),this.calcItemDisabled(this.data),this.calcItemVisible(this.data),this.calcItemRequired(this.data),this.calcDynaClass(this.data)}async panelStateNotify(t){this.calcDynamicLogic([],!0),this.calcItemDisabled(this.data),this.calcItemVisible(this.data),this.calcItemRequired(this.data),this.calcDynaClass(this.data)}calcItemDisabled(t){let e=!this.dynaLogicResult.disabled;if(e&&this.panel.scheduler){const a=this.panel.scheduler.triggerItemEnable(this.model.id,{data:[t]});void 0!==a&&(e=a)}this.state.disabled=!e}calcItemVisible(t){let{visible:e}=this.dynaLogicResult;if(e&&this.panel.scheduler){const a=this.panel.scheduler.triggerItemVisible(this.model.id,{data:[t]});void 0!==a&&(e=a)}this.state.visible=e}calcItemRequired(t){let e=!this.dynaLogicResult.required;if(e&&this.panel.scheduler){const a=this.panel.scheduler.triggerItemBlank(this.model.id,{data:[t]});void 0!==a&&(e=a)}this.state.required=!e}calcDynamicLogic(t,e=!1){var a;this.parent&&!this.parent.state.visible||null==(a=this.model.panelItemGroupLogics)||a.forEach((a=>{const s=a.relatedItemNames||[];if(e||E(s,t))try{const t=va(this.data,a);switch(a.logicCat){case"ITEMBLANK":this.dynaLogicResult.required=!t;break;case"ITEMENABLE":this.dynaLogicResult.disabled=!t;break;case"PANELVISIBLE":this.dynaLogicResult.visible=t}}catch(t){ibiz.log.error(t)}}))}findDataParent(t){const{parent:e}=t;return e?e.isDataContainer?e:this.findDataParent(e):t.panel}calcDynaClass(t){if(this.model.dynaClass){const e=ze(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=ze(this.model.labelDynaClass,t);e.length&&(this.state.class.labelDyna=e)}}onClick(){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:"onClick"})}}),t("PickupViewPanelController",class extends hn{async onCreated(){await super.onCreated(),this.mountCounter.enroll(this.model.embeddedAppDEViewId),this.initNavParam()}initNavParam(){const{navigateContexts:t,navigateParams:e}=this.model,a=this.context.clone(),s={...this.params};t&&Object.assign(a,Me(t,this.params,this.context)),e&&Object.assign(s,Me(e,this.params,this.context)),this.state.context=a,this.state.params=s}setEmbedView(t){this.embedView=t,this.embedView.state.isMounted?this.mountCounter.attend(this.model.embeddedAppDEViewId):this.embedView.evt.on("onMounted",(()=>{this.mountCounter.attend(this.model.embeddedAppDEViewId)})),this.embedView.evt.on("onSelectionChange",(t=>{this.evt.emit("onSelectionChange",t)})),this.embedView.evt.on("onDataActive",(t=>{this.evt.emit("onDataActive",{data:t.data})}))}async getSelectedData(){return await this.embedView.call("GetData")}async getAllData(){return await this.embedView.call("GetAllData")}}),t("SearchBarController",class extends hn{constructor(){super(...arguments),this.placeHolder=""}initState(){super.initState(),this.state.query="",this.state.selectedGroupItem=null,this.state.visible=!!(this.model.enableQuickSearch||this.model.enableGroup||this.model.enableFilter)}async onCreated(){var t;await super.onCreated();const e=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);if(e){const a=null==(t=e.appDEFields)?void 0:t.filter((t=>t.enableQuickSearch)),s=[];null==a||a.forEach((t=>{(null==t?void 0:t.lnlanguageRes)&&t.lnlanguageRes.lanResTag?s.push(ibiz.i18n.t(t.lnlanguageRes.lanResTag,t.logicName)):(null==t?void 0:t.logicName)&&s.push(t.logicName)})),s.length>0&&(this.placeHolder=s.join("、"))}}handleInput(t){this.state.query=t}handleSearch(){this.evt.emit("onSearch",void 0)}}),t("TabExpPanelController",class extends hn{constructor(){super(...arguments),this.isShowCaption=!0,this.isShowIcon=!1}get isCache(){return"CACHE"===this.controlParams.expcache||"NO_CACHE"!==this.controlParams.expcache&&ibiz.config.view.expCacheMode.includes(this.model.controlType)}initState(){super.initState(),this.state.tabPages=[],this.state.activeName=""}async onCreated(){await super.onCreated(),this.layoutPanel=this.view.layoutPanel,this.initTabPages(),this.initIconCaption()}initTabPages(){const t=this.model.controls,e=[];t.forEach((t=>{e.push({caption:t.caption,tabTag:t.id,class:t.sysCss?[t.sysCss.cssName]:[],sysImage:t.sysImage})})),this.state.tabPages=e,e.length>0&&this.initDefaultPage()}initIconCaption(){if(this.params.showmode)switch(this.params.showmode){case"ICONANDSHORTWORD":this.isShowIcon=!0,this.isShowCaption=!0;break;case"ICON":this.isShowIcon=!0,this.isShowCaption=!1;break;case"SHORTWORD":this.isShowIcon=!1,this.isShowCaption=!0}}initDefaultPage(){const t=()=>{this.state.activeName=this.state.tabPages[0].tabTag,this.handleTabChange()};if(this.state.defaultTabName){const e=this.state.tabPages.find((t=>t.tabTag===this.state.defaultTabName));e?(this.state.activeName=e.tabTag,this.changeToTab()):t()}else t()}changeToTab(t=this.activeTabViewPanelModel){const e=this.getNavViewMsg(t);this.evt.emit("onNavViewChange",{navViewMsg:e})}get activeTabViewPanelModel(){const{activeName:t}=this.state;return this.model.controls.find((e=>e.id===t))}async handleTabChange(){this.activeTabViewPanelModel&&this.changeToTab()}prepareParams(t){const{navDER:e,navFilter:a,navigateContexts:s,navigateParams:i,appDataEntityId:n}=t,r={deName:He(n),navFilter:a,pickupDEFName:null==e?void 0:e.pickupDEFName,navContexts:s,navParams:i},o={context:this.context,params:this.params,data:{}},{resultContext:c,resultParams:l}=Fe(r,o);return{context:Object.assign(this.context.clone(),c,{currentSrfNav:this.state.activeName}),params:{...this.params,...l}}}getNavViewMsg(t){const{context:e,params:a}=this.prepareParams(t);return{key:t.codeName.toLowerCase(),context:e,params:a,viewId:t.embeddedAppDEViewId,isCache:this.isCache}}}),t("TreeService",class extends yi{async fetchChildNodes(t,e){const{hasQuery:a}=e;let s=[];if(t){const i=ta(this.model,{parentId:null==t?void 0:t.nodeId,hasQuery:a});if(0===i.length)return;(await Ma(i.map((async a=>{const s=Ze(this.model,a.childDETreeNodeId);return this.fetchNodeDatasByType(s,a,t,e)})),!1)).forEach((t=>{s.push(...t)}))}else{const t=Qe(this.model);s=await this.fetchNodeDatasByType(t,void 0,void 0,e)}return s}async fetchNodeDatasByType(t,e,a,i){const n=0===ta(this.model,{parentId:t.id,hasQuery:i.hasQuery}).length,r={...i,leaf:n};let o=[];switch(t.treeNodeType){case"STATIC":o=[await this.getStaticNodeData(t,e,a,r)];break;case"DE":o=await this.getDENodeDatas(t,e,a,r);break;case"CODELIST":o=await this.getCodeListNodeDatas(t,e,a,r);break;default:throw new s(t,"".concat(t.treeNodeType,"节点类型未支持"))}const{expandFirstOnly:c,expanded:l,rootNode:h}=t,d=h&&!this.model.rootVisible;return n||await Promise.all(o.map((async(t,e)=>{var a;if(l&&(!c||c&&0===e)||(null==(a=i.defaultExpandedKeys)?void 0:a.length)&&i.defaultExpandedKeys.includes(t.id)||d){const e=await this.fetchChildNodes(t,i);t.children=e}}))),o}async getStaticNodeData(t,e,a,s){return new Si(t,a,{parentValueLevel:null==e?void 0:e.parentValueLevel,leaf:!!s.leaf})}getNodeRSFilterParams(t,e,a){const{parentValueLevel:s,navigateContexts:i,navigateParams:n,parentFilter:r,parentDER1N:o}=t,c=null==o?void 0:o.pickupDEFName,l={...a.params},h={...a.context,...(null==e?void 0:e.context)||{}};let d,u,p,m={};if(e){d=e;for(let t=1;t<s;t++)d=null==d?void 0:d.parent}if(d){m=d.deData||{};const t=Ze(this.model,d.nodeId);t.appDataEntityId&&(p=He(t.appDataEntityId)),u=d.value}const{resultContext:f,resultParams:g}=Fe({deName:p,navFilter:r?"n_".concat(r,"_eq"):void 0,pickupDEFName:c,navParams:n,navContexts:i},{derValue:u,context:h,params:l,data:m});return Object.assign(h,f),Object.assign(l,g),{context:h,params:l,navContext:f,navParams:g}}async getDENodeDatas(t,e,a,s){const{appDEDataSetId:i,appDataEntityId:n}=t,{context:r,params:o,navContext:c,navParams:l}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}};o.size=t.maxSize||1e3,t.sortAppDEFieldId&&Object.assign(o,{sort:"".concat(t.sortAppDEFieldId.toLowerCase(),",").concat(t.sortDir?t.sortDir.toLowerCase():"asc")});const h=await this.app.deService.exec(n,i,r,o);if(h.data.length){return h.data.map((e=>new Pi(t,a,{data:e,leaf:!!s.leaf,navContext:c,navParams:l})))}return[]}async getCodeListNodeDatas(t,e,a,s){const{context:i,params:n,navContext:r,navParams:o}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}},c=await this.app.codeList.get(t.codeListId,i,n);if(c.length){return c.map((e=>new bi(t,a,{data:e,leaf:!!s.leaf,navContext:r,navParams:o})))}return[]}})),$r=(t("TreeController",class extends dn{constructor(){super(...arguments),this.contextMenus={}}initState(){super.initState(),this.state.defaultExpandedKeys=[],this.state.expandedKeys=[],this.state.size=0}async onCreated(){await super.onCreated(),this.state.expandedKeys=[...this.state.defaultExpandedKeys],this.service=new Yr(this.model),await this.service.init(this.context),this.model.detreeNodes.forEach((t=>{var e,a;(null==(a=null==(e=t.decontextMenu)?void 0:e.detoolbarItems)?void 0:a.length)&&(this.contextMenus[t.decontextMenu.id]=new lr(t.decontextMenu,this.context,this.params,this.ctx))})),await Promise.all(Object.values(this.contextMenus).map((t=>t.created())))}async load(t={}){const e=!0===t.isInitialLoad;let a;e&&await this.startLoading();try{a=await this.loadNodes()}finally{e&&await this.endLoading()}return await this.afterLoad(t,a),this.state.isLoaded=!0,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),a}async loadNodes(t){const e=await this.getFetchParams(),a=!!e.query;let s;this.state.isLoading=!0;try{s=await this.service.fetchChildNodes(t,{context:this.context.clone(),params:e,hasQuery:a,defaultExpandedKeys:this.state.expandedKeys})||[]}finally{this.state.isLoading=!1}return t?t.children=s:this.state.rootNodes=s,this.state.items=[],f({children:this.state.rootNodes},(t=>{this.state.items.push(t)})),this.state.expandedKeys=this.calcExpandedKeys(s),s}async onTreeNodeClick(t){if(this.state.singleSelect){const{selectedData:e}=this.state,a=e.filter((e=>e.id!==t.id));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a)}1===this.state.mdctrlActiveMode&&await this.setActive(t)}onExpandChange(t,e){const a=this.state.expandedKeys.includes(t.id);if(e&&!a)this.state.expandedKeys.push(t.id);else if(!e&&a){const e=this.state.expandedKeys.indexOf(t.id);-1!==e&&this.state.expandedKeys.splice(e,1)}}async onDbTreeNodeClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}setActive(t){const e=this.parseTreeNodeData(t);return this.evt.emit("onActive",{...e,nodeData:t})}setSelection(t){const e=t.map((t=>t.id)),a=this.state.items.filter((t=>e.includes(t.id)));super.setSelection(a)}getNodeModel(t){var e;return null==(e=this.model.detreeNodes)?void 0:e.find((e=>e.id===t))}async doUIAction(t,e,a){const s=this.getEventArgs(),i=this.parseTreeNodeData(e),n=await er.exec(t,{...s,...i,event:a});if(n.closeView)this.view.closeView();else if(n.refresh)switch(n.refreshMode){case 1:this.refreshNodeChildren(e);break;case 2:this.refreshNodeChildren(e,!0);break;case 3:this.refresh()}}parseTreeNodeData(t){return{data:[{...t,...t.deData||{}}],context:Object.assign(this.context.clone(),t.context||{}),params:{...this.params,...t.params||{}}}}calcExpandedKeys(t){let e=[...this.state.expandedKeys];return f({children:t},(t=>{var a;(null==(a=t.children)?void 0:a.length)&&e.push(t.id)})),e=Array.from(new Set(e)),e}async refreshNodeChildren(t,e=!1){const a=t.srfkey?"srfkey":"id",s=this.state.items.find((e=>e[a]===t[a]));if(!s)return void ibiz.log.error("找不到对应的树节点数据",t);if(e){const{parent:t}=s;if(!t||!this.model.rootVisible&&this.state.rootNodes.includes(t))return void this.refresh()}const i=e?s.parent:s,n=await this.loadNodes(i);this.evt.emit("onAfterRefreshParent",{parentNode:i,children:n})}}),t("WizardPanelService",class extends vi{async initialize(t,e={},a={}){var s;const i=null==(s=this.model.initControlAction)?void 0:s.appDEMethodId;let n=await this.exec(i,t,e,a);return n=this.handleResponse(n),n}async finish(t,e={},a={}){var s;const i=null==(s=this.model.finishControlAction)?void 0:s.appDEMethodId;let n=await this.exec(i,t,e,a);return n=this.handleResponse(n),n}})),qr=(t("WizardPanelController",class extends hn{constructor(){super(...arguments),this.tagHistory=[],this.providers={},this.firstForm=void 0,this.formControllers=new Map,this.steps=[],this.stepTags={}}initState(){super.initState()}async onCreated(){var t,e;await super.onCreated(),this.model.dewizard.dewizardForms.forEach((t=>{var e,a,s;t.firstForm&&(this.firstForm=t);const i="".concat(this.model.name,"_form_").concat(null==(e=t.formTag)?void 0:e.toLowerCase()),n=null==(s=null==(a=this.model.dewizard)?void 0:a.dewizardSteps)?void 0:s.find((e=>e.id===t.dewizardStepId)),r=null==n?void 0:n.stepTag;this.stepTags[i]=r})),null==(e=null==(t=this.model.dewizard)?void 0:t.dewizardSteps)||e.forEach((t=>{this.steps.push(t.stepTag)})),this.service=new $r(this.model),await this.service.init(this.context);const{deeditForms:a}=this.model;a&&a.length>0&&await Promise.all(a.map((async t=>{const{formTag:e}=t.dewizardForm;if(e){const a=await Ka(t);a&&(this.providers[e]=a)}})))}get activeWizardForm(){const{activeFormTag:t}=this.state,e=this.model.dewizard.dewizardForms.find((e=>e.formTag===t));return e||ibiz.log.debug("找不到".concat(t,"的向导表单")),e}get activeFormController(){const{activeFormTag:t}=this.state,a=this.formControllers.get(t);if(!a)throw new e("找不到".concat(t,"的表单控制器"));return a}onFormMounted(t,e){const a=e.ctrl;this.formControllers.set(t,a),a.load()}onFormSaved(t){const e=t.data[0],a=He(this.model.appDataEntityId);!this.context[a]&&e&&e.srfkey&&(this.context[a]=e.srfkey)}async initialize(){var t;if(null==(t=this.model.initControlAction)?void 0:t.appDEMethodId){const t=await this.service.initialize(this.context,this.params),e=He(this.model.appDataEntityId);t.data&&t.data.srfkey&&(this.context[e]=t.data.srfkey)}this.firstForm&&(this.state.activeFormTag=this.firstForm.formTag,this.tagHistory.push(this.firstForm.formTag))}async finish(){await this.service.finish(this.context,this.params),this.evt.emit("onFinishSuccess",void 0)}async onPrevClick(){await this.activeFormController.goBack(),this.tagHistory.pop();const t=this.tagHistory[this.tagHistory.length-1];if(!t)throw new e("没有上一个表单");this.state.activeFormTag=t}async onNextClick(){const t=await this.activeFormController.save();let a;if(t.srfnextform){if(!this.model.dewizard.dewizardForms.find((e=>e.formTag===t.srfnextform)))throw new e("找不到标识为".concat(t.srfnextform,"的向导表单"));a=t.srfnextform}else{const{formTag:t}=this.activeWizardForm,s=this.model.dewizard.dewizardSteps;if(s&&t){const i=s.findIndex((e=>e.stepTag===t)),n=s[i+1];if(!n)throw new e("找不到下一个向导步骤");const r=this.model.dewizard.dewizardForms.find((t=>t.formTag===n.stepTag));r&&(a=r.formTag)}}if(!a)throw new e("找不到下一个向导表单");this.state.activeFormTag=a,this.tagHistory.push(a)}async onFinishClick(){await this.activeFormController.save(),await this.finish()}}),t("MDCtrlService",class extends yi{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new xi(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new xi(e,e);this.dataUIMap.set(e,s)}))}})),Jr=t("MobMDCtrlRowState",class{constructor(t,e){this.data=t,this.controller=e,this.uaColStates={},this.data=t}}),Qr=(t("MDCtrlController",class extends dn{initState(){super.initState(),this.state.rows=[],this.state.noSort=!0===this.model.noSort,this.state.mdctrlActiveMode=1}async onCreated(){await super.onCreated(),this.service=new qr(this.model),await this.service.init(this.context),this.setSort()}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;this.state.sortQuery=t&&e?"".concat(t.toLowerCase(),",").concat(e.toLowerCase()):""}}async loadMore(){this.state.total>this.state.items.length&&!this.state.isLoading&&await this.load({isLoadMore:!0})}async refresh(){await this.load({isInitialLoad:!0})}afterLoad(t,e){return t.isInitialLoad&&(this.state.rows=[]),e&&e.length>0&&this.state.rows.push(...e.map((t=>{const e=new Jr(t,this);return this.initActionStates(e),e}))),super.afterLoad(t,e)}setData(t){const e=t.map((t=>new Jr(t,this)));this.state.rows=e}getAllData(){return this.state.rows.map((t=>t.data))}async onActionClick(t,e,a){const s=t.uiactionId;await er.execAndResolved(s,{context:this.context,params:this.params,data:[e.data],view:this.view,event:a})}initActionStates(t){const{deuiactionGroup:e,deuiactionGroup2:a}=this.model;e&&this.initUIActionGroup(t,e),a&&this.initUIActionGroup(t,a)}initUIActionGroup(t,e){var a;(null==(a=e.uiactionGroupDetails)?void 0:a.length)||ibiz.log.debug("操作列界面行为组没有配置界面行为");const s=new qi;(e.uiactionGroupDetails||[]).forEach((t=>{const e=t.uiactionId;if(e){const a=new $i(t.id,this.context.srfappid,e);s.addState(t.id,a)}})),s.update(t.data.getOrigin()),t.uaColStates[e.id]=s}}),t("KanbanService",class extends ur{async updateGroup(t,e){var a;const s=(null==(a=this.model.updateGroupControlAction)?void 0:a.appDEMethodId)||"update";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}})),Zr=(t("KanbanController",class extends pr{get enableEditOrder(){return!0===this.model.enableCardEditOrder}get enableEditGroup(){return!0===this.model.enableCardEditGroup}async initControlService(){this.service=new Qr(this.model),await this.service.init(this.context)}initState(){super.initState(),this.state.size=this.model.pagingSize||1e3,this.state.updating=!1,this.state.draggable=this.enableEditOrder||this.enableEditGroup}async onCreated(){await super.onCreated()}sortItems(t){const s=this.model.minorSortAppDEFieldId,{minorSortDir:i}=this.model;if(!s)throw new a(this.model,"排序属性没配置");if(!i)throw new a(this.model,"排序方向没配置");const n="ASC"===i;t.forEach((t=>{const a=t[s];if(q(a))t[s]=0;else{const s=Number(a);if(Number.isNaN(s))throw new e("".concat(t.srfmajortext,"的排序属性无法转换成数值"))}})),t.sort(((t,e)=>n?t[s]-e[s]:e[s]-t[s]))}async afterLoad(t,e){return this.sortItems(this.state.items),super.afterLoad(t,e)}handleDataGroup(){if(!this.model.enableGroup||"NONE"===this.model.groupMode)throw new e("看板部件必须开启分组");return super.handleDataGroup()}async onDragChange(t){if(!this.enableEditGroup&&t.from!==t.to)return void ibiz.message.warning("当前看板不允许调整分组!");const e="ASC"===this.model.minorSortDir,{from:a,to:s,fromIndex:i,toIndex:n}=t,r=this.model.groupAppDEFieldId,o=this.model.minorSortAppDEFieldId,c=[],l=this.state.groups.find((t=>t.key===a)),h=this.state.groups.find((t=>t.key===s));if(!this.enableEditOrder){if(t.from===t.to)return void ibiz.message.warning("当前看板不允许调整次序");const e=l.children[i];return e[r]=t.to,this.updateChangedItems([e])}const d=t=>t+(100-t%100),u=[...h.children],p=[...h.children],m=l.children[i];t.from!==t.to?(m[r]=t.to,p.splice(n,0,m)):(p.splice(i,1),p.splice(n,0,m));const f=l.children.splice(i,1);let g;h.children.splice(n,0,...f),e||(u.reverse(),p.reverse());let w,E=[];p.forEach(((t,e)=>{void 0===g?t!==u[e]&&(g=u[e]?u[e][o]||100:0===e?100:d(u[e-1][o]),t[o]=g,c.push(t)):(g>=t[o]?(E.length>0&&(E.forEach((t=>{t[o]=d(w),c.push(t),w=t[o]})),g=w,w=0,E=[]),t[o]=d(g),c.push(t)):(0===E.length&&(w=g),E.push(t)),g=t[o])})),this.updateChangedItems(c)}async updateChangedItems(t){try{this.state.updating=!0,await Promise.all(t.map((async t=>{const e=He(this.model.appDataEntityId),a=this.context.clone();a[e]=t.srfkey;const s=await this.service.updateGroup(a,t);if(s.data){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(e,1,s.data)}})))}finally{this.state.updating=!1,await this.afterLoad({},this.state.items)}}}),t("TreeGridExService",class extends Yr{constructor(){super(...arguments),this.multipleUiMap=new Map}initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.detreeNodes)||t.forEach((t=>{var e;const a=new Map;null==(e=t.detreeNodeDataItems)||e.forEach((t=>{const e=t.id.toLowerCase(),s=t.appDEFieldId.toLowerCase(),i=new xi(e,s,{isOriginField:!0,dataType:t.dataType});a.set(e,i)})),this.multipleUiMap.set(t.id,a)}))}async getDENodeDatas(t,e,a,s){const{appDEDataSetId:i,appDataEntityId:n}=t,{context:r,params:o,navContext:c,navParams:l}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}};o.size=t.maxSize||1e3,t.sortAppDEFieldId&&t.sortDir&&Object.assign(o,{sort:"".concat(t.sortAppDEFieldId.toLowerCase(),",").concat(t.sortDir.toLowerCase())});const h=await this.app.deService.exec(n,i,r,o);if(h.data.length){const{data:e}=this.handleResponseForMultiple(h,t.id);return e.map((e=>new Pi(t,a,{data:e,leaf:!!s.leaf,navContext:c,navParams:l})))}return[]}handleResponseForMultiple(t,e){const a=super.handleResponse(t);return a.headers&&(a.headers["x-page"]&&(a.page=Number(a.headers["x-page"])),a.headers["x-per-page"]&&(a.size=Number(a.headers["x-per-page"])),a.headers["x-total"]&&(a.total=Number(a.headers["x-total"]))),a.ok&&(j(a.data)?a.data=a.data.map((t=>this.toUIDataForMultiple(t,e))):a.data=this.toUIDataForMultiple(a.data,e)),a}toUIDataForMultiple(t,e){const a=this.multipleUiMap.get(e);return new Ei(t,a)}})),to=(t("TreeGridExController",class extends dn{constructor(){super(...arguments),this.providers={},this.columns={},this.fieldColumns={},this.uaColumns={}}initState(){super.initState(),this.state.size=0,this.state.columnStates=[],this.state.defaultExpandedKeys=[]}async onCreated(){await super.onCreated(),this.service=new Zr(this.model),await this.service.init(this.context),this.initColumnStates(),await this.initGridColumns()}async initGridColumns(){this.model.detreeColumns&&await Promise.all(this.model.detreeColumns.map((async t=>this.initColumnsController(t))))}async initColumnsController(t){const e=await es(t);if(!e)return;this.providers[t.codeName]=e;const a=await e.createController(t,this);this.columns[t.codeName]=a,"DEFGRIDCOLUMN"===t.columnType?this.fieldColumns[t.codeName]=a:"UAGRIDCOLUMN"===t.columnType&&(this.uaColumns[t.codeName]=a)}initColumnStates(){f(this.model,(t=>{"GROUPGRIDCOLUMN"!==t.columnType&&this.state.columnStates.push({key:t.codeName,caption:t.caption,hidden:!!t.hideDefault,uaColumn:"UAGRIDCOLUMN"===t.columnType})}),{childrenFields:["detreeColumns"]}),this.calcColumnFixed()}calcColumnFixed(){const t=this.state.columnStates.filter((t=>!t.hidden)),e=t.length;t.forEach(((t,a)=>{t.uaColumn?t.fixed=a+1<=Math.floor(e/2)?"left":"right":t.fixed="right"}))}async load(t={}){const e=!0===t.isInitialLoad,a=await this.loadNodes();return this.state.expandedKeys=this.calcExpandedKeys(a),await this.afterLoad(t,a),this.state.isLoaded=!0,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),a}async loadNodes(t){const e=await this.getFetchParams(),a=!!e.query,s=t?void 0:this.state.defaultExpandedKeys;let i;await this.startLoading();try{i=await this.service.fetchChildNodes(t,{context:this.context.clone(),params:e,hasQuery:a,defaultExpandedKeys:s})||[]}finally{await this.endLoading()}return t?t.children=i:this.state.rootNodes=i,this.state.items=[],f({children:this.state.rootNodes},(t=>{this.state.items.push(t)})),i}calcExpandedKeys(t){let e=[];return f({children:t},(t=>{var a;(null==(a=t.children)?void 0:a.length)&&e.push(t.id)})),this.state.defaultExpandedKeys.length&&(e.push(...this.state.defaultExpandedKeys),e=Array.from(new Set(e))),e}}),t("TreeGridController",class extends jr{}),t("TreeGridService",class extends zr{}),t("HubController",class{constructor(){this.session={}}login(t,e){return ibiz.auth.login(t,e)}logout(){return ibiz.auth.logout()}})),eo=class{constructor(){this.convert=new Fi,this.controller=new to,this.appMap=new Map,this.apps=new Map,this.view2appMap=new Map,this.views=new Map,this.dataEntities=new Map,this.config=new Bi,this.defaultAppIndexViewName="Index"}calcAppViewId(t){let e="";if(-1!==t.indexOf(".")){const a=t.split(".");e=a[a.length-1]}else e=t.toLowerCase();return e}registerModelLoaderProvider(t){this.modelLoaderProvider=t}registerApp(t){this.apps.set(t.codeName,t)}registerAppView(t){this.views.set(t.codeName,t)}registerAppDataEntity(t,e=ibiz.env.appId){this.dataEntities.has(e)||this.dataEntities.set(e,new Map);this.dataEntities.get(e).set(t.id,t)}setAppView(t,e=ibiz.env.appId){const a=this.calcAppViewId(t);this.view2appMap.set(a,e)}hasAppView(t){const e=this.calcAppViewId(t);return this.view2appMap.has(e)}async getAppStyle(t){return this.modelLoaderProvider?this.modelLoaderProvider.getAppStyle(t):null}async getAppView(t){const a=this.calcAppViewId(t),s=this.view2appMap.get(a)||ibiz.env.appId;if(this.appMap.has(s)||await this.createApp(s),this.views.has(a))return this.views.get(a);if(this.modelLoaderProvider){const t=await this.modelLoaderProvider.getAppView(s,a);return this.registerAppView(t),t}throw new e("视图[".concat(a,"]不存在"))}async getAppDataEntity(t,a=ibiz.env.appId){if(this.dataEntities.has(a)){const e=this.dataEntities.get(a);if(e.has(t))return e.get(t)}if(this.modelLoaderProvider){let e;return e=-1!==t.indexOf(".")?await this.modelLoaderProvider.getAppDataEntity(a,t):await this.modelLoaderProvider.getAppDataEntityByCodeName(a,t),this.registerAppDataEntity(e,a),e}throw new e("未找到应用实体[".concat(t,"]"))}async createApp(t){if(this.appMap.has(t))return this.appMap.get(t);let a;if(this.apps.has(t))a=this.apps.get(t);else{if(!this.modelLoaderProvider)throw new e("未找到应用[".concat(t,"]模型"));a=await this.modelLoaderProvider.getApp(t),this.registerApp(a)}const s=new Vi(a);return this.appMap.set(t,s),await s.init(),this.configCache||(this.configCache=new Ls(ibiz.env.appId,"PSSysHub","Global")),s}async getAppAsync(t=ibiz.env.appId){return this.createApp(t)}getApp(t){let e=null;return e=t?t instanceof Object?t.id:t:ibiz.env.appId,this.appMap.get(e)}},ao=t("EngineFactory",class{constructor(){this.viewEngines=new Map}register(t,e){this.viewEngines.set(t,e)}unRegister(t){this.viewEngines.delete(t)}getEngine(t,...e){const{engineType:a,engineCat:s}=t,i="".concat(s,"_").concat(a),n=this.viewEngines.get(i);if(n)return n(...e);ibiz.log.error("没有".concat(i,"对应的引擎"),t)}}),so=t("ViewEngineBase",class{constructor(t){this.view=t,this.initViewState()}get toolbar(){return this.view.getController("toolbar")}get leftToolbar(){return this.view.getController("lefttoolbar")}get rightToolbar(){return this.view.getController("righttoolbar")}get footerToolbar(){return this.view.getController("footertoolbar")}get viewLayoutPanel(){return this.view.layoutPanel}async onCreated(){const{childNames:t}=this.view;t.push("captionbar","toolbar")}async onMounted(){var t,e;const{model:a,childNames:s}=this.view;ibiz.log.debug("".concat(a.id,"的子组件:").concat(s.join(";"),"都已mounted"));if(!this.calcViewHeaderVisible()){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_header;e&&(e.state.visible=!1)}if(ibiz.env.isMob){if(!this.calcViewFooterVisible()){const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.view_footer;t&&(t.state.visible=!1)}}}async onDestroyed(){}async call(t,e){if("GetData"===t)return this.getData()}initViewState(){}getData(){return[]}calcViewHeaderVisible(){var t,e,a,s;let i=!1;const{model:n}=this.view;if(!1===n.showCaptionBar){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_captionbar;e&&(e.state.visible=!1)}else i=!0;if(ibiz.env.isMob){if(this.leftToolbar)i=!0;else{const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.lefttoolbar;t&&(t.state.visible=!1)}if(this.rightToolbar)i=!0;else{const t=null==(a=this.viewLayoutPanel)?void 0:a.panelItems.righttoolbar;t&&(t.state.visible=!1)}}else if(this.toolbar)i=!0;else{const t=null==(s=this.viewLayoutPanel)?void 0:s.panelItems.view_toolbar;t&&(t.state.visible=!1)}return i}calcViewFooterVisible(){let t=!1;return this.footerToolbar&&(t=!0),t}async loadEntityData(){const{appDataEntityId:t}=this.view.model,{evt:a,context:s,params:i}=this.view;if(!t)throw new e("该视图没有实体,无法加载实体数据");const n=ibiz.hub.getApp(s.srfappid),r=await n.deService.exec(t,"get",s,i),{data:o}=r;o&&(this.view.state.srfactiveviewdata=o,a.emit("onDataChange",{actionType:"LOAD",data:[o]}),o.srfkey&&a.emit("onViewInfoChange",{dataInfo:o.srfmajortext||""}))}}),io=(t("MDViewEngine",class extends so{get xdataControlName(){return this.view.model.xdataControlName}get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get xdataControl(){return this.view.getController(this.xdataControlName)}async onCreated(){await super.onCreated();const{childNames:t}=this.view;t.push(this.xdataControlName,"searchform","searchbar"),this.xdataControlName&&(this.view.slotProps[this.xdataControlName]||(this.view.slotProps[this.xdataControlName]={}),this.view.slotProps[this.xdataControlName].loadDefault=!1)}async onMounted(){await super.onMounted();const{model:t}=this.view;this.xdataControl.evt.on("onActive",this.onXDataActive.bind(this)),this.xdataControl.evt.on("onSelectionChange",(async t=>{var e;null==(e=this.toolbar)||e.calcButtonState(t.data[0],this.xdataControl.model.appDataEntityId)})),this.xdataControl.evt.on("onBeforeLoad",(()=>{this.xdataControl.state.searchParams=this.getSearchParams()})),this.xdataControl.evt.on("onLoadSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"LOAD"})})),this.xdataControl.evt.on("onRemoveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"REMOVE"})})),this.xdataControl.evt.on("onSaveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"SAVE"})}));const e=this.viewLayoutPanel.panelItems.view_searchform;if(e){const a=!!this.searchForm;e.state.keepAlive=a,e.state.visible=a&&!!t.expandSearchForm}this.searchForm&&this.searchForm.evt.on("onSearch",(()=>{this.reLoad()})),this.searchBar&&this.searchBar.evt.on("onSearch",(()=>{this.reLoad()})),!this.view.state.noLoadDefault&&t.loadDefault&&this.load()}async onXDataActive(t){await this.openData(t)}async call(t,e){return"ToggleFilter"===t?(this.toggleFilter(),null):"Edit"===t||"View"===t?(await this.openData(e),null):"New"===t?(await this.newData(e),null):"Remove"===t?(await this.remove(e),null):"Import"===t?(await this.importData(),null):"Refresh"===t?(await this.refresh(),null):"ExportExcel"===t?(await this.exportData(e),null):"Copy"===t?(this.copy(e),null):"Load"===t?(this.load(e),null):super.call(t,e)}getData(){return this.xdataControl.getData()}async openData(t){var e,a;const{data:s,event:i}=t,n=(t.context||this.view.context).clone(),r=t.params||this.view.params;n[((null==(e=s[0].srfdecodename)?void 0:e.toLowerCase())||He(this.xdataControl.model.appDataEntityId)).toLowerCase()]=s[0].srfkey;const o=await(null==(a=this.view.scheduler)?void 0:a.triggerCustom("opendata",{context:n,params:r,data:s,event:i,view:this.view}));o instanceof Object&&o.ok?this.refresh():-1===o&&ibiz.log.warn("视图[".concat(this.view.model.codeName,"],未配置编辑打开视图"))}async newData(t){var e,s,i;const{data:n,event:r,copyMode:o}=t;if(!(null==(s=null==(e=this.view.model.viewLayoutPanel)?void 0:e.appViewLogics)?void 0:s.find((t=>"newdata"===t.id))))throw new a(this.view.model,"缺少newdata的视图逻辑");const c=Z(this.view.params);o&&(c.srfcopymode=o);const l=await(null==(i=this.view.scheduler)?void 0:i.triggerCustom("newdata",{context:this.view.context,params:c,data:n,event:r,view:this.view}));if(l instanceof Object&&l.ok)this.refresh();else if(-1===l)throw new a(this.view.model,"缺少newdata的视图逻辑")}async remove(t){await this.xdataControl.remove(t)}async load(t={}){await this.xdataControl.load({isInitialLoad:!0,...t})}async refresh(){await this.xdataControl.refresh()}async reLoad(){await this.xdataControl.load({isInitialLoad:!0})}getSearchParams(){var t;const e={};if(this.searchForm){const t=this.searchForm.getData()[0],a=Object.entries(t).reduce(((t,[e,a])=>(null!=a&&""!==a&&(t[e]=a),t)),{});Object.assign(e,a)}if(this.searchBar){if(this.searchBar.state.query){const t={query:this.searchBar.state.query};Object.assign(e,t)}if(null==(t=this.searchBar.state.selectedGroupItem)?void 0:t.data){const t=new Function("return (".concat(this.searchBar.state.selectedGroupItem.data,");"))();Object.assign(e,t)}}return e}async importData(){await this.xdataControl.importData()}async exportData(t){await this.xdataControl.exportData(t)}async copy(t){this.newData(Object.assign(t,{copyMode:!0}))}calcViewHeaderVisible(){let t=super.calcViewHeaderVisible();if(this.searchBar&&this.searchBar.state.visible)t=!0;else{const t=this.viewLayoutPanel.panelItems.view_searchbar;t&&(t.state.visible=!1)}return t}toggleFilter(){if(this.searchForm){const t=this.viewLayoutPanel.panelItems.view_searchform;t&&(t.state.visible=!t.state.visible)}}}),class{handle(t){return t instanceof a||t instanceof s?ibiz.message.error(t.message,10,!0):t instanceof o?401===t.status?ibiz.message.error("没有注册无权限错误处理器"):ibiz.notification.error({title:"",desc:t.message,duration:10}):t instanceof d?ibiz.message.error(t.message,t.duration,0===t.duration):t instanceof e&&ibiz.message.error(t.message,10,!0),ibiz.log.error(t),!0}}),no=class{constructor(){this.handlers=[]}register(t){this.handlers.unshift(t)}handleSingle(t){this.handlers.find((e=>!!e.handle(t)))||ibiz.log.error("没有找到能处理该错误的处理器",t)}handle(t){t instanceof Array?t.forEach((t=>{this.handleSingle(t)})):this.handleSingle(t)}},ro=class{constructor(){this.layoutPanel=new ya,this.text=new Na,this.hbs=new Ne,this.rawValue=new Oa,this.error=new no,this.error.register(new io)}showAppLoading(){const t=document.getElementById("app-loading-x");t&&(t.style.display="none")}hiddenAppLoading(){setTimeout((()=>{const t=document.getElementById("app-loading-x");t&&(t.style.display="none")}),300)}},oo=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.logicType}execute(t){throw new e("Method not implemented.")}destroy(){}},co=class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createExecutor(t,e){const a=this.constructorMap.get(t.logicType);if(!a)throw new s(t,"逻辑类型 ".concat(t.logicType," 暂未支持!"));return a(t,e)}},lo=class extends oo{constructor(){super(...arguments),this.initialized=!1}convertScriptArgs(t){return t}init(t,e,a){this.convertScriptArgs=e;const s=this.logic.scriptCode;this.scriptFn=fa.createScriptFn(t,s,a),this.initialized=!0}execute(t){const e=this.convertScriptArgs(t);return this.scriptFn.exec(e)}},ho=class extends oo{execute(t){const{appDEUILogicId:e,appDataEntityId:s}=this.logic;if(!e)throw new a(this.logic,"没有配置实体界面逻辑");tr(e,s,t)}},uo=class{constructor(t){this.triggers=new Map,this.executors=new Map,this.hasViewEventTrigger=!1,this.hasControlEventTrigger=!1,this.logics=t,t.forEach((t=>{try{const e=this.createExecutor(t);this.executors.set(t.id,e);const a=this.createTrigger(t);this.triggers.set(t.id,a),a.bindExecutor(e)}catch(t){ibiz.log.error(t.message)}}))}destroy(){this.triggers.forEach((t=>t.destroy())),this.executors.forEach((t=>t.destroy()))}getExecuteParams(t){let e={};return this.defaultParamsCb&&(e=this.defaultParamsCb()),at(t,e)}createTrigger(t){switch(t.triggerType){case"VIEWEVENT":this.hasViewEventTrigger=!0;break;case"CTRLEVENT":this.hasControlEventTrigger=!0}return ibiz.scheduler.triggerFactory.createTrigger(t,this)}createExecutor(t){return ibiz.scheduler.executorFactory.createExecutor(t,this)}getMatchTriggers(t){const e=[];return this.triggers.forEach((a=>{a.match(t)&&e.push(a)})),e}triggerAndExecute(t,e={}){const a=this.getMatchTriggers(t);if(a.length>0){const t=this.getExecuteParams(e);return a.map((e=>e.execute(t)))}}triggerItemDynaLogic(t,e,a){const s={itemName:t,triggerType:e},i=this.triggerAndExecute(s,a);if(null==i?void 0:i.length)return i.pop()}triggerItemVisible(t,e){return this.triggerItemDynaLogic(t,"ITEMVISIBLE",e)}triggerItemEnable(t,e){return this.triggerItemDynaLogic(t,"ITEMENABLE",e)}triggerItemBlank(t,e){return this.triggerItemDynaLogic(t,"ITEMBLANK",e)}startTimerTrigger(){this.getMatchTriggers({triggerType:"TIMER"}).forEach((t=>t.start()))}triggerCustom(t,e){const a=this.triggers.get(t);if(!a)return-1;const s=this.getExecuteParams(e);return a.execute(s)}triggerControlEvent(t,e,a){const s={ctrlName:t,eventName:e,triggerType:"CTRLEVENT"};this.triggerAndExecute(s,a)}},po=class extends uo{constructor(t){const e=t.filter((t=>"APPVIEWENGINE"!==t.triggerType));e.forEach((t=>{"CTRLEVENT"===t.triggerType&&(t.ctrlName=t.itemName)})),super(e)}},mo=class extends uo{constructor(t){t.forEach((t=>{t.triggerType=t.logicTrigger})),super(t)}triggerViewEvent(t){const e={eventName:t.eventName,triggerType:"VIEWEVENT"};this.triggerAndExecute(e,t)}},fo=class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createTrigger(t,e){const a=this.constructorMap.get(t.triggerType);if(!a)throw new s(t,"触发器类型 ".concat(t.triggerType," 暂未支持!"));return a(t,e)}},go=class{constructor(){this.executorFactory=new co,this.triggerFactory=new fo}createViewScheduler(t){return new mo(t)}createControlScheduler(t){return new po(t)}},wo=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.triggerType}bindExecutor(t){this.executor=t,"SCRIPT"===this.executor.type&&this.bindScriptExecutor(t)}bindScriptExecutor(t){t.initialized||t.init([],(t=>t),{isAsync:!0,singleRowReturn:!1})}match(t){return t.triggerType===this.type}execute(t){if(this.executor)return this.executor.execute(t);throw new e("".concat(this.logic.id,"没有绑定executor"))}destroy(){this.executor=void 0}},Eo=class extends wo{},vo=class extends wo{bindExecutor(t){if(super.bindExecutor(t),"SCRIPT"!==this.executor.type)throw new e("预定义逻辑类型".concat(this.type,"的触发器类型只能是脚本"))}bindScriptExecutor(t){t.init(["context","viewparams","data","env"],(t=>{const{context:e,params:a,data:s}=t;return{context:e,params:a,data:(null==s?void 0:s[0])||{},env:ibiz.env}}),{singleRowReturn:!0,isAsync:!1})}match(t){var e,a;return super.match(t)&&(null==(e=t.itemName)?void 0:e.toLowerCase())===(null==(a=this.logic.itemName)?void 0:a.toLowerCase())}execute(t){return!!this.executor.execute(t)}},yo=class extends wo{constructor(){super(...arguments),this.timer=null}start(){this.timer=setInterval((()=>{if(!this.scheduler.defaultParamsCb)throw new e("定时器缺少默认参数回调");const t=this.scheduler.defaultParamsCb();this.executor.execute(t)}),this.logic.timer)}destroy(){super.destroy(),this.timer&&clearInterval(this.timer)}},Io=class extends oo{execute(t){return"opendata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeOpenDataAppUILogic(this.logic.builtinAppUILogic,t):"newdata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeNewDataAppUILogic(this.logic.builtinAppUILogic,t):void 0}async executeOpenDataAppUILogic(t,s){const{context:i,params:n,...r}=s,{data:o}=s;if(!(null==o?void 0:o[0]))throw new e("opendata没有可操作数据!");let c;if(t.openDataAppViews)c=await this.calcOpenViewRef(t,s);else if(c=t.openDataAppView,!c)throw new a(t,"opendata视图逻辑没有配置默认打开视图");const l=c.refAppViewId;if(!l)throw new a(t,"opendata视图逻辑的默认打开视图没有实际引用视图");const h=c.navigateContexts||[],d=Object.assign(i,Me(h,o[0],n,i));let u={};const p=c.navigateParams;return F(p)&&(u=Me(p,o[0],n,i)),ibiz.commands.execute(Ni.TAG,l,d,u,r)}async calcOpenViewRef(t,s){const i=s.view.model.appDataEntityId,n=await Xe(i);if(!n)throw new a(t,"".concat(i,"实体缺少表单类型应用实体属性"));const{data:r}=s,o=r[0][n];if(!o)throw new a(t,"数据源无表单类型应用实体属性值");const c=t.openDataAppViews,l=null==c?void 0:c.find((t=>t.refMode===o));if(!l)throw new e("没有找到与表单类型".concat(o,"相关的实体的编辑视图"));return l}async executeNewDataAppUILogic(t,e){const{context:i,params:n,...r}=e,{data:o,view:c}=e,{enableWizardAdd:l,enableBatchAdd:h,batchAddOnly:d,newDataAppView:u}=t;let p;if(l){if(p=await this.getWizardNewViewRef(t,e),!p)return{ok:!1}}else if(h){const e=He(c.parentView.model.appDataEntityId),s=t.batchAddAppViews;if(p=null==s?void 0:s.find((t=>t.refMode.toLowerCase()!==e)),!p)throw new a(t,"没有找到批添加需要打开的选择视图")}else{if(d)throw new s(t,"batchAddOnly暂未支持");if(p=u,!p||!p.refAppViewId)throw new a(t,"newdata视图逻辑没有配置默认新建数据视图")}let m={},f={};const g=(null==o?void 0:o[0])||{},w=p.navigateContexts;F(w)&&(m=Me(w,g,n,i)),m=Object.assign(i,m);const E=p.navigateParams;if(F(E)&&(f=Me(E,g,n,i)),n.srfcopymode){const t=(await ibiz.hub.getAppDataEntity(c.model.appDataEntityId)).keyAppDEFieldId;t&&g&&(f[t]=g.srfkey,f.srfcopymode=!0)}f.srfuf=0;const v=await ibiz.commands.execute(Ni.TAG,p.refAppViewId,m,f,r);return h&&v.data&&await this.doBatchAdd(t,v.data,i,p),v}async getWizardNewViewRef(t,s){var i;const{wizardAppView:n,newDataAppViews:r}=t,{context:o,params:c,...l}=s;if(!n||!n.refAppViewId)throw new a(t,"缺少默认索引实体选择视图");const h=await ibiz.commands.execute(Ni.TAG,n.refAppViewId,o,c,{...l,openMode:"POPUPMODAL"});if(!h.ok)return;const d=null==(i=h.data)?void 0:i[0];if(!d)throw new e("请选中一条数据");const u=d.srfkey,p=null==r?void 0:r.find((t=>t.refMode===u));if(!p)throw new e("没有找到与索引类型".concat(u,"相关的实体的编辑视图"));return p}async doBatchAdd(t,e,s,i){var n;if(null==e?void 0:e.length){const r=await ibiz.hub.getAppDataEntity(t.appDataEntityId,s.srfappid),o=r.minorAppDERSs,c=i.refMode.toLowerCase();if(!o)throw new a(r,"实体没有从关系集合!");let l;null==o||o.forEach((t=>{const e=He(t.majorAppDataEntityId);c===e&&(l=t.parentAppDEFieldId)}));const h=null==(n=i.navigateParams)?void 0:n.find((t=>"keymapping"===t.key));let d=[];if(h){const t=h.value.split(";"),a={};for(const e of t){const[t,s]=e.split(":");t&&s&&(a[t]=s)}d=e.map((t=>{const e={[l]:t.srfkey};for(const s in a)if(Object.prototype.hasOwnProperty.call(a,s)){const i=a[s];Object.prototype.hasOwnProperty.call(t,s)&&(e[i]=t[s])}return e}))}else d=e.map((t=>({[l]:t.srfkey})));const u=ibiz.hub.getApp(s.srfappid).deService;await u.exec(r.id,"Create",s,d)}}},Do=class extends wo{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const a=t.eventNames.split(";");this.listenEventNames=a.map((t=>Sa[t]||t))}match(t){return super.match(t)&&this.listenEventNames.includes(t.eventName)}},Co=class extends wo{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const a=t.eventNames.split(";");this.listenEventNames=a.map((t=>_a[t]||t))}match(t){return super.match(t)&&t.ctrlName.toLowerCase()===this.logic.ctrlName.toLowerCase()&&this.listenEventNames.includes(t.eventName)}},Ao=class extends oo{execute(t){er.execAndResolved(this.logic.appDEUIActionId,t)}};var bo=vt(ce(),1);t("PluginStaticResource",class{constructor(t){this.styleElementMap=new Map,this.url=new URL(t);const e=bo.default.dirname(this.url.pathname);this.baseDir=e}dir(t){return bo.default.resolve(this.baseDir,t)}async loadStyle(t){const e=t.map((t=>{const e=this.dir(t);return!this.styleElementMap.has(e)&&(this.styleElementMap.set(e,null),new Promise(((t,a)=>{const s=document.createElement("link");s.setAttribute("type","text/css"),s.setAttribute("rel","stylesheet"),s.setAttribute("href",e),s.onload=t,s.onerror=a,document.head.appendChild(s)})))}));try{await Promise.all(e)}catch(t){ibiz.log.error(t)}}}),t("RemotePluginItem",class{constructor(t,e,a){this.tag=t,this.repo=e,this.config=a}})}}}));
|
|
1
|
+
System.register(["@ibiz-template/core","lodash-es","qx-util","qs","ramda","dayjs","dayjs/plugin/minMax","dayjs/plugin/isSameOrBefore","dayjs/plugin/quarterOfYear","dayjs/plugin/weekOfYear","dayjs/plugin/isoWeek","async-validator"],(function(t){"use strict";var e,a,s,i,n,r,o,c,l,h,d,u,p,m,f,g,w,E,v,y,I,D,C,A,b,P,S,x,_,T,L,N,O,M,R,V,k,F,W,B,U,j,z,G,H,K,X,Y,$,q,Q,J,Z,tt,et,at,st,it,nt,rt,ot,ct,lt,ht,dt,ut;return{setters:[function(t){e=t.RuntimeError,a=t.RuntimeModelError,s=t.ModelError,i=t.IBizContext,n=t.DataTypes,r=t.HttpResponse,o=t.HttpError,c=t.CoreConst,l=t.Net,h=t.NOOP,d=t.NoticeError,u=t.isElementSame,p=t.findRecursiveChild,m=t.StringUtil,f=t.recursiveIterate,g=t.debounceAndAsyncMerge,w=t.mergeDefaultInLeft,E=t.isOverlap,v=t.awaitTimeout,y=t.mergeInLeft,I=t.toNumberOrNil},function(t){D=t.isEmpty,C=t.isString,A=t.isArray,b=t.isObject,P=t.debounce,S=t.camelCase,x=t.eq,_=t.gt,T=t.gte,L=t.findIndex,N=t.lt,O=t.lte,M=t.upperFirst,R=t.snakeCase,V=t.kebabCase,k=t.isFunction},function(t){F=t.notNilEmpty,W=t.isNilOrEmpty,B=t.AsyncSeriesHook,U=t.QXEvent,j=t.createUUID,z=t.isArray,G=t.setCookie,H=t.clearCookie,K=t.clearAll,X=t.isNumber,Y=t.ascSort,$=t.descSort},function(t){q=t.default},function(t){Q=t.isNil,J=t.mergeRight,Z=t.isEmpty,tt=t.clone,et=t.equals,at=t.where,st=t.mergeLeft,it=t.isNotNil,nt=t.mergeDeepRight},function(t){rt=t.default},function(t){ot=t.default},function(t){ct=t.default},function(t){lt=t.default},function(t){ht=t.default},function(t){dt=t.default},function(t){ut=t.default}],execute:function(){t({calcContentAlignStyle:function(t){const{valignSelf:e,halignSelf:a}=t;let s;if(e||a){switch(s={display:"flex"},e){case"TOP":Object.assign(s,{"align-items":"flex-start"});break;case"MIDDLE":Object.assign(s,{"align-items":"center"});break;case"BOTTOM":Object.assign(s,{"align-items":"flex-end"})}switch(a){case"LEFT":Object.assign(s,{"justify-content":"flex-start"});break;case"CENTER":Object.assign(s,{"justify-content":"center"});break;case"RIGHT":Object.assign(s,{"justify-content":"flex-end"});break;case"JUSTIFY":Object.assign(s,{"justify-content":"space-between"})}}return s},calcDeCodeNameById:Ke,calcDynaClass:ze,calcGridLayoutPos:function(t){const{layout:e,colXS:a,colXSOffset:s,colSM:i,colSMOffset:n,colMD:r,colMDOffset:o,colLG:c,colLGOffset:l}=t,h=(t,a)=>({span:(t&&-1!==t?t:"TABLE_24COL"===e?24:12)*("TABLE_24COL"===e?1:2),offset:a&&-1!==a?a:void 0});return{xs:h(a,s),sm:h(i,n),md:h(r,o),lg:h(c,l)}},calcLayoutHeightWidth:je,calcMainStateOPPrivsStrs:He,calcNavParams:We,calcResPath:Ts,compare:ha,compareNumber:da,contains:ua,convertNavData:Re,convertNavDataByArray:ke,convertObjectToNavParams:Me,execDELogic:ui,execDELogicAction:mi,execDELogicById:pi,execFieldLogics:fi,execUILogic:sr,filterFieldLogics:qe,filterValueRules:Oa,findChildFormDetails:sa,findDELogic:$e,findEditItem:aa,findFieldById:Qe,findModelChild:Be,formatMultiData:Fe,generateEditorRules:nn,generateRules:sn,getAppCounterProvider:vs,getAppViewRef:function(t,e){var a,s;let i=t.appViewRefs||[];(null==(s=null==(a=t.viewLayoutPanel)?void 0:a.appViewRefs)?void 0:s.length)&&(i=i.concat(t.viewLayoutPanel.appViewRefs));return i.find((t=>t.name===e||t.id===e))},getChildNodeRSs:ea,getControl:function(t,e){var a,s;let i=t.controls||[];(null==(s=null==(a=t.viewLayoutPanel)?void 0:a.controls)?void 0:s.length)&&(i=i.concat(t.viewLayoutPanel.controls));return i.find((t=>t.name===e||t.codeName===e||t.id===e))},getControlProvider:Ya,getControlsByView:ia,getDeACMode:async function(t,e,a){var s;const i=await ibiz.hub.getAppDataEntity(e,a);return null==(s=i.appDEACModes)?void 0:s.find((e=>e.id===t))},getDefaultValue:on,getEditorProvider:Qa,getFormDetailProvider:ts,getFormTypeFieldName:Ye,getGridColumnProvider:ss,getMatchResPath:_s,getOriginData:an,getPanelItemProvider:rs,getPortletProvider:fs,getRootNode:Ze,getTreeNode:ta,getUIActionById:Je,getUIActionProvider:hs,getViewEngines:ra,getViewLogics:na,getViewProvider:async function(t){let e;const{viewType:a,viewStyle:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ha(i,n);if(t&&(e=us(t)),e)return e;ibiz.log.error("找不到视图插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=us("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到视图类型:[".concat(a,"]的视图样式:[").concat(s,"]对应的适配器"),t)}e||(e=us(a));e||(e=us("DEFAULT"));return e},getWFContext:Da,getWFSubmitViewId:function(t,e){var a;const{type:s,sequenceflowview:i,sequenceflowmobview:n}=e,r=(null==(a=t.viewLayoutPanel)?void 0:a.appViewRefs)||t.appViewRefs,o=s?"WFUTILACTION@".concat(s.toUpperCase()):"WFACTION@".concat(ibiz.env.isMob?n:i),c=null==r?void 0:r.find((t=>-1!==t.name.indexOf(o)));return null==c?void 0:c.refAppViewId},handleAllSettled:Va,hasDeCodeName:Xe,install:function(){const{ibiz:t}=window;t.util=new uo,t.hub=new ro,t.register=new de,t.config=new he,t.auth=new bi,t.engine=new oo,ki(),hr(),Cs(),ibiz.scheduler=new Io,ibiz.scheduler.triggerFactory.register("ITEMVISIBLE",((t,e)=>new Ao(t,e))),ibiz.scheduler.triggerFactory.register("ITEMENABLE",((t,e)=>new Ao(t,e))),ibiz.scheduler.triggerFactory.register("ITEMBLANK",((t,e)=>new Ao(t,e))),ibiz.scheduler.triggerFactory.register("TIMER",((t,e)=>new bo(t,e))),ibiz.scheduler.triggerFactory.register("CUSTOM",((t,e)=>new Co(t,e))),ibiz.scheduler.triggerFactory.register("VIEWEVENT",((t,e)=>new So(t,e))),ibiz.scheduler.triggerFactory.register("CTRLEVENT",((t,e)=>new xo(t,e))),ibiz.scheduler.executorFactory.register("SCRIPT",((t,e)=>new fo(t,e))),ibiz.scheduler.executorFactory.register("APPDEUILOGIC",((t,e)=>new go(t,e))),ibiz.scheduler.executorFactory.register("DEUILOGIC",((t,e)=>new go(t,e))),ibiz.scheduler.executorFactory.register("APPUILOGIC",((t,e)=>new Po(t,e))),ibiz.scheduler.executorFactory.register("APPDEUIACTION",((t,e)=>new _o(t,e)))},installCommand:ki,isDataContainer:function(t){return"CONTAINER"===t.itemType&&["CONTAINER_MULTIDATA","CONTAINER_SINGLEDATA"].includes(t.predefinedType)},isValueChange:en,matchMainState:Ge,openRedirectView:oa,parseUserParams:Ue,presetAppCounterProvider:Cs,presetUIActionProvider:hr,registerAppCounterProvider:ws,registerControlProvider:function(t,e){ibiz.register.register("".concat(Ka,"_").concat(t),e)},registerEditorProvider:function(t,e){ibiz.register.register("".concat($a,"_").concat(t),e)},registerFormDetailProvider:function(t,e){ibiz.register.register("".concat(Ja,"_").concat(t),e)},registerGridColumnProvider:function(t,e){ibiz.register.register("".concat(es,"_").concat(t),e)},registerPanelItemProvider:function(t,e){ibiz.register.register("".concat(is,"_").concat(t.toUpperCase()),e)},registerPortletProvider:function(t,e){ibiz.register.register("".concat(ps,"_").concat(t),e)},registerUIActionProvider:cs,registerViewProvider:function(t,e){ibiz.register.register("".concat(ds,"_").concat(t),e)},strContain:pa,testCond:la,toLocalOpenWFRedirectView:ca,verifyDeRules:wa,verifyFormGroupLogic:va,verifyPanelGroupLogic:ya});var pt=Object.create,mt=Object.defineProperty,ft=Object.getOwnPropertyDescriptor,gt=Object.getOwnPropertyNames,wt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty,vt=(t,e)=>function(){return e||(0,t[gt(t)[0]])((e={exports:{}}).exports,e),e.exports},yt=(t,e,a)=>(a=null!=t?pt(wt(t)):{},((t,e,a,s)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let i of gt(e))Et.call(t,i)||i===a||mt(t,i,{get:()=>e[i],enumerable:!(s=ft(e,i))||s.enumerable});return t})(!e&&t&&t.__esModule?a:mt(a,"default",{value:t,enumerable:!0}),t)),It=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/utils.js"(t){t.__esModule=!0,t.extend=n,t.indexOf=function(t,e){for(var a=0,s=t.length;a<s;a++)if(t[a]===e)return a;return-1},t.escapeExpression=function(t){if("string"!=typeof t){if(t&&t.toHTML)return t.toHTML();if(null==t)return"";if(!t)return t+"";t=""+t}if(!s.test(t))return t;return t.replace(a,i)},t.isEmpty=function(t){return!t&&0!==t||!(!c(t)||0!==t.length)},t.createFrame=function(t){var e=n({},t);return e._parent=t,e},t.blockParams=function(t,e){return t.path=e,t},t.appendContextPath=function(t,e){return(t?t+".":"")+e};var e={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},a=/[&<>"'`=]/g,s=/[&<>"'`=]/;function i(t){return e[t]}function n(t){for(var e=1;e<arguments.length;e++)for(var a in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],a)&&(t[a]=arguments[e][a]);return t}var r=Object.prototype.toString;t.toString=r;var o=function(t){return"function"==typeof t};o(/x/)&&(t.isFunction=o=function(t){return"function"==typeof t&&"[object Function]"===r.call(t)}),t.isFunction=o;var c=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===r.call(t)};t.isArray=c}}),Dt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/exception.js"(t,e){t.__esModule=!0;var a=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function s(t,e){var i=e&&e.loc,n=void 0,r=void 0,o=void 0,c=void 0;i&&(n=i.start.line,r=i.end.line,o=i.start.column,c=i.end.column,t+=" - "+n+":"+o);for(var l=Error.prototype.constructor.call(this,t),h=0;h<a.length;h++)this[a[h]]=l[a[h]];Error.captureStackTrace&&Error.captureStackTrace(this,s);try{i&&(this.lineNumber=n,this.endLineNumber=r,Object.defineProperty?(Object.defineProperty(this,"column",{value:o,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:c,enumerable:!0})):(this.column=o,this.endColumn=c))}catch(t){}}s.prototype=new Error,t.default=s,e.exports=t.default}}),Ct=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js"(t,e){t.__esModule=!0;var a=It();t.default=function(t){t.registerHelper("blockHelperMissing",(function(e,s){var i=s.inverse,n=s.fn;if(!0===e)return n(this);if(!1===e||null==e)return i(this);if(a.isArray(e))return e.length>0?(s.ids&&(s.ids=[s.name]),t.helpers.each(e,s)):i(this);if(s.data&&s.ids){var r=a.createFrame(s.data);r.contextPath=a.appendContextPath(s.data.contextPath,s.name),s={data:r}}return n(e,s)}))},e.exports=t.default}}),At=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js"(t,e){t.__esModule=!0;var a,s=It(),i=Dt(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("each",(function(t,e){if(!e)throw new n.default("Must pass iterator to #each");var a,i=e.fn,r=e.inverse,o=0,c="",l=void 0,h=void 0;function d(e,a,n){l&&(l.key=e,l.index=a,l.first=0===a,l.last=!!n,h&&(l.contextPath=h+e)),c+=i(t[e],{data:l,blockParams:s.blockParams([t[e],e],[h+e,null])})}if(e.data&&e.ids&&(h=s.appendContextPath(e.data.contextPath,e.ids[0])+"."),s.isFunction(t)&&(t=t.call(this)),e.data&&(l=s.createFrame(e.data)),t&&"object"==typeof t)if(s.isArray(t))for(var u=t.length;o<u;o++)o in t&&d(o,o,o===t.length-1);else if("function"==typeof Symbol&&t[Symbol.iterator]){for(var p=[],m=t[Symbol.iterator](),f=m.next();!f.done;f=m.next())p.push(f.value);for(u=(t=p).length;o<u;o++)d(o,o,o===t.length-1)}else a=void 0,Object.keys(t).forEach((function(t){void 0!==a&&d(a,o-1),a=t,o++})),void 0!==a&&d(a,o-1,!0);return 0===o&&(c=r(this)),c}))},e.exports=t.default}}),bt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js"(t,e){t.__esModule=!0;var a,s=Dt(),i=(a=s)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new i.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default}}),Pt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js"(t,e){t.__esModule=!0;var a,s=It(),i=Dt(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("if",(function(t,e){if(2!=arguments.length)throw new n.default("#if requires exactly one argument");return s.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||s.isEmpty(t)?e.inverse(this):e.fn(this)})),t.registerHelper("unless",(function(e,a){if(2!=arguments.length)throw new n.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:a.inverse,inverse:a.fn,hash:a.hash})}))},e.exports=t.default}}),St=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/log.js"(t,e){t.__esModule=!0,t.default=function(t){t.registerHelper("log",(function(){for(var e=[void 0],a=arguments[arguments.length-1],s=0;s<arguments.length-1;s++)e.push(arguments[s]);var i=1;null!=a.hash.level?i=a.hash.level:a.data&&null!=a.data.level&&(i=a.data.level),e[0]=i,t.log.apply(t,e)}))},e.exports=t.default}}),xt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js"(t,e){t.__esModule=!0,t.default=function(t){t.registerHelper("lookup",(function(t,e,a){return t?a.lookupProperty(t,e):t}))},e.exports=t.default}}),_t=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js"(t,e){t.__esModule=!0;var a,s=It(),i=Dt(),n=(a=i)&&a.__esModule?a:{default:a};t.default=function(t){t.registerHelper("with",(function(t,e){if(2!=arguments.length)throw new n.default("#with requires exactly one argument");s.isFunction(t)&&(t=t.call(this));var a=e.fn;if(s.isEmpty(t))return e.inverse(this);var i=e.data;return e.data&&e.ids&&((i=s.createFrame(e.data)).contextPath=s.appendContextPath(e.data.contextPath,e.ids[0])),a(t,{data:i,blockParams:s.blockParams([t],[i&&i.contextPath])})}))},e.exports=t.default}}),Tt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.registerDefaultHelpers=function(t){a.default(t),s.default(t),i.default(t),n.default(t),r.default(t),o.default(t),c.default(t)},t.moveHelperToHooks=function(t,e,a){t.helpers[e]&&(t.hooks[e]=t.helpers[e],a||delete t.helpers[e])};var a=e(Ct()),s=e(At()),i=e(bt()),n=e(Pt()),r=e(St()),o=e(xt()),c=e(_t())}}),Lt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js"(t,e){t.__esModule=!0;var a=It();t.default=function(t){t.registerDecorator("inline",(function(t,e,s,i){var n=t;return e.partials||(e.partials={},n=function(i,n){var r=s.partials;s.partials=a.extend({},r,e.partials);var o=t(i,n);return s.partials=r,o}),e.partials[i.args[0]]=i.fn,n}))},e.exports=t.default}}),Nt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators.js"(t){t.__esModule=!0,t.registerDefaultDecorators=function(t){s.default(t)};var e,a=Lt(),s=(e=a)&&e.__esModule?e:{default:e}}}),Ot=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/logger.js"(t,e){t.__esModule=!0;var a=It(),s={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if("string"==typeof t){var e=a.indexOf(s.methodMap,t.toLowerCase());t=e>=0?e:parseInt(t,10)}return t},log:function(t){if(t=s.lookupLevel(t),"undefined"!=typeof console&&s.lookupLevel(s.level)<=t){var e=s.methodMap[t];console[e]||(e="log");for(var a=arguments.length,i=Array(a>1?a-1:0),n=1;n<a;n++)i[n-1]=arguments[n];console[e].apply(console,i)}}};t.default=s,e.exports=t.default}}),Mt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js"(t){t.__esModule=!0,t.createNewLookupObject=function(){for(var t=arguments.length,a=Array(t),s=0;s<t;s++)a[s]=arguments[s];return e.extend.apply(void 0,[Object.create(null)].concat(a))};var e=It()}}),Rt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js"(t){t.__esModule=!0,t.createProtoAccessControl=function(t){var e=Object.create(null);e.constructor=!1,e.__defineGetter__=!1,e.__defineSetter__=!1,e.__lookupGetter__=!1;var s=Object.create(null);return s.__proto__=!1,{properties:{whitelist:a.createNewLookupObject(s,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:a.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(t,e,a){return r("function"==typeof t?e.methods:e.properties,a)},t.resetLoggedProperties=function(){Object.keys(n).forEach((function(t){delete n[t]}))};var e,a=Mt(),s=Ot(),i=(e=s)&&e.__esModule?e:{default:e},n=Object.create(null);function r(t,e){return void 0!==t.whitelist[e]?!0===t.whitelist[e]:void 0!==t.defaultValue?t.defaultValue:(function(t){!0!==n[t]&&(n[t]=!0,i.default.log("error",'Handlebars: Access has been denied to resolve the property "'+t+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}(e),!1)}}}),Vt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/base.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.HandlebarsEnvironment=l;var a=It(),s=e(Dt()),i=Tt(),n=Nt(),r=e(Ot()),o=Rt();t.VERSION="4.7.8";t.COMPILER_REVISION=8;t.LAST_COMPATIBLE_COMPILER_REVISION=7;t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};var c="[object Object]";function l(t,e,a){this.helpers=t||{},this.partials=e||{},this.decorators=a||{},i.registerDefaultHelpers(this),n.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:r.default,log:r.default.log,registerHelper:function(t,e){if(a.toString.call(t)===c){if(e)throw new s.default("Arg not supported with multiple helpers");a.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(a.toString.call(t)===c)a.extend(this.partials,t);else{if(void 0===e)throw new s.default('Attempting to register a partial called "'+t+'" as undefined');this.partials[t]=e}},unregisterPartial:function(t){delete this.partials[t]},registerDecorator:function(t,e){if(a.toString.call(t)===c){if(e)throw new s.default("Arg not supported with multiple decorators");a.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){o.resetLoggedProperties()}};var h=r.default.log;t.log=h,t.createFrame=a.createFrame,t.logger=r.default}}),kt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(t,e){function a(t){this.string=t}t.__esModule=!0,a.prototype.toString=a.prototype.toHTML=function(){return""+this.string},t.default=a,e.exports=t.default}}),Ft=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js"(t){t.__esModule=!0,t.wrapHelper=function(t,e){if("function"!=typeof t)return t;return function(){return arguments[arguments.length-1]=e(arguments[arguments.length-1]),t.apply(this,arguments)}}}}),Wt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/runtime.js"(t){t.__esModule=!0,t.checkRevision=function(t){var e=t&&t[0]||1,a=n.COMPILER_REVISION;if(e>=n.LAST_COMPATIBLE_COMPILER_REVISION&&e<=n.COMPILER_REVISION)return;if(e<n.LAST_COMPATIBLE_COMPILER_REVISION){var s=n.REVISION_CHANGES[a],r=n.REVISION_CHANGES[e];throw new i.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+s+") or downgrade your runtime to an older version ("+r+").")}throw new i.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+t[1]+").")},t.template=function(t,e){if(!e)throw new i.default("No environment passed to template");if(!t||!t.main)throw new i.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var s=t.compiler&&7===t.compiler[0];var h={strict:function(t,e,a){if(!t||!(e in t))throw new i.default('"'+e+'" not defined in '+t,{loc:a});return h.lookupProperty(t,e)},lookupProperty:function(t,e){var a=t[e];return null==a||Object.prototype.hasOwnProperty.call(t,e)||c.resultIsAllowed(a,h.protoAccessControl,e)?a:void 0},lookup:function(t,e){for(var a=t.length,s=0;s<a;s++){if(null!=(t[s]&&h.lookupProperty(t[s],e)))return t[s][e]}},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:a.escapeExpression,invokePartial:function(s,n,r){r.hash&&(n=a.extend({},n,r.hash),r.ids&&(r.ids[0]=!0)),s=e.VM.resolvePartial.call(this,s,n,r);var o=a.extend({},r,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),c=e.VM.invokePartial.call(this,s,n,o);if(null==c&&e.compile&&(r.partials[r.name]=e.compile(s,t.compilerOptions,e),c=r.partials[r.name](n,o)),null!=c){if(r.indent){for(var l=c.split("\n"),h=0,d=l.length;h<d&&(l[h]||h+1!==d);h++)l[h]=r.indent+l[h];c=l.join("\n")}return c}throw new i.default("The partial "+r.name+" could not be compiled when running in runtime-only mode")},fn:function(e){var a=t[e];return a.decorator=t[e+"_d"],a},programs:[],program:function(t,e,a,s,i){var n=this.programs[t],r=this.fn(t);return e||i||s||a?n=l(this,t,r,e,a,s,i):n||(n=this.programs[t]=l(this,t,r)),n},data:function(t,e){for(;t&&e--;)t=t._parent;return t},mergeIfNeeded:function(t,e){var s=t||e;return t&&e&&t!==e&&(s=a.extend({},e,t)),s},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:t.compiler};function u(e){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],s=a.data;u._setup(a),!a.partial&&t.useData&&(s=function(t,e){e&&"root"in e||((e=e?n.createFrame(e):{}).root=t);return e}(e,s));var i=void 0,r=t.useBlockParams?[]:void 0;function o(e){return""+t.main(h,e,h.helpers,h.partials,s,r,i)}return t.useDepths&&(i=a.depths?e!=a.depths[0]?[e].concat(a.depths):a.depths:[e]),(o=d(t.main,o,h,a.depths||[],s,r))(e,a)}return u.isTop=!0,u._setup=function(i){if(i.partial)h.protoAccessControl=i.protoAccessControl,h.helpers=i.helpers,h.partials=i.partials,h.decorators=i.decorators,h.hooks=i.hooks;else{var n=a.extend({},e.helpers,i.helpers);!function(t,e){Object.keys(t).forEach((function(s){var i=t[s];t[s]=function(t,e){var s=e.lookupProperty;return o.wrapHelper(t,(function(t){return a.extend({lookupProperty:s},t)}))}(i,e)}))}(n,h),h.helpers=n,t.usePartial&&(h.partials=h.mergeIfNeeded(i.partials,e.partials)),(t.usePartial||t.useDecorators)&&(h.decorators=a.extend({},e.decorators,i.decorators)),h.hooks={},h.protoAccessControl=c.createProtoAccessControl(i);var l=i.allowCallsToHelperMissing||s;r.moveHelperToHooks(h,"helperMissing",l),r.moveHelperToHooks(h,"blockHelperMissing",l)}},u._child=function(e,a,s,n){if(t.useBlockParams&&!s)throw new i.default("must pass block params");if(t.useDepths&&!n)throw new i.default("must pass parent depths");return l(h,e,t[e],a,0,s,n)},u},t.wrapProgram=l,t.resolvePartial=function(t,e,a){t?t.call||a.name||(a.name=t,t=a.partials[t]):t="@partial-block"===a.name?a.data["partial-block"]:a.partials[a.name];return t},t.invokePartial=function(t,e,s){var r=s.data&&s.data["partial-block"];s.partial=!0,s.ids&&(s.data.contextPath=s.ids[0]||s.data.contextPath);var o=void 0;s.fn&&s.fn!==h&&function(){s.data=n.createFrame(s.data);var t=s.fn;o=s.data["partial-block"]=function(e){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a.data=n.createFrame(a.data),a.data["partial-block"]=r,t(e,a)},t.partials&&(s.partials=a.extend({},s.partials,t.partials))}();void 0===t&&o&&(t=o);if(void 0===t)throw new i.default("The partial "+s.name+" could not be found");if(t instanceof Function)return t(e,s)},t.noop=h;var e,a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}(It()),s=Dt(),i=(e=s)&&e.__esModule?e:{default:e},n=Vt(),r=Tt(),o=Ft(),c=Rt();function l(t,e,a,s,i,n,r){function o(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=r;return!r||e==r[0]||e===t.nullContext&&null===r[0]||(o=[e].concat(r)),a(t,e,t.helpers,t.partials,i.data||s,n&&[i.blockParams].concat(n),o)}return(o=d(a,o,t,r,s,n)).program=e,o.depth=r?r.length:0,o.blockParams=i||0,o}function h(){return""}function d(t,e,s,i,n,r){if(t.decorator){var o={};e=t.decorator(e,o,s,i&&i[0],n,r,i),a.extend(e,o)}return e}}}),Bt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js"(t,e){t.__esModule=!0,t.default=function(t){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",(function(){return this})),__magic__.globalThis=__magic__,delete Object.prototype.__magic__);var e=globalThis.Handlebars;t.noConflict=function(){return globalThis.Handlebars===t&&(globalThis.Handlebars=e),t}},e.exports=t.default}}),Ut=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.runtime.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}function s(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}t.__esModule=!0;var i=s(Vt()),n=a(kt()),r=a(Dt()),o=s(It()),c=s(Wt()),l=a(Bt());function h(){var t=new i.HandlebarsEnvironment;return o.extend(t,i),t.SafeString=n.default,t.Exception=r.default,t.Utils=o,t.escapeExpression=o.escapeExpression,t.VM=c,t.template=function(e){return c.template(e,t)},t}var d=h();d.create=h,l.default(d),d.default=d,t.default=d,e.exports=t.default}}),jt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js"(t,e){t.__esModule=!0;var a={helpers:{helperExpression:function(t){return"SubExpression"===t.type||("MustacheStatement"===t.type||"BlockStatement"===t.type)&&!!(t.params&&t.params.length||t.hash)},scopedId:function(t){return/^\.|this\b/.test(t.original)},simpleId:function(t){return 1===t.parts.length&&!a.helpers.scopedId(t)&&!t.depth}}};t.default=a,e.exports=t.default}}),zt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js"(t,e){t.__esModule=!0;var a=function(){var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(t,e,a,s,i,n,r){var o=n.length-1;switch(i){case 1:return n[o-1];case 2:this.$=s.prepareProgram(n[o]);break;case 3:case 4:case 5:case 6:case 7:case 8:case 20:case 27:case 28:case 33:case 34:case 40:case 41:this.$=n[o];break;case 9:this.$={type:"CommentStatement",value:s.stripComment(n[o]),strip:s.stripFlags(n[o],n[o]),loc:s.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:n[o],value:n[o],loc:s.locInfo(this._$)};break;case 11:this.$=s.prepareRawBlock(n[o-2],n[o-1],n[o],this._$);break;case 12:this.$={path:n[o-3],params:n[o-2],hash:n[o-1]};break;case 13:this.$=s.prepareBlock(n[o-3],n[o-2],n[o-1],n[o],!1,this._$);break;case 14:this.$=s.prepareBlock(n[o-3],n[o-2],n[o-1],n[o],!0,this._$);break;case 15:this.$={open:n[o-5],path:n[o-4],params:n[o-3],hash:n[o-2],blockParams:n[o-1],strip:s.stripFlags(n[o-5],n[o])};break;case 16:case 17:this.$={path:n[o-4],params:n[o-3],hash:n[o-2],blockParams:n[o-1],strip:s.stripFlags(n[o-5],n[o])};break;case 18:this.$={strip:s.stripFlags(n[o-1],n[o-1]),program:n[o]};break;case 19:var c=s.prepareBlock(n[o-2],n[o-1],n[o],n[o],!1,this._$),l=s.prepareProgram([c],n[o-1].loc);l.chained=!0,this.$={strip:n[o-2].strip,program:l,chain:!0};break;case 21:this.$={path:n[o-1],strip:s.stripFlags(n[o-2],n[o])};break;case 22:case 23:this.$=s.prepareMustache(n[o-3],n[o-2],n[o-1],n[o-4],s.stripFlags(n[o-4],n[o]),this._$);break;case 24:this.$={type:"PartialStatement",name:n[o-3],params:n[o-2],hash:n[o-1],indent:"",strip:s.stripFlags(n[o-4],n[o]),loc:s.locInfo(this._$)};break;case 25:this.$=s.preparePartialBlock(n[o-2],n[o-1],n[o],this._$);break;case 26:this.$={path:n[o-3],params:n[o-2],hash:n[o-1],strip:s.stripFlags(n[o-4],n[o])};break;case 29:this.$={type:"SubExpression",path:n[o-3],params:n[o-2],hash:n[o-1],loc:s.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:n[o],loc:s.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:s.id(n[o-2]),value:n[o],loc:s.locInfo(this._$)};break;case 32:this.$=s.id(n[o-1]);break;case 35:this.$={type:"StringLiteral",value:n[o],original:n[o],loc:s.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(n[o]),original:Number(n[o]),loc:s.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===n[o],original:"true"===n[o],loc:s.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:s.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:s.locInfo(this._$)};break;case 42:this.$=s.preparePath(!0,n[o],this._$);break;case 43:this.$=s.preparePath(!1,n[o],this._$);break;case 44:n[o-2].push({part:s.id(n[o]),original:n[o],separator:n[o-1]}),this.$=n[o-2];break;case 45:this.$=[{part:s.id(n[o]),original:n[o]}];break;case 46:case 48:case 50:case 58:case 64:case 70:case 78:case 82:case 86:case 90:case 94:this.$=[];break;case 47:case 49:case 51:case 59:case 65:case 71:case 79:case 83:case 87:case 91:case 95:case 99:case 101:n[o-1].push(n[o]);break;case 98:case 100:this.$=[n[o]]}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(t,e){throw new Error(t)},parse:function(t){var e=this,a=[0],s=[null],i=[],n=this.table,r="",o=0,c=0;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;i.push(l);var h=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,u,p,m,f,g,w,E,v,y={};;){if(u=a[a.length-1],this.defaultActions[u]?p=this.defaultActions[u]:(null==d&&(v=void 0,"number"!=typeof(v=e.lexer.lex()||1)&&(v=e.symbols_[v]||v),d=v),p=n[u]&&n[u][d]),void 0===p||!p.length||!p[0]){var I="";for(f in E=[],n[u])this.terminals_[f]&&f>2&&E.push("'"+this.terminals_[f]+"'");I=this.lexer.showPosition?"Parse error on line "+(o+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(I,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:l,expected:E})}if(p[0]instanceof Array&&p.length>1)throw new Error("Parse Error: multiple actions possible at state: "+u+", token: "+d);switch(p[0]){case 1:a.push(d),s.push(this.lexer.yytext),i.push(this.lexer.yylloc),a.push(p[1]),d=null,c=this.lexer.yyleng,r=this.lexer.yytext,o=this.lexer.yylineno,l=this.lexer.yylloc;break;case 2:if(g=this.productions_[p[1]][1],y.$=s[s.length-g],y._$={first_line:i[i.length-(g||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(g||1)].first_column,last_column:i[i.length-1].last_column},h&&(y._$.range=[i[i.length-(g||1)].range[0],i[i.length-1].range[1]]),void 0!==(m=this.performAction.call(y,r,c,o,this.yy,p[1],s,i)))return m;g&&(a=a.slice(0,-1*g*2),s=s.slice(0,-1*g),i=i.slice(0,-1*g)),a.push(this.productions_[p[1]][0]),s.push(y.$),i.push(y._$),w=n[a[a.length-2]][a[a.length-1]],a.push(w);break;case 3:return!0}}return!0}},e={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t){return this._input=t,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,a=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e-1),this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===s.length?this.yylloc.first_column:0)+s[s.length-a.length].length-a[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this},more:function(){return this._more=!0,this},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},next:function(){if(this.done)return this.EOF;var t,e,a,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length&&(!(a=this._input.match(this.rules[n[r]]))||e&&!(a[0].length>e[0].length)||(e=a,s=r,this.options.flex));r++);return e?((i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],t=this.performAction.call(this,this.yy,this,n[s],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),t||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return void 0!==t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)},options:{},performAction:function(t,e,a,s){function i(t,a){return e.yytext=e.yytext.substring(t,e.yyleng-a+t)}switch(a){case 0:if("\\\\"===e.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),e.yytext)return 15;break;case 1:case 5:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(i(5,9),"END_RAW_BLOCK");case 6:case 22:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:case 23:return 48;case 21:this.unput(e.yytext),this.popState(),this.begin("com");break;case 24:return 73;case 25:case 26:case 41:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return e.yytext=i(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=i(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 42:return e.yytext=e.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};function a(){this.yy={}}return t.lexer=e,a.prototype=t,t.Parser=a,new a}();t.default=a,e.exports=t.default}}),Gt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js"(t,e){t.__esModule=!0;var a,s=Dt(),i=(a=s)&&a.__esModule?a:{default:a};function n(){this.parents=[]}function r(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function o(t){r.call(this,t),this.acceptKey(t,"program"),this.acceptKey(t,"inverse")}function c(t){this.acceptRequired(t,"name"),this.acceptArray(t.params),this.acceptKey(t,"hash")}n.prototype={constructor:n,mutating:!1,acceptKey:function(t,e){var a=this.accept(t[e]);if(this.mutating){if(a&&!n.prototype[a.type])throw new i.default('Unexpected node type "'+a.type+'" found when accepting '+e+" on "+t.type);t[e]=a}},acceptRequired:function(t,e){if(this.acceptKey(t,e),!t[e])throw new i.default(t.type+" requires "+e)},acceptArray:function(t){for(var e=0,a=t.length;e<a;e++)this.acceptKey(t,e),t[e]||(t.splice(e,1),e--,a--)},accept:function(t){if(t){if(!this[t.type])throw new i.default("Unknown type: "+t.type,t);this.current&&this.parents.unshift(this.current),this.current=t;var e=this[t.type](t);return this.current=this.parents.shift(),!this.mutating||e?e:!1!==e?t:void 0}},Program:function(t){this.acceptArray(t.body)},MustacheStatement:r,Decorator:r,BlockStatement:o,DecoratorBlock:o,PartialStatement:c,PartialBlockStatement:function(t){c.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:r,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(t){this.acceptArray(t.pairs)},HashPair:function(t){this.acceptRequired(t,"value")}},t.default=n,e.exports=t.default}}),Ht=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js"(t,e){t.__esModule=!0;var a,s=Gt(),i=(a=s)&&a.__esModule?a:{default:a};function n(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=t}function r(t,e,a){void 0===e&&(e=t.length);var s=t[e-1],i=t[e-2];return s?"ContentStatement"===s.type?(i||!a?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(s.original):void 0:a}function o(t,e,a){void 0===e&&(e=-1);var s=t[e+1],i=t[e+2];return s?"ContentStatement"===s.type?(i||!a?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(s.original):void 0:a}function c(t,e,a){var s=t[null==e?0:e+1];if(s&&"ContentStatement"===s.type&&(a||!s.rightStripped)){var i=s.value;s.value=s.value.replace(a?/^\s+/:/^[ \t]*\r?\n?/,""),s.rightStripped=s.value!==i}}function l(t,e,a){var s=t[null==e?t.length-1:e-1];if(s&&"ContentStatement"===s.type&&(a||!s.leftStripped)){var i=s.value;return s.value=s.value.replace(a?/\s+$/:/[ \t]+$/,""),s.leftStripped=s.value!==i,s.leftStripped}}n.prototype=new i.default,n.prototype.Program=function(t){var e=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var s=t.body,i=0,n=s.length;i<n;i++){var h=s[i],d=this.accept(h);if(d){var u=r(s,i,a),p=o(s,i,a),m=d.openStandalone&&u,f=d.closeStandalone&&p,g=d.inlineStandalone&&u&&p;d.close&&c(s,i,!0),d.open&&l(s,i,!0),e&&g&&(c(s,i),l(s,i)&&"PartialStatement"===h.type&&(h.indent=/([ \t]+$)/.exec(s[i-1].original)[1])),e&&m&&(c((h.program||h.inverse).body),l(s,i)),e&&f&&(c(s,i),l((h.inverse||h.program).body))}}return t},n.prototype.BlockStatement=n.prototype.DecoratorBlock=n.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,a=t.program&&t.inverse,s=a,i=a;if(a&&a.chained)for(s=a.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var n={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:o(e.body),closeStandalone:r((s||e).body)};if(t.openStrip.close&&c(e.body,null,!0),a){var h=t.inverseStrip;h.open&&l(e.body,null,!0),h.close&&c(s.body,null,!0),t.closeStrip.open&&l(i.body,null,!0),!this.options.ignoreStandalone&&r(e.body)&&o(s.body)&&(l(e.body),c(s.body))}else t.closeStrip.open&&l(e.body,null,!0);return n},n.prototype.Decorator=n.prototype.MustacheStatement=function(t){return t.strip},n.prototype.PartialStatement=n.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}},t.default=n,e.exports=t.default}}),Kt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js"(t){t.__esModule=!0,t.SourceLocation=function(t,e){this.source=t,this.start={line:e.first_line,column:e.first_column},this.end={line:e.last_line,column:e.last_column}},t.id=function(t){return/^\[.*\]$/.test(t)?t.substring(1,t.length-1):t},t.stripFlags=function(t,e){return{open:"~"===t.charAt(2),close:"~"===e.charAt(e.length-3)}},t.stripComment=function(t){return t.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")},t.preparePath=function(t,e,a){a=this.locInfo(a);for(var i=t?"@":"",n=[],r=0,o=0,c=e.length;o<c;o++){var l=e[o].part,h=e[o].original!==l;if(i+=(e[o].separator||"")+l,h||".."!==l&&"."!==l&&"this"!==l)n.push(l);else{if(n.length>0)throw new s.default("Invalid path: "+i,{loc:a});".."===l&&r++}}return{type:"PathExpression",data:t,depth:r,parts:n,original:i,loc:a}},t.prepareMustache=function(t,e,a,s,i,n){var r=s.charAt(3)||s.charAt(2),o="{"!==r&&"&"!==r;return{type:/\*/.test(s)?"Decorator":"MustacheStatement",path:t,params:e,hash:a,escaped:o,strip:i,loc:this.locInfo(n)}},t.prepareRawBlock=function(t,e,a,s){i(t,a),s=this.locInfo(s);var n={type:"Program",body:e,strip:{},loc:s};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:n,openStrip:{},inverseStrip:{},closeStrip:{},loc:s}},t.prepareBlock=function(t,e,a,n,r,o){n&&n.path&&i(t,n);var c=/\*/.test(t.open);e.blockParams=t.blockParams;var l=void 0,h=void 0;if(a){if(c)throw new s.default("Unexpected inverse block on decorator",a);a.chain&&(a.program.body[0].closeStrip=n.strip),h=a.strip,l=a.program}r&&(r=l,l=e,e=r);return{type:c?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:l,openStrip:t.strip,inverseStrip:h,closeStrip:n&&n.strip,loc:this.locInfo(o)}},t.prepareProgram=function(t,e){if(!e&&t.length){var a=t[0].loc,s=t[t.length-1].loc;a&&s&&(e={source:a.source,start:{line:a.start.line,column:a.start.column},end:{line:s.end.line,column:s.end.column}})}return{type:"Program",body:t,strip:{},loc:e}},t.preparePartialBlock=function(t,e,a,s){return i(t,a),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:a&&a.strip,loc:this.locInfo(s)}};var e,a=Dt(),s=(e=a)&&e.__esModule?e:{default:e};function i(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var a={loc:t.path.loc};throw new s.default(t.path.original+" doesn't match "+e,a)}}}}),Xt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.parseWithoutProcessing=o,t.parse=function(t,e){var a=o(t,e);return new s.default(e).accept(a)};var a=e(zt()),s=e(Ht()),i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e.default=t,e}(Kt()),n=It();t.parser=a.default;var r={};function o(t,e){return"Program"===t.type?t:(a.default.yy=r,r.locInfo=function(t){return new r.SourceLocation(e&&e.srcName,t)},a.default.parse(t))}n.extend(r,i)}}),Yt=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js"(t){function e(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0,t.Compiler=r,t.precompile=function(t,e,s){if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new a.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);"data"in(e=e||{})||(e.data=!0);e.compat&&(e.useDepths=!0);var i=s.parse(t,e),n=(new s.Compiler).compile(i,e);return(new s.JavaScriptCompiler).compile(n,e)},t.compile=function(t,e,i){void 0===e&&(e={});if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new a.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);"data"in(e=s.extend({},e))||(e.data=!0);e.compat&&(e.useDepths=!0);var n=void 0;function r(){var a=i.parse(t,e),s=(new i.Compiler).compile(a,e),n=(new i.JavaScriptCompiler).compile(s,e,void 0,!0);return i.template(n)}function o(t,e){return n||(n=r()),n.call(this,t,e)}return o._setup=function(t){return n||(n=r()),n._setup(t)},o._child=function(t,e,a,s){return n||(n=r()),n._child(t,e,a,s)},o};var a=e(Dt()),s=It(),i=e(jt()),n=[].slice;function r(){}function o(t,e){if(t===e)return!0;if(s.isArray(t)&&s.isArray(e)&&t.length===e.length){for(var a=0;a<t.length;a++)if(!o(t[a],e[a]))return!1;return!0}}function c(t){if(!t.path.parts){var e=t.path;t.path={type:"PathExpression",data:!1,depth:0,parts:[e.original+""],original:e.original+"",loc:e.loc}}}r.prototype={compiler:r,equals:function(t){var e=this.opcodes.length;if(t.opcodes.length!==e)return!1;for(var a=0;a<e;a++){var s=this.opcodes[a],i=t.opcodes[a];if(s.opcode!==i.opcode||!o(s.args,i.args))return!1}e=this.children.length;for(a=0;a<e;a++)if(!this.children[a].equals(t.children[a]))return!1;return!0},guid:0,compile:function(t,e){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=e,this.stringParams=e.stringParams,this.trackIds=e.trackIds,e.blockParams=e.blockParams||[],e.knownHelpers=s.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},e.knownHelpers),this.accept(t)},compileProgram:function(t){var e=(new this.compiler).compile(t,this.options),a=this.guid++;return this.usePartial=this.usePartial||e.usePartial,this.children[a]=e,this.useDepths=this.useDepths||e.useDepths,a},accept:function(t){if(!this[t.type])throw new a.default("Unknown type: "+t.type,t);this.sourceNode.unshift(t);var e=this[t.type](t);return this.sourceNode.shift(),e},Program:function(t){this.options.blockParams.unshift(t.blockParams);for(var e=t.body,a=e.length,s=0;s<a;s++)this.accept(e[s]);return this.options.blockParams.shift(),this.isSimple=1===a,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){c(t);var e=t.program,a=t.inverse;e=e&&this.compileProgram(e),a=a&&this.compileProgram(a);var s=this.classifySexpr(t);"helper"===s?this.helperSexpr(t,e,a):"simple"===s?(this.simpleSexpr(t),this.opcode("pushProgram",e),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,e,a),this.opcode("pushProgram",e),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var e=t.program&&this.compileProgram(t.program),a=this.setupFullMustacheParams(t,e,void 0),s=t.path;this.useDecorators=!0,this.opcode("registerDecorator",a.length,s.original)},PartialStatement:function(t){this.usePartial=!0;var e=t.program;e&&(e=this.compileProgram(t.program));var s=t.params;if(s.length>1)throw new a.default("Unsupported number of partial arguments: "+s.length,t);s.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):s.push({type:"PathExpression",parts:[],depth:0}));var i=t.name.original,n="SubExpression"===t.name.type;n&&this.accept(t.name),this.setupFullMustacheParams(t,e,void 0,!0);var r=t.indent||"";this.options.preventIndent&&r&&(this.opcode("appendContent",r),r=""),this.opcode("invokePartial",n,i,r),this.opcode("append")},PartialBlockStatement:function(t){this.PartialStatement(t)},MustacheStatement:function(t){this.SubExpression(t),t.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(t){this.DecoratorBlock(t)},ContentStatement:function(t){t.value&&this.opcode("appendContent",t.value)},CommentStatement:function(){},SubExpression:function(t){c(t);var e=this.classifySexpr(t);"simple"===e?this.simpleSexpr(t):"helper"===e?this.helperSexpr(t):this.ambiguousSexpr(t)},ambiguousSexpr:function(t,e,a){var s=t.path,i=s.parts[0],n=null!=e||null!=a;this.opcode("getContext",s.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",a),s.strict=!0,this.accept(s),this.opcode("invokeAmbiguous",i,n)},simpleSexpr:function(t){var e=t.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,e,s){var n=this.setupFullMustacheParams(t,e,s),r=t.path,o=r.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",n.length,o);else{if(this.options.knownHelpersOnly)throw new a.default("You specified knownHelpersOnly, but used the unknown helper "+o,t);r.strict=!0,r.falsy=!0,this.accept(r),this.opcode("invokeHelper",n.length,r.original,i.default.helpers.simpleId(r))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var e=t.parts[0],a=i.default.helpers.scopedId(t),s=!t.depth&&!a&&this.blockParamIndex(e);s?this.opcode("lookupBlockParam",s,t.parts):e?t.data?(this.options.data=!0,this.opcode("lookupData",t.depth,t.parts,t.strict)):this.opcode("lookupOnContext",t.parts,t.falsy,t.strict,a):this.opcode("pushContext")},StringLiteral:function(t){this.opcode("pushString",t.value)},NumberLiteral:function(t){this.opcode("pushLiteral",t.value)},BooleanLiteral:function(t){this.opcode("pushLiteral",t.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(t){var e=t.pairs,a=0,s=e.length;for(this.opcode("pushHash");a<s;a++)this.pushParam(e[a].value);for(;a--;)this.opcode("assignToHash",e[a].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:n.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var e=i.default.helpers.simpleId(t.path),a=e&&!!this.blockParamIndex(t.path.parts[0]),s=!a&&i.default.helpers.helperExpression(t),n=!a&&(s||e);if(n&&!s){var r=t.path.parts[0],o=this.options;o.knownHelpers[r]?s=!0:o.knownHelpersOnly&&(n=!1)}return s?"helper":n?"ambiguous":"simple"},pushParams:function(t){for(var e=0,a=t.length;e<a;e++)this.pushParam(t[e])},pushParam:function(t){var e=null!=t.value?t.value:t.original||"";if(this.stringParams)e.replace&&(e=e.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",e,t.type),"SubExpression"===t.type&&this.accept(t);else{if(this.trackIds){var a=void 0;if(!t.parts||i.default.helpers.scopedId(t)||t.depth||(a=this.blockParamIndex(t.parts[0])),a){var s=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",a,s)}else(e=t.original||e).replace&&(e=e.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",t.type,e)}this.accept(t)}},setupFullMustacheParams:function(t,e,a,s){var i=t.params;return this.pushParams(i),this.opcode("pushProgram",e),this.opcode("pushProgram",a),t.hash?this.accept(t.hash):this.opcode("emptyHash",s),i},blockParamIndex:function(t){for(var e=0,a=this.options.blockParams.length;e<a;e++){var i=this.options.blockParams[e],n=i&&s.indexOf(i,t);if(i&&n>=0)return[e,n]}}}}}),$t=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js"(t){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(t){if(0<=t&&t<e.length)return e[t];throw new TypeError("Must be between 0 and 63: "+t)},t.decode=function(t){return 65<=t&&t<=90?t-65:97<=t&&t<=122?t-97+26:48<=t&&t<=57?t-48+52:43==t?62:47==t?63:-1}}}),qt=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(t){var e=$t();t.encode=function(t){var a,s="",i=function(t){return t<0?1+(-t<<1):0+(t<<1)}(t);do{a=31&i,(i>>>=5)>0&&(a|=32),s+=e.encode(a)}while(i>0);return s},t.decode=function(t,a,s){var i,n,r,o,c=t.length,l=0,h=0;do{if(a>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(n=e.decode(t.charCodeAt(a++))))throw new Error("Invalid base64 digit: "+t.charAt(a-1));i=!!(32&n),l+=(n&=31)<<h,h+=5}while(i);s.value=(o=(r=l)>>1,1==(1&r)?-o:o),s.rest=a}}}),Qt=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js"(t){t.getArg=function(t,e,a){if(e in t)return t[e];if(3===arguments.length)return a;throw new Error('"'+e+'" is a required argument.')};var e=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,a=/^data:.+\,.+$/;function s(t){var a=t.match(e);return a?{scheme:a[1],auth:a[2],host:a[3],port:a[4],path:a[5]}:null}function i(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}function n(e){var a=e,n=s(e);if(n){if(!n.path)return e;a=n.path}for(var r,o=t.isAbsolute(a),c=a.split(/\/+/),l=0,h=c.length-1;h>=0;h--)"."===(r=c[h])?c.splice(h,1):".."===r?l++:l>0&&(""===r?(c.splice(h+1,l),l=0):(c.splice(h,2),l--));return""===(a=c.join("/"))&&(a=o?"/":"."),n?(n.path=a,i(n)):a}function r(t,e){""===t&&(t="."),""===e&&(e=".");var r=s(e),o=s(t);if(o&&(t=o.path||"/"),r&&!r.scheme)return o&&(r.scheme=o.scheme),i(r);if(r||e.match(a))return e;if(o&&!o.host&&!o.path)return o.host=e,i(o);var c="/"===e.charAt(0)?e:n(t.replace(/\/+$/,"")+"/"+e);return o?(o.path=c,i(o)):c}t.urlParse=s,t.urlGenerate=i,t.normalize=n,t.join=r,t.isAbsolute=function(t){return"/"===t.charAt(0)||e.test(t)},t.relative=function(t,e){""===t&&(t="."),t=t.replace(/\/$/,"");for(var a=0;0!==e.indexOf(t+"/");){var s=t.lastIndexOf("/");if(s<0)return e;if((t=t.slice(0,s)).match(/^([^\/]+:\/)?\/*$/))return e;++a}return Array(a+1).join("../")+e.substr(t.length+1)};var o=!("__proto__"in Object.create(null));function c(t){return t}function l(t){if(!t)return!1;var e=t.length;if(e<9)return!1;if(95!==t.charCodeAt(e-1)||95!==t.charCodeAt(e-2)||111!==t.charCodeAt(e-3)||116!==t.charCodeAt(e-4)||111!==t.charCodeAt(e-5)||114!==t.charCodeAt(e-6)||112!==t.charCodeAt(e-7)||95!==t.charCodeAt(e-8)||95!==t.charCodeAt(e-9))return!1;for(var a=e-10;a>=0;a--)if(36!==t.charCodeAt(a))return!1;return!0}function h(t,e){return t===e?0:null===t?1:null===e?-1:t>e?1:-1}t.toSetString=o?c:function(t){return l(t)?"$"+t:t},t.fromSetString=o?c:function(t){return l(t)?t.slice(1):t},t.compareByOriginalPositions=function(t,e,a){var s=h(t.source,e.source);return 0!==s||0!==(s=t.originalLine-e.originalLine)||0!==(s=t.originalColumn-e.originalColumn)||a||0!==(s=t.generatedColumn-e.generatedColumn)||0!==(s=t.generatedLine-e.generatedLine)?s:h(t.name,e.name)},t.compareByGeneratedPositionsDeflated=function(t,e,a){var s=t.generatedLine-e.generatedLine;return 0!==s||0!==(s=t.generatedColumn-e.generatedColumn)||a||0!==(s=h(t.source,e.source))||0!==(s=t.originalLine-e.originalLine)||0!==(s=t.originalColumn-e.originalColumn)?s:h(t.name,e.name)},t.compareByGeneratedPositionsInflated=function(t,e){var a=t.generatedLine-e.generatedLine;return 0!==a||0!==(a=t.generatedColumn-e.generatedColumn)||0!==(a=h(t.source,e.source))||0!==(a=t.originalLine-e.originalLine)||0!==(a=t.originalColumn-e.originalColumn)?a:h(t.name,e.name)},t.parseSourceMapInput=function(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(t,e,a){if(e=e||"",t&&("/"!==t[t.length-1]&&"/"!==e[0]&&(t+="/"),e=t+e),a){var o=s(a);if(!o)throw new Error("sourceMapURL could not be parsed");if(o.path){var c=o.path.lastIndexOf("/");c>=0&&(o.path=o.path.substring(0,c+1))}e=r(i(o),e)}return n(e)}}}),Jt=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js"(t){var e=Qt(),a=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;function i(){this._array=[],this._set=s?new Map:Object.create(null)}i.fromArray=function(t,e){for(var a=new i,s=0,n=t.length;s<n;s++)a.add(t[s],e);return a},i.prototype.size=function(){return s?this._set.size:Object.getOwnPropertyNames(this._set).length},i.prototype.add=function(t,i){var n=s?t:e.toSetString(t),r=s?this.has(t):a.call(this._set,n),o=this._array.length;r&&!i||this._array.push(t),r||(s?this._set.set(t,o):this._set[n]=o)},i.prototype.has=function(t){if(s)return this._set.has(t);var i=e.toSetString(t);return a.call(this._set,i)},i.prototype.indexOf=function(t){if(s){var i=this._set.get(t);if(i>=0)return i}else{var n=e.toSetString(t);if(a.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')},i.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)},i.prototype.toArray=function(){return this._array.slice()},t.ArraySet=i}}),Zt=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js"(t){var e=Qt();function a(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}a.prototype.unsortedForEach=function(t,e){this._array.forEach(t,e)},a.prototype.add=function(t){var a,s,i,n,r,o;a=this._last,s=t,i=a.generatedLine,n=s.generatedLine,r=a.generatedColumn,o=s.generatedColumn,n>i||n==i&&o>=r||e.compareByGeneratedPositionsInflated(a,s)<=0?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))},a.prototype.toArray=function(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=a}}),te=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js"(t){var e=qt(),a=Qt(),s=Jt().ArraySet,i=Zt().MappingList;function n(t){t||(t={}),this._file=a.getArg(t,"file",null),this._sourceRoot=a.getArg(t,"sourceRoot",null),this._skipValidation=a.getArg(t,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new i,this._sourcesContents=null}n.prototype._version=3,n.fromSourceMap=function(t){var e=t.sourceRoot,s=new n({file:t.file,sourceRoot:e});return t.eachMapping((function(t){var i={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(i.source=t.source,null!=e&&(i.source=a.relative(e,i.source)),i.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(i.name=t.name)),s.addMapping(i)})),t.sources.forEach((function(i){var n=i;null!==e&&(n=a.relative(e,i)),s._sources.has(n)||s._sources.add(n);var r=t.sourceContentFor(i);null!=r&&s.setSourceContent(i,r)})),s},n.prototype.addMapping=function(t){var e=a.getArg(t,"generated"),s=a.getArg(t,"original",null),i=a.getArg(t,"source",null),n=a.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,s,i,n),null!=i&&(i=String(i),this._sources.has(i)||this._sources.add(i)),null!=n&&(n=String(n),this._names.has(n)||this._names.add(n)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:null!=s&&s.line,originalColumn:null!=s&&s.column,source:i,name:n})},n.prototype.setSourceContent=function(t,e){var s=t;null!=this._sourceRoot&&(s=a.relative(this._sourceRoot,s)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[a.toSetString(s)]=e):this._sourcesContents&&(delete this._sourcesContents[a.toSetString(s)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},n.prototype.applySourceMap=function(t,e,i){var n=e;if(null==e){if(null==t.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}var r=this._sourceRoot;null!=r&&(n=a.relative(r,n));var o=new s,c=new s;this._mappings.unsortedForEach((function(e){if(e.source===n&&null!=e.originalLine){var s=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=s.source&&(e.source=s.source,null!=i&&(e.source=a.join(i,e.source)),null!=r&&(e.source=a.relative(r,e.source)),e.originalLine=s.line,e.originalColumn=s.column,null!=s.name&&(e.name=s.name))}var l=e.source;null==l||o.has(l)||o.add(l);var h=e.name;null==h||c.has(h)||c.add(h)}),this),this._sources=o,this._names=c,t.sources.forEach((function(e){var s=t.sourceContentFor(e);null!=s&&(null!=i&&(e=a.join(i,e)),null!=r&&(e=a.relative(r,e)),this.setSourceContent(e,s))}),this)},n.prototype._validateMapping=function(t,e,a,s){if(e&&"number"!=typeof e.line&&"number"!=typeof e.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0)||e||a||s)&&!(t&&"line"in t&&"column"in t&&e&&"line"in e&&"column"in e&&t.line>0&&t.column>=0&&e.line>0&&e.column>=0&&a))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:a,original:e,name:s}))},n.prototype._serializeMappings=function(){for(var t,s,i,n,r=0,o=1,c=0,l=0,h=0,d=0,u="",p=this._mappings.toArray(),m=0,f=p.length;m<f;m++){if(t="",(s=p[m]).generatedLine!==o)for(r=0;s.generatedLine!==o;)t+=";",o++;else if(m>0){if(!a.compareByGeneratedPositionsInflated(s,p[m-1]))continue;t+=","}t+=e.encode(s.generatedColumn-r),r=s.generatedColumn,null!=s.source&&(n=this._sources.indexOf(s.source),t+=e.encode(n-d),d=n,t+=e.encode(s.originalLine-1-l),l=s.originalLine-1,t+=e.encode(s.originalColumn-c),c=s.originalColumn,null!=s.name&&(i=this._names.indexOf(s.name),t+=e.encode(i-h),h=i)),u+=t}return u},n.prototype._generateSourcesContent=function(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=a.relative(e,t));var s=a.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,s)?this._sourcesContents[s]:null}),this)},n.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},n.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=n}}),ee=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js"(t){function e(a,s,i,n,r,o){var c=Math.floor((s-a)/2)+a,l=r(i,n[c],!0);return 0===l?c:l>0?s-c>1?e(c,s,i,n,r,o):o==t.LEAST_UPPER_BOUND?s<n.length?s:-1:c:c-a>1?e(a,c,i,n,r,o):o==t.LEAST_UPPER_BOUND?c:a<0?-1:a}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(a,s,i,n){if(0===s.length)return-1;var r=e(-1,s.length,a,s,i,n||t.GREATEST_LOWER_BOUND);if(r<0)return-1;for(;r-1>=0&&0===i(s[r],s[r-1],!0);)--r;return r}}}),ae=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(t){function e(t,e,a){var s=t[e];t[e]=t[a],t[a]=s}function a(t,s,i,n){if(i<n){var r=i-1;e(t,(h=i,d=n,Math.round(h+Math.random()*(d-h))),n);for(var o=t[n],c=i;c<n;c++)s(t[c],o)<=0&&e(t,r+=1,c);e(t,r+1,c);var l=r+1;a(t,s,i,l-1),a(t,s,l+1,n)}var h,d}t.quickSort=function(t,e){a(t,e,0,t.length-1)}}}),se=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js"(t){var e=Qt(),a=ee(),s=Jt().ArraySet,i=qt(),n=ae().quickSort;function r(t,a){var s=t;return"string"==typeof t&&(s=e.parseSourceMapInput(t)),null!=s.sections?new l(s,a):new o(s,a)}function o(t,a){var i=t;"string"==typeof t&&(i=e.parseSourceMapInput(t));var n=e.getArg(i,"version"),r=e.getArg(i,"sources"),o=e.getArg(i,"names",[]),c=e.getArg(i,"sourceRoot",null),l=e.getArg(i,"sourcesContent",null),h=e.getArg(i,"mappings"),d=e.getArg(i,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);c&&(c=e.normalize(c)),r=r.map(String).map(e.normalize).map((function(t){return c&&e.isAbsolute(c)&&e.isAbsolute(t)?e.relative(c,t):t})),this._names=s.fromArray(o.map(String),!0),this._sources=s.fromArray(r,!0),this._absoluteSources=this._sources.toArray().map((function(t){return e.computeSourceURL(c,t,a)})),this.sourceRoot=c,this.sourcesContent=l,this._mappings=h,this._sourceMapURL=a,this.file=d}function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function l(t,a){var i=t;"string"==typeof t&&(i=e.parseSourceMapInput(t));var n=e.getArg(i,"version"),o=e.getArg(i,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new s,this._names=new s;var c={line:-1,column:0};this._sections=o.map((function(t){if(t.url)throw new Error("Support for url field in sections not implemented.");var s=e.getArg(t,"offset"),i=e.getArg(s,"line"),n=e.getArg(s,"column");if(i<c.line||i===c.line&&n<c.column)throw new Error("Section offsets must be ordered and non-overlapping.");return c=s,{generatedOffset:{generatedLine:i+1,generatedColumn:n+1},consumer:new r(e.getArg(t,"map"),a)}}))}r.fromSourceMap=function(t,e){return o.fromSourceMap(t,e)},r.prototype._version=3,r.prototype.__generatedMappings=null,Object.defineProperty(r.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),r.prototype.__originalMappings=null,Object.defineProperty(r.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),r.prototype._charIsMappingSeparator=function(t,e){var a=t.charAt(e);return";"===a||","===a},r.prototype._parseMappings=function(t,e){throw new Error("Subclasses must implement _parseMappings")},r.GENERATED_ORDER=1,r.ORIGINAL_ORDER=2,r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.prototype.eachMapping=function(t,a,s){var i,n=a||null;switch(s||r.GENERATED_ORDER){case r.GENERATED_ORDER:i=this._generatedMappings;break;case r.ORIGINAL_ORDER:i=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var o=this.sourceRoot;i.map((function(t){var a=null===t.source?null:this._sources.at(t.source);return{source:a=e.computeSourceURL(o,a,this._sourceMapURL),generatedLine:t.generatedLine,generatedColumn:t.generatedColumn,originalLine:t.originalLine,originalColumn:t.originalColumn,name:null===t.name?null:this._names.at(t.name)}}),this).forEach(t,n)},r.prototype.allGeneratedPositionsFor=function(t){var s=e.getArg(t,"line"),i={source:e.getArg(t,"source"),originalLine:s,originalColumn:e.getArg(t,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],r=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,a.LEAST_UPPER_BOUND);if(r>=0){var o=this._originalMappings[r];if(void 0===t.column)for(var c=o.originalLine;o&&o.originalLine===c;)n.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++r];else for(var l=o.originalColumn;o&&o.originalLine===s&&o.originalColumn==l;)n.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++r]}return n},t.SourceMapConsumer=r,o.prototype=Object.create(r.prototype),o.prototype.consumer=r,o.prototype._findSourceIndex=function(t){var a,s=t;if(null!=this.sourceRoot&&(s=e.relative(this.sourceRoot,s)),this._sources.has(s))return this._sources.indexOf(s);for(a=0;a<this._absoluteSources.length;++a)if(this._absoluteSources[a]==t)return a;return-1},o.fromSourceMap=function(t,a){var i=Object.create(o.prototype),r=i._names=s.fromArray(t._names.toArray(),!0),l=i._sources=s.fromArray(t._sources.toArray(),!0);i.sourceRoot=t._sourceRoot,i.sourcesContent=t._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=t._file,i._sourceMapURL=a,i._absoluteSources=i._sources.toArray().map((function(t){return e.computeSourceURL(i.sourceRoot,t,a)}));for(var h=t._mappings.toArray().slice(),d=i.__generatedMappings=[],u=i.__originalMappings=[],p=0,m=h.length;p<m;p++){var f=h[p],g=new c;g.generatedLine=f.generatedLine,g.generatedColumn=f.generatedColumn,f.source&&(g.source=l.indexOf(f.source),g.originalLine=f.originalLine,g.originalColumn=f.originalColumn,f.name&&(g.name=r.indexOf(f.name)),u.push(g)),d.push(g)}return n(i.__originalMappings,e.compareByOriginalPositions),i},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),o.prototype._parseMappings=function(t,a){for(var s,r,o,l,h,d=1,u=0,p=0,m=0,f=0,g=0,w=t.length,E=0,v={},y={},I=[],D=[];E<w;)if(";"===t.charAt(E))d++,E++,u=0;else if(","===t.charAt(E))E++;else{for((s=new c).generatedLine=d,l=E;l<w&&!this._charIsMappingSeparator(t,l);l++);if(o=v[r=t.slice(E,l)])E+=r.length;else{for(o=[];E<l;)i.decode(t,E,y),h=y.value,E=y.rest,o.push(h);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");v[r]=o}s.generatedColumn=u+o[0],u=s.generatedColumn,o.length>1&&(s.source=f+o[1],f+=o[1],s.originalLine=p+o[2],p=s.originalLine,s.originalLine+=1,s.originalColumn=m+o[3],m=s.originalColumn,o.length>4&&(s.name=g+o[4],g+=o[4])),D.push(s),"number"==typeof s.originalLine&&I.push(s)}n(D,e.compareByGeneratedPositionsDeflated),this.__generatedMappings=D,n(I,e.compareByOriginalPositions),this.__originalMappings=I},o.prototype._findMapping=function(t,e,s,i,n,r){if(t[s]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[s]);if(t[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[i]);return a.search(t,e,n,r)},o.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var e=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var a=this._generatedMappings[t+1];if(e.generatedLine===a.generatedLine){e.lastGeneratedColumn=a.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(t){var a={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},s=this._findMapping(a,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(t,"bias",r.GREATEST_LOWER_BOUND));if(s>=0){var i=this._generatedMappings[s];if(i.generatedLine===a.generatedLine){var n=e.getArg(i,"source",null);null!==n&&(n=this._sources.at(n),n=e.computeSourceURL(this.sourceRoot,n,this._sourceMapURL));var o=e.getArg(i,"name",null);return null!==o&&(o=this._names.at(o)),{source:n,line:e.getArg(i,"originalLine",null),column:e.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}},o.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(t){return null==t})))},o.prototype.sourceContentFor=function(t,a){if(!this.sourcesContent)return null;var s=this._findSourceIndex(t);if(s>=0)return this.sourcesContent[s];var i,n=t;if(null!=this.sourceRoot&&(n=e.relative(this.sourceRoot,n)),null!=this.sourceRoot&&(i=e.urlParse(this.sourceRoot))){var r=n.replace(/^file:\/\//,"");if("file"==i.scheme&&this._sources.has(r))return this.sourcesContent[this._sources.indexOf(r)];if((!i.path||"/"==i.path)&&this._sources.has("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(a)return null;throw new Error('"'+n+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(t){var a=e.getArg(t,"source");if((a=this._findSourceIndex(a))<0)return{line:null,column:null,lastColumn:null};var s={source:a,originalLine:e.getArg(t,"line"),originalColumn:e.getArg(t,"column")},i=this._findMapping(s,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(t,"bias",r.GREATEST_LOWER_BOUND));if(i>=0){var n=this._originalMappings[i];if(n.source===s.source)return{line:e.getArg(n,"generatedLine",null),column:e.getArg(n,"generatedColumn",null),lastColumn:e.getArg(n,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=o,l.prototype=Object.create(r.prototype),l.prototype.constructor=r,l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var a=0;a<this._sections[e].consumer.sources.length;a++)t.push(this._sections[e].consumer.sources[a]);return t}}),l.prototype.originalPositionFor=function(t){var s={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},i=a.search(s,this._sections,(function(t,e){var a=t.generatedLine-e.generatedOffset.generatedLine;return a||t.generatedColumn-e.generatedOffset.generatedColumn})),n=this._sections[i];return n?n.consumer.originalPositionFor({line:s.generatedLine-(n.generatedOffset.generatedLine-1),column:s.generatedColumn-(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(t){return t.consumer.hasContentsOfAllSources()}))},l.prototype.sourceContentFor=function(t,e){for(var a=0;a<this._sections.length;a++){var s=this._sections[a].consumer.sourceContentFor(t,!0);if(s)return s}if(e)return null;throw new Error('"'+t+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(t){for(var a=0;a<this._sections.length;a++){var s=this._sections[a];if(-1!==s.consumer._findSourceIndex(e.getArg(t,"source"))){var i=s.consumer.generatedPositionFor(t);if(i)return{line:i.line+(s.generatedOffset.generatedLine-1),column:i.column+(s.generatedOffset.generatedLine===i.line?s.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},l.prototype._parseMappings=function(t,a){this.__generatedMappings=[],this.__originalMappings=[];for(var s=0;s<this._sections.length;s++)for(var i=this._sections[s],r=i.consumer._generatedMappings,o=0;o<r.length;o++){var c=r[o],l=i.consumer._sources.at(c.source);l=e.computeSourceURL(i.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var h=null;c.name&&(h=i.consumer._names.at(c.name),this._names.add(h),h=this._names.indexOf(h));var d={source:l,generatedLine:c.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(i.generatedOffset.generatedLine===c.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:h};this.__generatedMappings.push(d),"number"==typeof d.originalLine&&this.__originalMappings.push(d)}n(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),n(this.__originalMappings,e.compareByOriginalPositions)},t.IndexedSourceMapConsumer=l}}),ie=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js"(t){var e=te().SourceMapGenerator,a=Qt(),s=/(\r?\n)/,i="$$$isSourceNode$$$";function n(t,e,a,s,n){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==a?null:a,this.name=null==n?null:n,this[i]=!0,null!=s&&this.add(s)}n.fromStringWithSourceMap=function(t,e,i){var r=new n,o=t.split(s),c=0,l=function(){return t()+(t()||"");function t(){return c<o.length?o[c++]:void 0}},h=1,d=0,u=null;return e.eachMapping((function(t){if(null!==u){if(!(h<t.generatedLine)){var e=(a=o[c]||"").substr(0,t.generatedColumn-d);return o[c]=a.substr(t.generatedColumn-d),d=t.generatedColumn,p(u,e),void(u=t)}p(u,l()),h++,d=0}for(;h<t.generatedLine;)r.add(l()),h++;if(d<t.generatedColumn){var a=o[c]||"";r.add(a.substr(0,t.generatedColumn)),o[c]=a.substr(t.generatedColumn),d=t.generatedColumn}u=t}),this),c<o.length&&(u&&p(u,l()),r.add(o.splice(c).join(""))),e.sources.forEach((function(t){var s=e.sourceContentFor(t);null!=s&&(null!=i&&(t=a.join(i,t)),r.setSourceContent(t,s))})),r;function p(t,e){if(null===t||void 0===t.source)r.add(e);else{var s=i?a.join(i,t.source):t.source;r.add(new n(t.originalLine,t.originalColumn,s,e,t.name))}}},n.prototype.add=function(t){if(Array.isArray(t))t.forEach((function(t){this.add(t)}),this);else{if(!t[i]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);t&&this.children.push(t)}return this},n.prototype.prepend=function(t){if(Array.isArray(t))for(var e=t.length-1;e>=0;e--)this.prepend(t[e]);else{if(!t[i]&&"string"!=typeof t)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this},n.prototype.walk=function(t){for(var e,a=0,s=this.children.length;a<s;a++)(e=this.children[a])[i]?e.walk(t):""!==e&&t(e,{source:this.source,line:this.line,column:this.column,name:this.name})},n.prototype.join=function(t){var e,a,s=this.children.length;if(s>0){for(e=[],a=0;a<s-1;a++)e.push(this.children[a]),e.push(t);e.push(this.children[a]),this.children=e}return this},n.prototype.replaceRight=function(t,e){var a=this.children[this.children.length-1];return a[i]?a.replaceRight(t,e):"string"==typeof a?this.children[this.children.length-1]=a.replace(t,e):this.children.push("".replace(t,e)),this},n.prototype.setSourceContent=function(t,e){this.sourceContents[a.toSetString(t)]=e},n.prototype.walkSourceContents=function(t){for(var e=0,s=this.children.length;e<s;e++)this.children[e][i]&&this.children[e].walkSourceContents(t);var n=Object.keys(this.sourceContents);for(e=0,s=n.length;e<s;e++)t(a.fromSetString(n[e]),this.sourceContents[n[e]])},n.prototype.toString=function(){var t="";return this.walk((function(e){t+=e})),t},n.prototype.toStringWithSourceMap=function(t){var a={code:"",line:1,column:0},s=new e(t),i=!1,n=null,r=null,o=null,c=null;return this.walk((function(t,e){a.code+=t,null!==e.source&&null!==e.line&&null!==e.column?(n===e.source&&r===e.line&&o===e.column&&c===e.name||s.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:a.line,column:a.column},name:e.name}),n=e.source,r=e.line,o=e.column,c=e.name,i=!0):i&&(s.addMapping({generated:{line:a.line,column:a.column}}),n=null,i=!1);for(var l=0,h=t.length;l<h;l++)10===t.charCodeAt(l)?(a.line++,a.column=0,l+1===h?(n=null,i=!1):i&&s.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:a.line,column:a.column},name:e.name})):a.column++})),this.walkSourceContents((function(t,e){s.setSourceContent(t,e)})),{code:a.code,map:s}},t.SourceNode=n}}),ne=vt({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js"(t){t.SourceMapGenerator=te().SourceMapGenerator,t.SourceMapConsumer=se().SourceMapConsumer,t.SourceNode=ie().SourceNode}}),re=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"(t,e){t.__esModule=!0;var a,s=It(),i=void 0;try{"function"==typeof define&&define.amd||(a=ne(),i=a.SourceNode)}catch(t){}function n(t,e,a){if(s.isArray(t)){for(var i=[],n=0,r=t.length;n<r;n++)i.push(e.wrap(t[n],a));return i}return"boolean"==typeof t||"number"==typeof t?t+"":t}function r(t){this.srcFile=t,this.source=[]}i||((i=function(t,e,a,s){this.src="",s&&this.add(s)}).prototype={add:function(t){s.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){s.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),r.prototype={isEmpty:function(){return!this.source.length},prepend:function(t,e){this.source.unshift(this.wrap(t,e))},push:function(t,e){this.source.push(this.wrap(t,e))},merge:function(){var t=this.empty();return this.each((function(e){t.add([" ",e,"\n"])})),t},each:function(t){for(var e=0,a=this.source.length;e<a;e++)t(this.source[e])},empty:function(){var t=this.currentLocation||{start:{}};return new i(t.start.line,t.start.column,this.srcFile)},wrap:function(t){var e=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return t instanceof i?t:(t=n(t,this,e),new i(e.start.line,e.start.column,this.srcFile,t))},functionCall:function(t,e,a){return a=this.generateList(a),this.wrap([t,e?"."+e+"(":"(",a,")"])},quotedString:function(t){return'"'+(t+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(t){var e=this,a=[];Object.keys(t).forEach((function(s){var i=n(t[s],e);"undefined"!==i&&a.push([e.quotedString(s),":",i])}));var s=this.generateList(a);return s.prepend("{"),s.add("}"),s},generateList:function(t){for(var e=this.empty(),a=0,s=t.length;a<s;a++)a&&e.add(","),e.add(n(t[a],this));return e},generateArray:function(t){var e=this.generateList(t);return e.prepend("["),e.add("]"),e}},t.default=r,e.exports=t.default}}),oe=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var s=Vt(),i=a(Dt()),n=It(),r=a(re());function o(t){this.value=t}function c(){}c.prototype={nameLookup:function(t,e){return this.internalNameLookup(t,e)},depthedLookup:function(t){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(t),")"]},compilerInfo:function(){var t=s.COMPILER_REVISION;return[t,s.REVISION_CHANGES[t]]},appendToBuffer:function(t,e,a){return n.isArray(t)||(t=[t]),t=this.source.wrap(t,e),this.environment.isSimple?["return ",t,";"]:a?["buffer += ",t,";"]:(t.appendToBuffer=!0,t)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(t,e){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",t,",",JSON.stringify(e),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(t,e,a,s){this.environment=t,this.options=e,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!s,this.name=this.environment.name,this.isChild=!!a,this.context=a||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(t,e),this.useDepths=this.useDepths||t.useDepths||t.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||t.useBlockParams;var n=t.opcodes,r=void 0,o=void 0,c=void 0,l=void 0;for(c=0,l=n.length;c<l;c++)r=n[c],this.source.currentLocation=r.loc,o=o||r.loc,this[r.opcode].apply(this,r.args);if(this.source.currentLocation=o,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new i.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),";\n"]),this.decorators.push("return fn;"),s?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var h=this.createFunctionContext(s);if(this.isChild)return h;var d={compiler:this.compilerInfo(),main:h};this.decorators&&(d.main_d=this.decorators,d.useDecorators=!0);var u=this.context,p=u.programs,m=u.decorators;for(c=0,l=p.length;c<l;c++)p[c]&&(d[c]=p[c],m[c]&&(d[c+"_d"]=m[c],d.useDecorators=!0));return this.environment.usePartial&&(d.usePartial=!0),this.options.data&&(d.useData=!0),this.useDepths&&(d.useDepths=!0),this.useBlockParams&&(d.useBlockParams=!0),this.options.compat&&(d.compat=!0),s?d.compilerOptions=this.options:(d.compiler=JSON.stringify(d.compiler),this.source.currentLocation={start:{line:1,column:0}},d=this.objectLiteral(d),e.srcName?(d=d.toStringWithSourceMap({file:e.destName})).map=d.map&&d.map.toString():d=d.toString()),d},preamble:function(){this.lastContext=0,this.source=new r.default(this.options.srcName),this.decorators=new r.default(this.options.srcName)},createFunctionContext:function(t){var e=this,a="",s=this.stackVars.concat(this.registers.list);s.length>0&&(a+=", "+s.join(", "));var i=0;Object.keys(this.aliases).forEach((function(t){var s=e.aliases[t];s.children&&s.referenceCount>1&&(a+=", alias"+ ++i+"="+t,s.children[0]="alias"+i)})),this.lookupPropertyFunctionIsUsed&&(a+=", "+this.lookupPropertyFunctionVarDeclaration());var n=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&n.push("blockParams"),this.useDepths&&n.push("depths");var r=this.mergeSource(a);return t?(n.push(r),Function.apply(this,n)):this.source.wrap(["function(",n.join(","),") {\n ",r,"}"])},mergeSource:function(t){var e=this.environment.isSimple,a=!this.forceBuffer,s=void 0,i=void 0,n=void 0,r=void 0;return this.source.each((function(t){t.appendToBuffer?(n?t.prepend(" + "):n=t,r=t):(n&&(i?n.prepend("buffer += "):s=!0,r.add(";"),n=r=void 0),i=!0,e||(a=!1))})),a?n?(n.prepend("return "),r.add(";")):i||this.source.push('return "";'):(t+=", buffer = "+(s?"":this.initializeBuffer()),n?(n.prepend("return buffer + "),r.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(s?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(t){var e=this.aliasable("container.hooks.blockHelperMissing"),a=[this.contextName(0)];this.setupHelperArgs(t,0,a);var s=this.popStack();a.splice(1,0,s),this.push(this.source.functionCall(e,"call",a))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var a=this.topStack();e.splice(1,0,a),this.pushSource(["if (!",this.lastHelper,") { ",a," = ",this.source.functionCall(t,"call",e),"}"])},appendContent:function(t){this.pendingContent?t=this.pendingContent+t:this.pendingLocation=this.source.currentLocation,this.pendingContent=t},append:function(){if(this.isInline())this.replaceStack((function(t){return[" != null ? ",t,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var t=this.popStack();this.pushSource(["if (",t," != null) { ",this.appendToBuffer(t,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(t){this.lastContext=t},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(t,e,a,s){var i=0;s||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[i++])),this.resolvePath("context",t,i,e,a)},lookupBlockParam:function(t,e){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(t,e,a){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,a)},resolvePath:function(t,e,a,s,i){var n=this;if(this.options.strict||this.options.assumeObjects)this.push(function(t,e,a,s,i){var n=e.popStack(),r=a.length;t&&r--;for(;s<r;s++)n=e.nameLookup(n,a[s],i);return t?[e.aliasable("container.strict"),"(",n,", ",e.quotedString(a[s]),", ",JSON.stringify(e.source.currentLocation)," )"]:n}(this.options.strict&&i,this,e,a,t));else for(var r=e.length;a<r;a++)this.replaceStack((function(i){var r=n.nameLookup(i,e[a],t);return s?[" && ",r]:[" != null ? ",r," : ",i]}))},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(t,e){this.pushContext(),this.pushString(e),"SubExpression"!==e&&("string"==typeof t?this.pushString(t):this.pushStackLiteral(t))},emptyHash:function(t){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(t?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var t=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(t.ids)),this.stringParams&&(this.push(this.objectLiteral(t.contexts)),this.push(this.objectLiteral(t.types))),this.push(this.objectLiteral(t.values))},pushString:function(t){this.pushStackLiteral(this.quotedString(t))},pushLiteral:function(t){this.pushStackLiteral(t)},pushProgram:function(t){null!=t?this.pushStackLiteral(this.programExpression(t)):this.pushStackLiteral(null)},registerDecorator:function(t,e){var a=this.nameLookup("decorators",e,"decorator"),s=this.setupHelperArgs(e,t);this.decorators.push(["fn = ",this.decorators.functionCall(a,"",["fn","props","container",s])," || fn;"])},invokeHelper:function(t,e,a){var s=this.popStack(),i=this.setupHelper(t,e),n=[];a&&n.push(i.name),n.push(s),this.options.strict||n.push(this.aliasable("container.hooks.helperMissing"));var r=["(",this.itemsSeparatedBy(n,"||"),")"],o=this.source.functionCall(r,"call",i.callParams);this.push(o)},itemsSeparatedBy:function(t,e){var a=[];a.push(t[0]);for(var s=1;s<t.length;s++)a.push(e,t[s]);return a},invokeKnownHelper:function(t,e){var a=this.setupHelper(t,e);this.push(this.source.functionCall(a.name,"call",a.callParams))},invokeAmbiguous:function(t,e){this.useRegister("helper");var a=this.popStack();this.emptyHash();var s=this.setupHelper(0,t,e),i=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",t,"helper")," || ",a,")"];this.options.strict||(i[0]="(helper = ",i.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",i,s.paramsInit?["),(",s.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",s.callParams)," : helper))"])},invokePartial:function(t,e,a){var s=[],i=this.setupParams(e,1,s);t&&(e=this.popStack(),delete i.name),a&&(i.indent=JSON.stringify(a)),i.helpers="helpers",i.partials="partials",i.decorators="container.decorators",t?s.unshift(e):s.unshift(this.nameLookup("partials",e,"partial")),this.options.compat&&(i.depths="depths"),i=this.objectLiteral(i),s.push(i),this.push(this.source.functionCall("container.invokePartial","",s))},assignToHash:function(t){var e=this.popStack(),a=void 0,s=void 0,i=void 0;this.trackIds&&(i=this.popStack()),this.stringParams&&(s=this.popStack(),a=this.popStack());var n=this.hash;a&&(n.contexts[t]=a),s&&(n.types[t]=s),i&&(n.ids[t]=i),n.values[t]=e},pushId:function(t,e,a){"BlockParam"===t?this.pushStackLiteral("blockParams["+e[0]+"].path["+e[1]+"]"+(a?" + "+JSON.stringify("."+a):"")):"PathExpression"===t?this.pushString(e):"SubExpression"===t?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:c,compileChildren:function(t,e){for(var a=t.children,s=void 0,i=void 0,n=0,r=a.length;n<r;n++){s=a[n],i=new this.compiler;var o=this.matchExistingProgram(s);if(null==o){this.context.programs.push("");var c=this.context.programs.length;s.index=c,s.name="program"+c,this.context.programs[c]=i.compile(s,e,this.context,!this.precompile),this.context.decorators[c]=i.decorators,this.context.environments[c]=s,this.useDepths=this.useDepths||i.useDepths,this.useBlockParams=this.useBlockParams||i.useBlockParams,s.useDepths=this.useDepths,s.useBlockParams=this.useBlockParams}else s.index=o.index,s.name="program"+o.index,this.useDepths=this.useDepths||o.useDepths,this.useBlockParams=this.useBlockParams||o.useBlockParams}},matchExistingProgram:function(t){for(var e=0,a=this.context.environments.length;e<a;e++){var s=this.context.environments[e];if(s&&s.equals(t))return s}},programExpression:function(t){var e=this.environment.children[t],a=[e.index,"data",e.blockParams];return(this.useBlockParams||this.useDepths)&&a.push("blockParams"),this.useDepths&&a.push("depths"),"container.program("+a.join(", ")+")"},useRegister:function(t){this.registers[t]||(this.registers[t]=!0,this.registers.list.push(t))},push:function(t){return t instanceof o||(t=this.source.wrap(t)),this.inlineStack.push(t),t},pushStackLiteral:function(t){this.push(new o(t))},pushSource:function(t){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),t&&this.source.push(t)},replaceStack:function(t){var e=["("],a=void 0,s=void 0,n=void 0;if(!this.isInline())throw new i.default("replaceStack on non-inline");var r=this.popStack(!0);if(r instanceof o)e=["(",a=[r.value]],n=!0;else{s=!0;var c=this.incrStack();e=["((",this.push(c)," = ",r,")"],a=this.topStack()}var l=t.call(this,a);n||this.popStack(),s&&this.stackSlot--,this.push(e.concat(l,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var t=this.inlineStack;this.inlineStack=[];for(var e=0,a=t.length;e<a;e++){var s=t[e];if(s instanceof o)this.compileStack.push(s);else{var i=this.incrStack();this.pushSource([i," = ",s,";"]),this.compileStack.push(i)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var e=this.isInline(),a=(e?this.inlineStack:this.compileStack).pop();if(!t&&a instanceof o)return a.value;if(!e){if(!this.stackSlot)throw new i.default("Invalid stack pop");this.stackSlot--}return a},topStack:function(){var t=this.isInline()?this.inlineStack:this.compileStack,e=t[t.length-1];return e instanceof o?e.value:e},contextName:function(t){return this.useDepths&&t?"depths["+t+"]":"depth"+t},quotedString:function(t){return this.source.quotedString(t)},objectLiteral:function(t){return this.source.objectLiteral(t)},aliasable:function(t){var e=this.aliases[t];return e?(e.referenceCount++,e):((e=this.aliases[t]=this.source.wrap(t)).aliasable=!0,e.referenceCount=1,e)},setupHelper:function(t,e,a){var s=[];return{params:s,paramsInit:this.setupHelperArgs(e,t,s,a),name:this.nameLookup("helpers",e,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(s)}},setupParams:function(t,e,a){var s={},i=[],n=[],r=[],o=!a,c=void 0;o&&(a=[]),s.name=this.quotedString(t),s.hash=this.popStack(),this.trackIds&&(s.hashIds=this.popStack()),this.stringParams&&(s.hashTypes=this.popStack(),s.hashContexts=this.popStack());var l=this.popStack(),h=this.popStack();(h||l)&&(s.fn=h||"container.noop",s.inverse=l||"container.noop");for(var d=e;d--;)c=this.popStack(),a[d]=c,this.trackIds&&(r[d]=this.popStack()),this.stringParams&&(n[d]=this.popStack(),i[d]=this.popStack());return o&&(s.args=this.source.generateArray(a)),this.trackIds&&(s.ids=this.source.generateArray(r)),this.stringParams&&(s.types=this.source.generateArray(n),s.contexts=this.source.generateArray(i)),this.options.data&&(s.data="data"),this.useBlockParams&&(s.blockParams="blockParams"),s},setupHelperArgs:function(t,e,a,s){var i=this.setupParams(t,e,a);return i.loc=JSON.stringify(this.source.currentLocation),i=this.objectLiteral(i),s?(this.useRegister("options"),a.push("options"),["options=",i]):a?(a.push(i),""):i}},function(){for(var t="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),e=c.RESERVED_WORDS={},a=0,s=t.length;a<s;a++)e[t[a]]=!0}(),c.isValidJavaScriptVariableName=function(t){return!c.RESERVED_WORDS[t]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(t)},t.default=c,e.exports=t.default}}),ce=vt({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.js"(t,e){function a(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var s=a(Ut()),i=a(jt()),n=Xt(),r=Yt(),o=a(oe()),c=a(Gt()),l=a(Bt()),h=s.default.create;function d(){var t=h();return t.compile=function(e,a){return r.compile(e,a,t)},t.precompile=function(e,a){return r.precompile(e,a,t)},t.AST=i.default,t.Compiler=r.Compiler,t.JavaScriptCompiler=o.default,t.Parser=n.parser,t.parse=n.parse,t.parseWithoutProcessing=n.parseWithoutProcessing,t}var u=d();u.create=d,l.default(u),u.Visitor=c.default,u.default=u,t.default=u,e.exports=t.default}}),le=vt({"../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(t,e){function a(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function s(t,e){for(var a,s="",i=0,n=-1,r=0,o=0;o<=t.length;++o){if(o<t.length)a=t.charCodeAt(o);else{if(47===a)break;a=47}if(47===a){if(n===o-1||1===r);else if(n!==o-1&&2===r){if(s.length<2||2!==i||46!==s.charCodeAt(s.length-1)||46!==s.charCodeAt(s.length-2))if(s.length>2){var c=s.lastIndexOf("/");if(c!==s.length-1){-1===c?(s="",i=0):i=(s=s.slice(0,c)).length-1-s.lastIndexOf("/"),n=o,r=0;continue}}else if(2===s.length||1===s.length){s="",i=0,n=o,r=0;continue}e&&(s.length>0?s+="/..":s="..",i=2)}else s.length>0?s+="/"+t.slice(n+1,o):s=t.slice(n+1,o),i=o-n-1;n=o,r=0}else 46===a&&-1!==r?++r:r=-1}return s}var i={resolve:function(){for(var t,e="",i=!1,n=arguments.length-1;n>=-1&&!i;n--){var r;n>=0?r=arguments[n]:(void 0===t&&(t=process.cwd()),r=t),a(r),0!==r.length&&(e=r+"/"+e,i=47===r.charCodeAt(0))}return e=s(e,!i),i?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(a(t),0===t.length)return".";var e=47===t.charCodeAt(0),i=47===t.charCodeAt(t.length-1);return 0!==(t=s(t,!e)).length||e||(t="."),t.length>0&&i&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return a(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var s=arguments[e];a(s),s.length>0&&(void 0===t?t=s:t+="/"+s)}return void 0===t?".":i.normalize(t)},relative:function(t,e){if(a(t),a(e),t===e)return"";if((t=i.resolve(t))===(e=i.resolve(e)))return"";for(var s=1;s<t.length&&47===t.charCodeAt(s);++s);for(var n=t.length,r=n-s,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var c=e.length-o,l=r<c?r:c,h=-1,d=0;d<=l;++d){if(d===l){if(c>l){if(47===e.charCodeAt(o+d))return e.slice(o+d+1);if(0===d)return e.slice(o+d)}else r>l&&(47===t.charCodeAt(s+d)?h=d:0===d&&(h=0));break}var u=t.charCodeAt(s+d);if(u!==e.charCodeAt(o+d))break;47===u&&(h=d)}var p="";for(d=s+h+1;d<=n;++d)d!==n&&47!==t.charCodeAt(d)||(0===p.length?p+="..":p+="/..");return p.length>0?p+e.slice(o+h):(o+=h,47===e.charCodeAt(o)&&++o,e.slice(o))},_makeLong:function(t){return t},dirname:function(t){if(a(t),0===t.length)return".";for(var e=t.charCodeAt(0),s=47===e,i=-1,n=!0,r=t.length-1;r>=1;--r)if(47===(e=t.charCodeAt(r))){if(!n){i=r;break}}else n=!1;return-1===i?s?"/":".":s&&1===i?"//":t.slice(0,i)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');a(t);var s,i=0,n=-1,r=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var o=e.length-1,c=-1;for(s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(47===l){if(!r){i=s+1;break}}else-1===c&&(r=!1,c=s+1),o>=0&&(l===e.charCodeAt(o)?-1==--o&&(n=s):(o=-1,n=c))}return i===n?n=c:-1===n&&(n=t.length),t.slice(i,n)}for(s=t.length-1;s>=0;--s)if(47===t.charCodeAt(s)){if(!r){i=s+1;break}}else-1===n&&(r=!1,n=s+1);return-1===n?"":t.slice(i,n)},extname:function(t){a(t);for(var e=-1,s=0,i=-1,n=!0,r=0,o=t.length-1;o>=0;--o){var c=t.charCodeAt(o);if(47!==c)-1===i&&(n=!1,i=o+1),46===c?-1===e?e=o:1!==r&&(r=1):-1!==e&&(r=-1);else if(!n){s=o+1;break}}return-1===e||-1===i||0===r||1===r&&e===i-1&&e===s+1?"":t.slice(e,i)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var a=e.dir||e.root,s=e.base||(e.name||"")+(e.ext||"");return a?a===e.root?a+s:a+t+s:s}("/",t)},parse:function(t){a(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var s,i=t.charCodeAt(0),n=47===i;n?(e.root="/",s=1):s=0;for(var r=-1,o=0,c=-1,l=!0,h=t.length-1,d=0;h>=s;--h)if(47!==(i=t.charCodeAt(h)))-1===c&&(l=!1,c=h+1),46===i?-1===r?r=h:1!==d&&(d=1):-1!==r&&(d=-1);else if(!l){o=h+1;break}return-1===r||-1===c||0===d||1===d&&r===c-1&&r===o+1?-1!==c&&(e.base=e.name=0===o&&n?t.slice(1,c):t.slice(o,c)):(0===o&&n?(e.name=t.slice(1,r),e.base=t.slice(1,c)):(e.name=t.slice(o,r),e.base=t.slice(o,c)),e.ext=t.slice(r,c)),o>0?e.dir=t.slice(0,o-1):n&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,e.exports=i}}),he=class{constructor(){this.view={enableDataInfoBar:!0,expCacheMode:"TABEXPPANEL:"},this.grid={editShowMode:"row",editSaveMode:"cell-blur"},this.appMenu={enableEcho:!0},this.codeList={timeout:36e5}}},de=t("RegisterCenter",class{constructor(){this.providers=new Map}register(t,e){this.providers.set(t,e)}unRegister(t){this.providers.delete(t)}get(t,...e){const a=this.providers.get(t);if(a)return a(...e)}}),ue=class{static isHelperName(t){return this.helperNames.includes(t)}static handleJudgmentExecute(t,e,a){return a.fn?e?a.fn(t):a.inverse(t):e?a.hash.yes=!0:a.hash.no=!1}};ue.helperNames=["lookup","log","and","camelCase","concat","eq","gt","get","lowerCase","lt","lte","neq","not","or","pascalCase","pluralize","snakeCase","spinalCase","upperCase"];var pe=class{constructor(t,e){t.registerHelper(e,this.onExecute)}},me=class extends pe{constructor(t){super(t,"and")}onExecute(...t){const e=t[t.length-1];t.pop();const a=t.filter((t=>!!t)).length===t.length;return ue.handleJudgmentExecute(this,a,e)}},fe=class extends pe{constructor(t){super(t,"camelCase")}onExecute(t){return t?S(t):""}},ge=class extends pe{constructor(t){super(t,"concat")}onExecute(...t){return t.pop(),t.join("")}},we=class extends pe{constructor(t){super(t,"eq")}onExecute(t,e,a){const s=x(t,e);return ue.handleJudgmentExecute(this,s,a)}},Ee=class extends pe{constructor(t){super(t,"gt")}onExecute(t,e,a){const s=_(t,e);return ue.handleJudgmentExecute(this,s,a)}},ve=class extends pe{constructor(t){super(t,"gte")}onExecute(t,e,a){const s=T(t,e);return ue.handleJudgmentExecute(this,s,a)}},ye=class extends pe{constructor(t){super(t,"eqPropertyValue")}onExecute(t,e,a,s){let i=!1;return i=A(t)?!x(L(t,(t=>x(t[e],a))),-1):t.hasOwnProperty(e)&&(i=x(t[e],a)),ue.handleJudgmentExecute(this,i,s)}},Ie=class extends pe{constructor(t){super(t,"jsonParse")}onExecute(t){return JSON.parse(t)}},De=class extends pe{constructor(t){super(t,"jsonStringify")}onExecute(t,e){return JSON.stringify(t,null,"number"==typeof e?e:void 0)}},Ce=class extends pe{constructor(t){super(t,"lowerCase")}onExecute(t){return t?t.toLowerCase():""}},Ae=class extends pe{constructor(t){super(t,"lt")}onExecute(t,e,a){const s=N(t,e);return ue.handleJudgmentExecute(this,s,a)}},be=class extends pe{constructor(t){super(t,"lte")}onExecute(t,e,a){const s=O(t,e);return ue.handleJudgmentExecute(this,s,a)}},Pe=class extends pe{constructor(t){super(t,"neq")}onExecute(t,e,a){const s=!x(t,e);return ue.handleJudgmentExecute(this,s,a)}},Se=class extends pe{constructor(t){super(t,"not")}onExecute(t,e){const a=Handlebars.Utils.isEmpty(t);return ue.handleJudgmentExecute(this,a,e)}},xe=class extends pe{constructor(t){super(t,"or")}onExecute(...t){var e;const a=t[t.length-1];t.pop();const s=t.find((t=>!!t));if(a.fn){const t=(null==(e=a.data)?void 0:e.root)||{};return s?a.fn(t):a.inverse(t)}return s||""}},_e=class extends pe{constructor(t){super(t,"pascalCase")}onExecute(t){return t?M(t):""}},Te=class extends pe{constructor(t){super(t,"snakeCase")}onExecute(t){return t?R(t):""}},Le=class extends pe{constructor(t){super(t,"spinalCase")}onExecute(t){return t?V(t):""}},Ne=class extends pe{constructor(t){super(t,"upperCase")}onExecute(t){return t?t.toUpperCase():""}};var Oe=t("HandlebarsUtil",class{constructor(){this.p=null}get isInit(){return!!this.hsb}async init(){var t;if(!this.isInit)return this.p?this.p:(this.p=Promise.resolve().then((()=>yt(ce(),1))),this.hsb=await this.p,this.p=null,t=this.hsb,new me(t),new fe(t),new ge(t),new we(t),new Ee(t),new ve(t),new Ie(t),new De(t),new Ce(t),new Ae(t),new be(t),new Pe(t),new Se(t),new xe(t),new _e(t),new Te(t),new Le(t),new Ne(t),new ye(t),this.hsb)}async render(t,e){this.hsb||await this.init();return this.hsb.compile(t)(e)}syncRender(t,e){if(!this.hsb)throw new Error("handlebars not init");return this.hsb.compile(t)(e)}});function Me(t){const e=[],a=/^%(.+)%$/;for(const s in t){let i=!0,n=t[s];F(t[s])&&a.test(t[s])&&(i=!1,n=t[s].substring(1,t[s].length-1)),e.push({key:s.toLowerCase(),rawValue:i,value:n})}return e}function Re(t,...e){if(!t||D(t))return{};return ke(Array.isArray(t)?t:Me(t),...e)}function Ve(t,e){const a=t.find((t=>!W(t)&&(t[e]||Object.prototype.hasOwnProperty.call(t,e))));return{find:!!a,value:null==a?void 0:a[e]}}function ke(t,...e){const a=/\$\{[^}]*\}/g,s={};for(const i of t)if(i.rawValue)s[i.key.toLowerCase()]=i.value||null;else{const t=i.value.match(a);if(null!==t){let a=i.value;t.forEach((t=>{const{find:s,value:i}=Ve(e,t.slice(2,-1));s&&(a=a.replace(t,"".concat(i)))})),s[i.key.toLowerCase()]=a}else{const{find:t,value:a}=Ve(e,i.value);t&&(s[i.key.toLowerCase()]=a)}}return s}function Fe(t,e){const a={};if(!t)return a;const s=Array.isArray(t)?t:Me(t),i=e[0];return s.forEach((t=>{const{rawValue:s,value:n}=t;!s&&n&&Object.prototype.hasOwnProperty.call(i,n)&&(a[n]=e.map((t=>t[n])).join(";"))})),a}function We(t,e){const{deName:a,navFilter:s,pickupDEFName:i,navContexts:n,navParams:r}=t,{context:o,params:c,data:l,derValue:h}=e,d={},u={},p=h||l.srfkey;p&&(a&&(d[a]=p),s&&(u[s]=p),i&&(u["n_".concat(i.toLowerCase(),"_eq")]=p));const m=Re(n,l,c,o),f=Re(r,l,c,o);return Object.assign(d,m),Object.assign(u,f),{resultContext:d,resultParams:u}}function Be(t,e){if(t){const a=t.find((t=>t.id===e));if(a)return a}return null}function Ue(t){const e={},a={},s={};for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];if(-1!==i.indexOf(".")){const t=i.split(".");switch(t[0]){case"SRFNAVPARAM":Object.assign(e,{[t[1]]:n});break;case"SRFNAVCTX":Object.assign(a,{[t[1]]:n});break;default:Object.assign(s,{key:n})}}}return{navigateContexts:e,navigateParams:a,other:s}}function je(t){const{width:e,height:a,widthMode:s,heightMode:i}=t,n={width:"",height:""};return"FULL"===s?n.width="100%":e&&e>0&&(n.width=e>0&&e<=1?"".concat(100*e,"%"):"".concat(e,"PERCENTAGE"===s?"%":"px")),"FULL"===i?n.height="100%":a&&a>0&&(n.height=a>0&&a<=1?"".concat(100*a,"%"):"".concat(a,"PERCENTAGE"===i?"%":"px")),n}function ze(t,e){const a=[],s=ga.execScriptFn({data:e},t,{singleRowReturn:!0,isAsync:!1});return C(s)?a.push(s):A(s)?a.push(...s):b(s)&&Object.keys(s).forEach((t=>{s[t]&&a.push(t)})),a}function Ge(t,e){const{mainStateAppDEFieldIds:a,demainStates:s}=t;if(a&&s){const t=[];return a.forEach((a=>{t.push(e[a])})),s.find((e=>{const{stateValue:a,state2Value:s,state3Value:i}=e;let n=!0;const r=[a,s,i];for(let e=0;e<t.length;e++)if("".concat(t[e])!=="".concat(r[e])){n=!1;break}return n}))}}function He(t,e){const a=ibiz.hub.getApp().model,{demainStateOPPrivs:s,opprivAllowMode:i}=t,n=(null==s?void 0:s.map((t=>t.name)))||[];let r=[];if(i)r=n;else{r=[...a.deopprivs,...e.deopprivs].filter((t=>!n.includes(t.name))).map((t=>t.name))}return r}function Ke(t){return t.split(".").pop()}function Xe(t,e){const a=Ke(e);return F(t[a])}async function Ye(t){return(await ibiz.hub.getAppDataEntity(t)).formTypeAppDEFieldId}function $e(t,e){var a;return null==(a=e.appDELogics)?void 0:a.find((e=>e.id===t))}function qe(t,e){var a,s;const i=[];return null==(a=t.appDEFields)||a.forEach((t=>{"compute"===e&&t.computeAppDEFLogicId?i.push(t.computeAppDEFLogicId):"change"===e&&t.onChangeAppDEFLogicId?i.push(t.onChangeAppDEFLogicId):"default"===e&&t.defaultValueAppDEFLogicId&&i.push(t.defaultValueAppDEFLogicId)})),(null==(s=t.appDELogics)?void 0:s.filter((t=>i.includes(t.id))))||[]}function Qe(t,e){var a;return null==(a=t.appDEFields)?void 0:a.find((t=>t.id===e))}async function Je(t){const[,,e]=t.split("@");return ibiz.hub.getApp(e).getUIAction(t)}function Ze(t){return t.detreeNodes.find((t=>t.rootNode))}function ta(t,e){return t.detreeNodes.find((t=>t.id===e))}function ea(t,e){const a=e.parentId||Ze(t).id;return t.detreeNodeRSs.filter((t=>{return t.parentDETreeNodeId===a&&(s=t.searchMode,i=e.hasQuery,3===s||(i?1===s:2===s));var s,i}))}function aa(t,e){var a;return null==(a=t.degridEditItems)?void 0:a.find((t=>t.codeName===e))}function sa(t){let e;switch(t.detailType){case"TABPANEL":e=t.deformTabPages;break;case"FORMPAGE":case"TABPAGE":case"GROUPPANEL":e=t.deformDetails}return e||[]}function ia(t){const{viewLayoutPanel:e}=t,a=t.controls||[];return e&&a.push(...e.controls||[]),a}function na(t){const{viewLayoutPanel:e}=t,a=t.appViewLogics||[];return e&&a.push(...e.appViewLogics||[]),a}function ra(t){const{viewLayoutPanel:e}=t,a=t.appViewEngines||[];return e&&a.push(...e.appViewEngines||[]),a}async function oa(t,e,s={},i={}){return async function(t,e,s={},i={}){var n;const r=t.appViewNavContexts||[],o=Re(r,s,e);e=Object.assign(e.clone(),o);const c=t.appViewNavParams||[],l=Re(c,s,e);Object.assign(s,l);const h=t.appDataEntityId,d=Ke(h);let u=(null==(n=i.data)?void 0:n[0])||{};e[d]=u[d]||e[d]||s[d];const p=t.getDataAppDEActionId,m=ibiz.hub.getApp(t.appId),f=await m.deService.getService(h);ibiz.loading.showRedirect();try{const t=await f.exec(p||"get",e,s);if(t.ok){u=t.data;let a=u.linkurl;if(a)return e.srfprocessinstanceid&&(a+=";srfprocessinstanceid=".concat(e.srfprocessinstanceid)),ibiz.env.dev&&-1!==a.indexOf("appredirectview?")&&(a=a.slice(a.indexOf("appredirectview?"))),a.startsWith("http://")||a.startsWith("https://")?new Promise((t=>{const e=window.open(a,"_blank");e&&(e.callback=()=>{t({ok:!0,data:[]})})})):a.startsWith("appredirectview?")?(await ca(e,a,i),{ok:!0,data:[]}):{ok:!1,data:[]}}}finally{ibiz.loading.hideRedirect()}const g=await ibiz.hub.getAppDataEntity(h,t.appId),w=await async function(t,e,a,s){let i="";const n=e.typeAppDEFieldId;if(n){const{codeName:a}=Qe(t,n),i=s[a.toLowerCase()];if(F(i))return"".concat(i);ibiz.log.warn("重定向视图[".concat(e.name,"]自定义类别属性[").concat(n,"]值为空"),s)}const r="".concat(ibiz.env.isMob?"MOB":"","EDITVIEW"),o=a.srfwf;if(F(o))return F(a.wf)?"".concat(r,":").concat(o.toUpperCase(),":").concat(a.wf.toUpperCase()):"".concat(r,":").concat(o.toUpperCase());let c="";if(t.indexTypeAppDEFieldId){const{codeName:e}=Qe(t,t.indexTypeAppDEFieldId);c=s[e.toLowerCase()]}if(W(c)&&t.formTypeAppDEFieldId){const{codeName:e}=Qe(t,t.formTypeAppDEFieldId);c=s[e.toLowerCase()]}i=F(c)?"".concat(r,":").concat(c.toString().toUpperCase()):"".concat(r);return i}(g,t,s,u),E=w.split(":"),v=2===E.length?w:E.slice(0,2).join(":"),y="".concat(g.name.toUpperCase(),":").concat(w),I=t.redirectAppViewRefs,D=null==I?void 0:I.find((t=>{const e=t.name||t.id;return e===y||e===w||e===v}));if(!D)throw ibiz.log.error("重定向视图引用有:",null==I?void 0:I.map((({refAppViewId:t,name:e,realTitle:a})=>({viewId:t,tag:e,title:a})))),new a(t,"未找到重定向标识[".concat(w,"]或[").concat(y,"]或工作流[").concat(v,"]对应视图"));{const t=D.refAppViewId;if(!t)throw new a(D,"未配置实际引用视图");{const a=await ibiz.commands.execute(Mi.TAG,t,e,s,{...i,data:[u]});if(a)return a}}return{ok:!0,data:[]}}(t,e,s,i)}async function ca(t,a,s={}){const i=a.lastIndexOf("?"),n=decodeURIComponent(a.substring(i+1,a.length)),r=q.parse(n,{delimiter:";"}),o=r.srfdename||"";if(!o)throw new e("重定向参数缺少实体名称");const c=ibiz.hub.getApp(t.srfappid).deName2DeCodeName.get(o.toUpperCase());if(!c)throw new e("未找到指定实体的codeName: ".concat(o));r[c.toLowerCase()]=r[o.toLowerCase()];const l="".concat(c).concat(ibiz.env.isMob?"Mob":"","RedirectView"),h=await ibiz.hub.getAppView(l);if(delete r.srfdename,"undo"!==r.srfwf){const t=r.processDefinitionKey.split("-")[3],e=t.substring(0,t.lastIndexOf("v")),a=t.substring(t.lastIndexOf("v"));r.wf=e,r.wfVersion=a}r.srfprocessinstanceid&&(t.srfprocessinstanceid=r.srfprocessinstanceid,delete r.srfprocessinstanceid),await ibiz.commands.execute(Mi.TAG,h.id,t,r,s)}function la(t,a,s){if(Object.is(a,"IN"))return ua(t,s);if(Object.is(a,"NOTIN"))return!ua(t,s);switch(a){case"EQ":return"".concat(t)==="".concat(s);case"NOTEQ":return"".concat(t)!=="".concat(s);case"LT":return ha(t,s)<0;case"LTANDEQ":return ha(t,s)<=0;case"GT":return ha(t,s)>0;case"GTANDEQ":return ha(t,s)>=0;case"ISNULL":return W(t);case"ISNOTNULL":return F(t);case"TESTNULL":return Q(t);case"IN":return ua(t,s);case"NOTIN":return!ua(t,s);case"LIKE":return pa(t,s);case"LEFTLIKE":return pa(t,s,"start");case"RIGHTLIKE":return pa(t,s,"end");default:throw new e("值操作:".concat(a,",暂未支持"))}}function ha(t,a){const s=Number(t),i=Number(a);if(!Number.isNaN(s)&&!Number.isNaN(i))return da(s,i);const n=new Date(t).getTime(),r=new Date(a).getTime();if(!Number.isNaN(n)&&!Number.isNaN(r))return da(n,r);throw new e("".concat(t," 和 ").concat(a," 无法比较大小"))}function da(t,e){return Number.isNaN(t)&&(t=0),Number.isNaN(e)&&(e=0),t>e?1:t<e?-1:0}function ua(t,a){if(!a||"string"!=typeof a)throw new e("范围比较的条件值不存或者不是字符串");if(t){return a.split(",").includes("".concat(t))}return!1}function pa(t,e,a){if(!t||!e)return!1;const s="".concat(t).toUpperCase(),i="".concat(e).toUpperCase(),n=s.indexOf(i);switch(a){case"start":return 0===n;case"end":return n+i.length===s.length;default:return-1!==n}}var ma={singleRowReturn:!1,isAsync:!0},fa=t("ScriptFunction",class{constructor(t,e,a=ma){this.argKeys=[],this.options=a;const s=this.formatCode(e,a);this.calcArgKeys(t,a);const i=new Function(...this.argKeys,s);this.scriptFn=function(...t){return i.apply({},t)}}formatCode(t,e){let a=t;return e.singleRowReturn&&(a="return (".concat(a,")")),e.isAsync&&(a="return (async function() { ".concat(a,"} )();")),a}calcArgKeys(t,e){const a=e.presetParams?Object.keys(e.presetParams):[];a.push(...t);a.push("document","el","selector","env","appSession","topViewSession","viewSession","context","viewParam","activeData","data","app","topView","parentView","view","parent","util"),this.argKeys=Array.from(new Set(a))}convertArgs(t){const{presetParams:e}=this.options,a=e?J(e,t):t;a.document=document,a.selector=t=>document.getElementsByClassName(t);const s=[];return this.argKeys.forEach((t=>{void 0===a[t]&&this.fillDefaultParams(t,a),s.push(a[t])})),s}fillDefaultParams(t,e){const a=e.view;switch(t){case"util":e.util={message:ibiz.message,notification:ibiz.notification,modal:ibiz.modal,confirm:ibiz.confirm,openView:ibiz.openView};break;case"viewParam":e.viewParam=e.params;break;case"env":e.env=ibiz.env;break;case"app":e.app=ibiz.hub.controller;break;case"parent":e.parent=null==a?void 0:a.parentView;break;case"topView":e.topView=null==a?void 0:a.getTopView();break;case"parentView":e.parentView=null==a?void 0:a.parentView;break;case"topViewSession":e.topViewSession=null==a?void 0:a.getTopView().session;break;case"viewSession":e.viewSession=null==a?void 0:a.session;break;case"appSession":e.appSession=ibiz.hub.controller.session}}exec(t){const e=this.convertArgs(t);return this.scriptFn(...e)}}),ga=t("ScriptFactory",class{static createScriptFn(t,e,a){return new fa(t,e,a)}static execScriptFn(t,e,a){return this.createScriptFn(Object.keys(t),e,a).exec(t)}});function wa(t,a,s){const i={isPast:!0,infoMessage:s.ruleInfo};if(function(t){return"GROUP"===t.condType}(s)){const e=s.conds;e&&e.length>0&&(i.isPast=function(t,e,a="AND",s=!1){if(!((null==t?void 0:t.length)>0))return!1;let i="AND"===a;for(let s=0,n=t.length;s<n;s++){const n=e(t[s],s);if("AND"===a){if(!n){i=!1;break}}else if("OR"===a&&n){i=!0;break}}return s?!i:i}(e,(e=>{const{isPast:s,infoMessage:n}=wa(t,a,e);return i.infoMessage=n,s}),s.condOp,!!s.notMode),!i.isPast&&("AND"===s.condOp&&s.notMode||"OR"===s.condOp&&!s.notMode)&&(i.infoMessage=s.ruleInfo))}else{t=(null==s?void 0:s.defname.toLowerCase())||t;try{if(function(t){return"SIMPLE"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){Object.is(n,"CURTIME")&&(s="".concat(new Date));if(Object.is(n,"ENTITYFIELD")){s=r[s=s?s.toLowerCase():""]?r[s]:s}(Q(i)||Z(i))&&(i="内容必须符合值规则");const c=la(t,a,s);if(!c&&o)throw new e(i);return!c}(a[t],s.condOp,s.paramValue,s.ruleInfo,s.paramType,a,s.keyCond);else if(function(t){return"VALUERANGE2"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){W(r)&&(r="值必须符合值范围规则");if(W(t)){if(o)throw new e("值为空");return r="值为空",!0}if(Ea(t,/^-?\d*\.?\d+$/,"",o))return!0;const c=Number.parseFloat(t);if(null!==a)if(s){if(c<a){if(o)throw new e(r);return!0}}else if(c<=a){if(o)throw new e(r);return!0}if(null!=i)if(n){if(c>i){if(o)throw new e(r);return!0}}else if(c>=i){if(o)throw new e(r);return!0}return r="",!1}(a[t],s.minValue,s.includeMinValue,s.maxValue,s.includeMaxValue,s.ruleInfo,s.keyCond);else if(function(t){return"REGEX"===t.condType}(s))i.isPast=!Ea(a[t],s.regExCode,s.ruleInfo,s.keyCond);else if(function(t){return"STRINGLENGTH"===t.condType}(s))i.isPast=!function(t,a,s,i,n,r,o){W(r)&&(r="内容长度必须符合范围规则");if(W(t)){if(o)throw new e("值为空");return r="值为空",!0}const c=t.length;if(null!==a)if(s){if(c<a){if(o)throw new e(r);return!0}}else if(c<=a){if(o)throw new e(r);return!0}if(null!==i)if(n){if(c>i){if(o)throw new e(r);return!0}}else if(c>=i){if(o)throw new e(r);return!0}return r="",!1}(a[t],s.minValue,s.includeMinValue,s.maxValue,s.includeMaxValue,s.ruleInfo,s.keyCond);else if(function(t){return"SYSVALUERULE"===t.condType}(s)&&(null==s?void 0:s.sysValueRule)){const{ruleType:n,regExCode:r,scriptCode:o,ruleInfo:c}=s.sysValueRule;if(i.infoMessage=s.ruleInfo||c,"REG"===n)i.isPast=!Ea(a[t],r,i.infoMessage,s.keyCond);else if("SCRIPT"===n){const{isPast:n,infoMessage:r}=function(t,a,s,i,n){W(i)&&(i="值必须符合脚本规则");const r=a;let o="",c=!0;const l=t=>{c=!1,(null==t?void 0:t.length)>0?t.forEach((t=>{(null==t?void 0:t.message)&&(o+=t.message)})):(null==t?void 0:t.message)&&(o=t.message)};try{const e=ga.execScriptFn({value:t,data:r},s,{isAsync:!1});"boolean"==typeof e&&(c=e)}catch(t){ibiz.log.error(t),l(t)}if(i="",!c&&n)throw new e(i);return{isPast:c,infoMessage:o||i}}(a[t],a,o,i.infoMessage,s.keyCond);i.isPast=n,i.infoMessage=r||i.infoMessage}}}catch(t){i.isPast=!1}i.isPast=s.notMode?!i.isPast:i.isPast}return i}function Ea(t,a,s,i){W(s)&&(s="值必须符合正则规则");if(W(t)){if(i)throw new e("值为空");return s="值为空",!0}if(!new RegExp(a).test(t)){if(i)throw new e(s);return!0}return s="",!1}function va(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const s=e.defdlogics;if(!s||0===s.length)throw new a(e,"发现空逻辑组,逻辑无法正常执行!");let i=!0;if("AND"===e.groupOP){i=void 0===s.find((e=>!va(t,e)))}else if("OR"===e.groupOP){i=void 0!==e.defdlogics.find((e=>va(t,e)))}return e.notMode?!i:i}if(function(t){return"SINGLE"===t.logicType}(e))return la(t[e.defdname.toLowerCase()],e.condOP,e.value);throw new s(e,"未支持的逻辑类型".concat(e.logicType))}function ya(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const s=e.panelItemLogics;if(!s||0===s.length)throw new a(e,"发现空逻辑组,逻辑无法正常执行!");let i=!0;if("AND"===e.groupOP){i=void 0===s.find((e=>!ya(t,e)))}else if("OR"===e.groupOP){i=void 0!==e.panelItemLogics.find((e=>ya(t,e)))}return e.notMode?!i:i}if(function(t){return"SINGLE"===t.logicType}(e))return la(t[e.dstModelField.toLowerCase()],e.condOp,e.value);throw new s(e,"未支持的逻辑类型".concat(e.logicType))}var Ia=t("LayoutPanelUtil",class{constructor(){this.cache=new Map}register(t,e){this.cache.set(t,e)}get(t){return this.cache.get(t)}fill(t){const{viewLayoutPanel:e}=t;if(!e||!0===e.useDefaultLayout){const e=this.calcLayoutTag(t);if(this.cache.has(e)){const a=tt(this.cache.get(e));t.viewLayoutPanel=a,t.appCounterRefs&&(a.appCounterRefs=t.appCounterRefs,delete t.appCounterRefs),t.appViewEngines&&(a.appViewEngines=t.appViewEngines,delete t.appViewEngines),t.appViewLogics&&(a.appViewLogics=t.appViewLogics,delete t.appViewLogics),t.appViewRefs&&(a.appViewRefs=t.appViewRefs,delete t.appViewRefs),t.controls&&(a.controls=t.controls,delete t.controls)}}return t}calcLayoutTag(t){const{viewType:e,viewStyle:a}=t;return"APPINDEXVIEW"===e?this.calcIndexViewLayoutTag(t):"".concat(e,"_").concat(a)}calcIndexViewLayoutTag(t){const{viewType:e,viewStyle:a,blankMode:s,mainMenuAlign:i}=t;let n="";return s?n="BLANK_MODE":i&&(n=i.toUpperCase()),""!==n?"".concat(e,"_").concat(a,"_").concat(n):"".concat(e,"_").concat(a)}});function Da(t){const e={};return t.param09&&(e.srfprocessinstanceid=t.param09),e}var Ca=t("ControlType",(t=>(t.APP_MENU="APPMENU",t.GRID="GRID",t.FORM="FORM",t.SEARCHFORM="SEARCHFORM",t.TOOLBAR="TOOLBAR",t.DRBAR="DRBAR",t.VIEWPANEL="VIEWPANEL",t.PICKUP_VIEW_PANEL="PICKUPVIEWPANEL",t.DATAVIEW="DATAVIEW",t.TREEGRID="TREEGRID",t.WF_EXPBAR="WFEXPBAR",t.TREEVIEW="TREEVIEW",t.TREE_EXP_BAR="TREEEXPBAR",t.TAB_VIEWPANEL="TABVIEWPANEL",t.DRTAB="DRTAB",t.CHART="CHART",t.REPORT_PANEL="REPORTPANEL",t.LIST="LIST",t.MOB_MDCTRL="MOBMDCTRL",t.MULTI_EDIT_VIEWPANEL="MULTIEDITVIEWPANEL",t.WIZARD_PANEL="WIZARDPANEL",t.UPDATE_PANEL="UPDATEPANEL",t.SEARCHBAR="SEARCHBAR",t.DASHBOARD="DASHBOARD",t.CALENDAR="CALENDAR",t.PANEL="PANEL",t.VIEW_LAYOUT_PANEL="VIEWLAYOUTPANEL",t.MAP="MAP",t.GANTT="GANTT",t.TREE_GRIDEX="TREEGRIDEX",t.KANBAN="KANBAN",t.CALENDAR_EXPBAR="CALENDAREXPBAR",t.CHART_EXPBAR="CHARTEXPBAR",t.DATA_VIEW_EXPBAR="DATAVIEWEXPBAR",t.GANTT_EXPBAR="GANTTEXPBAR",t.GRID_EXPBAR="GRIDEXPBAR",t.LIST_EXPBAR="LISTEXPBAR",t.MAP_EXPBAR="MAPEXPBAR",t.STATE_WIZARD_PANEL="STATEWIZARDPANEL",t.TAB_EXP_PANEL="TABEXPPANEL",t.CUSTOM="CUSTOM",t.CAPTIONBAR="CAPTIONBAR",t))(Ca||{})),Aa=t("ViewType",(t=>(t.APP_INDEX_VIEW="APPINDEXVIEW",t.DE_GRID_VIEW="DEGRIDVIEW",t.DE_EDIT_VIEW="DEEDITVIEW",t.APP_DATA_UPLOAD_VIEW="APPDATAUPLOADVIEW",t.APP_ERROR_VIEW="APPERRORVIEW",t.APP_FILE_UPLOAD_VIEW="APPFILEUPLOADVIEW",t.APP_FUN_PICKUP_VIEW="APPFUNCPICKUPVIEW",t.APP_LOGIN_VIEW="APPLOGINVIEW",t.APP_LOGOUT_VIEW="APPLOGOUTVIEW",t.APP_PANEL_VIEW="APPPANELVIEW",t.APP_PIC_UPLOAD_VIEW="APPPICUPLOADVIEW",t.APP_PORTAL_VIEW="APPPORTALVIEW",t.APP_REDIRECT_VIEW="APPREDIRECTVIEW",t.APP_START_VIEW="APPSTARTVIEW",t.APP_WELCOME_VIEW="APPWELCOMEVIEW",t.APP_WF_ADD_STEP_AFTER_VIEW="APPWFADDSTEPAFTERVIEW",t.APP_WF_ADD_STEP_BEFORE_VIEW="APPWFADDSTEPBEFOREVIEW",t.APP_WF_REDIRECT_VIEW="APPWFREDIRECTVIEW",t.APP_WF_SENDBAC_VIEW="APPWFSENDBACKVIEW",t.APP_WF_STEP_ACTOR_VIEW="APPWFSTEPACTORVIEW",t.APP_WF_STEP_DATA_VIEW="APPWFSTEPDATAVIEW",t.APP_WF_STEP_TRACE_VIEW="APPWFSTEPTRACEVIEW",t.APP_WF_SUPPLY_INFO_VIEW="APPWFSUPPLYINFOVIEW",t.APP_WF_TAKE_ADVICE_VIEW="APPWFTAKEADVICEVIEW",t.DE_CALENDAR_EXP_VIEW="DECALENDAREXPVIEW",t.DE_CALENDAR_VIEW="DECALENDARVIEW",t.DE_CHART_EXP_VIEW="DECHARTEXPVIEW",t.DE_CHART_VIEW="DECHARTVIEW",t.DE_CHART_VIEW9="DECHARTVIEW9",t.DE_CUSTOM_VIEW="DECUSTOMVIEW",t.DE_DATA_VIEW="DEDATAVIEW",t.DE_DATA_VIEW9="DEDATAVIEW9",t.DE_DATAVIEW_EXP_VIEW="DEDATAVIEWEXPVIEW",t.DE_EDIT_VIEW2="DEEDITVIEW2",t.DE_EDIT_VIEW3="DEEDITVIEW3",t.DE_EDIT_VIEW4="DEEDITVIEW4",t.DE_EDIT_VIEW9="DEEDITVIEW9",t.DE_FORM_PICKUP_DATA_VIEW="DEFORMPICKUPDATAVIEW",t.DE_GANTT_EXP_VIEW="DEGANTTEXPVIEW",t.DE_GANTT_VIEW="DEGANTTVIEW",t.DE_GANTT_VIEW9="DEGANTTVIEW9",t.DE_GRID_EXP_VIEW="DEGRIDEXPVIEW",t.DE_GRID_VIEW2="DEGRIDVIEW2",t.DE_GRID_VIEW4="DEGRIDVIEW4",t.DE_GRID_VIEW8="DEGRIDVIEW8",t.DE_GRID_VIEW9="DEGRIDVIEW9",t.DE_HTML_VIEW="DEHTMLVIEW",t.DE_INDEX_PICKUP_DATA_VIEW="DEINDEXPICKUPDATAVIEW",t.DE_INDEX_VIEW="DEINDEXVIEW",t.DE_KANBAN_VIEW="DEKANBANVIEW",t.DE_KANBAN_VIEW9="DEKANBANVIEW9",t.DE_LIST_EXP_VIEW="DELISTEXPVIEW",t.DE_LIST_VIEW="DELISTVIEW",t.DE_LIST_VIEW9="DELISTVIEW9",t.DE_MAP_EXP_VIEW="DEMAPEXPVIEW",t.DE_MAP_VIEW="DEMAPVIEW",t.DE_MAP_VIEW9="DEMAPVIEW9",t.DE_MD_CUSTOM_VIEW="DEMDCUSTOMVIEW",t.DE_MEDITVIEW9="DEMEDITVIEW9",t.DE_MOB_CALENDAR_EXP_VIEW="DEMOBCALENDAREXPVIEW",t.DE_MOB_CALENDAR_VIEW="DEMOBCALENDARVIEW",t.DE_MOB_CALENDAR_VIEW9="DEMOBCALENDARVIEW9",t.DE_MOB_CHART_EXP_VIEW="DEMOBCHARTEXPVIEW",t.DE_MO_BCHART_VIEW="DEMOBCHARTVIEW",t.D_EMOB_CHART_VIEW9="DEMOBCHARTVIEW9",t.DE_MOB_CUSTOM_VIEW="DEMOBCUSTOMVIEW",t.DE_MOB_DATA_VIEW="DEMOBDATAVIEW",t.DE_MOB_DATA_VIEW_EXP_VIEW="DEMOBDATAVIEWEXPVIEW",t.DE_MOB_EDIT_VIEW="DEMOBEDITVIEW",t.DE_MOB_EDIT_VIEW3="DEMOBEDITVIEW3",t.DE_MOB_EDITVIEW9="DEMOBEDITVIEW9",t.DE_MOB_FORM_PICKUP_MDVIEW="DEMOBFORMPICKUPMDVIEW",t.DE_MOB_GANTT_EXP_VIEW="DEMOBGANTTEXPVIEW",t.DE_MOB_GANTT_VIEW="DEMOBGANTTVIEW",t.DE_MOB_GANTT_VIEW9="DEMOBGANTTVIEW9",t.DE_MOB_HTML_VIEW="DEMOBHTMLVIEW",t.DE_MOB_INDEX_PICKUP_MDVIEW="DEMOBINDEXPICKUPMDVIEW",t.DE_MOB_LIST_EXP_VIEW="DEMOBLISTEXPVIEW",t.DE_MOB_LIST_VIEW="DEMOBLISTVIEW",t.DE_MOB_MAP_VIEW="DEMOBMAPVIEW",t.DE_MOB_MAP_VIEW9="DEMOBMAPVIEW9",t.DE_MOB_MDVIEW="DEMOBMDVIEW",t.DE_MOB_MDVIEW9="DEMOBMDVIEW9",t.DE_MOB_MEDIT_VIEW9="DEMOBMEDITVIEW9",t.DE_MOB_MPICKUP_VIEW="DEMOBMPICKUPVIEW",t.DE_MOB_OPT_VIEW="DEMOBOPTVIEW",t.DE_MOB_PANEL_VIEW="DEMOBPANELVIEW",t.DE_MOB_PANEL_VIEW9="DEMOBPANELVIEW9",t.DE_MOB_PICKUP_LIST_VIEW="DEMOBPICKUPLISTVIEW",t.DE_MOB_PICKUP_MDVIEW="DEMOBPICKUPMDVIEW",t.DE_MOB_PICKUP_TREE_VIEW="DEMOBPICKUPTREEVIEW",t.DE_MOB_PICKUP_VIEW="DEMOBPICKUPVIEW",t.DE_MOB_PORTAL_VIEW="DEMOBPORTALVIEW",t.DE_MOB_PORTAL_VIEW9="DEMOBPORTALVIEW9",t.DE_MOB_REDIRECT_VIEW="DEMOBREDIRECTVIEW",t.DE_MOB_REPORT_VIEW="DEMOBREPORTVIEW",t.DE_MOB_TAB_EXP_VIEW="DEMOBTABEXPVIEW",t.DE_MOB_TAB_EXP_VIEW9="DEMOBTABEXPVIEW9",t.DE_MOB_TAB_SEARCH_VIEW="DEMOBTABSEARCHVIEW",t.DE_MOB_TAB_SEARCH_VIEW9="DEMOBTABSEARCHVIEW9",t.DE_MOB_TREE_EXP_VIEW="DEMOBTREEEXPVIEW",t.DEMOBTREEEXPVIEW9="DEMOBTREEEXPVIEW9",t.DE_MOB_TREE_VIEW="DEMOBTREEVIEW",t.DE_MOB_WFACTION_VIEW="DEMOBWFACTIONVIEW",t.DE_MOB_WF_DATA_REDIRECT_VIEW="DEMOBWFDATAREDIRECTVIEW",t.DE_MOB_WF_DYNAACTIO_NVIEW="DEMOBWFDYNAACTIONVIEW",t.DE_MOB_WFDYNA_EDIT_VIEW="DEMOBWFDYNAEDITVIEW",t.DE_MOB_WF_DYNA_EDIT_VIEW3="DEMOBWFDYNAEDITVIEW3",t.DE_MOB_WF_DYNA_EXP_MDVIEW="DEMOBWFDYNAEXPMDVIEW",t.DE_MO_BWF_DYNA_START_VIEW="DEMOBWFDYNASTARTVIEW",t.DE_MOB_WF_EDIT_VIEW="DEMOBWFEDITVIEW",t.DE_MOB_WF_EDIT_VIEW3="DEMOBWFEDITVIEW3",t.DE_MOB_WF_MDVIEW="DEMOBWFMDVIEW",t.DE_MOB_WF_PROXY_RESULT_VIEW="DEMOBWFPROXYRESULTVIEW",t.DE_MOB_WF_PROXY_START_VIEW="DEMOBWFPROXYSTARTVIEW",t.DE_MOB_WF_START_VIEW="DEMOBWFSTARTVIEW",t.DE_MOB_WIZARD_VIEW="DEMOBWIZARDVIEW",t.DE_MPICKUP_VIEW="DEMPICKUPVIEW",t.DE_MPICKUP_VIEW2="DEMPICKUPVIEW2",t.DE_OPT_VIEW="DEOPTVIEW",t.DE_PANEL_VIEW="DEPANELVIEW",t.DE_PANEL_VIEW9="DEPANELVIEW9",t.DE_PICKUP_DATA_VIEW="DEPICKUPDATAVIEW",t.DE_PICKUP_GRID_VIEW="DEPICKUPGRIDVIEW",t.DE_PICKUP_TREE_VIEW="DEPICKUPTREEVIEW",t.DE_PICKUP_VIEW="DEPICKUPVIEW",t.DE_PICKUP_VIEW2="DEPICKUPVIEW2",t.DE_PICK_UP_VIEW3="DEPICKUPVIEW3",t.DE_PORTAL_VIEW="DEPORTALVIEW",t.DE_PORTAL_VIEW9="DEPORTALVIEW9",t.DE_REDIRECT_VIEW="DEREDIRECTVIEW",t.DE_REPORT_VIEW="DEREPORTVIEW",t.DE_TAB_EXP_VIEW="DETABEXPVIEW",t.DE_TAB_EXP_VIEW9="DETABEXPVIEW9",t.DE_TAB_SEARCH_VIEW="DETABSEARCHVIEW",t.DE_TAB_SEARCH_VIEW9="DETABSEARCHVIEW9",t.DE_TREE_EXP_VIEW="DETREEEXPVIEW",t.DE_TREE_EXP_VIEW2="DETREEEXPVIEW2",t.DE_TREE_EXP_VIEW3="DETREEEXPVIEW3",t.DE_TREE_GRID_EXVIEW="DETREEGRIDEXVIEW",t.DE_TREE_GRID_EXVIEW9="DETREEGRIDEXVIEW9",t.DE_TREE_GRID_VIEW="DETREEGRIDVIEW",t.DE_TREE_GRID_VIEW9="DETREEGRIDVIEW9",t.DE_TREE_VIEW="DETREEVIEW",t.DE_TREE_VIEW9="DETREEVIEW9",t.DE_WF_ACTION_VIEW="DEWFACTIONVIEW",t.DE_WF_DATA_REDIRECT_VIEW="DEWFDATAREDIRECTVIEW",t.DE_WF_DYNA_ACTION_VIEW="DEWFDYNAACTIONVIEW",t.DE_WF_DYNA_EDIT_VIEW="DEWFDYNAEDITVIEW",t.DE_WF_DYNA_EDIT_VIEW3="DEWFDYNAEDITVIEW3",t.DE_WF_DYNA_EXP_GRID_VIEW="DEWFDYNAEXPGRIDVIEW",t.DE_WF_DYNA_START_VIEW="DEWFDYNASTARTVIEW",t.DE_WF_EDIT_PROXY_DATA_VIEW="DEWFEDITPROXYDATAVIEW",t.DE_WF_EDIT_VIEW="DEWFEDITVIEW",t.DE_WF_EDIT_VIEW2="DEWFEDITVIEW2",t.DE_WF_EDIT_VIEW3="DEWFEDITVIEW3",t.DE_WF_EDIT_VIEW9="DEWFEDITVIEW9",t.DE_WF_EXP_VIEW="DEWFEXPVIEW",t.DE_WF_GRID_VIEW="DEWFGRIDVIEW",t.DE_WF_PROXY_DATA_VIEW="DEWFPROXYDATAVIEW",t.DE_WF_PROXY_RESULT_VIEW="DEWFPROXYRESULTVIEW",t.DE_WF_PROXY_START_VIEW="DEWFPROXYSTARTVIEW",t.DE_WF_START_VIEW="DEWFSTARTVIEW",t.DE_WIZARD_VIEW="DEWIZARDVIEW",t))(Aa||{})),ba=t("ViewMode",(t=>(t.ROUTE="ROUTE",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t.POPOVER="POPOVER",t))(ba||{})),Pa=t("SysUIActionTag",(t=>(t.NEW="New",t.EDIT="Edit",t.REFRESH="Refresh",t.EXIT="Exit",t.SAVE_AND_EXIT="SaveAndExit",t.SAVE_AND_NEW="SaveAndNew",t.SAVE="Save",t.SAVE_ROW="SaveRow",t.REMOVE="Remove",t.REMOVE_AND_EXIT="RemoveAndExit",t.NEW_ROW="NewRow",t.TOGGLE_FILTER="ToggleFilter",t.IMPORT="Import",t.EXPORT_EXCEL="ExportExcel",t.SAVE_AND_START="SaveAndStart",t.VIEW_WF_STEP="ViewWFStep",t.NO="No",t.YES="Yes",t.CANCEL="Cancel",t.OK="Ok",t.SEARCH="Search",t.FINISH="Finish",t.NEXT_STEP="NextStep",t.PREV_STEP="PrevStep",t.ADD_SELECTION="AddSelection",t.REMOVE_SELECTION="RemoveSelection",t.REMOVE_ALL="RemoveAll",t.ADD_ALL="AddAll",t.LOGOUT="Logout",t.LOGIN="Login",t.CANCEL_CHANGES="CancelChanges",t.COPY="Copy",t.VIEW="View",t.TOGGLE_ROW_EDIT="ToggleRowEdit",t.REFRESH_ALL="RefreshAll",t.REFRESH_PARENT="RefreshParent",t.LOAD_MORE="LoadMore",t))(Pa||{})),Sa=t("ViewCallTag",(t=>(t.LOAD="Load",t.GET_DATA="GetData",t.GET_ALL_DATA="GetAllData",t.VALIDATE="Validate",t.TOGGLE_COLLAPSE="ToggleCollapse",t))(Sa||{})),xa=t("ValueOP",(t=>(t.EQ="EQ",t.NOT_EQ="NOTEQ",t.GT="GT",t.GT_AND_EQ="GTANDEQ",t.LT="LT",t.LT_AND_EQ="LTANDEQ",t.IS_NULL="ISNULL",t.IS_NOT_NULL="ISNOTNULL",t.IN="IN",t.NOT_IN="NOTIN",t.LIKE="LIKE",t.LIFT_LIKE="LIFTLIKE",t.RIGHT_LIKE="RIGHT_LIKE",t.CHILD_OF="CHILDOF",t.USER_LIKE="USERLIKE",t.BIT_AND="BITAND",t.EXISTS="EXISTS",t.NOT_EXISTS="NOTEXISTS",t))(xa||{})),_a=t("StudioViewEvents",class{});_a.onViewMounted="onMounted",_a.onViewDestroyed="onDestroyed";var Ta=t("StudioPanelEvents",class{});Ta.onClick="onClick",Ta.onChange="onChange",Ta.onEnter="onEnter",Ta.onLeave="onLeave";var La=t("StudioControlEvents",class{});La.onBeforeLoad="onBeforeLoad",La.onLoadSuccess="onLoadSuccess",La.onLoadError="onLoadError",La.onBeforeLoadDraft="onBeforeLoadDraft",La.onLoadDraftSuccess="onLoadDraftSuccess",La.onLoadDraftError="onLoadDraftError",La.onBeforeSave="onBeforeSave",La.onSaveSuccess="onSaveSuccess",La.onSaveError="onSaveError",La.onBeforeRemove="onBeforeRemove",La.onRemoveSuccess="onRemoveSuccess",La.onRemoveError="onRemoveError",La.CLICK="onClick";var Na=t("Modal",class{constructor(t){this.mode="EMBED",this.viewUsage=4,this.ignoreDismissCheck=!1,this.hooks={shouldDismiss:new B,beforeDismiss:new B},this._dismiss=t=>{ibiz.log.error("外部关闭能力未注册",t)},t.mode&&(this.mode=t.mode),t.routeDepth&&(this.routeDepth=t.routeDepth),t.viewUsage&&(this.viewUsage=t.viewUsage),t.dismiss&&(this._dismiss=t.dismiss)}injectDismiss(t){this._dismiss=t}async dismiss(t={ok:!1,data:[]}){const e={allowClose:!0};return!0!==this.ignoreDismissCheck&&await this.hooks.shouldDismiss.call(e),e.allowClose?(await this.hooks.beforeDismiss.call(t),this._dismiss(t),this.destroy(),!0):(ibiz.log.debug("shouldDismiss结果为false,关闭中断。"),!1)}destroy(){this.hooks.shouldDismiss.clear(),this.hooks.beforeDismiss.clear()}});function Oa(t,e){return t.filter((t=>{const{checkMode:a}=t,s=t.deformItemName||t.degridEditItemName;return 2!==a&&s===e}))}var Ma=t("TextUtil",class{constructor(){this.inputElement=null}format(t,e){return t}copy(t){return this.inputElement||(this.inputElement=document.createElement("input"),this.inputElement.style.position="absolute",this.inputElement.style.left="-9999px",document.body.appendChild(this.inputElement)),this.inputElement.value=t,this.inputElement.select(),document.execCommand("copy")}}),Ra=t("RawValueUtil",class{isNumber(t){return/^-?\d+(\.\d+)?$/.test(t)}format(t){let e=t;return void 0!==t&&("true"===t||"false"===t?e="true"===t:this.isNumber(t)&&(e=parseFloat(t))),e}});async function Va(t,e=!0){const a=await Promise.allSettled(t),s=[],i=[];if(a.forEach((t=>{"fulfilled"===t.status?s.push(t.value):i.push(t.reason)})),i.length>0){const t=1===i.length?i[0]:i;if(e)throw t;ibiz.util.error.handle(t)}return s}var ka=class{constructor(){this.psModelGroupCondBase=null}parse(t){if(t instanceof Array){const e=this.createPSModelGroupCond();e.parse(t),this.psModelGroupCondBase=e}}testSingleCond(t,e,a){try{if("ISNULL"===t)return null==e;if("ISNOTNULL"===t)return null!=e;if("EQ"===t||"ABSEQ"===t||"GT"===t||"GTANDEQ"===t||"LT"===t||"LTANDEQ"===t||"NOTEQ"===t){let s=-1;if(e==a?s=0:e>a&&(s=1),"EQ"===t||"ABSEQ"===t)return 0===s;if("GT"===t)return s>0;if("GTANDEQ"===t)return s>=0;if("LT"===t)return s<0;if("LTANDEQ"===t)return s<=0;if("NOTEQ"===t)return 0!==s}if("LIKE"===t)return null!=e&&null!=a&&-1!==e.toString().toUpperCase().indexOf(a.toString().toUpperCase());if("LEFTLIKE"===t)return null!=e&&null!=a&&0===e.toString().toUpperCase().indexOf(a.toString().toUpperCase())}catch(t){ibiz.log.error(t)}return!1}getPSModelGroupCondBase(){return this.psModelGroupCondBase}},Fa=class{constructor(){this.strCondOp=null}getCondOp(){return this.strCondOp}setCondOp(t){this.strCondOp=t}},Wa=class extends Fa{parse(t){const e=t.length;let a=!0,s=!1,i=!1;for(let n=0;n<e;n++)if(a){const e=t[n];this.setCondOp(e),a=!1,s=!0}else if(s){const e=t[n];this.setParam(e),s=!1,i=!0}else if(i){const e=t[n];if(e instanceof Object&&!(e instanceof Array)){const t=e;null!=t.type&&this.setValueType(t.type.toString()),null!=t.value&&this.setValue(t.value.toString())}else this.setValue(e);break}}getValueType(){return this.strValueType}setValueType(t){this.strValueType=t}getValue(){return this.strValue}setValue(t){this.strValue=t}getParamType(){return this.strParamType}setParamType(t){this.strParamType=t}getParam(){return this.strParam}setParam(t){this.strParam=t}},Ba=class t extends Fa{constructor(){super(...arguments),this.childCondList=[],this.bNotMode=!1}parse(a){const s=a.length;let i=!0,n=!0,r=!1;for(let o=0;o<s;o++){if(i&&n){if("!"===a[o]){this.setNotMode(!0),i=!1;continue}}if(n){const t=a[o];this.setCondOp(t),n=!1,i=!1,r=!0}else if(r){const s=a[o];if(!(s instanceof Array))throw new e("值必须为数组");s.forEach((e=>{if(e.length>0){const a=e[0].toString();if("!"===a||"OR"===a||"AND"===a){const a=new t;a.parse(e),this.childCondList.push(a)}else{const t=new Wa;t.parse(e),this.childCondList.push(t)}}}))}}}setNotMode(t){this.bNotMode=t}isNotMode(){return this.bNotMode}getChildPSModelCondBases(){return this.childCondList}},Ua=class extends Ba{},ja=class extends Wa{},za=class t extends ka{test(t,e){return this.testCond(this.getPSModelGroupCondBase(),t,e)}testCond(e,a,s){if(e instanceof Ba){const t=e.getChildPSModelCondBases();if(null==t||Z(t))return!e.isNotMode();const i="AND"===e.getCondOp();let n=i;for(let e=0;e<t.length;e++){const r=t[e];if(this.testCond(r,a,s)){if(!i){n=!0;break}}else if(i){n=!1;break}}return e.isNotMode()?!n:n}if(e instanceof Wa){Z(e.getParam())&&ibiz.log.warn("没有指定属性名称",e);const i=a[e.getParam().toLowerCase()];let n=null;const r=e.getValueType(),o=e.getValue();return null==r||Z(r)?n=e.getValue():(Z(o)&&ibiz.log.warn("没有指定上下文参数名称"),t.PARAMTYPE_WEBCONTEXT===r?n=s.data[o.toLowerCase()]:t.PARAMTYPE_DATACONTEXT===r&&(n=s.getValue(o.toLowerCase()))),this.testSingleCond(e.getCondOp(),i,n)}return ibiz.log.warn("无法识别的条件对象",e),!1}createPSModelSingleCond(){return new ja}createPSModelGroupCond(){return new Ua}};za.PARAMTYPE_DATACONTEXT="DATACONTEXT",za.PARAMTYPE_WEBCONTEXT="WEBCONTEXT";var Ga=t("PSDEDQCondEngine",za);async function Ha(t,e){var a;const s=null==(a=ibiz.hub.getApp(e).model.appPFPluginRefs)?void 0:a.find((e=>e.pluginCode.toLowerCase()===t));if(s)return await ibiz.plugin.loadPlugin(s),"".concat(s.pluginType,"_").concat(s.pluginCode);ibiz.log.error("找不到".concat(t,"的插件模型"))}var Ka=t("CONTROL_PROVIDER_PREFIX","CONTROL");function Xa(t){return ibiz.register.get("".concat(Ka,"_").concat(t))}async function Ya(t){let e;const{controlType:a,controlStyle:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ha(i,n);if(t&&(e=Xa(t)),e)return e;ibiz.log.error("找不到部件插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=Xa("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到部件类型:[".concat(a,"]的部件样式:[").concat(s,"]对应的适配器"),t)}if(e=Xa(a),e)return e;"DATAINFOBAR"!==a&&ibiz.log.error("找不到部件类型".concat(a,"对应的适配器"))}var $a=t("EDITOR_PROVIDER_PREFIX","EDITOR");function qa(t){return ibiz.register.get("".concat($a,"_").concat(t))}async function Qa(t){let e;const{editorType:a,editorStyle:s,predefinedType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await Ha(n,r);if(t&&(e=qa(t)),e)return e;ibiz.log.error("找不到编辑器插件".concat(t,"对应的适配器"))}if(s&&"DEFAULT"!==s){if(e=qa("".concat(a,"_").concat(s)),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(a,"]的编辑器样式:[").concat(s,"]对应的适配器"),t)}if(i){let n="".concat(i,"_").concat(a);if(s&&"DEFAULT"!==s&&(n+="_".concat(s)),e=qa(n),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(a,"]的预置类型:[").concat(i,"]对应的适配器"),t)}if(e=qa(a),e)return e;ibiz.log.error("找不到编辑器类型".concat(a,"对应的适配器"))}var Ja=t("FORMDETAIL_PROVIDER_PREFIX","FORMDETAIL");function Za(t){return ibiz.register.get("".concat(Ja,"_").concat(t))}async function ts(t){let e;const{detailType:a,sysPFPluginId:s,appId:i}=t;if(s){const t=await Ha(s,i);if(t&&(e=Za(t)),e)return e;ibiz.log.error("找不到表单成员插件".concat(t,"对应的适配器"))}if(e=Za(a),e)return e;ibiz.log.error("找不到表单成员类型".concat(a,"对应的适配器"))}var es=t("GRIDCOLUMN_PROVIDER_PREFIX","GRIDCOLUMN");function as(t){return ibiz.register.get("".concat(es,"_").concat(t))}async function ss(t){let e;const{columnType:a,enableRowEdit:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ha(i,n);if(t&&(e=as(t)),e)return e;ibiz.log.error("找不到表格列插件".concat(t,"对应的适配器"))}const r=s?"".concat(a,"_EDIT"):a;if(e=as(r),e)return e;ibiz.log.error("找不到表格列类型".concat(r,"对应的适配器"))}var is=t("PANELITEM_PROVIDER_PREFIX","PANELITEM");function ns(t){return ibiz.register.get("".concat(is,"_").concat(t.toUpperCase()))}async function rs(t){var e;let a;const{itemType:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ha(i,n);if(t&&(a=ns(t)),a)return a;ibiz.log.error("找不到面板成员插件".concat(t,"对应的适配器"))}if("CONTAINER"===s){const e=t.predefinedType||"DEFAULT";if(a=ns("CONTAINER_".concat(e)),a)return a;ibiz.log.error("找不到面板容器预置类型为".concat(e,"的适配器"))}if("RAWITEM"===s){const s=(null==(e=t.rawItem)?void 0:e.predefinedType)||"DEFAULT";if(a=ns("RAWITEM_".concat(s)),a)return a;ibiz.log.error("找不到面板成员直接内容预置类型为".concat(s,"的适配器"))}if(a=ns(s),a)return a;ibiz.log.error("找不到面板成员类型".concat(s,"对应的适配器"))}var os=t("UIACTION_PROVIDER_PREFIX","UIACTION");function cs(t,e){ibiz.register.register("".concat(os,"_").concat(t),e)}function ls(t){return ibiz.register.get("".concat(os,"_").concat(t))}async function hs(t){let a;const{uiactionMode:s,sysPFPluginId:i,appId:n}=t;if(i){const t=await Ha(i,n);if(t&&(a=ls(t)),a)return a;ibiz.log.error("找不到界面行为插件".concat(t,"对应的适配器"))}if(a=ls(s),a)return a;throw new e("找不界面行为模式".concat(s,"对应的适配器"))}var ds=t("VIEW_PROVIDER_PREFIX","VIEW");function us(t){return ibiz.register.get("".concat(ds,"_").concat(t))}var ps=t("PORTLET_PROVIDER_PREFIX","PORTLET");function ms(t){return ibiz.register.get("".concat(ps,"_").concat(t))}async function fs(t){let e;const{portletType:a,sysPFPluginId:s,appId:i}=t;if(s){const t=await Ha(s,i);if(t&&(e=ms(t)),e)return e;ibiz.log.error("找不到门户部件插件".concat(t,"对应的适配器"))}if(e=ms(a),e)return e;ibiz.log.error("找不到门户部件成员类型".concat(a,"对应的适配器"))}var gs=t("APP_COUNTER_PROVIDER_PREFIX","APPCOUNTER");function ws(t,e){ibiz.register.register("".concat(gs,"_").concat(t),e)}function Es(t){return ibiz.register.get("".concat(gs,"_").concat(t))}async function vs(t){let a;const{codeName:s,counterType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await Ha(n,r);if(t&&(a=Es(t)),a)return a;ibiz.log.error("找不到系统计数器插件".concat(t,"对应的适配器"))}if("CUSTOM"===i){if(a=Es(s),a)return a;throw new e("找不到自定义系统计数器".concat(s,"对应的适配器"))}if(a=Es(i),a)return a;throw new e("找不系统计数器类型".concat(i,"对应的适配器"))}var ys=t("AppCounter",class{constructor(t){this.model=t,this.destroyed=!1,this.context=i.create(),this.params={},this.evt=new U,this.data={}}get isDestroyed(){return this.destroyed}async init(t,e){this.setParams(t,e),this.interval(),await this.load()}setParams(t,e){t&&(this.context=tt(t)),e&&(this.params=tt(e))}interval(){this.destroyInterval(),this.intervalTimer=setInterval((()=>{this.evt.getSize("change")>0&&this.load()}),this.model.timer||6e3)}destroyInterval(){this.intervalTimer&&(clearInterval(this.intervalTimer),this.intervalTimer=null)}async load(){throw new e("未实现计数器加载方法")}refresh(t,e){return this.setParams(t,e),this.load()}onChange(t,e=!0){this.evt.on("change",t),e&&F(this.data)&&t(this.data)}offChange(t){this.evt.off("change",t)}getCounter(t){return this.data[t.toLowerCase()]||0}destroy(){this.destroyed=!0,this.context.destroy(),this.destroyInterval(),this.evt.reset()}}),Is=t("AppDECounter",class extends ys{async init(t,e){this.appDataEntityId=this.model.appDataEntityId;const s=this.model.getAppDEActionId;if(!s)throw new a(this.model,"未找到获取计数器行为!");this.action=s,await super.init(t,e)}async load(){const t=ibiz.hub.getApp(this.context.srfappid),e=await t.deService.exec(this.appDataEntityId,this.action,this.context,this.params);return e.ok&&(this.data=e.data,this.evt.emit("change",this.data)),this.data}}),Ds=t("AppDECounterProvider",class{createCounter(t){return new Is(t)}});function Cs(){ws("DEDR",(()=>new Ds))}t("DEDQCondUtil",class{static getCond(t){if(this.map.has(t))return this.map.get(t);const e=t.dedqgroupConditions;if(e){const a=new Ga;return a.parse(["OR",this.calcCond(e)]),this.map.set(t,a),a}return null}static calcCond(t){const e=[];return t.forEach((t=>{const a=[];if("GROUP"===t.condType){const e=t;e.notMode&&a.push("!"),a.push(t.condOp);const s=e.dedqconditions;if(s){const t=this.calcCond(s);a.push(t)}}else{if("SINGLE"!==t.condType)throw new s(t,"暂未支持的查询条件类型: ".concat(t.condType));{const e=t;a.push(e.fieldName),e.condValue||a.push("")}}e.push(a)})),e}}).map=new WeakMap;var As=t("DynamicCodeListCache",class{constructor(t){this.cache=new Map,this.isPredefined=!1,this.codeList=t}async init(){return this.initPromise=(async()=>{const{predefinedType:t}=this.codeList;if(t){if(this.isPredefined=!0,!["OPERATOR","RUNTIME"].includes(t))throw new s(this.codeList,"预定义类型".concat(t,"暂不支持"))}else this.initPromise=void 0})(),this.initPromise}convertData(t){const e={},{valueAppDEFieldId:a,textAppDEFieldId:s}=this.codeList,i=a?t[a]:t.srfkey;return e.id=i,e.value=i,e.text=s?t[s]:t.srfmajortext,Object.freeze(e)}async load(t={},e={}){const s=ibiz.hub.getApp(t.srfappid);if(e.size||(e={...e,size:1e4}),this.isPredefined){const t=await s.net.get("/dictionaries/codelist/".concat(this.codeList.codeName),e);return Object.freeze(t.data.items)}const{appDataEntityId:i,appDEDataSetId:n}=this.codeList;if(!i)throw new a(this.codeList,"未配置应用实体");if(!n)throw new a(this.codeList,"未配置数据集");const r=await s.deService.exec(i,n,t,{},e);let o=[];return r.data.length&&(o=r.data.map((t=>this.convertData(t)))),o}async get(t={},e={}){if(this.initPromise&&await this.initPromise,!this.codeList.enableCache)return this.load(t,e);const a=JSON.stringify(t)+JSON.stringify(e);if(this.cache.has(a)){const t=this.cache.get(a);if(t.expirationTime>(new Date).getTime())return t.promise?t.promise:t.items;this.cache.delete(a)}const s=this.load(t,e),{cacheTimeout:i}=this.codeList,n=-1===i||Q(i)?ibiz.config.codeList.timeout:this.codeList.cacheTimeout,r={expirationTime:(new Date).getTime()+n,promise:s};this.cache.set(a,r);const o=await s;return r.items=o,delete r.promise,o}});function bs(t,a){if(null!=a){const{srfkey:t}=a;if(!Q(t)&&!Z(t))return!0}throw new e("执行「".concat(t,"」不存在「srfkey」无法处理"))}function Ps(t,a){const{srfsessionid:s}=a;if(!Q(s)&&!Z(s))return!0;throw new e("执行「".concat(t,"」不存在「srfsessionid」无法处理"))}var Ss=t("DECache",class{constructor(){this.cacheMap=new Map}forceAdd(t,e){const a=this.getCacheByTag(t).get(e.srfkey);a&&(a.assign(e),ibiz.log.warn("forceAdd",e.srfkey,e))}forceUpdate(t,e){this.getCacheByTag(t).set(e.srfkey,tt(e)),ibiz.log.warn("forceUpdate",e.srfkey,e)}forceDelete(t,e){this.getCacheByTag(t).delete(e),ibiz.log.warn("forceDelete",e)}add(t,e){try{Ps("add",t),(Q(e.srfkey)||Z(e.srfkey))&&(e.srfkey=j()),e.srftempdate=(new Date).getTime();return this.getCacheByTag(t).set(e.srfkey,tt(e)),ibiz.log.warn("add",e.srfkey,e),e}catch(t){return ibiz.log.error(t),null}}get(t,e){try{Ps("get",t);const a=this.getCacheByTag(t).get(e);return ibiz.log.warn("get",e,a),tt(a)}catch(t){return ibiz.log.error(t),null}}update(t,e){try{Ps("update",t),bs("update",e),e.srftempdate=(new Date).getTime();const a=this.getCacheByTag(t),s=a.get(e.srfkey);if(s)return s.assign(e),a.set(e.srfkey,s),ibiz.log.warn("update",e.srfkey,e),tt(s);throw new Error("数据不存在,无法更新!")}catch(t){return ibiz.log.error(t),null}}delete(t,e){try{Ps("delete",t);const a=this.getCacheByTag(t),s=e;if(a.has(s)){const t=a.get(s);return t.srftempdate=(new Date).getTime(),a.delete(s),ibiz.log.warn("delete",s),t}return null}catch(t){return ibiz.log.error(t),null}}createBatch(t,e){try{Ps("add",t);const a=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const s=e[t];(Q(s.srfkey)||Z(s.srfkey))&&(s.srfkey=j()),s.srftempdate=(new Date).getTime();const i=tt(s);a.set(s.srfkey,i),e[t]=i,ibiz.log.warn("add",s.srfkey,s)}return e}catch(t){ibiz.log.error(t)}return[]}updateBatch(t,e){try{Ps("update",t);const a=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const s=e[t];bs("update",s),s.srftempdate=(new Date).getTime();const i=a.get(s.srfkey);if(!i)throw new Error("数据[".concat(s.srfdename,"-").concat(s.srfmajortext,"(").concat(s.srfkey,")]不存在,无法更新!"));i.assign(s),a.set(s.srfkey,i),ibiz.log.warn("update",s.srfkey,s),e[t]=tt(i)}return e}catch(t){return ibiz.log.error(t),null}}deleteBatch(t,e){try{Ps("delete",t)}catch(t){return ibiz.log.error(t),e}const a=this.getCacheByTag(t),s=[];for(let t=0;t<e.length;t++){const i=e[t];a.has(i)||s.push(i)}if(s.length>0)throw new Error("未找到以下数据「".concat(s.join("、"),"」,无法删除!"));for(let t=0;t<e.length;t++){const s=e[t];a.delete(s),ibiz.log.warn("delete",s)}return[]}checkData(t,e){return-1!==this.getList(t).findIndex((t=>t.srfkey===e))}getList(t){try{Ps("getList",t);const e=this.getCacheByTag(t);if(!e)return[];const a=e.values();return Array.from(a)}catch(t){return ibiz.log.error(t),[]}}generatePred(t={}){const e={};t.srfkey&&(e.srfkey=et(t.srfkey)),delete t.srfkey;for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)){const s=t[a];e[a]=et(s)}return at(e)}clear(t){const e=t.srfsessionid;this.cacheMap.size>0&&this.cacheMap.delete(e)}getCacheByTag(t){const e=t.srfsessionid;return this.cacheMap.has(e)||this.cacheMap.set(e,new Map),this.cacheMap.get(e)}}),xs=new RegExp("(?<=\\$\\{)(.*?)(?=\\})","g");function _s(t,e){const a=(e.requestPaths||[]).map((t=>({path:t,keys:t.match(xs)||[]}))).filter((e=>{const{keys:a}=e;return 0===a.length||a.every(((e,s)=>s===a.length-1||null!=t[e]))})).sort(((t,e)=>e.keys.length-t.keys.length));if(a.length>0)return a[0]}function Ts(t,e){const a=_s(t,e);if(a){if(a.keys.length>0){let{path:e}=a;return a.keys.forEach(((s,i)=>{e=i===a.keys.length-1?e.replace(new RegExp("/[^/]+/\\$\\{".concat(s,"\\}")),""):e.replace("${".concat(s,"}"),t[s])})),e}return a.path}return""}var Ls=t("SearchFilter",class{constructor(t,e){if(this.page=0,this.size=1e3,this.data={},this.sortField="srfordervalue",this.sortMode="ASC",this.context=t,e){if(Q(e.page)||Z(e.page)||(this.page=e.page),Q(e.size)||Z(e.size)||(this.size=e.size),Q(e.query)||Z(e.query)||(this.query=e.query),!Q(e.sort)&&!Z(e.sort)){const t=e.sort.split(",");t.length>=1&&([this.sortField]=t),t.length>=2&&(this.sortMode=t[1].toUpperCase())}Q(e.srfparentkey)||Z(e.srfparentkey)||(this.srfparentkey=e.srfparentkey),Q(e.srfparentdename)||Z(e.srfparentdename)||(this.srfparentdename=e.srfparentdename),this.data={...e},delete this.data.page,delete this.data.size,delete this.data.query,delete this.data.sort,delete this.data.srfparentkey,delete this.data.srfparentdename}}getValue(t){return this.data[t]?this.data[t]:this.context[t]}}),Ns=t("CodeListService",class{constructor(t){this.appModel=t,this.allCodeLists=new Map,this.cache=new Map}getStatic(t){const e=t.codeName;if(this.cache.has(e))return this.cache.get(e);const a=t.codeItems;let s=[];return(null==a?void 0:a.length)&&(s=this.formatStaticItems(a,t.codeItemValueNumber)),this.cache.set(e,Object.freeze(s)),s}setCodeList(t){const{id:e,codeName:a}=t;this.allCodeLists.set(e,t),this.allCodeLists.set(a,t)}getCodeList(t){return this.allCodeLists.get(t)}formatStaticItems(t,e){return t.map((t=>{var a;let s=t.text;t.textLanguageRes&&(s=ibiz.i18n.t(t.textLanguageRes.lanResTag,t.text));const i={text:s,value:e?Number(t.value):t.value,color:t.color,id:t.codeName,textCls:t.textCls,disableSelect:t.disableSelect};return(null==(a=t.codeItems)?void 0:a.length)&&(i.children=this.formatStaticItems(t.codeItems,e)),Object.freeze(i)}))}async getDynamicCodeList(t,e={},a={}){let s;const i=t.codeName;return this.cache.has(i)?s=this.cache.get(i):(s=new As(t),this.cache.set(i,s),await s.init()),s.get(e,a)}async get(t,a,s){const i=this.allCodeLists.get(t);if(!i)throw new e("找不到".concat(t,"代码表"));return"STATIC"===i.codeListType?this.getStatic(i):"DYNAMIC"===i.codeListType?this.getDynamicCodeList(i,a,s):[]}}),Os=t("ConfigService",class{constructor(t,e,a){this.appId=t,this.folder=e,this.tag=a,this.app=ibiz.hub.getApp(t)}async save(t){const e=await this.app.net.put("/configs/".concat(this.folder,"/").concat(this.tag),t);return!!e.ok&&e.data}async load(){const t=await this.app.net.get("/configs/".concat(this.folder,"/").concat(this.tag));return t.ok?t.data:{}}}),Ms=t("CounterService",class{static async getCounter(t,e,a){const s=t.id;if(this.counterMap.has(s)){const t=this.counterMap.get(s);if(!1===t.isDestroyed)return t;this.counterMap.delete(s)}const i=(await vs(t)).createCounter(t);return await i.init(e,a),this.counterMap.set(s,i),i}static async getCounterByRef(t,e,s){const{appCounter:i}=t;if(!i)throw new a(t,"未配置应用计数器!");return this.getCounter(i,e,s)}});Ms.counterMap=new Map;var Rs=t("WorkFlowService",class{constructor(t){this.model=t,this.commonBaseUrl="",this.app=ibiz.hub.getApp(t.appId);const e=ibiz.appData.context;this.commonBaseUrl="/wfcore/".concat(e.srfsystemid,"-app-").concat(this.app.model.codeName.toLowerCase(),"/").concat(this.model.name.toLowerCase())}getBaseUrl(){return this.commonBaseUrl}getActiveData(t,e){return e.srfprocessinstanceid&&(t.srfprocessinstanceid=e.srfprocessinstanceid),t}async getWFStep(t){const{processDefinitionKey:e,taskDefinitionKey:a}=t;return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions/").concat(e,"/usertasks/").concat(a))}async getWFLink(t,e){const a=t[this.model.codeName.toLowerCase()],{taskDefinitionKey:s}=t;return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(a,"/usertasks/").concat(s,"/ways"),{activedata:this.getActiveData(e,t)})}async getWFHistory(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.get("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/history"))}async getWFProcessDiagram(t){const e=t[this.model.codeName.toLowerCase()];return this.app.net.request("".concat(this.getBaseUrl(),"/").concat(e,"/process-instances/alls/processdiagram"),{method:"post",data:{},responseType:"blob"})}async getWFVersion(){return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions2"))}async wfStart(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/process-instances"),{...e,activedata:this.getActiveData(a,t)})}async wfSubmit(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId),{...e,activedata:this.getActiveData(a,t)})}async wfWithdraw(t,e,a){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/withdraw"),{...e,activedata:this.getActiveData(a,t)})}async wfReassign(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/transfer"),{...e,activedata:this.getActiveData(a,t)})}async wfAddStepBefore(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/beforesign"),{...e,activedata:this.getActiveData(a,t)})}async wfAddStepAfter(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/aftersign"),{...e,activedata:this.getActiveData(a,t)})}async wfSendBack(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendback"),{...e,activedata:this.getActiveData(a,t)})}async wfSendCopy(t,e,a){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendcopy"),{...e,activedata:this.getActiveData(a,t)})}async exec(t,a,s={},i={}){switch(t){case"wfstart":return this.wfStart(a,s,i);case"wfsubmit":return this.wfSubmit(a,s,i);case"reassign":return this.wfReassign(a,s,i);case"addstepbefore":return this.wfAddStepBefore(a,s,i);case"addstepafter":return this.wfAddStepAfter(a,s,i);case"sendback":return this.wfSendBack(a,s,i);case"sendcopy":return this.wfSendCopy(a,s,i);default:throw new e("「".concat(t,"」未实现"))}}}),Vs=class{constructor(t){this.model=t}exportData(t,e,a,s){const i=Ts(a,this.model),n="".concat(i,"/").concat(this.model.codeName2.toLowerCase(),"/exportdata/").concat(e.toLowerCase(),"/?srfexporttag=").concat(t.codeName);return ibiz.net.request(n,{method:"post",data:s,responseType:"blob"})}},ks=t("Srfuf",(t=>(t[t.CREATE=0]="CREATE",t[t.UPDATE=1]="UPDATE",t))(ks||{})),Fs=t("AppDataEntity",class t{get srfuf(){return this.srfkey?1:0}constructor(e,a){let s;Object.defineProperty(this,"_entity",{enumerable:!1,configurable:!0,value:e}),Object.defineProperty(this,"_data",{enumerable:!1,configurable:!0,value:tt(a instanceof t?a._data:a)}),Object.defineProperty(this,"srfdeid",{get:()=>e.id}),Object.defineProperty(this,"srfdecodename",{get:()=>e.codeName});const i=Be(e.appDEFields||[],e.keyAppDEFieldId);if(i){const t=i.codeName.toLowerCase();Object.defineProperty(this,"srfkeyfile",{get:()=>t}),Object.defineProperty(this,"srfkey",{set(t){s=t},get(){return this._data[t]||s}}),Object.defineProperty(this,"srfsourcekey",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主键字段"));const n=Be(e.appDEFields||[],e.majorAppDEFieldId);if(n){const t=n.codeName.toLowerCase();Object.defineProperty(this,"srfmajorfile",{get:()=>t}),Object.defineProperty(this,"srfmajortext",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主文本字段"));this.defineProperties()}defineProperties(){var t;const{_data:e,convertVal:a}=this,s={};Object.keys(e).forEach((t=>{s[t]={enumerable:!0,set(a){e[t]=a},get:()=>e[t]}})),null==(t=this._entity.appDEFields)||t.forEach((t=>{const i=t.codeName.toLowerCase();s[i]={enumerable:!0,set(s){e[i]=a(s,t.stdDataType)},get:()=>e[i]},e[i]=a(e[i],t.stdDataType)})),Object.defineProperties(this,s)}clone(){const e=new t(this._entity,this._data);return e.srfkey=this.srfkey,e}assign(e){return e instanceof t?Object.assign(this._data,e._data):Object.assign(this._data,e),this}convertVal(t,e){if(null==t)return t;if(Q(e))return t;if(n.isNumber(e)){const e=Q(t)||""===t?t:Number(t);return Number.isNaN(e)?(ibiz.log.debug("".concat(t,"不能转换成数字")),t):e}return t}}),Ws=t("MethodDto",class t{constructor(t,e,a){this.entity=t,this.isLocalMode=e,this.dto=a,this.dtoMap=new Map,a?(this.app=ibiz.hub.getApp(t.appId),this.fields=a.appDEMethodDTOFields||[]):this.fields=[]}async get(t,e){const a={};for(let i=0;i<this.fields.length;i++){const n=this.fields[i],r=n.codeName.toLowerCase();switch(n.type){case"SIMPLE":break;case"DTOS":{if(void 0!==e[r])break;if(!n.refAppDataEntityId)break;const s=await this.getFieldDto(n),i=(await this.app.deService.getService(n.refAppDataEntityId)).local.getList(t);if(i){const e=[];for(let a=0;a<i.length;a++)e.push(await s.get(t,i[a]));a[r]=e}break}default:throw new s(n,"未支持的应用实体方法输入属性类型: ".concat(n.type))}}return{...e,...a}}async sets(t,e){const a=await this.app.deService.getService(this.entity.id);return this.isLocalMode&&a.local.clear(t),Promise.all(e.map((async e=>{const s=this.fields.filter((t=>"DTOS"===t.type)).map((async a=>{if(!a.refAppDataEntityId)return;const s=a.codeName.toLowerCase(),i=await this.getFieldDto(a),n=e[s];n?await i.sets(t,n):await i.sets(t,[])}));for(let t=0;t<s.length;t++)await s[t];const i=new Fs(this.entity,e);return this.isLocalMode&&await a.local.add(t,i),i})))}async getFieldDto(e){if(this.dtoMap.has(e.codeName))return this.dtoMap.get(e.codeName);const a=await ibiz.hub.getAppDataEntity(e.refAppDataEntityId,this.entity.appId),s=Be(a.appDEMethodDTOs||[],e.refAppDEMethodDTOId),i=new t(a,!0,s);return this.dtoMap.set(e.codeName,i),i}});function Bs(t){return"BUILTIN"===t.actionType||"DATAQUERY"===t.dataSetType}var Us=class{constructor(t,e){this.entity=t,this.method=e;const a=e.appDEMethodInput;if(a){const e=Be(t.appDEMethodDTOs||[],a.appDEMethodDTOId);e&&(this.dto=new Ws(t,this.isLocalMode,e))}}get isLocalMode(){return Bs(this.method)}async handle(t,e){return this.dto?this.dto.get(t,e):e}},js=class{constructor(t,e){this.entity=t,this.method=e;const a=e.appDEMethodReturn;if(a){const e=Be(t.appDEMethodDTOs||[],a.appDEMethodDTOId);e&&(this.dto=new Ws(t,this.isLocalMode,e))}}get isLocalMode(){return Bs(this.method)}async handle(t,e){if(this.dto){return(await this.dto.sets(t,[e]))[0]}return W(e)&&(e={}),new Fs(this.entity,e)}},zs=class{constructor(t,e){this.entity=t,this.method=e,this.app=ibiz.hub.getApp(t.appId),this.input=new Us(t,e),this.result=new js(t,e)}async request(t,e,s,i){const{actionType:n,requestMethod:r}=this.method;if("REMOTE"===n){const e=this.method.codeName.toLowerCase();let n=null;switch(r){case"POST":n=await this.app.net.post(this.mergeRequestPath(t,e),F(s)?s:i||{});break;case"GET":n=await this.app.net.get(this.mergeRequestPath(t,e),s||i);break;case"PUT":n=await this.app.net.put(this.mergeRequestPath(t,e),F(s)?s:i||{});break;case"DELETE":n=await this.app.net.delete(this.mergeRequestPath(t,e),s||i);break;default:throw new a(this.method,r?"未支持的请求方式: ".concat(r):"未配置请求方式")}return n}throw new a(this.method,"未支持的行为类型[".concat(n,"]"))}mergeRequestPath(t,e){return"".concat(t,"/").concat(e)}calcPath(t){const e="/".concat(this.entity.codeName2.toLowerCase());return Ts(t,this.entity)+e}async getService(){return this.service||(this.service=await this.app.deService.getService(this.entity.id)),this.service}createEntity(t){return t instanceof Fs?t.clone():new Fs(this.entity,t)}},Gs=class{constructor(t,e,a,s){this.deLogicParams=t,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default",this.parameters={context:e,data:a,params:s}}get context(){return Object.prototype.hasOwnProperty.call(this.params,"context")?this.params.context:this.parameters.context}get data(){return this.parameters.data}get viewParam(){return Object.prototype.hasOwnProperty.call(this.params,"viewParam")?this.params.viewParam:this.parameters.params}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}setLastReturn(t){this.lastReturn=t}initLastReturnParam(t){Object.defineProperty(this.params,t,{enumerable:!0,configurable:!0,get:()=>this.lastReturn})}isEntityParam(t){const e=this.deLogicParams.get(t);return!(!e||!e.model.entityParam)}},Hs=class{},Ks=class extends Hs{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName.toLowerCase()}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,i){const n=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=i[this.value]?i[this.value]:e[this.value];return la(n[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return la(n[this.dstField],this.op,e[this.value])}case"CURTIME":throw new s(this.model,"暂未支持条件值类型为[当前时间]");default:return la(n[this.dstField],this.op,this.value)}}},Xs=class t extends Hs{constructor(e){super(),this.model=e;const a=e.conds||[];this.conds=a.map((e=>"SINGLE"===e.logicType?new Ks(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,s){let i=!0;if(0===this.conds.length)throw new a(this.model,"界面连接条件逻辑组未配置逻辑项");for(let a=0;a<this.conds.length;a++){const n=this.conds[a].test(t,e,s);if("AND"===this.op&&!1===n){i=!1;break}if("OR"===this.op&&!0===n){i=!0;break}}return this.notMode?!i:i}},Ys=class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const e=this.model.delogicLinkGroupCond;e&&(this.groupCond=new Xs(e))}async exec(t){const{defaultLink:e}=this.model;return!(!e&&this.groupCond)||this.groupCond.test(t,t.context,t.data||{})}},$s=class{constructor(t){var e;this.model=t,this.links=null==(e=t.links||[])?void 0:e.map((t=>new Ys(t)))}},qs=class extends $s{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:s,dstDELogicParamId:i,retDELogicParamId:n}=this.model;if(!e)throw new a(this.model,"未指定应用实体");if(!s)throw new a(this.model,"未指定实体行为");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,s,t.context,r,t.viewParam);c.ok&&(t.params[n]=c.data)}},Qs=class extends $s{async exec(t){}},Js=class extends $s{async exec(t){t.isEndNode=!0;const{returnParamId:e,returnType:a,rawValue:i}=this.model;if(a)switch(a){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=ibiz.util.rawValue.format(i);break;case"LOGICPARAM":t.result=t.params[e];break;default:throw new s(this.model,"暂未支持的结束节点返回值类型: ".concat(a))}}};function Zs(t,e){const{srcDELogicParamId:a,srcFieldName:i,srcValue:n}=e,r=e.srcValueType||"SRCDLPARAM";let o,c=i;switch(r){case"SRCDLPARAM":o=t.params[a],t.isEntityParam(a)&&(c=null==c?void 0:c.toLowerCase());break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return ibiz.util.rawValue.format(n);case"WEBCONTEXT":case"VIEWPARAM":o=t.parameters.params;break;case"APPLICATION":case"SESSION":case"APPDATA":case"DATACONTEXT":o=t.parameters.context;break;case"ENVPARAM":o=tt(ibiz.env);break;default:throw new s(e,"暂未支持源值类型".concat(r))}if(o&&c)try{o=ga.execScriptFn({srcValue:o},"srcValue.".concat(c),{singleRowReturn:!0,isAsync:!1})}catch(t){throw ibiz.log.error("从源参数取属性".concat(c,"报错,源参数:"),o),t}return o}var ti=class extends $s{async exec(t){const e=this.model.delogicNodeParams;(null==e?void 0:e.length)&&await Promise.all(e.map((e=>{switch(e.paramAction){case"SETPARAMVALUE":return this.setParamValue(e,t);case"RESETPARAM":return this.resetParam(e,t);case"COPYPARAM":return this.copyParam(e,t);case"BINDPARAM":return this.bindParam(e,t);case"RENEWPARAM":return this.renewParam(e,t);case"APPENDPARAM":return this.appendParam(e,t);case"SORTPARAM":return this.sortParam(e,t);default:throw new s(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))}})))}copyParam(t,e){const{dstDELogicParamId:a}=t,s=Zs(e,t);e.params[a]=tt(s)}bindParam(t,e){const a=Zs(e,t);e.params[t.dstDELogicParamId]=a}setParamValue(t,e){const{dstFieldName:a,dstDELogicParamId:s}=t;let i=a;e.isEntityParam(s)&&(i=null==i?void 0:i.toLowerCase());const n=Zs(e,t);i?e.params[s][i]=n:e.params[s]=n}resetParam(t,e){const{dstDELogicParamId:a}=t;e.resetParam(a)}renewParam(t,e){const{dstDELogicParamId:a}=t;e.renewParam(a)}appendParam(t,e){const{dstDELogicParamId:a,dstIndex:s,srcIndex:i,srcSize:n}=t,r=Zs(e,t),o=s||0,c=i||0,l=n||r.length;e.params[a].splice(o,0,...r.slice(c,l))}sortParam(t,e){const{dstDELogicParamId:a,dstFieldName:s,dstSortDir:i}=t,n=s.toLowerCase();e.params[a].sort(((t,e)=>"ASC"===i?t[n]-e[n]:e[n]-t[n]))}},ei=class extends $s{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:a,dstDELogicParamId:s,retDELogicParamId:i}=this.model,n=t.params[s],r=ibiz.hub.getApp(t.context.srfappid),o=await r.deService.exec(a,e,t.context,n);o.ok&&(t.params[i]=o.data)}},ai=class extends $s{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Zs(t,this.model);t.params[e]=i}},si=class extends $s{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.resetParam(e)}},ii=class extends $s{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.renewParam(e)}},ni=class extends $s{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Zs(t,this.model);t.params[e]=tt(i)}},ri=class extends $s{async exec(t){const{dstDELogicParamId:e,dstSortDir:s,dstFieldName:i}=this.model;if(!e||!i)throw new a(this.model,"缺少目标参数对象或目标属性配置");const n=i.toLowerCase();t.params[e].sort(((t,e)=>"ASC"===s?t[n]-e[n]:e[n]-t[n]))}},oi=class extends $s{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:s,dstIndex:i,srcIndex:n,srcSize:r}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const o=Zs(t,this.model),c=i||0,l=n||0,h=r||o.length;t.params[e].splice(c,0,...o.slice(l,h))}},ci=class extends $s{async exec(t){const{errorCode:e,errorInfo:a}=this.model;throw new o({response:{status:e,statusText:a}})}},li=class{constructor(t){this.model=t}calc(t){const e=this.model.id,a=this.model;if(a.default)t.params[e]=t.data||{};else if(a.appGlobalParam)t.params[e]=tt(ibiz.env);else if(a.entityListParam)t.params[e]=[];else{if(a.entityPageParam)throw new s(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[e]={};else if(a.lastReturnParam)t.initLastReturnParam(e);else if(a.appContextParam)t.params[e]=t.parameters.context;else if(a.simpleListParam)t.params[e]=[];else if(a.simpleParam)t.params[e]={};else if(a.cloneParam)t.params[e]=tt(t.data||{});else{if(a.envParam)throw new s(a,"未支持的逻辑参数类型: 系统环境变量");if(a.fileListParam)throw new s(a,"未支持的逻辑参数类型: 文件对象列表变量");if(a.fileParam)throw new s(a,"未支持的逻辑参数类型: 文件对象变量");if(a.filterParam)throw new s(a,"未支持的逻辑参数类型: 过滤器对象变量");if(a.lastParam)throw new s(a,"未支持的逻辑参数类型: 最后数据变量");if(a.originEntity)throw new s(a,"未支持的逻辑参数类型: 原始数据对象");if(a.sessionParam)throw new s(a,"未支持的逻辑参数类型: 操作会话变量")}}}renew(t){const e=this.model.id,a=this.model;if(a.entityListParam||a.simpleListParam||a.entityPageParam)t.params[e]=[];else{if(!a.simpleParam&&!a.entityParam)throw new s(a,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}},hi=class{constructor(t){var e,i;if(this.model=t,this.nodes=new Map,this.params=new Map,t.customCode){if(!t.scriptCode)throw new a(t,"脚本代码模式没有配置脚本代码");this.scriptFn=ga.createScriptFn([],t.scriptCode,{isAsync:!0})}else{if(!(null==(e=t.delogicNodes)?void 0:e.length))throw new a(t,"实体逻辑没有配置逻辑节点");t.delogicNodes.forEach((t=>{const{logicNodeType:e}=t;let a;switch(e){case"BEGIN":a=new Qs(t);break;case"END":a=new Js(t);break;case"DEACTION":a=new qs(t);break;case"PREPAREPARAM":a=new ti(t);break;case"DEDATASET":a=new ei(t);break;case"THROWEXCEPTION":a=new ci(t);break;case"BINDPARAM":a=new ai(t);break;case"RESETPARAM":a=new si(t);break;case"COPYPARAM":a=new ni(t);break;case"RENEWPARAM":a=new ii(t);break;case"APPENDPARAM":a=new oi(t);break;case"SORTPARAM":a=new ri(t);break;default:throw new s(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,a)})),null==(i=t.delogicParams)||i.forEach((t=>{this.params.set(t.id,new li(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.thenId)&&(e.dstNode=this.nodes.get(e.model.thenId))}))}))}}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t,e,s){if(this.scriptFn)return this.scriptFn.exec({context:t,data:e,params:s});const i=new Gs(this.params,t,e,s);this.initLogicParams(i);const{startDELogicNodeId:n}=this.model;if(!n||!this.nodes.has(n))throw new a(this.model,"未设置起始节点");{const t=this.nodes.get(n);await this.deepExec(t,i)}return i.isEndNode?i.result:i.params[i.defaultParamName]?i.params[i.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:a}=t;for(let s=0;s<a.length;s++){const i=a[s];if(await i.exec(e)&&i.dstNode&&(await this.deepExec(i.dstNode,e),!1===t.model.parallelOutput))break}}},di=new Map;async function ui(t,e,a,s){di.has(t)||di.set(t,new hi(t));return di.get(t).exec(e,a,s)}async function pi(t,a,s,i,n){const r=await async function(t,e,a){return $e(t,await ibiz.hub.getAppDataEntity(e,a))}(t,a,s.srfappid);if(!r)throw new e("".concat(a,"找不到实体逻辑").concat(t));return ui(r,s,i,n)}async function mi(t,e,a,s){try{const i=await ui(t,e,a,s);return new r(i)}catch(t){if(t instanceof o)return new r(t,500);throw t}}async function fi(t,e,a,s,i){const n=qe(t,e);if(n.length){(await Promise.all(n.map((t=>ui(t,a,s,i))))).forEach((t=>{Object.assign(s,t)}))}}var gi=class extends zs{get isLocalMode(){return Bs(this.method)}async exec(t,e,s){if("DELOGIC"===this.method.actionType){const i=$e(this.method.appDELogicId,this.entity);if(!i)throw new a(this.method,"缺少实体处理逻辑");return mi(i,tt(t),e?tt(e):{},s?tt(s):{})}let i;switch(e&&!this.isLocalMode&&(e=await this.input.handle(t,e)),e&&!["READ","GETDRAFT"].includes(this.method.actionMode)&&await fi(this.entity,"change",t,e,s||{}),this.method.codeName){case"Create":i=await this.create(t,e,s||{});break;case"Get":i=await this.get(t,s);break;case"GetDraft":i=await this.getDraft(t,s);break;case"Remove":i=await this.remove(t,s);break;case"Update":i=await this.update(t,e,s);break;case"CreateTemp":i=await this.createTemp(t,e);break;case"GetTemp":i=await this.getTemp(t,e);break;case"GetDraftTemp":i=await this.getDraftTemp(t,s);break;case"RemoveTemp":i=await this.removeTemp(t,e);break;case"UpdateTemp":i=await this.updateTemp(t,e);break;default:{let a=this.calcPath(t);this.method.needResourceKey&&(a="".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]||(null==e?void 0:e[this.entity.keyAppDEFieldId])));const n=await this.request(a,t,e,s);n.data=await this.result.handle(t,n.data),i=n}}return await fi(this.entity,"compute",t,i.data,s||{}),i}async create(t,e,a){if(this.isLocalMode)return this.createTemp(t,this.createEntity(e));const s=this.calcPath(t),i=await this.app.net.post(s,e,a);return i.data=await this.result.handle(t,i.data),i}async remove(t,e){if(this.isLocalMode)return this.removeTemp(t,e);const a=this.calcPath(t);return await this.app.net.delete("".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]),e)}async update(t,e,a={}){if(this.isLocalMode)return this.updateTemp(t,this.createEntity(e));const s=this.calcPath(t),i=await this.app.net.put("".concat(s,"/").concat(t[this.entity.codeName.toLowerCase()]),e,a);return i.data=await this.result.handle(t,i.data),i}async get(t,e={}){if(this.isLocalMode)return this.getTemp(t,e);const a=this.calcPath(t),s=await this.app.net.get("".concat(a,"/").concat(t[this.entity.codeName.toLowerCase()]),e);return s.data=await this.result.handle(t,s.data),s}async getDraft(t,e){if(this.isLocalMode)return this.getDraftTemp(t,e);const a=this.calcPath(t),s=await this.app.net.get("".concat(a,"/getdraft"),e);return s.data=await this.result.handle(t,s.data),s}async createTemp(t,e){try{const a=await this.getService(),s=await a.local.add(t,this.createEntity(e));return new r(s)}catch(t){return new r(t,500)}}async getDraftTemp(t,e){try{const t=this.createEntity({});return t?new r(t):new r(t,500)}catch(t){return new r(t,500)}}async removeTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const a=(await this.getService()).local.delete(t,e);return a?new r(a):new r(a,500)}catch(t){return new r(t,500)}}async updateTemp(t,e){try{const a=(await this.getService()).local.update(t,this.createEntity(e));return a?new r(a):new r(a,500)}catch(t){return new r(t,500)}}async getTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const a=(await this.getService()).local.get(t,e);return a?new r(a):new r(a,500)}catch(t){return new r(t,500)}}async removeBatchTemp(t,e){return new r(!0)}},wi=class extends zs{get isLocalMode(){return Bs(this.method)}async exec(t,e,a){if(this.isLocalMode){const a=await this.searchLocal(null,new Ls(t,e));return new r(a,200)}let i;switch(this.method.dataSetType){case"INDEXDE":case"CODELIST":case"MULTIFORM":i=await this.fetchCodeListSet(t,a);break;case"REMOTE":{const s=this.calcPath(t);i=await this.request(s,t,e,a)}break;default:throw new s(this.method,"数据来源类型".concat(this.method.dataSetType,"暂未支持"))}const n=i.data||[];return i.data=n.map((t=>this.createEntity(t))),i.data.length&&await Promise.all(i.data.map((e=>fi(this.entity,"compute",t,e,a)))),i}async selectLocal(t,e={}){let a=(await this.getService()).local.getList(t);a=Y(a,"srfordervalue");const s={},i={},n={},r={};e.srfkey&&(s.srfkey=et(e.srfkey),delete e.srfkey);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const a=e[t];null==a?(i[t]=et(null),n[t]=et(void 0),r[t]=et("")):s[t]=et(a)}if(!Z(s)){const t=at(s),e=at(i),o=at(n),c=at(r);a=a.filter((a=>{if(Z(i)){if(t(a))return!0}else if(t(a)&&(e(a)||o(a)||c(a)))return!0;return!1}))}return a.map((t=>t.clone()))}async searchLocal(t,e,a=this.entity.quickSearchAppDEFieldIds){const s=await this.getService();let i=[];t?(i=s.local.getList(e.context),i.length>0&&(i=i.filter((a=>t.test(a,e))))):(i=await this.selectLocal(e.context),i.length>0&&e.query&&""!==e.query&&a&&(i=i.filter((t=>{const s=new RegExp(e.query);for(let e=0;e<a.length;e+=1){const i=t[a[e]];if(s.test(i))return!0}return!1})))),Q(e.sortField)||Z(e.sortField)||(i="DESC"===e.sortMode?$(i,e.sortField):Y(i,e.sortField));const{page:n,size:r}=e,o=n*r,c=(n+1)*r-1;return i.slice(o,c).map((t=>tt(t)))}async fetchCodeListSet(t,e){const{appCodeListId:s}=this.method;if(!s)throw new a(this.method,"没有指定数据来源代码表");const i=await this.app.codeList.get(s,t,e),{keyAppDEFieldId:n,majorAppDEFieldId:o}=this.entity,c=i.map((t=>({[n]:t.value,[o]:t.text})));return new r(c,200)}},Ei=class extends wi{mergeRequestPath(t,e){return"".concat(t,"/ac/").concat(e,"?srfac=ac")}},vi=t("DEService",class{constructor(t){this.model=t,this.methodMap=new Map,this.local=new Ss,this.configCache=new Os(t.appId,"PSAppDataEntity",t.codeName),this.wf=new Rs(t),this.file=new Vs(t)}getMethod(t,e=!1){const a=e?"ac-".concat(t):t;if(this.methodMap.has(a))return this.methodMap.get(a);const i=Be(this.model.appDEMethods,t);let n=null;switch(i.methodType){case"DEACTION":n=new gi(this.model,i);break;case"FETCH":case"FETCHTEMP":n=e?new Ei(this.model,i):new wi(this.model,i);break;default:throw new s(i,"未支持的服务方法类型: ".concat(i.methodType))}return this.methodMap.set(a,n),n}exec(t,a,s,i){const n=this.getMethod(t);if(n)return n.exec(a,s,i);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}execAc(t,a,s,i={}){const n=this.getMethod(t,!0);if(n)return n.exec(a,s,i);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}aiChatSse(t,e,a={},s={}){const i=ibiz.hub.getApp(this.model.appId),n=this.calcSsePath(e);return new Promise(((e,r)=>{i.net.sse("/".concat(n),{srfactag:"AIChat",...a},{headers:{"Content-Type":"application/json"},body:JSON.stringify(s),onmessage:e=>{if(e.data){const a=JSON.parse(e.data);t(a)}},onclose:()=>{e()},onerror:t=>{r(t)}})}))}calcSsePath(t){const e=t[this.model.codeName.toLowerCase()],a="/".concat(this.model.codeName2.toLowerCase(),"/ssechatcompletion").concat(e?"/".concat(e):"");return Ts(t,this.model)+a}}),yi=t("ControlVO",class t{get srfuf(){return Q(this.$origin.srfuf)?this.srfkey?1:0:this.$origin.srfuf}get srfkey(){return this.$origin.srfkey}get srfmajortext(){return this.$origin.srfmajortext}get srfdeid(){return this.$origin.srfdeid}get srfdecodename(){return this.$origin.srfdecodename}get srfkeyfile(){return this.$origin.srfkeyfile}get srfmajorfile(){return this.$origin.srfmajorfile}constructor(t={},e=new Map){Object.defineProperty(this,"$origin",{enumerable:!1,configurable:!0,value:t||{}}),Object.defineProperty(this,"$dataUIMap",{enumerable:!1,configurable:!0,value:e||new Map}),this.$dataUIMap.forEach(((t,e)=>{const a=t.dataKey;this.linkProperty(e,a,t)})),Object.keys(t).forEach((t=>{Object.prototype.hasOwnProperty.call(this,t)||this.linkProperty(t,t)}))}linkProperty(t,e,a){const s=!a||a.isOriginField;"srfuf"!==t&&(s||Object.prototype.hasOwnProperty.call(this.$origin,t)?Object.defineProperty(this,t,{enumerable:!0,configurable:!0,get(){return"srfkey"===t?this.$origin[e]||this.$origin[t]:this.$origin[e]},set(t){this.$origin[e]=t}}):Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:null}))}getOrigin(){return this.$origin}setOrigin(e){this.$origin=e instanceof t?e.getOrigin():e}clone(){const e=tt(this.$origin),a=new t(e,this.$dataUIMap);return Object.keys(this).forEach((t=>{a[t]=this[t]})),a}}),Ii=t("ControlService",class{constructor(t){this.dataUIMap=new Map,this.model=t}async init(t){this.app=ibiz.hub.getApp(null==t?void 0:t.srfappid),this.initUIDataMap()}initUIDataMap(){}async exec(t,e,a,s){return await this.app.deService.exec(this.model.appDataEntityId,t,e,a,s)}handleResponse(t){return t}toUIData(t){return new yi(t,this.dataUIMap)}}),Di=t("MDControlService",class extends Ii{async fetch(t,e={}){var a;const s=(null==(a=this.model.fetchControlAction)?void 0:a.appDEMethodId)||"fetchdefault";let i=await this.exec(s,t,e);return i=this.handleResponse(i),i}async get(t,e={}){var a;const s=(null==(a=this.model.getControlAction)?void 0:a.appDEMethodId)||"get";let i=await this.exec(s,t,void 0,e);return i=this.handleResponse(i),i}async getDraft(t,e={}){var a;const s=(null==(a=this.model.getDraftControlAction)?void 0:a.appDEMethodId)||"getdraft";let i=await this.exec(s,t,void 0,e);return i=this.handleResponse(i),i}async remove(t,e={}){var a;const s=(null==(a=this.model.removeControlAction)?void 0:a.appDEMethodId)||"remove";return await this.exec(s,t,void 0,e)}async create(t,e){var a;const s=(null==(a=this.model.createControlAction)?void 0:a.appDEMethodId)||"create";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}async update(t,e){var a;const s=(null==(a=this.model.updateControlAction)?void 0:a.appDEMethodId)||"update";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}async exportData(t,a,s={}){throw new e("未实现")}handleResponse(t){const e=super.handleResponse(t);return e.headers&&(e.headers["x-page"]&&(e.page=Number(e.headers["x-page"])),e.headers["x-per-page"]&&(e.size=Number(e.headers["x-per-page"])),e.headers["x-total"]&&(e.total=Number(e.headers["x-total"]))),e.ok&&(z(e.data)?e.data=e.data.map((t=>this.toUIData(t))):e.data=this.toUIData(e.data)),e}}),Ci=t("DeAuthorityService",class{constructor(t){this.entityModel=t}async calcByDataAccessAction(t,e){if(e.srfopprivs&&!e.srfopprivs.includes(t))return!1;return!!await this.calcByDeMainState(t,e)}async calcByDeMainState(t,e){let a=!0;const s=this.entityModel;if(!s.enableDEMainState)return ibiz.log.debug("".concat(s.codeName,"实体不存在或者为启用主状态,返回true")),a;ibiz.log.debug("操作标识".concat(t,"主状态计算开始"),e,s);const i=Ge(s,e);if(i){ibiz.log.debug("匹配主状态",i);const e=He(i,s);ibiz.log.debug("允许的主状态权限集合",e),a=e.includes(t)}else ibiz.log.debug("没匹配主状态,返回false"),a=!1;return ibiz.log.debug("操作标识".concat(t,"权限计算结束:").concat(a)),a}}),Ai=t("AuthorityService",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map,this.resCodes=[],this.enablePermission=!1}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const a=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!a)throw new e("未找到应用实体[".concat(t,"]"));const s=this.constructorCache.get(t);let i;i=s?await s(a):new Ci(a),this.cache.set(t,i)}return this.cache.get(t)}async init(t=ibiz.appData){t&&(t.unires&&(this.resCodes=t.unires),!0===t.enablepermissionvalid&&ibiz.env.enablePermission&&(this.enablePermission=!0))}calcByResCode(t){return!this.enablePermission||this.resCodes.includes(t)}async calcByDataAccessAction(t,e,a){if(this.enablePermission){const e=await ibiz.hub.getApp(this.appModel.appId),s=await e.getOPPriv(t,a);if(this.enablePermission&&(null==s?void 0:s.mapSysUniResCode)&&!this.calcByResCode(s.mapSysUniResCode))return!1}if(e&&a){return(await this.getService(a)).calcByDataAccessAction(t,e)}return!0}}),bi=t("V7AuthService",class{async login(t,e){try{const a=await ibiz.net.post("/v7/login",{loginname:t,password:e}),{data:s}=a;if(s&&s.token){G(c.TOKEN,s.token,0,!0);const t=(new Date).getTime()+1e3*(s.expirein||7199);G(c.TOKEN_EXPIRES,"".concat(t),0,!0)}return!0}catch(t){ibiz.notification.error({title:"登录失败",desc:t.message||""})}return!1}async logout(){try{return await ibiz.net.get("/v7/logout"),H(c.TOKEN),H(c.TOKEN_EXPIRES),!0}catch(t){ibiz.notification.error({title:"登出失败",desc:t.message||""})}return!1}}),Pi=t("TreeNodeData",class{constructor(t,e,a){this.leaf=!1,this.leaf=!0===a.leaf,this.parent=e,this.parent&&(this.context={...this.parent.context}),a.navContext&&(this.context=Object.assign(this.context||{},a.navContext)),a.navParams&&(this.params={...a.navParams}),this.nodeId=t.id}calcIcon(t){const{sysImage:e}=t,a={};return e&&(e.cssClass&&(a.cssClass=e.cssClass),e.imagePath&&(a.imagePath=e.imagePath)),Object.values(a).length>0?a:void 0}}),Si=t("TreeCodeListNodeData",class extends Pi{constructor(t,e,a){super(t,e,a);const{data:s}=a;if(this.deData=s,this.text=s.text,this.value=s.value,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(this.value):t.id+this.value,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=Ke(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:this.value})}this.srfkey=this.value,this.srfmajortext=this.text,this.icon=this.calcIcon(t)}}),xi=t("TreeDataSetNodeData",class extends Pi{constructor(t,e,a){super(t,e,a);const{data:s}=a;if(this.deData=s,this.text=s.srfmajortext,this.value=s.srfkey,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(s.srfkey):t.id+s.srfkey,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=Ke(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:s.srfkey})}this.srfkey=this.deData.srfkey,this.srfmajortext=this.deData.srfmajortext,this.icon=this.calcIcon(t),this.textHtml=this.calcTextHtml(t)}calcIcon(t){const e=super.calcIcon(t)||{},{iconAppDEFieldId:a,detreeNodeDataItems:s}=t;a&&this.deData[a]&&(e.imagePath=this.deData[a]),e&&(this.icon=e);const i=null==s?void 0:s.find((t=>"icon"===t.id));return i&&(e.htmlStr=this.calcDataItemScript(i)),Object.values(e).length>0?e:void 0}calcDataItemScript(t){if(t.customCode&&t.scriptCode)return ga.execScriptFn({data:this.deData},t.scriptCode,{isAsync:!1})}calcTextHtml(t){let e;const{detreeNodeDataItems:a}=t,s=null==a?void 0:a.find((t=>"text"===t.id));return s&&(e=this.calcDataItemScript(s)),e}}),_i=t("TreeStaticNodeData",class extends Pi{constructor(t,e,a){var s,i;super(t,e,a);const n="root"===t.nodeValue?void 0:t.nodeValue;if(this.id=e?"".concat(e.id,":").concat(t.id):t.id,this.id=this.id.toLowerCase(),this.text=t.text,this.value=n,e&&a.parentValueLevel){let t=e;for(let e=1;e<a.parentValueLevel;e++)t=null==t?void 0:t.parent;(null==t?void 0:t.deData)&&(this.deData=t.deData),this.value=n||(null==t?void 0:t.value)}this.srfkey=(null==(s=this.deData)?void 0:s.srfkey)||this.value,this.srfmajortext=(null==(i=this.deData)?void 0:i.srfmajortext)||this.text,this.icon=this.calcIcon(t)}}),Ti=t("UIMapField",class{constructor(t,e,a={}){this.isOriginField=!1,this.isRequestNeed=!0,this.uiKey=t,this.dataKey=e,Q(a.isOriginField)||(this.isOriginField=a.isOriginField),Q(a.dataType)||(this.dataType=a.dataType)}convertVal(t){if(!this.dataType)return t;if(n.isNumber(this.dataType)){const e=Q(t)||""===t?t:Number(t);return Number.isNaN(e)?(ibiz.log.debug("".concat(t,"不能转换成数字")),t):e}return t}}),Li=t("CalendarItemData",class{constructor(t,e){this.model=t,this.data=e}get deData(){return this.data}get navId(){return"".concat(this.itemType,"@").concat(this.id)}get itemType(){return this.model.itemType}get bkColor(){const t=this.model.bkcolorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.bkcolor}get beginTime(){const t=this.model.beginTimeAppDEFieldId;return t?this.data[t]:void 0}get color(){const t=this.model.colorAppDEFieldId;return t&&this.data[t]?this.data[t]:this.model.color}get content(){const t=this.model.contentAppDEFieldId;return t?this.data[t]:void 0}get endTime(){const t=this.model.endTimeAppDEFieldId;return t?this.data[t]:void 0}get icon(){const t=this.model.iconAppDEFieldId;return t?this.data[t]:void 0}get id(){const t=this.model.idAppDEFieldId;return t&&this.data[t]?this.data[t]:this.data.srfkey}get level(){const t=this.model.levelAppDEFieldId;return t?this.data[t]:void 0}get tag2(){const t=this.model.tag2AppDEFieldId;return t?this.data[t]:void 0}get tag(){const t=this.model.tagAppDEFieldId;return t?this.data[t]:void 0}get text(){const t=this.model.textAppDEFieldId;return t?this.data[t]:void 0}get tips(){const t=this.model.tipsAppDEFieldId;return t?this.data[t]:void 0}}),Ni=t("DEServiceUtil",class{constructor(t){this.appModel=t,this.cache=new Map,this.constructorCache=new Map}register(t,e){this.constructorCache.set(t,e)}async getService(t){if(!this.cache.has(t)){const a=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!a)throw new e("未找到应用实体[".concat(t,"]"));const s=this.constructorCache.get(t);let i;i=s?await s(a):new vi(a),this.cache.set(t,i)}return this.cache.get(t)}clearTempCache(t){this.cache.forEach((e=>{e.local.clear(t)}))}async exec(t,e,a,s,i){return(await this.getService(t)).exec(e,a,s,i)}}),Oi=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,a,i={},n={}){const r=tt(a),o=await ibiz.hub.config.view.get(t);if(!o)throw new e("应用视图[".concat(t,"]不存在"));if((r.srfkey||0===i.srfuf)&&o.appDataEntityId){const t=Ke(o.appDataEntityId);r.srfkey&&(r[t]=r.srfkey,r.srfkey=void 0),0===i.srfuf&&(r[t]=void 0,delete i.srfuf)}if(o.redirectView){return oa(await ibiz.hub.getAppView(t),r,i,n)}const{openMode:c="INDEXVIEWTAB"}=o;switch(n.openMode||c){case"INDEXVIEWTAB":return n.noWaitRoute?(this.openIndexViewTab(o,r,i),{ok:!0}):this.openIndexViewTab(o,r,i);case"POPUP":throw new s(o,"未支持的视图打开模式: POPUP");case"POPUPMODAL":return this.openModal(o,r,i);case"POPUPAPP":throw new s(o,"未支持的视图打开模式: POPUPAPP");case"POPOVER":return this.openPopover(o,n.event,r,i);case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return this.openDrawer(o,r,i);case"USER":return this.openUserCustom(o,r,i);default:return this.openIndexViewTab(o,r,i)}}openIndexViewTab(t,e,a={}){return ibiz.openView.root(t.id,e,a)}async openModal(t,e,a={}){return ibiz.openView.modal(t.id,e,a)}async openPopover(t,a,s,i={}){if(!a)throw new e("气泡打开缺少event");return ibiz.openView.popover(t.id,a,s,i)}async openDrawer(t,e,a={}){return ibiz.openView.drawer(t.id,e,a)}async openUserCustom(t,e,a={}){return ibiz.openView.custom(t.id,e,a)}};Oi.TAG="ibiz.app-view.open";var Mi=t("OpenAppViewCommand",Oi),Ri=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,a,i={},n={}){const r=ibiz.hub.getApp(a.srfappid).getAppFunc(t);if(!r)throw new e("找不到叫".concat(t,"的应用功能"));const{navigateContexts:o,navigateParams:c,appFuncType:l}=r,h=a.clone();Object.assign(h,Re(o,i,a));const d=Re(c,i,a);switch(l){case"APPVIEW":return this.openAppView(r,h,d,n);case"OPENHTMLPAGE":return this.openHtmlPage(r);case"PDTAPPFUNC":return this.openPdAppFunc(r,h,d);case"JAVASCRIPT":return this.executeJavaScript(r,h,d);case"CUSTOM":return this.custom(r,h,d);default:throw new s(r,"未支持的应用功能类型: ".concat(l))}}async openAppView(t,a,s,i){if(!t.appViewId)throw new e("应用视图[".concat(t.appViewId,"]不存在"));return ibiz.commands.execute(Mi.TAG,t.appViewId,a,s,i)}openHtmlPage(t){const e=t.htmlPageUrl;window.open(e,"_blank")}openPdAppFunc(t,a,s){throw ibiz.log.warn("openPdAppFunc",t,a,s),new e("未实现")}executeJavaScript(t,a,s){throw ibiz.log.warn("executeJavaScript",t,a,s),new e("未实现")}custom(t,a,s){throw ibiz.log.warn("custom",t,a,s),new e("未实现")}};Ri.TAG="ibiz.app-func.exec";var Vi=t("AppFuncCommand",Ri);function ki(){new Vi,new Mi}var Fi=t("Application",class{constructor(t){this.model=t,this.deName2DeCodeName=new Map,this.net=new l({baseURL:"".concat(ibiz.env.baseUrl,"/").concat(t.appId)}),this.configCache=new Os(t.appId,"PSSysApp",t.codeName),this.deService=new Ni(t),this.codeList=new Ns(t),this.authority=new Ai(t)}get appId(){return this.model.appId}async init(){await this.authority.init(),await this.loadAppModelStyle()}async loadAppModelStyle(){const t=await ibiz.hub.getAppStyle(this.appId);if(t){const e=document.createElement("style");e.setAttribute("type","text/css"),e.id=this.appId,e.innerHTML=t,document.head.appendChild(e)}}getAppFunc(t){return(this.model.appFuncs||[]).find((e=>e.id===t))||null}async getUIAction(t){const[,e]=t.split("@");if(e){const a=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUIActions.find((e=>e.id===t));if(a)return a}return this.model.appDEUIActions.find((e=>e.id===t))}async getOPPriv(t,e){var a,s;let i=null==(a=this.model.deopprivs)?void 0:a.find((e=>e.name===t));if(!i&&e){i=null==(s=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).deopprivs)?void 0:s.find((e=>e.name===t))}return i}async getDEUILogic(t,e){return(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUILogics.find((e=>e.id===t))}}),Wi=class{parse(t){return t}},Bi=class{constructor(){this.appMenu=new Wi}},Ui=class{constructor(){this.viewConfigs=new Map}set(t,e){this.viewConfigs.set(t,e)}async get(t){if(!this.viewConfigs.has(t)){const a=await ibiz.hub.getAppView(t);if(!a)throw new e("视图[".concat(t,"]不存在"));this.set(a.id,{id:a.id,codeName:a.codeName,openMode:a.openMode,viewType:a.viewType,width:a.width,height:a.height,appDataEntityId:a.appDataEntityId,redirectView:a.redirectView})}return this.viewConfigs.get(t)}},ji=class{constructor(){this.view=new Ui}},zi=t("FormNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(zi||{})),Gi=t("GridNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Gi||{})),Hi=t("PanelNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Hi||{})),Ki=t("Counter",class{constructor(t){this.callback=t,this.count=0,this.state="Unused",this.reusable=!0}increment(){return"Used"===this.state||(this.count+=1),this.count}decrement(t){if("Used"!==this.state){if(0===this.count)throw new e("错误的调用!decrement不能对count为0调用");this.count-=1,0===this.count&&(t?t():this.callback&&this.callback(),this.reusable||(this.state="Used"))}}destroy(){this.callback=void 0}}),Xi=t("LoadingState",class{constructor(){this.isLoading=!1,this.counter=new Ki(h)}begin(){this.isLoading=!0,this.counter.increment()}end(){this.counter.decrement((()=>{this.isLoading=!1}))}}),Yi=t("CTXState",class{}),$i=t("CTX",class{constructor(t){this.parent=t,this.isDestroyed=!1,this.evt=new U(3e3),this.controllersMap=new Map,this.state=new Yi}async init(t){this.view=t,this.registerController(t.model.name,t)}destroy(){this.controllersMap.clear(),this.view=null,this.state=null,this.isDestroyed=!0}async setState(t){Object.assign(this.state,t)}startLoading(){this.view.startLoading()}endLoading(){this.isDestroyed||this.view.endLoading()}registerController(t,e){this.controllersMap.set(t,e),this.evt.emit("onRegister",t,e)}getController(t,e=!1){return this.controllersMap.has(t)?this.controllersMap.get(t):this.parent&&e?this.parent.getController(t):void 0}getTopView(){return this.parent?2===this.view.modal.routeDepth?this.view:this.parent.getTopView():this.view}}),qi=t("ActivityCounter",class extends Ki{constructor(){super(...arguments),this.reusable=!1,this.registration=new Map}enroll(t){"Unused"!==this.state||this.registration.has(t)||(this.registration.set(t,!1),this.increment())}attend(t){this.registration.has(t)&&!1===this.registration.get(t)&&(this.registration.set(t,!0),this.decrement())}}),Qi=t("UIActionButtonState",class{constructor(t,e,a){this.disabled=!1,this.visible=!0,this.loading=!1,this.permitted=!0,this.noPermissionHidden=!0,this.noDataDisabled=!1,this.isInit=!1,this.name=t,this.uiActionId=a,this.appId=e}async init(){if(!this.uiActionId)return void(this.isInit=!0);const t=await Je(this.uiActionId);if([,this.appDeName]=this.uiActionId.split("@"),!t)return;const{dataAccessAction:e,noPrivDisplayMode:a,actionTarget:s,uiactionMode:i,uiactionTag:n}=t;this.dataAccessAction=e,1===a?this.noPermissionHidden=!1:6===a&&(this.visible=!1),(s&&"NONE"!==s||"SYS"===i&&["Save","SaveAndExit","SaveAndNew","Edit","Remove","RemoveAndExit"].includes(n))&&(this.noDataDisabled=!0),this.isInit=!0}async calcPermission(t,e){if(!this.dataAccessAction)return;const a=await ibiz.hub.getApp(this.appId);this.appDeName&&e&&!e.includes(this.appDeName)&&ibiz.log.warn("".concat(this.uiActionId,"界面行为的实体").concat(this.appDeName,"和数据的实体").concat(e,"不一致")),this.permitted=await a.authority.calcByDataAccessAction(this.dataAccessAction,t,e)}async update(t,e){this.isInit||await this.init(),await this.calcPermission(t,e),this.permitted?(this.visible=!0,this.disabled=this.noDataDisabled&&!t):(this.disabled=!0,this.visible=!this.noPermissionHidden)}}),Ji=t("ButtonContainerState",class{constructor(){Object.defineProperty(this,"children",{enumerable:!1,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get:()=>0!==this.children.length&&!!this.children.find((t=>t.visible))})}addState(t,e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e}),this.children.push(e)}setLoading(t){this.children.forEach((e=>{e.setLoading?e.setLoading(t):e.loading=!!t&&e.name===t}))}async update(t,e){await Promise.all(this.children.map((a=>a.update(t,e))))}}),Zi=t("QXEventEx",class extends U{constructor(){super(...arguments),this.anyEventFns=[]}onAll(t){this.anyEventFns.includes(t)||this.anyEventFns.push(t)}emit(t,...e){super.emit(t,...e),this.anyEventFns.forEach((a=>{a(t,...e)}))}async asyncEmit(t,...e){const a=super.asyncEmit(t,...e),s=this.anyEventFns.map((a=>a(t,...e))),i=Promise.all(s),n=await a,r=await i;return n.concat(...r)}reset(){super.reset(),K(this.anyEventFns)}}),tn=t("ControllerEvent",class{constructor(t){this.getBaseArgs=t,this.isDestroyed=!1,this.evt=new Zi}async emit(t,e){this.isDestroyed||await this.evt.asyncEmit(t,{...this.getBaseArgs(),eventName:t,...e||{}})}on(t,e){this.isDestroyed||this.evt.on(t,e)}off(t,e){this.isDestroyed||this.evt.off(t,e)}onAll(t){this.isDestroyed||this.evt.onAll(t)}destroy(){this.getBaseArgs=void 0,this.evt.reset(),this.isDestroyed=!0}});function en(t,e){return(!Q(t)&&""!==t||!Q(e)&&""!==e)&&t!==e}function an(t){let e=Array.isArray(t)?t[0]:t;return e&&e instanceof yi&&(e=e.getOrigin()),e}function sn(t,a,s){const i=[];return t.forEach((t=>{const{valueRuleType:n}=t,r=t.sysValueRule,o=t.defvalueRule;if("SYSVALUERULE"===n&&r)"REG"===r.ruleType?i.push({pattern:new RegExp(r.regExCode),message:r.ruleInfo,trigger:"change blur"}):"SCRIPT"===r.ruleType&&i.push({validator:(t,e,a,s)=>{if(!e)return!0;try{ga.execScriptFn({rule:t,value:e,callback:a,source:s},r.scriptCode,{isAsync:!1})}catch(t){return console.error(t),!1}return!0},trigger:"change blur"});else if("DEFVALUERULE"===n&&o){const t=s||a;i.push({validator:(a,s,i,n)=>{if(W(n[t]))return!0;const{isPast:r,infoMessage:c}=wa(t,n,o.groupCond);return r||i(new e(c||o.ruleInfo)),!0},trigger:"change blur"})}})),i}function nn(t){const e=[],{maxLength:a,minLength:s}=t,{maxValue:i,minValue:n}=t;return a&&e.push({validator:(t,e,s)=>{if(Q(e)||!(e.length>a))return!0;s(new Error("内容长度必须小于等于".concat(a,",当前长度为").concat(e.length)))}}),s&&e.push({validator:(t,e,a)=>{if(Q(e)||!(e.length<s))return!0;a(new Error("内容长度必须大于等于".concat(s,",当前长度为").concat(e.length)))}}),Q(i)||e.push({validator:(t,e,a)=>{if(!(!Q(e)&&X(e)&&e>i))return!0;a(new Error("值必须小于等于".concat(i)))}}),Q(n)||e.push({validator:(t,e,a)=>{if(!(!Q(e)&&X(e)&&e<n))return!0;a(new Error("值必须大于等于".concat(n)))}}),e}var rn=t("ValueExUtil",class{static mergeDefault(t){return st(t,{textSeparator:",",valueSeparator:","})}static toText(t,a){if(Q(a)||""===a)return"";const{valueType:s,objectNameField:i,textSeparator:n}=this.mergeDefault(t);if(["OBJECTS","OBJECT"].includes(s)){if(!i)throw new e("缺少objectNameField");const t=i.toLowerCase();return"OBJECTS"===s?a.map((e=>e[t]||"---")).join(n):a[t]}return"SIMPLES"===s?a.join(n):"".concat(a)}});function on(t,a){var i;const{name:n,valueType:r,defaultValue:o,valueFormat:c}=t,{data:l,context:h,params:d}=a;if(Q(r)&&Q(o))return;if("RESET"===r)return null;const u=l[n];if(!it(u)){if(!r&&o)return o;switch(r){case"APPDATA":if(Object.prototype.hasOwnProperty.call(d,o))return d[o];if(Object.prototype.hasOwnProperty.call(h,o))return h[o];break;case"OPERATORNAME":return h.srfusername;case"OPERATOR":return h.srfuserid;case"CURTIME":return rt().format(c);case"PARAM":return l[o];case"SESSION":case"APPLICATION":if(!(null==(i=ibiz.appData)?void 0:i.context))throw new e("appdata.context不存在");return ibiz.appData.context[o];case"CONTEXT":return d[o];case"UNIQUEID":return j();default:throw new s({},"默认值类型[".concat(r,"]未支持"))}}}var cn="__self",ln=t("BaseController",class{constructor(t,e,a,s){this.model=t,this.context=e,this.params=a,this.ctx=s,this.state={},this.name="",this.evt=new tn(this.getEventArgs.bind(this)),this.mountCounter=new qi(this.mounted.bind(this)),this.childNames=[],this.name=t.name||t.id,this.initState()}get _evt(){return this.evt}initState(){this.state.isCreated=!1,this.state.isMounted=!1,this.state.isDestroyed=!1}getEventArgs(){return{context:this.context,params:this.params,data:[],targetName:this.model.name,view:this.ctx.view}}async created(){this.mountCounter.enroll(cn),await this.onCreated(),this.state.isCreated=!0,this.force((()=>{this.mountSelf()})),ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onCreated")),this._evt.emit("onCreated",void 0)}async onCreated(){this.ctx.evt.on("onForecast",(t=>{this.childNames.includes(t)&&this.mountCounter.enroll(t)})),this.ctx.evt.on("onRegister",((t,e)=>{this.childNames.includes(t)&&e.evt.on("onMounted",(()=>{this.mountCounter.attend(t)}))}))}async mountSelf(){this.mountCounter.registration.get(cn)||this.mountCounter.attend(cn)}async mounted(){await this.onMounted(),this.state.isMounted=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onMounted")),this._evt.emit("onMounted",void 0)}async onMounted(){}async destroyed(){await this.onDestroyed(),this.state.isDestroyed=!0,ibiz.log.debug("".concat(this.constructor.name,":").concat(this.name," onDestroyed")),await this._evt.emit("onDestroyed",void 0),this.evt.destroy()}async onDestroyed(){}force(t){}getController(t,e=!1){return this.ctx.getController(t,e)}getTopView(){return this.ctx.getTopView()}listenNewController(t){this.ctx.evt.on("onRegister",t)}}),hn=class t{constructor(t){this.msgGroupId=t,this.viewMsgMap=new Map}async init(t){var a,s;const i=ibiz.hub.getApp(t.srfappid).model,n=null==(a=i.appViewMsgGroups)?void 0:a.find((t=>t.id===this.msgGroupId));if(!n)throw new e("找不到视图消息组".concat(this.msgGroupId,"的模型"));this.msgGroup=n;const r=n.appViewMsgGroupDetails.map((t=>t.appViewMsgId));if(null==(s=i.appViewMsgs)||s.forEach((t=>{const e=r.indexOf(t.id);-1!==e&&(this.viewMsgMap.set(t.id,t),r.splice(e,1))})),r.length)throw new e("没有找到".concat(r.join(","),"视图消息模型"))}getDeFieldName(t,e){var a,s;if(e)return null==(s=null==(a=Qe(t,e))?void 0:a.name)?void 0:s.toLowerCase()}static async fetchDataSet(t,e,s){const{appDataEntityId:i,appDEDataSetId:n}=t;if(!n)throw new a(t,"未配置实体数据集");const r=await ibiz.hub.getApp(e.srfappid).deService.exec(i,n,e,s);return r.data.length?r.data:[]}async calcViewMessages(t,e){const a=this.msgGroup.appViewMsgGroupDetails,s=[];return(null==a?void 0:a.length)&&await Promise.all(a.map((async a=>{if(1===this.viewMsgMap.get(a.appViewMsgId).dynamicMode){const i=await this.calcDynaMsgs(a,t,e);s.push(...i)}else{const t=this.calcStaticMsg(a);s.push(t)}}))),s}calcStaticMsg(t){const{position:e}=t,{title:a,message:s,removeMode:i,position:n,messageType:r}=this.viewMsgMap.get(t.appViewMsgId);return{title:a,message:s,position:e||n,messageType:r,removeMode:i}}async calcDynaMsgs(e,s,i){const n=this.viewMsgMap.get(e.appViewMsgId),{appDataEntityId:r,orderValueAppDEFieldId:o,titleAppDEFieldId:c,removeFlagAppDEFieldId:l,msgTypeAppDEFieldId:h,contentAppDEFieldId:d,msgPosAppDEFieldId:u}=n;if(!r)throw new a(n,"未配置应用实体");const p=await ibiz.hub.getAppDataEntity(r,s.srfappid),m={...i},f=this.getDeFieldName(p,o);f&&(m.sort="".concat(f,",asc"));const g=await t.fetchDataSet(n,s,m);if(!g.length)return[];const w=this.calcStaticMsg(e),E=this.getDeFieldName(p,c),v=this.getDeFieldName(p,u),y=this.getDeFieldName(p,d),I=this.getDeFieldName(p,h),D=this.getDeFieldName(p,l);return g.map((t=>{const e={};return v&&!Q(t[v])&&(e.position=t[v]),E&&!Q(t[E])&&(e.title=t[E]),y&&!Q(t[y])&&(e.message=t[y]),I&&!Q(t[I])&&(e.messageType=t[I]),D&&!Q(t[D])&&(e.removeMode=t[D]),J(w,e)}))}},dn=t("ViewController",class extends ln{constructor(t,e,a,s){super(ibiz.util.layoutPanel.fill(t),i.create({},e),a||{},new $i(s)),this.session={},this.modal=new Na({}),this.providers={},this.engines=[],this.slotProps={},this.counters={},this.viewLoading=new Xi,this.isCloseView=!1,this._isActive=!0,s&&s.registerController(this.model.name,this),this.ctx.init(this),this.initEngines()}get _evt(){return this.evt}get parentView(){var t;return null==(t=this.ctx.parent)?void 0:t.view}get isActive(){return this._isActive}onActivated(){this._isActive=!0,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")激活"))}onDeactivated(){this._isActive=!1,ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")暂停"))}initEngines(){const t=ra(this.model);if(t.length)t.forEach((t=>{const e=ibiz.engine.getEngine(t,this);e&&this.engines.push(e)}));else{const t=ibiz.engine.getEngine({engineCat:"VIEW",engineType:this.model.viewType},this);t&&this.engines.push(t)}}async initCounters(){const t=this.model.viewLayoutPanel,{appCounterRefs:e}=t;if(e&&e.length>0)try{await Promise.all(e.map((async t=>{const e=await Ms.getCounterByRef(t,this.context);this.counters[t.id]=e})))}catch(t){console.error(t)}}initState(){super.initState(),this.state.isLoading=!1,this.state.caption=this.model.caption,this.state.srfactiveviewdata=null,this.state.viewMessages={}}async onCreated(){await super.onCreated(),this.modal.hooks.beforeDismiss.tapPromise((async t=>{it(this.state.closeOK)&&(t.ok=this.state.closeOK),await this._evt.emit("onCloseView",{...t})})),this._evt.emit("onViewInfoChange",{caption:this.model.caption,title:this.model.title}),this.handleContextParams();const t=this.model.viewLayoutPanel;this.childNames.push(t.name);const e=await Ya(t);this.providers[t.name]=e;const a=ia(this.model);a&&await Promise.all(a.map((async t=>{const e=await Ya(t);this.providers[t.name||t.id]=e}))),await this.initCounters();const s=na(this.model);s.length&&(this.scheduler=ibiz.scheduler.createViewScheduler(s),this.scheduler.defaultParamsCb=()=>this.getEventArgs(),this.scheduler.hasViewEventTrigger&&this.evt.onAll(((t,e)=>{this.scheduler.triggerViewEvent(e)}))),this.initViewMsg(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onCreated())))}async onMounted(){var t;await super.onMounted(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onMounted()))),null==(t=this.scheduler)||t.startTimerTrigger()}async onDestroyed(){await super.onDestroyed(),this.engines.length&&await Promise.all(this.engines.map((t=>t.onDestroyed()))),this.ctx.destroy(),this.context.destroy(),this.engines=[],this.scheduler&&this.scheduler.destroy(),ibiz.log.debug("视图[".concat(this.model.name,"](").concat(this.model.id,")销毁"))}handleContextParams(){this.context.srfappid=this.model.appId,(Q(this.context.srfsessionid)||Z(this.context.srfsessionid))&&(this.context.srfsessionid=j());const t=this.model.appViewNavContexts;let e={};F(t)&&(e=Re(t,this.params,this.context)),Object.assign(this.context,e);const a=this.model.appViewNavParams;let s={};F(a)&&(s=Re(a,this.params,this.context)),Object.assign(this.params,s),this.state.isMounted&&this.callUIAction("Refresh")}async call(t,e){let a;for(const s of this.engines)if(a=await s.call(t,e),void 0!==a)break;return a}async callUIAction(t,a){const s=this.call(t,a);if(void 0===s)throw new e("没有引擎支持预置界面行为".concat(t));return s}async closeView(t={ok:!1,data:[]}){await this.modal.dismiss(t)}startLoading(){this.viewLoading.begin(),this.state.isLoading=this.viewLoading.isLoading}endLoading(){this.viewLoading.end(),this.state.isLoading=this.viewLoading.isLoading}setLayoutPanel(t){var e;this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)})),(null==(e=this.scheduler)?void 0:e.hasControlEventTrigger)&&t.evt.on("onControlEvent",(t=>{this.scheduler.triggerControlEvent(t.triggerControlName,t.triggerEventName,t.triggerEvent)}))}async initViewMsg(){const{appViewMsgGroupId:t}=this.model;if(t){this.state.viewMessages={TOP:[],BOTTOM:[],BODY:[],POPUP:[]},this.viewMsgController=new hn(t),await this.viewMsgController.init(this.context);(await this.viewMsgController.calcViewMessages(this.context,this.params)).forEach((t=>{["TOP","BOTTOM","BODY","POPUP"].includes(t.position)&&this.state.viewMessages[t.position].push(t)})),this.state.viewMessages.POPUP.length&&this.alertViewMessage(this.state.viewMessages.POPUP)}}async alertViewMessage(t){const[e,...a]=t,s={title:e.title,desc:e.message};"WARN"===e.messageType?await ibiz.modal.warning(s):"ERROR"===e.messageType?await ibiz.modal.error(s):await ibiz.modal.info(s),a.length&&this.alertViewMessage(a)}}),un=(t("MobViewController",class extends dn{}),t("WFStepTraceViewController",class extends dn{initState(){super.initState(),this.state.historyData=null}async onCreated(){var t;await super.onCreated();const e=ibiz.hub.getApp(this.context.srfappid);if(null==(t=this.ctx.parent)?void 0:t.view.model.appDataEntityId){const t=await e.deService.getService(this.ctx.parent.view.model.appDataEntityId),a=Object.assign(this.context.clone(),this.params),s=await t.wf.getWFHistory(a);s.data&&(this.state.historyData=s.data)}}}),t("EditorController",class{constructor(t,e){this.style={},this.placeHolder="",this.editorParams={},this.model=t,this.parent=e,this.context=e.context,this.params=e.params}get readonly(){return!!this.model.readOnly}async init(){await this.onInit()}async onInit(){if(this.model.placeHolder&&(this.placeHolder=this.model.placeHolder),this.model.editorParams&&Object.keys(this.model.editorParams).forEach((t=>{this.editorParams[t]=this.model.editorParams[t]})),this.model.editorWidth){const t=this.model.editorWidth;this.style.width=t>0&&t<=1?"".concat(100*t,"%"):"".concat(t,"px")}if(this.model.editorHeight){const t=this.model.editorHeight;this.style.height=t>0&&t<=1?"".concat(100*t,"%"):"".concat(t,"px")}}handlePublicParams(t,e,a){const{navigateContexts:s,navigateParams:i}=this.model;let n={};s&&t&&(n=Re(s,t,a,e));const r=Object.assign(e.clone(),n);let o={};return i&&t&&(o=Re(i,t,a,e)),{context:r,params:o}}toObj(t){if(!t)return;return new Function("return (".concat(t,");"))()}toBoolean(t){return Object.is("true",t)}})),pn=(t("CodeListEditorController",class extends un{async loadCodeList(t){const{context:e,params:s}=this.handlePublicParams(t,this.context,this.params);if(this.model.appCodeListId){const t=await ibiz.hub.getApp(this.context.srfappid);let a=[];return a=await t.codeList.get(this.model.appCodeListId,e,s),a}throw new a(this.model,"编辑器类型[".concat(this.model.editorType,"],未配置代码表"))}}),t("ControlController",class extends ln{constructor(t,e,a,s){super(t,e,a,s),this.controlParams={},this.providers={},this.registerToCtx();const i=ibiz.util.layoutPanel.get("".concat(t.controlType,"_DEFAULT"));i&&(this.controlPanel=i)}get _evt(){return this.evt}get view(){return this.ctx.view}registerToCtx(){this.ctx.registerController(this.model.name||this.model.id,this)}getEventArgs(){return{...super.getEventArgs(),data:this.getData()||[],ctrl:this}}initState(){super.initState(),this.state.isLoading=!1}async onCreated(){if(await super.onCreated(),this.controlPanel){this.childNames.push(this.controlPanel.name);const t=await Ya(this.controlPanel);this.providers[this.controlPanel.name]=t}this.handleControlParams(),this.initControlScheduler(this.model.controlLogics)}async onMounted(){var t;await super.onMounted(),null==(t=this.scheduler)||t.startTimerTrigger()}async onDestroyed(){await super.onDestroyed(),this.scheduler&&this.scheduler.destroy()}getControlType(){return this.model.controlType}getData(){return null}async startLoading(){this.state.isLoading=!0,this.ctx.startLoading()}async endLoading(){this.state.isLoading=!1,this.ctx.endLoading()}handlerAbilityParams(t){const e=this.context.clone(),a={...this.params};let s=this.getData()||[];return(null==t?void 0:t.data)&&(s=Array.isArray(t.data)?t.data:[t.data]),(null==t?void 0:t.context)&&Object.assign(e,t.context),(null==t?void 0:t.viewParam)&&Object.assign(a,t.viewParam),{context:e,params:a,data:s}}setLayoutPanel(t){this.layoutPanel=t,this.layoutPanel.state.isMounted?this.mountCounter.attend(this.layoutPanel.model.name):this.layoutPanel.evt.on("onMounted",(()=>{this.mountCounter.attend(this.layoutPanel.model.name)}))}handleControlParams(){if(!this.model.controlParam)return;const{ctrlParams:t}=this.model.controlParam;let e={};F(t)&&(e=Re(t,this.params,this.context)),Object.assign(this.controlParams,e)}initControlScheduler(t=[]){0!==t.length&&(this.scheduler=ibiz.scheduler.createControlScheduler(t),this.scheduler.defaultParamsCb=()=>this.getEventArgs())}actionNotification(t,e){var a;const{ctrlMsg:s}=this.model,i=null==(a=null==s?void 0:s.ctrlMsgItems)?void 0:a.find((e=>e.name===t));let n,r;if(i&&i.content){r=Q(i.timeout)?void 0:i.timeout/1e3;const t={...this.getEventArgs()};(null==e?void 0:e.data)&&(t.data=e.data),n=ga.execScriptFn(t,"`".concat(i.content,"`"),{isAsync:!1,singleRowReturn:!0})}else{const e="CONTROL.".concat(this.model.controlType,".").concat(t).toUpperCase();n=ibiz.i18n.t(e,""),n===e&&(n="")}if(!n&&(null==e?void 0:e.default)&&(n=e.default),!n&&(null==e?void 0:e.error)&&(n=n||e.error.message),n){if(null==e?void 0:e.error)throw ibiz.log.error(e.error),new d(n,r);ibiz.message.success(n,r,0===r)}}})),mn=t("MDControlController",class extends pn{constructor(){super(...arguments),this.fieldIdNameMap=new Map}get _evt(){return this.evt}initState(){super.initState(),this.state.items=[],this.state.selectedData=[],this.state.searchParams={},this.state.noSort=!1,this.state.sortQuery="",this.state.curPage=1,this.state.size=20,this.state.total=0,this.state.isLoaded=!1,this.state.singleSelect=!0,this.state.mdctrlActiveMode=0,this.state.groups=[]}async onCreated(){var t;await super.onCreated(),this.dataEntity=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId),null==(t=this.dataEntity.appDEFields)||t.forEach((t=>{this.fieldIdNameMap.set(t.id,t.name)})),this.onDataChange=this.onDataChange.bind(this),ibiz.mc.command.change.on(this.onDataChange),this.setSort()}async onMounted(){await super.onMounted(),this.state.loadDefault&&this.load({isInitialLoad:!0})}onDestroyed(){return ibiz.mc.command.change.off(this.onDataChange),super.onDestroyed()}onDataChange(t){t.data&&t.data.srfdecodename===this.dataEntity.codeName&&this.refresh()}setSort(t,e){t&&e&&(this.state.sortQuery="".concat(t,",").concat(e))}async getFetchParams(t){const{curPage:e,size:a,sortQuery:s,noSort:i}=this.state,n={...this.params};return a&&(n.page=e-1,n.size=a),!i&&s&&(n.sort=s),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),t&&Object.assign(n,t),n}async load(t={}){if(this.state.isSimple)return[];await this.startLoading();try{const e=!0===t.isInitialLoad,a=!0===t.isLoadMore;e?this.state.curPage=1:a&&(this.state.curPage+=1);const{context:s}=this.handlerAbilityParams(t),i=await this.getFetchParams(null==t?void 0:t.viewParam),n=await this.service.fetch(s,i);"number"==typeof n.total&&(this.state.total=n.total),a?this.state.items.push(...n.data):this.state.items=n.data,await this.afterLoad(t,n.data),this.state.isLoaded=!0,await this._evt.emit("onLoadSuccess",{isInitialLoad:e})}catch(t){throw await this._evt.emit("onLoadError",void 0),this.actionNotification("FETCHERROR",{error:t}),t}finally{await this.endLoading()}return this.actionNotification("FETCHSUCCESS"),this.state.items}async afterLoad(t,e){return e}async refresh(){await this.load({isInitialLoad:!1})}async remove(t){const{context:a,params:s,data:i}=this.handlerAbilityParams(t);if(!(null==i?void 0:i.length))throw new e("未选中数据");if(!0!==(null==t?void 0:t.silent)){if(!await ibiz.confirm.error({title:"数据删除",desc:"确认删除数据?"}))return}await this._evt.emit("onBeforeRemove",void 0),await this.startLoading();let n=!1;try{const e=Ke(this.model.appDataEntityId);await Va(i.map((async t=>{if(0!==t.srfuf){const i=a.clone();i[e]=t.srfkey,await this.service.remove(i,s),n=!0}this.afterRemove(t)}))),!0!==(null==t?void 0:t.silent)&&this.actionNotification("REMOVESUCCESS",{data:i,default:"数据[".concat(i.map((t=>t.srfmajortext)).join("、"),"]删除成功!")}),n&&await this.refresh()}catch(t){throw await this._evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t,data:i}),t}finally{await this.endLoading()}this.state.selectedData=[],await this._evt.emit("onRemoveSuccess",void 0)}afterRemove(t){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));-1!==e&&this.state.items.splice(e,1)}getData(){return this.state.selectedData||[]}setActive(t){return this._evt.emit("onActive",{data:[t]})}setSelection(t){const{selectedData:e}=this.state;u(e,t)||(this.state.selectedData=t,this._evt.emit("onSelectionChange",{data:t}))}async onRowClick(t){const{selectedData:e}=this.state,a=e.filter((e=>e.srfkey!==t.srfkey));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a),1===this.state.mdctrlActiveMode&&await this.setActive(t)}async onDbRowClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}async importData(){}async exportData(t){}}),fn=t("AppMenuController",class extends pn{initState(){super.initState(),this.state.menuItemsState={}}get routeDepth(){return this.view.modal.routeDepth}async onCreated(){var t;await super.onCreated(),this.app=await ibiz.hub.getApp(this.context.srfappid),null==(t=this.model.appMenuItems)||t.forEach((t=>{this.initMenuItemState(t)}))}async onClickMenuItem(t,s,i=!0){const n=p(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!n)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:s}),!n.appFuncId)throw new a(n,"没有配置应用功能");const r=this.context.clone();this.routeDepth&&i&&Object.assign(r,{toRouteDepth:this.routeDepth+1}),await ibiz.commands.execute(Vi.TAG,n.appFuncId,r,this.params)}initMenuItemState(t){var e;const a={permitted:!0,visible:!0};if(t.hidden)a.visible=!1;else{let s=!0;t.accessKey&&(s=this.app.authority.calcByResCode(t.accessKey));let i=s;if(null==(e=t.appMenuItems)?void 0:e.length){const e=t.appMenuItems.map((t=>this.initMenuItemState(t).visible));i=i&&e.includes(!0)}a.permitted=s,a.visible=i}return this.state.menuItemsState[t.id]=a,a}getAllItems(){const t=[],e=a=>{a.forEach((a=>{t.push(a),a.appMenuItems&&a.appMenuItems.length>0&&e(a.appMenuItems)}))};return e(this.model.appMenuItems),t}getCounter(t){const{counters:e}=this.ctx.view;return e[t]?e[t]:null}}),gn=(t("AppMenuIconViewController",class extends fn{async onClickMenuItem(t,s){const i=p(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!i)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:s}),!i.appFuncId)throw new a(i,"没有配置应用功能");const n=this.context.clone();1===this.routeDepth&&Object.assign(n,{toRouteDepth:1}),await ibiz.commands.execute(Vi.TAG,i.appFuncId,n,this.params)}}),t("CalendarService",class extends Di{async search(t,e={}){const{sysCalendarItems:a}=this.model;if(!a)return[];const s=a.map((async a=>{const s=a.appDEDataSetId||"fetchdefault";return this.exec2(s,t,e,void 0,a.appDataEntityId)}));return(await Promise.all(s)).map(((t,e)=>this.setCalendarConfigData(t.data,e))).flat()}setCalendarConfigData(t,a){const{sysCalendarItems:s}=this.model;if(!s)throw new e("未找到日历项模型");const i=s[a];if(!i)throw new e("未找到日历项模型");return t.map((t=>new Li(i,t)))}async exec2(t,e,a={},s={},i=this.model.appDataEntityId){return await this.app.deService.exec(i,t,e,a,s)}}));t("CalendarController",class extends mn{initState(){super.initState(),this.state.selectedDate=new Date,this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new gn(this.model),await this.service.init(this.context)}async load(t={}){const e=!0===t.isInitialLoad,{context:a}=this.handlerAbilityParams(t),s=await this.getFetchParams(null==t?void 0:t.viewParam);let i;await this.startLoading();try{i=await this.service.search(a,s)}finally{await this.endLoading()}return await this.afterLoad(t,i),this.state.isLoaded=!0,this.state.items=i,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),i}getCurSelectDate(t){const{selectedDate:e}=this.state,{start:a,end:s}=t;if(!a||!s){const t=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,1);return{start:rt(t).format("YYYY-MM-DD HH:mm:ss"),end:rt(a).format("YYYY-MM-DD HH:mm:ss")}}return{start:a,end:s}}async getFetchParams(t={}){const{curPage:e,size:a,sortQuery:s,noSort:i}=this.state,n={...this.params};!i&&s&&(n.sort=s),await this._evt.emit("onBeforeLoad",void 0),Object.assign(n,{...this.state.searchParams}),a&&(n.page=e-1,n.size=a),t&&Object.assign(n,t);const r=this.getCurSelectDate(n);return Object.assign(n,r),n}async onRowClick(t){const{selectedData:e}=this.state,a=e.filter((e=>e.deData.srfkey!==t.deData.srfkey));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a),1===this.state.mdctrlActiveMode&&await this.setActive(t)}setSelectDate(t){this.state.selectedDate=t}});rt.extend(ot),rt.extend(ct),rt.extend(lt),rt.extend(ht),rt.extend(dt);var wn="$default_group",En=class{constructor(t,e){this.model=t,this.chartGenerator=e,this.staticOptions={},this.autoCompleteCategory=!0,this.model=t,this.chartGenerator=e;const{chartSeriesEncode:s,caption:i,id:n,userParam:r}=t;if(!t.catalogField)throw new a(t,"缺少分类属性配置");if(!t.valueField)throw new a(t,"缺少值属性配置");this.catalogField=e.getFieldKey(t.catalogField),this.valueField=e.getFieldKey(t.valueField),this.groupField=t.seriesField?e.getFieldKey(t.seriesField):void 0;const{chartXAxisId:o,chartYAxisId:c}=s||{};this.xAxisIndex=I(o),this.yAxisIndex=I(c),this.seriesName=i||n,this.staticOptions=this.calcStaticOptions(),r&&(this.seriesUserParam=Pn(r))}calcStaticOptions(){return{type:this.model.seriesType,name:this.seriesName,emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}}}translateVal(t,e,a=!1){if(Q(e))return;if(Q(t))return e;const s=this.chartGenerator.codeListMap.get(t);if(null==s?void 0:s.length){const t=s.find((t=>t.value===e));if(t)return t.text}return a?void 0:e}calcGroupData(t){this.groupData={};const e=this.groupData,{seriesCodeListId:a,catalogCodeListId:s}=this.model;return t.forEach((t=>{let i=wn;if(this.groupField){const e=this.translateVal(a,t[this.groupField]);if(Q(e))return;i=e}if(!e[i]&&(e[i]=new Map,s&&this.autoCompleteCategory)){this.chartGenerator.codeListMap.get(s).forEach((t=>{e[i].set(t.text,{value:0})}))}const n=this.translateVal(s,t[this.catalogField],!0);n&&(e[i].get(n)||e[i].set(n,{value:0}),e[i].get(n).value+=t[this.valueField],e[i].get(n).deData=t)})),e}calcGroupSeries(t){return Object.keys(t).map((e=>{const a=t[e],s=this.calcSeriesData(a);let i={...this.staticOptions,data:s};return e!==wn&&(i.name=e),this.seriesUserParam&&(i=nt(i,this.seriesUserParam)),i}))}calcSeriesData(t){const e=[];return t.forEach(((t,a)=>{var s;e.push([a,t.value,null==(s=t.deData)?void 0:s.srfkey])})),e}calcByData(t){const e=this.dataPreprocess(t),a=this.calcGroupData(e);return this.addTimeData(a),this.calcGroupSeries(a)}getSrfkeyByParams(t){return t.value[2]}dataPreprocess(t){const e=[];t.forEach((t=>{e.push(tt(t))}));const{groupMode:a}=this.model;return a&&e.forEach((t=>{let e="";if("DAY"===a||"YEAR"===a||"MONTH"===a){if("DAY"===a?e="YYYY-MM-DD":"YEAR"===a?e="YYYY":"MONTH"===a&&(e="YYYY-MM"),t[this.catalogField]){const a=rt(t[this.catalogField]).format(e);t[this.catalogField]=a}}else if("QUARTER"===a){if(t[this.catalogField]){const e="".concat(rt(t[this.catalogField]).format("YYYY"),"-").concat(rt(t[this.catalogField]).quarter());t[this.catalogField]=e}}else if("YEARWEEK"===a&&t[this.catalogField]){const e="".concat(rt(t[this.catalogField]).format("YYYY"),"-").concat(rt(t[this.catalogField]).week());t[this.catalogField]=e}})),e}sortTimeData(t){const{groupMode:e}=this.model;Object.keys(t).forEach((a=>{const s=t[a];let i=[];"DAY"===e||"YEAR"===e||"MONTH"===e?i=Array.from(s.keys()).sort(((t,e)=>rt(t).diff(rt(e)))):"QUARTER"!==e&&"YEARWEEK"!==e||(i=Array.from(s.keys()).sort(((t,e)=>{const[a,s]=t.split("-"),[i,n]=e.split("-");return a!==i?parseInt(a,10)-parseInt(i,10):parseInt(s,10)-parseInt(n,10)})));const n=new Map;i.forEach((t=>{n.set(t,s.get(t))})),t[a]=n}))}addTimeData(t){const{groupMode:e}=this.model;if(!e||"CODELIST"===e)return;const a=[];Object.keys(t).forEach((e=>{t[e].forEach(((t,e)=>{a.push(rt(e))}))}));const s=rt.max(a),i=rt.min(a);if("DAY"===e){let e=i;const a=s;for(;null==e?void 0:e.isSameOrBefore(a,"day");){const a=e.format("YYYY-MM-DD");Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e=e.add(1,"day")}}else if("YEAR"===e){let e=i.year();const a=s.year();for(;e<=a;){const a=e.toString();Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e+=1}}else if("MONTH"===e){let e=i.clone().startOf("month");const a=s.clone().startOf("month");for(;e.isSameOrBefore(a);){const a=e.format("YYYY-MM");Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})})),e=e.add(1,"month")}}else if("QUARTER"===e){const e=[];Object.keys(t).forEach((a=>{t[a].forEach(((t,a)=>{e.push(a)}))}));const a=e.reduce(((t,e)=>e<t?e:t),e[0]),s=e.reduce(((t,e)=>e>t?e:t),e[0]),[i]=a.split("-"),[n]=s.split("-");for(let e=parseInt(i,10);e<=parseInt(n,10);e++)for(let a=1;a<=4;a++){const s="".concat(e,"-").concat(a);Object.keys(t).forEach((e=>{t[e].get(s)||t[e].set(s,{value:0})}))}}else if("YEARWEEK"===e){const e=[];Object.keys(t).forEach((a=>{t[a].forEach(((t,a)=>{e.push(a)}))}));const a=e.reduce(((t,e)=>e<t?e:t),e[0]),s=e.reduce(((t,e)=>e>t?e:t),e[0]),[i]=a.split("-"),[n]=s.split("-");for(let e=parseInt(i,10);e<=parseInt(n,10);e++){const a=rt("".concat(e,"-12-31")).isoWeek();for(let s=1;s<=a;s++){const a="".concat(e,"-").concat(s);Object.keys(t).forEach((e=>{t[e].get(a)||t[e].set(a,{value:0})}))}}}this.sortTimeData(t)}},vn=class extends En{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex;const{stack:e,step:s}=this.model;return s&&(t.step="middle"),t}},yn=class extends En{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,this.model,t}},In=class extends En{calcStaticOptions(){const t=super.calcStaticOptions();return t.label.formatter="{b}: {d}%({c})",t.label.position="outer",t}calcSeriesData(t){return Object.keys(t).map((e=>{var a;const s=t.get(e);return{name:e,value:[s.value,null==(a=s.deData)?void 0:a.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},Dn=class extends En{calcStaticOptions(){const t=super.calcStaticOptions();return t.label.formatter="{b}: {d}%({c})",t.label.position="outside",t}calcSeriesData(t){return Object.keys(t).map((e=>{var a;const s=t.get(e);return{name:e,value:[s.value,null==(a=s.deData)?void 0:a.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},Cn=class extends En{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new a(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new a(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,t}},An=class{constructor(t){this.indicator={},this.index=t}get indicatorKeys(){return this._indicatorKeys&&this._indicatorKeys.length===Object.keys(this.indicator).length||(this._indicatorKeys=Object.keys(this.indicator).sort()),this._indicatorKeys}updateIndicator(t,e){const a=this.indicator[t];(!a||a.max<e)&&(this.indicator[t]={max:e})}toOptions(){const t=Math.max(...Object.values(this.indicator).map((t=>t.max)));return{indicator:this.indicatorKeys.map((e=>({name:e,max:t})))}}},bn=class extends En{calcStaticOptions(){return super.calcStaticOptions()}calcRadarCoordSystem(t){const e=this.calcGroupData(t);this.chartGenerator.radarMap.has(this.catalogField)||this.chartGenerator.radarMap.set(this.catalogField,new An(this.chartGenerator.radarMap.size));const a=this.chartGenerator.radarMap.get(this.catalogField);Object.values(e).forEach((t=>{Object.keys(t).forEach((e=>{a.updateIndicator(e,t.get(e).value)}))}))}calcByData(t){const e=this.groupData,a=this.chartGenerator.radarMap.get(this.catalogField),s=Object.keys(e).map((t=>{const s=e[t],i=a.indicatorKeys.map((t=>s.has(t)?s.get(t):0));return{name:t===wn?this.seriesName:t,value:i}}));let i={...this.staticOptions,data:s};return this.seriesUserParam&&(i=nt(i,this.seriesUserParam)),i}getSrfkeyByParams(t){return t.value[1]}};function Pn(t){const e={};return t&&Object.keys(t).forEach((a=>{const s=a.indexOf(".");if(-1===s)return;const i=a.slice(s+1);if(i)try{e[i]=JSON.parse(t[a])}catch(s){e[i]=t[a]}})),e}var Sn=class{constructor(t){this.model=t,this.staticOptions={tooltip:{show:!0}},this.options={},this.seriesGenerators=[],this.radarMap=new Map,this.codeListMap=new Map;const{dechartTitle:e,dechartLegend:a,chartXAxises:s,chartYAxises:i,userParam:n}=t;e&&(this.staticOptions.title=this.calcTitleOption(e)),a&&(this.staticOptions.legend=this.calcLegendOption(a)),(null==s?void 0:s.length)&&(this.staticOptions.xAxis=this.calcXYAxisOption(s)),(null==i?void 0:i.length)&&(this.staticOptions.yAxis=this.calcXYAxisOption(i)),n&&(this.chartUserParam=Pn(n))}initSeriesGenerators(){var t;null==(t=this.model.dechartSerieses)||t.forEach((t=>{let e;switch(t.seriesType){case"line":e=new vn(t,this);break;case"bar":e=new yn(t,this);break;case"scatter":e=new Cn(t,this);break;case"pie":e=new Dn(t,this);break;case"funnel":e=new In(t,this);break;case"radar":e=new bn(t,this);break;default:ibiz.log.error("图表暂未支持序列类型".concat(t.seriesType))}e&&this.seriesGenerators.push(e)}))}calcTitleOption(t){const{showTitle:e,title:a,subTitle:s,titlePos:i}=t,n={show:e,text:a,subtext:s,left:"center"},r=null==i?void 0:i.toLowerCase();return"left"===r||"right"===r?n.left=r:"bottom"!==r&&"top"!==r||(n.top=r),n}calcLegendOption(t){var e;const{showLegend:a,legendPos:s}=t,i={};i.show=a,1===(null==(e=this.model.dechartSerieses)?void 0:e.length)&&(i.show=!1);const n=null==s?void 0:s.toLowerCase();return"left"===n||"right"===n?(i.left=n,i.top="middle",i.orient="vertical"):"bottom"===n&&(i.top=n),i}calcXYAxisOption(t){const e=[];return t.forEach((t=>{const{position:a,dataShowMode:s,userParam:i}=t;let n={type:t.echartsType,name:t.caption,max:t.maxValue,min:t.minValue,position:a,axisLabel:{formatter:t=>1===s?t.length>4?"".concat(t.slice(0,4).split("").join("\n"),"\n..."):t.split("").join("\n"):2===s&&t.length>4?"".concat(t.slice(0,4),"..."):t,rotate:3===s?45:0}};i&&(n=nt(n,Pn(i))),e.push(n)})),e}async init(t,e){await this.loadCodeList(t,e),this.entity=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId),this.initSeriesGenerators()}getFieldKey(t){const e=this.entity.appDEFields.find((e=>e.name===t));return e?e.codeName.toLowerCase():t.toLowerCase()}async loadCodeList(t,e){var a;if(this.codeListMap.clear(),!(null==(a=this.model.dechartSerieses)?void 0:a.length))return;const s=ibiz.hub.getApp(t.srfappid),i=async a=>{if(!a||this.codeListMap.has(a))return;const i=await s.codeList.get(a,t,e);this.codeListMap.set(a,i)};await Promise.all(this.model.dechartSerieses.map((async t=>{const{seriesCodeListId:e,catalogCodeListId:a}=t;await i(e),await i(a)})))}calcOptionsByData(t){this.radarMap.clear(),this.options={series:[],radar:[]},this.seriesGenerators.forEach((e=>{"radar"===e.model.seriesType&&e.calcRadarCoordSystem(t)})),this.radarMap.size&&(this.options.radar=[...this.radarMap.values()].map((t=>t.toOptions())));const e=[];return this.seriesGenerators.forEach((a=>{const s=a.calcByData(t);s instanceof Array?e.push(...s):e.push(s)})),this.options.series=e,this.options=nt(this.staticOptions,this.options),this.chartUserParam&&(this.options=nt(this.options,this.chartUserParam)),this.options}getSrfkeyByParams(t){const a=this.seriesGenerators[t.seriesIndex];if(!a)throw new e("找不到".concat(t.seriesIndex,"序列的generator!"));return a.getSrfkeyByParams(t)}},xn=t("ChartService",class extends Di{}),_n=(t("ChartController",class extends mn{initState(){super.initState(),this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new xn(this.model),await this.service.init(this.context),this.generator=new Sn(this.model),await this.generator.init(this.context,this.params),window.addEventListener("resize",this.resizeChart)}async afterLoad(t,e){const a=await super.afterLoad(t,e);return e.forEach((t=>{Object.assign(t,{srfcount:1})})),this.calcOptions(),a}initChart(t){this.chart=t,this.chart.on("click",(t=>{const e=this.generator.getSrfkeyByParams(t),a=this.state.items.find((t=>t.srfkey===e));console.log("实体数据",a)}))}calcOptions(t=this.state.items){this.options=this.generator.calcOptionsByData(t),this.updateChart()}updateChart(){if(!this.chart)throw new e("chart对象没有正确初始化");if(!this.options)throw new e("options还没计算");this.chart.setOption(this.options),this.resizeChart()}resizeChart(){this.chart&&this.chart.resize()}async onDestroyed(){var t;window.removeEventListener("resize",this.resizeChart),await super.onDestroyed(),null==(t=this.chart)||t.dispose()}}),t("CaptionBarController",class extends pn{initState(){super.initState(),this.view.model.capLanguageRes?this.state.caption=ibiz.i18n.t(this.view.model.capLanguageRes.lanResTag,this.view.model.caption):this.state.caption=this.view.model.caption}async onCreated(){await super.onCreated(),this.view.evt.on("onViewInfoChange",(({caption:t,dataInfo:e})=>{this.state.caption="".concat(this.view.model.caption).concat(e?"-".concat(e):"")}))}}),class{constructor(t,e){this.deLogicParams=t,this.parameters=e,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default"}get context(){return Object.prototype.hasOwnProperty.call(this.params,"context")?this.params.context:this.parameters.context}get data(){return this.parameters.data}get viewParam(){return Object.prototype.hasOwnProperty.call(this.params,"viewParam")?this.params.viewParam:this.parameters.params}resetParam(t){var e;null==(e=this.deLogicParams.get(t))||e.calc(this)}renewParam(t){var e;null==(e=this.deLogicParams.get(t))||e.renew(this)}setLastReturn(t){this.lastReturn=t}initLastReturnParam(t){Object.defineProperty(this.params,t,{enumerable:!0,configurable:!0,get:()=>this.lastReturn})}isEntityParam(t){const e=this.deLogicParams.get(t);return!(!e||!e.model.entityParam)}}),Tn=class{};function Ln(t,e){const{srcDEUILogicParamId:a,srcFieldName:i,srcValue:n}=e,r=e.srcValueType||"SRCDLPARAM",o=i;let c;switch(r){case"SRCDLPARAM":c=t.params[a];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return ibiz.util.rawValue.format(n);case"WEBCONTEXT":case"VIEWPARAM":c=t.parameters.params;break;case"APPLICATION":case"SESSION":case"APPDATA":case"DATACONTEXT":c=t.parameters.context;break;case"ENVPARAM":c=tt(ibiz.env);break;default:throw new s(e,"暂未支持源值类型".concat(r))}if(c&&o)try{c=ga.execScriptFn({srcValue:c},"srcValue.".concat(o),{singleRowReturn:!0,isAsync:!1})}catch(t){throw ibiz.log.error("从源参数取属性".concat(o,"报错,源参数:"),c),t}return c}var Nn=class extends Tn{constructor(t){super(),this.model=t,this.srcParam=t.srcLogicParamId,this.dstParam=t.dstLogicParamId}get dstField(){return this.model.dstFieldName}get op(){return this.model.condOP}get type(){return this.model.paramType}get value(){return this.model.paramValue}test(t,e,i){const n=Ln(t,{srcDEUILogicParamId:this.dstParam,srcFieldName:this.dstField});switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=i[this.value]?i[this.value]:e[this.value];return la(n,this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new a(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=Ln(t,{srcDEUILogicParamId:this.srcParam,srcFieldName:this.value});return la(n,this.op,e)}case"CURTIME":throw new s(this.model,"暂未支持条件值类型为[当前时间]");default:return la(n,this.op,this.value)}}},On=class t extends Tn{constructor(e){super(),this.model=e;const a=e.deuilogicLinkConds||[];this.conds=a.map((e=>"SINGLE"===e.logicType?new Nn(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,s){let i=!0;if(0===this.conds.length)throw new a(this.model,"界面连接条件逻辑组未配置逻辑项");for(let a=0;a<this.conds.length;a++){const n=this.conds[a].test(t,e,s);if("AND"===this.op&&!1===n){i=!1;break}if("OR"===this.op&&!0===n){i=!0;break}}return this.notMode?!i:i}},Mn=class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const{linkMode:e,deuilogicLinkGroupCond:a}=this.model;0===(e||0)&&a&&(this.groupCond=new On(a))}async exec(t){const{linkMode:e}=this.model,{context:a,data:i}=t;switch(e||0){case 0:return!this.groupCond||this.groupCond.test(t,a,i&&i.length>0?i[0]:{});case 1:return!0;case 2:throw new s(this.model,"未支持的逻辑连接类型: 异步结束");case 3:throw new s(this.model,"未支持的逻辑连接类型: 异步拒绝");case 9:throw new s(this.model,"未支持的逻辑连接类型: 异常处理");default:throw new s(this.model,"未支持的逻辑连接类型:".concat(e))}}},Rn=class{constructor(t){this.model=t,this.links=(t.deuilogicLinks||[]).map((t=>new Mn(t)))}},Vn=class extends Rn{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:s,dstDEUILogicParamId:i,retDEUILogicParamId:n}=this.model;if(!e)throw new a(this.model,"未指定应用实体");if(!s)throw new a(this.model,"未指定实体行为");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,s,t.context,r,t.viewParam);c.ok&&(t.params[n]=c.data)}},kn=class extends Rn{async exec(t){const{dstAppDEUIActionId:e,dstDEUILogicParamId:s}=this.model,{data:i,parameters:n}=t;if(!e)throw new a(this.model,"未配置界面行为");let r=[i];if(s){const e=t.params[s];r=e instanceof Array?e:[e]}await ir.execAndResolved(e,{...n,context:t.context,params:t.viewParam,data:r})}},Fn=class extends Rn{async exec(t){}},Wn=class extends Rn{async exec(t){t.isEndNode=!0;const{returnType:e,rawValue:a,returnParamId:i}=this.model;if(e)switch(e){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=ibiz.util.rawValue.format(a);break;case"LOGICPARAM":t.result=t.params[i];break;default:throw new s(this.model,"暂未支持的结束节点返回值类型: ".concat(e))}}},Bn=class extends Rn{async exec(t){const e=this.model.deuilogicNodeParams;if(null==e?void 0:e.length)for(const a of e)switch(a.paramAction){case"SETPARAMVALUE":await this.setParamValue(a,t);break;case"RESETPARAM":await this.resetParam(a,t);break;case"COPYPARAM":await this.copyParam(a,t);break;case"BINDPARAM":await this.bindParam(a,t);break;case"RENEWPARAM":await this.renewParam(a,t);break;case"APPENDPARAM":await this.appendParam(a,t);break;case"SORTPARAM":await this.sortParam(a,t);break;default:throw new s(a,"暂未支持逻辑处理参数操作".concat(a.paramAction))}}setParamValue(t,a){const{dstFieldName:s,dstDEUILogicParamId:i}=t;if(!i)throw new e("没有目标参数对象id");let n=s;a.isEntityParam(i)&&(n=null==n?void 0:n.toLowerCase());const r=Ln(a,t);if(n)try{ga.execScriptFn({srcVal:r,dstParam:a.params[i]},"dstParam.".concat(s," = srcVal"),{singleRowReturn:!1,isAsync:!1})}catch(t){throw ibiz.log.error("给目标参数属性".concat(s,"赋值报错,目标参数:"),a.params[i]),t}else a.params[i]=r}copyParam(t,e){const{dstDEUILogicParamId:a}=t,s=Ln(e,t);e.params[a]=tt(s)}bindParam(t,e){const a=Ln(e,t);e.params[t.dstDEUILogicParamId]=a}resetParam(t,e){const{dstDEUILogicParamId:a}=t;e.resetParam(a)}renewParam(t,e){const{dstDEUILogicParamId:a}=t;e.renewParam(a)}appendParam(t,e){const{dstDEUILogicParamId:a,dstIndex:s,srcIndex:i,srcSize:n}=t,r=Ln(e,t),o=s||0,c=i||0,l=n||r.length;e.params[a].splice(o,0,...r.slice(c,l))}sortParam(t,e){const{dstDEUILogicParamId:a,dstFieldName:s,dstSortDir:i}=t,n=s;e.params[a].sort(((t,e)=>"ASC"===i?t[n]-e[n]:e[n]-t[n]))}},Un=class extends Rn{async exec(t){t.isEndNode=!0;const{invokeMethod:s,invokeCtrlId:i,invokeParamId:n}=this.model;if(!i)throw new a(this.model,"没有配置界面对象");if(!n)throw new a(this.model,"没有配置操作参数");if(!s)throw new a(this.model,"没有配置调用方法");const r=t.params[n];if(!r)throw new e("没有找到操作参数".concat(n));const o=t.params[i];if(!o)throw new e("没有找到界面对象".concat(i));if(!o[s]||!k(o[s]))throw new e("没有找到调用方法".concat(s));await o[s](r)}},jn=class extends Rn{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Ln(t,this.model);t.params[e]=i}},zn=class extends Rn{constructor(){super(...arguments),this.typeMap={INFO:"info",QUESTION:"success",WARNING:"warning",ERROR:"error"}}async exec(t){const{msgBoxType:e,buttonsType:i,msgBoxParamId:n}=this.model;if(!e)throw new a(this.model,"缺少消息类型的配置");if(!i)throw new a(this.model,"缺少按钮类型的配置");let{title:r}=this.model,{message:o}=this.model;if(n){const e=t.params[n];e.title&&(r=e.title),e.message&&(o=e.message)}const c={type:this.typeMap[e],title:r||"消息",desc:o};let l=[];switch(i){case"YESNO":c.confirmButtonText="是",c.cancelButtonText="否",c.showConfirmButton=!0,c.showCancelButton=!0,l=["yes","no"];break;case"OK":c.confirmButtonText="确定",c.showConfirmButton=!0,c.showCancelButton=!1,l=["ok"];break;case"OKCANCEL":c.confirmButtonText="确定",c.cancelButtonText="取消",c.showConfirmButton=!0,c.showCancelButton=!0,l=["ok","cancel"];break;default:throw new s(this.model,"".concat(i,"暂未支持"))}const h=await ibiz.modal.confirm(c);t.setLastReturn(l[h?0:1])}},Gn=class extends Rn{async exec(t){const{dstDEUILogicParamId:e,name:s}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");const i=t.params[e];console.log("逻辑节点".concat(s,"操作参数值:"),i)}},Hn=class extends Rn{async exec(t){const{dstDEUILogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.resetParam(e)}},Kn=class extends Rn{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const i=Ln(t,this.model);t.params[e]=tt(i)}},Xn=class extends Rn{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:s,dstIndex:i,srcIndex:n,srcSize:r}=this.model;if(!e||!s)throw new a(this.model,"缺少目标参数对象或者源参数对象配置");const o=Ln(t,this.model),c=i||0,l=n||0,h=r||o.length;t.params[e].splice(c,0,...o.slice(l,h))}},Yn=class extends Rn{async exec(t){const{dstDEUILogicParamId:e,dstSortDir:s,dstFieldName:i}=this.model;if(!e||!i)throw new a(this.model,"缺少目标参数对象或目标属性配置");const n=i;t.params[e].sort(((t,e)=>"ASC"===s?t[n]-e[n]:e[n]-t[n]))}},$n=class extends Rn{async exec(t){const{dstDEUILogicParamId:e}=this.model;if(!e)throw new a(this.model,"缺少目标参数对象配置");t.renewParam(e)}},qn=class extends Rn{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:s,dstDEUILogicParamId:i,retDEUILogicParamId:n}=this.model;if(!i)throw new a(this.model,"缺少配置过滤参数");const r=t.params[i],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(s,e,t.context,r);c.ok&&(t.params[n]=c.data)}},Qn=class extends Rn{async exec(t){const{errorInfo:a}=this.model;throw new e(a)}},Jn=class extends Rn{async exec(t){t.isEndNode=!0;const{eventName:s,eventParamId:i,fireCtrlId:n}=this.model;if(!n)throw new a(this.model,"没有配置触发对象");if(!s)throw new a(this.model,"没有配置事件名称参数");if(!i)throw new a(this.model,"没有配置事件参数");const r=t.params[n];if(!r)throw new e("没有找到触发对象".concat(n));const o=t.params[i];if(!o)throw new e("没有找到事件参数对象".concat(i));await r.evt.emit(s,o)}},Zn=class extends Rn{async exec(t){const{dstAppDELogicId:s,dstAppDataEntityId:i,dstDEUILogicParamId:n,retDEUILogicParamId:r}=this.model;if(!i)throw new a(this.model,"没有配置实体");if(!s)throw new a(this.model,"没有配置实体逻辑");if(!n)throw new a(this.model,"没有配置传入逻辑参数");const o=t.params[n];if(!o)throw new e("没有找到传入参数".concat(n));const c=await pi(s,i,t.context,o,t.params);r&&(t.params[r]=c)}},tr=class{constructor(t){this.model=t}calc(t){const e=this.model.id,a=this.model,{parameters:i}=t,{context:n,params:r,data:o}=i,c=ibiz.hub.getApp(n.srfappid);if("layoutPanel"!==a.codeName)if(a.default)t.params[e]=o&&o.length>0?o[0]:{};else if(a.activeContainerParam)t.params[e]=i.ctrl||i.view;else if(a.activeCtrlParam)t.params[e]=i.ctrl;else if(a.ctrlParam){const s=i.view.getController(a.codeName.toLowerCase());s?t.params[e]=s:ibiz.log.error("视图逻辑初始化参数,未找到".concat(a.codeName,"指定部件对象"))}else if(a.activeViewParam)t.params[e]=i.view;else if(a.appGlobalParam)t.params[e]=ibiz.env;else if(a.applicationParam)t.params[e]=c;else if(a.entityListParam)t.params[e]=[];else{if(a.entityPageParam)throw new s(a,"未支持的逻辑参数类型: 分页查询结果");if(a.entityParam)t.params[e]={};else if(a.lastReturnParam)t.initLastReturnParam(e);else if(a.navContextParam)t.params[e]=n;else{if(a.navViewParamParam)throw new s(a,"未支持的逻辑参数类型: 视图路由参数");if(a.routeViewSessionParam)throw new s(a,"未支持的逻辑参数类型: 路由视图会话");if(a.simpleListParam)t.params[e]=[];else if(a.simpleParam)t.params[e]={};else if(a.viewNavDataParam)t.params[e]=r;else if(a.viewSessionParam)throw new s(a,"未支持的逻辑参数类型: 当前视图会话")}}else t.params[e]=i.view.layoutPanel.panelItems}renew(t){const e=this.model.id,a=this.model;if(a.entityListParam||a.simpleListParam||a.entityPageParam)t.params[e]=[];else{if(!a.simpleParam&&!a.entityParam)throw new s(a,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}},er=class{constructor(t){var e;if(this.model=t,this.nodes=new Map,this.params=new Map,!(null==(e=t.deuilogicNodes)?void 0:e.length))throw new a(t,"界面逻辑没有配置逻辑节点");t.deuilogicNodes.forEach((t=>{const{logicNodeType:e}=t;let a;switch(e){case"BEGIN":a=new Fn(t);break;case"END":a=new Wn(t);break;case"DEACTION":a=new Vn(t);break;case"DEUIACTION":a=new kn(t);break;case"PREPAREJSPARAM":a=new Bn(t);break;case"RESETPARAM":a=new Hn(t);break;case"COPYPARAM":a=new Kn(t);break;case"BINDPARAM":a=new jn(t);break;case"VIEWCTRLINVOKE":a=new Un(t);break;case"MSGBOX":a=new zn(t);break;case"DEBUGPARAM":a=new Gn(t);break;case"APPENDPARAM":a=new Xn(t);break;case"SORTPARAM":a=new Yn(t);break;case"RENEWPARAM":a=new $n(t);break;case"DEDATASET":a=new qn(t);break;case"THROWEXCEPTION":a=new Qn(t);break;case"VIEWCTRLFIREEVENT":a=new Jn(t);break;case"DELOGIC":a=new Zn(t);break;default:throw new s(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,a)})),t.deuilogicParams.forEach((t=>{this.params.set(t.id,new tr(t))})),this.nodes.forEach((t=>{t.links.forEach((e=>{e.srcNode=t,this.nodes.has(e.model.dstDEUILogicNodeId)&&(e.dstNode=this.nodes.get(e.model.dstDEUILogicNodeId))}))}))}initLogicParams(t){this.params.forEach((e=>{e.model.default&&(t.defaultParamName=e.model.id),e.calc(t)}))}async exec(t){const e=new _n(this.params,t);this.initLogicParams(e);const{startDEUILogicNodeId:s}=this.model;if(!s||!this.nodes.has(s))throw new a(this.model,"未设置起始节点");{const t=this.nodes.get(s);await this.deepExec(t,e)}return e.isEndNode?e.result:e.params[e.defaultParamName]?e.params[e.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:a}=t;for(let s=0;s<a.length;s++){const i=a[s];if(await i.exec(e)&&i.dstNode&&(await this.deepExec(i.dstNode,e),!1===t.model.parallelOutput))break}}},ar=new Map;async function sr(t,a,s){const i=ibiz.hub.getApp(s.context.srfappid),n=await i.getDEUILogic(t,a);if(!n)throw new e("找不到实体".concat(a,"的界面逻辑").concat(t));ar.has(n)||ar.set(n,new er(n));const r=ar.get(n);return await r.exec(s),null}var ir=t("UIActionUtil",class{static async exec(t,a){const s=await Je(t);if(!s)throw new e("没找到".concat(t,"的界面行为模型"));if("SINGLEDATA"===s.actionTarget){if(!1===await a.view.call("Validate"))return{cancel:!0}}return(await hs(s)).exec(s,a)}static async execAndResolved(t,e){var a,s;const i=await this.exec(t,e);if(i.closeView)e.view.modal.ignoreDismissCheck=!0,e.view.closeView({ok:!0});else if(i.refresh)switch(i.refreshMode){case 1:await e.view.callUIAction("Refresh");break;case 2:await(null==(a=e.view.parentView)?void 0:a.callUIAction("Refresh"));break;case 3:await(null==(s=e.view.getTopView())?void 0:s.callUIAction("Refresh"))}}}),nr=class{async exec(t,e){const{context:s,params:i,data:n}=e,r={refresh:t.reloadData,refreshMode:t.refreshMode,closeView:t.closeEditView},{appDEUILogicId:o,appDataEntityId:c,uilogicAttachMode:l}=t;if("REPLACE"===l){if(!o)throw new a(t,"没有配置实体界面逻辑");return await sr(o,c,e),r}if(!await this.isConfirm(t,e))return this.returnError(r);const h=await this.execAction(t,e);if(Object.assign(r,h),!0===r.cancel)return this.returnError(r);const d=await this.doNextAction(t,{...e,context:r.nextContext||s,data:r.data||n,params:r.nextParams||i});if(d&&(Object.assign(r,d),!0===d.cancel))return this.returnError(r);if("AFTER"===t.uilogicAttachMode){if(!o)throw new a(t,"没有配置实体界面逻辑");await sr(o,c,e)}return r}returnError(t){return Object.assign(t,{refresh:!1,closeView:!1})}async isConfirm(t,e){const a=this.calcMessage("confirm",t,e);return!t.enableConfirm||!a||ibiz.confirm.warning({title:"操作确认",desc:a})}async doNextAction(t,e){const a=t.nextId;if(a)return ir.exec(a,e)}async handleParams(t,e,a,s){let i=[];const n=Ke(t.appDataEntityId);switch(t.actionTarget){case"NONE":i=[];break;case"SINGLEDATA":i=[a[0]];break;case"MULTIDATA":i=a;break;case"MULTIKEY":i=n&&a.length>0?a.map((t=>({[n]:t.srfkey||t[n]}))):[{}];break;case"SINGLEKEY":{const t=a[0]||{};i=n?[{[n]:t.srfkey||t[n]}]:[{}]}}const r=e.clone(),o=[...t.navigateContexts||[]];if(n&&"NONE"!==t.actionTarget){const{valueItem:e,paramItem:a}=t,s=a||n,i=e||"srfkey";o.unshift({key:s,value:i,rawValue:!1})}const c=["MULTIKEY","MULTIDATA"].includes(t.actionTarget)&&a.length>0,l=Re(o,c?Fe(o,a):a[0]||{},s,e);Object.assign(r,l);const h=t.navigateParams;return{resultContext:r,resultData:i,resultParams:Re(h,c?Fe(h,a):a[0]||{},s,r)}}calcMessage(t,e,a){let s,i;const{confirmMsg:n,cmlanguageRes:r,successMsg:o,smlanguageRes:c}=e;switch(t){case"confirm":s=n,i=r;break;case"success":s=o,i=c}if(i){const t=ibiz.i18n.t(i.lanResTag,i.defaultContent||s);t!==i.lanResTag&&(s=t)}if(s){const{data:t}=a,e={...a};return 1===t.length?[e.data]=t:0===t.length&&delete e.data,ga.execScriptFn(e,"`".concat(s,"`"),{isAsync:!1,singleRowReturn:!0})}}},rr=t("BackendUIActionProvider",class extends nr{async execAction(t,e){const{context:s,params:i,data:n,event:r}=e,o={},c=t.appDataEntityId,l=t.appDEMethodId;if(!c||!l)throw new a(t,"未配置实体或实体行为");const{resultContext:h,resultParams:d,resultData:u}=await this.handleParams(t,s,n,i),p={...d},m=t.frontAppViewId;if(m){const t=await ibiz.commands.execute(Mi.TAG,m,h,d,{event:r});if(!(null==t?void 0:t.ok))return o.cancel=!0,o;(null==t?void 0:t.ok)&&t.data&&(0===u.length&&u.push({}),u.forEach((e=>{e.srfactionparam=t.data})))}const f=ibiz.hub.getApp(null==s?void 0:s.srfappid),g=u.map((t=>{var e;return(null==(e=t.getOrigin)?void 0:e.call(t))||t||{}})).map((t=>Object.assign(t,p))),w=["MULTIKEY","MULTIDATA"].includes(t.actionTarget),E=await f.deService.exec(c,l,h,w?g:g[0],p);if(E.ok){const a=this.calcMessage("success",t,e);a&&ibiz.message.success(a)}return Object.assign(o,{data:z(E.data)?E.data:[E.data],nextContext:h,nextParams:p}),o}}),or=t("SysUIActionProvider",class extends nr{constructor(){super(...arguments),this.predefinedActionMap=new Map([["EDITVIEW_EXITACTION","Exit"],["EDITVIEW_SAVEANDEXITACTION","SaveAndExit"],["TREEVIEW_REFRESHPARENTACTION","RefreshParent"],["GRIDVIEW_EXPORTXMLACTION","ExportModel"],["GRIDVIEW_EXPORTACTION","ExportExcel"],["EDITVIEW_REMOVEANDEXITACTION","RemoveAndExit"],["GRIDVIEW_PRINTACTION","Print"],["EDITVIEW_NEXTRECORDACTION","NextRecord"],["GRIDVIEW_NEWROWACTION","NewRow"],["EDITVIEW_LASTRECORDACTION","LastRecord"],["EDITVIEW_PREVRECORDACTION","PrevRecord"],["GRIDVIEW_SEARCHBAR","ToggleFilter"],["EDITVIEW_SAVEANDSTARTWFACTION","SaveAndStart"],["EDITVIEW_NEWACTION","New"],["EDITVIEW_PRINTACTION","Print"],["EDITVIEW_COPYACTION","Copy"],["EDITVIEW_HELPACTION","Help"],["EDITVIEW_FIRSTRECORDACTION","FirstRecord"],["GRIDVIEW_REFRESHACTION","Refresh"],["EDITVIEW_SAVEANDNEWACTION","SaveAndNew"],["EDITVIEW_VIEWWFSTEPACTORACTION","ViewWFStep"],["EDITVIEW_SAVEACTION","Save"],["TREEVIEW_REFRESHALLACTION","RefreshAll"],["GRIDVIEW_IMPORTBAR","Import"],["GRIDVIEW_ROWEDITACTION","ToggleRowEdit"],["GRIDVIEW_NEWACTION","New"],["GRIDVIEW_EDITACTION","Edit"],["GRIDVIEW_HELPACTION","Help"],["EDITVIEW_REFRESHACTION","Refresh"],["GRIDVIEW_REMOVEACTION","Remove"],["GRIDVIEW_COPYACTION","Copy"],["GRIDVIEW_VIEWACTION","View"],["GRIDVIEW_SAVEROWACTION","SaveRow"],["APP_LOGIN","Login"],["APP_LOGOUT","logout"]])}async execAction(t,e){const{view:a}=e,s=this.predefinedActionMap.get(t.predefinedType)||t.uiactionTag;if("Exit"===s)return{closeView:!0};return await a.callUIAction(s,e)||{}}}),cr=t("FrontUIActionProvider",class extends nr{async execAction(t,e){const{context:i,params:n,data:r,event:o,noWaitRoute:c}=e;let l={};switch(t.frontProcessType){case"OPENHTMLPAGE":{const e=m.fill(t.htmlPageUrl,i,null==r?void 0:r[0]);window.open(e,"_blank");break}case"TOP":case"WIZARD":{const e=t.frontAppViewId;if(!e)throw new a(t,"未配置打开视图");const{resultContext:s,resultParams:h}=await this.handleParams(t,i,r,n),d=await ibiz.commands.execute(Mi.TAG,e,s,h,{event:o,noWaitRoute:c});(null==d?void 0:d.ok)||(l.cancel=!0),(null==d?void 0:d.ok)&&d.data&&(l.data=d.data,l.nextContext=s,l.nextParams={...n,...h});break}case"OTHER":l=this.doOther(t,e);break;default:throw new s(t,"未支持的前台处理模式[".concat(t.frontProcessType,"]"))}return l}doOther(t,e){const{scriptCode:s}=t,{context:i,params:n,data:r,event:o}=e;if(s){return ga.execScriptFn({context:i,params:n,data:r,el:null==o?void 0:o.target},s)||{}}throw new a(t,"自定义类型缺少配置脚本代码")}}),lr=t("WFWithdrawUIActionProvider",class extends nr{async execAction(t,e){const{view:a}=e;let s=!1;return await ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})&&a&&(await a.call("WFWithdraw",e),s=!0),{refresh:!1,closeView:s}}});function hr(){const t=new cr;cs("FRONT",(()=>t));const e=new rr;cs("BACKEND",(()=>e));const a=new or;cs("SYS",(()=>a));const s=new lr;cs("DEUIACTION_WFWithdraw",(()=>s))}var dr=t("ToolbarController",class extends pn{get _evt(){return this.evt}initState(){super.initState(),this.state.buttonsState=new Ji,this.state.viewMode="EMBED",this.state.extraButtons={}}async doUIAction(t,a,s={}){if("DEUIACTION"===t.itemType){const i=t.uiactionId,n=await Je(i);if(!n)throw new e("没有找到界面行为模型".concat(i));const r=["SYS","BACKEND","WFBACKEND"].includes(n.uiactionMode)&&!1!==n.showBusyIndicator;r&&this.state.buttonsState.setLoading(t.id);try{const t=await this.ctx.view.call("GetData")||[],e=this.getEventArgs();e.params=Object.assign(s,e.params),await ir.execAndResolved(i,{...e,data:t,event:a})}finally{r&&this.state.buttonsState.setLoading("")}}}async onCreated(){await super.onCreated(),this.state.viewMode=this.ctx.view.modal.mode,f(this.model,(t=>{if("DEUIACTION"===t.itemType){const e=t,a=new Qi(e.id,this.context.srfappid,e.uiactionId);this.state.buttonsState.addState(e.id,a)}}),{childrenFields:["detoolbarItems"]}),await this.calcButtonState()}async onItemClick(t,e,a){const s="extra"===t.buttonType;await this._evt.emit("onClick",{event:e,eventArg:t.id,buttonType:s?"extra":"deuiaction"}),s||await this.doUIAction(t,e,a)}async calcButtonState(t,e){let a=t;if(t&&t instanceof yi&&(a=t.getOrigin()),await this.state.buttonsState.update(a,e),this.scheduler){const t={};a&&(t.data=[a]),f(this.model,(e=>{const a=this.state.buttonsState[e.id];if(a.visible){const s=this.scheduler.triggerItemVisible(e.id,t);void 0!==s&&(a.visible=s)}if(!a.disabled){const s=this.scheduler.triggerItemEnable(e.id,t);void 0!==s&&(a.disabled=!s)}}),{childrenFields:["detoolbarItems"]})}}setExtraButtons(t,e){this.state.extraButtons[t]||(this.state.extraButtons[t]=[]),this.state.extraButtons[t].push(...e)}clearExtraButtons(t){void 0===t?this.state.extraButtons={}:this.state.extraButtons[t]=[]}initControlScheduler(t=[]){const e=[...t];f(this.model,(t=>{t.controlLogics&&e.push(...t.controlLogics)}),{childrenFields:["detoolbarItems"]}),super.initControlScheduler(e)}}),ur=t("ContextMenuController",class extends dr{}),pr=(t("DashboardController",class extends pn{constructor(){super(...arguments),this.providers={},this.portlets={}}initState(){super.initState()}async onCreated(){await super.onCreated(),await this.initPortlets(this.model.controls);const{appDataEntityId:t}=this.view.model;t&&this.view.evt.on("onDataChange",(t=>{const e=an(t.data);e&&this.dataChangeNotify(e)}))}async initPortlets(t,e){(null==t?void 0:t.length)&&await Promise.all(t.map((async t=>{var a;const s=await fs(t);if(s){this.providers[t.id]=s;const i=await s.createController(t,this,e);this.portlets[t.id]=i,(null==(a=t.controls)?void 0:a.length)&&await this.initPortlets(t.controls,i)}})))}async dataChangeNotify(t){await Va(Object.values(this.portlets).map((async e=>e.dataChangeNotify(t))))}}),t("CustomDashboardController",class{constructor(t){var e,a;this.customModelData=[],this.layoutColNum=12,this.layoutRowH=80,this.model=null,this.model=t,this.config=new Os(t.appId,"dynadashboard","dashboard_".concat((null==(e=this.model.appDataEntityId)?void 0:e.toLowerCase())||"app","_").concat(null==(a=this.model.codeName)?void 0:a.toLowerCase()))}async loadCustomModelData(){const t=await this.config.load();return t.model&&(this.customModelData=t.model),t.colNum&&(this.layoutColNum=t.colNum),t.rowH&&(this.layoutRowH=t.rowH),this.customModelData}async saveCustomModelData(t){return await this.config.save({model:t,colNum:this.layoutColNum,rowH:this.layoutRowH})&&(this.customModelData=t),t}}),t("PortletPartState",class{constructor(){this.visible=!0,this.keepAlive=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[]},this.actionGroupState=null}})),mr=t("PortletPartController",class{get context(){return this.dashboard.context}get params(){return this.dashboard.params}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}constructor(t,e,a){this.model=t,this.dashboard=e,this.parent=a,this.state=this.createState()}async init(){await this.onInit()}async onInit(){this.onDataChange=this.onDataChange.bind(this);const{layoutPos:t,sysCss:e}=this.model;if(t){const{width:t,height:e}=je(this.model);this.state.layout.width="".concat(t),this.state.layout.height="".concat(e)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),await this.initActionStates()}createState(){return new pr}onDataChange(t){let e=t.data[0];e&&e instanceof yi&&(e=e.getOrigin()),e&&this.state.actionGroupState.update(e,this.dashboard.view.model.appDataEntityId)}async initActionStates(){var t;const{uiactionGroup:e}=this.model;if(!(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length))return;const a=new Ji;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new Qi(t.id,this.dashboard.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),this.state.actionGroupState=a;const{appDataEntityId:s}=this.dashboard.view.model;s&&this.dashboard.view.evt.on("onDataChange",this.onDataChange)}async onActionClick(t,e,a=[]){const s=t.uiactionId;await ir.execAndResolved(s,{context:this.dashboard.context,params:this.dashboard.params,data:a,view:this.dashboard.view,event:e})}async dataChangeNotify(t){if(this.state.actionGroupState){const{appDataEntityId:e}=this.dashboard.view.model;this.state.actionGroupState.update(t,e)}this.calcDynaClass(t)}calcDynaClass(t){if(this.model.dynaClass){const e=ze(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}}async destroyed(){ibiz.log.debug("".concat(this.model.codeName," onDestroyed")),this.dashboard.view.evt.off("onDataChange",this.onDataChange)}}),fr=(t("ContainerPortletController",class extends mr{}),t("ViewPortletController",class extends mr{}),t("MenuPortletController",class extends mr{}),t("DataViewControlService",class extends Di{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.dedataViewDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new Ti(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new Ti(e,e);this.dataUIMap.set(e,s)}))}})),gr=t("DataViewControlController",class extends mn{get enableNew(){return!0===this.model.enableCardNew}initState(){super.initState(),this.state.noSort=!0===this.model.noSort,this.state.size=this.model.pagingSize||20,this.state.singleSelect=!0===this.model.singleSelect}async onCreated(){await super.onCreated(),await this.initControlService()}async initControlService(){this.service=new fr(this.model),await this.service.init(this.context)}async initGroupActionStates(){var t;const{groupUIActionGroup:e}=this.model;(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length)&&this.state.groups.forEach((async t=>{const a=new Ji;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new Qi(t.id,this.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),t.groupActionGroupState=a}))}async onRowClick(t){var e;super.onRowClick(t);const{groupAppDEFieldId:a}=this.model;if(a)if(this.state.groups.forEach((t=>{t.selectedData=[]})),this.state.selectedData.forEach((t=>{const e=t[a],s=this.state.groups.find((t=>t.key===e));s&&s.selectedData.push(t)})),this.state.singleSelect)this.state.groups.forEach((e=>{var a,s;let i=t;-1!==e.selectedData.indexOf(i)?(i&&i instanceof yi&&(i=i.getOrigin()),i&&(null==(a=e.groupActionGroupState)||a.update(i,this.model.appDataEntityId))):null==(s=e.groupActionGroupState)||s.update(void 0,this.model.appDataEntityId)}));else{const a=this.state.groups.find((e=>-1!==e.children.indexOf(t)));a&&(null==(e=a.groupActionGroupState)||e.update(a.selectedData[0],this.model.appDataEntityId))}}async loadMore(){this.state.total>this.state.items.length&&await this.load({isLoadMore:!0})}async afterLoad(t,e){return await this.initGroupCodeListItems(),await this.handleDataGroup(),await this.initGroupActionStates(),e}getOptItemModel(){let t=null;const{dedataViewItems:e}=this.model;if(e)for(let a=0;a<e.length;a++)"ACTIONITEM"===e[a].itemType&&(t=e[a]);return t}getOptItemAction(t){var e;const s=new Ji,i=this.getOptItemModel();if(i){if(!i.deuiactionGroup)throw new a(this.model,"操作项没有配置界面行为组");if(!(null==(e=i.deuiactionGroup.uiactionGroupDetails)?void 0:e.length))return ibiz.log.debug("操作项界面行为组没有配置界面行为"),s;i.deuiactionGroup.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const a=new Qi(t.id,this.context.srfappid,e);s.addState(t.id,a)}})),s.update(t.getOrigin())}return s}async onActionClick(t,e,a){const s=t.uiactionId;await ir.execAndResolved(s,{context:this.context,params:this.params,data:[e],view:this.view,event:a})}async handleDataGroup(){const{enableGroup:t,groupMode:e,groupAppDEFieldId:s}=this.model;if(t&&e){if(!s)throw new a(this.model,"分组属性没有配置");"AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup()}}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,a=new Map;e.forEach((e=>{const s=e[t];Q(s)||(a.has(s)||a.set(s,[]),a.get(s).push(e))}));const s=[];a.forEach(((t,e)=>{s.push({caption:e,key:e,children:[...t]})})),this.state.groups=s}}async initGroupCodeListItems(){const{groupCodeListId:t}=this.model;if(!t)return;const e=ibiz.hub.getApp(this.context.srfappid);this.groupCodeListItems=await e.codeList.get(t,this.context,this.params)}async handleCodeListGroup(){const{groupAppDEFieldId:t,groupCodeListId:e}=this.model;if(!e)throw new a(this.model,"分组代码表没有配置");const{items:s}=this.state,i=new Map;this.groupCodeListItems.forEach((t=>{i.set(t.value,[])})),s.forEach((e=>{const a=e[t],s=i.get(a);s&&s.push(e)}));const n=[];i.forEach(((t,e)=>{const a=this.groupCodeListItems.find((t=>t.value===e));n.push({caption:a.text,key:a.value,children:t})})),this.state.groups=n}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}onClickNew(t,e){const a={...this.params,srfgroup:e};ir.execAndResolved("new",{context:this.context,params:a,data:[],view:this.view,event:t})}async onGroupToolbarClick(t,e,a){const s=t.uiactionId,i={...this.params,srfgroup:a.key};await ir.execAndResolved(s,{context:this.context,params:i,data:a.selectedData||[],view:this.view,event:e})}}),wr=t("ExpBarControlController",class extends pn{constructor(){super(...arguments),this.navKeyName="srfkey"}get _evt(){return this.evt}get routeDepth(){return this.view.modal.routeDepth}initState(){super.initState(),this.state.query=""}load(){return this.xDataController.load({isInitialLoad:!0})}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}get toolbarController(){return this.view.getController("".concat(this.model.xdataControlName.split("_")[0],"_toolbar"))}get XDataModel(){var t;return null==(t=this.model.controls)?void 0:t.find((t=>t.name===this.model.xdataControlName))}get isCache(){return"CACHE"===this.controlParams.expcache||"NO_CACHE"!==this.controlParams.expcache&&ibiz.config.view.expCacheMode.includes(this.model.controlType)}async onCreated(){var t;await super.onCreated(),this.childNames.push(this.model.xdataControlName);const e=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);if(e){const a=null==(t=e.appDEFields)?void 0:t.filter((t=>t.enableQuickSearch)),s=[];null==a||a.forEach((t=>{(null==t?void 0:t.lnlanguageRes)&&t.lnlanguageRes.lanResTag?s.push(ibiz.i18n.t(t.lnlanguageRes.lanResTag,t.logicName)):(null==t?void 0:t.logicName)&&s.push(t.logicName)})),s.length>0&&(this.state.placeHolder=s.join("、"))}}async onMounted(){super.onMounted(),this.xDataController&&(this.xDataController.evt.on("onActive",(t=>{this.xDataActive(t)})),this.xDataController.evt.on("onLoadSuccess",(t=>{this.xDataLoadSuccess(t)})),this.xDataController.evt.on("onRemoveSuccess",(()=>{this.defaultNavByFirstItem()}))),this.toolbarController&&this.xDataController.evt.on("onSelectionChange",(async t=>{this.toolbarController.calcButtonState(t.data[0],this.model.appDataEntityId)})),this.state.loadDefault&&this.load()}xDataLoadSuccess(t){t.isInitialLoad&&(this.state.srfnav&&this.routeDepth?this.defaultNavBySrfnav():this.defaultNavByFirstItem())}defaultNavBySrfnav(){var t;const e=null==(t=this.xDataController)?void 0:t.state.items.find((t=>t[this.navKeyName]===this.state.srfnav));this.routeDepth&&window.location.hash.split("/").length>2*this.routeDepth+2?(e&&this.xDataController.setSelection([e]),this._evt.emit("onNavViewChange",{navViewMsg:{key:this.state.srfnav,isCache:this.isCache},context:this.context})):e&&(this.xDataController.setActive(e),this.xDataController.setSelection([e]))}defaultNavByFirstItem(){const t=this.xDataController.state.items[0];if(!t)return this.state.srfnav="",void this._evt.emit("onNavViewChange",{navViewMsg:{key:"",isCache:this.isCache}});this.xDataController.setActive(t),this.xDataController.setSelection([t])}xDataActive(t){const{data:e,context:a,params:s}=t,i=this.getNavViewMsg(e[0],a,s);this._evt.emit("onNavViewChange",{navViewMsg:i})}prepareParams(t,e,a,s){const{navDER:i,navFilter:n,navigateContexts:r,navigateParams:o,appDataEntityId:c}=t,l={deName:c?Ke(c):void 0,navFilter:n,pickupDEFName:null==i?void 0:i.pickupDEFName,navContexts:r,navParams:o},h={context:a,params:s,data:e},{resultContext:d,resultParams:u}=We(l,h),p=Object.assign(a.clone(),d,{currentSrfNav:e[this.navKeyName]});this.state.srfnav=e[this.navKeyName];return{context:p,params:{...u}}}calcViewModelId(){var t;if(["GRID","DATAVIEW","LIST"].includes((null==(t=this.XDataModel)?void 0:t.controlType)||""))return this.XDataModel.navAppViewId;throw new e("多节点视图由子类实现")}getNavViewMsg(t,e,a){const s=this.calcViewModelId(),i=this.prepareParams(this.XDataModel,t,e,a);return{key:t[this.navKeyName],context:i.context,params:i.params,viewId:s,isCache:this.isCache}}calcControlHeaderVisible(){const t=!!this.toolbarController;if(!t&&this.layoutPanel){const t=this.layoutPanel.panelItems.control_toolbar;t&&(t.state.visible=!1)}return t||!(!this.model.showTitleBar||!this.model.title)||!!this.model.enableSearch}setLayoutPanel(t){super.setLayoutPanel(t),t.evt.on("onMounted",(()=>{if(!this.calcControlHeaderVisible()){const t=this.layoutPanel.panelItems.control_header;t&&(t.state.visible=!1)}}))}onRouterChange(t){this.state.srfnav!==t.srfnav&&(this.state.srfnav=t.srfnav,this.defaultNavBySrfnav())}}),Er=(t("CalendarExpBarController",class extends wr{constructor(){super(...arguments),this.navKeyName="navId"}getCalendarItemModel(t){const{sysCalendarItems:e}=this.XDataModel;if(e)return e.find((e=>e.itemType===t))}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}defaultNavBySrfnav(){var t;const e=null==(t=this.xDataController)?void 0:t.state.items.find((t=>t.navId===this.state.srfnav));if(super.defaultNavBySrfnav(),!e)return;const a=new Date(e.beginTime);this.xDataController.setSelectDate(a)}getNavViewMsg(t){const e=this.getCalendarItemModel(t.itemType);if(e){const{context:a,params:s}=this.prepareParams(e,t.deData?t.deData:t,this.context,this.params);return a.currentSrfNav=t.navId,this.state.srfnav=t.navId,{key:t.navId,context:a,params:s,viewId:e.navAppViewId}}return{key:t.navId,context:this.context,params:this.params}}}),t("TreeExpBarController",class extends wr{constructor(){super(...arguments),this.navKeyName="id",this.navNodeModelIds=[]}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new a(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}getNodeModel(t){const{detreeNodes:e}=this.XDataModel;let a;return e&&e.forEach((e=>{e.id===t&&(a=e)})),a}xDataActive(t){const{nodeData:e}=t;super.xDataActive({...t,data:[e]})}getNavViewMsg(t,a,s){const i=t.id,n=t.deData||t,r=this.getNodeModel(t.nodeId);if(!r)throw new e("找不到".concat(t.nodeId,"的节点模型"));const o=this.prepareParams(r,n,a,s);return o.context.currentSrfNav=i,this.state.srfnav=i,{key:i,viewId:r.navAppViewId,isCache:this.isCache,...o}}defaultNavByFirstItem(){const t=this.xDataController.state.items.find((t=>!(!this.xDataController.model.rootVisible&&this.xDataController.state.rootNodes.includes(t))&&(!!this.state.noNeedNavView||this.navNodeModelIds.includes(t.nodeId))));t&&(this.xDataController.setActive(t),this.xDataController.setSelection([t]))}async onCreated(){await super.onCreated();const{detreeNodes:t}=this.XDataModel;if(null==t||t.forEach((t=>{t.navAppViewId&&this.navNodeModelIds.push(t.id)})),this.state.srfnav){const t=[];this.state.srfnav.split(":").forEach(((e,a)=>{0===a?t.push(e):t.push("".concat(t[a-1],":").concat(e))})),t.pop(),this.defaultExpandedKeys=t}}}),t("FormController",class extends pn{constructor(){super(...arguments),this.details={},this.providers={},this.formItems=[]}get _evt(){return this.evt}get data(){return this.state.data}initState(){super.initState(),this.state.data=new yi,this.state.isLoaded=!1,this.state.processing=!1,this.state.modified=!1}async dataChangeNotify(t){await Va(Object.values(this.details).map((async e=>e.dataChangeNotify(t))))}formStateNotify(t){Object.values(this.details).forEach((e=>{e.formStateNotify(t)}))}async onCreated(){await super.onCreated(),await this.initDetailControllers(),this.dataChangeNotify=g(this.dataChangeNotify.bind(this),((t,e)=>[Array.from(new Set([...t[0],...e[0]]))]),200)}async getDraftParams(){const t={};return await Promise.all(this.formItems.map((e=>e.setDefaultValue(!0,t)))),t}async initDetailControllers(t=this.model.deformPages,e=this,a=void 0){await Promise.all(t.map((async t=>{const s=await ts(t);if(!s)return;e.providers[t.id]=s;const i=await s.createController(t,e,a);e.details[t.id]=i,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(i);const n=sa(t);n.length&&await this.initDetailControllers(n,e,i)})))}getData(){return[this.state.data]}async setDataValue(t,e){if(!Object.prototype.hasOwnProperty.call(this.state.data,t)||en(this.state.data[t],e)){this.state.data[t]=e,this.state.processing=!0,this.state.modified=!0,await this._evt.emit("onFormDataChange",void 0);try{await this.dataChangeNotify([t])}finally{this.state.processing=!1}}}async validate(){return-1===(await Promise.all(this.formItems.map((t=>t.validate())))).findIndex((t=>!t))}actionNotification(t,e){super.actionNotification(t,{data:this.data,...e||{}})}})),vr=t("SearchFormService",class extends Ii{async getDraft(t,e={}){let a={ok:!0,status:200,data:this.getFilteredData({...e})};return a=this.handleResponse(a),a}initUIDataMap(){f(this.model,(t=>{if("FORMITEM"===t.detailType){const e=t.id.toLowerCase();this.dataUIMap.set(e,new Ti(e,e))}}),{childrenFields:["deformPages","deformTabPages","deformDetails"]})}handleResponse(t){const e=super.handleResponse(t);return e.ok&&e.data&&(e.data=this.toUIData(e.data)),e}getFilteredData(t){const e={};return this.dataUIMap.forEach((a=>{void 0!==t[a.dataKey]&&(e[a.dataKey]=t[a.dataKey])})),e}}),yr=(t("SearchFormController",class extends Er{async onCreated(){await super.onCreated(),this.service=new vr(this.model),await this.service.init(this.context),await this.load()}async onMounted(){await super.onMounted(),this.state.loadDefault&&this.load()}async load(){const t={...this.params},e=await this.getDraftParams();let a;Object.assign(t,e),await this.evt.emit("onBeforeLoadDraft",{params:t});try{a=await this.service.getDraft(this.context,t)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}return this.state.data=a.data,w(this.data,e),this.state.isLoaded=!0,this.formStateNotify("DRAFT"),this.actionNotification("GETDRAFTSUCCESS"),this.data}getFilterParams(){const t={};return Object.keys(this.state.data).forEach((e=>{const a=this.state.data[e];null!=a&&""!==a&&(t[e]=a)})),t}async search(){await this.evt.emit("onSearch",void 0)}async onSearchButtonClick(){await this.search()}async reset(){await this.load(),await this.search()}async dataChangeNotify(t){await super.dataChangeNotify(t),this.model.enableAutoSearch&&this.search()}async onKeyUp(t){const e=t||window.event;e&&"Enter"===e.code&&await this.onSearchButtonClick()}}),t("FormDetailState",class{constructor(t){this.parent=t,this.disabled=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[],label:[],labelDyna:[]},this.required=!1,this.showMoreMode=0;let e,a=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get(){if(this.parent){if(!1===this.parent.visible)return!1;if(1===this.showMoreMode&&!1===this.parent.isShowMore)return!1}return a},set:t=>(a=t,!0)}),Object.defineProperty(this,"keepAlive",{enumerable:!0,configurable:!0,get(){return void 0!==e?e:!!this.parent&&this.parent.keepAlive},set:t=>(e=t,!0)})}})),Ir=t("FormDetailController",class{get data(){return this.form.data}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}get labelClass(){return[...this.state.class.label,...this.state.class.labelDyna]}constructor(t,e,a){this.model=t,this.form=e,this.parent=a,this.state=this.createState()}async init(){await this.onInit()}async onInit(){this.state.showMoreMode=this.model.showMoreMode;const{layoutPos:t,sysCss:e,labelSysCss:a}=this.model;if(t){const{width:e,height:a}=je(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(a)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==a?void 0:a.cssName)&&this.state.class.label.push(a.cssName)}createState(){var t;return new yr(null==(t=this.parent)?void 0:t.state)}async dataChangeNotify(t){this.calcDynamicLogic(t),this.calcDynaClass(this.data)}async formStateNotify(t){this.calcDynamicLogic([],t),this.calcDynaClass(this.data)}calcDynamicLogic(t,e){var a;this.parent&&!this.parent.state.visible||null==(a=this.model.defdgroupLogics)||a.forEach((a=>{const s=a.relatedDetailNames||[];if(e||E(s,t))try{const t=va(this.form.data,a);switch(a.logicCat){case"ITEMBLANK":this.state.required=!t;break;case"ITEMENABLE":this.state.disabled=!t;break;case"PANELVISIBLE":this.state.visible=t}}catch(t){ibiz.log.error(t)}}))}force(t){}calcDynaClass(t){if(this.model.dynaClass){const e=ze(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=ze(this.model.labelDynaClass,t);e.length&&(this.state.class.labelDyna=e)}}}),Dr=t("FormButtonState",class extends yr{constructor(){super(...arguments),this.loading=!1}}),Cr=(t("FormButtonController",class extends Ir{createState(){var t;return new Dr(null==(t=this.parent)?void 0:t.state)}get data(){return this.form.data}async onClick(t){this.state.loading=!0;try{"UIACTION"===this.model.actionType&&await this.doUIAction(t),await this.doFormItemUpdate()}finally{this.state.loading=!1}}async doUIAction(t){const e=this.model.uiactionId;await ir.execAndResolved(e,{context:this.form.context,params:this.form.params,data:[this.data],view:this.form.view,event:t,noWaitRoute:!0})}async doFormItemUpdate(){this.model.deformItemUpdateId&&await this.form.updateFormItem(this.model.deformItemUpdateId)}}),t("FormDruipartState",class extends yr{constructor(){super(...arguments),this.showMask=!1}})),Ar=(t("FormDRUIPartController",class extends Ir{constructor(){super(...arguments),this.refreshItems=["srfkey"],this.paramItem="srfkey",this.isNewData=!1}createState(){var t;return new Cr(null==(t=this.parent)?void 0:t.state)}async onInit(){if(await super.onInit(),Object.assign(this.state.layout.extraStyle,{overflow:"auto"}),this.model.refreshItems){let t=this.model.refreshItems.split(";");t=t.filter((t=>!!t)),this.refreshItems.push(...t)}this.model.paramItem&&(this.paramItem=this.model.paramItem)}async dataChangeNotify(t){await super.dataChangeNotify(t),E(this.refreshItems,t)&&this.calcViewParams()}async formStateNotify(t){await super.formStateNotify(t),this.isNewData="DRAFT"===t,0!==this.model.maskMode&&(this.state.showMask=this.isNewData),"LOAD"!==t&&"DRAFT"!==t&&"SAVE"!==t||this.calcViewParams()}calcViewParams(){let t=this.form.context.clone();const e=this.model.navigateContexts;F(e)&&(t=Object.assign(t,Re(e,this.form.data,this.form.params,this.form.context)));const a=Re(this.model.navigateParams,this.form.data,this.form.params,this.form.context);if(this.state.viewComponentKey){if(JSON.stringify(this.navContext)!==JSON.stringify(t)||JSON.stringify(this.navParams)!==JSON.stringify(a))this.navContext=t,this.navParams=a,this.force();else if(this.embedView){if(this.isNewData)return;this.embedView.callUIAction("Refresh")}}else this.state.viewComponentKey=j(),this.navContext=t,this.navParams=a}setEmbedView(t){this.embedView=t,this.embedView.evt.on("onMounted",(()=>{this.isNewData||this.embedView.call("Load")})),this.embedView.evt.on("onDataChange",(t=>{["LOAD","LOADDRAFT"].includes(t.actionType)||(ibiz.log.debug("接收到关系界面的数据变更事件",t),this.model.deformItemUpdateId&&this.form.updateFormItem(this.model.deformItemUpdateId))}))}}),t("FormGroupPanelState",class extends yr{constructor(){super(...arguments),this.isShowMore=!1,this.actionGroupState=null}})),br=t("FormGroupPanelController",class extends Ir{get disableClose(){const{titleBarCloseMode:t}=this.model;return 0===t||void 0===t}get defaultExpansion(){const{titleBarCloseMode:t}=this.model;return this.disableClose||1===t}createState(){var t;return new Ar(null==(t=this.parent)?void 0:t.state)}async onInit(){super.onInit(),await this.initActionStates()}async formStateNotify(t){super.calcDynamicLogic([],t),this.state.actionGroupState&&this.state.actionGroupState.update(this.form.data.getOrigin())}async initActionStates(){var t;const{uiactionGroup:e}=this.model;if(!(null==(t=null==e?void 0:e.uiactionGroupDetails)?void 0:t.length))return;const a=new Ji;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const s=new Qi(t.id,this.form.context.srfappid,e);a.addState(t.id,s)}})),await a.update(),this.state.actionGroupState=a}async onActionClick(t,e){const a=t.uiactionId;await ir.execAndResolved(a,{context:this.form.context,params:this.form.params,data:[this.data],view:this.form.view,event:e})}}),Pr=t("FormItemState",class extends yr{constructor(t){super(t),this.parent=t,this.error=null,this.enableCondDisabled=!1;let e=!1;Object.defineProperty(this,"disabled",{enumerable:!0,configurable:!0,get(){return!!this.enableCondDisabled||e},set:t=>(e=t,!0)})}}),Sr=(t("FormItemController",class extends Ir{constructor(t,e,a){super(t,e,a),this.rules=[],this.context=e.context,this.params=e.params}createState(){var t;return new Pr(null==(t=this.parent)?void 0:t.state)}get name(){return this.model.fieldName||this.model.id}get value(){return this.form.data[this.name]}get valueItemName(){if(this.model.editor)return this.model.editor.valueItemName}get unitName(){return this.model.unitName}get valueFormat(){return this.model.valueFormat}get dataType(){return this.model.dataType}async onInit(){await super.onInit(),this.state.required=!this.model.allowEmpty,this.model.editor&&"HIDDEN"!==this.model.editor.editorType&&(this.editorProvider=await Qa(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this),await this.initRules()))}async initRules(){this.rules=[];const t=Oa(this.form.model.deformItemVRs||[],this.name);t&&this.rules.push(...sn(t,this.name,this.valueItemName)),this.model.editor&&this.rules.push(...nn(this.model.editor)),this.rules.length>0&&(this.validator=new ut({[this.name]:this.rules}))}calcEnableCond(){const{enableCond:t}=this.model,e=0===this.data.srfuf;t?(e&&2===t||!e&&1===t)&&(this.state.enableCondDisabled=!0):this.state.enableCondDisabled=!0}async dataChangeNotify(t){await super.dataChangeNotify(t);const{resetItemNames:e}=this.model;let a=!1;e&&e.length>0&&e.forEach((e=>{t.includes(e)&&(a=!0)})),a&&this.setDataValue(null,this.name),(t.includes(this.name)||t.includes(this.valueItemName))&&this.validate(),t.includes(this.name)&&this.model.deformItemUpdateId&&await this.form.updateFormItem(this.model.deformItemUpdateId)}async formStateNotify(t){super.formStateNotify(t),this.calcEnableCond(),"LOAD"===t&&this.setDefaultValue(!1)}calcDynamicLogic(t,e){this.model.hidden||super.calcDynamicLogic(t,e)}async validate(){if(!this.state.visible)return this.state.error=null,!0;if(this.state.required&&W(this.data[this.name]))return this.state.error="请填写".concat(this.model.caption||""),!1;if(this.validator)try{await this.validator.validate(this.data)}catch({errors:t,_fields:e}){return this.state.error=t[0].message,!1}return this.state.error=null,!0}async setDataValue(t,e){e=e||this.name,await this.form.setDataValue(e,t)}setDefaultValue(t,e=this.data){const{createDVT:a,createDV:s,updateDVT:i,updateDV:n}=this.model,r=t?a:i,o=t?s:n,c=on({name:this.name,valueType:r,defaultValue:o,valueFormat:this.model.valueFormat},{data:e,context:this.context,params:this.params});void 0!==c&&(e[this.name]=c)}}),t("FormMDCtrlContentTypeController",class{constructor(t){this.parent=t,this.model=this.parent.model}get data(){return this.parent.state.contentCtrlData}async onInit(){}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}onDataItemChange(t,e){this.parent.state.contentCtrlData[e]=t,this.parent.setFormDataValue()}onDataRemove(t){t<0||(this.parent.state.contentCtrlData.splice(t,1),this.parent.setFormDataValue())}onDataInsert(t){this.parent.state.contentCtrlData.push(t||{}),this.parent.setFormDataValue()}async initData(){const t=this.model.appDEFieldId||this.model.fieldName||this.model.id;t&&("REPEATER"===this.model.contentType&&"STYLE3"===this.model.detailStyle?this.parent.state.contentCtrlData=this.parent.data[t]||{}:this.parent.state.contentCtrlData=this.parent.data[t]||[])}async validate(){return!0}})),xr=t("FormMDCtrlControlController",class extends Sr{async onInit(){const{model:t}=this.parent,{contentControl:a}=t;if(!a)throw new e("表单多数据部件未配置嵌入部件");this.controlModel=a;const s=await Ya(this.controlModel);s&&(this.provider=s)}}),_r=t("FormMDCtrlDataViewController",class extends xr{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onDataViewMounted(t){this.dataViewController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.dataViewController.remove(),this.parent.state.contentCtrlData=this.dataViewController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.dataViewController.load()}async onDataInsert(){}}),Tr=t("EditFormService",class extends Ii{async get(t,e={}){var a;let s=await this.exec((null==(a=this.model.getControlAction)?void 0:a.appDEMethodId)||"get",t,void 0,e);return s=this.handleResponse(s),s}async getDraft(t,e={}){var a;let s=await this.exec((null==(a=this.model.getDraftControlAction)?void 0:a.appDEMethodId)||"getdraft",t,void 0,e);return s=this.handleResponse(s),s}async remove(t,e={}){var a;return await this.exec((null==(a=this.model.removeControlAction)?void 0:a.appDEMethodId)||"remove",t,void 0,e)}async create(t,e){var a;const s=e instanceof yi?e.getOrigin():e,i=this.getFilteredData(s);let n=await this.exec((null==(a=this.model.createControlAction)?void 0:a.appDEMethodId)||"create",t,i);return n=this.handleResponse(n),n}async update(t,e){var a;const s=e instanceof yi?e.getOrigin():e,i=this.getFilteredData(s);let n=await this.exec((null==(a=this.model.updateControlAction)?void 0:a.appDEMethodId)||"update",t,i);return n=this.handleResponse(n),n}async goBack(t,e){var s;const i=null==(s=this.model.goBackControlAction)?void 0:s.appDEMethodId;if(!i)throw new a(this.model,"缺少返回操作实体行为");let n=await this.exec(i,t,e instanceof yi?e.getOrigin():e);return n=this.handleResponse(n),n}async updateFormItem(t,e,a={}){let s=await this.exec(t,e,a);return s=this.handleResponse(s),s}async wfStart(t,e,a){var s;const i=(null==(s=this.model.wfstartControlAction)?void 0:s.appDEMethodId)||"wfstart";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(i,t,e,a instanceof yi?a.getOrigin():a)}async wfSubmit(t,e,a){var s;const i=this.model;let n="";n=e.type?e.type:(null==(s=i.wfsubmitControlAction)?void 0:s.appDEMethodId)||"wfsubmit";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(n,t,e,a instanceof yi?a.getOrigin():a)}initUIDataMap(){super.initUIDataMap();const t=["srfwfmemo","srfwftransferor","srfactionparam","srffrontuf","srfnextform"];f(this.model,(e=>{if("FORMITEM"===e.detailType||"MDCTRL"===e.detailType){const a=e,s=a.fieldName||a.id.toLowerCase(),i=a.fieldName||e.appDEFieldId;let n;n=i?new Ti(s,i,{isOriginField:!0,dataType:a.dataType}):new Ti(s,s,{isOriginField:t.includes(s)}),this.dataUIMap.set(s,n)}}),{childrenFields:["deformPages","deformTabPages","deformDetails"]})}handleResponse(t){const e=super.handleResponse(t);return e.ok&&e.data&&(e.data=this.toUIData(e.data)),e}getFilteredData(t){const e={};return this.dataUIMap.forEach((a=>{void 0!==t[a.dataKey]&&(e[a.dataKey]=t[a.dataKey])})),e}}),Lr=t("EditFormController",class extends Er{get view(){return this.ctx.view}async onCreated(){await super.onCreated(),this.service=new Tr(this.model),await this.service.init(this.context),this.autoSave=P(this.autoSave.bind(this),500,{trailing:!0})}async onMounted(){await super.onMounted(),this.state.loadDefault&&this.load()}async loadDraft(t){const{context:e,params:a}=this.handlerAbilityParams(t),s=await this.getDraftParams();let i;Object.assign(a,s);try{await this.startLoading(),await this.evt.emit("onBeforeLoadDraft",{params:a}),i=await this.service.getDraft(e,a)}catch(t){throw await this.evt.emit("onLoadDraftError",void 0),this.actionNotification("GETDRAFTERROR",{error:t}),t}finally{await this.endLoading()}return this.state.data=i.data,w(this.data,s),this.formStateNotify("DRAFT"),await this.evt.emit("onLoadDraftSuccess",void 0),this.actionNotification("GETDRAFTSUCCESS"),this.state.isLoaded=!0,this.data}async copy(){const t=tt(this.context),e=tt(this.params),a=(await ibiz.hub.getAppDataEntity(this.model.appDataEntityId)).keyAppDEFieldId;if(a&&this.params[a]){t[Ke(this.model.appDataEntityId)]=this.params[a],delete e[a],delete this.params[a],delete e.srfcopymode,delete this.params.srfcopymode}let s;try{await this.startLoading(),await this.evt.emit("onBeforeLoad",void 0),s=await this.service.get(t,e)}catch(t){throw await this.evt.emit("onLoadError",void 0),this.actionNotification("GETERROR",{error:t}),t}finally{await this.endLoading()}return s.data.$origin.srfsourcekey=void 0,this.state.modified=!1,this.state.data=s.data,this.formStateNotify("LOAD"),await this.evt.emit("onLoadSuccess",void 0),this.actionNotification("GETSUCCESS"),this.state.isLoaded=!0,this.data}async load(t){if(this.params.srfcopymode)return this.copy();if(!Xe(this.context,this.model.appDataEntityId))return this.loadDraft();const{context:e,params:a}=this.handlerAbilityParams(t),s=tt(a);let i;try{await this.startLoading(),await this.evt.emit("onBeforeLoad",void 0),i=await this.service.get(e,s)}catch(t){throw await this.evt.emit("onLoadError",void 0),this.actionNotification("GETERROR",{error:t}),t}finally{await this.endLoading()}return this.state.modified=!1,this.state.data=i.data,this.formStateNotify("LOAD"),await this.evt.emit("onLoadSuccess",void 0),this.actionNotification("GETSUCCESS"),this.state.isLoaded=!0,this.data}async save(t){if(this.state.processing){return await v(500,this.save.bind(this))}if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading(),await this.evt.emit("onBeforeSave",void 0);const{context:a,data:s}=this.handlerAbilityParams(t),i=s[0],n=0===i.srfuf;let r;try{r=n?await this.service.create(a,i):await this.service.update(a,i)}catch(t){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(n?"CREATE":"UPDATE","ERROR"),{error:t}),t}finally{await this.endLoading()}return r.data&&y(this.data,r.data),this.state.modified=!1,await this.evt.emit("onSaveSuccess",void 0),this.formStateNotify("SAVE"),this.actionNotification("".concat(n?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(this.data.srfmajortext||"","保存成功")}),"ROUTE"===this.view.modal.mode&&ibiz.mc.command.send(this.data.$origin,n?"OBJECTCREATED":"OBJECTUPDATED"),this.data}async remove(t){const{context:e,params:a}=this.handlerAbilityParams(t);let s,i=!1;if(await this.evt.emit("onBeforeRemove",void 0),1===this.data.srfuf){if(i=await ibiz.modal.confirm({title:"提示",desc:"确认删除吗?"}),!i)return!1;await this.startLoading();try{s=await this.service.remove(e,a)}catch(t){throw await this.evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t}),t}finally{await this.endLoading()}i=s.ok}return this.state.data=new yi,this.state.modified=!1,await this.evt.emit("onRemoveSuccess",void 0),this.actionNotification("REMOVESUCCESS"),"ROUTE"===this.view.modal.mode&&ibiz.mc.command.send(this.data.$origin,"OBJECTREMOVED"),i}async goBack(){let t;await this.startLoading();try{t=await this.service.goBack(this.context,this.data)}finally{await this.endLoading()}t.data&&y(this.data,t.data)}async updateFormItem(t){var a;const s=null==(a=this.model.deformItemUpdates)?void 0:a.find((e=>e.id===t));if(!s)throw new e("没找到".concat(t,"表单项更新"));const{appDEMethodId:i,defiupdateDetails:n,customCode:r,scriptCode:o}=s,c=null==n?void 0:n.map((t=>t.id));let l;if(r&&o)l=ga.execScriptFn({...this.getEventArgs(),data:this.data},o,{isAsync:!1});else{const t={...this.params,...this.data.getOrigin()},e=await this.service.updateFormItem(i,this.context,t);l=e.data}l&&(null==c?void 0:c.length)&&await Promise.all(c.map((t=>this.setDataValue(t,l[t]))))}async wfStart(t){if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading();const{context:a,params:s}=this.handlerAbilityParams(t);try{await this.service.wfStart(a,s,this.data)}catch(t){throw this.actionNotification("WFSTARTERROR",{error:t}),t}finally{await this.endLoading()}this.actionNotification("WFSTARTSUCCESS",{default:"流程启动成功"})}async wfSubmit(t){if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading();const{context:a,params:s}=this.handlerAbilityParams(t);try{await this.service.wfSubmit(a,s,this.data)}catch(t){throw this.actionNotification("WFSUBMITERROR",{error:t}),t}finally{await this.endLoading()}this.actionNotification("WFSUBMITSUCCESS",{default:"流程提交成功"})}async dataChangeNotify(t){await super.dataChangeNotify(t),this.autoSave()}async autoSave(){if(this.model.enableAutoSave)try{await this.save()}catch(t){ibiz.log.error(t)}}}),Nr=t("FormMDCtrlFormController",class extends xr{constructor(){super(...arguments),this.controlControllerArray=[],this.state={data:[]}}onControlMounted(t,e){const a=t.ctrl;this.controlControllerArray[e]=a,a.load()}async onInit(){super.onInit(),this.service=new Tr(this.model.contentControl),await this.service.init(this.parent.form.context)}async fetch(t,e={}){let a=await this.service.exec("fetchdefault",t,e);return a=this.handleResponse(a),a}handleResponse(t){const e=t;return e.ok&&(A(e.data)?e.data=e.data.map((t=>this.service.toUIData(t))):e.data=this.service.toUIData(e.data)),e}async initData(){const t=await this.fetch(this.parent.form.context,this.parent.form.params);this.state.data=t.data}onDataRemove(t){const e=this.controlControllerArray[t];e&&e.remove()}onFormChange(t,e){const a=this.controlControllerArray[e];a&&(a.save(),this.state.data[e]&&y(this.state.data[e],t[0]),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue())}onFormRemoveSuccess(t){this.state.data.splice(t,1),this.controlControllerArray.splice(t,1),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue()}async onDataInsert(){const t=await this.service.getDraft(this.parent.form.context,this.parent.form.params);if(t.data){const e=await this.service.create(this.parent.form.context,t.data);this.state.data.push(e.data),this.parent.state.contentCtrlData=this.state.data,this.parent.setFormDataValue()}}async validate(){return-1===(await Promise.all(this.controlControllerArray.map((t=>t.validate())))).findIndex((t=>!t))}}),Or=t("FormMDCtrlGridController",class extends xr{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onGridMounted(t){this.gridController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.gridController.remove(),this.parent.state.contentCtrlData=this.gridController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.gridController.load()}async onDataInsert(){await this.gridController.newRow(),this.parent.state.contentCtrlData=this.gridController.state.items,this.parent.setFormDataValue()}async onInit(){const{model:t}=this.parent,{contentControl:a}=t;if(!a)throw new e("表单多数据部件未配置嵌入部件");y(a,{enableRowEdit:!0,enableRowNew:!0}),this.controlModel=a;const s=await Ya(this.controlModel);s&&(this.provider=s)}async validate(){const{rows:t}=this.gridController.state;return-1===(await Promise.all(t.map((t=>this.gridController.validate(t))))).findIndex((t=>!t))}}),Mr=t("FormMDCtrlListController",class extends xr{constructor(){super(...arguments),this.selectData=[],this.state={isSelect:!1}}onListMounted(t){this.listController=t.ctrl}onSelectionChange(t){this.state.isSelect=t.data.length>0}onDataRemove(){this.listController.remove(),this.parent.state.contentCtrlData=this.listController.state.items,this.parent.setFormDataValue()}onDataChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}async initData(){this.listController.load()}async onDataInsert(){}}),Rr=t("FormMDCtrlRepeaterFormController",class extends Sr{constructor(){super(...arguments),this.formControllerArray=[]}async onDataInsert(){super.onDataInsert({})}onDataRemove(t){t<0||super.onDataRemove(t)}async validate(){const t=this.formControllerArray.map((t=>t.validate()));return-1===(await Promise.all(t)).findIndex((t=>!t))}setFromController(t){this.formControllerArray.push(t)}}),Vr=t("FormMDCtrlRepeaterFormOneController",class extends Rr{get data(){return this.parent.state.contentCtrlData}onDataItemChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}}),kr=t("FormMDCtrlRepeaterGridController",class extends Sr{constructor(){super(...arguments),this.columns=[],this.editorMap={}}async onInit(){this.initColumns(this.model.deformDetails||[])}initColumns(t){t.forEach((async t=>{if("FORMITEM"===t.detailType){const{editor:e,dataType:a}=t,s=await Qa(e);if(s){const i=await s.createController(e,{unitName:e.unitName,valueFormat:e.valueFormat,context:this.parent.form.context,params:this.parent.form.params,dataType:a});this.editorMap[t.codeName]={provider:s,controller:i}}this.columns.push({codeName:t.codeName,caption:t.caption})}const e=sa(t);e.length&&this.initColumns(e)}))}rowDataChange(t,e,a){const s=this.data[a];Object.prototype.hasOwnProperty.call(s,e)&&!en(s[e],t)||(s[e]=t,this.onDataItemChange(s,a))}}),Fr=t("FormMDCtrlState",class extends yr{constructor(){super(...arguments),this.contentCtrlData=[]}}),Wr=(t("FormMDCtrlController",class extends Ir{createState(){var t;return new Fr(null==(t=this.parent)?void 0:t.state)}async onInit(){switch(await super.onInit(),this.model.contentType){case"FORM":this.mdCtrlContentController=new Nr(this);break;case"GRID":this.mdCtrlContentController=new Or(this);break;case"LIST":this.mdCtrlContentController=new Mr(this);break;case"DATAVIEW":this.mdCtrlContentController=new _r(this);break;case"REPEATER":"DEFAULT"===this.model.detailStyle&&(this.mdCtrlContentController=new Rr(this)),"STYLE3"===this.model.detailStyle&&(this.mdCtrlContentController=new Vr(this)),"STYLE2"===this.model.detailStyle&&(this.mdCtrlContentController=new kr(this))}this.mdCtrlContentController&&await this.mdCtrlContentController.onInit()}setFormDataValue(){const t=this.model.appDEFieldId||this.model.fieldName||this.model.id;t&&this.form.setDataValue(t,this.state.contentCtrlData)}async loadData(){await this.mdCtrlContentController.initData()}async validate(){return this.mdCtrlContentController.validate()}setDefaultValue(){}}),t("FormMDCtrlItemController",class extends Lr{constructor(t,e,a,s,i){super(t,e,a,s),this.state.data=i,this.state.isSimple=!0}async initDetailControllers(t=this.model.deformDetails,e=this,a=void 0){await Promise.all(t.map((async t=>{const s=await ts(t);if(!s)return;e.providers[t.id]=s;const i=await s.createController(t,e,a);e.details[t.id]=i,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(i);const n=sa(t);n.length&&await this.initDetailControllers(n,e,i)})))}}),t("FormPageState",class extends Ar{})),Br=(t("FormPageController",class extends br{createState(){var t;return new Wr(null==(t=this.parent)?void 0:t.state)}}),t("FormRawItemState",class extends yr{})),Ur=(t("FormRawItemController",class extends Ir{createState(){var t;return new Br(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPageState",class extends yr{})),jr=(t("FormTabPageController",class extends Ir{createState(){var t;return new Ur(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPanelState",class extends yr{})),zr=(t("FormTabPanelController",class extends Ir{createState(){var t;return new jr(null==(t=this.parent)?void 0:t.state)}}),t("GridColumnController",class{constructor(t,e){var a;this.isAdaptiveColumn=!1,this.isCustomCode=!1,this.model=t,this.grid=e,this.isAdaptiveColumn="STAR"===t.widthUnit,this.isAdaptiveColumn&&(this.grid.hasAdaptiveColumn=!0),(null==(a=this.deGridDataItem)?void 0:a.customCode)&&(this.isCustomCode=!0)}get context(){return this.grid.context}get params(){return this.grid.params}get enableRowEdit(){return!(!this.grid.model.enableRowEdit||!this.model.enableRowEdit)}get deGridDataItem(){var t;return null==(t=this.grid.model.degridDataItems)?void 0:t.find((t=>t.id===this.model.id))}get valueFormat(){var t;return null==(t=this.deGridDataItem)?void 0:t.format}get dataType(){var t;return null==(t=this.deGridDataItem)?void 0:t.dataType}async init(){await this.onInit()}async onInit(){}getCustomHtml(t){var e;if(null==(e=this.deGridDataItem)?void 0:e.scriptCode)return ga.execScriptFn({data:t.data},this.deGridDataItem.scriptCode,{singleRowReturn:!0,isAsync:!1})}})),Gr=t("GridRowState",class{constructor(t,e){this.errors={},this.uaColStates={},this.editColStates={},this.showRowEdit=!1,this.modified=!1,this.processing=!1,this.data=t,Object.keys(this.data).forEach((t=>{void 0===this.errors[t]&&(this.errors[t]=null)})),Object.values(e.uaColumns).forEach((t=>{t.initActionStates(this)})),Object.values(e.editColumns).forEach((t=>{this.editColStates[t.fieldName]={disabled:!1,readonly:!1,editable:"all"===ibiz.config.grid.editShowMode,required:!1}}))}}),Hr=t("GridService",class extends Di{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.degridDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new Ti(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new Ti(e,e);this.dataUIMap.set(e,s)}))}async updateGridEditItem(t,e,a={}){const s=await this.app.deService.getService(this.model.appDataEntityId);let i=await s.exec(t,e,a);return i=this.handleResponse(i),i}}),Kr=t("GridController",class extends mn{constructor(){super(...arguments),this.hasAdaptiveColumn=!1,this.isMultistageHeader=!1,this.columns={},this.fieldColumns={},this.uaColumns={},this.editColumns={},this.providers={},this.aggTitle="合计"}get groupCodeListItems(){var t;return null==(t=this.groupFieldColumn)?void 0:t.codeListItems}get enableAgg(){return"NONE"!==this.model.aggMode}get allowRowEdit(){return!!this.model.enableRowEdit&&this.state.rowEditOpen}initState(){super.initState(),this.state.rows=[],this.state.noSort=!0===this.model.noSort,this.state.size=this.model.pagingSize||20,this.state.singleSelect=!0===this.model.singleSelect,this.state.columnStates=[],this.state.aggResult={},this.state.rowEditOpen=!1}async onCreated(){await super.onCreated(),this.service=new Hr(this.model),await this.service.init(this.context),this.initColumnStates(),await this.initGridColumns(),this.dataChangeNotify=g(this.dataChangeNotify.bind(this),((t,e)=>[t[0],Array.from(new Set([...t[1],...e[1]]))]),200),await this.initGroup()}async initGroup(){if(!this.model.enableGroup)return;const{groupAppDEFieldId:t,groupCodeListId:e,groupMode:s}=this.model;if(this.groupFieldColumn=Object.values(this.fieldColumns).find((e=>e.model.appDEFieldId===t)),!this.groupFieldColumn)throw new a(this.model,"没有配置分组属性的属性列");const i=this.groupFieldColumn.model.id;if(!this.groupFieldColumn.model.appCodeListId)throw new a(this.groupFieldColumn.model,"分组属性的属性列".concat(i,"没有配置代码表"));const n=this.state.columnStates.findIndex((t=>t.key===this.groupFieldColumn.model.codeName));if(-1!==n&&0!==n){if(this.isMultistageHeader)throw new a(this.model,"请将分组属性列".concat(i,"配置为第一列"));const t=this.state.columnStates.splice(n,1);this.state.columnStates.unshift(...t)}if("CODELIST"===s){if(!e)throw new a(this.model,"代码表分组模式需要配置代码表");if(this.groupFieldColumn.model.appCodeListId!==e)throw new a(this.model,"分组代码表与属性列".concat(i,"的代码表不一致"))}}async afterLoad(t,e){return await super.afterLoad(t,e),await Va(Object.values(this.fieldColumns).map((async t=>{await t.loadCodeList()})),!1),this.state.rows=e.map((t=>{const e=new Gr(t,this);return this.gridStateNotify(e,"LOAD"),e})),this.state.rows.forEach((t=>{Object.values(t.uaColStates).forEach((e=>{e.update(t.data.getOrigin(),this.model.appDataEntityId)}))})),this.calcGroupData(e),this.calcAggResult(e),e}calcGroupData(t){const{enableGroup:e,groupMode:a}=this.model;if(e){const e=new Map,s="CODELIST"===a,i=this.groupFieldColumn.model.id;s&&this.groupCodeListItems.forEach((t=>{e.set(t.value,[])})),t.forEach((t=>{const a=t[i];s||e.has(a)||e.set(a,[]),e.has(a)&&e.get(a).push(t)})),this.state.groups=[],e.forEach(((t,e)=>{const a=this.groupCodeListItems.find((t=>t.value===e));this.state.groups.push({caption:(null==a?void 0:a.text)||"".concat(e),key:e,children:t})}))}}async loadRemoteAgg(){const{aggMode:t,aggAppDataEntityId:e,aggAppDEDataSetId:s}=this.model;if("ALL"!==t)return;if(!s||!e)throw new a(this.model,"缺少配置聚合实体或聚合数据集");const i=await this.getFetchParams(),n=ibiz.hub.getApp(this.context.srfappid),r=await n.deService.exec(e,s,this.context,void 0,i);r.data.length&&([this.state.remoteAggResult]=r.data)}calcAggResult(t){Object.values(this.fieldColumns).forEach((e=>{const a=e.calcFieldAgg(t);a&&(this.state.aggResult[e.model.id]=a)}))}afterRemove(t){super.afterRemove(t);const e=this.state.rows.findIndex((e=>e.data.srfkey===t.srfkey));this.state.rows.splice(e,1),this.state.groups.forEach((e=>{if(e.children.length){const a=e.children.findIndex((e=>e.srfkey===t.srfkey));-1!==a&&e.children.splice(a,1)}}))}async newRow(){const{enableRowEdit:t,enableRowNew:a}=this.model;if(!t||!a||"row"!==ibiz.config.grid.editShowMode)return void ibiz.log.error("不支持新建行");if(this.state.rows.find((t=>t.showRowEdit)))throw new e("请先完成当前行编辑中的行的操作");const s={...this.params},i=this.calcDefaultValue({},!0);let n;Object.assign(s,i);try{n=await this.service.getDraft(this.context,s)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}const r=n.data;w(r,i),this.state.items.unshift(r);const o=new Gr(r,this);this.state.rows.unshift(o),this.gridStateNotify(o,"DRAFT"),this.switchRowEdit(this.state.rows[0],!0),this.actionNotification("GETDRAFTSUCCESS",{data:r})}async save(t){if(this.state.isSimple)return;const a=this.state.rows.find((e=>e.data.srfkey===t.srfkey));if(!a)throw new e("行数据不存在");if(!a.modified)return void ibiz.log.debug("值没有发生改变");if(a.processing)return void await v(500,this.save.bind(this),[t]);if(!await this.validate(a))throw new e("行数据校验不通过,保存取消");let s;await this.startLoading();const i=0===t.srfuf,n=Ke(this.model.appDataEntityId),r=this.context.clone();r[n]=t.srfkey;try{s=i?await this.service.create(r,t):await this.service.update(r,t)}catch(t){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(i?"CREATE":"UPDATE","ERROR"),{error:t,data:a.data}),t}finally{await this.endLoading()}const o=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(o,1,s.data),a.data=s.data,a.modified=!1,this.actionNotification("".concat(i?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(s.data.srfmajortext||"","保存成功"),data:s.data}),this.gridStateNotify(a,"SAVE"),await this.evt.emit("onSaveSuccess",void 0)}async saveAll(){const t=this.state.rows.filter((t=>t.modified)).map((t=>t.data));t.length&&await Va(t.map((t=>this.save(t))))}async initColumnsController(t){var e;const a=await ss(t);if(!a)return;this.providers[t.codeName]=a;const s=await a.createController(t,this);this.columns[t.codeName]=s,"DEFGRIDCOLUMN"===t.columnType?(this.fieldColumns[t.codeName]=s,t.enableRowEdit&&(this.editColumns[t.codeName]=s)):"UAGRIDCOLUMN"===t.columnType?this.uaColumns[t.codeName]=s:"GROUPGRIDCOLUMN"===t.columnType&&(this.isMultistageHeader=!0,await Promise.all((null==(e=t.degridColumns)?void 0:e.map((async t=>{await this.initColumnsController(t)})))||[]))}initColumnStates(){f(this.model,(t=>{"GROUPGRIDCOLUMN"!==t.columnType&&this.state.columnStates.push({key:t.codeName,caption:t.caption,hidden:!!t.hideDefault,uaColumn:"UAGRIDCOLUMN"===t.columnType})}),{childrenFields:["degridColumns"]}),this.calcColumnFixed()}calcColumnFixed(){const t=this.state.columnStates.filter((t=>!t.hidden)),e=t.length,{frozenFirstColumn:a,frozenLastColumn:s}=this.model;t.forEach(((t,i)=>{t.uaColumn?t.fixed=i+1<=Math.floor(e/2)?"left":"right":a&&i<a?t.fixed="left":s&&i>=e-s&&(t.fixed="right")}))}async initGridColumns(){this.model.degridColumns&&await Promise.all(this.model.degridColumns.map((async t=>this.initColumnsController(t))))}async setRowValue(t,e,a){if(!Object.prototype.hasOwnProperty.call(t.data,e)||en(t.data[e],a)){t.data[e]=a,t.modified=!0,t.processing=!0;try{await this.dataChangeNotify(t,[e]),await this.evt.emit("onGridDataChange",{data:this.state.rows.map((t=>t.data))})}finally{t.processing=!1}}}async dataChangeNotify(t,e){await Va(Object.values(this.editColumns).map((async a=>a.dataChangeNotify(t,e))))}gridStateNotify(t,e){Object.values(this.editColumns).forEach((a=>{a.gridStateNotify(t,e)}))}async validate(t){return-1===(await Promise.all(Object.values(this.editColumns).map((e=>e.validate(t))))).findIndex((t=>!t))}async toggleRowEdit(){if(!this.model.enableRowNew)throw new e("当前表格不支持行编辑,无法切换开启行编辑");this.state.rowEditOpen=!this.state.rowEditOpen}async switchRowEdit(t,a,s=!0){if(!this.allowRowEdit)return;const i=void 0===a?!t.showRowEdit:a;if(t.showRowEdit!==i){if(!1===i)if(s)await this.save(t.data);else{if(0===t.data.srfuf)return t.showRowEdit=!1,this.evt.emit("onRowEditChange",{row:t}),this.remove({data:[t.data],silent:!0});t.cacheData&&(t.data=t.cacheData,delete t.cacheData)}else{if(this.state.rows.find((t=>t.showRowEdit)))throw new e("同时只能有一行开启行编辑");if(1===t.data.srfuf){t.cacheData=tt(t.data);const e=this.calcDefaultValue(t.data,!1);Object.assign(t.data,e)}}t.showRowEdit=i,Object.values(this.editColumns).forEach((e=>{t.editColStates[e.fieldName].editable=i})),this.evt.emit("onRowEditChange",{row:t})}}setSort(t,e){if(t&&e){const a=this.fieldIdNameMap.get(t).toLowerCase();super.setSort(a,e)}else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}async updateGridEditItem(t,a){var s;const i=null==(s=this.model.degridEditItemUpdates)?void 0:s.find((t=>t.id===a));if(!i)throw new e("没找到".concat(a,"编辑列更新"));const{appDEMethodId:n,degeiupdateDetails:r,customCode:o,scriptCode:c}=i,l=r.map((t=>t.id));let h;if(o&&c)h=ga.execScriptFn({...this.getEventArgs(),data:t.data},c,{isAsync:!1});else{const e={...this.params,...t.data.getOrigin()},a=await this.service.updateGridEditItem(n,this.context,e);h=a.data}h&&(null==l?void 0:l.length)&&await Promise.all(l.map((e=>this.setRowValue(t,e,h[e]))))}async loadData(t){const{context:e}=this.handlerAbilityParams(t),a=await this.getFetchParams(null==t?void 0:t.viewParam);let s;await this.startLoading();try{s=await this.service.fetch(e,a)}finally{await this.endLoading()}return s.data}async exportData(t){const a=this.fieldColumns,s=Object.keys(a).map((t=>a[t].model.id)),i=Object.keys(a).map((t=>a[t].model.caption)),n=(r=s,(await(async()=>{var s;const i=null==(s=t.params)?void 0:s.type;let n=[];if("activatedPage"===i&&(n=this.state.rows.map((t=>t.data))),"maxRowCount"===i||"customPage"===i){const{size:e}=this.state,{startPage:a,endPage:s}=t.params,r="customPage"===i?{page:0,offset:(a-1)*e,size:(s-a+1)*e}:{size:1e3,page:0};n=await this.loadData({viewParam:r})}if("selectedRows"===i&&(n=this.getData()),0===n.length)throw new e("无导出数据");return(t=>{const e=new Map;Object.keys(a).forEach((t=>{a[t].codeList&&e.set(t,a[t].codeListItems)}));const s=tt(t.map((t=>t.getOrigin())));return s.forEach((t=>{Object.keys(t).forEach((a=>{var s;e.get(a)&&(t[a]=(null==(s=e.get(a).find((e=>e.value===t[a])))?void 0:s.text)||t[a])}))})),s})(n)})()).map((t=>r.map((e=>t[e])))));var r;if(!ibiz.util.getExportExcel)throw new e("ibiz.util.getExportExcel不存在");const o=await ibiz.util.getExportExcel();if(!o)throw new e("导出模块加载错误");o.exportJsonToExcel({header:i,data:n,filename:this.model.logicName,autoWidth:!0})}calcDefaultValue(t,e){const a={};return Object.values(this.editColumns).forEach((s=>{const{createDV:i,createDVT:n,updateDV:r,updateDVT:o}=s.editItem,c=e?n:o,l=e?i:r,h=on({name:s.fieldName,valueType:c,defaultValue:l,valueFormat:s.valueFormat},{data:t,context:this.context,params:this.params});void 0!==h&&(a[s.fieldName]=h)})),a}}),Xr=t("GridFieldColumnController",class extends zr{constructor(){super(...arguments),this.codeList=void 0}get isLinkColumn(){return!!this.model.enableLinkView&&!!this.model.linkAppViewId}get hasAction(){return!!this.model.deuiactionId}clickable(t){const e=t.data[this.model.codeName];return(this.isLinkColumn||this.hasAction)&&e}handlePublicParams(t,e,a){const{userParam:s}=this.model;if(!s)return{context:e,params:a};const{navigateContexts:i,navigateParams:n}=Ue(s);let r={};i&&t&&(r=Re(i,t,a,e));const o=Object.assign(e.clone(),r);let c={};n&&t&&(c=Re(n,t,a,e));return{context:o,params:{...a,...c}}}async openLinkView(t,e){if(!t.data[this.model.codeName])return;const a=this.model.linkValueItem||"srfkey",i=t.data[a];if(null==i)throw new s(this.model,"未在行数据中取到 ".concat(a," 的值"));const{linkAppViewId:n}=this.model;if(!n)return;const r=Da(t.data),o=Object.assign(this.context.clone(),{srfkey:i,...r}),c=tt(this.params),{context:l,params:h}=this.handlePublicParams(t.data,o,c),d=await ibiz.commands.execute(Mi.TAG,n,l,h,{event:e});(null==d?void 0:d.ok)&&this.grid.load()}async triggerAction(t,e){const a=this.model.deuiactionId;await ir.execAndResolved(a,{context:this.context,params:this.params,data:[t.data],view:this.grid.view,event:e})}async loadCodeList(){const t=this.model.appCodeListId;if(!t)return;const e=ibiz.hub.getApp(this.context.srfappid);this.codeList||(this.codeList=e.codeList.getCodeList(t));const a=await e.codeList.get(t,this.context,this.params);return this.codeListItems=a,a}calcFieldAgg(t){const{aggField:e,aggMode:a,aggValueFormat:i,unitName:n}=this.model;if("NONE"===a)return;const r=e||this.model.id;let o;if(t=t.filter((t=>!Q(t[r]))),"PAGE"!==this.grid.model.aggMode)throw"ALL"===this.grid.model.aggMode?new s(this.model,"远程聚合暂未支持"):new s(this.grid.model,"暂未支持聚合模式".concat(this.grid.model.aggMode));switch(a){case"SUM":o=t.map((t=>t[r])).reduce(((t,e)=>t+e),0);break;case"AVG":o=t.map((t=>t[r])).reduce(((t,e)=>t+e),0)/t.length;break;case"MAX":o=Math.max(...t.map((t=>t[r])));break;case"MIN":o=Math.min(...t.map((t=>t[r])));break;default:throw new s(this.model,"暂未支持属性列聚合模式".concat(a))}let c="".concat(o);if(i)try{c=ibiz.util.text.format("".concat(o),i)}catch(t){ibiz.log.error("".concat(o," 值格式化错误"))}return c&&n&&(c+=n),c}formatValue(t=""){if("SIMPLE"!==this.model.valueType)return rn.toText(this.model,t);const e="".concat(t);if(!this.valueFormat)return e;return n.isDate(this.dataType)?rt(e).format(this.valueFormat):ibiz.util.text.format(e,this.valueFormat)}}),Yr=(t("GridUAColumnController",class extends zr{initActionStates(t){var e;const{deuiactionGroup:s}=this.model;if(!s)throw new a(this.model,"操作列没有配置界面行为组");if(!(null==(e=s.uiactionGroupDetails)?void 0:e.length))return void ibiz.log.debug("操作列界面行为组没有配置界面行为");const i=new Ji;s.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const a=new Qi(t.id,this.grid.context.srfappid,e);i.addState(t.id,a)}})),t.uaColStates[this.model.codeName]=i}async onActionClick(t,e,a){const s=t.uiactionId;await ir.execAndResolved(s,{context:this.context,params:this.params,data:[e.data],view:this.grid.view,event:a})}}),t("GridFieldEditColumnController",class extends Xr{constructor(){super(...arguments),this.rules=[]}get unitName(){return this.editItem.unitName}get valueFormat(){return this.model.valueFormat}get valueItemName(){if(this.editItem.editor)return this.editItem.editor.valueItemName}get fieldName(){return this.model.dataItemName}async onInit(){await super.onInit();const t=aa(this.grid.model,this.model.codeName);t&&(this.editItem=t,this.editItem.editor&&"HIDDEN"!==this.editItem.editor.editorType&&(this.editorProvider=await Qa(this.editItem.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.editItem.editor,this),await this.initRules())))}async initRules(){this.rules=[];const t=Oa(this.grid.model.degridEditItemVRs||[],this.fieldName);t&&this.rules.push(...sn(t,this.fieldName,this.valueItemName)),this.editItem.editor&&this.rules.push(...nn(this.editItem.editor)),this.rules.length>0&&(this.validator=new ut({[this.fieldName]:this.rules}))}async setRowValue(t,e,a){a=a||this.fieldName,await this.grid.setRowValue(t,a,e)}async dataChangeNotify(t,a){this.calcColumnDisabled(t);const s=t.editColStates[this.fieldName].required;this.calcColumnRequired(t);if(s!==t.editColStates[this.fieldName].required||a.includes(this.fieldName)||a.includes(this.valueItemName)){if(!await this.validate(t))throw new e("".concat(this.editItem.codeName,"校验报错,").concat(t.errors[this.fieldName]))}a.includes(this.fieldName)&&this.editItem.degridEditItemUpdateId&&await this.grid.updateGridEditItem(t,this.editItem.degridEditItemUpdateId)}gridStateNotify(t,e){this.calcColumnDisabled(t),this.calcColumnReadonly(t),this.calcColumnRequired(t)}calcColumnDisabled(t){let e=this.calcEnableCond(t);if(e&&this.grid.scheduler){const a=this.grid.scheduler.triggerItemEnable(this.fieldName,{data:[t.data]});void 0!==a&&(e=a)}t.editColStates[this.fieldName].disabled=!e}calcColumnRequired(t){let e=!1!==this.editItem.allowEmpty;if(e&&this.grid.scheduler){const a=this.grid.scheduler.triggerItemBlank(this.fieldName,{data:[t.data]});void 0!==a&&(e=a)}t.editColStates[this.fieldName].required=!e}calcColumnReadonly(t){var e;const a=!!(null==(e=this.editItem.editor)?void 0:e.readOnly);t.editColStates[this.fieldName].readonly=a}calcEnableCond(t){const{enableCond:e}=this.editItem,a=0===t.data.srfuf;switch(e){case 0:return!1;case 1:return a;case 2:return!a;default:return!0}}async validate(t){const e=this.fieldName;if("cell"!==ibiz.config.grid.editShowMode&&t.editColStates[e].required&&W(t.data[e]))return t.errors[e]="请填写".concat(this.model.caption||""),!1;if(this.rules.length&&this.validator)try{await this.validator.validate(t.data)}catch(a){const{errors:s}=a;return t.errors[e]=s[0].message,!1}return t.errors[e]=null,!0}}),t("GridGroupColumnController",class extends zr{}),t("ListService",class extends Di{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new Ti(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new Ti(e,e);this.dataUIMap.set(e,s)}))}})),$r=(t("ListController",class extends mn{initState(){super.initState(),this.state.noSort=!0===this.model.noSort}async onCreated(){await super.onCreated(),this.state.size=this.model.pagingSize||20,this.service=new Yr(this.model),await this.service.init(this.context)}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const a=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(a.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}get batchToolbarController(){return this.view.getController("".concat(this.model.name,"_batchtoolbar"))}get quickToolbarController(){return this.view.getController("".concat(this.model.name,"_quicktoolbar"))}setSelection(t){var e,a;super.setSelection(t);const s=null==t?void 0:t[0];null==(e=this.batchToolbarController)||e.calcButtonState(s,this.model.appDataEntityId),null==(a=this.quickToolbarController)||a.calcButtonState(s,this.model.appDataEntityId)}async loadMore(){this.state.total>this.state.items.length&&await this.load({isLoadMore:!0})}async afterLoad(t,e){return await this.handleDataGroup(),e}setData(t){this.state.items=t}getAllData(){return this.state.items}async handleDataGroup(){const{enableGroup:t,groupMode:e}=this.model;t&&e&&("AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup())}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,a=new Map;e.forEach((e=>{const s=a.get(e[t])||[];s.push(e),a.set(e[t],s)}));const s=[];a.forEach(((t,e)=>{s.push({caption:e,key:e,children:[...t]})})),this.state.groups=s}}async handleCodeListGroup(){const{groupAppDEFieldId:t,groupCodeListId:e}=this.model;if(t&&e){const{items:a}=this.state,s=[],i=ibiz.hub.getApp(this.context.srfappid),n=await i.codeList.get(e,this.context,this.params),r=[];n.forEach((e=>{const i=a.filter((a=>a[t]===e.value));s.push({caption:e.text,key:e.value,children:[...i]}),r.push(e.value)}));const o=a.filter((e=>-1===r.indexOf(e[t])));o.length>0&&s.push({caption:"其他",key:"其他",children:[...o]}),this.state.groups=s}}}),t("PanelController",class extends pn{constructor(){super(...arguments),this.panelItems={},this.providers={}}get _evt(){return this.evt}get data(){return this.state.data}initState(){super.initState(),this.state.data={}}setInputData(t){this.inputData=t}getData(){return[this.data]}async onCreated(){var t;await super.onCreated(),await this.initPanelItemControllers(),(null==(t=this.scheduler)?void 0:t.hasControlEventTrigger)&&this._evt.on("onPanelItemEvent",(t=>{this.scheduler.triggerControlEvent(t.panelItemName,t.panelItemEventName,t)}))}async onMounted(){this.load()}async initPanelItemControllers(t=this.model.rootPanelItems,e=this,a=void 0){t&&await Promise.all(t.map((async t=>{var s,i;const n=await rs(t);if(!n)return;e.providers[t.id]=n;const r=await n.createController(t,e,a);e.panelItems[t.id]=r,(null==(s=t.panelItems)?void 0:s.length)&&!r.isDataContainer&&await this.initPanelItemControllers(t.panelItems,e,r),(null==(i=t.panelTabPages)?void 0:i.length)&&await this.initPanelItemControllers(t.panelTabPages,e,r)})))}async load(){const t=await this.prepareData();if(!t)throw new e("未获取到面板数据");const a=this.convertData(t);this.state.data=a,this.panelStateNotify("LOAD")}async prepareData(){let t;if(1===this.model.dataMode)this.inputData&&(t=this.inputData);else t=this.inputData||{};return t}convertData(t){return t}dataChangeNotify(t){Object.values(this.panelItems).forEach((e=>{e.dataChangeNotify(t)}))}panelStateNotify(t){Object.values(this.panelItems).forEach((e=>{e.panelStateNotify(t)}))}async setDataValue(t,e){Object.prototype.hasOwnProperty.call(this.state.data,t)&&this.state.data[t]===e||(this.state.data[t]=e,this.dataChangeNotify([t]))}initControlScheduler(t=[]){const e=[...t];f(this.model,(t=>{t.controlLogics&&e.push(...t.controlLogics)}),{childrenFields:["rootPanelItems","panelItems","panelTabPages"]}),super.initControlScheduler(e)}})),qr=(t("ViewLayoutPanelController",class extends $r{async onCreated(){var t;this.preprocessModel(),await super.onCreated(),(null==(t=this.scheduler)?void 0:t.hasControlEventTrigger)&&this.evt.on("onControlEvent",(t=>{this.scheduler.triggerControlEvent(t.triggerControlName,t.triggerEventName,t.triggerEvent)}))}registerToCtx(){}preprocessModel(t){var e;const a=t=>{const e=[];return t.forEach((t=>{"CONTAINER"===t.itemType&&"PANELPART"===t.predefinedType?e.push(...t.panelItems||[]):e.push(t)})),e.forEach((t=>{"CONTAINER"===t.itemType&&this.preprocessModel(t)})),e};t?t.panelItems=a(t.panelItems||[]):(null==(e=this.model.rootPanelItems)?void 0:e.length)&&(this.model.rootPanelItems=a(this.model.rootPanelItems||[]))}}),t("PanelItemState",class{constructor(t){this.parent=t,this.disabled=!1,this.layout={width:"",height:"",extraStyle:{},extraClass:[],contentStyle:{}},this.class={container:[],containerDyna:[],label:[],labelDyna:[]},this.required=!1;let e,a=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get(){var t;return!1!==(null==(t=this.parent)?void 0:t.visible)&&a},set:t=>(a=t,!0)}),Object.defineProperty(this,"keepAlive",{enumerable:!0,configurable:!0,get(){return void 0!==e?e:!!this.parent&&this.parent.keepAlive},set:t=>(e=t,!0)})}})),Qr=(t("PanelItemController",class{constructor(t,e,a){this.model=t,this.panel=e,this.parent=a,this.dynaLogicResult={visible:!0,disabled:!1,required:!1},this.state=this.createState()}get dataParent(){return this.findDataParent(this)}get data(){return this.dataParent.data}get containerClass(){return[...this.state.class.container,...this.state.class.containerDyna]}get labelClass(){return[...this.state.class.label,...this.state.class.labelDyna]}async init(){await this.onInit()}async onInit(){const{layoutPos:t,sysCss:e,labelSysCss:a}=this.model;if(t){const{width:e,height:a}=je(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(a)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==a?void 0:a.cssName)&&this.state.class.label.push(a.cssName)}createState(){var t;return new qr(null==(t=this.parent)?void 0:t.state)}async dataChangeNotify(t){this.calcDynamicLogic(t),this.calcItemDisabled(this.data),this.calcItemVisible(this.data),this.calcItemRequired(this.data),this.calcDynaClass(this.data)}async panelStateNotify(t){this.calcDynamicLogic([],!0),this.calcItemDisabled(this.data),this.calcItemVisible(this.data),this.calcItemRequired(this.data),this.calcDynaClass(this.data)}calcItemDisabled(t){let e=!this.dynaLogicResult.disabled;if(e&&this.panel.scheduler){const a=this.panel.scheduler.triggerItemEnable(this.model.id,{data:[t]});void 0!==a&&(e=a)}this.state.disabled=!e}calcItemVisible(t){let{visible:e}=this.dynaLogicResult;if(e&&this.panel.scheduler){const a=this.panel.scheduler.triggerItemVisible(this.model.id,{data:[t]});void 0!==a&&(e=a)}this.state.visible=e}calcItemRequired(t){let e=!this.dynaLogicResult.required;if(e&&this.panel.scheduler){const a=this.panel.scheduler.triggerItemBlank(this.model.id,{data:[t]});void 0!==a&&(e=a)}this.state.required=!e}calcDynamicLogic(t,e=!1){var a;this.parent&&!this.parent.state.visible||null==(a=this.model.panelItemGroupLogics)||a.forEach((a=>{const s=a.relatedItemNames||[];if(e||E(s,t))try{const t=ya(this.data,a);switch(a.logicCat){case"ITEMBLANK":this.dynaLogicResult.required=!t;break;case"ITEMENABLE":this.dynaLogicResult.disabled=!t;break;case"PANELVISIBLE":this.dynaLogicResult.visible=t}}catch(t){ibiz.log.error(t)}}))}findDataParent(t){const{parent:e}=t;return e?e.isDataContainer?e:this.findDataParent(e):t.panel}calcDynaClass(t){if(this.model.dynaClass){const e=ze(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=ze(this.model.labelDynaClass,t);e.length&&(this.state.class.labelDyna=e)}}onClick(){this.panel.evt.emit("onPanelItemEvent",{panelItemName:this.model.id,panelItemEventName:"onClick"})}}),t("PickupViewPanelController",class extends pn{async onCreated(){await super.onCreated(),this.mountCounter.enroll(this.model.embeddedAppDEViewId),this.initNavParam()}initNavParam(){const{navigateContexts:t,navigateParams:e}=this.model,a=this.context.clone(),s={...this.params};t&&Object.assign(a,Re(t,this.params,this.context)),e&&Object.assign(s,Re(e,this.params,this.context)),this.state.context=a,this.state.params=s}setEmbedView(t){this.embedView=t,this.embedView.state.isMounted?this.mountCounter.attend(this.model.embeddedAppDEViewId):this.embedView.evt.on("onMounted",(()=>{this.mountCounter.attend(this.model.embeddedAppDEViewId)})),this.embedView.evt.on("onSelectionChange",(t=>{this.evt.emit("onSelectionChange",t)})),this.embedView.evt.on("onDataActive",(t=>{this.evt.emit("onDataActive",{data:t.data})}))}async getSelectedData(){return await this.embedView.call("GetData")}async getAllData(){return await this.embedView.call("GetAllData")}}),class{constructor(t,e){var a;let s;this.model=t,this.searchBar=e,t.appDEFieldId&&(s=Qe(e.appDataEntity,t.appDEFieldId)),this.fieldName=s?s.codeName.toLowerCase():t.id,this.label=t.caption||(null==s?void 0:s.logicName)||t.id,this.valueOP=null==(a=t.defsearchMode)?void 0:a.valueOP}get context(){return this.searchBar.context}get params(){return this.searchBar.params}async init(){if(!this.model.editor)throw new a(this.model,"缺少编辑器模型");this.editorProvider=await Qa(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this))}}),Jr=(t("SearchBarController",class extends pn{constructor(){super(...arguments),this.placeHolder="",this.filterControllers=[]}initState(){super.initState(),this.state.query="",this.state.selectedGroupItem=null,this.state.visible=!!(this.model.enableQuickSearch||this.model.enableGroup||this.model.enableFilter),this.model.enableFilter&&this.resetFilter()}async onCreated(){await super.onCreated();const t=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);t&&(this.appDataEntity=t,this.calcQuickSearchPlaceholder()),await this.initSearchBarFilters()}calcQuickSearchPlaceholder(){if(!this.appDataEntity)return;const t=this.appDataEntity.appDEFields.filter((t=>t.enableQuickSearch));if(t.length){const e=[];t.forEach((t=>{t.lnlanguageRes&&t.lnlanguageRes.lanResTag?e.push(ibiz.i18n.t(t.lnlanguageRes.lanResTag,t.logicName)):t.logicName&&e.push(t.logicName)})),e.length>0&&(this.placeHolder=e.join("、"))}}handleInput(t){this.state.query=t}onSearch(){this.evt.emit("onSearch",void 0)}getFilterParams(){var t;const e={};if(this.state.query&&(e.query=this.state.query),null==(t=this.state.selectedGroupItem)?void 0:t.data){const t=new Function("return (".concat(this.state.selectedGroupItem.data,");"))();Object.assign(e,t)}const a=this.calcFilters();return a&&(e.filters=a),e}resetFilter(){this.state.filterNodes=[{leaf:!1,logicType:"AND",children:[{leaf:!0,field:null,valueOP:null,value:null}]}]}async initSearchBarFilters(){var t;(null==(t=this.model.searchBarFilters)?void 0:t.length)&&(this.model.searchBarFilters.forEach((t=>{const e=new Qr(t,this);this.filterControllers.push(e)})),await Promise.all(this.filterControllers.map((t=>t.init()))))}calcFilters(){if(!this.model.enableFilter)return;let t=!1,e=!1;if(f(this.state.filterNodes[0],(a=>{a.leaf&&(a.field&&a.valueOP&&!Q(a.value)?t=!0:e=!0)})),t&&!e){return this.formatFilters(this.state.filterNodes[0])}}formatFilters(t){return t.leaf?{["".concat(t.field)]:{["$".concat(t.valueOP.toLowerCase())]:t.value}}:{["$".concat(t.logicType.toLowerCase())]:t.children.map((t=>this.formatFilters(t)))}}}),t("TabExpPanelController",class extends pn{constructor(){super(...arguments),this.isShowCaption=!0,this.isShowIcon=!1}get isCache(){return"CACHE"===this.controlParams.expcache||"NO_CACHE"!==this.controlParams.expcache&&ibiz.config.view.expCacheMode.includes(this.model.controlType)}initState(){super.initState(),this.state.tabPages=[],this.state.activeName=""}async onCreated(){await super.onCreated(),this.layoutPanel=this.view.layoutPanel,this.initTabPages(),this.initIconCaption()}initTabPages(){const t=this.model.controls,e=[];t.forEach((t=>{e.push({caption:t.caption,tabTag:t.id,class:t.sysCss?[t.sysCss.cssName]:[],sysImage:t.sysImage})})),this.state.tabPages=e,e.length>0&&this.initDefaultPage()}initIconCaption(){if(this.params.showmode)switch(this.params.showmode){case"ICONANDSHORTWORD":this.isShowIcon=!0,this.isShowCaption=!0;break;case"ICON":this.isShowIcon=!0,this.isShowCaption=!1;break;case"SHORTWORD":this.isShowIcon=!1,this.isShowCaption=!0}}initDefaultPage(){const t=()=>{this.state.activeName=this.state.tabPages[0].tabTag,this.handleTabChange()};if(this.state.defaultTabName){const e=this.state.tabPages.find((t=>t.tabTag===this.state.defaultTabName));e?(this.state.activeName=e.tabTag,this.changeToTab()):t()}else t()}changeToTab(t=this.activeTabViewPanelModel){const e=this.getNavViewMsg(t);this.evt.emit("onNavViewChange",{navViewMsg:e})}get activeTabViewPanelModel(){const{activeName:t}=this.state;return this.model.controls.find((e=>e.id===t))}async handleTabChange(){this.activeTabViewPanelModel&&this.changeToTab()}prepareParams(t){const{navDER:e,navFilter:a,navigateContexts:s,navigateParams:i,appDataEntityId:n}=t,r={deName:Ke(n),navFilter:a,pickupDEFName:null==e?void 0:e.pickupDEFName,navContexts:s,navParams:i},o={context:this.context,params:this.params,data:{}},{resultContext:c,resultParams:l}=We(r,o);return{context:Object.assign(this.context.clone(),c,{currentSrfNav:this.state.activeName}),params:{...this.params,...l}}}getNavViewMsg(t){const{context:e,params:a}=this.prepareParams(t);return{key:t.codeName.toLowerCase(),context:e,params:a,viewId:t.embeddedAppDEViewId,isCache:this.isCache}}}),t("TreeService",class extends Di{async fetchChildNodes(t,e){const{hasQuery:a}=e;let s=[];if(t){const i=ea(this.model,{parentId:null==t?void 0:t.nodeId,hasQuery:a});if(0===i.length)return;(await Va(i.map((async a=>{const s=ta(this.model,a.childDETreeNodeId);return this.fetchNodeDatasByType(s,a,t,e)})),!1)).forEach((t=>{s.push(...t)}))}else{const t=Ze(this.model);s=await this.fetchNodeDatasByType(t,void 0,void 0,e)}return s}async fetchNodeDatasByType(t,e,a,i){const n=0===ea(this.model,{parentId:t.id,hasQuery:i.hasQuery}).length,r={...i,leaf:n};let o=[];switch(t.treeNodeType){case"STATIC":o=[await this.getStaticNodeData(t,e,a,r)];break;case"DE":o=await this.getDENodeDatas(t,e,a,r);break;case"CODELIST":o=await this.getCodeListNodeDatas(t,e,a,r);break;default:throw new s(t,"".concat(t.treeNodeType,"节点类型未支持"))}const{expandFirstOnly:c,expanded:l,rootNode:h}=t,d=h&&!this.model.rootVisible;return n||await Promise.all(o.map((async(t,e)=>{var a;if(l&&(!c||c&&0===e)||(null==(a=i.defaultExpandedKeys)?void 0:a.length)&&i.defaultExpandedKeys.includes(t.id)||d){const e=await this.fetchChildNodes(t,i);t.children=e}}))),o}async getStaticNodeData(t,e,a,s){return new _i(t,a,{parentValueLevel:null==e?void 0:e.parentValueLevel,leaf:!!s.leaf})}getNodeRSFilterParams(t,e,a){const{parentValueLevel:s,navigateContexts:i,navigateParams:n,parentFilter:r,parentDER1N:o}=t,c=null==o?void 0:o.pickupDEFName,l={...a.params},h={...a.context,...(null==e?void 0:e.context)||{}};let d,u,p,m={};if(e){d=e;for(let t=1;t<s;t++)d=null==d?void 0:d.parent}if(d){m=d.deData||{};const t=ta(this.model,d.nodeId);t.appDataEntityId&&(p=Ke(t.appDataEntityId)),u=d.value}const{resultContext:f,resultParams:g}=We({deName:p,navFilter:r?"n_".concat(r,"_eq"):void 0,pickupDEFName:c,navParams:n,navContexts:i},{derValue:u,context:h,params:l,data:m});return Object.assign(h,f),Object.assign(l,g),{context:h,params:l,navContext:f,navParams:g}}async getDENodeDatas(t,e,a,s){const{appDEDataSetId:i,appDataEntityId:n}=t,{context:r,params:o,navContext:c,navParams:l}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}};o.size=t.maxSize||1e3,t.sortAppDEFieldId&&Object.assign(o,{sort:"".concat(t.sortAppDEFieldId.toLowerCase(),",").concat(t.sortDir?t.sortDir.toLowerCase():"asc")});const h=await this.app.deService.exec(n,i,r,o);if(h.data.length){return h.data.map((e=>new xi(t,a,{data:e,leaf:!!s.leaf,navContext:c,navParams:l})))}return[]}async getCodeListNodeDatas(t,e,a,s){const{context:i,params:n,navContext:r,navParams:o}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}},c=await this.app.codeList.get(t.codeListId,i,n);if(c.length){return c.map((e=>new Si(t,a,{data:e,leaf:!!s.leaf,navContext:r,navParams:o})))}return[]}})),Zr=(t("TreeController",class extends mn{constructor(){super(...arguments),this.contextMenus={}}initState(){super.initState(),this.state.defaultExpandedKeys=[],this.state.expandedKeys=[],this.state.size=0}async onCreated(){await super.onCreated(),this.state.expandedKeys=[...this.state.defaultExpandedKeys],this.service=new Jr(this.model),await this.service.init(this.context),this.model.detreeNodes.forEach((t=>{var e,a;(null==(a=null==(e=t.decontextMenu)?void 0:e.detoolbarItems)?void 0:a.length)&&(this.contextMenus[t.decontextMenu.id]=new ur(t.decontextMenu,this.context,this.params,this.ctx))})),await Promise.all(Object.values(this.contextMenus).map((t=>t.created())))}async load(t={}){const e=!0===t.isInitialLoad;let a;e&&await this.startLoading();try{a=await this.loadNodes()}finally{e&&await this.endLoading()}return await this.afterLoad(t,a),this.state.isLoaded=!0,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),a}async loadNodes(t){const e=await this.getFetchParams(),a=!!e.query;let s;this.state.isLoading=!0;try{s=await this.service.fetchChildNodes(t,{context:this.context.clone(),params:e,hasQuery:a,defaultExpandedKeys:this.state.expandedKeys})||[]}finally{this.state.isLoading=!1}return t?t.children=s:this.state.rootNodes=s,this.state.items=[],f({children:this.state.rootNodes},(t=>{this.state.items.push(t)})),this.state.expandedKeys=this.calcExpandedKeys(s),s}async onTreeNodeClick(t){if(this.state.singleSelect){const{selectedData:e}=this.state,a=e.filter((e=>e.id!==t.id));a.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(a)}1===this.state.mdctrlActiveMode&&await this.setActive(t)}onExpandChange(t,e){const a=this.state.expandedKeys.includes(t.id);if(e&&!a)this.state.expandedKeys.push(t.id);else if(!e&&a){const e=this.state.expandedKeys.indexOf(t.id);-1!==e&&this.state.expandedKeys.splice(e,1)}}async onDbTreeNodeClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}setActive(t){const e=this.parseTreeNodeData(t);return this.evt.emit("onActive",{...e,nodeData:t})}setSelection(t){const e=t.map((t=>t.id)),a=this.state.items.filter((t=>e.includes(t.id)));super.setSelection(a)}getNodeModel(t){var e;return null==(e=this.model.detreeNodes)?void 0:e.find((e=>e.id===t))}async doUIAction(t,e,a){const s=this.getEventArgs(),i=this.parseTreeNodeData(e),n=await ir.exec(t,{...s,...i,event:a});if(n.closeView)this.view.closeView();else if(n.refresh)switch(n.refreshMode){case 1:this.refreshNodeChildren(e);break;case 2:this.refreshNodeChildren(e,!0);break;case 3:this.refresh()}}parseTreeNodeData(t){return{data:[{...t,...t.deData||{}}],context:Object.assign(this.context.clone(),t.context||{}),params:{...this.params,...t.params||{}}}}calcExpandedKeys(t){let e=[...this.state.expandedKeys];return f({children:t},(t=>{var a;(null==(a=t.children)?void 0:a.length)&&e.push(t.id)})),e=Array.from(new Set(e)),e}async refreshNodeChildren(t,e=!1){const a=t.srfkey?"srfkey":"id",s=this.state.items.find((e=>e[a]===t[a]));if(!s)return void ibiz.log.error("找不到对应的树节点数据",t);if(e){const{parent:t}=s;if(!t||!this.model.rootVisible&&this.state.rootNodes.includes(t))return void this.refresh()}const i=e?s.parent:s,n=await this.loadNodes(i);this.evt.emit("onAfterRefreshParent",{parentNode:i,children:n})}}),t("WizardPanelService",class extends Ii{async initialize(t,e={},a={}){var s;const i=null==(s=this.model.initControlAction)?void 0:s.appDEMethodId;let n=await this.exec(i,t,e,a);return n=this.handleResponse(n),n}async finish(t,e={},a={}){var s;const i=null==(s=this.model.finishControlAction)?void 0:s.appDEMethodId;let n=await this.exec(i,t,e,a);return n=this.handleResponse(n),n}})),to=(t("WizardPanelController",class extends pn{constructor(){super(...arguments),this.tagHistory=[],this.providers={},this.firstForm=void 0,this.formControllers=new Map,this.steps=[],this.stepTags={}}initState(){super.initState()}async onCreated(){var t,e;await super.onCreated(),this.model.dewizard.dewizardForms.forEach((t=>{var e,a,s;t.firstForm&&(this.firstForm=t);const i="".concat(this.model.name,"_form_").concat(null==(e=t.formTag)?void 0:e.toLowerCase()),n=null==(s=null==(a=this.model.dewizard)?void 0:a.dewizardSteps)?void 0:s.find((e=>e.id===t.dewizardStepId)),r=null==n?void 0:n.stepTag;this.stepTags[i]=r})),null==(e=null==(t=this.model.dewizard)?void 0:t.dewizardSteps)||e.forEach((t=>{this.steps.push(t.stepTag)})),this.service=new Zr(this.model),await this.service.init(this.context);const{deeditForms:a}=this.model;a&&a.length>0&&await Promise.all(a.map((async t=>{const{formTag:e}=t.dewizardForm;if(e){const a=await Ya(t);a&&(this.providers[e]=a)}})))}get activeWizardForm(){const{activeFormTag:t}=this.state,e=this.model.dewizard.dewizardForms.find((e=>e.formTag===t));return e||ibiz.log.debug("找不到".concat(t,"的向导表单")),e}get activeFormController(){const{activeFormTag:t}=this.state,a=this.formControllers.get(t);if(!a)throw new e("找不到".concat(t,"的表单控制器"));return a}onFormMounted(t,e){const a=e.ctrl;this.formControllers.set(t,a),a.load()}onFormSaved(t){const e=t.data[0],a=Ke(this.model.appDataEntityId);!this.context[a]&&e&&e.srfkey&&(this.context[a]=e.srfkey)}async initialize(){var t;if(null==(t=this.model.initControlAction)?void 0:t.appDEMethodId){const t=await this.service.initialize(this.context,this.params),e=Ke(this.model.appDataEntityId);t.data&&t.data.srfkey&&(this.context[e]=t.data.srfkey)}this.firstForm&&(this.state.activeFormTag=this.firstForm.formTag,this.tagHistory.push(this.firstForm.formTag))}async finish(){await this.service.finish(this.context,this.params),this.evt.emit("onFinishSuccess",void 0)}async onPrevClick(){await this.activeFormController.goBack(),this.tagHistory.pop();const t=this.tagHistory[this.tagHistory.length-1];if(!t)throw new e("没有上一个表单");this.state.activeFormTag=t}async onNextClick(){const t=await this.activeFormController.save();let a;if(t.srfnextform){if(!this.model.dewizard.dewizardForms.find((e=>e.formTag===t.srfnextform)))throw new e("找不到标识为".concat(t.srfnextform,"的向导表单"));a=t.srfnextform}else{const{formTag:t}=this.activeWizardForm,s=this.model.dewizard.dewizardSteps;if(s&&t){const i=s.findIndex((e=>e.stepTag===t)),n=s[i+1];if(!n)throw new e("找不到下一个向导步骤");const r=this.model.dewizard.dewizardForms.find((t=>t.formTag===n.stepTag));r&&(a=r.formTag)}}if(!a)throw new e("找不到下一个向导表单");this.state.activeFormTag=a,this.tagHistory.push(a)}async onFinishClick(){await this.activeFormController.save(),await this.finish()}}),t("MDCtrlService",class extends Di{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),a=t.appDEFieldId;let s;if(a){const i=a.toLowerCase();s=new Ti(e,i,{isOriginField:!0,dataType:t.dataType})}else s=new Ti(e,e);this.dataUIMap.set(e,s)}))}})),eo=t("MobMDCtrlRowState",class{constructor(t,e){this.data=t,this.controller=e,this.uaColStates={},this.data=t}}),ao=(t("MDCtrlController",class extends mn{initState(){super.initState(),this.state.rows=[],this.state.noSort=!0===this.model.noSort,this.state.mdctrlActiveMode=1}async onCreated(){await super.onCreated(),this.service=new to(this.model),await this.service.init(this.context),this.setSort()}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;this.state.sortQuery=t&&e?"".concat(t.toLowerCase(),",").concat(e.toLowerCase()):""}}async loadMore(){this.state.total>this.state.items.length&&!this.state.isLoading&&await this.load({isLoadMore:!0})}async refresh(){await this.load({isInitialLoad:!0})}async afterLoad(t,e){return t.isInitialLoad&&(this.state.rows=[]),e&&e.length>0&&this.state.rows.push(...e.map((t=>{const e=new eo(t,this);return this.initActionStates(e),e}))),await this.initGroupCodeListItems(),await this.handleDataGroup(),super.afterLoad(t,e)}setData(t){const e=t.map((t=>new eo(t,this)));this.state.rows=e}getAllData(){return this.state.rows.map((t=>t.data))}async onActionClick(t,e,a){const s=t.uiactionId;await ir.execAndResolved(s,{context:this.context,params:this.params,data:[e.data],view:this.view,event:a})}initActionStates(t){const{deuiactionGroup:e,deuiactionGroup2:a}=this.model;e&&this.initUIActionGroup(t,e),a&&this.initUIActionGroup(t,a)}initUIActionGroup(t,e){var a;(null==(a=e.uiactionGroupDetails)?void 0:a.length)||ibiz.log.debug("操作列界面行为组没有配置界面行为");const s=new Ji;(e.uiactionGroupDetails||[]).forEach((t=>{const e=t.uiactionId;if(e){const a=new Qi(t.id,this.context.srfappid,e);s.addState(t.id,a)}})),s.update(t.data.getOrigin()),t.uaColStates[e.id]=s}async handleDataGroup(){const{enableGroup:t,groupMode:e,groupAppDEFieldId:s}=this.model;if(t&&e){if(!s)throw new a(this.model,"分组属性没有配置");"AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup()}}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,a=new Map;e.forEach((e=>{const s=e[t];Q(s)||(a.has(s)||a.set(s,[]),a.get(s).push(new eo(e,this)))}));const s=[];a.forEach(((t,e)=>{s.push({caption:e,key:e,children:[...t]})})),this.state.groups=s}}async initGroupCodeListItems(){const{groupCodeListId:t}=this.model;if(!t)return;const e=ibiz.hub.getApp(this.context.srfappid);this.groupCodeListItems=await e.codeList.get(t,this.context,this.params)}async handleCodeListGroup(){const{groupAppDEFieldId:t,groupCodeListId:e}=this.model;if(!e)throw new a(this.model,"分组代码表没有配置");const{items:s}=this.state,i=new Map;this.groupCodeListItems.forEach((t=>{i.set(t.value,[])})),s.forEach((e=>{const a=e[t],s=i.get(a);s&&s.push(new eo(e,this))}));const n=[];i.forEach(((t,e)=>{const a=this.groupCodeListItems.find((t=>t.value===e));n.push({caption:a.text,key:a.value,children:t})})),this.state.groups=n}}),t("KanbanService",class extends fr{async updateGroup(t,e){var a;const s=(null==(a=this.model.updateGroupControlAction)?void 0:a.appDEMethodId)||"update";let i=await this.exec(s,t,e.getOrigin());return i=this.handleResponse(i),i}})),so=(t("KanbanController",class extends gr{get enableEditOrder(){return!0===this.model.enableCardEditOrder}get enableEditGroup(){return!0===this.model.enableCardEditGroup}async initControlService(){this.service=new ao(this.model),await this.service.init(this.context)}initState(){super.initState(),this.state.size=this.model.pagingSize||1e3,this.state.updating=!1,this.state.draggable=this.enableEditOrder||this.enableEditGroup}async onCreated(){await super.onCreated()}sortItems(t){const s=this.model.minorSortAppDEFieldId,{minorSortDir:i}=this.model;if(!s)throw new a(this.model,"排序属性没配置");if(!i)throw new a(this.model,"排序方向没配置");const n="ASC"===i;t.forEach((t=>{const a=t[s];if(Q(a))t[s]=0;else{const s=Number(a);if(Number.isNaN(s))throw new e("".concat(t.srfmajortext,"的排序属性无法转换成数值"))}})),t.sort(((t,e)=>n?t[s]-e[s]:e[s]-t[s]))}async afterLoad(t,e){return this.sortItems(this.state.items),super.afterLoad(t,e)}handleDataGroup(){if(!this.model.enableGroup||"NONE"===this.model.groupMode)throw new e("看板部件必须开启分组");return super.handleDataGroup()}async onDragChange(t){if(!this.enableEditGroup&&t.from!==t.to)return void ibiz.message.warning("当前看板不允许调整分组!");const e="ASC"===this.model.minorSortDir,{from:a,to:s,fromIndex:i,toIndex:n}=t,r=this.model.groupAppDEFieldId,o=this.model.minorSortAppDEFieldId,c=[],l=this.state.groups.find((t=>t.key===a)),h=this.state.groups.find((t=>t.key===s));if(!this.enableEditOrder){if(t.from===t.to)return void ibiz.message.warning("当前看板不允许调整次序");const e=l.children[i];return e[r]=t.to,this.updateChangedItems([e])}const d=t=>t+(100-t%100),u=[...h.children],p=[...h.children],m=l.children[i];t.from!==t.to?(m[r]=t.to,p.splice(n,0,m)):(p.splice(i,1),p.splice(n,0,m));const f=l.children.splice(i,1);let g;h.children.splice(n,0,...f),e||(u.reverse(),p.reverse());let w,E=[];p.forEach(((t,e)=>{void 0===g?t!==u[e]&&(g=u[e]?u[e][o]||100:0===e?100:d(u[e-1][o]),t[o]=g,c.push(t)):(g>=t[o]?(E.length>0&&(E.forEach((t=>{t[o]=d(w),c.push(t),w=t[o]})),g=w,w=0,E=[]),t[o]=d(g),c.push(t)):(0===E.length&&(w=g),E.push(t)),g=t[o])})),this.updateChangedItems(c)}async updateChangedItems(t){try{this.state.updating=!0,await Promise.all(t.map((async t=>{const e=Ke(this.model.appDataEntityId),a=this.context.clone();a[e]=t.srfkey;const s=await this.service.updateGroup(a,t);if(s.data){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(e,1,s.data)}})))}finally{this.state.updating=!1,await this.afterLoad({},this.state.items)}}}),t("TreeGridExService",class extends Jr{constructor(){super(...arguments),this.multipleUiMap=new Map}initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.detreeNodes)||t.forEach((t=>{var e;const a=new Map;null==(e=t.detreeNodeDataItems)||e.forEach((t=>{const e=t.id.toLowerCase(),s=t.appDEFieldId.toLowerCase(),i=new Ti(e,s,{isOriginField:!0,dataType:t.dataType});a.set(e,i)})),this.multipleUiMap.set(t.id,a)}))}async getDENodeDatas(t,e,a,s){const{appDEDataSetId:i,appDataEntityId:n}=t,{context:r,params:o,navContext:c,navParams:l}=e?this.getNodeRSFilterParams(e,a,s):{context:s.context,params:s.params,navContext:{},navParams:{}};o.size=t.maxSize||1e3,t.sortAppDEFieldId&&t.sortDir&&Object.assign(o,{sort:"".concat(t.sortAppDEFieldId.toLowerCase(),",").concat(t.sortDir.toLowerCase())});const h=await this.app.deService.exec(n,i,r,o);if(h.data.length){const{data:e}=this.handleResponseForMultiple(h,t.id);return e.map((e=>new xi(t,a,{data:e,leaf:!!s.leaf,navContext:c,navParams:l})))}return[]}handleResponseForMultiple(t,e){const a=super.handleResponse(t);return a.headers&&(a.headers["x-page"]&&(a.page=Number(a.headers["x-page"])),a.headers["x-per-page"]&&(a.size=Number(a.headers["x-per-page"])),a.headers["x-total"]&&(a.total=Number(a.headers["x-total"]))),a.ok&&(z(a.data)?a.data=a.data.map((t=>this.toUIDataForMultiple(t,e))):a.data=this.toUIDataForMultiple(a.data,e)),a}toUIDataForMultiple(t,e){const a=this.multipleUiMap.get(e);return new yi(t,a)}})),io=(t("TreeGridExController",class extends mn{constructor(){super(...arguments),this.providers={},this.columns={},this.fieldColumns={},this.uaColumns={}}initState(){super.initState(),this.state.size=0,this.state.columnStates=[],this.state.defaultExpandedKeys=[]}async onCreated(){await super.onCreated(),this.service=new so(this.model),await this.service.init(this.context),this.initColumnStates(),await this.initGridColumns()}async initGridColumns(){this.model.detreeColumns&&await Promise.all(this.model.detreeColumns.map((async t=>this.initColumnsController(t))))}async initColumnsController(t){const e=await ss(t);if(!e)return;this.providers[t.codeName]=e;const a=await e.createController(t,this);this.columns[t.codeName]=a,"DEFGRIDCOLUMN"===t.columnType?this.fieldColumns[t.codeName]=a:"UAGRIDCOLUMN"===t.columnType&&(this.uaColumns[t.codeName]=a)}initColumnStates(){f(this.model,(t=>{"GROUPGRIDCOLUMN"!==t.columnType&&this.state.columnStates.push({key:t.codeName,caption:t.caption,hidden:!!t.hideDefault,uaColumn:"UAGRIDCOLUMN"===t.columnType})}),{childrenFields:["detreeColumns"]}),this.calcColumnFixed()}calcColumnFixed(){const t=this.state.columnStates.filter((t=>!t.hidden)),e=t.length;t.forEach(((t,a)=>{t.uaColumn?t.fixed=a+1<=Math.floor(e/2)?"left":"right":t.fixed="right"}))}async load(t={}){const e=!0===t.isInitialLoad,a=await this.loadNodes();return this.state.expandedKeys=this.calcExpandedKeys(a),await this.afterLoad(t,a),this.state.isLoaded=!0,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),a}async loadNodes(t){const e=await this.getFetchParams(),a=!!e.query,s=t?void 0:this.state.defaultExpandedKeys;let i;await this.startLoading();try{i=await this.service.fetchChildNodes(t,{context:this.context.clone(),params:e,hasQuery:a,defaultExpandedKeys:s})||[]}finally{await this.endLoading()}return t?t.children=i:this.state.rootNodes=i,this.state.items=[],f({children:this.state.rootNodes},(t=>{this.state.items.push(t)})),i}calcExpandedKeys(t){let e=[];return f({children:t},(t=>{var a;(null==(a=t.children)?void 0:a.length)&&e.push(t.id)})),this.state.defaultExpandedKeys.length&&(e.push(...this.state.defaultExpandedKeys),e=Array.from(new Set(e))),e}}),t("TreeGridController",class extends Kr{}),t("TreeGridService",class extends Hr{}),t("MEditViewPanelService",class extends Di{})),no=(t("MEditViewPanelController",class extends mn{constructor(){super(...arguments),this.showButton=!0,this.deResParameters=[],this.parameters=[]}async onCreated(){await super.onCreated(),this.service=new io(this.model),await this.service.init(this.context),await this.initParameters()}initState(){super.initState(),this.state.panelUiItems=[],this.state.activeTab="",this.state.size=1e3}async formatAppDERSPath(t,e){var a,s;if(!e||0===e.length)return[];let i=0;for(const n of e){const r={isInclude:!0,data:[]};for(const e of n){const i=await ibiz.hub.getAppDataEntity(e.majorAppDataEntityId);i&&i.codeName&&(r.isInclude=t[i.codeName.toLowerCase()]&&r.isInclude,r.data.push({parameterName:null==(a=i.keyAppDEFieldId)?void 0:a.toLowerCase(),pathName:null==(s=i.codeName)?void 0:s.toLowerCase()}))}if(i++,r.isInclude)return r.data;if(i===e.length)return[]}return[]}async initParameters(){var t,e;if(this.controlParams.SHOWBUTTON&&(this.showButton=!Object.is(this.controlParams.SHOWBUTTON,"false")),this.model.embeddedAppViewId){const a=await ibiz.hub.getAppView(this.model.embeddedAppViewId);if(a.appDataEntityId){const s=await ibiz.hub.getAppDataEntity(a.appDataEntityId);a&&s?(this.deResParameters=await this.formatAppDERSPath(this.context,a.appDERSPaths),this.parameters=[{parameterName:null==(t=s.keyAppDEFieldId)?void 0:t.toLowerCase(),pathName:null==(e=s.codeName)?void 0:e.toLowerCase()}]):(this.deResParameters=[],this.parameters=[])}}}async afterLoad(t,e){return await super.afterLoad(t,e),this.state.panelUiItems=[],this.doItems(e),"TAB_TOP"===this.model.panelStyle&&this.state.panelUiItems.length>0&&(this.state.activeTab=this.state.panelUiItems[0].id),e}handlePanelItemParams(t){const[{parameterName:e}]=this.parameters,a={id:t[e]?t[e]:"mockId:".concat(j()),context:{},params:{},data:t,srfmajortext:""};return Object.assign(a.context,this.context),this.deResParameters.forEach((e=>{const{parameterName:s,pathName:i}=e;this.context[s]&&!Object.is(this.context[s],"")?Object.assign(a.context,{[i]:this.context[s]}):t[s]&&!Object.is(t[s],"")&&Object.assign(a.context,{[i]:t[s]})})),this.parameters.forEach((e=>{const{parameterName:s,pathName:i}=e;t[s]&&!Object.is(t[s],"")&&Object.assign(a.context,{[i]:t[s]}),t.srfmajortext&&!Object.is(t.srfmajortext,"")?Object.assign(a,{srfmajortext:t.srfmajortext}):0===t.srfuf&&Object.assign(a,{srfmajortext:"草稿--新建"})})),Object.assign(a.params,this.params),a}doItems(t){t.forEach((t=>{const e=this.handlePanelItemParams(t);this.state.panelUiItems.push(e)}))}async handleAdd(){this.doItems([{srfuf:0}]),"TAB_TOP"===this.model.panelStyle&&(this.state.activeTab=this.state.panelUiItems[this.state.panelUiItems.length-1].id)}async handleDelete(t){if(0===t.data.srfuf){const e=this.state.panelUiItems.findIndex((e=>e===t));this.state.panelUiItems.splice(e,1)}else await this.remove({data:[t.data]})}async handleTabDelete(t,e){let a=!1;t.id===this.state.activeTab&&e===this.state.panelUiItems.length-1&&e>0&&(a=!0),await this.handleDelete(t),a&&(this.state.activeTab=this.state.panelUiItems[this.state.panelUiItems.length-1].id)}afterRemove(t){super.afterRemove(t);const e=this.state.panelUiItems.findIndex((e=>e.data.srfkey===t.srfkey));-1!==e&&this.state.panelUiItems.splice(e,1)}onViewDataChange(t,e){"onSaveSuccess"===t.eventName&&this.save(t.data[0],e)}async save(t,a){const s=this.state.panelUiItems.findIndex((t=>t.id===a));if(!s)throw new e("编辑视图面板部件UI数据不存在");let i;await this.startLoading();const n=0===t.srfuf,r=Ke(this.model.appDataEntityId),o=this.context.clone();o[r]=t.srfkey;try{i=n?await this.service.create(o,t):await this.service.update(o,t)}catch(t){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(n?"CREATE":"UPDATE","ERROR"),{error:t,data:this.state.panelUiItems[s].data}),t}finally{await this.endLoading()}const c=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(c,1,i.data),this.state.panelUiItems.splice(s,1,this.handlePanelItemParams(i.data)),await this.evt.emit("onSaveSuccess",void 0)}}),t("HubController",class{constructor(){this.session={}}login(t,e){return ibiz.auth.login(t,e)}logout(){return ibiz.auth.logout()}})),ro=class{constructor(){this.convert=new Bi,this.controller=new no,this.appMap=new Map,this.apps=new Map,this.view2appMap=new Map,this.views=new Map,this.dataEntities=new Map,this.config=new ji,this.defaultAppIndexViewName="Index"}calcAppViewId(t){let e="";if(-1!==t.indexOf(".")){const a=t.split(".");e=a[a.length-1]}else e=t.toLowerCase();return e}registerModelLoaderProvider(t){this.modelLoaderProvider=t}registerApp(t){this.apps.set(t.codeName,t)}registerAppView(t){this.views.set(t.codeName,t)}registerAppDataEntity(t,e=ibiz.env.appId){this.dataEntities.has(e)||this.dataEntities.set(e,new Map);this.dataEntities.get(e).set(t.id,t)}setAppView(t,e=ibiz.env.appId){const a=this.calcAppViewId(t);this.view2appMap.set(a,e)}hasAppView(t){const e=this.calcAppViewId(t);return this.view2appMap.has(e)}async getAppStyle(t){return this.modelLoaderProvider?this.modelLoaderProvider.getAppStyle(t):null}async getAppView(t){const a=this.calcAppViewId(t),s=this.view2appMap.get(a)||ibiz.env.appId;if(this.appMap.has(s)||await this.createApp(s),this.views.has(a))return this.views.get(a);if(this.modelLoaderProvider){const t=await this.modelLoaderProvider.getAppView(s,a);return this.registerAppView(t),t}throw new e("视图[".concat(a,"]不存在"))}async getAppDataEntity(t,a=ibiz.env.appId){if(this.dataEntities.has(a)){const e=this.dataEntities.get(a);if(e.has(t))return e.get(t)}if(this.modelLoaderProvider){let e;return e=-1!==t.indexOf(".")?await this.modelLoaderProvider.getAppDataEntity(a,t):await this.modelLoaderProvider.getAppDataEntityByCodeName(a,t),this.registerAppDataEntity(e,a),e}throw new e("未找到应用实体[".concat(t,"]"))}async createApp(t){if(this.appMap.has(t))return this.appMap.get(t);let a;if(this.apps.has(t))a=this.apps.get(t);else{if(!this.modelLoaderProvider)throw new e("未找到应用[".concat(t,"]模型"));a=await this.modelLoaderProvider.getApp(t),this.registerApp(a)}const s=new Fi(a);return this.appMap.set(t,s),await s.init(),this.configCache||(this.configCache=new Os(ibiz.env.appId,"PSSysHub","Global")),s}async getAppAsync(t=ibiz.env.appId){return this.createApp(t)}getApp(t){let e=null;return e=t?t instanceof Object?t.id:t:ibiz.env.appId,this.appMap.get(e)}},oo=t("EngineFactory",class{constructor(){this.viewEngines=new Map}register(t,e){this.viewEngines.set(t,e)}unRegister(t){this.viewEngines.delete(t)}getEngine(t,...e){const{engineType:a,engineCat:s}=t,i="".concat(s,"_").concat(a),n=this.viewEngines.get(i);if(n)return n(...e);ibiz.log.error("没有".concat(i,"对应的引擎"),t)}}),co=t("ViewEngineBase",class{constructor(t){this.view=t,this.initViewState()}get toolbar(){return this.view.getController("toolbar")}get leftToolbar(){return this.view.getController("lefttoolbar")}get rightToolbar(){return this.view.getController("righttoolbar")}get footerToolbar(){return this.view.getController("footertoolbar")}get viewLayoutPanel(){return this.view.layoutPanel}async onCreated(){const{childNames:t}=this.view;t.push("captionbar","toolbar")}async onMounted(){var t,e;const{model:a,childNames:s}=this.view;ibiz.log.debug("".concat(a.id,"的子组件:").concat(s.join(";"),"都已mounted"));if(!this.calcViewHeaderVisible()){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_header;e&&(e.state.visible=!1)}if(ibiz.env.isMob){if(!this.calcViewFooterVisible()){const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.view_footer;t&&(t.state.visible=!1)}}}async onDestroyed(){}async call(t,e){if("GetData"===t)return this.getData()}initViewState(){}getData(){return[]}calcViewHeaderVisible(){var t,e,a,s;let i=!1;const{model:n}=this.view;if(!1===n.showCaptionBar){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_captionbar;e&&(e.state.visible=!1)}else i=!0;if(ibiz.env.isMob){if(this.leftToolbar)i=!0;else{const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.lefttoolbar;t&&(t.state.visible=!1)}if(this.rightToolbar)i=!0;else{const t=null==(a=this.viewLayoutPanel)?void 0:a.panelItems.righttoolbar;t&&(t.state.visible=!1)}}else if(this.toolbar)i=!0;else{const t=null==(s=this.viewLayoutPanel)?void 0:s.panelItems.view_toolbar;t&&(t.state.visible=!1)}return i}calcViewFooterVisible(){let t=!1;return this.footerToolbar&&(t=!0),t}async loadEntityData(){const{appDataEntityId:t}=this.view.model,{evt:a,context:s,params:i}=this.view;if(!t)throw new e("该视图没有实体,无法加载实体数据");const n=ibiz.hub.getApp(s.srfappid),r=await n.deService.exec(t,"get",s,i),{data:o}=r;o&&(this.view.state.srfactiveviewdata=o,a.emit("onDataChange",{actionType:"LOAD",data:[o]}),o.srfkey&&a.emit("onViewInfoChange",{dataInfo:o.srfmajortext||""}))}}),lo=(t("MDViewEngine",class extends co{get xdataControlName(){return this.view.model.xdataControlName}get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get xdataControl(){return this.view.getController(this.xdataControlName)}async onCreated(){await super.onCreated();const{childNames:t}=this.view;t.push(this.xdataControlName,"searchform","searchbar"),this.xdataControlName&&(this.view.slotProps[this.xdataControlName]||(this.view.slotProps[this.xdataControlName]={}),this.view.slotProps[this.xdataControlName].loadDefault=!1)}async onMounted(){await super.onMounted();const{model:t}=this.view;this.xdataControl.evt.on("onActive",this.onXDataActive.bind(this)),this.xdataControl.evt.on("onSelectionChange",(async t=>{var e;null==(e=this.toolbar)||e.calcButtonState(t.data[0],this.xdataControl.model.appDataEntityId)})),this.xdataControl.evt.on("onBeforeLoad",(()=>{this.xdataControl.state.searchParams=this.getSearchParams()})),this.xdataControl.evt.on("onLoadSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"LOAD"})})),this.xdataControl.evt.on("onRemoveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"REMOVE"})})),this.xdataControl.evt.on("onSaveSuccess",(t=>{this.view.evt.emit("onDataChange",{...t,actionType:"SAVE"})}));const e=this.viewLayoutPanel.panelItems.view_searchform;if(e){const a=!!this.searchForm;e.state.keepAlive=a,e.state.visible=a&&!!t.expandSearchForm}this.searchForm&&this.searchForm.evt.on("onSearch",(()=>{this.reLoad()})),this.searchBar&&this.searchBar.evt.on("onSearch",(()=>{this.reLoad()})),!this.view.state.noLoadDefault&&t.loadDefault&&this.load()}async onXDataActive(t){await this.openData(t)}async call(t,e){return"ToggleFilter"===t?(this.toggleFilter(),null):"Edit"===t||"View"===t?(await this.openData(e),null):"New"===t?(await this.newData(e),null):"Remove"===t?(await this.remove(e),null):"Import"===t?(await this.importData(),null):"Refresh"===t?(await this.refresh(),null):"ExportExcel"===t?(await this.exportData(e),null):"Copy"===t?(this.copy(e),null):"Load"===t?(this.load(e),null):super.call(t,e)}getData(){return this.xdataControl.getData()}async openData(t){var e,a;const{data:s,event:i}=t,n=(t.context||this.view.context).clone(),r=t.params||this.view.params;n[((null==(e=s[0].srfdecodename)?void 0:e.toLowerCase())||Ke(this.xdataControl.model.appDataEntityId)).toLowerCase()]=s[0].srfkey;const o=await(null==(a=this.view.scheduler)?void 0:a.triggerCustom("opendata",{context:n,params:r,data:s,event:i,view:this.view}));o instanceof Object&&o.ok?this.refresh():-1===o&&ibiz.log.warn("视图[".concat(this.view.model.codeName,"],未配置编辑打开视图"))}async newData(t){var e,s,i;const{data:n,event:r,copyMode:o}=t;if(!(null==(s=null==(e=this.view.model.viewLayoutPanel)?void 0:e.appViewLogics)?void 0:s.find((t=>"newdata"===t.id))))throw new a(this.view.model,"缺少newdata的视图逻辑");const c=tt(this.view.params);o&&(c.srfcopymode=o);const l=await(null==(i=this.view.scheduler)?void 0:i.triggerCustom("newdata",{context:this.view.context,params:c,data:n,event:r,view:this.view}));if(l instanceof Object&&l.ok)this.refresh();else if(-1===l)throw new a(this.view.model,"缺少newdata的视图逻辑")}async remove(t){await this.xdataControl.remove(t)}async load(t={}){await this.xdataControl.load({isInitialLoad:!0,...t})}async refresh(){await this.xdataControl.refresh()}async reLoad(){await this.xdataControl.load({isInitialLoad:!0})}getSearchParams(){const t={};return this.searchForm&&Object.assign(t,this.searchForm.getFilterParams()),this.searchBar&&Object.assign(t,this.searchBar.getFilterParams()),t}async importData(){await this.xdataControl.importData()}async exportData(t){await this.xdataControl.exportData(t)}async copy(t){this.newData(Object.assign(t,{copyMode:!0}))}calcViewHeaderVisible(){let t=super.calcViewHeaderVisible();if(this.searchBar&&this.searchBar.state.visible)t=!0;else{const t=this.viewLayoutPanel.panelItems.view_searchbar;t&&(t.state.visible=!1)}return t}toggleFilter(){if(this.searchForm){const t=this.viewLayoutPanel.panelItems.view_searchform;t&&(t.state.visible=!t.state.visible)}}}),class{handle(t){return t instanceof a||t instanceof s?ibiz.message.error(t.message,10,!0):t instanceof o?401===t.status?ibiz.message.error("没有注册无权限错误处理器"):ibiz.notification.error({title:"",desc:t.message,duration:10}):t instanceof d?ibiz.message.error(t.message,t.duration,0===t.duration):t instanceof e&&ibiz.message.error(t.message,10,!0),ibiz.log.error(t),!0}}),ho=class{constructor(){this.handlers=[]}register(t){this.handlers.unshift(t)}handleSingle(t){this.handlers.find((e=>!!e.handle(t)))||ibiz.log.error("没有找到能处理该错误的处理器",t)}handle(t){t instanceof Array?t.forEach((t=>{this.handleSingle(t)})):this.handleSingle(t)}},uo=class{constructor(){this.layoutPanel=new Ia,this.text=new Ma,this.hbs=new Oe,this.rawValue=new Ra,this.error=new ho,this.error.register(new lo)}showAppLoading(){const t=document.getElementById("app-loading-x");t&&(t.style.display="none")}hiddenAppLoading(){setTimeout((()=>{const t=document.getElementById("app-loading-x");t&&(t.style.display="none")}),300)}},po=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.logicType}execute(t){throw new e("Method not implemented.")}destroy(){}},mo=class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createExecutor(t,e){const a=this.constructorMap.get(t.logicType);if(!a)throw new s(t,"逻辑类型 ".concat(t.logicType," 暂未支持!"));return a(t,e)}},fo=class extends po{constructor(){super(...arguments),this.initialized=!1}convertScriptArgs(t){return t}init(t,e,a){this.convertScriptArgs=e;const s=this.logic.scriptCode;this.scriptFn=ga.createScriptFn(t,s,a),this.initialized=!0}execute(t){const e=this.convertScriptArgs(t);return this.scriptFn.exec(e)}},go=class extends po{execute(t){const{appDEUILogicId:e,appDataEntityId:s}=this.logic;if(!e)throw new a(this.logic,"没有配置实体界面逻辑");sr(e,s,t)}},wo=class{constructor(t){this.triggers=new Map,this.executors=new Map,this.hasViewEventTrigger=!1,this.hasControlEventTrigger=!1,this.logics=t,t.forEach((t=>{try{const e=this.createExecutor(t);this.executors.set(t.id,e);const a=this.createTrigger(t);this.triggers.set(t.id,a),a.bindExecutor(e)}catch(t){ibiz.log.error(t.message)}}))}destroy(){this.triggers.forEach((t=>t.destroy())),this.executors.forEach((t=>t.destroy()))}getExecuteParams(t){let e={};return this.defaultParamsCb&&(e=this.defaultParamsCb()),st(t,e)}createTrigger(t){switch(t.triggerType){case"VIEWEVENT":this.hasViewEventTrigger=!0;break;case"CTRLEVENT":this.hasControlEventTrigger=!0}return ibiz.scheduler.triggerFactory.createTrigger(t,this)}createExecutor(t){return ibiz.scheduler.executorFactory.createExecutor(t,this)}getMatchTriggers(t){const e=[];return this.triggers.forEach((a=>{a.match(t)&&e.push(a)})),e}triggerAndExecute(t,e={}){const a=this.getMatchTriggers(t);if(a.length>0){const t=this.getExecuteParams(e);return a.map((e=>e.execute(t)))}}triggerItemDynaLogic(t,e,a){const s={itemName:t,triggerType:e},i=this.triggerAndExecute(s,a);if(null==i?void 0:i.length)return i.pop()}triggerItemVisible(t,e){return this.triggerItemDynaLogic(t,"ITEMVISIBLE",e)}triggerItemEnable(t,e){return this.triggerItemDynaLogic(t,"ITEMENABLE",e)}triggerItemBlank(t,e){return this.triggerItemDynaLogic(t,"ITEMBLANK",e)}startTimerTrigger(){this.getMatchTriggers({triggerType:"TIMER"}).forEach((t=>t.start()))}triggerCustom(t,e){const a=this.triggers.get(t);if(!a)return-1;const s=this.getExecuteParams(e);return a.execute(s)}triggerControlEvent(t,e,a){const s={ctrlName:t,eventName:e,triggerType:"CTRLEVENT"};this.triggerAndExecute(s,a)}},Eo=class extends wo{constructor(t){const e=t.filter((t=>"APPVIEWENGINE"!==t.triggerType));e.forEach((t=>{"CTRLEVENT"===t.triggerType&&(t.ctrlName=t.itemName)})),super(e)}},vo=class extends wo{constructor(t){t.forEach((t=>{t.triggerType=t.logicTrigger})),super(t)}triggerViewEvent(t){const e={eventName:t.eventName,triggerType:"VIEWEVENT"};this.triggerAndExecute(e,t)}},yo=class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createTrigger(t,e){const a=this.constructorMap.get(t.triggerType);if(!a)throw new s(t,"触发器类型 ".concat(t.triggerType," 暂未支持!"));return a(t,e)}},Io=class{constructor(){this.executorFactory=new mo,this.triggerFactory=new yo}createViewScheduler(t){return new vo(t)}createControlScheduler(t){return new Eo(t)}},Do=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.triggerType}bindExecutor(t){this.executor=t,"SCRIPT"===this.executor.type&&this.bindScriptExecutor(t)}bindScriptExecutor(t){t.initialized||t.init([],(t=>t),{isAsync:!0,singleRowReturn:!1})}match(t){return t.triggerType===this.type}execute(t){if(this.executor)return this.executor.execute(t);throw new e("".concat(this.logic.id,"没有绑定executor"))}destroy(){this.executor=void 0}},Co=class extends Do{},Ao=class extends Do{bindExecutor(t){if(super.bindExecutor(t),"SCRIPT"!==this.executor.type)throw new e("预定义逻辑类型".concat(this.type,"的触发器类型只能是脚本"))}bindScriptExecutor(t){t.init(["context","viewparams","data","env"],(t=>{const{context:e,params:a,data:s}=t;return{context:e,params:a,data:(null==s?void 0:s[0])||{},env:ibiz.env}}),{singleRowReturn:!0,isAsync:!1})}match(t){var e,a;return super.match(t)&&(null==(e=t.itemName)?void 0:e.toLowerCase())===(null==(a=this.logic.itemName)?void 0:a.toLowerCase())}execute(t){return!!this.executor.execute(t)}},bo=class extends Do{constructor(){super(...arguments),this.timer=null}start(){this.timer=setInterval((()=>{if(!this.scheduler.defaultParamsCb)throw new e("定时器缺少默认参数回调");const t=this.scheduler.defaultParamsCb();this.executor.execute(t)}),this.logic.timer)}destroy(){super.destroy(),this.timer&&clearInterval(this.timer)}},Po=class extends po{execute(t){return"opendata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeOpenDataAppUILogic(this.logic.builtinAppUILogic,t):"newdata"===this.logic.id&&this.logic.builtinAppUILogic?this.executeNewDataAppUILogic(this.logic.builtinAppUILogic,t):void 0}async executeOpenDataAppUILogic(t,s){const{context:i,params:n,...r}=s,{data:o}=s;if(!(null==o?void 0:o[0]))throw new e("opendata没有可操作数据!");let c;if(t.openDataAppViews)c=await this.calcOpenViewRef(t,s);else if(c=t.openDataAppView,!c)throw new a(t,"opendata视图逻辑没有配置默认打开视图");const l=c.refAppViewId;if(!l)throw new a(t,"opendata视图逻辑的默认打开视图没有实际引用视图");const h=c.navigateContexts||[],d=Object.assign(i,Re(h,o[0],n,i));let u={};const p=c.navigateParams;return F(p)&&(u=Re(p,o[0],n,i)),ibiz.commands.execute(Mi.TAG,l,d,u,r)}async calcOpenViewRef(t,s){const i=s.view.model.appDataEntityId,n=await Ye(i);if(!n)throw new a(t,"".concat(i,"实体缺少表单类型应用实体属性"));const{data:r}=s,o=r[0][n];if(!o)throw new a(t,"数据源无表单类型应用实体属性值");const c=t.openDataAppViews,l=null==c?void 0:c.find((t=>t.refMode===o));if(!l)throw new e("没有找到与表单类型".concat(o,"相关的实体的编辑视图"));return l}async executeNewDataAppUILogic(t,e){const{context:i,params:n,...r}=e,{data:o,view:c}=e,{enableWizardAdd:l,enableBatchAdd:h,batchAddOnly:d,newDataAppView:u}=t;let p;if(l){if(p=await this.getWizardNewViewRef(t,e),!p)return{ok:!1}}else if(h){const e=Ke(c.parentView.model.appDataEntityId),s=t.batchAddAppViews;if(p=null==s?void 0:s.find((t=>t.refMode.toLowerCase()!==e)),!p)throw new a(t,"没有找到批添加需要打开的选择视图")}else{if(d)throw new s(t,"batchAddOnly暂未支持");if(p=u,!p||!p.refAppViewId)throw new a(t,"newdata视图逻辑没有配置默认新建数据视图")}let m={},f={};const g=(null==o?void 0:o[0])||{},w=p.navigateContexts;F(w)&&(m=Re(w,g,n,i)),m=Object.assign(i,m);const E=p.navigateParams;if(F(E)&&(f=Re(E,g,n,i)),n.srfcopymode){const t=(await ibiz.hub.getAppDataEntity(c.model.appDataEntityId)).keyAppDEFieldId;t&&g&&(f[t]=g.srfkey,f.srfcopymode=!0)}f.srfuf=0;const v=await ibiz.commands.execute(Mi.TAG,p.refAppViewId,m,f,r);return h&&v.data&&await this.doBatchAdd(t,v.data,i,p),v}async getWizardNewViewRef(t,s){var i;const{wizardAppView:n,newDataAppViews:r}=t,{context:o,params:c,...l}=s;if(!n||!n.refAppViewId)throw new a(t,"缺少默认索引实体选择视图");const h=await ibiz.commands.execute(Mi.TAG,n.refAppViewId,o,c,{...l,openMode:"POPUPMODAL"});if(!h.ok)return;const d=null==(i=h.data)?void 0:i[0];if(!d)throw new e("请选中一条数据");const u=d.srfkey,p=null==r?void 0:r.find((t=>t.refMode===u));if(!p)throw new e("没有找到与索引类型".concat(u,"相关的实体的编辑视图"));return p}async doBatchAdd(t,e,s,i){var n;if(null==e?void 0:e.length){const r=await ibiz.hub.getAppDataEntity(t.appDataEntityId,s.srfappid),o=r.minorAppDERSs,c=i.refMode.toLowerCase();if(!o)throw new a(r,"实体没有从关系集合!");let l;null==o||o.forEach((t=>{const e=Ke(t.majorAppDataEntityId);c===e&&(l=t.parentAppDEFieldId)}));const h=null==(n=i.navigateParams)?void 0:n.find((t=>"keymapping"===t.key));let d=[];if(h){const t=h.value.split(";"),a={};for(const e of t){const[t,s]=e.split(":");t&&s&&(a[t]=s)}d=e.map((t=>{const e={[l]:t.srfkey};for(const s in a)if(Object.prototype.hasOwnProperty.call(a,s)){const i=a[s];Object.prototype.hasOwnProperty.call(t,s)&&(e[i]=t[s])}return e}))}else d=e.map((t=>({[l]:t.srfkey})));const u=ibiz.hub.getApp(s.srfappid).deService;await u.exec(r.id,"Create",s,d)}}},So=class extends Do{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const a=t.eventNames.split(";");this.listenEventNames=a.map((t=>_a[t]||t))}match(t){return super.match(t)&&this.listenEventNames.includes(t.eventName)}},xo=class extends Do{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const a=t.eventNames.split(";");this.listenEventNames=a.map((t=>La[t]||t))}match(t){return super.match(t)&&t.ctrlName.toLowerCase()===this.logic.ctrlName.toLowerCase()&&this.listenEventNames.includes(t.eventName)}},_o=class extends po{execute(t){ir.execAndResolved(this.logic.appDEUIActionId,t)}};var To=yt(le(),1);t("PluginStaticResource",class{constructor(t){this.styleElementMap=new Map,this.url=new URL(t);const e=To.default.dirname(this.url.pathname);this.baseDir=e}dir(t){return To.default.resolve(this.baseDir,t)}async loadStyle(t){const e=t.map((t=>{const e=this.dir(t);return!this.styleElementMap.has(e)&&(this.styleElementMap.set(e,null),new Promise(((t,a)=>{const s=document.createElement("link");s.setAttribute("type","text/css"),s.setAttribute("rel","stylesheet"),s.setAttribute("href",e),s.onload=t,s.onerror=a,document.head.appendChild(s)})))}));try{await Promise.all(e)}catch(t){ibiz.log.error(t)}}}),t("RemotePluginItem",class{constructor(t,e,a){this.tag=t,this.repo=e,this.config=a}})}}}));
|
|
2
2
|
//# sourceMappingURL=index.system.min.js.map
|