@ibiz-template/runtime 0.1.37 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/dist/index.esm.js +12431 -360
  2. package/dist/index.system.min.js +1 -1
  3. package/dist/index.system.min.js.map +1 -1
  4. package/out/application.d.ts +9 -1
  5. package/out/application.d.ts.map +1 -1
  6. package/out/application.js +9 -2
  7. package/out/controller/control/exp-bar/chart-exp-bar.controller.d.ts +24 -0
  8. package/out/controller/control/exp-bar/chart-exp-bar.controller.d.ts.map +1 -0
  9. package/out/controller/control/exp-bar/chart-exp-bar.controller.js +32 -0
  10. package/out/controller/control/exp-bar/index.d.ts +1 -0
  11. package/out/controller/control/exp-bar/index.d.ts.map +1 -1
  12. package/out/controller/control/exp-bar/index.js +1 -0
  13. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts +1 -0
  14. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts.map +1 -1
  15. package/out/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.js +8 -0
  16. package/out/controller/control/medit-view-panel/medit-view-panel.controller.d.ts +1 -13
  17. package/out/controller/control/medit-view-panel/medit-view-panel.controller.d.ts.map +1 -1
  18. package/out/controller/control/medit-view-panel/medit-view-panel.controller.js +7 -67
  19. package/out/controller/control/search-bar/search-bar.controller.d.ts.map +1 -1
  20. package/out/controller/control/search-bar/search-bar.controller.js +3 -3
  21. package/out/de-logic/de-logic-context.d.ts +4 -4
  22. package/out/de-logic/de-logic-context.d.ts.map +1 -1
  23. package/out/de-logic/de-logic-context.js +2 -1
  24. package/out/de-logic/de-logic-link/de-logic-link.js +1 -1
  25. package/out/de-logic/de-logic-param/de-logic-param.d.ts.map +1 -1
  26. package/out/de-logic/de-logic-param/de-logic-param.js +7 -1
  27. package/out/de-logic/de-logic.d.ts +1 -1
  28. package/out/de-logic/de-logic.d.ts.map +1 -1
  29. package/out/de-logic/index.d.ts +5 -5
  30. package/out/de-logic/index.d.ts.map +1 -1
  31. package/out/de-logic/index.js +32 -5
  32. package/out/engine/md-view.engine.d.ts +3 -3
  33. package/out/engine/md-view.engine.d.ts.map +1 -1
  34. package/out/engine/md-view.engine.js +14 -12
  35. package/out/hub/config/app-view-config-service.d.ts +3 -1
  36. package/out/hub/config/app-view-config-service.d.ts.map +1 -1
  37. package/out/hub/config/app-view-config-service.js +9 -0
  38. package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts +20 -2
  39. package/out/interface/common/i-app-view-config-service/i-app-view-config-service.d.ts.map +1 -1
  40. package/out/interface/controller/controller/control/i-chart-exp-bar.controller.d.ts +15 -0
  41. package/out/interface/controller/controller/control/i-chart-exp-bar.controller.d.ts.map +1 -0
  42. package/out/interface/controller/controller/control/i-chart-exp-bar.controller.js +1 -0
  43. package/out/interface/controller/controller/control/index.d.ts +1 -0
  44. package/out/interface/controller/controller/control/index.d.ts.map +1 -1
  45. package/out/interface/controller/controller/control/index.js +1 -0
  46. package/out/interface/controller/event/control/i-chart-exp-bar.event.d.ts +11 -0
  47. package/out/interface/controller/event/control/i-chart-exp-bar.event.d.ts.map +1 -0
  48. package/out/interface/controller/event/control/i-chart-exp-bar.event.js +1 -0
  49. package/out/interface/controller/event/control/index.d.ts +1 -0
  50. package/out/interface/controller/event/control/index.d.ts.map +1 -1
  51. package/out/interface/controller/event/control/index.js +1 -0
  52. package/out/interface/controller/event/view/i-chart-exp-view.event.d.ts +11 -0
  53. package/out/interface/controller/event/view/i-chart-exp-view.event.d.ts.map +1 -0
  54. package/out/interface/controller/event/view/i-chart-exp-view.event.js +1 -0
  55. package/out/interface/controller/event/view/index.d.ts +1 -0
  56. package/out/interface/controller/event/view/index.d.ts.map +1 -1
  57. package/out/interface/controller/event/view/index.js +1 -0
  58. package/out/interface/controller/state/control/i-chart-exp-bar.state.d.ts +11 -0
  59. package/out/interface/controller/state/control/i-chart-exp-bar.state.d.ts.map +1 -0
  60. package/out/interface/controller/state/control/i-chart-exp-bar.state.js +1 -0
  61. package/out/interface/controller/state/control/index.d.ts +1 -0
  62. package/out/interface/controller/state/control/index.d.ts.map +1 -1
  63. package/out/interface/controller/state/control/index.js +1 -0
  64. package/out/interface/controller/state/view/i-chart-exp-view.state.d.ts +11 -0
  65. package/out/interface/controller/state/view/i-chart-exp-view.state.d.ts.map +1 -0
  66. package/out/interface/controller/state/view/i-chart-exp-view.state.js +1 -0
  67. package/out/interface/controller/state/view/index.d.ts +1 -0
  68. package/out/interface/controller/state/view/index.d.ts.map +1 -1
  69. package/out/interface/controller/state/view/index.js +1 -0
  70. package/out/interface/service/code-list-item/code-list-item.d.ts +16 -0
  71. package/out/interface/service/code-list-item/code-list-item.d.ts.map +1 -1
  72. package/out/service/index.d.ts +1 -0
  73. package/out/service/index.d.ts.map +1 -1
  74. package/out/service/index.js +1 -0
  75. package/out/service/mqtt/mqtt.service.d.ts +66 -0
  76. package/out/service/mqtt/mqtt.service.d.ts.map +1 -0
  77. package/out/service/mqtt/mqtt.service.js +95 -0
  78. package/out/service/service/code-list/code-list.service.d.ts.map +1 -1
  79. package/out/service/service/code-list/code-list.service.js +12 -1
  80. package/out/service/service/entity/de.service.d.ts +2 -2
  81. package/out/service/service/entity/de.service.d.ts.map +1 -1
  82. package/out/service/service/entity/method/de-action.d.ts +14 -5
  83. package/out/service/service/entity/method/de-action.d.ts.map +1 -1
  84. package/out/service/service/entity/method/de-action.js +56 -15
  85. package/out/service/service/entity/method/fetch.d.ts +1 -1
  86. package/out/service/service/entity/method/fetch.d.ts.map +1 -1
  87. package/out/service/service/entity/method/fetch.js +9 -6
  88. package/out/service/service/entity/method/method.d.ts +13 -13
  89. package/out/service/service/entity/method/method.d.ts.map +1 -1
  90. package/out/service/service/entity/method/method.js +16 -11
  91. package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts +7 -1
  92. package/out/service/utils/dynamic-code-list/dynamic-code-list.d.ts.map +1 -1
  93. package/out/service/utils/dynamic-code-list/dynamic-code-list.js +89 -13
  94. package/out/ui-action/uiaction-util.js +3 -3
  95. package/out/ui-logic/ui-logic-param/ui-logic-param.d.ts.map +1 -1
  96. package/out/ui-logic/ui-logic-param/ui-logic-param.js +7 -1
  97. package/out/utils/script/script-factory.d.ts +10 -0
  98. package/out/utils/script/script-factory.d.ts.map +1 -1
  99. package/out/utils/script/script-factory.js +15 -0
  100. package/package.json +5 -3
  101. package/src/application.ts +22 -1
  102. package/src/controller/control/exp-bar/chart-exp-bar.controller.ts +51 -0
  103. package/src/controller/control/exp-bar/index.ts +1 -0
  104. package/src/controller/control/grid/grid-column/grid-field-column/grid-field-column.controller.ts +14 -0
  105. package/src/controller/control/medit-view-panel/medit-view-panel.controller.ts +8 -78
  106. package/src/controller/control/search-bar/search-bar.controller.ts +6 -5
  107. package/src/de-logic/de-logic-context.ts +6 -5
  108. package/src/de-logic/de-logic-link/de-logic-link.ts +1 -1
  109. package/src/de-logic/de-logic-param/de-logic-param.ts +6 -1
  110. package/src/de-logic/de-logic.ts +5 -1
  111. package/src/de-logic/index.ts +49 -8
  112. package/src/engine/md-view.engine.ts +16 -13
  113. package/src/hub/config/app-view-config-service.ts +12 -1
  114. package/src/interface/common/i-app-view-config-service/i-app-view-config-service.ts +22 -4
  115. package/src/interface/controller/controller/control/i-chart-exp-bar.controller.ts +19 -0
  116. package/src/interface/controller/controller/control/index.ts +1 -0
  117. package/src/interface/controller/event/control/i-chart-exp-bar.event.ts +10 -0
  118. package/src/interface/controller/event/control/index.ts +1 -0
  119. package/src/interface/controller/event/view/i-chart-exp-view.event.ts +11 -0
  120. package/src/interface/controller/event/view/index.ts +1 -0
  121. package/src/interface/controller/state/control/i-chart-exp-bar.state.ts +10 -0
  122. package/src/interface/controller/state/control/index.ts +1 -0
  123. package/src/interface/controller/state/view/i-chart-exp-view.state.ts +10 -0
  124. package/src/interface/controller/state/view/index.ts +1 -0
  125. package/src/interface/service/code-list-item/code-list-item.ts +20 -0
  126. package/src/service/index.ts +1 -0
  127. package/src/service/mqtt/mqtt.service.ts +117 -0
  128. package/src/service/service/code-list/code-list.service.ts +15 -1
  129. package/src/service/service/entity/de.service.ts +2 -2
  130. package/src/service/service/entity/method/de-action.ts +74 -33
  131. package/src/service/service/entity/method/fetch.ts +12 -11
  132. package/src/service/service/entity/method/method.ts +28 -19
  133. package/src/service/utils/dynamic-code-list/dynamic-code-list.ts +121 -16
  134. package/src/ui-action/uiaction-util.ts +3 -3
  135. package/src/ui-logic/ui-logic-param/ui-logic-param.ts +6 -1
  136. package/src/utils/script/script-factory.ts +16 -0
@@ -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,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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},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}})}}}));
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,i,n,r,s,a,o,c,l,h,u,d,p,f,m,g,y,w,v,b,E,_,I,C,D,S,A,x,P,T,O,L,R,M,k,N,V,F,j,B,U,W,z,G,H,q,K,X,Y,$,Q,J,Z,tt,et,it,nt,rt,st,at,ot,ct,lt,ht,ut,dt,pt,ft;return{setters:[function(t){e=t.RuntimeError,i=t.RuntimeModelError,n=t.ModelError,r=t.IBizContext,s=t.DataTypes,a=t.HttpResponse,o=t.HttpError,c=t.CoreConst,l=t.Net,h=t.getToken,u=t.NOOP,d=t.NoticeError,p=t.isElementSame,f=t.findRecursiveChild,m=t.StringUtil,g=t.recursiveIterate,y=t.debounceAndAsyncMerge,w=t.mergeDefaultInLeft,v=t.isOverlap,b=t.awaitTimeout,E=t.mergeInLeft,_=t.toNumberOrNil},function(t){I=t.isEmpty,C=t.isString,D=t.isArray,S=t.isObject,A=t.debounce,x=t.isNil,P=t.camelCase,T=t.eq,O=t.gt,L=t.gte,R=t.findIndex,M=t.lt,k=t.lte,N=t.upperFirst,V=t.snakeCase,F=t.kebabCase,j=t.isFunction},function(t){B=t.notNilEmpty,U=t.isNilOrEmpty,W=t.AsyncSeriesHook,z=t.QXEvent,G=t.createUUID,H=t.isArray,q=t.setCookie,K=t.clearCookie,X=t.clearAll,Y=t.isNumber,$=t.ascSort,Q=t.descSort},function(t){J=t.default},function(t){Z=t.isNil,tt=t.mergeRight,et=t.isEmpty,it=t.clone,nt=t.equals,rt=t.where,st=t.mergeLeft,at=t.isNotNil,ot=t.mergeDeepRight},function(t){ct=t.default},function(t){lt=t.default},function(t){ht=t.default},function(t){ut=t.default},function(t){dt=t.default},function(t){pt=t.default},function(t){ft=t.default}],execute:function(){t({calcContentAlignStyle:function(t){const{valignSelf:e,halignSelf:i}=t;let n;if(e||i){switch(n={display:"flex"},e){case"TOP":Object.assign(n,{"align-items":"flex-start"});break;case"MIDDLE":Object.assign(n,{"align-items":"center"});break;case"BOTTOM":Object.assign(n,{"align-items":"flex-end"})}switch(i){case"LEFT":Object.assign(n,{"justify-content":"flex-start"});break;case"CENTER":Object.assign(n,{"justify-content":"center"});break;case"RIGHT":Object.assign(n,{"justify-content":"flex-end"});break;case"JUSTIFY":Object.assign(n,{"justify-content":"space-between"})}}return n},calcDeCodeNameById:$e,calcDynaClass:Ke,calcGridLayoutPos:function(t){const{layout:e,colXS:i,colXSOffset:n,colSM:r,colSMOffset:s,colMD:a,colMDOffset:o,colLG:c,colLGOffset:l}=t,h=(t,i)=>({span:(t&&-1!==t?t:"TABLE_24COL"===e?24:12)*("TABLE_24COL"===e?1:2),offset:i&&-1!==i?i:void 0});return{xs:h(i,n),sm:h(r,s),md:h(a,o),lg:h(c,l)}},calcLayoutHeightWidth:qe,calcMainStateOPPrivsStrs:Ye,calcNavParams:ze,calcResPath:kn,compare:fi,compareNumber:mi,contains:gi,convertNavData:je,convertNavDataByArray:Ue,convertObjectToNavParams:Fe,execDELogic:yr,execDELogicAction:vr,execDELogicById:wr,execFieldLogics:Er,execUILogic:la,filterFieldLogics:ti,filterValueRules:Vi,findChildFormDetails:oi,findDELogic:Ze,findEditItem:ai,findFieldById:ei,findModelChild:Ge,formatMultiData:We,generateEditorRules:us,generateRules:hs,getAppCounterProvider:Cn,getAppViewRef:function(t,e){var i,n;let r=t.appViewRefs||[];(null==(n=null==(i=t.viewLayoutPanel)?void 0:i.appViewRefs)?void 0:n.length)&&(r=r.concat(t.viewLayoutPanel.appViewRefs));return r.find((t=>t.name===e||t.id===e))},getChildNodeRSs:si,getControl:function(t,e){var i,n;let r=t.controls||[];(null==(n=null==(i=t.viewLayoutPanel)?void 0:i.controls)?void 0:n.length)&&(r=r.concat(t.viewLayoutPanel.controls));return r.find((t=>t.name===e||t.codeName===e||t.id===e))},getControlProvider:Ji,getControlsByView:ci,getDeACMode:async function(t,e,i){var n;const r=await ibiz.hub.getAppDataEntity(e,i);return null==(n=r.appDEACModes)?void 0:n.find((e=>e.id===t))},getDefaultValue:ps,getEditorProvider:en,getFormDetailProvider:sn,getFormTypeFieldName:Je,getGridColumnProvider:cn,getMatchResPath:Mn,getOriginData:ls,getPanelItemProvider:un,getPortletProvider:bn,getRootNode:ni,getTreeNode:ri,getUIActionById:ii,getUIActionProvider:mn,getViewEngines:hi,getViewLogics:li,getViewProvider:async function(t){let e;const{viewType:i,viewStyle:n,sysPFPluginId:r,appId:s}=t;if(r){const t=await Yi(r,s);if(t&&(e=yn(t)),e)return e;ibiz.log.error("找不到视图插件".concat(t,"对应的适配器"))}if(n&&"DEFAULT"!==n){if(e=yn("".concat(i,"_").concat(n)),e)return e;ibiz.log.error("找不到视图类型:[".concat(i,"]的视图样式:[").concat(n,"]对应的适配器"),t)}e||(e=yn(i));e||(e=yn("DEFAULT"));return e},getWFContext:Si,getWFSubmitViewId:function(t,e){var i;const{type:n,sequenceflowview:r,sequenceflowmobview:s}=e,a=(null==(i=t.viewLayoutPanel)?void 0:i.appViewRefs)||t.appViewRefs,o=n?"WFUTILACTION@".concat(n.toUpperCase()):"WFACTION@".concat(ibiz.env.isMob?s:r),c=null==a?void 0:a.find((t=>-1!==t.name.indexOf(o)));return null==c?void 0:c.refAppViewId},handleAllSettled:Bi,hasDeCodeName:Qe,install:function(){const{ibiz:t}=window;t.util=new wo,t.hub=new po,t.register=new me,t.config=new fe,t.auth=new Or,t.engine=new fo,Gr(),ga(),xn(),ibiz.scheduler=new Ao,ibiz.scheduler.triggerFactory.register("ITEMVISIBLE",((t,e)=>new To(t,e))),ibiz.scheduler.triggerFactory.register("ITEMENABLE",((t,e)=>new To(t,e))),ibiz.scheduler.triggerFactory.register("ITEMBLANK",((t,e)=>new To(t,e))),ibiz.scheduler.triggerFactory.register("TIMER",((t,e)=>new Oo(t,e))),ibiz.scheduler.triggerFactory.register("CUSTOM",((t,e)=>new Po(t,e))),ibiz.scheduler.triggerFactory.register("VIEWEVENT",((t,e)=>new Ro(t,e))),ibiz.scheduler.triggerFactory.register("CTRLEVENT",((t,e)=>new Mo(t,e))),ibiz.scheduler.executorFactory.register("SCRIPT",((t,e)=>new Eo(t,e))),ibiz.scheduler.executorFactory.register("APPDEUILOGIC",((t,e)=>new _o(t,e))),ibiz.scheduler.executorFactory.register("DEUILOGIC",((t,e)=>new _o(t,e))),ibiz.scheduler.executorFactory.register("APPUILOGIC",((t,e)=>new Lo(t,e))),ibiz.scheduler.executorFactory.register("APPDEUIACTION",((t,e)=>new ko(t,e)))},installCommand:Gr,isDataContainer:function(t){return"CONTAINER"===t.itemType&&["CONTAINER_MULTIDATA","CONTAINER_SINGLEDATA"].includes(t.predefinedType)},isValueChange:cs,matchMainState:Xe,openRedirectView:ui,parseUserParams:He,presetAppCounterProvider:xn,presetUIActionProvider:ga,registerAppCounterProvider:_n,registerControlProvider:function(t,e){ibiz.register.register("".concat($i,"_").concat(t),e)},registerEditorProvider:function(t,e){ibiz.register.register("".concat(Zi,"_").concat(t),e)},registerFormDetailProvider:function(t,e){ibiz.register.register("".concat(nn,"_").concat(t),e)},registerGridColumnProvider:function(t,e){ibiz.register.register("".concat(an,"_").concat(t),e)},registerPanelItemProvider:function(t,e){ibiz.register.register("".concat(ln,"_").concat(t.toUpperCase()),e)},registerPortletProvider:function(t,e){ibiz.register.register("".concat(wn,"_").concat(t),e)},registerUIActionProvider:pn,registerViewProvider:function(t,e){ibiz.register.register("".concat(gn,"_").concat(t),e)},strContain:yi,testCond:pi,toLocalOpenWFRedirectView:di,verifyDeRules:Ei,verifyFormGroupLogic:Ii,verifyPanelGroupLogic:Ci});var mt=Object.create,gt=Object.defineProperty,yt=Object.getOwnPropertyDescriptor,wt=Object.getOwnPropertyNames,vt=Object.getPrototypeOf,bt=Object.prototype.hasOwnProperty,Et=(t=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(t,{get:(t,e)=>("undefined"!=typeof require?require:t)[e]}):t)((function(t){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')})),_t=(t,e)=>function(){return e||(0,t[wt(t)[0]])((e={exports:{}}).exports,e),e.exports},It=(t,e,i)=>(i=null!=t?mt(vt(t)):{},((t,e,i,n)=>{if(e&&"object"==typeof e||"function"==typeof e)for(let r of wt(e))bt.call(t,r)||r===i||gt(t,r,{get:()=>e[r],enumerable:!(n=yt(e,r))||n.enumerable});return t})(!e&&t&&t.__esModule?i:gt(i,"default",{value:t,enumerable:!0}),t)),Ct=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/utils.js"(t){t.__esModule=!0,t.extend=s,t.indexOf=function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;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(!n.test(t))return t;return t.replace(i,r)},t.isEmpty=function(t){return!t&&0!==t||!(!c(t)||0!==t.length)},t.createFrame=function(t){var e=s({},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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},i=/[&<>"'`=]/g,n=/[&<>"'`=]/;function r(t){return e[t]}function s(t){for(var e=1;e<arguments.length;e++)for(var i in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],i)&&(t[i]=arguments[e][i]);return t}var a=Object.prototype.toString;t.toString=a;var o=function(t){return"function"==typeof t};o(/x/)&&(t.isFunction=o=function(t){return"function"==typeof t&&"[object Function]"===a.call(t)}),t.isFunction=o;var c=Array.isArray||function(t){return!(!t||"object"!=typeof t)&&"[object Array]"===a.call(t)};t.isArray=c}}),Dt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/exception.js"(t,e){t.__esModule=!0;var i=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function n(t,e){var r=e&&e.loc,s=void 0,a=void 0,o=void 0,c=void 0;r&&(s=r.start.line,a=r.end.line,o=r.start.column,c=r.end.column,t+=" - "+s+":"+o);for(var l=Error.prototype.constructor.call(this,t),h=0;h<i.length;h++)this[i[h]]=l[i[h]];Error.captureStackTrace&&Error.captureStackTrace(this,n);try{r&&(this.lineNumber=s,this.endLineNumber=a,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){}}n.prototype=new Error,t.default=n,e.exports=t.default}}),St=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js"(t,e){t.__esModule=!0;var i=Ct();t.default=function(t){t.registerHelper("blockHelperMissing",(function(e,n){var r=n.inverse,s=n.fn;if(!0===e)return s(this);if(!1===e||null==e)return r(this);if(i.isArray(e))return e.length>0?(n.ids&&(n.ids=[n.name]),t.helpers.each(e,n)):r(this);if(n.data&&n.ids){var a=i.createFrame(n.data);a.contextPath=i.appendContextPath(n.data.contextPath,n.name),n={data:a}}return s(e,n)}))},e.exports=t.default}}),At=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js"(t,e){t.__esModule=!0;var i,n=Ct(),r=Dt(),s=(i=r)&&i.__esModule?i:{default:i};t.default=function(t){t.registerHelper("each",(function(t,e){if(!e)throw new s.default("Must pass iterator to #each");var i,r=e.fn,a=e.inverse,o=0,c="",l=void 0,h=void 0;function u(e,i,s){l&&(l.key=e,l.index=i,l.first=0===i,l.last=!!s,h&&(l.contextPath=h+e)),c+=r(t[e],{data:l,blockParams:n.blockParams([t[e],e],[h+e,null])})}if(e.data&&e.ids&&(h=n.appendContextPath(e.data.contextPath,e.ids[0])+"."),n.isFunction(t)&&(t=t.call(this)),e.data&&(l=n.createFrame(e.data)),t&&"object"==typeof t)if(n.isArray(t))for(var d=t.length;o<d;o++)o in t&&u(o,o,o===t.length-1);else if("function"==typeof Symbol&&t[Symbol.iterator]){for(var p=[],f=t[Symbol.iterator](),m=f.next();!m.done;m=f.next())p.push(m.value);for(d=(t=p).length;o<d;o++)u(o,o,o===t.length-1)}else i=void 0,Object.keys(t).forEach((function(t){void 0!==i&&u(i,o-1),i=t,o++})),void 0!==i&&u(i,o-1,!0);return 0===o&&(c=a(this)),c}))},e.exports=t.default}}),xt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js"(t,e){t.__esModule=!0;var i,n=Dt(),r=(i=n)&&i.__esModule?i:{default:i};t.default=function(t){t.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new r.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default}}),Pt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js"(t,e){t.__esModule=!0;var i,n=Ct(),r=Dt(),s=(i=r)&&i.__esModule?i:{default:i};t.default=function(t){t.registerHelper("if",(function(t,e){if(2!=arguments.length)throw new s.default("#if requires exactly one argument");return n.isFunction(t)&&(t=t.call(this)),!e.hash.includeZero&&!t||n.isEmpty(t)?e.inverse(this):e.fn(this)})),t.registerHelper("unless",(function(e,i){if(2!=arguments.length)throw new s.default("#unless requires exactly one argument");return t.helpers.if.call(this,e,{fn:i.inverse,inverse:i.fn,hash:i.hash})}))},e.exports=t.default}}),Tt=_t({"../../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],i=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)e.push(arguments[n]);var r=1;null!=i.hash.level?r=i.hash.level:i.data&&null!=i.data.level&&(r=i.data.level),e[0]=r,t.log.apply(t,e)}))},e.exports=t.default}}),Ot=_t({"../../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,i){return t?i.lookupProperty(t,e):t}))},e.exports=t.default}}),Lt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js"(t,e){t.__esModule=!0;var i,n=Ct(),r=Dt(),s=(i=r)&&i.__esModule?i:{default:i};t.default=function(t){t.registerHelper("with",(function(t,e){if(2!=arguments.length)throw new s.default("#with requires exactly one argument");n.isFunction(t)&&(t=t.call(this));var i=e.fn;if(n.isEmpty(t))return e.inverse(this);var r=e.data;return e.data&&e.ids&&((r=n.createFrame(e.data)).contextPath=n.appendContextPath(e.data.contextPath,e.ids[0])),i(t,{data:r,blockParams:n.blockParams([t],[r&&r.contextPath])})}))},e.exports=t.default}}),Rt=_t({"../../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){i.default(t),n.default(t),r.default(t),s.default(t),a.default(t),o.default(t),c.default(t)},t.moveHelperToHooks=function(t,e,i){t.helpers[e]&&(t.hooks[e]=t.helpers[e],i||delete t.helpers[e])};var i=e(St()),n=e(At()),r=e(xt()),s=e(Pt()),a=e(Tt()),o=e(Ot()),c=e(Lt())}}),Mt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js"(t,e){t.__esModule=!0;var i=Ct();t.default=function(t){t.registerDecorator("inline",(function(t,e,n,r){var s=t;return e.partials||(e.partials={},s=function(r,s){var a=n.partials;n.partials=i.extend({},a,e.partials);var o=t(r,s);return n.partials=a,o}),e.partials[r.args[0]]=r.fn,s}))},e.exports=t.default}}),kt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/decorators.js"(t){t.__esModule=!0,t.registerDefaultDecorators=function(t){n.default(t)};var e,i=Mt(),n=(e=i)&&e.__esModule?e:{default:e}}}),Nt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/logger.js"(t,e){t.__esModule=!0;var i=Ct(),n={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(t){if("string"==typeof t){var e=i.indexOf(n.methodMap,t.toLowerCase());t=e>=0?e:parseInt(t,10)}return t},log:function(t){if(t=n.lookupLevel(t),"undefined"!=typeof console&&n.lookupLevel(n.level)<=t){var e=n.methodMap[t];console[e]||(e="log");for(var i=arguments.length,r=Array(i>1?i-1:0),s=1;s<i;s++)r[s-1]=arguments[s];console[e].apply(console,r)}}};t.default=n,e.exports=t.default}}),Vt=_t({"../../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,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return e.extend.apply(void 0,[Object.create(null)].concat(i))};var e=Ct()}}),Ft=_t({"../../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 n=Object.create(null);return n.__proto__=!1,{properties:{whitelist:i.createNewLookupObject(n,t.allowedProtoProperties),defaultValue:t.allowProtoPropertiesByDefault},methods:{whitelist:i.createNewLookupObject(e,t.allowedProtoMethods),defaultValue:t.allowProtoMethodsByDefault}}},t.resultIsAllowed=function(t,e,i){return a("function"==typeof t?e.methods:e.properties,i)},t.resetLoggedProperties=function(){Object.keys(s).forEach((function(t){delete s[t]}))};var e,i=Vt(),n=Nt(),r=(e=n)&&e.__esModule?e:{default:e},s=Object.create(null);function a(t,e){return void 0!==t.whitelist[e]?!0===t.whitelist[e]:void 0!==t.defaultValue?t.defaultValue:(function(t){!0!==s[t]&&(s[t]=!0,r.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)}}}),jt=_t({"../../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 i=Ct(),n=e(Dt()),r=Rt(),s=kt(),a=e(Nt()),o=Ft();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,i){this.helpers=t||{},this.partials=e||{},this.decorators=i||{},r.registerDefaultHelpers(this),s.registerDefaultDecorators(this)}l.prototype={constructor:l,logger:a.default,log:a.default.log,registerHelper:function(t,e){if(i.toString.call(t)===c){if(e)throw new n.default("Arg not supported with multiple helpers");i.extend(this.helpers,t)}else this.helpers[t]=e},unregisterHelper:function(t){delete this.helpers[t]},registerPartial:function(t,e){if(i.toString.call(t)===c)i.extend(this.partials,t);else{if(void 0===e)throw new n.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(i.toString.call(t)===c){if(e)throw new n.default("Arg not supported with multiple decorators");i.extend(this.decorators,t)}else this.decorators[t]=e},unregisterDecorator:function(t){delete this.decorators[t]},resetLoggedPropertyAccesses:function(){o.resetLoggedProperties()}};var h=a.default.log;t.log=h,t.createFrame=i.createFrame,t.logger=a.default}}),Bt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(t,e){function i(t){this.string=t}t.__esModule=!0,i.prototype.toString=i.prototype.toHTML=function(){return""+this.string},t.default=i,e.exports=t.default}}),Ut=_t({"../../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=_t({"../../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,i=s.COMPILER_REVISION;if(e>=s.LAST_COMPATIBLE_COMPILER_REVISION&&e<=s.COMPILER_REVISION)return;if(e<s.LAST_COMPATIBLE_COMPILER_REVISION){var n=s.REVISION_CHANGES[i],a=s.REVISION_CHANGES[e];throw new r.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+a+").")}throw new r.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 r.default("No environment passed to template");if(!t||!t.main)throw new r.default("Unknown template object: "+typeof t);t.main.decorator=t.main_d,e.VM.checkRevision(t.compiler);var n=t.compiler&&7===t.compiler[0];var h={strict:function(t,e,i){if(!t||!(e in t))throw new r.default('"'+e+'" not defined in '+t,{loc:i});return h.lookupProperty(t,e)},lookupProperty:function(t,e){var i=t[e];return null==i||Object.prototype.hasOwnProperty.call(t,e)||c.resultIsAllowed(i,h.protoAccessControl,e)?i:void 0},lookup:function(t,e){for(var i=t.length,n=0;n<i;n++){if(null!=(t[n]&&h.lookupProperty(t[n],e)))return t[n][e]}},lambda:function(t,e){return"function"==typeof t?t.call(e):t},escapeExpression:i.escapeExpression,invokePartial:function(n,s,a){a.hash&&(s=i.extend({},s,a.hash),a.ids&&(a.ids[0]=!0)),n=e.VM.resolvePartial.call(this,n,s,a);var o=i.extend({},a,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),c=e.VM.invokePartial.call(this,n,s,o);if(null==c&&e.compile&&(a.partials[a.name]=e.compile(n,t.compilerOptions,e),c=a.partials[a.name](s,o)),null!=c){if(a.indent){for(var l=c.split("\n"),h=0,u=l.length;h<u&&(l[h]||h+1!==u);h++)l[h]=a.indent+l[h];c=l.join("\n")}return c}throw new r.default("The partial "+a.name+" could not be compiled when running in runtime-only mode")},fn:function(e){var i=t[e];return i.decorator=t[e+"_d"],i},programs:[],program:function(t,e,i,n,r){var s=this.programs[t],a=this.fn(t);return e||r||n||i?s=l(this,t,a,e,i,n,r):s||(s=this.programs[t]=l(this,t,a)),s},data:function(t,e){for(;t&&e--;)t=t._parent;return t},mergeIfNeeded:function(t,e){var n=t||e;return t&&e&&t!==e&&(n=i.extend({},e,t)),n},nullContext:Object.seal({}),noop:e.VM.noop,compilerInfo:t.compiler};function d(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=i.data;d._setup(i),!i.partial&&t.useData&&(n=function(t,e){e&&"root"in e||((e=e?s.createFrame(e):{}).root=t);return e}(e,n));var r=void 0,a=t.useBlockParams?[]:void 0;function o(e){return""+t.main(h,e,h.helpers,h.partials,n,a,r)}return t.useDepths&&(r=i.depths?e!=i.depths[0]?[e].concat(i.depths):i.depths:[e]),(o=u(t.main,o,h,i.depths||[],n,a))(e,i)}return d.isTop=!0,d._setup=function(r){if(r.partial)h.protoAccessControl=r.protoAccessControl,h.helpers=r.helpers,h.partials=r.partials,h.decorators=r.decorators,h.hooks=r.hooks;else{var s=i.extend({},e.helpers,r.helpers);!function(t,e){Object.keys(t).forEach((function(n){var r=t[n];t[n]=function(t,e){var n=e.lookupProperty;return o.wrapHelper(t,(function(t){return i.extend({lookupProperty:n},t)}))}(r,e)}))}(s,h),h.helpers=s,t.usePartial&&(h.partials=h.mergeIfNeeded(r.partials,e.partials)),(t.usePartial||t.useDecorators)&&(h.decorators=i.extend({},e.decorators,r.decorators)),h.hooks={},h.protoAccessControl=c.createProtoAccessControl(r);var l=r.allowCallsToHelperMissing||n;a.moveHelperToHooks(h,"helperMissing",l),a.moveHelperToHooks(h,"blockHelperMissing",l)}},d._child=function(e,i,n,s){if(t.useBlockParams&&!n)throw new r.default("must pass block params");if(t.useDepths&&!s)throw new r.default("must pass parent depths");return l(h,e,t[e],i,0,n,s)},d},t.wrapProgram=l,t.resolvePartial=function(t,e,i){t?t.call||i.name||(i.name=t,t=i.partials[t]):t="@partial-block"===i.name?i.data["partial-block"]:i.partials[i.name];return t},t.invokePartial=function(t,e,n){var a=n.data&&n.data["partial-block"];n.partial=!0,n.ids&&(n.data.contextPath=n.ids[0]||n.data.contextPath);var o=void 0;n.fn&&n.fn!==h&&function(){n.data=s.createFrame(n.data);var t=n.fn;o=n.data["partial-block"]=function(e){var i=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return i.data=s.createFrame(i.data),i.data["partial-block"]=a,t(e,i)},t.partials&&(n.partials=i.extend({},n.partials,t.partials))}();void 0===t&&o&&(t=o);if(void 0===t)throw new r.default("The partial "+n.name+" could not be found");if(t instanceof Function)return t(e,n)},t.noop=h;var e,i=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(Ct()),n=Dt(),r=(e=n)&&e.__esModule?e:{default:e},s=jt(),a=Rt(),o=Ut(),c=Ft();function l(t,e,i,n,r,s,a){function o(e){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=a;return!a||e==a[0]||e===t.nullContext&&null===a[0]||(o=[e].concat(a)),i(t,e,t.helpers,t.partials,r.data||n,s&&[r.blockParams].concat(s),o)}return(o=u(i,o,t,a,n,s)).program=e,o.depth=a?a.length:0,o.blockParams=r||0,o}function h(){return""}function u(t,e,n,r,s,a){if(t.decorator){var o={};e=t.decorator(e,o,n,r&&r[0],s,a,r),i.extend(e,o)}return e}}}),zt=_t({"../../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}}),Gt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.runtime.js"(t,e){function i(t){return t&&t.__esModule?t:{default:t}}function n(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}t.__esModule=!0;var r=n(jt()),s=i(Bt()),a=i(Dt()),o=n(Ct()),c=n(Wt()),l=i(zt());function h(){var t=new r.HandlebarsEnvironment;return o.extend(t,r),t.SafeString=s.default,t.Exception=a.default,t.Utils=o,t.escapeExpression=o.escapeExpression,t.VM=c,t.template=function(e){return c.template(e,t)},t}var u=h();u.create=h,l.default(u),u.default=u,t.default=u,e.exports=t.default}}),Ht=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js"(t,e){t.__esModule=!0;var i={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&&!i.helpers.scopedId(t)&&!t.depth}}};t.default=i,e.exports=t.default}}),qt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js"(t,e){t.__esModule=!0;var i=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,i,n,r,s,a){var o=s.length-1;switch(r){case 1:return s[o-1];case 2:this.$=n.prepareProgram(s[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.$=s[o];break;case 9:this.$={type:"CommentStatement",value:n.stripComment(s[o]),strip:n.stripFlags(s[o],s[o]),loc:n.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:s[o],value:s[o],loc:n.locInfo(this._$)};break;case 11:this.$=n.prepareRawBlock(s[o-2],s[o-1],s[o],this._$);break;case 12:this.$={path:s[o-3],params:s[o-2],hash:s[o-1]};break;case 13:this.$=n.prepareBlock(s[o-3],s[o-2],s[o-1],s[o],!1,this._$);break;case 14:this.$=n.prepareBlock(s[o-3],s[o-2],s[o-1],s[o],!0,this._$);break;case 15:this.$={open:s[o-5],path:s[o-4],params:s[o-3],hash:s[o-2],blockParams:s[o-1],strip:n.stripFlags(s[o-5],s[o])};break;case 16:case 17:this.$={path:s[o-4],params:s[o-3],hash:s[o-2],blockParams:s[o-1],strip:n.stripFlags(s[o-5],s[o])};break;case 18:this.$={strip:n.stripFlags(s[o-1],s[o-1]),program:s[o]};break;case 19:var c=n.prepareBlock(s[o-2],s[o-1],s[o],s[o],!1,this._$),l=n.prepareProgram([c],s[o-1].loc);l.chained=!0,this.$={strip:s[o-2].strip,program:l,chain:!0};break;case 21:this.$={path:s[o-1],strip:n.stripFlags(s[o-2],s[o])};break;case 22:case 23:this.$=n.prepareMustache(s[o-3],s[o-2],s[o-1],s[o-4],n.stripFlags(s[o-4],s[o]),this._$);break;case 24:this.$={type:"PartialStatement",name:s[o-3],params:s[o-2],hash:s[o-1],indent:"",strip:n.stripFlags(s[o-4],s[o]),loc:n.locInfo(this._$)};break;case 25:this.$=n.preparePartialBlock(s[o-2],s[o-1],s[o],this._$);break;case 26:this.$={path:s[o-3],params:s[o-2],hash:s[o-1],strip:n.stripFlags(s[o-4],s[o])};break;case 29:this.$={type:"SubExpression",path:s[o-3],params:s[o-2],hash:s[o-1],loc:n.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:s[o],loc:n.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:n.id(s[o-2]),value:s[o],loc:n.locInfo(this._$)};break;case 32:this.$=n.id(s[o-1]);break;case 35:this.$={type:"StringLiteral",value:s[o],original:s[o],loc:n.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(s[o]),original:Number(s[o]),loc:n.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===s[o],original:"true"===s[o],loc:n.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:n.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:n.locInfo(this._$)};break;case 42:this.$=n.preparePath(!0,s[o],this._$);break;case 43:this.$=n.preparePath(!1,s[o],this._$);break;case 44:s[o-2].push({part:n.id(s[o]),original:s[o],separator:s[o-1]}),this.$=s[o-2];break;case 45:this.$=[{part:n.id(s[o]),original:s[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:s[o-1].push(s[o]);break;case 98:case 100:this.$=[s[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,i=[0],n=[null],r=[],s=this.table,a="",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;r.push(l);var h=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var u,d,p,f,m,g,y,w,v,b={};;){if(d=i[i.length-1],this.defaultActions[d]?p=this.defaultActions[d]:(null==u&&(v=void 0,"number"!=typeof(v=e.lexer.lex()||1)&&(v=e.symbols_[v]||v),u=v),p=s[d]&&s[d][u]),void 0===p||!p.length||!p[0]){var E="";for(m in w=[],s[d])this.terminals_[m]&&m>2&&w.push("'"+this.terminals_[m]+"'");E=this.lexer.showPosition?"Parse error on line "+(o+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+w.join(", ")+", got '"+(this.terminals_[u]||u)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==u?"end of input":"'"+(this.terminals_[u]||u)+"'"),this.parseError(E,{text:this.lexer.match,token:this.terminals_[u]||u,line:this.lexer.yylineno,loc:l,expected:w})}if(p[0]instanceof Array&&p.length>1)throw new Error("Parse Error: multiple actions possible at state: "+d+", token: "+u);switch(p[0]){case 1:i.push(u),n.push(this.lexer.yytext),r.push(this.lexer.yylloc),i.push(p[1]),u=null,c=this.lexer.yyleng,a=this.lexer.yytext,o=this.lexer.yylineno,l=this.lexer.yylloc;break;case 2:if(g=this.productions_[p[1]][1],b.$=n[n.length-g],b._$={first_line:r[r.length-(g||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(g||1)].first_column,last_column:r[r.length-1].last_column},h&&(b._$.range=[r[r.length-(g||1)].range[0],r[r.length-1].range[1]]),void 0!==(f=this.performAction.call(b,a,c,o,this.yy,p[1],n,r)))return f;g&&(i=i.slice(0,-1*g*2),n=n.slice(0,-1*g),r=r.slice(0,-1*g)),i.push(this.productions_[p[1]][0]),n.push(b.$),r.push(b._$),y=s[i[i.length-2]][i[i.length-1]],i.push(y);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,i=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 n=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),i.length-1&&(this.yylineno-=i.length-1);var r=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:i?(i.length===n.length?this.yylloc.first_column:0)+n[n.length-i.length].length-i[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[r[0],r[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,i,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length&&(!(i=this._input.match(this.rules[s[a]]))||e&&!(i[0].length>e[0].length)||(e=i,n=a,this.options.flex));a++);return e?((r=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.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,s[n],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,i,n){function r(t,i){return e.yytext=e.yytext.substring(t,e.yyleng-i+t)}switch(i){case 0:if("\\\\"===e.yytext.slice(-2)?(r(0,1),this.begin("mu")):"\\"===e.yytext.slice(-1)?(r(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:(r(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=r(1,2).replace(/\\"/g,'"'),80;case 32:return e.yytext=r(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 i(){this.yy={}}return t.lexer=e,i.prototype=t,t.Parser=i,new i}();t.default=i,e.exports=t.default}}),Kt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js"(t,e){t.__esModule=!0;var i,n=Dt(),r=(i=n)&&i.__esModule?i:{default:i};function s(){this.parents=[]}function a(t){this.acceptRequired(t,"path"),this.acceptArray(t.params),this.acceptKey(t,"hash")}function o(t){a.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")}s.prototype={constructor:s,mutating:!1,acceptKey:function(t,e){var i=this.accept(t[e]);if(this.mutating){if(i&&!s.prototype[i.type])throw new r.default('Unexpected node type "'+i.type+'" found when accepting '+e+" on "+t.type);t[e]=i}},acceptRequired:function(t,e){if(this.acceptKey(t,e),!t[e])throw new r.default(t.type+" requires "+e)},acceptArray:function(t){for(var e=0,i=t.length;e<i;e++)this.acceptKey(t,e),t[e]||(t.splice(e,1),e--,i--)},accept:function(t){if(t){if(!this[t.type])throw new r.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:a,Decorator:a,BlockStatement:o,DecoratorBlock:o,PartialStatement:c,PartialBlockStatement:function(t){c.call(this,t),this.acceptKey(t,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:a,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=s,e.exports=t.default}}),Xt=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js"(t,e){t.__esModule=!0;var i,n=Kt(),r=(i=n)&&i.__esModule?i:{default:i};function s(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=t}function a(t,e,i){void 0===e&&(e=t.length);var n=t[e-1],r=t[e-2];return n?"ContentStatement"===n.type?(r||!i?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original):void 0:i}function o(t,e,i){void 0===e&&(e=-1);var n=t[e+1],r=t[e+2];return n?"ContentStatement"===n.type?(r||!i?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original):void 0:i}function c(t,e,i){var n=t[null==e?0:e+1];if(n&&"ContentStatement"===n.type&&(i||!n.rightStripped)){var r=n.value;n.value=n.value.replace(i?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==r}}function l(t,e,i){var n=t[null==e?t.length-1:e-1];if(n&&"ContentStatement"===n.type&&(i||!n.leftStripped)){var r=n.value;return n.value=n.value.replace(i?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==r,n.leftStripped}}s.prototype=new r.default,s.prototype.Program=function(t){var e=!this.options.ignoreStandalone,i=!this.isRootSeen;this.isRootSeen=!0;for(var n=t.body,r=0,s=n.length;r<s;r++){var h=n[r],u=this.accept(h);if(u){var d=a(n,r,i),p=o(n,r,i),f=u.openStandalone&&d,m=u.closeStandalone&&p,g=u.inlineStandalone&&d&&p;u.close&&c(n,r,!0),u.open&&l(n,r,!0),e&&g&&(c(n,r),l(n,r)&&"PartialStatement"===h.type&&(h.indent=/([ \t]+$)/.exec(n[r-1].original)[1])),e&&f&&(c((h.program||h.inverse).body),l(n,r)),e&&m&&(c(n,r),l((h.inverse||h.program).body))}}return t},s.prototype.BlockStatement=s.prototype.DecoratorBlock=s.prototype.PartialBlockStatement=function(t){this.accept(t.program),this.accept(t.inverse);var e=t.program||t.inverse,i=t.program&&t.inverse,n=i,r=i;if(i&&i.chained)for(n=i.body[0].program;r.chained;)r=r.body[r.body.length-1].program;var s={open:t.openStrip.open,close:t.closeStrip.close,openStandalone:o(e.body),closeStandalone:a((n||e).body)};if(t.openStrip.close&&c(e.body,null,!0),i){var h=t.inverseStrip;h.open&&l(e.body,null,!0),h.close&&c(n.body,null,!0),t.closeStrip.open&&l(r.body,null,!0),!this.options.ignoreStandalone&&a(e.body)&&o(n.body)&&(l(e.body),c(n.body))}else t.closeStrip.open&&l(e.body,null,!0);return s},s.prototype.Decorator=s.prototype.MustacheStatement=function(t){return t.strip},s.prototype.PartialStatement=s.prototype.CommentStatement=function(t){var e=t.strip||{};return{inlineStandalone:!0,open:e.open,close:e.close}},t.default=s,e.exports=t.default}}),Yt=_t({"../../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,i){i=this.locInfo(i);for(var r=t?"@":"",s=[],a=0,o=0,c=e.length;o<c;o++){var l=e[o].part,h=e[o].original!==l;if(r+=(e[o].separator||"")+l,h||".."!==l&&"."!==l&&"this"!==l)s.push(l);else{if(s.length>0)throw new n.default("Invalid path: "+r,{loc:i});".."===l&&a++}}return{type:"PathExpression",data:t,depth:a,parts:s,original:r,loc:i}},t.prepareMustache=function(t,e,i,n,r,s){var a=n.charAt(3)||n.charAt(2),o="{"!==a&&"&"!==a;return{type:/\*/.test(n)?"Decorator":"MustacheStatement",path:t,params:e,hash:i,escaped:o,strip:r,loc:this.locInfo(s)}},t.prepareRawBlock=function(t,e,i,n){r(t,i),n=this.locInfo(n);var s={type:"Program",body:e,strip:{},loc:n};return{type:"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:s,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}},t.prepareBlock=function(t,e,i,s,a,o){s&&s.path&&r(t,s);var c=/\*/.test(t.open);e.blockParams=t.blockParams;var l=void 0,h=void 0;if(i){if(c)throw new n.default("Unexpected inverse block on decorator",i);i.chain&&(i.program.body[0].closeStrip=s.strip),h=i.strip,l=i.program}a&&(a=l,l=e,e=a);return{type:c?"DecoratorBlock":"BlockStatement",path:t.path,params:t.params,hash:t.hash,program:e,inverse:l,openStrip:t.strip,inverseStrip:h,closeStrip:s&&s.strip,loc:this.locInfo(o)}},t.prepareProgram=function(t,e){if(!e&&t.length){var i=t[0].loc,n=t[t.length-1].loc;i&&n&&(e={source:i.source,start:{line:i.start.line,column:i.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:t,strip:{},loc:e}},t.preparePartialBlock=function(t,e,i,n){return r(t,i),{type:"PartialBlockStatement",name:t.path,params:t.params,hash:t.hash,program:e,openStrip:t.strip,closeStrip:i&&i.strip,loc:this.locInfo(n)}};var e,i=Dt(),n=(e=i)&&e.__esModule?e:{default:e};function r(t,e){if(e=e.path?e.path.original:e,t.path.original!==e){var i={loc:t.path.loc};throw new n.default(t.path.original+" doesn't match "+e,i)}}}}),$t=_t({"../../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 i=o(t,e);return new n.default(e).accept(i)};var i=e(qt()),n=e(Xt()),r=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}(Yt()),s=Ct();t.parser=i.default;var a={};function o(t,e){return"Program"===t.type?t:(i.default.yy=a,a.locInfo=function(t){return new a.SourceLocation(e&&e.srcName,t)},i.default.parse(t))}s.extend(a,r)}}),Qt=_t({"../../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=a,t.precompile=function(t,e,n){if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new i.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 r=n.parse(t,e),s=(new n.Compiler).compile(r,e);return(new n.JavaScriptCompiler).compile(s,e)},t.compile=function(t,e,r){void 0===e&&(e={});if(null==t||"string"!=typeof t&&"Program"!==t.type)throw new i.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+t);"data"in(e=n.extend({},e))||(e.data=!0);e.compat&&(e.useDepths=!0);var s=void 0;function a(){var i=r.parse(t,e),n=(new r.Compiler).compile(i,e),s=(new r.JavaScriptCompiler).compile(n,e,void 0,!0);return r.template(s)}function o(t,e){return s||(s=a()),s.call(this,t,e)}return o._setup=function(t){return s||(s=a()),s._setup(t)},o._child=function(t,e,i,n){return s||(s=a()),s._child(t,e,i,n)},o};var i=e(Dt()),n=Ct(),r=e(Ht()),s=[].slice;function a(){}function o(t,e){if(t===e)return!0;if(n.isArray(t)&&n.isArray(e)&&t.length===e.length){for(var i=0;i<t.length;i++)if(!o(t[i],e[i]))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}}}a.prototype={compiler:a,equals:function(t){var e=this.opcodes.length;if(t.opcodes.length!==e)return!1;for(var i=0;i<e;i++){var n=this.opcodes[i],r=t.opcodes[i];if(n.opcode!==r.opcode||!o(n.args,r.args))return!1}e=this.children.length;for(i=0;i<e;i++)if(!this.children[i].equals(t.children[i]))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=n.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),i=this.guid++;return this.usePartial=this.usePartial||e.usePartial,this.children[i]=e,this.useDepths=this.useDepths||e.useDepths,i},accept:function(t){if(!this[t.type])throw new i.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,i=e.length,n=0;n<i;n++)this.accept(e[n]);return this.options.blockParams.shift(),this.isSimple=1===i,this.blockParams=t.blockParams?t.blockParams.length:0,this},BlockStatement:function(t){c(t);var e=t.program,i=t.inverse;e=e&&this.compileProgram(e),i=i&&this.compileProgram(i);var n=this.classifySexpr(t);"helper"===n?this.helperSexpr(t,e,i):"simple"===n?(this.simpleSexpr(t),this.opcode("pushProgram",e),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue",t.path.original)):(this.ambiguousSexpr(t,e,i),this.opcode("pushProgram",e),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(t){var e=t.program&&this.compileProgram(t.program),i=this.setupFullMustacheParams(t,e,void 0),n=t.path;this.useDecorators=!0,this.opcode("registerDecorator",i.length,n.original)},PartialStatement:function(t){this.usePartial=!0;var e=t.program;e&&(e=this.compileProgram(t.program));var n=t.params;if(n.length>1)throw new i.default("Unsupported number of partial arguments: "+n.length,t);n.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):n.push({type:"PathExpression",parts:[],depth:0}));var r=t.name.original,s="SubExpression"===t.name.type;s&&this.accept(t.name),this.setupFullMustacheParams(t,e,void 0,!0);var a=t.indent||"";this.options.preventIndent&&a&&(this.opcode("appendContent",a),a=""),this.opcode("invokePartial",s,r,a),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,i){var n=t.path,r=n.parts[0],s=null!=e||null!=i;this.opcode("getContext",n.depth),this.opcode("pushProgram",e),this.opcode("pushProgram",i),n.strict=!0,this.accept(n),this.opcode("invokeAmbiguous",r,s)},simpleSexpr:function(t){var e=t.path;e.strict=!0,this.accept(e),this.opcode("resolvePossibleLambda")},helperSexpr:function(t,e,n){var s=this.setupFullMustacheParams(t,e,n),a=t.path,o=a.parts[0];if(this.options.knownHelpers[o])this.opcode("invokeKnownHelper",s.length,o);else{if(this.options.knownHelpersOnly)throw new i.default("You specified knownHelpersOnly, but used the unknown helper "+o,t);a.strict=!0,a.falsy=!0,this.accept(a),this.opcode("invokeHelper",s.length,a.original,r.default.helpers.simpleId(a))}},PathExpression:function(t){this.addDepth(t.depth),this.opcode("getContext",t.depth);var e=t.parts[0],i=r.default.helpers.scopedId(t),n=!t.depth&&!i&&this.blockParamIndex(e);n?this.opcode("lookupBlockParam",n,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,i):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,i=0,n=e.length;for(this.opcode("pushHash");i<n;i++)this.pushParam(e[i].value);for(;i--;)this.opcode("assignToHash",e[i].key);this.opcode("popHash")},opcode:function(t){this.opcodes.push({opcode:t,args:s.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(t){t&&(this.useDepths=!0)},classifySexpr:function(t){var e=r.default.helpers.simpleId(t.path),i=e&&!!this.blockParamIndex(t.path.parts[0]),n=!i&&r.default.helpers.helperExpression(t),s=!i&&(n||e);if(s&&!n){var a=t.path.parts[0],o=this.options;o.knownHelpers[a]?n=!0:o.knownHelpersOnly&&(s=!1)}return n?"helper":s?"ambiguous":"simple"},pushParams:function(t){for(var e=0,i=t.length;e<i;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 i=void 0;if(!t.parts||r.default.helpers.scopedId(t)||t.depth||(i=this.blockParamIndex(t.parts[0])),i){var n=t.parts.slice(1).join(".");this.opcode("pushId","BlockParam",i,n)}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,i,n){var r=t.params;return this.pushParams(r),this.opcode("pushProgram",e),this.opcode("pushProgram",i),t.hash?this.accept(t.hash):this.opcode("emptyHash",n),r},blockParamIndex:function(t){for(var e=0,i=this.options.blockParams.length;e<i;e++){var r=this.options.blockParams[e],s=r&&n.indexOf(r,t);if(r&&s>=0)return[e,s]}}}}}),Jt=_t({"../../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}}}),Zt=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(t){var e=Jt();t.encode=function(t){var i,n="",r=function(t){return t<0?1+(-t<<1):0+(t<<1)}(t);do{i=31&r,(r>>>=5)>0&&(i|=32),n+=e.encode(i)}while(r>0);return n},t.decode=function(t,i,n){var r,s,a,o,c=t.length,l=0,h=0;do{if(i>=c)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(s=e.decode(t.charCodeAt(i++))))throw new Error("Invalid base64 digit: "+t.charAt(i-1));r=!!(32&s),l+=(s&=31)<<h,h+=5}while(r);n.value=(o=(a=l)>>1,1==(1&a)?-o:o),n.rest=i}}}),te=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js"(t){t.getArg=function(t,e,i){if(e in t)return t[e];if(3===arguments.length)return i;throw new Error('"'+e+'" is a required argument.')};var e=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,i=/^data:.+\,.+$/;function n(t){var i=t.match(e);return i?{scheme:i[1],auth:i[2],host:i[3],port:i[4],path:i[5]}:null}function r(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 s(e){var i=e,s=n(e);if(s){if(!s.path)return e;i=s.path}for(var a,o=t.isAbsolute(i),c=i.split(/\/+/),l=0,h=c.length-1;h>=0;h--)"."===(a=c[h])?c.splice(h,1):".."===a?l++:l>0&&(""===a?(c.splice(h+1,l),l=0):(c.splice(h,2),l--));return""===(i=c.join("/"))&&(i=o?"/":"."),s?(s.path=i,r(s)):i}function a(t,e){""===t&&(t="."),""===e&&(e=".");var a=n(e),o=n(t);if(o&&(t=o.path||"/"),a&&!a.scheme)return o&&(a.scheme=o.scheme),r(a);if(a||e.match(i))return e;if(o&&!o.host&&!o.path)return o.host=e,r(o);var c="/"===e.charAt(0)?e:s(t.replace(/\/+$/,"")+"/"+e);return o?(o.path=c,r(o)):c}t.urlParse=n,t.urlGenerate=r,t.normalize=s,t.join=a,t.isAbsolute=function(t){return"/"===t.charAt(0)||e.test(t)},t.relative=function(t,e){""===t&&(t="."),t=t.replace(/\/$/,"");for(var i=0;0!==e.indexOf(t+"/");){var n=t.lastIndexOf("/");if(n<0)return e;if((t=t.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return e;++i}return Array(i+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 i=e-10;i>=0;i--)if(36!==t.charCodeAt(i))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,i){var n=h(t.source,e.source);return 0!==n||0!==(n=t.originalLine-e.originalLine)||0!==(n=t.originalColumn-e.originalColumn)||i||0!==(n=t.generatedColumn-e.generatedColumn)||0!==(n=t.generatedLine-e.generatedLine)?n:h(t.name,e.name)},t.compareByGeneratedPositionsDeflated=function(t,e,i){var n=t.generatedLine-e.generatedLine;return 0!==n||0!==(n=t.generatedColumn-e.generatedColumn)||i||0!==(n=h(t.source,e.source))||0!==(n=t.originalLine-e.originalLine)||0!==(n=t.originalColumn-e.originalColumn)?n:h(t.name,e.name)},t.compareByGeneratedPositionsInflated=function(t,e){var i=t.generatedLine-e.generatedLine;return 0!==i||0!==(i=t.generatedColumn-e.generatedColumn)||0!==(i=h(t.source,e.source))||0!==(i=t.originalLine-e.originalLine)||0!==(i=t.originalColumn-e.originalColumn)?i:h(t.name,e.name)},t.parseSourceMapInput=function(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(t,e,i){if(e=e||"",t&&("/"!==t[t.length-1]&&"/"!==e[0]&&(t+="/"),e=t+e),i){var o=n(i);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=a(r(o),e)}return s(e)}}}),ee=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js"(t){var e=te(),i=Object.prototype.hasOwnProperty,n="undefined"!=typeof Map;function r(){this._array=[],this._set=n?new Map:Object.create(null)}r.fromArray=function(t,e){for(var i=new r,n=0,s=t.length;n<s;n++)i.add(t[n],e);return i},r.prototype.size=function(){return n?this._set.size:Object.getOwnPropertyNames(this._set).length},r.prototype.add=function(t,r){var s=n?t:e.toSetString(t),a=n?this.has(t):i.call(this._set,s),o=this._array.length;a&&!r||this._array.push(t),a||(n?this._set.set(t,o):this._set[s]=o)},r.prototype.has=function(t){if(n)return this._set.has(t);var r=e.toSetString(t);return i.call(this._set,r)},r.prototype.indexOf=function(t){if(n){var r=this._set.get(t);if(r>=0)return r}else{var s=e.toSetString(t);if(i.call(this._set,s))return this._set[s]}throw new Error('"'+t+'" is not in the set.')},r.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)},r.prototype.toArray=function(){return this._array.slice()},t.ArraySet=r}}),ie=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js"(t){var e=te();function i(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}i.prototype.unsortedForEach=function(t,e){this._array.forEach(t,e)},i.prototype.add=function(t){var i,n,r,s,a,o;i=this._last,n=t,r=i.generatedLine,s=n.generatedLine,a=i.generatedColumn,o=n.generatedColumn,s>r||s==r&&o>=a||e.compareByGeneratedPositionsInflated(i,n)<=0?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))},i.prototype.toArray=function(){return this._sorted||(this._array.sort(e.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},t.MappingList=i}}),ne=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js"(t){var e=Zt(),i=te(),n=ee().ArraySet,r=ie().MappingList;function s(t){t||(t={}),this._file=i.getArg(t,"file",null),this._sourceRoot=i.getArg(t,"sourceRoot",null),this._skipValidation=i.getArg(t,"skipValidation",!1),this._sources=new n,this._names=new n,this._mappings=new r,this._sourcesContents=null}s.prototype._version=3,s.fromSourceMap=function(t){var e=t.sourceRoot,n=new s({file:t.file,sourceRoot:e});return t.eachMapping((function(t){var r={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(r.source=t.source,null!=e&&(r.source=i.relative(e,r.source)),r.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(r.name=t.name)),n.addMapping(r)})),t.sources.forEach((function(r){var s=r;null!==e&&(s=i.relative(e,r)),n._sources.has(s)||n._sources.add(s);var a=t.sourceContentFor(r);null!=a&&n.setSourceContent(r,a)})),n},s.prototype.addMapping=function(t){var e=i.getArg(t,"generated"),n=i.getArg(t,"original",null),r=i.getArg(t,"source",null),s=i.getArg(t,"name",null);this._skipValidation||this._validateMapping(e,n,r,s),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:s})},s.prototype.setSourceContent=function(t,e){var n=t;null!=this._sourceRoot&&(n=i.relative(this._sourceRoot,n)),null!=e?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[i.toSetString(n)]=e):this._sourcesContents&&(delete this._sourcesContents[i.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},s.prototype.applySourceMap=function(t,e,r){var s=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.');s=t.file}var a=this._sourceRoot;null!=a&&(s=i.relative(a,s));var o=new n,c=new n;this._mappings.unsortedForEach((function(e){if(e.source===s&&null!=e.originalLine){var n=t.originalPositionFor({line:e.originalLine,column:e.originalColumn});null!=n.source&&(e.source=n.source,null!=r&&(e.source=i.join(r,e.source)),null!=a&&(e.source=i.relative(a,e.source)),e.originalLine=n.line,e.originalColumn=n.column,null!=n.name&&(e.name=n.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 n=t.sourceContentFor(e);null!=n&&(null!=r&&(e=i.join(r,e)),null!=a&&(e=i.relative(a,e)),this.setSourceContent(e,n))}),this)},s.prototype._validateMapping=function(t,e,i,n){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||i||n)&&!(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&&i))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:i,original:e,name:n}))},s.prototype._serializeMappings=function(){for(var t,n,r,s,a=0,o=1,c=0,l=0,h=0,u=0,d="",p=this._mappings.toArray(),f=0,m=p.length;f<m;f++){if(t="",(n=p[f]).generatedLine!==o)for(a=0;n.generatedLine!==o;)t+=";",o++;else if(f>0){if(!i.compareByGeneratedPositionsInflated(n,p[f-1]))continue;t+=","}t+=e.encode(n.generatedColumn-a),a=n.generatedColumn,null!=n.source&&(s=this._sources.indexOf(n.source),t+=e.encode(s-u),u=s,t+=e.encode(n.originalLine-1-l),l=n.originalLine-1,t+=e.encode(n.originalColumn-c),c=n.originalColumn,null!=n.name&&(r=this._names.indexOf(n.name),t+=e.encode(r-h),h=r)),d+=t}return d},s.prototype._generateSourcesContent=function(t,e){return t.map((function(t){if(!this._sourcesContents)return null;null!=e&&(t=i.relative(e,t));var n=i.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},s.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},s.prototype.toString=function(){return JSON.stringify(this.toJSON())},t.SourceMapGenerator=s}}),re=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js"(t){function e(i,n,r,s,a,o){var c=Math.floor((n-i)/2)+i,l=a(r,s[c],!0);return 0===l?c:l>0?n-c>1?e(c,n,r,s,a,o):o==t.LEAST_UPPER_BOUND?n<s.length?n:-1:c:c-i>1?e(i,c,r,s,a,o):o==t.LEAST_UPPER_BOUND?c:i<0?-1:i}t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(i,n,r,s){if(0===n.length)return-1;var a=e(-1,n.length,i,n,r,s||t.GREATEST_LOWER_BOUND);if(a<0)return-1;for(;a-1>=0&&0===r(n[a],n[a-1],!0);)--a;return a}}}),se=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(t){function e(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function i(t,n,r,s){if(r<s){var a=r-1;e(t,(h=r,u=s,Math.round(h+Math.random()*(u-h))),s);for(var o=t[s],c=r;c<s;c++)n(t[c],o)<=0&&e(t,a+=1,c);e(t,a+1,c);var l=a+1;i(t,n,r,l-1),i(t,n,l+1,s)}var h,u}t.quickSort=function(t,e){i(t,e,0,t.length-1)}}}),ae=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js"(t){var e=te(),i=re(),n=ee().ArraySet,r=Zt(),s=se().quickSort;function a(t,i){var n=t;return"string"==typeof t&&(n=e.parseSourceMapInput(t)),null!=n.sections?new l(n,i):new o(n,i)}function o(t,i){var r=t;"string"==typeof t&&(r=e.parseSourceMapInput(t));var s=e.getArg(r,"version"),a=e.getArg(r,"sources"),o=e.getArg(r,"names",[]),c=e.getArg(r,"sourceRoot",null),l=e.getArg(r,"sourcesContent",null),h=e.getArg(r,"mappings"),u=e.getArg(r,"file",null);if(s!=this._version)throw new Error("Unsupported version: "+s);c&&(c=e.normalize(c)),a=a.map(String).map(e.normalize).map((function(t){return c&&e.isAbsolute(c)&&e.isAbsolute(t)?e.relative(c,t):t})),this._names=n.fromArray(o.map(String),!0),this._sources=n.fromArray(a,!0),this._absoluteSources=this._sources.toArray().map((function(t){return e.computeSourceURL(c,t,i)})),this.sourceRoot=c,this.sourcesContent=l,this._mappings=h,this._sourceMapURL=i,this.file=u}function c(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function l(t,i){var r=t;"string"==typeof t&&(r=e.parseSourceMapInput(t));var s=e.getArg(r,"version"),o=e.getArg(r,"sections");if(s!=this._version)throw new Error("Unsupported version: "+s);this._sources=new n,this._names=new n;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 n=e.getArg(t,"offset"),r=e.getArg(n,"line"),s=e.getArg(n,"column");if(r<c.line||r===c.line&&s<c.column)throw new Error("Section offsets must be ordered and non-overlapping.");return c=n,{generatedOffset:{generatedLine:r+1,generatedColumn:s+1},consumer:new a(e.getArg(t,"map"),i)}}))}a.fromSourceMap=function(t,e){return o.fromSourceMap(t,e)},a.prototype._version=3,a.prototype.__generatedMappings=null,Object.defineProperty(a.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),a.prototype.__originalMappings=null,Object.defineProperty(a.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),a.prototype._charIsMappingSeparator=function(t,e){var i=t.charAt(e);return";"===i||","===i},a.prototype._parseMappings=function(t,e){throw new Error("Subclasses must implement _parseMappings")},a.GENERATED_ORDER=1,a.ORIGINAL_ORDER=2,a.GREATEST_LOWER_BOUND=1,a.LEAST_UPPER_BOUND=2,a.prototype.eachMapping=function(t,i,n){var r,s=i||null;switch(n||a.GENERATED_ORDER){case a.GENERATED_ORDER:r=this._generatedMappings;break;case a.ORIGINAL_ORDER:r=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var o=this.sourceRoot;r.map((function(t){var i=null===t.source?null:this._sources.at(t.source);return{source:i=e.computeSourceURL(o,i,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,s)},a.prototype.allGeneratedPositionsFor=function(t){var n=e.getArg(t,"line"),r={source:e.getArg(t,"source"),originalLine:n,originalColumn:e.getArg(t,"column",0)};if(r.source=this._findSourceIndex(r.source),r.source<0)return[];var s=[],a=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,i.LEAST_UPPER_BOUND);if(a>=0){var o=this._originalMappings[a];if(void 0===t.column)for(var c=o.originalLine;o&&o.originalLine===c;)s.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a];else for(var l=o.originalColumn;o&&o.originalLine===n&&o.originalColumn==l;)s.push({line:e.getArg(o,"generatedLine",null),column:e.getArg(o,"generatedColumn",null),lastColumn:e.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++a]}return s},t.SourceMapConsumer=a,o.prototype=Object.create(a.prototype),o.prototype.consumer=a,o.prototype._findSourceIndex=function(t){var i,n=t;if(null!=this.sourceRoot&&(n=e.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(i=0;i<this._absoluteSources.length;++i)if(this._absoluteSources[i]==t)return i;return-1},o.fromSourceMap=function(t,i){var r=Object.create(o.prototype),a=r._names=n.fromArray(t._names.toArray(),!0),l=r._sources=n.fromArray(t._sources.toArray(),!0);r.sourceRoot=t._sourceRoot,r.sourcesContent=t._generateSourcesContent(r._sources.toArray(),r.sourceRoot),r.file=t._file,r._sourceMapURL=i,r._absoluteSources=r._sources.toArray().map((function(t){return e.computeSourceURL(r.sourceRoot,t,i)}));for(var h=t._mappings.toArray().slice(),u=r.__generatedMappings=[],d=r.__originalMappings=[],p=0,f=h.length;p<f;p++){var m=h[p],g=new c;g.generatedLine=m.generatedLine,g.generatedColumn=m.generatedColumn,m.source&&(g.source=l.indexOf(m.source),g.originalLine=m.originalLine,g.originalColumn=m.originalColumn,m.name&&(g.name=a.indexOf(m.name)),d.push(g)),u.push(g)}return s(r.__originalMappings,e.compareByOriginalPositions),r},o.prototype._version=3,Object.defineProperty(o.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),o.prototype._parseMappings=function(t,i){for(var n,a,o,l,h,u=1,d=0,p=0,f=0,m=0,g=0,y=t.length,w=0,v={},b={},E=[],_=[];w<y;)if(";"===t.charAt(w))u++,w++,d=0;else if(","===t.charAt(w))w++;else{for((n=new c).generatedLine=u,l=w;l<y&&!this._charIsMappingSeparator(t,l);l++);if(o=v[a=t.slice(w,l)])w+=a.length;else{for(o=[];w<l;)r.decode(t,w,b),h=b.value,w=b.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[a]=o}n.generatedColumn=d+o[0],d=n.generatedColumn,o.length>1&&(n.source=m+o[1],m+=o[1],n.originalLine=p+o[2],p=n.originalLine,n.originalLine+=1,n.originalColumn=f+o[3],f=n.originalColumn,o.length>4&&(n.name=g+o[4],g+=o[4])),_.push(n),"number"==typeof n.originalLine&&E.push(n)}s(_,e.compareByGeneratedPositionsDeflated),this.__generatedMappings=_,s(E,e.compareByOriginalPositions),this.__originalMappings=E},o.prototype._findMapping=function(t,e,n,r,s,a){if(t[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+t[n]);if(t[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+t[r]);return i.search(t,e,s,a)},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 i=this._generatedMappings[t+1];if(e.generatedLine===i.generatedLine){e.lastGeneratedColumn=i.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}},o.prototype.originalPositionFor=function(t){var i={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},n=this._findMapping(i,this._generatedMappings,"generatedLine","generatedColumn",e.compareByGeneratedPositionsDeflated,e.getArg(t,"bias",a.GREATEST_LOWER_BOUND));if(n>=0){var r=this._generatedMappings[n];if(r.generatedLine===i.generatedLine){var s=e.getArg(r,"source",null);null!==s&&(s=this._sources.at(s),s=e.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=e.getArg(r,"name",null);return null!==o&&(o=this._names.at(o)),{source:s,line:e.getArg(r,"originalLine",null),column:e.getArg(r,"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,i){if(!this.sourcesContent)return null;var n=this._findSourceIndex(t);if(n>=0)return this.sourcesContent[n];var r,s=t;if(null!=this.sourceRoot&&(s=e.relative(this.sourceRoot,s)),null!=this.sourceRoot&&(r=e.urlParse(this.sourceRoot))){var a=s.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!r.path||"/"==r.path)&&this._sources.has("/"+s))return this.sourcesContent[this._sources.indexOf("/"+s)]}if(i)return null;throw new Error('"'+s+'" is not in the SourceMap.')},o.prototype.generatedPositionFor=function(t){var i=e.getArg(t,"source");if((i=this._findSourceIndex(i))<0)return{line:null,column:null,lastColumn:null};var n={source:i,originalLine:e.getArg(t,"line"),originalColumn:e.getArg(t,"column")},r=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",e.compareByOriginalPositions,e.getArg(t,"bias",a.GREATEST_LOWER_BOUND));if(r>=0){var s=this._originalMappings[r];if(s.source===n.source)return{line:e.getArg(s,"generatedLine",null),column:e.getArg(s,"generatedColumn",null),lastColumn:e.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=o,l.prototype=Object.create(a.prototype),l.prototype.constructor=a,l.prototype._version=3,Object.defineProperty(l.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var i=0;i<this._sections[e].consumer.sources.length;i++)t.push(this._sections[e].consumer.sources[i]);return t}}),l.prototype.originalPositionFor=function(t){var n={generatedLine:e.getArg(t,"line"),generatedColumn:e.getArg(t,"column")},r=i.search(n,this._sections,(function(t,e){var i=t.generatedLine-e.generatedOffset.generatedLine;return i||t.generatedColumn-e.generatedOffset.generatedColumn})),s=this._sections[r];return s?s.consumer.originalPositionFor({line:n.generatedLine-(s.generatedOffset.generatedLine-1),column:n.generatedColumn-(s.generatedOffset.generatedLine===n.generatedLine?s.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 i=0;i<this._sections.length;i++){var n=this._sections[i].consumer.sourceContentFor(t,!0);if(n)return n}if(e)return null;throw new Error('"'+t+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(t){for(var i=0;i<this._sections.length;i++){var n=this._sections[i];if(-1!==n.consumer._findSourceIndex(e.getArg(t,"source"))){var r=n.consumer.generatedPositionFor(t);if(r)return{line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},l.prototype._parseMappings=function(t,i){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var r=this._sections[n],a=r.consumer._generatedMappings,o=0;o<a.length;o++){var c=a[o],l=r.consumer._sources.at(c.source);l=e.computeSourceURL(r.consumer.sourceRoot,l,this._sourceMapURL),this._sources.add(l),l=this._sources.indexOf(l);var h=null;c.name&&(h=r.consumer._names.at(c.name),this._names.add(h),h=this._names.indexOf(h));var u={source:l,generatedLine:c.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:c.generatedColumn+(r.generatedOffset.generatedLine===c.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:c.originalLine,originalColumn:c.originalColumn,name:h};this.__generatedMappings.push(u),"number"==typeof u.originalLine&&this.__originalMappings.push(u)}s(this.__generatedMappings,e.compareByGeneratedPositionsDeflated),s(this.__originalMappings,e.compareByOriginalPositions)},t.IndexedSourceMapConsumer=l}}),oe=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js"(t){var e=ne().SourceMapGenerator,i=te(),n=/(\r?\n)/,r="$$$isSourceNode$$$";function s(t,e,i,n,s){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==e?null:e,this.source=null==i?null:i,this.name=null==s?null:s,this[r]=!0,null!=n&&this.add(n)}s.fromStringWithSourceMap=function(t,e,r){var a=new s,o=t.split(n),c=0,l=function(){return t()+(t()||"");function t(){return c<o.length?o[c++]:void 0}},h=1,u=0,d=null;return e.eachMapping((function(t){if(null!==d){if(!(h<t.generatedLine)){var e=(i=o[c]||"").substr(0,t.generatedColumn-u);return o[c]=i.substr(t.generatedColumn-u),u=t.generatedColumn,p(d,e),void(d=t)}p(d,l()),h++,u=0}for(;h<t.generatedLine;)a.add(l()),h++;if(u<t.generatedColumn){var i=o[c]||"";a.add(i.substr(0,t.generatedColumn)),o[c]=i.substr(t.generatedColumn),u=t.generatedColumn}d=t}),this),c<o.length&&(d&&p(d,l()),a.add(o.splice(c).join(""))),e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=i.join(r,t)),a.setSourceContent(t,n))})),a;function p(t,e){if(null===t||void 0===t.source)a.add(e);else{var n=r?i.join(r,t.source):t.source;a.add(new s(t.originalLine,t.originalColumn,n,e,t.name))}}},s.prototype.add=function(t){if(Array.isArray(t))t.forEach((function(t){this.add(t)}),this);else{if(!t[r]&&"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},s.prototype.prepend=function(t){if(Array.isArray(t))for(var e=t.length-1;e>=0;e--)this.prepend(t[e]);else{if(!t[r]&&"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},s.prototype.walk=function(t){for(var e,i=0,n=this.children.length;i<n;i++)(e=this.children[i])[r]?e.walk(t):""!==e&&t(e,{source:this.source,line:this.line,column:this.column,name:this.name})},s.prototype.join=function(t){var e,i,n=this.children.length;if(n>0){for(e=[],i=0;i<n-1;i++)e.push(this.children[i]),e.push(t);e.push(this.children[i]),this.children=e}return this},s.prototype.replaceRight=function(t,e){var i=this.children[this.children.length-1];return i[r]?i.replaceRight(t,e):"string"==typeof i?this.children[this.children.length-1]=i.replace(t,e):this.children.push("".replace(t,e)),this},s.prototype.setSourceContent=function(t,e){this.sourceContents[i.toSetString(t)]=e},s.prototype.walkSourceContents=function(t){for(var e=0,n=this.children.length;e<n;e++)this.children[e][r]&&this.children[e].walkSourceContents(t);var s=Object.keys(this.sourceContents);for(e=0,n=s.length;e<n;e++)t(i.fromSetString(s[e]),this.sourceContents[s[e]])},s.prototype.toString=function(){var t="";return this.walk((function(e){t+=e})),t},s.prototype.toStringWithSourceMap=function(t){var i={code:"",line:1,column:0},n=new e(t),r=!1,s=null,a=null,o=null,c=null;return this.walk((function(t,e){i.code+=t,null!==e.source&&null!==e.line&&null!==e.column?(s===e.source&&a===e.line&&o===e.column&&c===e.name||n.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:i.line,column:i.column},name:e.name}),s=e.source,a=e.line,o=e.column,c=e.name,r=!0):r&&(n.addMapping({generated:{line:i.line,column:i.column}}),s=null,r=!1);for(var l=0,h=t.length;l<h;l++)10===t.charCodeAt(l)?(i.line++,i.column=0,l+1===h?(s=null,r=!1):r&&n.addMapping({source:e.source,original:{line:e.line,column:e.column},generated:{line:i.line,column:i.column},name:e.name})):i.column++})),this.walkSourceContents((function(t,e){n.setSourceContent(t,e)})),{code:i.code,map:n}},t.SourceNode=s}}),ce=_t({"../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js"(t){t.SourceMapGenerator=ne().SourceMapGenerator,t.SourceMapConsumer=ae().SourceMapConsumer,t.SourceNode=oe().SourceNode}}),le=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"(t,e){t.__esModule=!0;var i,n=Ct(),r=void 0;try{"function"==typeof define&&define.amd||(i=ce(),r=i.SourceNode)}catch(t){}function s(t,e,i){if(n.isArray(t)){for(var r=[],s=0,a=t.length;s<a;s++)r.push(e.wrap(t[s],i));return r}return"boolean"==typeof t||"number"==typeof t?t+"":t}function a(t){this.srcFile=t,this.source=[]}r||((r=function(t,e,i,n){this.src="",n&&this.add(n)}).prototype={add:function(t){n.isArray(t)&&(t=t.join("")),this.src+=t},prepend:function(t){n.isArray(t)&&(t=t.join("")),this.src=t+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),a.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,i=this.source.length;e<i;e++)t(this.source[e])},empty:function(){var t=this.currentLocation||{start:{}};return new r(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 r?t:(t=s(t,this,e),new r(e.start.line,e.start.column,this.srcFile,t))},functionCall:function(t,e,i){return i=this.generateList(i),this.wrap([t,e?"."+e+"(":"(",i,")"])},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,i=[];Object.keys(t).forEach((function(n){var r=s(t[n],e);"undefined"!==r&&i.push([e.quotedString(n),":",r])}));var n=this.generateList(i);return n.prepend("{"),n.add("}"),n},generateList:function(t){for(var e=this.empty(),i=0,n=t.length;i<n;i++)i&&e.add(","),e.add(s(t[i],this));return e},generateArray:function(t){var e=this.generateList(t);return e.prepend("["),e.add("]"),e}},t.default=a,e.exports=t.default}}),he=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js"(t,e){function i(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var n=jt(),r=i(Dt()),s=Ct(),a=i(le());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=n.COMPILER_REVISION;return[t,n.REVISION_CHANGES[t]]},appendToBuffer:function(t,e,i){return s.isArray(t)||(t=[t]),t=this.source.wrap(t,e),this.environment.isSimple?["return ",t,";"]:i?["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,i,n){this.environment=t,this.options=e,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!n,this.name=this.environment.name,this.isChild=!!i,this.context=i||{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 s=t.opcodes,a=void 0,o=void 0,c=void 0,l=void 0;for(c=0,l=s.length;c<l;c++)a=s[c],this.source.currentLocation=a.loc,o=o||a.loc,this[a.opcode].apply(this,a.args);if(this.source.currentLocation=o,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new r.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;"),n?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(n);if(this.isChild)return h;var u={compiler:this.compilerInfo(),main:h};this.decorators&&(u.main_d=this.decorators,u.useDecorators=!0);var d=this.context,p=d.programs,f=d.decorators;for(c=0,l=p.length;c<l;c++)p[c]&&(u[c]=p[c],f[c]&&(u[c+"_d"]=f[c],u.useDecorators=!0));return this.environment.usePartial&&(u.usePartial=!0),this.options.data&&(u.useData=!0),this.useDepths&&(u.useDepths=!0),this.useBlockParams&&(u.useBlockParams=!0),this.options.compat&&(u.compat=!0),n?u.compilerOptions=this.options:(u.compiler=JSON.stringify(u.compiler),this.source.currentLocation={start:{line:1,column:0}},u=this.objectLiteral(u),e.srcName?(u=u.toStringWithSourceMap({file:e.destName})).map=u.map&&u.map.toString():u=u.toString()),u},preamble:function(){this.lastContext=0,this.source=new a.default(this.options.srcName),this.decorators=new a.default(this.options.srcName)},createFunctionContext:function(t){var e=this,i="",n=this.stackVars.concat(this.registers.list);n.length>0&&(i+=", "+n.join(", "));var r=0;Object.keys(this.aliases).forEach((function(t){var n=e.aliases[t];n.children&&n.referenceCount>1&&(i+=", alias"+ ++r+"="+t,n.children[0]="alias"+r)})),this.lookupPropertyFunctionIsUsed&&(i+=", "+this.lookupPropertyFunctionVarDeclaration());var s=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&s.push("blockParams"),this.useDepths&&s.push("depths");var a=this.mergeSource(i);return t?(s.push(a),Function.apply(this,s)):this.source.wrap(["function(",s.join(","),") {\n ",a,"}"])},mergeSource:function(t){var e=this.environment.isSimple,i=!this.forceBuffer,n=void 0,r=void 0,s=void 0,a=void 0;return this.source.each((function(t){t.appendToBuffer?(s?t.prepend(" + "):s=t,a=t):(s&&(r?s.prepend("buffer += "):n=!0,a.add(";"),s=a=void 0),r=!0,e||(i=!1))})),i?s?(s.prepend("return "),a.add(";")):r||this.source.push('return "";'):(t+=", buffer = "+(n?"":this.initializeBuffer()),s?(s.prepend("return buffer + "),a.add(";")):this.source.push("return buffer;")),t&&this.source.prepend("var "+t.substring(2)+(n?"":";\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"),i=[this.contextName(0)];this.setupHelperArgs(t,0,i);var n=this.popStack();i.splice(1,0,n),this.push(this.source.functionCall(e,"call",i))},ambiguousBlockValue:function(){var t=this.aliasable("container.hooks.blockHelperMissing"),e=[this.contextName(0)];this.setupHelperArgs("",0,e,!0),this.flushInline();var i=this.topStack();e.splice(1,0,i),this.pushSource(["if (!",this.lastHelper,") { ",i," = ",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,i,n){var r=0;n||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(t[r++])),this.resolvePath("context",t,r,e,i)},lookupBlockParam:function(t,e){this.useBlockParams=!0,this.push(["blockParams[",t[0],"][",t[1],"]"]),this.resolvePath("context",e,1)},lookupData:function(t,e,i){t?this.pushStackLiteral("container.data(data, "+t+")"):this.pushStackLiteral("data"),this.resolvePath("data",e,0,!0,i)},resolvePath:function(t,e,i,n,r){var s=this;if(this.options.strict||this.options.assumeObjects)this.push(function(t,e,i,n,r){var s=e.popStack(),a=i.length;t&&a--;for(;n<a;n++)s=e.nameLookup(s,i[n],r);return t?[e.aliasable("container.strict"),"(",s,", ",e.quotedString(i[n]),", ",JSON.stringify(e.source.currentLocation)," )"]:s}(this.options.strict&&r,this,e,i,t));else for(var a=e.length;i<a;i++)this.replaceStack((function(r){var a=s.nameLookup(r,e[i],t);return n?[" && ",a]:[" != null ? ",a," : ",r]}))},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 i=this.nameLookup("decorators",e,"decorator"),n=this.setupHelperArgs(e,t);this.decorators.push(["fn = ",this.decorators.functionCall(i,"",["fn","props","container",n])," || fn;"])},invokeHelper:function(t,e,i){var n=this.popStack(),r=this.setupHelper(t,e),s=[];i&&s.push(r.name),s.push(n),this.options.strict||s.push(this.aliasable("container.hooks.helperMissing"));var a=["(",this.itemsSeparatedBy(s,"||"),")"],o=this.source.functionCall(a,"call",r.callParams);this.push(o)},itemsSeparatedBy:function(t,e){var i=[];i.push(t[0]);for(var n=1;n<t.length;n++)i.push(e,t[n]);return i},invokeKnownHelper:function(t,e){var i=this.setupHelper(t,e);this.push(this.source.functionCall(i.name,"call",i.callParams))},invokeAmbiguous:function(t,e){this.useRegister("helper");var i=this.popStack();this.emptyHash();var n=this.setupHelper(0,t,e),r=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",t,"helper")," || ",i,")"];this.options.strict||(r[0]="(helper = ",r.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",r,n.paramsInit?["),(",n.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",n.callParams)," : helper))"])},invokePartial:function(t,e,i){var n=[],r=this.setupParams(e,1,n);t&&(e=this.popStack(),delete r.name),i&&(r.indent=JSON.stringify(i)),r.helpers="helpers",r.partials="partials",r.decorators="container.decorators",t?n.unshift(e):n.unshift(this.nameLookup("partials",e,"partial")),this.options.compat&&(r.depths="depths"),r=this.objectLiteral(r),n.push(r),this.push(this.source.functionCall("container.invokePartial","",n))},assignToHash:function(t){var e=this.popStack(),i=void 0,n=void 0,r=void 0;this.trackIds&&(r=this.popStack()),this.stringParams&&(n=this.popStack(),i=this.popStack());var s=this.hash;i&&(s.contexts[t]=i),n&&(s.types[t]=n),r&&(s.ids[t]=r),s.values[t]=e},pushId:function(t,e,i){"BlockParam"===t?this.pushStackLiteral("blockParams["+e[0]+"].path["+e[1]+"]"+(i?" + "+JSON.stringify("."+i):"")):"PathExpression"===t?this.pushString(e):"SubExpression"===t?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:c,compileChildren:function(t,e){for(var i=t.children,n=void 0,r=void 0,s=0,a=i.length;s<a;s++){n=i[s],r=new this.compiler;var o=this.matchExistingProgram(n);if(null==o){this.context.programs.push("");var c=this.context.programs.length;n.index=c,n.name="program"+c,this.context.programs[c]=r.compile(n,e,this.context,!this.precompile),this.context.decorators[c]=r.decorators,this.context.environments[c]=n,this.useDepths=this.useDepths||r.useDepths,this.useBlockParams=this.useBlockParams||r.useBlockParams,n.useDepths=this.useDepths,n.useBlockParams=this.useBlockParams}else n.index=o.index,n.name="program"+o.index,this.useDepths=this.useDepths||o.useDepths,this.useBlockParams=this.useBlockParams||o.useBlockParams}},matchExistingProgram:function(t){for(var e=0,i=this.context.environments.length;e<i;e++){var n=this.context.environments[e];if(n&&n.equals(t))return n}},programExpression:function(t){var e=this.environment.children[t],i=[e.index,"data",e.blockParams];return(this.useBlockParams||this.useDepths)&&i.push("blockParams"),this.useDepths&&i.push("depths"),"container.program("+i.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=["("],i=void 0,n=void 0,s=void 0;if(!this.isInline())throw new r.default("replaceStack on non-inline");var a=this.popStack(!0);if(a instanceof o)e=["(",i=[a.value]],s=!0;else{n=!0;var c=this.incrStack();e=["((",this.push(c)," = ",a,")"],i=this.topStack()}var l=t.call(this,i);s||this.popStack(),n&&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,i=t.length;e<i;e++){var n=t[e];if(n instanceof o)this.compileStack.push(n);else{var r=this.incrStack();this.pushSource([r," = ",n,";"]),this.compileStack.push(r)}}},isInline:function(){return this.inlineStack.length},popStack:function(t){var e=this.isInline(),i=(e?this.inlineStack:this.compileStack).pop();if(!t&&i instanceof o)return i.value;if(!e){if(!this.stackSlot)throw new r.default("Invalid stack pop");this.stackSlot--}return i},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,i){var n=[];return{params:n,paramsInit:this.setupHelperArgs(e,t,n,i),name:this.nameLookup("helpers",e,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(n)}},setupParams:function(t,e,i){var n={},r=[],s=[],a=[],o=!i,c=void 0;o&&(i=[]),n.name=this.quotedString(t),n.hash=this.popStack(),this.trackIds&&(n.hashIds=this.popStack()),this.stringParams&&(n.hashTypes=this.popStack(),n.hashContexts=this.popStack());var l=this.popStack(),h=this.popStack();(h||l)&&(n.fn=h||"container.noop",n.inverse=l||"container.noop");for(var u=e;u--;)c=this.popStack(),i[u]=c,this.trackIds&&(a[u]=this.popStack()),this.stringParams&&(s[u]=this.popStack(),r[u]=this.popStack());return o&&(n.args=this.source.generateArray(i)),this.trackIds&&(n.ids=this.source.generateArray(a)),this.stringParams&&(n.types=this.source.generateArray(s),n.contexts=this.source.generateArray(r)),this.options.data&&(n.data="data"),this.useBlockParams&&(n.blockParams="blockParams"),n},setupHelperArgs:function(t,e,i,n){var r=this.setupParams(t,e,i);return r.loc=JSON.stringify(this.source.currentLocation),r=this.objectLiteral(r),n?(this.useRegister("options"),i.push("options"),["options=",r]):i?(i.push(r),""):r}},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={},i=0,n=t.length;i<n;i++)e[t[i]]=!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}}),ue=_t({"../../node_modules/.pnpm/handlebars@4.7.8/node_modules/handlebars/dist/cjs/handlebars.js"(t,e){function i(t){return t&&t.__esModule?t:{default:t}}t.__esModule=!0;var n=i(Gt()),r=i(Ht()),s=$t(),a=Qt(),o=i(he()),c=i(Kt()),l=i(zt()),h=n.default.create;function u(){var t=h();return t.compile=function(e,i){return a.compile(e,i,t)},t.precompile=function(e,i){return a.precompile(e,i,t)},t.AST=r.default,t.Compiler=a.Compiler,t.JavaScriptCompiler=o.default,t.Parser=s.parser,t.parse=s.parse,t.parseWithoutProcessing=s.parseWithoutProcessing,t}var d=u();d.create=u,l.default(d),d.Visitor=c.default,d.default=d,t.default=d,e.exports=t.default}}),de=_t({"../../node_modules/.pnpm/mqtt@2.18.9/node_modules/mqtt/dist/mqtt.min.js"(t,e){!function(i){if("object"==typeof t&&void 0!==e)e.exports=i();else if("function"==typeof define&&define.amd)define([],i);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).mqtt=i()}}((function(){return function t(e,i,n){function r(a,o){if(!i[a]){if(!e[a]){var c="function"==typeof Et&&Et;if(!o&&c)return c(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[a]={exports:{}};e[a][0].call(h.exports,(function(t){return r(e[a][1][t]||t)}),h,h.exports,t,e,i,n)}return i[a].exports}for(var s="function"==typeof Et&&Et,a=0;a<n.length;a++)r(n[a]);return r}({1:[function(t,e,i){(function(i,n){(function(){var r=t("events"),s=t("./store"),a=t("end-of-stream"),o=t("mqtt-packet"),c=t("readable-stream").Writable,l=t("inherits"),h=t("reinterval"),u=t("./validations"),d=t("xtend"),p=n.setImmediate||function(t){i.nextTick(t)},f={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0};function m(t,e,i){t.emit("packetsend",e),!o.writeToStream(e,t.stream)&&i?t.stream.once("drain",i):i&&i()}function g(t,e,i){t.outgoingStore.put(e,(function(n){if(n)return i&&i(n);m(t,e,i)}))}function y(){}function w(t,e){var i,n=this;if(!(this instanceof w))return new w(t,e);for(i in this.options=e||{},f)void 0===this.options[i]?this.options[i]=f[i]:this.options[i]=e[i];this.options.clientId="string"==typeof this.options.clientId?this.options.clientId:"mqttjs_"+Math.random().toString(16).substr(2,8),this.streamBuilder=t,this.outgoingStore=this.options.outgoingStore||new s,this.incomingStore=this.options.incomingStore||new s,this.queueQoSZero=void 0===this.options.queueQoSZero||this.options.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this.nextId=Math.max(1,Math.floor(65535*Math.random())),this.outgoing={},this.on("connect",(function(){if(!this.disconnected){this.connected=!0;var t=this.outgoingStore.createStream();this.once("close",e),t.on("end",(function(){n.removeListener("close",e)})),t.on("error",(function(t){n.removeListener("close",e),n.emit("error",t)})),function e(){if(t){var i,r=t.read(1);r?n.disconnecting||n.reconnectTimer?t.destroy&&t.destroy():(i=n.outgoing[r.messageId],n.outgoing[r.messageId]=function(t,n){i&&i(t,n),e()},n._sendPacket(r)):t.once("readable",e)}}()}function e(){t.destroy(),t=null}})),this.on("close",(function(){this.connected=!1,clearTimeout(this.connackTimer)})),this.on("connect",this._setupPingTimer),this.on("connect",(function(){var t=this.queue;!function e(){var i,r=t.shift();r&&(i=r.packet,n._sendPacket(i,(function(t){r.cb&&r.cb(t),e()})))}()}));var a=!0;this.on("connect",(function(){!a&&this.options.clean&&Object.keys(this._resubscribeTopics).length>0&&(this.options.resubscribe?(this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics)):this._resubscribeTopics={}),a=!1})),this.on("close",(function(){null!==n.pingTimer&&(n.pingTimer.clear(),n.pingTimer=null)})),this.on("close",this._setupReconnect),r.EventEmitter.call(this),this._setupStream()}l(w,r.EventEmitter),w.prototype._setupStream=function(){var t,e=this,n=new c,r=o.parser(this.options),s=null,l=[];function h(){i.nextTick(u)}function u(){var t=l.shift(),i=s;t?e._handlePacket(t,h):(s=null,i())}this._clearReconnect(),this.stream=this.streamBuilder(this),r.on("packet",(function(t){l.push(t)})),n._write=function(t,e,i){s=i,r.parse(t),u()},this.stream.pipe(n),this.stream.on("error",y),a(this.stream,this.emit.bind(this,"close")),(t=Object.create(this.options)).cmd="connect",m(this,t),r.on("error",this.emit.bind(this,"error")),this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((function(){e._cleanUp(!0)}),this.options.connectTimeout)},w.prototype._handlePacket=function(t,e){switch(this.emit("packetreceive",t),t.cmd){case"publish":this._handlePublish(t,e);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(t),e();break;case"pubrel":this._handlePubrel(t,e);break;case"connack":this._handleConnack(t),e();break;case"pingresp":this._handlePingresp(t),e()}},w.prototype._checkDisconnecting=function(t){return this.disconnecting&&(t?t(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},w.prototype.publish=function(t,e,i,n){var r;"function"==typeof i&&(n=i,i=null);if(i=d({qos:0,retain:!1,dup:!1},i),this._checkDisconnecting(n))return this;switch(r={cmd:"publish",topic:t,payload:e,qos:i.qos,retain:i.retain,messageId:this._nextId(),dup:i.dup},i.qos){case 1:case 2:this.outgoing[r.messageId]=n||y,this._sendPacket(r);break;default:this._sendPacket(r,n)}return this},w.prototype.subscribe=function(){var t,e,i=Array.prototype.slice.call(arguments),n=[],r=i.shift(),s=r.resubscribe,a=i.pop()||y,o=i.pop(),c=this;if(delete r.resubscribe,"string"==typeof r&&(r=[r]),"function"!=typeof a&&(o=a,a=y),null!==(e=u.validateTopics(r)))return p(a,new Error("Invalid topic "+e)),this;if(this._checkDisconnecting(a))return this;if(o=d({qos:0},o),Array.isArray(r)?r.forEach((function(t){(c._resubscribeTopics[t]<o.qos||!c._resubscribeTopics.hasOwnProperty(t)||s)&&n.push({topic:t,qos:o.qos})})):Object.keys(r).forEach((function(t){(c._resubscribeTopics[t]<r[t]||!c._resubscribeTopics.hasOwnProperty(t)||s)&&n.push({topic:t,qos:r[t]})})),t={cmd:"subscribe",subscriptions:n,qos:1,retain:!1,dup:!1,messageId:this._nextId()},n.length){if(this.options.resubscribe){var l=[];n.forEach((function(t){c.options.reconnectPeriod>0&&(c._resubscribeTopics[t.topic]=t.qos,l.push(t.topic))})),c.messageIdToTopic[t.messageId]=l}return this.outgoing[t.messageId]=function(t,e){if(!t)for(var i=e.granted,r=0;r<i.length;r+=1)n[r].qos=i[r];a(t,n)},this._sendPacket(t),this}a(null,[])},w.prototype.unsubscribe=function(t,e){var i={cmd:"unsubscribe",qos:1,messageId:this._nextId()},n=this;return e=e||y,this._checkDisconnecting(e)||("string"==typeof t?i.unsubscriptions=[t]:"object"==typeof t&&t.length&&(i.unsubscriptions=t),this.options.resubscribe&&i.unsubscriptions.forEach((function(t){delete n._resubscribeTopics[t]})),this.outgoing[i.messageId]=e,this._sendPacket(i)),this},w.prototype.end=function(t,e){var i=this;function n(){i.disconnected=!0,i.incomingStore.close((function(){i.outgoingStore.close((function(){e&&e.apply(null,arguments),i.emit("end")}))})),i._deferredReconnect&&i._deferredReconnect()}function r(){i._cleanUp(t,p.bind(null,n))}return"function"==typeof t&&(e=t,t=!1),this.disconnecting||(this._clearReconnect(),this.disconnecting=!0,!t&&Object.keys(this.outgoing).length>0?this.once("outgoingEmpty",setTimeout.bind(null,r,10)):r()),this},w.prototype.removeOutgoingMessage=function(t){var e=this.outgoing[t];return delete this.outgoing[t],this.outgoingStore.del({messageId:t},(function(){e(new Error("Message removed"))})),this},w.prototype.reconnect=function(t){var e=this,i=function(){t?(e.options.incomingStore=t.incomingStore,e.options.outgoingStore=t.outgoingStore):(e.options.incomingStore=null,e.options.outgoingStore=null),e.incomingStore=e.options.incomingStore||new s,e.outgoingStore=e.options.outgoingStore||new s,e.disconnecting=!1,e.disconnected=!1,e._deferredReconnect=null,e._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=i:i(),this},w.prototype._reconnect=function(){this.emit("reconnect"),this._setupStream()},w.prototype._setupReconnect=function(){var t=this;!t.disconnecting&&!t.reconnectTimer&&t.options.reconnectPeriod>0&&(this.reconnecting||(this.emit("offline"),this.reconnecting=!0),t.reconnectTimer=setInterval((function(){t._reconnect()}),t.options.reconnectPeriod))},w.prototype._clearReconnect=function(){this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},w.prototype._cleanUp=function(t,e){var i;e&&this.stream.on("close",e),t?(0===this.options.reconnectPeriod&&this.options.clean&&(i=this.outgoing)&&Object.keys(i).forEach((function(t){"function"==typeof i[t]&&(i[t](new Error("Connection closed")),delete i[t])})),this.stream.destroy()):this._sendPacket({cmd:"disconnect"},p.bind(null,this.stream.end.bind(this.stream))),this.disconnecting||(this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(this.pingTimer.clear(),this.pingTimer=null),e&&!this.connected&&(this.stream.removeListener("close",e),e())},w.prototype._sendPacket=function(t,e){if(this.connected){switch(this._shiftPingInterval(),t.cmd){case"publish":break;case"pubrel":return void g(this,t,e);default:return void m(this,t,e)}switch(t.qos){case 2:case 1:g(this,t,e);break;default:m(this,t,e)}}else 0===(t.qos||0)&&this.queueQoSZero||"publish"!==t.cmd?this.queue.push({packet:t,cb:e}):t.qos>0?(e=this.outgoing[t.messageId],this.outgoingStore.put(t,(function(t){if(t)return e&&e(t)}))):e&&e(new Error("No connection to broker"))},w.prototype._setupPingTimer=function(){var t=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=h((function(){t._checkPing()}),1e3*this.options.keepalive))},w.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},w.prototype._checkPing=function(){this.pingResp?(this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):this._cleanUp(!0)},w.prototype._handlePingresp=function(){this.pingResp=!0},w.prototype._handleConnack=function(t){var e=t.returnCode;if(clearTimeout(this.connackTimer),0===e)this.reconnecting=!1,this.emit("connect",t);else if(e>0){var i=new Error("Connection refused: "+["","Unacceptable protocol version","Identifier rejected","Server unavailable","Bad username or password","Not authorized"][e]);i.code=e,this.emit("error",i)}},w.prototype._handlePublish=function(t,e){e=void 0!==e?e:y;var i=t.topic.toString(),n=t.payload,r=t.qos,s=t.messageId,a=this;switch(r){case 2:this.incomingStore.put(t,(function(t){if(t)return e(t);a._sendPacket({cmd:"pubrec",messageId:s},e)}));break;case 1:this.emit("message",i,n,t),this.handleMessage(t,(function(t){if(t)return e(t);a._sendPacket({cmd:"puback",messageId:s},e)}));break;case 0:this.emit("message",i,n,t),this.handleMessage(t,e)}},w.prototype.handleMessage=function(t,e){e()},w.prototype._handleAck=function(t){var e=t.messageId,i=t.cmd,n=null,r=this.outgoing[e],s=this;if(r){switch(i){case"pubcomp":case"puback":delete this.outgoing[e],this.outgoingStore.del(t,r);break;case"pubrec":n={cmd:"pubrel",qos:2,messageId:e},this._sendPacket(n);break;case"suback":if(delete this.outgoing[e],1===t.granted.length&&0!=(128&t.granted[0])){var a=this.messageIdToTopic[e];a&&a.forEach((function(t){delete s._resubscribeTopics[t]}))}r(null,t);break;case"unsuback":delete this.outgoing[e],r(null);break;default:s.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}},w.prototype._handlePubrel=function(t,e){e=void 0!==e?e:y;var i=t.messageId,n=this,r={cmd:"pubcomp",messageId:i};n.incomingStore.get(t,(function(i,s){i||"pubrel"===s.cmd?n._sendPacket(r,e):(n.emit("message",s.topic,s.payload,s),n.incomingStore.put(t,(function(t){if(t)return e(t);n.handleMessage(s,(function(t){if(t)return e(t);n._sendPacket(r,e)}))})))}))},w.prototype._nextId=function(){var t=this.nextId++;return 65536===this.nextId&&(this.nextId=1),t},w.prototype.getLastMessageId=function(){return 1===this.nextId?65535:this.nextId-1},e.exports=w}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./store":6,"./validations":7,_process:96,"end-of-stream":16,events:79,inherits:84,"mqtt-packet":89,"readable-stream":112,reinterval:113,xtend:165}],2:[function(t,e,i){var n=t("net");e.exports=function(t,e){var i,r;return e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",i=e.port,r=e.hostname,n.createConnection(i,r)}},{net:11}],3:[function(t,e,i){var n=t("tls");e.exports=function(t,e){var i;function r(n){e.rejectUnauthorized&&t.emit("error",n),i.end()}return e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",e.rejectUnauthorized=!1!==e.rejectUnauthorized,delete e.path,(i=n.connect(e)).on("secureConnect",(function(){e.rejectUnauthorized&&!i.authorized?i.emit("error",new Error("TLS not authorized")):i.removeListener("error",r)})),i.on("error",r),i}},{tls:11}],4:[function(t,e,i){(function(i){(function(){var n=t("websocket-stream"),r=t("url"),s=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],a="browser"===i.title;function o(t,e){var i="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";!function(t){t.hostname||(t.hostname="localhost"),t.port||("wss"===t.protocol?t.port=443:t.port=80),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={}),a||"wss"!==t.protocol||s.forEach((function(e){t.hasOwnProperty(e)&&!t.wsOptions.hasOwnProperty(e)&&(t.wsOptions[e]=t[e])}))}(e);var r=function(t,e){var i=t.protocol+"://"+t.hostname+":"+t.port+t.path;return"function"==typeof t.transformWsUrl&&(i=t.transformWsUrl(i,t,e)),i}(e,t);return n(r,[i],e.wsOptions)}e.exports=a?function(t,e){if(e.hostname||(e.hostname=e.host),!e.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");var i=r.parse(document.URL);e.hostname=i.hostname,e.port||(e.port=i.port)}return o(t,e)}:function(t,e){return o(t,e)}}).call(this)}).call(this,t("_process"))},{_process:96,url:128,"websocket-stream":162}],5:[function(t,e,i){var n=!1,r=[];function s(t){n?wx.sendSocketMessage({data:t.buffer||t}):r.push(t)}var a=t("websocket-stream");function o(t,e){var i="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";!function(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}(e);var o=function(t,e){var i="wxs"===t.protocol?"wss":"ws",n=i+"://"+t.hostname+t.path;return t.port&&80!==t.port&&443!==t.port&&(n=i+"://"+t.hostname+":"+t.port+t.path),"function"==typeof t.transformWsUrl&&(n=t.transformWsUrl(n,t,e)),n}(e,t);return a(function(t,e){var i={OPEN:1,CLOSING:2,CLOSED:3,readyState:n?1:0,send:s,close:wx.closeSocket,onopen:null,onmessage:null,onclose:null,onerror:null};return wx.connectSocket({url:t,protocols:e}),wx.onSocketOpen((function(t){i.readyState=i.OPEN,n=!0;for(var e=0;e<r.length;e++)s(r[e]);r=[],i.onopen&&i.onopen.apply(i,arguments)})),wx.onSocketMessage((function(t){i.onmessage&&i.onmessage.apply(i,arguments)})),wx.onSocketClose((function(){i.onclose&&i.onclose.apply(i,arguments),i.readyState=i.CLOSED,n=!1})),wx.onSocketError((function(){i.onerror&&i.onerror.apply(i,arguments),i.readyState=i.CLOSED,n=!1})),i}(o,[i]))}e.exports=function(t,e){if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");return o(t,e)}},{"websocket-stream":162}],6:[function(t,e,i){(function(i){(function(){var n=t("xtend"),r=t("readable-stream").Readable,s={objectMode:!0},a={clean:!0},o=t("es6-map");function c(t){if(!(this instanceof c))return new c(t);this.options=t||{},this.options=n(a,t),this._inflights=new o}c.prototype.put=function(t,e){return this._inflights.set(t.messageId,t),e&&e(),this},c.prototype.createStream=function(){var t=new r(s),e=!1,n=[],a=0;return this._inflights.forEach((function(t,e){n.push(t)})),t._read=function(){!e&&a<n.length?this.push(n[a++]):this.push(null)},t.destroy=function(){if(!e){var t=this;e=!0,i.nextTick((function(){t.emit("close")}))}},t},c.prototype.del=function(t,e){return(t=this._inflights.get(t.messageId))?(this._inflights.delete(t.messageId),e(null,t)):e&&e(new Error("missing packet")),this},c.prototype.get=function(t,e){return(t=this._inflights.get(t.messageId))?e(null,t):e&&e(new Error("missing packet")),this},c.prototype.close=function(t){this.options.clean&&(this._inflights=null),t&&t()},e.exports=c}).call(this)}).call(this,t("_process"))},{_process:96,"es6-map":64,"readable-stream":112,xtend:165}],7:[function(t,e,i){function n(t){for(var e=t.split("/"),i=0;i<e.length;i++)if("+"!==e[i]){if("#"===e[i])return i===e.length-1;if(-1!==e[i].indexOf("+")||-1!==e[i].indexOf("#"))return!1}return!0}e.exports={validateTopics:function(t){if(0===t.length)return"empty_topic_list";for(var e=0;e<t.length;e++)if(!n(t[e]))return t[e];return null}}},{}],8:[function(t,e,i){(function(i){(function(){var n=t("../client"),r=t("../store"),s=t("url"),a=t("xtend"),o={};function c(t,e){if("object"!=typeof t||e||(e=t,t=null),e=e||{},t){var i=s.parse(t,!0);if(null!=i.port&&(i.port=Number(i.port)),null===(e=a(i,e)).protocol)throw new Error("Missing protocol");e.protocol=e.protocol.replace(/:$/,"")}if(function(t){var e;t.auth&&((e=t.auth.match(/^(.+):(.+)$/))?(t.username=e[1],t.password=e[2]):t.username=t.auth)}(e),e.query&&"string"==typeof e.query.clientId&&(e.clientId=e.query.clientId),e.cert&&e.key){if(!e.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs"].indexOf(e.protocol))switch(e.protocol){case"mqtt":e.protocol="mqtts";break;case"ws":e.protocol="wss";break;case"wx":e.protocol="wxs";break;default:throw new Error('Unknown protocol for secure connection: "'+e.protocol+'"!')}}if(!o[e.protocol]){var r=-1!==["mqtts","wss"].indexOf(e.protocol);e.protocol=["mqtt","mqtts","ws","wss","wx","wxs"].filter((function(t,e){return(!r||e%2!=0)&&"function"==typeof o[t]}))[0]}if(!1===e.clean&&!e.clientId)throw new Error("Missing clientId for unclean clients");return e.protocol&&(e.defaultProtocol=e.protocol),new n((function(t){return e.servers&&(t._reconnectCount&&t._reconnectCount!==e.servers.length||(t._reconnectCount=0),e.host=e.servers[t._reconnectCount].host,e.port=e.servers[t._reconnectCount].port,e.protocol=e.servers[t._reconnectCount].protocol?e.servers[t._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,t._reconnectCount++),o[e.protocol](t,e)}),e)}"browser"!==i.title?(o.mqtt=t("./tcp"),o.tcp=t("./tcp"),o.ssl=t("./tls"),o.tls=t("./tls"),o.mqtts=t("./tls")):(o.wx=t("./wx"),o.wxs=t("./wx")),o.ws=t("./ws"),o.wss=t("./ws"),e.exports=c,e.exports.connect=c,e.exports.MqttClient=n,e.exports.Store=r}).call(this)}).call(this,t("_process"))},{"../client":1,"../store":6,"./tcp":2,"./tls":3,"./ws":4,"./wx":5,_process:96,url:128,xtend:165}],9:[function(t,e,i){i.byteLength=function(t){var e=c(t),i=e[0],n=e[1];return 3*(i+n)/4-n},i.toByteArray=function(t){var e,i,n=c(t),a=n[0],o=n[1],l=new s(function(t,e,i){return 3*(e+i)/4-i}(0,a,o)),h=0,u=o>0?a-4:a;for(i=0;i<u;i+=4)e=r[t.charCodeAt(i)]<<18|r[t.charCodeAt(i+1)]<<12|r[t.charCodeAt(i+2)]<<6|r[t.charCodeAt(i+3)],l[h++]=e>>16&255,l[h++]=e>>8&255,l[h++]=255&e;2===o&&(e=r[t.charCodeAt(i)]<<2|r[t.charCodeAt(i+1)]>>4,l[h++]=255&e);1===o&&(e=r[t.charCodeAt(i)]<<10|r[t.charCodeAt(i+1)]<<4|r[t.charCodeAt(i+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e);return l},i.fromByteArray=function(t){for(var e,i=t.length,r=i%3,s=[],a=16383,o=0,c=i-r;o<c;o+=a)s.push(l(t,o,o+a>c?c:o+a));1===r?(e=t[i-1],s.push(n[e>>2]+n[e<<4&63]+"==")):2===r&&(e=(t[i-2]<<8)+t[i-1],s.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return s.join("")};for(var n=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=a[o],r[a.charCodeAt(o)]=o;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");return-1===i&&(i=e),[i,i===e?0:4-i%4]}function l(t,e,i){for(var r,s,a=[],o=e;o<i;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),a.push(n[(s=r)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],10:[function(t,e,i){var n=t("readable-stream/duplex"),r=t("util"),s=t("safe-buffer").Buffer;function a(t){if(!(this instanceof a))return new a(t);if(this._bufs=[],this.length=0,"function"==typeof t){this._callback=t;var e=function(t){this._callback&&(this._callback(t),this._callback=null)}.bind(this);this.on("pipe",(function(t){t.on("error",e)})),this.on("unpipe",(function(t){t.removeListener("error",e)}))}else this.append(t);n.call(this)}r.inherits(a,n),a.prototype._offset=function(t){var e,i=0,n=0;if(0===t)return[0,0];for(;n<this._bufs.length;n++){if(t<(e=i+this._bufs[n].length)||n==this._bufs.length-1)return[n,t-i];i=e}},a.prototype.append=function(t){var e=0;if(s.isBuffer(t))this._appendBuffer(t);else if(Array.isArray(t))for(;e<t.length;e++)this.append(t[e]);else if(t instanceof a)for(;e<t._bufs.length;e++)this.append(t._bufs[e]);else null!=t&&("number"==typeof t&&(t=t.toString()),this._appendBuffer(s.from(t)));return this},a.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length},a.prototype._write=function(t,e,i){this._appendBuffer(t),"function"==typeof i&&i()},a.prototype._read=function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)},a.prototype.end=function(t){n.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)},a.prototype.get=function(t){return this.slice(t,t+1)[0]},a.prototype.slice=function(t,e){return"number"==typeof t&&t<0&&(t+=this.length),"number"==typeof e&&e<0&&(e+=this.length),this.copy(null,0,t,e)},a.prototype.copy=function(t,e,i,n){if(("number"!=typeof i||i<0)&&(i=0),("number"!=typeof n||n>this.length)&&(n=this.length),i>=this.length)return t||s.alloc(0);if(n<=0)return t||s.alloc(0);var r,a,o=!!t,c=this._offset(i),l=n-i,h=l,u=o&&e||0,d=c[1];if(0===i&&n==this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:s.concat(this._bufs,this.length);for(a=0;a<this._bufs.length;a++)this._bufs[a].copy(t,u),u+=this._bufs[a].length;return t}if(h<=this._bufs[c[0]].length-d)return o?this._bufs[c[0]].copy(t,e,d,d+h):this._bufs[c[0]].slice(d,d+h);for(o||(t=s.allocUnsafe(l)),a=c[0];a<this._bufs.length;a++){if(!(h>(r=this._bufs[a].length-d))){this._bufs[a].copy(t,u,d,d+h),u+=r;break}this._bufs[a].copy(t,u,d),u+=r,h-=r,d&&(d=0)}return t.length>u?t.slice(0,u):t},a.prototype.shallowSlice=function(t,e){t=t||0,e=e||this.length,t<0&&(t+=this.length),e<0&&(e+=this.length);var i=this._offset(t),n=this._offset(e),r=this._bufs.slice(i[0],n[0]+1);return 0==n[1]?r.pop():r[r.length-1]=r[r.length-1].slice(0,n[1]),0!=i[1]&&(r[0]=r[0].slice(i[1])),new a(r)},a.prototype.toString=function(t,e,i){return this.slice(e,i).toString(t)},a.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;){if(!(t>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},a.prototype.duplicate=function(){for(var t=0,e=new a;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},a.prototype.destroy=function(){this._bufs.length=0,this.length=0,this.push(null)},function(){var t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1};for(var e in t)!function(e){a.prototype[e]=function(i){return this.slice(i,i+t[e])[e](0)}}(e)}(),e.exports=a},{"readable-stream/duplex":101,"safe-buffer":114,util:133}],11:[function(t,e,i){},{}],12:[function(t,e,i){(function(e){(function(){var e=t("base64-js"),n=t("ieee754");i.Buffer=a,i.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},i.INSPECT_MAX_BYTES=50;var r=2147483647;function s(t){if(t>r)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,i){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,i)}function o(t,e,i){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var i=0|d(t,e),n=s(i),r=n.write(t,e);r!==i&&(n=n.slice(0,r));return n}(t,e);if(ArrayBuffer.isView(t))return h(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===e&&void 0===i?new Uint8Array(t):void 0===i?new Uint8Array(t,e):new Uint8Array(t,e,i);return n.__proto__=a.prototype,n}(t,e,i);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,i);var r=function(t){if(a.isBuffer(t)){var e=0|u(t.length),i=s(e);return 0===i.length||t.copy(i,0,0,e),i}if(void 0!==t.length)return"number"!=typeof t.length||U(t.length)?s(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}(t);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function l(t){return c(t),s(t<0?0:0|u(t))}function h(t){for(var e=t.length<0?0:0|u(t.length),i=s(e),n=0;n<e;n+=1)i[n]=255&t[n];return i}function u(t){if(t>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var i=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return F(t).length;default:if(r)return n?-1:V(t).length;e=(""+e).toLowerCase(),r=!0}}function p(t,e,i){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return x(this,e,i);case"utf8":case"utf-8":return C(this,e,i);case"ascii":return S(this,e,i);case"latin1":case"binary":return A(this,e,i);case"base64":return I(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function f(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function m(t,e,i,n,r){if(0===t.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),U(i=+i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:g(t,e,i,n,r);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):g(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}function g(t,e,i,n,r){var s,a=1,o=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,o/=2,c/=2,i/=2}function l(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(r){var h=-1;for(s=i;s<o;s++)if(l(t,s)===l(e,-1===h?0:s-h)){if(-1===h&&(h=s),s-h+1===c)return h*a}else-1!==h&&(s-=s-h),h=-1}else for(i+c>o&&(i=o-c),s=i;s>=0;s--){for(var u=!0,d=0;d<c;d++)if(l(t,s+d)!==l(e,d)){u=!1;break}if(u)return s}return-1}function y(t,e,i,n){i=Number(i)||0;var r=t.length-i;n?(n=Number(n))>r&&(n=r):n=r;var s=e.length;n>s/2&&(n=s/2);for(var a=0;a<n;++a){var o=parseInt(e.substr(2*a,2),16);if(U(o))return a;t[i+a]=o}return a}function w(t,e,i,n){return j(V(e,t.length-i),t,i,n)}function v(t,e,i,n){return j(function(t){for(var e=[],i=0;i<t.length;++i)e.push(255&t.charCodeAt(i));return e}(e),t,i,n)}function b(t,e,i,n){return v(t,e,i,n)}function E(t,e,i,n){return j(F(e),t,i,n)}function _(t,e,i,n){return j(function(t,e){for(var i,n,r,s=[],a=0;a<t.length&&!((e-=2)<0);++a)n=(i=t.charCodeAt(a))>>8,r=i%256,s.push(r),s.push(n);return s}(e,t.length-i),t,i,n)}function I(t,i,n){return 0===i&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(i,n))}function C(t,e,i){i=Math.min(t.length,i);for(var n=[],r=e;r<i;){var s,a,o,c,l=t[r],h=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u<=i)switch(u){case 1:l<128&&(h=l);break;case 2:128==(192&(s=t[r+1]))&&(c=(31&l)<<6|63&s)>127&&(h=c);break;case 3:s=t[r+1],a=t[r+2],128==(192&s)&&128==(192&a)&&(c=(15&l)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(h=c);break;case 4:s=t[r+1],a=t[r+2],o=t[r+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(c=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&c<1114112&&(h=c)}null===h?(h=65533,u=1):h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),r+=u}return function(t){var e=t.length;if(e<=D)return String.fromCharCode.apply(String,t);var i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=D));return i}(n)}i.kMaxLength=r,a.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(t,e,i){return o(t,e,i)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(t,e,i){return function(t,e,i){return c(t),t<=0?s(t):void 0!==e?"string"==typeof i?s(t).fill(e,i):s(t).fill(e):s(t)}(t,e,i)},a.allocUnsafe=function(t){return l(t)},a.allocUnsafeSlow=function(t){return l(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),B(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var i=t.length,n=e.length,r=0,s=Math.min(i,n);r<s;++r)if(t[r]!==e[r]){i=t[r],n=e[r];break}return i<n?-1:n<i?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var i;if(void 0===e)for(e=0,i=0;i<t.length;++i)e+=t[i].length;var n=a.allocUnsafe(e),r=0;for(i=0;i<t.length;++i){var s=t[i];if(B(s,Uint8Array)&&(s=a.from(s)),!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,r),r+=s.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)f(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)f(this,e,e+3),f(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)f(this,e,e+7),f(this,e+1,e+6),f(this,e+2,e+5),f(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?C(this,0,t):p.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",e=i.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},a.prototype.compare=function(t,e,i,n,r){if(B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),e<0||i>t.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&e>=i)return 0;if(n>=r)return-1;if(e>=i)return 1;if(this===t)return 0;for(var s=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(e>>>=0),c=Math.min(s,o),l=this.slice(n,r),h=t.slice(e,i),u=0;u<c;++u)if(l[u]!==h[u]){s=l[u],o=h[u];break}return s<o?-1:o<s?1:0},a.prototype.includes=function(t,e,i){return-1!==this.indexOf(t,e,i)},a.prototype.indexOf=function(t,e,i){return m(this,t,e,i,!0)},a.prototype.lastIndexOf=function(t,e,i){return m(this,t,e,i,!1)},a.prototype.write=function(t,e,i,n){if(void 0===e)n="utf8",i=this.length,e=0;else if(void 0===i&&"string"==typeof e)n=e,i=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-e;if((void 0===i||i>r)&&(i=r),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return y(this,t,e,i);case"utf8":case"utf-8":return w(this,t,e,i);case"ascii":return v(this,t,e,i);case"latin1":case"binary":return b(this,t,e,i);case"base64":return E(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function S(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(127&t[r]);return n}function A(t,e,i){var n="";i=Math.min(t.length,i);for(var r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}function x(t,e,i){var n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var r="",s=e;s<i;++s)r+=N(t[s]);return r}function P(t,e,i){for(var n=t.slice(e,i),r="",s=0;s<n.length;s+=2)r+=String.fromCharCode(n[s]+256*n[s+1]);return r}function T(t,e,i){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,i,n,r,s){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<s)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}function L(t,e,i,n,r,s){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function R(t,e,i,r,s){return e=+e,i>>>=0,s||L(t,0,i,4),n.write(t,e,i,r,23,4),i+4}function M(t,e,i,r,s){return e=+e,i>>>=0,s||L(t,0,i,8),n.write(t,e,i,r,52,8),i+8}a.prototype.slice=function(t,e){var i=this.length;(t=~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),(e=void 0===e?i:~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=a.prototype,n},a.prototype.readUIntLE=function(t,e,i){t>>>=0,e>>>=0,i||T(t,e,this.length);for(var n=this[t],r=1,s=0;++s<e&&(r*=256);)n+=this[t+s]*r;return n},a.prototype.readUIntBE=function(t,e,i){t>>>=0,e>>>=0,i||T(t,e,this.length);for(var n=this[t+--e],r=1;e>0&&(r*=256);)n+=this[t+--e]*r;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||T(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,i){t>>>=0,e>>>=0,i||T(t,e,this.length);for(var n=this[t],r=1,s=0;++s<e&&(r*=256);)n+=this[t+s]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,i){t>>>=0,e>>>=0,i||T(t,e,this.length);for(var n=e,r=1,s=this[t+--n];n>0&&(r*=256);)s+=this[t+--n]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*e)),s},a.prototype.readInt8=function(t,e){return t>>>=0,e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||T(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt16BE=function(t,e){t>>>=0,e||T(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||T(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||T(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||T(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||T(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,i,n){(t=+t,e>>>=0,i>>>=0,n)||O(this,t,e,i,Math.pow(2,8*i)-1,0);var r=1,s=0;for(this[e]=255&t;++s<i&&(r*=256);)this[e+s]=t/r&255;return e+i},a.prototype.writeUIntBE=function(t,e,i,n){(t=+t,e>>>=0,i>>>=0,n)||O(this,t,e,i,Math.pow(2,8*i)-1,0);var r=i-1,s=1;for(this[e+r]=255&t;--r>=0&&(s*=256);)this[e+r]=t/s&255;return e+i},a.prototype.writeUInt8=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,i,n){if(t=+t,e>>>=0,!n){var r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}var s=0,a=1,o=0;for(this[e]=255&t;++s<i&&(a*=256);)t<0&&0===o&&0!==this[e+s-1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+i},a.prototype.writeIntBE=function(t,e,i,n){if(t=+t,e>>>=0,!n){var r=Math.pow(2,8*i-1);O(this,t,e,i,r-1,-r)}var s=i-1,a=1,o=0;for(this[e+s]=255&t;--s>=0&&(a*=256);)t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+i},a.prototype.writeInt8=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,i){return t=+t,e>>>=0,i||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,i){return R(this,t,e,!0,i)},a.prototype.writeFloatBE=function(t,e,i){return R(this,t,e,!1,i)},a.prototype.writeDoubleLE=function(t,e,i){return M(this,t,e,!0,i)},a.prototype.writeDoubleBE=function(t,e,i){return M(this,t,e,!1,i)},a.prototype.copy=function(t,e,i,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-i&&(n=t.length-e+i);var r=n-i;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,i,n);else if(this===t&&i<e&&e<n)for(var s=r-1;s>=0;--s)t[s+e]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,n),e);return r},a.prototype.fill=function(t,e,i,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var r=t.charCodeAt(0);("utf8"===n&&r<128||"latin1"===n)&&(t=r)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<i)throw new RangeError("Out of range index");if(i<=e)return this;var s;if(e>>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(s=e;s<i;++s)this[s]=t;else{var o=a.isBuffer(t)?t:a.from(t,n),c=o.length;if(0===c)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<i-e;++s)this[s+e]=o[s%c]}return this};var k=/[^+/0-9A-Za-z-_]/g;function N(t){return t<16?"0"+t.toString(16):t.toString(16)}function V(t,e){var i;e=e||1/0;for(var n=t.length,r=null,s=[],a=0;a<n;++a){if((i=t.charCodeAt(a))>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&s.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(e-=3)>-1&&s.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function F(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,i,n){for(var r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function U(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":9,buffer:12,ieee754:83}],13:[function(t,e,i){(function(t){(function(){function e(t){return Object.prototype.toString.call(t)}i.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===e(t)},i.isBoolean=function(t){return"boolean"==typeof t},i.isNull=function(t){return null===t},i.isNullOrUndefined=function(t){return null==t},i.isNumber=function(t){return"number"==typeof t},i.isString=function(t){return"string"==typeof t},i.isSymbol=function(t){return"symbol"==typeof t},i.isUndefined=function(t){return void 0===t},i.isRegExp=function(t){return"[object RegExp]"===e(t)},i.isObject=function(t){return"object"==typeof t&&null!==t},i.isDate=function(t){return"[object Date]"===e(t)},i.isError=function(t){return"[object Error]"===e(t)||t instanceof Error},i.isFunction=function(t){return"function"==typeof t},i.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},i.isBuffer=t.isBuffer}).call(this)}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":85}],14:[function(t,e,i){var n,r=t("type/value/is"),s=t("type/value/ensure"),a=t("type/plain-function/ensure"),o=t("es5-ext/object/copy"),c=t("es5-ext/object/normalize-options"),l=t("es5-ext/object/map"),h=Function.prototype.bind,u=Object.defineProperty,d=Object.prototype.hasOwnProperty;n=function(t,e,i){var n,r=s(e)&&a(e.value);return delete(n=o(e)).writable,delete n.value,n.get=function(){return!i.overwriteDefinition&&d.call(this,t)?r:(e.value=h.call(r,i.resolveContext?i.resolveContext(this):this),u(this,t,e),this[t])},n},e.exports=function(t){var e=c(arguments[1]);return r(e.resolveContext)&&a(e.resolveContext),l(t,(function(t,i){return n(i,t,e)}))}},{"es5-ext/object/copy":37,"es5-ext/object/map":45,"es5-ext/object/normalize-options":46,"type/plain-function/ensure":122,"type/value/ensure":126,"type/value/is":127}],15:[function(t,e,i){var n=t("type/value/is"),r=t("type/plain-function/is"),s=t("es5-ext/object/assign"),a=t("es5-ext/object/normalize-options"),o=t("es5-ext/string/#/contains"),c=e.exports=function(t,e){var i,r,c,l,h;return arguments.length<2||"string"!=typeof t?(l=e,e=t,t=null):l=arguments[2],n(t)?(i=o.call(t,"c"),r=o.call(t,"e"),c=o.call(t,"w")):(i=c=!0,r=!1),h={value:e,configurable:i,enumerable:r,writable:c},l?s(a(l),h):h};c.gs=function(t,e,i){var c,l,h,u;return"string"!=typeof t?(h=i,i=e,e=t,t=null):h=arguments[3],n(e)?r(e)?n(i)?r(i)||(h=i,i=void 0):i=void 0:(h=e,e=i=void 0):e=void 0,n(t)?(c=o.call(t,"c"),l=o.call(t,"e")):(c=!0,l=!1),u={get:e,set:i,configurable:c,enumerable:l},h?s(a(h),u):u}},{"es5-ext/object/assign":34,"es5-ext/object/normalize-options":46,"es5-ext/string/#/contains":53,"type/plain-function/is":123,"type/value/is":127}],16:[function(t,e,i){(function(i){(function(){var n=t("once"),r=function(){},s=function(t,e,a){if("function"==typeof e)return s(t,null,e);e||(e={}),a=n(a||r);var o=t._writableState,c=t._readableState,l=e.readable||!1!==e.readable&&t.readable,h=e.writable||!1!==e.writable&&t.writable,u=!1,d=function(){t.writable||p()},p=function(){h=!1,l||a.call(t)},f=function(){l=!1,h||a.call(t)},m=function(e){a.call(t,e?new Error("exited with error code: "+e):null)},g=function(e){a.call(t,e)},y=function(){i.nextTick(w)},w=function(){if(!u)return(!l||c&&c.ended&&!c.destroyed)&&(!h||o&&o.ended&&!o.destroyed)?void 0:a.call(t,new Error("premature close"))},v=function(){t.req.on("finish",p)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(t)?h&&!o&&(t.on("end",d),t.on("close",d)):(t.on("complete",p),t.on("abort",y),t.req?v():t.on("request",v)),function(t){return t.stdio&&Array.isArray(t.stdio)&&3===t.stdio.length}(t)&&t.on("exit",m),t.on("end",f),t.on("finish",p),!1!==e.error&&t.on("error",g),t.on("close",y),function(){u=!0,t.removeListener("complete",p),t.removeListener("abort",y),t.removeListener("request",v),t.req&&t.req.removeListener("finish",p),t.removeListener("end",d),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("exit",m),t.removeListener("end",f),t.removeListener("error",g),t.removeListener("close",y)}};e.exports=s}).call(this)}).call(this,t("_process"))},{_process:96,once:94}],17:[function(t,e,i){var n=t("../../object/valid-value");e.exports=function(){return n(this).length=0,this}},{"../../object/valid-value":52}],18:[function(t,e,i){var n=t("../../number/is-nan"),r=t("../../number/to-pos-integer"),s=t("../../object/valid-value"),a=Array.prototype.indexOf,o=Object.prototype.hasOwnProperty,c=Math.abs,l=Math.floor;e.exports=function(t){var e,i,h,u;if(!n(t))return a.apply(this,arguments);for(i=r(s(this).length),h=arguments[1],e=h=isNaN(h)?0:h>=0?l(h):r(this.length)-l(c(h));e<i;++e)if(o.call(this,e)&&(u=this[e],n(u)))return e;return-1}},{"../../number/is-nan":28,"../../number/to-pos-integer":32,"../../object/valid-value":52}],19:[function(t,e,i){e.exports=t("./is-implemented")()?Array.from:t("./shim")},{"./is-implemented":20,"./shim":21}],20:[function(t,e,i){e.exports=function(){var t,e,i=Array.from;return"function"==typeof i&&(e=i(t=["raz","dwa"]),Boolean(e&&e!==t&&"dwa"===e[1]))}},{}],21:[function(t,e,i){var n=t("es6-symbol").iterator,r=t("../../function/is-arguments"),s=t("../../function/is-function"),a=t("../../number/to-pos-integer"),o=t("../../object/valid-callable"),c=t("../../object/valid-value"),l=t("../../object/is-value"),h=t("../../string/is-string"),u=Array.isArray,d=Function.prototype.call,p={configurable:!0,enumerable:!0,writable:!0,value:null},f=Object.defineProperty;e.exports=function(t){var e,i,m,g,y,w,v,b,E,_,I=arguments[1],C=arguments[2];if(t=Object(c(t)),l(I)&&o(I),this&&this!==Array&&s(this))e=this;else{if(!I){if(r(t))return 1!==(y=t.length)?Array.apply(null,t):((g=new Array(1))[0]=t[0],g);if(u(t)){for(g=new Array(y=t.length),i=0;i<y;++i)g[i]=t[i];return g}}g=[]}if(!u(t))if(void 0!==(E=t[n])){for(v=o(E).call(t),e&&(g=new e),b=v.next(),i=0;!b.done;)_=I?d.call(I,C,b.value,i):b.value,e?(p.value=_,f(g,i,p)):g[i]=_,b=v.next(),++i;y=i}else if(h(t)){for(y=t.length,e&&(g=new e),i=0,m=0;i<y;++i)_=t[i],i+1<y&&(w=_.charCodeAt(0))>=55296&&w<=56319&&(_+=t[++i]),_=I?d.call(I,C,_,m):_,e?(p.value=_,f(g,m,p)):g[m]=_,++m;y=m}if(void 0===y)for(y=a(t.length),e&&(g=new e(y)),i=0;i<y;++i)_=I?d.call(I,C,t[i],i):t[i],e?(p.value=_,f(g,i,p)):g[i]=_;return e&&(p.value=null,g.length=y),g}},{"../../function/is-arguments":22,"../../function/is-function":23,"../../number/to-pos-integer":32,"../../object/is-value":41,"../../object/valid-callable":51,"../../object/valid-value":52,"../../string/is-string":56,"es6-symbol":70}],22:[function(t,e,i){var n=Object.prototype.toString,r=n.call(function(){return arguments}());e.exports=function(t){return n.call(t)===r}},{}],23:[function(t,e,i){var n=Object.prototype.toString,r=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);e.exports=function(t){return"function"==typeof t&&r(n.call(t))}},{}],24:[function(t,e,i){e.exports=function(){}},{}],25:[function(t,e,i){e.exports=t("./is-implemented")()?Math.sign:t("./shim")},{"./is-implemented":26,"./shim":27}],26:[function(t,e,i){e.exports=function(){var t=Math.sign;return"function"==typeof t&&(1===t(10)&&-1===t(-20))}},{}],27:[function(t,e,i){e.exports=function(t){return t=Number(t),isNaN(t)||0===t?t:t>0?1:-1}},{}],28:[function(t,e,i){e.exports=t("./is-implemented")()?Number.isNaN:t("./shim")},{"./is-implemented":29,"./shim":30}],29:[function(t,e,i){e.exports=function(){var t=Number.isNaN;return"function"==typeof t&&(!t({})&&t(NaN)&&!t(34))}},{}],30:[function(t,e,i){e.exports=function(t){return t!=t}},{}],31:[function(t,e,i){var n=t("../math/sign"),r=Math.abs,s=Math.floor;e.exports=function(t){return isNaN(t)?0:0!==(t=Number(t))&&isFinite(t)?n(t)*s(r(t)):t}},{"../math/sign":25}],32:[function(t,e,i){var n=t("./to-integer"),r=Math.max;e.exports=function(t){return r(0,n(t))}},{"./to-integer":31}],33:[function(t,e,i){var n=t("./valid-callable"),r=t("./valid-value"),s=Function.prototype.bind,a=Function.prototype.call,o=Object.keys,c=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(i,l){var h,u=arguments[2],d=arguments[3];return i=Object(r(i)),n(l),h=o(i),d&&h.sort("function"==typeof d?s.call(d,i):void 0),"function"!=typeof t&&(t=h[t]),a.call(t,h,(function(t,n){return c.call(i,t)?a.call(l,u,i[t],t,i,n):e}))}}},{"./valid-callable":51,"./valid-value":52}],34:[function(t,e,i){e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":35,"./shim":36}],35:[function(t,e,i){e.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],36:[function(t,e,i){var n=t("../keys"),r=t("../valid-value"),s=Math.max;e.exports=function(t,e){var i,a,o,c=s(arguments.length,2);for(t=Object(r(t)),o=function(n){try{t[n]=e[n]}catch(t){i||(i=t)}},a=1;a<c;++a)n(e=arguments[a]).forEach(o);if(void 0!==i)throw i;return t}},{"../keys":42,"../valid-value":52}],37:[function(t,e,i){var n=t("../array/from"),r=t("./assign"),s=t("./valid-value");e.exports=function(t){var e=Object(s(t)),i=arguments[1],a=Object(arguments[2]);if(e!==t&&!i)return e;var o={};return i?n(i,(function(e){(a.ensure||e in t)&&(o[e]=t[e])})):r(o,t),o}},{"../array/from":19,"./assign":34,"./valid-value":52}],38:[function(t,e,i){var n,r,s,a,o=Object.create;t("./set-prototype-of/is-implemented")()||(n=t("./set-prototype-of/shim")),e.exports=n?1!==n.level?o:(r={},s={},a={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(t){s[t]="__proto__"!==t?a:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(r,s),Object.defineProperty(n,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:r}),function(t,e){return o(null===t?r:t,e)}):o},{"./set-prototype-of/is-implemented":49,"./set-prototype-of/shim":50}],39:[function(t,e,i){e.exports=t("./_iterate")("forEach")},{"./_iterate":33}],40:[function(t,e,i){var n=t("./is-value"),r={function:!0,object:!0};e.exports=function(t){return n(t)&&r[typeof t]||!1}},{"./is-value":41}],41:[function(t,e,i){var n=t("../function/noop")();e.exports=function(t){return t!==n&&null!==t}},{"../function/noop":24}],42:[function(t,e,i){e.exports=t("./is-implemented")()?Object.keys:t("./shim")},{"./is-implemented":43,"./shim":44}],43:[function(t,e,i){e.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},{}],44:[function(t,e,i){var n=t("../is-value"),r=Object.keys;e.exports=function(t){return r(n(t)?Object(t):t)}},{"../is-value":41}],45:[function(t,e,i){var n=t("./valid-callable"),r=t("./for-each"),s=Function.prototype.call;e.exports=function(t,e){var i={},a=arguments[2];return n(e),r(t,(function(t,n,r,o){i[n]=s.call(e,a,t,n,r,o)})),i}},{"./for-each":39,"./valid-callable":51}],46:[function(t,e,i){var n=t("./is-value"),r=Array.prototype.forEach,s=Object.create;e.exports=function(t){var e=s(null);return r.call(arguments,(function(t){n(t)&&function(t,e){var i;for(i in t)e[i]=t[i]}(Object(t),e)})),e}},{"./is-value":41}],47:[function(t,e,i){var n=Array.prototype.forEach,r=Object.create;e.exports=function(t){var e=r(null);return n.call(arguments,(function(t){e[t]=!0})),e}},{}],48:[function(t,e,i){e.exports=t("./is-implemented")()?Object.setPrototypeOf:t("./shim")},{"./is-implemented":49,"./shim":50}],49:[function(t,e,i){var n=Object.create,r=Object.getPrototypeOf,s={};e.exports=function(){var t=Object.setPrototypeOf;return"function"==typeof t&&r(t((arguments[0]||n)(null),s))===s}},{}],50:[function(t,e,i){var n,r,s,a,o=t("../is-object"),c=t("../valid-value"),l=Object.prototype.isPrototypeOf,h=Object.defineProperty,u={configurable:!0,enumerable:!1,writable:!0,value:void 0};n=function(t,e){if(c(t),null===e||o(e))return t;throw new TypeError("Prototype must be null or an object")},e.exports=(r=function(){var t,e=Object.create(null),i={},n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__");if(n){try{(t=n.set).call(e,i)}catch(t){}if(Object.getPrototypeOf(e)===i)return{set:t,level:2}}return e.__proto__=i,Object.getPrototypeOf(e)===i?{level:2}:((e={}).__proto__=i,Object.getPrototypeOf(e)===i&&{level:1})}(),r?(2===r.level?r.set?(a=r.set,s=function(t,e){return a.call(n(t,e),e),t}):s=function(t,e){return n(t,e).__proto__=e,t}:s=function t(e,i){var r;return n(e,i),(r=l.call(t.nullPolyfill,e))&&delete t.nullPolyfill.__proto__,null===i&&(i=t.nullPolyfill),e.__proto__=i,r&&h(t.nullPolyfill,"__proto__",u),e},Object.defineProperty(s,"level",{configurable:!1,enumerable:!1,writable:!1,value:r.level})):null),t("../create")},{"../create":38,"../is-object":40,"../valid-value":52}],51:[function(t,e,i){e.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},{}],52:[function(t,e,i){var n=t("./is-value");e.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},{"./is-value":41}],53:[function(t,e,i){e.exports=t("./is-implemented")()?String.prototype.contains:t("./shim")},{"./is-implemented":54,"./shim":55}],54:[function(t,e,i){var n="razdwatrzy";e.exports=function(){return"function"==typeof n.contains&&(!0===n.contains("dwa")&&!1===n.contains("foo"))}},{}],55:[function(t,e,i){var n=String.prototype.indexOf;e.exports=function(t){return n.call(this,t,arguments[1])>-1}},{}],56:[function(t,e,i){var n=Object.prototype.toString,r=n.call("");e.exports=function(t){return"string"==typeof t||t&&"object"==typeof t&&(t instanceof String||n.call(t)===r)||!1}},{}],57:[function(t,e,i){var n,r=t("es5-ext/object/set-prototype-of"),s=t("es5-ext/string/#/contains"),a=t("d"),o=t("es6-symbol"),c=t("./"),l=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");c.call(this,t),e=e?s.call(e,"key+value")?"key+value":s.call(e,"key")?"key":"value":"value",l(this,"__kind__",a("",e))},r&&r(n,c),delete n.prototype.constructor,n.prototype=Object.create(c.prototype,{_resolve:a((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),l(n.prototype,o.toStringTag,a("c","Array Iterator"))},{"./":60,d:15,"es5-ext/object/set-prototype-of":48,"es5-ext/string/#/contains":53,"es6-symbol":70}],58:[function(t,e,i){var n=t("es5-ext/function/is-arguments"),r=t("es5-ext/object/valid-callable"),s=t("es5-ext/string/is-string"),a=t("./get"),o=Array.isArray,c=Function.prototype.call,l=Array.prototype.some;e.exports=function(t,e){var i,h,u,d,p,f,m,g,y=arguments[2];if(o(t)||n(t)?i="array":s(t)?i="string":t=a(t),r(e),u=function(){d=!0},"array"!==i)if("string"!==i)for(h=t.next();!h.done;){if(c.call(e,y,h.value,u),d)return;h=t.next()}else for(f=t.length,p=0;p<f&&(m=t[p],p+1<f&&(g=m.charCodeAt(0))>=55296&&g<=56319&&(m+=t[++p]),c.call(e,y,m,u),!d);++p);else l.call(t,(function(t){return c.call(e,y,t,u),d}))}},{"./get":59,"es5-ext/function/is-arguments":22,"es5-ext/object/valid-callable":51,"es5-ext/string/is-string":56}],59:[function(t,e,i){var n=t("es5-ext/function/is-arguments"),r=t("es5-ext/string/is-string"),s=t("./array"),a=t("./string"),o=t("./valid-iterable"),c=t("es6-symbol").iterator;e.exports=function(t){return"function"==typeof o(t)[c]?t[c]():n(t)?new s(t):r(t)?new a(t):new s(t)}},{"./array":57,"./string":62,"./valid-iterable":63,"es5-ext/function/is-arguments":22,"es5-ext/string/is-string":56,"es6-symbol":70}],60:[function(t,e,i){var n,r=t("es5-ext/array/#/clear"),s=t("es5-ext/object/assign"),a=t("es5-ext/object/valid-callable"),o=t("es5-ext/object/valid-value"),c=t("d"),l=t("d/auto-bind"),h=t("es6-symbol"),u=Object.defineProperty,d=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");d(this,{__list__:c("w",o(t)),__context__:c("w",e),__nextIndex__:c("w",0)}),e&&(a(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,d(n.prototype,s({_next:c((function(){var t;if(this.__list__)return this.__redo__&&void 0!==(t=this.__redo__.shift())?t:this.__nextIndex__<this.__list__.length?this.__nextIndex__++:void this._unBind()})),next:c((function(){return this._createResult(this._next())})),_createResult:c((function(t){return void 0===t?{done:!0,value:void 0}:{done:!1,value:this._resolve(t)}})),_resolve:c((function(t){return this.__list__[t]})),_unBind:c((function(){this.__list__=null,delete this.__redo__,this.__context__&&(this.__context__.off("_add",this._onAdd),this.__context__.off("_delete",this._onDelete),this.__context__.off("_clear",this._onClear),this.__context__=null)})),toString:c((function(){return"[object "+(this[h.toStringTag]||"Object")+"]"}))},l({_onAdd:c((function(t){t>=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,i){e>=t&&(this.__redo__[i]=++e)}),this),this.__redo__.push(t)):u(this,"__redo__",c("c",[t])))})),_onDelete:c((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(-1!==(e=this.__redo__.indexOf(t))&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,i){e>t&&(this.__redo__[i]=--e)}),this)))})),_onClear:c((function(){this.__redo__&&r.call(this.__redo__),this.__nextIndex__=0}))}))),u(n.prototype,h.iterator,c((function(){return this})))},{d:15,"d/auto-bind":14,"es5-ext/array/#/clear":17,"es5-ext/object/assign":34,"es5-ext/object/valid-callable":51,"es5-ext/object/valid-value":52,"es6-symbol":70}],61:[function(t,e,i){var n=t("es5-ext/function/is-arguments"),r=t("es5-ext/object/is-value"),s=t("es5-ext/string/is-string"),a=t("es6-symbol").iterator,o=Array.isArray;e.exports=function(t){return!!r(t)&&(!!o(t)||(!!s(t)||(!!n(t)||"function"==typeof t[a])))}},{"es5-ext/function/is-arguments":22,"es5-ext/object/is-value":41,"es5-ext/string/is-string":56,"es6-symbol":70}],62:[function(t,e,i){var n,r=t("es5-ext/object/set-prototype-of"),s=t("d"),a=t("es6-symbol"),o=t("./"),c=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),o.call(this,t),c(this,"__length__",s("",t.length))},r&&r(n,o),delete n.prototype.constructor,n.prototype=Object.create(o.prototype,{_next:s((function(){if(this.__list__)return this.__nextIndex__<this.__length__?this.__nextIndex__++:void this._unBind()})),_resolve:s((function(t){var e,i=this.__list__[t];return this.__nextIndex__===this.__length__?i:(e=i.charCodeAt(0))>=55296&&e<=56319?i+this.__list__[this.__nextIndex__++]:i}))}),c(n.prototype,a.toStringTag,s("c","String Iterator"))},{"./":60,d:15,"es5-ext/object/set-prototype-of":48,"es6-symbol":70}],63:[function(t,e,i){var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":61}],64:[function(t,e,i){e.exports=t("./is-implemented")()?Map:t("./polyfill")},{"./is-implemented":65,"./polyfill":69}],65:[function(t,e,i){e.exports=function(){var t,e;if("function"!=typeof Map)return!1;try{t=new Map([["raz","one"],["dwa","two"],["trzy","three"]])}catch(t){return!1}return"[object Map]"===String(t)&&(3===t.size&&("function"==typeof t.clear&&("function"==typeof t.delete&&("function"==typeof t.entries&&("function"==typeof t.forEach&&("function"==typeof t.get&&("function"==typeof t.has&&("function"==typeof t.keys&&("function"==typeof t.set&&("function"==typeof t.values&&(!1===(e=t.entries().next()).done&&(!!e.value&&("raz"===e.value[0]&&"one"===e.value[1])))))))))))))}},{}],66:[function(t,e,i){e.exports="undefined"!=typeof Map&&"[object Map]"===Object.prototype.toString.call(new Map)},{}],67:[function(t,e,i){e.exports=t("es5-ext/object/primitive-set")("key","value","key+value")},{"es5-ext/object/primitive-set":47}],68:[function(t,e,i){var n,r=t("es5-ext/object/set-prototype-of"),s=t("d"),a=t("es6-iterator"),o=t("es6-symbol").toStringTag,c=t("./iterator-kinds"),l=Object.defineProperties,h=a.prototype._unBind;n=e.exports=function(t,e){if(!(this instanceof n))return new n(t,e);a.call(this,t.__mapKeysData__,t),e&&c[e]||(e="key+value"),l(this,{__kind__:s("",e),__values__:s("w",t.__mapValuesData__)})},r&&r(n,a),n.prototype=Object.create(a.prototype,{constructor:s(n),_resolve:s((function(t){return"value"===this.__kind__?this.__values__[t]:"key"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__values__[t]]})),_unBind:s((function(){this.__values__=null,h.call(this)})),toString:s((function(){return"[object Map Iterator]"}))}),Object.defineProperty(n.prototype,o,s("c","Map Iterator"))},{"./iterator-kinds":67,d:15,"es5-ext/object/set-prototype-of":48,"es6-iterator":60,"es6-symbol":70}],69:[function(t,e,i){var n,r=t("es5-ext/array/#/clear"),s=t("es5-ext/array/#/e-index-of"),a=t("es5-ext/object/set-prototype-of"),o=t("es5-ext/object/valid-callable"),c=t("es5-ext/object/valid-value"),l=t("d"),h=t("event-emitter"),u=t("es6-symbol"),d=t("es6-iterator/valid-iterable"),p=t("es6-iterator/for-of"),f=t("./lib/iterator"),m=t("./is-native-implemented"),g=Function.prototype.call,y=Object.defineProperties,w=Object.getPrototypeOf;e.exports=n=function(){var t,e,i,r=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return i=m&&a&&Map!==n?a(new Map,w(this)):this,null!=r&&d(r),y(i,{__mapKeysData__:l("c",t=[]),__mapValuesData__:l("c",e=[])}),r?(p(r,(function(i){var n=c(i)[0];i=i[1],-1===s.call(t,n)&&(t.push(n),e.push(i))}),i),i):i},m&&(a&&a(n,Map),n.prototype=Object.create(Map.prototype,{constructor:l(n)})),h(y(n.prototype,{clear:l((function(){this.__mapKeysData__.length&&(r.call(this.__mapKeysData__),r.call(this.__mapValuesData__),this.emit("_clear"))})),delete:l((function(t){var e=s.call(this.__mapKeysData__,t);return-1!==e&&(this.__mapKeysData__.splice(e,1),this.__mapValuesData__.splice(e,1),this.emit("_delete",e,t),!0)})),entries:l((function(){return new f(this,"key+value")})),forEach:l((function(t){var e,i,n=arguments[1];for(o(t),i=(e=this.entries())._next();void 0!==i;)g.call(t,n,this.__mapValuesData__[i],this.__mapKeysData__[i],this),i=e._next()})),get:l((function(t){var e=s.call(this.__mapKeysData__,t);if(-1!==e)return this.__mapValuesData__[e]})),has:l((function(t){return-1!==s.call(this.__mapKeysData__,t)})),keys:l((function(){return new f(this,"key")})),set:l((function(t,e){var i,n=s.call(this.__mapKeysData__,t);return-1===n&&(n=this.__mapKeysData__.push(t)-1,i=!0),this.__mapValuesData__[n]=e,i&&this.emit("_add",n,t),this})),size:l.gs((function(){return this.__mapKeysData__.length})),values:l((function(){return new f(this,"value")})),toString:l((function(){return"[object Map]"}))})),Object.defineProperty(n.prototype,u.iterator,l((function(){return this.entries()}))),Object.defineProperty(n.prototype,u.toStringTag,l("c","Map"))},{"./is-native-implemented":66,"./lib/iterator":68,d:15,"es5-ext/array/#/clear":17,"es5-ext/array/#/e-index-of":18,"es5-ext/object/set-prototype-of":48,"es5-ext/object/valid-callable":51,"es5-ext/object/valid-value":52,"es6-iterator/for-of":58,"es6-iterator/valid-iterable":63,"es6-symbol":70,"event-emitter":78}],70:[function(t,e,i){e.exports=t("./is-implemented")()?t("ext/global-this").Symbol:t("./polyfill")},{"./is-implemented":71,"./polyfill":76,"ext/global-this":81}],71:[function(t,e,i){var n=t("ext/global-this"),r={object:!0,symbol:!0};e.exports=function(){var t,e=n.Symbol;if("function"!=typeof e)return!1;t=e("test symbol");try{String(t)}catch(t){return!1}return!!r[typeof e.iterator]&&(!!r[typeof e.toPrimitive]&&!!r[typeof e.toStringTag])}},{"ext/global-this":81}],72:[function(t,e,i){e.exports=function(t){return!!t&&("symbol"==typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},{}],73:[function(t,e,i){var n=t("d"),r=Object.create,s=Object.defineProperty,a=Object.prototype,o=r(null);e.exports=function(t){for(var e,i,r=0;o[t+(r||"")];)++r;return o[t+=r||""]=!0,s(a,e="@@"+t,n.gs(null,(function(t){i||(i=!0,s(this,e,n(t)),i=!1)}))),e}},{d:15}],74:[function(t,e,i){var n=t("d"),r=t("ext/global-this").Symbol;e.exports=function(t){return Object.defineProperties(t,{hasInstance:n("",r&&r.hasInstance||t("hasInstance")),isConcatSpreadable:n("",r&&r.isConcatSpreadable||t("isConcatSpreadable")),iterator:n("",r&&r.iterator||t("iterator")),match:n("",r&&r.match||t("match")),replace:n("",r&&r.replace||t("replace")),search:n("",r&&r.search||t("search")),species:n("",r&&r.species||t("species")),split:n("",r&&r.split||t("split")),toPrimitive:n("",r&&r.toPrimitive||t("toPrimitive")),toStringTag:n("",r&&r.toStringTag||t("toStringTag")),unscopables:n("",r&&r.unscopables||t("unscopables"))})}},{d:15,"ext/global-this":81}],75:[function(t,e,i){var n=t("d"),r=t("../../../validate-symbol"),s=Object.create(null);e.exports=function(t){return Object.defineProperties(t,{for:n((function(e){return s[e]?s[e]:s[e]=t(String(e))})),keyFor:n((function(t){var e;for(e in r(t),s)if(s[e]===t)return e}))})}},{"../../../validate-symbol":77,d:15}],76:[function(t,e,i){var n,r,s,a=t("d"),o=t("./validate-symbol"),c=t("ext/global-this").Symbol,l=t("./lib/private/generate-name"),h=t("./lib/private/setup/standard-symbols"),u=t("./lib/private/setup/symbol-registry"),d=Object.create,p=Object.defineProperties,f=Object.defineProperty;if("function"==typeof c)try{String(c()),s=!0}catch(t){}else c=null;r=function(t){if(this instanceof r)throw new TypeError("Symbol is not a constructor");return n(t)},e.exports=n=function t(e){var i;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?c(e):(i=d(r.prototype),e=void 0===e?"":String(e),p(i,{__description__:a("",e),__name__:a("",l(e))}))},h(n),u(n),p(r.prototype,{constructor:a(n),toString:a("",(function(){return this.__name__}))}),p(n.prototype,{toString:a((function(){return"Symbol ("+o(this).__description__+")"})),valueOf:a((function(){return o(this)}))}),f(n.prototype,n.toPrimitive,a("",(function(){var t=o(this);return"symbol"==typeof t?t:t.toString()}))),f(n.prototype,n.toStringTag,a("c","Symbol")),f(r.prototype,n.toStringTag,a("c",n.prototype[n.toStringTag])),f(r.prototype,n.toPrimitive,a("c",n.prototype[n.toPrimitive]))},{"./lib/private/generate-name":73,"./lib/private/setup/standard-symbols":74,"./lib/private/setup/symbol-registry":75,"./validate-symbol":77,d:15,"ext/global-this":81}],77:[function(t,e,i){var n=t("./is-symbol");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},{"./is-symbol":72}],78:[function(t,e,i){var n,r,s,a,o,c,l,h=t("d"),u=t("es5-ext/object/valid-callable"),d=Function.prototype.apply,p=Function.prototype.call,f=Object.create,m=Object.defineProperty,g=Object.defineProperties,y=Object.prototype.hasOwnProperty,w={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var i,r;return u(e),r=this,n.call(this,t,i=function(){s.call(r,t,i),d.call(e,this,arguments)}),i.__eeOnceListener__=e,this},a=function(t){var e,i,n,r,s;if(y.call(this,"__ee__")&&(r=this.__ee__[t]))if("object"==typeof r){for(i=arguments.length,s=new Array(i-1),e=1;e<i;++e)s[e-1]=arguments[e];for(r=r.slice(),e=0;n=r[e];++e)d.call(n,this,s)}else switch(arguments.length){case 1:p.call(r,this);break;case 2:p.call(r,this,arguments[1]);break;case 3:p.call(r,this,arguments[1],arguments[2]);break;default:for(i=arguments.length,s=new Array(i-1),e=1;e<i;++e)s[e-1]=arguments[e];d.call(r,this,s)}},o={on:n=function(t,e){var i;return u(e),y.call(this,"__ee__")?i=this.__ee__:(i=w.value=f(null),m(this,"__ee__",w),w.value=null),i[t]?"object"==typeof i[t]?i[t].push(e):i[t]=[i[t],e]:i[t]=e,this},once:r,off:s=function(t,e){var i,n,r,s;if(u(e),!y.call(this,"__ee__"))return this;if(!(i=this.__ee__)[t])return this;if("object"==typeof(n=i[t]))for(s=0;r=n[s];++s)r!==e&&r.__eeOnceListener__!==e||(2===n.length?i[t]=n[s?0:1]:n.splice(s,1));else n!==e&&n.__eeOnceListener__!==e||delete i[t];return this},emit:a},c={on:h(n),once:h(r),off:h(s),emit:h(a)},l=g({},c),e.exports=i=function(t){return null==t?f(l):g(Object(t),c)},i.methods=o},{d:15,"es5-ext/object/valid-callable":51}],79:[function(t,e,i){var n=Object.create||function(t){var e=function(){};return e.prototype=t,new e},r=Object.keys||function(t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e);return e},s=Function.prototype.bind||function(t){var e=this;return function(){return e.apply(t,arguments)}};function a(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=n(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}e.exports=a,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._maxListeners=void 0;var o,c=10;try{var l={};Object.defineProperty&&Object.defineProperty(l,"x",{value:0}),o=0===l.x}catch(t){o=!1}function h(t){return void 0===t._maxListeners?a.defaultMaxListeners:t._maxListeners}function u(t,e,i,r){var s,a,o;if("function"!=typeof i)throw new TypeError('"listener" argument must be a function');if((a=t._events)?(a.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),a=t._events),o=a[e]):(a=t._events=n(null),t._eventsCount=0),o){if("function"==typeof o?o=a[e]=r?[i,o]:[o,i]:r?o.unshift(i):o.push(i),!o.warned&&(s=h(t))&&s>0&&o.length>s){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=o.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",c.name,c.message)}}else o=a[e]=i,++t._eventsCount;return t}function d(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e<t.length;++e)t[e]=arguments[e];this.listener.apply(this.target,t)}}function p(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=s.call(d,n);return r.listener=i,n.wrapFn=r,r}function f(t,e,i){var n=t._events;if(!n)return[];var r=n[e];return r?"function"==typeof r?i?[r.listener||r]:[r]:i?function(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}(r):g(r,r.length):[]}function m(t){var e=this._events;if(e){var i=e[t];if("function"==typeof i)return 1;if(i)return i.length}return 0}function g(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}o?Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t||t<0||t!=t)throw new TypeError('"defaultMaxListeners" must be a positive number');c=t}}):a.defaultMaxListeners=c,a.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this},a.prototype.getMaxListeners=function(){return h(this)},a.prototype.emit=function(t){var e,i,n,r,s,a,o="error"===t;if(a=this._events)o=o&&null==a.error;else if(!o)return!1;if(o){if(arguments.length>1&&(e=arguments[1]),e instanceof Error)throw e;var c=new Error('Unhandled "error" event. ('+e+")");throw c.context=e,c}if(!(i=a[t]))return!1;var l="function"==typeof i;switch(n=arguments.length){case 1:!function(t,e,i){if(e)t.call(i);else for(var n=t.length,r=g(t,n),s=0;s<n;++s)r[s].call(i)}(i,l,this);break;case 2:!function(t,e,i,n){if(e)t.call(i,n);else for(var r=t.length,s=g(t,r),a=0;a<r;++a)s[a].call(i,n)}(i,l,this,arguments[1]);break;case 3:!function(t,e,i,n,r){if(e)t.call(i,n,r);else for(var s=t.length,a=g(t,s),o=0;o<s;++o)a[o].call(i,n,r)}(i,l,this,arguments[1],arguments[2]);break;case 4:!function(t,e,i,n,r,s){if(e)t.call(i,n,r,s);else for(var a=t.length,o=g(t,a),c=0;c<a;++c)o[c].call(i,n,r,s)}(i,l,this,arguments[1],arguments[2],arguments[3]);break;default:for(r=new Array(n-1),s=1;s<n;s++)r[s-1]=arguments[s];!function(t,e,i,n){if(e)t.apply(i,n);else for(var r=t.length,s=g(t,r),a=0;a<r;++a)s[a].apply(i,n)}(i,l,this,r)}return!0},a.prototype.addListener=function(t,e){return u(this,t,e,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(t,e){return u(this,t,e,!0)},a.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.on(t,p(this,t,e)),this},a.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');return this.prependListener(t,p(this,t,e)),this},a.prototype.removeListener=function(t,e){var i,r,s,a,o;if("function"!=typeof e)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(i=r[t]))return this;if(i===e||i.listener===e)0==--this._eventsCount?this._events=n(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||e));else if("function"!=typeof i){for(s=-1,a=i.length-1;a>=0;a--)if(i[a]===e||i[a].listener===e){o=i[a].listener,s=a;break}if(s<0)return this;0===s?i.shift():function(t,e){for(var i=e,n=i+1,r=t.length;n<r;i+=1,n+=1)t[i]=t[n];t.pop()}(i,s),1===i.length&&(r[t]=i[0]),r.removeListener&&this.emit("removeListener",t,o||e)}return this},a.prototype.removeAllListeners=function(t){var e,i,s;if(!(i=this._events))return this;if(!i.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):i[t]&&(0==--this._eventsCount?this._events=n(null):delete i[t]),this;if(0===arguments.length){var a,o=r(i);for(s=0;s<o.length;++s)"removeListener"!==(a=o[s])&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=n(null),this._eventsCount=0,this}if("function"==typeof(e=i[t]))this.removeListener(t,e);else if(e)for(s=e.length-1;s>=0;s--)this.removeListener(t,e[s]);return this},a.prototype.listeners=function(t){return f(this,t,!0)},a.prototype.rawListeners=function(t){return f(this,t,!1)},a.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],80:[function(t,e,i){var n=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(t){return n()}try{return __global__||n()}finally{delete Object.prototype.__global__}}()},{}],81:[function(t,e,i){e.exports=t("./is-implemented")()?globalThis:t("./implementation")},{"./implementation":80,"./is-implemented":82}],82:[function(t,e,i){e.exports=function(){return"object"==typeof globalThis&&(!!globalThis&&globalThis.Array===Array)}},{}],83:[function(t,e,i){i.read=function(t,e,i,n,r){var s,a,o=8*r-n-1,c=(1<<o)-1,l=c>>1,h=-7,u=i?r-1:0,d=i?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=o;h>0;s=256*s+t[e+u],u+=d,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=n;h>0;a=256*a+t[e+u],u+=d,h-=8);if(0===s)s=1-l;else{if(s===c)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),s-=l}return(p?-1:1)*a*Math.pow(2,s-n)},i.write=function(t,e,i,n,r,s){var a,o,c,l=8*s-r-1,h=(1<<l)-1,u=h>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:s-1,f=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),(e+=a+u>=1?d/c:d*Math.pow(2,1-u))*c>=2&&(a++,c/=2),a+u>=h?(o=0,a=h):a+u>=1?(o=(e*c-1)*Math.pow(2,r),a+=u):(o=e*Math.pow(2,u-1)*Math.pow(2,r),a=0));r>=8;t[i+p]=255&o,p+=f,o/=256,r-=8);for(a=a<<r|o,l+=r;l>0;t[i+p]=255&a,p+=f,a/=256,l-=8);t[i+p-f]|=128*m}},{}],84:[function(t,e,i){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}}},{}],85:[function(t,e,i){function n(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}e.exports=function(t){return null!=t&&(n(t)||function(t){return"function"==typeof t.readFloatLE&&"function"==typeof t.slice&&n(t.slice(0,0))}(t)||!!t._isBuffer)}},{}],86:[function(t,e,i){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],87:[function(t,e,i){var n=t("safe-buffer").Buffer,r=e.exports;for(var s in r.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"reserved"},r.codes={},r.types){var a=r.types[s];r.codes[a]=s}function o(t){return[0,1,2].map((function(e){return[0,1].map((function(i){return[0,1].map((function(s){var a=new n(1);return a.writeUInt8(r.codes[t]<<r.CMD_SHIFT|(i?r.DUP_MASK:0)|e<<r.QOS_SHIFT|s,0,!0),a}))}))}))}r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.LENGTH_MASK=127,r.LENGTH_FIN_MASK=128,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=n.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=n.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=n.from([r.codes.connect<<r.CMD_SHIFT]),r.PUBLISH_HEADER=o("publish"),r.SUBSCRIBE_HEADER=o("subscribe"),r.UNSUBSCRIBE_HEADER=o("unsubscribe"),r.ACKS={unsuback:o("unsuback"),puback:o("puback"),pubcomp:o("pubcomp"),pubrel:o("pubrel"),pubrec:o("pubrec")},r.SUBACK_HEADER=n.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=n.from([3]),r.VERSION4=n.from([4]),r.QOS=[0,1,2].map((function(t){return n.from([t])})),r.EMPTY={pingreq:n.from([r.codes.pingreq<<4,0]),pingresp:n.from([r.codes.pingresp<<4,0]),disconnect:n.from([r.codes.disconnect<<4,0])}},{"safe-buffer":114}],88:[function(t,e,i){var n=t("safe-buffer").Buffer,r=t("./writeToStream"),s=t("events").EventEmitter;function a(){this._array=new Array(20),this._i=0}t("inherits")(a,s),a.prototype.write=function(t){return this._array[this._i++]=t,!0},a.prototype.concat=function(){var t,e,i=0,r=new Array(this._array.length),s=this._array,a=0;for(t=0;t<s.length&&void 0!==s[t];t++)"string"!=typeof s[t]?r[t]=s[t].length:r[t]=n.byteLength(s[t]),i+=r[t];for(e=n.allocUnsafe(i),t=0;t<s.length&&void 0!==s[t];t++)"string"!=typeof s[t]?(s[t].copy(e,a),a+=r[t]):(e.write(s[t],a),a+=r[t]);return e},e.exports=function(t){var e=new a;return r(t,e),e.concat()}},{"./writeToStream":93,events:79,inherits:84,"safe-buffer":114}],89:[function(t,e,i){i.parser=t("./parser"),i.generate=t("./generate"),i.writeToStream=t("./writeToStream")},{"./generate":88,"./parser":92,"./writeToStream":93}],90:[function(t,e,i){var n=t("safe-buffer").Buffer,r={};function s(t){var e=n.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(255&t,1),e}e.exports={cache:r,generateCache:function(){for(var t=0;t<65536;t++)r[t]=s(t)},generateNumber:s}},{"safe-buffer":114}],91:[function(t,e,i){e.exports=function(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}},{}],92:[function(t,e,i){var n=t("bl"),r=t("inherits"),s=t("events").EventEmitter,a=t("./packet"),o=t("./constants");function c(){if(!(this instanceof c))return new c;this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState()}r(c,s),c.prototype._resetState=function(){this.packet=new a,this.error=null,this._list=n(),this._stateCounter=0},c.prototype.parse=function(t){for(this.error&&this._resetState(),this._list.append(t);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,this._stateCounter>=this._states.length&&(this._stateCounter=0);return this._list.length},c.prototype._parseHeader=function(){var t=this._list.readUInt8(0);return this.packet.cmd=o.types[t>>o.CMD_SHIFT],this.packet.retain=0!=(t&o.RETAIN_MASK),this.packet.qos=t>>o.QOS_SHIFT&o.QOS_MASK,this.packet.dup=0!=(t&o.DUP_MASK),this._list.consume(1),!0},c.prototype._parseLength=function(){for(var t,e=0,i=1,n=0,r=!0;e<5&&(n+=i*((t=this._list.readUInt8(e++))&o.LENGTH_MASK),i*=128,0!=(t&o.LENGTH_FIN_MASK));)if(this._list.length<=e){r=!1;break}return r&&(this.packet.length=n,this._list.consume(e)),r},c.prototype._parsePayload=function(){var t=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseMessageId();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":case"disconnect":break;default:this._emitError(new Error("Not supported"))}t=!0}return t},c.prototype._parseConnect=function(){var t,e,i,n,r,s,a={},c=this.packet;if(null===(t=this._parseString()))return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==t&&"MQIsdp"!==t)return this._emitError(new Error("Invalid protocolId"));if(c.protocolId=t,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(c.protocolVersion=this._list.readUInt8(this._pos),3!==c.protocolVersion&&4!==c.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(a.username=this._list.readUInt8(this._pos)&o.USERNAME_MASK,a.password=this._list.readUInt8(this._pos)&o.PASSWORD_MASK,a.will=this._list.readUInt8(this._pos)&o.WILL_FLAG_MASK,a.will&&(c.will={},c.will.retain=0!=(this._list.readUInt8(this._pos)&o.WILL_RETAIN_MASK),c.will.qos=(this._list.readUInt8(this._pos)&o.WILL_QOS_MASK)>>o.WILL_QOS_SHIFT),c.clean=0!=(this._list.readUInt8(this._pos)&o.CLEAN_SESSION_MASK),this._pos++,c.keepalive=this._parseNum(),-1===c.keepalive)return this._emitError(new Error("Packet too short"));if(null===(e=this._parseString()))return this._emitError(new Error("Packet too short"));if(c.clientId=e,a.will){if(null===(i=this._parseString()))return this._emitError(new Error("Cannot parse will topic"));if(c.will.topic=i,null===(n=this._parseBuffer()))return this._emitError(new Error("Cannot parse will payload"));c.will.payload=n}if(a.username){if(null===(s=this._parseString()))return this._emitError(new Error("Cannot parse username"));c.username=s}if(a.password){if(null===(r=this._parseBuffer()))return this._emitError(new Error("Cannot parse password"));c.password=r}return c},c.prototype._parseConnack=function(){var t=this.packet;return this._list.length<2?null:(t.sessionPresent=!!(this._list.readUInt8(this._pos++)&o.SESSIONPRESENT_MASK),t.returnCode=this._list.readUInt8(this._pos),-1===t.returnCode?this._emitError(new Error("Cannot parse return code")):void 0)},c.prototype._parsePublish=function(){var t=this.packet;if(t.topic=this._parseString(),null===t.topic)return this._emitError(new Error("Cannot parse topic"));t.qos>0&&!this._parseMessageId()||(t.payload=this._list.slice(this._pos,t.length))},c.prototype._parseSubscribe=function(){var t,e,i=this.packet;if(1!==i.qos)return this._emitError(new Error("Wrong subscribe header"));if(i.subscriptions=[],this._parseMessageId())for(;this._pos<i.length;){if(null===(t=this._parseString()))return this._emitError(new Error("Cannot parse topic"));if(this._pos>=i.length)return this._emitError(new Error("Malformed Subscribe Payload"));e=this._list.readUInt8(this._pos++),i.subscriptions.push({topic:t,qos:e})}},c.prototype._parseSuback=function(){if(this.packet.granted=[],this._parseMessageId())for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))},c.prototype._parseUnsubscribe=function(){var t=this.packet;if(t.unsubscriptions=[],this._parseMessageId())for(;this._pos<t.length;){var e;if(null===(e=this._parseString()))return this._emitError(new Error("Cannot parse topic"));t.unsubscriptions.push(e)}},c.prototype._parseUnsuback=function(){if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"))},c.prototype._parseMessageId=function(){var t=this.packet;return t.messageId=this._parseNum(),null!==t.messageId||(this._emitError(new Error("Cannot parse messageId")),!1)},c.prototype._parseString=function(t){var e,i=this._parseNum(),n=i+this._pos;return-1===i||n>this._list.length||n>this.packet.length?null:(e=this._list.toString("utf8",this._pos,n),this._pos+=i,e)},c.prototype._parseBuffer=function(){var t,e=this._parseNum(),i=e+this._pos;return-1===e||i>this._list.length||i>this.packet.length?null:(t=this._list.slice(this._pos,i),this._pos+=e,t)},c.prototype._parseNum=function(){if(this._list.length-this._pos<2)return-1;var t=this._list.readUInt16BE(this._pos);return this._pos+=2,t},c.prototype._newPacket=function(){return this.packet&&(this._list.consume(this.packet.length),this.emit("packet",this.packet)),this.packet=new a,!0},c.prototype._emitError=function(t){this.error=t,this.emit("error",t)},e.exports=c},{"./constants":87,"./packet":91,bl:10,events:79,inherits:84}],93:[function(t,e,i){var n=t("./constants"),r=t("safe-buffer").Buffer,s=r.allocUnsafe(0),a=r.from([0]),o=t("./numbers"),c=t("process-nextick-args").nextTick,l=o.cache,h=o.generateNumber,u=o.generateCache,d=v,p=!0;function f(t,e){switch(e.cork&&(e.cork(),c(m,e)),p&&(p=!1,u()),t.cmd){case"connect":return function(t,e){var i=t||{},s=i.protocolId||"MQTT",a=i.protocolVersion||4,o=i.will,c=i.clean,l=i.keepalive||0,h=i.clientId||"",u=i.username,p=i.password;void 0===c&&(c=!0);var f=0;if(!s||"string"!=typeof s&&!r.isBuffer(s))return e.emit("error",new Error("Invalid protocolId")),!1;f+=s.length+2;if(3!==a&&4!==a)return e.emit("error",new Error("Invalid protocol version")),!1;f+=1;if("string"!=typeof h&&!r.isBuffer(h)||!h&&4!==a||!h&&!c){if(a<4)return e.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*c==0)return e.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}else f+=h.length+2;if("number"!=typeof l||l<0||l>65535||l%1!=0)return e.emit("error",new Error("Invalid keepalive")),!1;f+=2;if(f+=1,o){if("object"!=typeof o)return e.emit("error",new Error("Invalid will")),!1;if(!o.topic||"string"!=typeof o.topic)return e.emit("error",new Error("Invalid will topic")),!1;if(f+=r.byteLength(o.topic)+2,o.payload&&o.payload){if(!(o.payload.length>=0))return e.emit("error",new Error("Invalid will payload")),!1;"string"==typeof o.payload?f+=r.byteLength(o.payload)+2:f+=o.payload.length+2}else f+=2}var m=!1;if(null!=u){if(!I(u))return e.emit("error",new Error("Invalid username")),!1;m=!0,f+=r.byteLength(u)+2}if(null!=p){if(!m)return e.emit("error",new Error("Username is required to use password")),!1;if(!I(p))return e.emit("error",new Error("Invalid password")),!1;f+=_(p)+2}e.write(n.CONNECT_HEADER),y(e,f),E(e,s),e.write(4===a?n.VERSION4:n.VERSION3);var g=0;g|=null!=u?n.USERNAME_MASK:0,g|=null!=p?n.PASSWORD_MASK:0,g|=o&&o.retain?n.WILL_RETAIN_MASK:0,g|=o&&o.qos?o.qos<<n.WILL_QOS_SHIFT:0,g|=o?n.WILL_FLAG_MASK:0,g|=c?n.CLEAN_SESSION_MASK:0,e.write(r.from([g])),d(e,l),E(e,h),o&&(w(e,o.topic),E(e,o.payload));null!=u&&E(e,u);null!=p&&E(e,p);return!0}(t,e);case"connack":return function(t,e){var i=(t||{}).returnCode;if("number"!=typeof i)return e.emit("error",new Error("Invalid return code")),!1;return e.write(n.CONNACK_HEADER),y(e,2),e.write(t.sessionPresent?n.SESSIONPRESENT_HEADER:a),e.write(r.from([i]))}(t,e);case"publish":return function(t,e){var i=t||{},a=i.qos||0,o=i.retain?n.RETAIN_MASK:0,c=i.topic,l=i.payload||s,h=i.messageId,u=0;if("string"==typeof c)u+=r.byteLength(c)+2;else{if(!r.isBuffer(c))return e.emit("error",new Error("Invalid topic")),!1;u+=c.length+2}r.isBuffer(l)?u+=l.length:u+=r.byteLength(l);if(a&&"number"!=typeof h)return e.emit("error",new Error("Invalid messageId")),!1;a&&(u+=2);e.write(n.PUBLISH_HEADER[a][t.dup?1:0][o?1:0]),y(e,u),d(e,_(c)),e.write(c),a>0&&d(e,h);return e.write(l)}(t,e);case"puback":case"pubrec":case"pubrel":case"pubcomp":case"unsuback":return function(t,e){var i=t||{},r=i.cmd||"puback",s=i.messageId,a=i.dup&&"pubrel"===r?n.DUP_MASK:0,o=0;"pubrel"===r&&(o=1);if("number"!=typeof s)return e.emit("error",new Error("Invalid messageId")),!1;return e.write(n.ACKS[r][o][a][0]),y(e,2),d(e,s)}(t,e);case"subscribe":return function(t,e){var i=t||{},s=i.dup?n.DUP_MASK:0,a=i.messageId,o=i.subscriptions,c=0;if("number"!=typeof a)return e.emit("error",new Error("Invalid messageId")),!1;c+=2;if("object"!=typeof o||!o.length)return e.emit("error",new Error("Invalid subscriptions")),!1;for(var l=0;l<o.length;l+=1){var h=o[l].topic,u=o[l].qos;if("string"!=typeof h)return e.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof u)return e.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;c+=r.byteLength(h)+2+1}e.write(n.SUBSCRIBE_HEADER[1][s?1:0][0]),y(e,c),d(e,a);for(var p=!0,f=0;f<o.length;f++){var m=o[f],g=m.topic,v=m.qos;w(e,g),p=e.write(n.QOS[v])}return p}(t,e);case"suback":return function(t,e){var i=t||{},s=i.messageId,a=i.granted,o=0;if("number"!=typeof s)return e.emit("error",new Error("Invalid messageId")),!1;o+=2;if("object"!=typeof a||!a.length)return e.emit("error",new Error("Invalid qos vector")),!1;for(var c=0;c<a.length;c+=1){if("number"!=typeof a[c])return e.emit("error",new Error("Invalid qos vector")),!1;o+=1}return e.write(n.SUBACK_HEADER),y(e,o),d(e,s),e.write(r.from(a))}(t,e);case"unsubscribe":return function(t,e){var i=t||{},s=i.messageId,a=i.dup?n.DUP_MASK:0,o=i.unsubscriptions,c=0;if("number"!=typeof s)return e.emit("error",new Error("Invalid messageId")),!1;c+=2;if("object"!=typeof o||!o.length)return e.emit("error",new Error("Invalid unsubscriptions")),!1;for(var l=0;l<o.length;l+=1){if("string"!=typeof o[l])return e.emit("error",new Error("Invalid unsubscriptions")),!1;c+=r.byteLength(o[l])+2}e.write(n.UNSUBSCRIBE_HEADER[1][a?1:0][0]),y(e,c),d(e,s);for(var h=!0,u=0;u<o.length;u++)h=w(e,o[u]);return h}(t,e);case"pingreq":case"pingresp":case"disconnect":return function(t,e){return e.write(n.EMPTY[t.cmd])}(t,e);default:return e.emit("error",new Error("Unknown command")),!1}}function m(t){t.uncork()}Object.defineProperty(f,"cacheNumbers",{get:function(){return d===v},set:function(t){t?(l&&0!==Object.keys(l).length||(p=!0),d=v):(p=!1,d=b)}});var g={};function y(t,e){var i=g[e];i||(i=function(t){var e=0,i=0,n=r.allocUnsafe(function(t){return t>=0&&t<128?1:t>=128&&t<16384?2:t>=16384&&t<2097152?3:t>=2097152&&t<268435456?4:0}(t));do{e=t%128|0,(t=t/128|0)>0&&(e|=128),n.writeUInt8(e,i++)}while(t>0);return n}(e),e<16384&&(g[e]=i)),t.write(i)}function w(t,e){var i=r.byteLength(e);d(t,i),t.write(e,"utf8")}function v(t,e){return t.write(l[e])}function b(t,e){return t.write(h(e))}function E(t,e){"string"==typeof e?w(t,e):e?(d(t,e.length),t.write(e)):d(t,0)}function _(t){return t?t instanceof r?t.length:r.byteLength(t):0}function I(t){return"string"==typeof t||t instanceof r}e.exports=f},{"./constants":87,"./numbers":90,"process-nextick-args":95,"safe-buffer":114}],94:[function(t,e,i){var n=t("wrappy");function r(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function s(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},i=t.name||"Function wrapped with `once`";return e.onceError=i+" shouldn't be called more than once",e.called=!1,e}e.exports=n(r),e.exports.strict=n(s),r.proto=r((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})}))},{wrappy:164}],95:[function(t,e,i){(function(t){(function(){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,i,n,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var s,a,o=arguments.length;switch(o){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,i)}));case 3:return t.nextTick((function(){e.call(null,i,n)}));case 4:return t.nextTick((function(){e.call(null,i,n,r)}));default:for(s=new Array(o-1),a=0;a<s.length;)s[a++]=arguments[a];return t.nextTick((function(){e.apply(null,s)}))}}}:e.exports=t}).call(this)}).call(this,t("_process"))},{_process:96}],96:[function(t,e,i){var n,r,s=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function c(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var l,h=[],u=!1,d=-1;function p(){u&&l&&(u=!1,l.length?h=l.concat(h):d=-1,h.length&&f())}function f(){if(!u){var t=c(p);u=!0;for(var e=h.length;e;){for(l=h,h=[];++d<e;)l&&l[d].run();d=-1,e=h.length}l=null,u=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function m(t,e){this.fun=t,this.array=e}function g(){}s.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];h.push(new m(t,e)),1!==h.length||u||c(f)},m.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=g,s.addListener=g,s.once=g,s.off=g,s.removeListener=g,s.removeAllListeners=g,s.emit=g,s.prependListener=g,s.prependOnceListener=g,s.listeners=function(t){return[]},s.binding=function(t){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(t){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}},{}],97:[function(t,e,i){(function(t){(function(){!function(n){var r="object"==typeof i&&i&&!i.nodeType&&i,s="object"==typeof e&&e&&!e.nodeType&&e,a="object"==typeof t&&t;a.global!==a&&a.window!==a&&a.self!==a||(n=a);var o,c,l=2147483647,h=36,u=1,d=26,p=38,f=700,m=72,g=128,y="-",w=/^xn--/,v=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,E={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=h-u,I=Math.floor,C=String.fromCharCode;function D(t){throw new RangeError(E[t])}function S(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function A(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+S((t=t.replace(b,".")).split("."),e).join(".")}function x(t){for(var e,i,n=[],r=0,s=t.length;r<s;)(e=t.charCodeAt(r++))>=55296&&e<=56319&&r<s?56320==(64512&(i=t.charCodeAt(r++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),r--):n.push(e);return n}function P(t){return S(t,(function(t){var e="";return t>65535&&(e+=C((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=C(t)})).join("")}function T(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function O(t,e,i){var n=0;for(t=i?I(t/f):t>>1,t+=I(t/e);t>_*d>>1;n+=h)t=I(t/_);return I(n+(_+1)*t/(t+p))}function L(t){var e,i,n,r,s,a,o,c,p,f,w,v=[],b=t.length,E=0,_=g,C=m;for((i=t.lastIndexOf(y))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&D("not-basic"),v.push(t.charCodeAt(n));for(r=i>0?i+1:0;r<b;){for(s=E,a=1,o=h;r>=b&&D("invalid-input"),((c=(w=t.charCodeAt(r++))-48<10?w-22:w-65<26?w-65:w-97<26?w-97:h)>=h||c>I((l-E)/a))&&D("overflow"),E+=c*a,!(c<(p=o<=C?u:o>=C+d?d:o-C));o+=h)a>I(l/(f=h-p))&&D("overflow"),a*=f;C=O(E-s,e=v.length+1,0==s),I(E/e)>l-_&&D("overflow"),_+=I(E/e),E%=e,v.splice(E++,0,_)}return P(v)}function R(t){var e,i,n,r,s,a,o,c,p,f,w,v,b,E,_,S=[];for(v=(t=x(t)).length,e=g,i=0,s=m,a=0;a<v;++a)(w=t[a])<128&&S.push(C(w));for(n=r=S.length,r&&S.push(y);n<v;){for(o=l,a=0;a<v;++a)(w=t[a])>=e&&w<o&&(o=w);for(o-e>I((l-i)/(b=n+1))&&D("overflow"),i+=(o-e)*b,e=o,a=0;a<v;++a)if((w=t[a])<e&&++i>l&&D("overflow"),w==e){for(c=i,p=h;!(c<(f=p<=s?u:p>=s+d?d:p-s));p+=h)_=c-f,E=h-f,S.push(C(T(f+_%E,0))),c=I(_/E);S.push(C(T(c,0))),s=O(i,b,n==r),i=0,++n}++i,++e}return S.join("")}if(o={version:"1.4.1",ucs2:{decode:x,encode:P},decode:L,encode:R,toASCII:function(t){return A(t,(function(t){return v.test(t)?"xn--"+R(t):t}))},toUnicode:function(t){return A(t,(function(t){return w.test(t)?L(t.slice(4).toLowerCase()):t}))}},r&&s)if(e.exports==r)s.exports=o;else for(c in o)o.hasOwnProperty(c)&&(r[c]=o[c]);else n.punycode=o}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],98:[function(t,e,i){function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,i,s){e=e||"&",i=i||"=";var a={};if("string"!=typeof t||0===t.length)return a;var o=/\+/g;t=t.split(e);var c=1e3;s&&"number"==typeof s.maxKeys&&(c=s.maxKeys);var l=t.length;c>0&&l>c&&(l=c);for(var h=0;h<l;++h){var u,d,p,f,m=t[h].replace(o,"%20"),g=m.indexOf(i);g>=0?(u=m.substr(0,g),d=m.substr(g+1)):(u=m,d=""),p=decodeURIComponent(u),f=decodeURIComponent(d),n(a,p)?r(a[p])?a[p].push(f):a[p]=[a[p],f]:a[p]=f}return a};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],99:[function(t,e,i){var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,i,o){return e=e||"&",i=i||"=",null===t&&(t=void 0),"object"==typeof t?s(a(t),(function(a){var o=encodeURIComponent(n(a))+i;return r(t[a])?s(t[a],(function(t){return o+encodeURIComponent(n(t))})).join(e):o+encodeURIComponent(n(t[a]))})).join(e):o?encodeURIComponent(n(o))+i+encodeURIComponent(n(t)):""};var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function s(t,e){if(t.map)return t.map(e);for(var i=[],n=0;n<t.length;n++)i.push(e(t[n],n));return i}var a=Object.keys||function(t){var e=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.push(i);return e}},{}],100:[function(t,e,i){i.decode=i.parse=t("./decode"),i.encode=i.stringify=t("./encode")},{"./decode":98,"./encode":99}],101:[function(t,e,i){e.exports=t("./lib/_stream_duplex.js")},{"./lib/_stream_duplex.js":102}],102:[function(t,e,i){var n=t("process-nextick-args"),r=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};e.exports=u;var s=Object.create(t("core-util-is"));s.inherits=t("inherits");var a=t("./_stream_readable"),o=t("./_stream_writable");s.inherits(u,a);for(var c=r(o.prototype),l=0;l<c.length;l++){var h=c[l];u.prototype[h]||(u.prototype[h]=o.prototype[h])}function u(t){if(!(this instanceof u))return new u(t);a.call(this,t),o.call(this,t),t&&!1===t.readable&&(this.readable=!1),t&&!1===t.writable&&(this.writable=!1),this.allowHalfOpen=!0,t&&!1===t.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",d)}function d(){this.allowHalfOpen||this._writableState.ended||n.nextTick(p,this)}function p(t){t.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}),u.prototype._destroy=function(t,e){this.push(null),this.end(),n.nextTick(e,t)}},{"./_stream_readable":104,"./_stream_writable":106,"core-util-is":13,inherits:84,"process-nextick-args":95}],103:[function(t,e,i){e.exports=s;var n=t("./_stream_transform"),r=Object.create(t("core-util-is"));function s(t){if(!(this instanceof s))return new s(t);n.call(this,t)}r.inherits=t("inherits"),r.inherits(s,n),s.prototype._transform=function(t,e,i){i(null,t)}},{"./_stream_transform":105,"core-util-is":13,inherits:84}],104:[function(t,e,i){(function(i,n){(function(){var r=t("process-nextick-args");e.exports=v;var s,a=t("isarray");v.ReadableState=w,t("events").EventEmitter;var o=function(t,e){return t.listeners(e).length},c=t("./internal/streams/stream"),l=t("safe-buffer").Buffer,h=n.Uint8Array||function(){};var u=Object.create(t("core-util-is"));u.inherits=t("inherits");var d=t("util"),p=void 0;p=d&&d.debuglog?d.debuglog("stream"):function(){};var f,m=t("./internal/streams/BufferList"),g=t("./internal/streams/destroy");u.inherits(v,c);var y=["error","close","destroy","pause","resume"];function w(e,i){e=e||{};var n=i instanceof(s=s||t("./_stream_duplex"));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,a=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(a||0===a)?a:o,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=t("string_decoder/").StringDecoder),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function v(e){if(s=s||t("./_stream_duplex"),!(this instanceof v))return new v(e);this._readableState=new w(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),c.call(this)}function b(t,e,i,n,r){var s,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,C(t)}(t,a)):(r||(s=function(t,e){var i;n=e,l.isBuffer(n)||n instanceof h||"string"==typeof e||void 0===e||t.objectMode||(i=new TypeError("Invalid non-string/buffer chunk"));var n;return i}(a,e)),s?t.emit("error",s):a.objectMode||e&&e.length>0?("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),n?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):E(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!i?(e=a.decoder.write(e),a.objectMode||0!==e.length?E(t,a,e,!1):S(t,a)):E(t,a,e,!1))):n||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(a)}function E(t,e,i,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",i),t.read(0)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&C(t)),S(t,e)}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),v.prototype.destroy=g.destroy,v.prototype._undestroy=g.undestroy,v.prototype._destroy=function(t,e){this.push(null),e(t)},v.prototype.push=function(t,e){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=l.from(t,e),e=""),i=!0),b(this,t,e,!1,i)},v.prototype.unshift=function(t){return b(this,t,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return f||(f=t("string_decoder/").StringDecoder),this._readableState.decoder=new f(e),this._readableState.encoding=e,this};var _=8388608;function I(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=_?t=_:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(p("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?r.nextTick(D,t):D(t))}function D(t){p("emit readable"),t.emit("readable"),T(t)}function S(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(A,t,e))}function A(t,e){for(var i=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(p("maybeReadMore read 0"),t.read(0),i!==e.length);)i=e.length;e.readingMore=!1}function x(t){p("readable nexttick read 0"),t.read(0)}function P(t,e){e.reading||(p("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),T(t),e.flowing&&!e.reading&&t.read(0)}function T(t){var e=t._readableState;for(p("flow",e.flowing);e.flowing&&null!==t.read(););}function O(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):i=function(t,e,i){var n;t<e.head.data.length?(n=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):n=t===e.head.data.length?e.shift():i?function(t,e){var i=e.head,n=1,r=i.data;t-=r.length;for(;i=i.next;){var s=i.data,a=t>s.length?s.length:t;if(a===s.length?r+=s:r+=s.slice(0,t),0===(t-=a)){a===s.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=s.slice(a));break}++n}return e.length-=n,r}(t,e):function(t,e){var i=l.allocUnsafe(t),n=e.head,r=1;n.data.copy(i),t-=n.data.length;for(;n=n.next;){var s=n.data,a=t>s.length?s.length:t;if(s.copy(i,i.length-t,0,a),0===(t-=a)){a===s.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=s.slice(a));break}++r}return e.length-=r,i}(t,e);return n}(t,e.buffer,e.decoder),i);var i}function L(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,r.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function M(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}v.prototype.read=function(t){p("read",t),t=parseInt(t,10);var e=this._readableState,i=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return p("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?L(this):C(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&L(this),null;var n,r=e.needReadable;return p("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&p("length less than watermark",r=!0),e.ended||e.reading?p("reading or ended",r=!1):r&&(p("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=I(i,e))),null===(n=t>0?O(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&L(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(t,e){var n=this,s=this._readableState;switch(s.pipesCount){case 0:s.pipes=t;break;case 1:s.pipes=[s.pipes,t];break;default:s.pipes.push(t)}s.pipesCount+=1,p("pipe count=%d opts=%j",s.pipesCount,e);var c=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?h:v;function l(e,i){p("onunpipe"),e===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,p("cleanup"),t.removeListener("close",y),t.removeListener("finish",w),t.removeListener("drain",u),t.removeListener("error",g),t.removeListener("unpipe",l),n.removeListener("end",h),n.removeListener("end",v),n.removeListener("data",m),d=!0,!s.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function h(){p("onend"),t.end()}s.endEmitted?r.nextTick(c):n.once("end",c),t.on("unpipe",l);var u=function(t){return function(){var e=t._readableState;p("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,T(t))}}(n);t.on("drain",u);var d=!1;var f=!1;function m(e){p("ondata"),f=!1,!1!==t.write(e)||f||((1===s.pipesCount&&s.pipes===t||s.pipesCount>1&&-1!==M(s.pipes,t))&&!d&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,f=!0),n.pause())}function g(e){p("onerror",e),v(),t.removeListener("error",g),0===o(t,"error")&&t.emit("error",e)}function y(){t.removeListener("finish",w),v()}function w(){p("onfinish"),t.removeListener("close",y),v()}function v(){p("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}(t,"error",g),t.once("close",y),t.once("finish",w),t.emit("pipe",n),s.flowing||(p("pipe resume"),n.resume()),t},v.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var n=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<r;s++)n[s].emit("unpipe",this,i);return this}var a=M(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i)),this},v.prototype.on=function(t,e){var i=c.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&C(this):r.nextTick(x,this))}return i},v.prototype.addListener=v.prototype.on,v.prototype.resume=function(){var t=this._readableState;return t.flowing||(p("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(P,t,e))}(this,t)),this},v.prototype.pause=function(){return p("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(p("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(t){var e=this,i=this._readableState,n=!1;for(var r in t.on("end",(function(){if(p("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(r){(p("wrapped data"),i.decoder&&(r=i.decoder.write(r)),i.objectMode&&null==r)||(i.objectMode||r&&r.length)&&(e.push(r)||(n=!0,t.pause()))})),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));for(var s=0;s<y.length;s++)t.on(y[s],this.emit.bind(this,y[s]));return this._read=function(e){p("wrapped _read",e),n&&(n=!1,t.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=O}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./_stream_duplex":102,"./internal/streams/BufferList":107,"./internal/streams/destroy":108,"./internal/streams/stream":109,_process:96,"core-util-is":13,events:79,inherits:84,isarray:86,"process-nextick-args":95,"safe-buffer":110,"string_decoder/":111,util:11}],105:[function(t,e,i){e.exports=a;var n=t("./_stream_duplex"),r=Object.create(t("core-util-is"));function s(t,e){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));i.writechunk=null,i.writecb=null,null!=e&&this.push(e),n(t);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function a(t){if(!(this instanceof a))return new a(t);n.call(this,t),this._transformState={afterTransform:s.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",o)}function o(){var t=this;"function"==typeof this._flush?this._flush((function(e,i){c(t,e,i)})):c(this,null,null)}function c(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}r.inherits=t("inherits"),r.inherits(a,n),a.prototype.push=function(t,e){return this._transformState.needTransform=!1,n.prototype.push.call(this,t,e)},a.prototype._transform=function(t,e,i){throw new Error("_transform() is not implemented")},a.prototype._write=function(t,e,i){var n=this._transformState;if(n.writecb=i,n.writechunk=t,n.writeencoding=e,!n.transforming){var r=this._readableState;(n.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},a.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},a.prototype._destroy=function(t,e){var i=this;n.prototype._destroy.call(this,t,(function(t){e(t),i.emit("close")}))}},{"./_stream_duplex":102,"core-util-is":13,inherits:84}],106:[function(t,e,i){(function(i,n,r){(function(){var s=t("process-nextick-args");function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var n=t.entry;t.entry=null;for(;n;){var r=n.callback;e.pendingcb--,r(i),n=n.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}e.exports=w;var o,c=!i.browser&&["v0.10","v0.9."].indexOf(i.version.slice(0,5))>-1?r:s.nextTick;w.WritableState=y;var l=Object.create(t("core-util-is"));l.inherits=t("inherits");var h={deprecate:t("util-deprecate")},u=t("./internal/streams/stream"),d=t("safe-buffer").Buffer,p=n.Uint8Array||function(){};var f,m=t("./internal/streams/destroy");function g(){}function y(e,i){o=o||t("./_stream_duplex"),e=e||{};var n=i instanceof o;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,l=e.writableHighWaterMark,h=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(l||0===l)?l:h,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var u=!1===e.decodeStrings;this.decodeStrings=!u,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var i=t._writableState,n=i.sync,r=i.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(i),e)!function(t,e,i,n,r){--e.pendingcb,i?(s.nextTick(r,n),s.nextTick(C,t,e),t._writableState.errorEmitted=!0,t.emit("error",n)):(r(n),t._writableState.errorEmitted=!0,t.emit("error",n),C(t,e))}(t,i,n,e,r);else{var a=_(i);a||i.corked||i.bufferProcessing||!i.bufferedRequest||E(t,i),n?c(b,t,i,a,r):b(t,i,a,r)}}(i,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function w(e){if(o=o||t("./_stream_duplex"),!(f.call(w,this)||this instanceof o))return new w(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function v(t,e,i,n,r,s,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,i?t._writev(r,e.onwrite):t._write(r,s,e.onwrite),e.sync=!1}function b(t,e,i,n){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),C(t,e)}function E(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var n=e.bufferedRequestCount,r=new Array(n),s=e.corkedRequestsFree;s.entry=i;for(var o=0,c=!0;i;)r[o]=i,i.isBuf||(c=!1),i=i.next,o+=1;r.allBuffers=c,v(t,e,!0,e.length,r,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;i;){var l=i.chunk,h=i.encoding,u=i.callback;if(v(t,e,!1,e.objectMode?1:l.length,l,h,u),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function _(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function I(t,e){t._final((function(i){e.pendingcb--,i&&t.emit("error",i),e.prefinished=!0,t.emit("prefinish"),C(t,e)}))}function C(t,e){var i=_(e);return i&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,s.nextTick(I,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),i}l.inherits(w,u),y.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(y.prototype,"buffer",{get:h.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(w,Symbol.hasInstance,{value:function(t){return!!f.call(this,t)||this===w&&(t&&t._writableState instanceof y)}})):f=function(t){return t instanceof this},w.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},w.prototype.write=function(t,e,i){var n,r=this._writableState,a=!1,o=!r.objectMode&&(n=t,d.isBuffer(n)||n instanceof p);return o&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"==typeof e&&(i=e,e=null),o?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof i&&(i=g),r.ended?function(t,e){var i=new Error("write after end");t.emit("error",i),s.nextTick(e,i)}(this,i):(o||function(t,e,i,n){var r=!0,a=!1;return null===i?a=new TypeError("May not write null values to stream"):"string"==typeof i||void 0===i||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),s.nextTick(n,a),r=!1),r}(this,r,t,i))&&(r.pendingcb++,a=function(t,e,i,n,r,s){if(!i){var a=function(t,e,i){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=d.from(e,i));return e}(e,n,r);n!==a&&(i=!0,r="buffer",n=a)}var o=e.objectMode?1:n.length;e.length+=o;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:s,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else v(t,e,!1,o,n,r,s);return c}(this,r,o,t,e,i)),a},w.prototype.cork=function(){this._writableState.corked++},w.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||E(this,t))},w.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(w.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),w.prototype._write=function(t,e,i){i(new Error("_write() is not implemented"))},w.prototype._writev=null,w.prototype.end=function(t,e,i){var n=this._writableState;"function"==typeof t?(i=t,t=null,e=null):"function"==typeof e&&(i=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(t,e,i){e.ending=!0,C(t,e),i&&(e.finished?s.nextTick(i):t.once("finish",i));e.ended=!0,t.writable=!1}(this,n,i)},Object.defineProperty(w.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),w.prototype.destroy=m.destroy,w.prototype._undestroy=m.undestroy,w.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("timers").setImmediate)},{"./_stream_duplex":102,"./internal/streams/destroy":108,"./internal/streams/stream":109,_process:96,"core-util-is":13,inherits:84,"process-nextick-args":95,"safe-buffer":110,timers:116,"util-deprecate":130}],107:[function(t,e,i){var n=t("safe-buffer").Buffer,r=t("util");e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i},t.prototype.concat=function(t){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var e,i,r,s=n.allocUnsafe(t>>>0),a=this.head,o=0;a;)e=a.data,i=s,r=o,e.copy(i,r),o+=a.data.length,a=a.next;return s},t}(),r&&r.inspect&&r.inspect.custom&&(e.exports.prototype[r.inspect.custom]=function(){var t=r.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":110,util:11}],108:[function(t,e,i){var n=t("process-nextick-args");function r(t,e){t.emit("error",e)}e.exports={destroy:function(t,e){var i=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(r,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(n.nextTick(r,i,t),i._writableState&&(i._writableState.errorEmitted=!0)):e&&e(t)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{"process-nextick-args":95}],109:[function(t,e,i){e.exports=t("events").EventEmitter},{events:79}],110:[function(t,e,i){var n=t("buffer"),r=n.Buffer;function s(t,e){for(var i in t)e[i]=t[i]}function a(t,e,i){return r(t,e,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(s(n,i),i.Buffer=a),s(r,a),a.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,i)},a.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=r(t);return void 0!==e?"string"==typeof i?n.fill(e,i):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:12}],111:[function(t,e,i){var n=t("safe-buffer").Buffer,r=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===r||!r(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=c,this.end=l,e=4;break;case"utf8":this.fillLast=o,e=4;break;case"base64":this.text=h,this.end=u,e=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function a(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function o(t){var e=this.lastTotal-this.lastNeed,i=function(t,e,i){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==i?i:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function c(t,e){if((t.length-e)%2==0){var i=t.toString("utf16le",e);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}function h(t,e){var i=(t.length-e)%3;return 0===i?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}function u(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}i.StringDecoder=s,s.prototype.write=function(t){if(0===t.length)return"";var e,i;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""},s.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},s.prototype.text=function(t,e){var i=function(t,e,i){var n=e.length-1;if(n<i)return 0;var r=a(e[n]);if(r>=0)return r>0&&(t.lastNeed=r-1),r;if(--n<i||-2===r)return 0;if(r=a(e[n]),r>=0)return r>0&&(t.lastNeed=r-2),r;if(--n<i||-2===r)return 0;if(r=a(e[n]),r>=0)return r>0&&(2===r?r=0:t.lastNeed=r-3),r;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},s.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},{"safe-buffer":110}],112:[function(t,e,i){(i=e.exports=t("./lib/_stream_readable.js")).Stream=i,i.Readable=i,i.Writable=t("./lib/_stream_writable.js"),i.Duplex=t("./lib/_stream_duplex.js"),i.Transform=t("./lib/_stream_transform.js"),i.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":102,"./lib/_stream_passthrough.js":103,"./lib/_stream_readable.js":104,"./lib/_stream_transform.js":105,"./lib/_stream_writable.js":106}],113:[function(t,e,i){function n(t,e,i){var n=this;this._callback=t,this._args=i,this._interval=setInterval(t,e,this._args),this.reschedule=function(t){t||(t=n._interval),n._interval&&clearInterval(n._interval),n._interval=setInterval(n._callback,t,n._args)},this.clear=function(){n._interval&&(clearInterval(n._interval),n._interval=void 0)},this.destroy=function(){n._interval&&clearInterval(n._interval),n._callback=void 0,n._interval=void 0,n._args=void 0}}e.exports=function(){if("function"!=typeof arguments[0])throw new Error("callback needed");if("number"!=typeof arguments[1])throw new Error("interval needed");var t;if(arguments.length>0){t=new Array(arguments.length-2);for(var e=0;e<t.length;e++)t[e]=arguments[e+2]}return new n(arguments[0],arguments[1],t)}},{}],114:[function(t,e,i){var n=t("buffer"),r=n.Buffer;function s(t,e){for(var i in t)e[i]=t[i]}function a(t,e,i){return r(t,e,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(s(n,i),i.Buffer=a),a.prototype=Object.create(r.prototype),s(r,a),a.from=function(t,e,i){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,i)},a.alloc=function(t,e,i){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=r(t);return void 0!==e?"string"==typeof i?n.fill(e,i):n.fill(e):n.fill(0),n},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:12}],115:[function(t,e,i){e.exports=function(t){var e=t._readableState;return e?e.objectMode||"number"==typeof t._duplexState?t.read():t.read(function(t){if(t.buffer.length)return t.buffer.head?t.buffer.head.data.length:t.buffer[0].length;return t.length}(e)):null}},{}],116:[function(t,e,i){(function(e,n){(function(){var r=t("process/browser.js").nextTick,s=Function.prototype.apply,a=Array.prototype.slice,o={},c=0;function l(t,e){this._id=t,this._clearFn=e}i.setTimeout=function(){return new l(s.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new l(s.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(t){t.close()},l.prototype.unref=l.prototype.ref=function(){},l.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},i.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},i._unrefActive=i.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},i.setImmediate="function"==typeof e?e:function(t){var e=c++,n=!(arguments.length<2)&&a.call(arguments,1);return o[e]=!0,r((function(){o[e]&&(n?t.apply(null,n):t.call(null),i.clearImmediate(e))})),e},i.clearImmediate="function"==typeof n?n:function(t){delete o[t]}}).call(this)}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":96,timers:116}],117:[function(t,e,i){var n=t("../prototype/is");e.exports=function(t){if("function"!=typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!=typeof t.length)return!1;if("function"!=typeof t.call)return!1;if("function"!=typeof t.apply)return!1}catch(t){return!1}return!n(t)}},{"../prototype/is":124}],118:[function(t,e,i){var n=t("../value/is"),r=t("../object/is"),s=t("../string/coerce"),a=t("./to-short-string"),o=function(t,e){return t.replace("%v",a(e))};e.exports=function(t,e,i){if(!r(i))throw new TypeError(o(e,t));if(!n(t)){if("default"in i)return i.default;if(i.isOptional)return null}var a=s(i.errorMessage);throw n(a)||(a=e),new TypeError(o(a,t))}},{"../object/is":121,"../string/coerce":125,"../value/is":127,"./to-short-string":120}],119:[function(t,e,i){e.exports=function(t){try{return t.toString()}catch(e){try{return String(t)}catch(t){return null}}}},{}],120:[function(t,e,i){var n=t("./safe-to-string"),r=/[\n\r\u2028\u2029]/g;e.exports=function(t){var e=n(t);return null===e?"<Non-coercible to string value>":(e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(r,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})))}},{"./safe-to-string":119}],121:[function(t,e,i){var n=t("../value/is"),r={object:!0,function:!0,undefined:!0};e.exports=function(t){return!!n(t)&&hasOwnProperty.call(r,typeof t)}},{"../value/is":127}],122:[function(t,e,i){var n=t("../lib/resolve-exception"),r=t("./is");e.exports=function(t){return r(t)?t:n(t,"%v is not a plain function",arguments[1])}},{"../lib/resolve-exception":118,"./is":123}],123:[function(t,e,i){var n=t("../function/is"),r=/^\s*class[\s{/}]/,s=Function.prototype.toString;e.exports=function(t){return!!n(t)&&!r.test(s.call(t))}},{"../function/is":117}],124:[function(t,e,i){var n=t("../object/is");e.exports=function(t){if(!n(t))return!1;try{return!!t.constructor&&t.constructor.prototype===t}catch(t){return!1}}},{"../object/is":121}],125:[function(t,e,i){var n=t("../value/is"),r=t("../object/is"),s=Object.prototype.toString;e.exports=function(t){if(!n(t))return null;if(r(t)){var e=t.toString;if("function"!=typeof e)return null;if(e===s)return null}try{return""+t}catch(t){return null}}},{"../object/is":121,"../value/is":127}],126:[function(t,e,i){var n=t("../lib/resolve-exception"),r=t("./is");e.exports=function(t){return r(t)?t:n(t,"Cannot use %v",arguments[1])}},{"../lib/resolve-exception":118,"./is":127}],127:[function(t,e,i){e.exports=function(t){return null!=t}},{}],128:[function(t,e,i){var n=t("punycode"),r=t("./util");function s(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}i.parse=v,i.resolve=function(t,e){return v(t,!1,!0).resolve(e)},i.resolveObject=function(t,e){return t?v(t,!1,!0).resolveObject(e):e},i.format=function(t){r.isString(t)&&(t=v(t));return t instanceof s?t.format():s.prototype.format.call(t)},i.Url=s;var a=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(l),u=["%","/","?",";","#"].concat(h),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=t("querystring");function v(t,e,i){if(t&&r.isObject(t)&&t instanceof s)return t;var n=new s;return n.parse(t,e,i),n}s.prototype.parse=function(t,e,i){if(!r.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var s=t.indexOf("?"),o=-1!==s&&s<t.indexOf("#")?"?":"#",l=t.split(o);l[0]=l[0].replace(/\\/g,"/");var v=t=l.join(o);if(v=v.trim(),!i&&1===t.split("#").length){var b=c.exec(v);if(b)return this.path=v,this.href=v,this.pathname=b[1],b[2]?(this.search=b[2],this.query=e?w.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var E=a.exec(v);if(E){var _=(E=E[0]).toLowerCase();this.protocol=_,v=v.substr(E.length)}if(i||E||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var I="//"===v.substr(0,2);!I||E&&g[E]||(v=v.substr(2),this.slashes=!0)}if(!g[E]&&(I||E&&!y[E])){for(var C,D,S=-1,A=0;A<d.length;A++){-1!==(x=v.indexOf(d[A]))&&(-1===S||x<S)&&(S=x)}-1!==(D=-1===S?v.lastIndexOf("@"):v.lastIndexOf("@",S))&&(C=v.slice(0,D),v=v.slice(D+1),this.auth=decodeURIComponent(C)),S=-1;for(A=0;A<u.length;A++){var x;-1!==(x=v.indexOf(u[A]))&&(-1===S||x<S)&&(S=x)}-1===S&&(S=v.length),this.host=v.slice(0,S),v=v.slice(S),this.parseHost(),this.hostname=this.hostname||"";var P="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!P)for(var T=this.hostname.split(/\./),O=(A=0,T.length);A<O;A++){var L=T[A];if(L&&!L.match(p)){for(var R="",M=0,k=L.length;M<k;M++)L.charCodeAt(M)>127?R+="x":R+=L[M];if(!R.match(p)){var N=T.slice(0,A),V=T.slice(A+1),F=L.match(f);F&&(N.push(F[1]),V.unshift(F[2])),V.length&&(v="/"+V.join(".")+v),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=n.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!m[_])for(A=0,O=h.length;A<O;A++){var U=h[A];if(-1!==v.indexOf(U)){var W=encodeURIComponent(U);W===U&&(W=escape(U)),v=v.split(U).join(W)}}var z=v.indexOf("#");-1!==z&&(this.hash=v.substr(z),v=v.slice(0,z));var G=v.indexOf("?");if(-1!==G?(this.search=v.substr(G),this.query=v.substr(G+1),e&&(this.query=w.parse(this.query)),v=v.slice(0,G)):e&&(this.search="",this.query={}),v&&(this.pathname=v),y[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){j=this.pathname||"";var H=this.search||"";this.path=j+H}return this.href=this.format(),this},s.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",n=this.hash||"",s=!1,a="";this.host?s=t+this.host:this.hostname&&(s=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&r.isObject(this.query)&&Object.keys(this.query).length&&(a=w.stringify(this.query));var o=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||y[e])&&!1!==s?(s="//"+(s||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):s||(s=""),n&&"#"!==n.charAt(0)&&(n="#"+n),o&&"?"!==o.charAt(0)&&(o="?"+o),e+s+(i=i.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(o=o.replace("#","%23"))+n},s.prototype.resolve=function(t){return this.resolveObject(v(t,!1,!0)).format()},s.prototype.resolveObject=function(t){if(r.isString(t)){var e=new s;e.parse(t,!1,!0),t=e}for(var i=new s,n=Object.keys(this),a=0;a<n.length;a++){var o=n[a];i[o]=this[o]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var c=Object.keys(t),l=0;l<c.length;l++){var h=c[l];"protocol"!==h&&(i[h]=t[h])}return y[i.protocol]&&i.hostname&&!i.pathname&&(i.path=i.pathname="/"),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!y[t.protocol]){for(var u=Object.keys(t),d=0;d<u.length;d++){var p=u[d];i[p]=t[p]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||g[t.protocol])i.pathname=t.pathname;else{for(var f=(t.pathname||"").split("/");f.length&&!(t.host=f.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),i.pathname=f.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var m=i.pathname||"",w=i.search||"";i.path=m+w}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var v=i.pathname&&"/"===i.pathname.charAt(0),b=t.host||t.pathname&&"/"===t.pathname.charAt(0),E=b||v||i.host&&t.pathname,_=E,I=i.pathname&&i.pathname.split("/")||[],C=(f=t.pathname&&t.pathname.split("/")||[],i.protocol&&!y[i.protocol]);if(C&&(i.hostname="",i.port=null,i.host&&(""===I[0]?I[0]=i.host:I.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===f[0]?f[0]=t.host:f.unshift(t.host)),t.host=null),E=E&&(""===f[0]||""===I[0])),b)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,I=f;else if(f.length)I||(I=[]),I.pop(),I=I.concat(f),i.search=t.search,i.query=t.query;else if(!r.isNullOrUndefined(t.search)){if(C)i.hostname=i.host=I.shift(),(P=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=P.shift(),i.host=i.hostname=P.shift());return i.search=t.search,i.query=t.query,r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!I.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var D=I.slice(-1)[0],S=(i.host||t.host||I.length>1)&&("."===D||".."===D)||""===D,A=0,x=I.length;x>=0;x--)"."===(D=I[x])?I.splice(x,1):".."===D?(I.splice(x,1),A++):A&&(I.splice(x,1),A--);if(!E&&!_)for(;A--;A)I.unshift("..");!E||""===I[0]||I[0]&&"/"===I[0].charAt(0)||I.unshift(""),S&&"/"!==I.join("/").substr(-1)&&I.push("");var P,T=""===I[0]||I[0]&&"/"===I[0].charAt(0);C&&(i.hostname=i.host=T?"":I.length?I.shift():"",(P=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=P.shift(),i.host=i.hostname=P.shift()));return(E=E||i.host&&I.length)&&!T&&I.unshift(""),I.length?i.pathname=I.join("/"):(i.pathname=null,i.path=null),r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},s.prototype.parseHost=function(){var t=this.host,e=o.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":129,punycode:97,querystring:100}],129:[function(t,e,i){e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],130:[function(t,e,i){(function(t){(function(){function i(e){try{if(!t.localStorage)return!1}catch(t){return!1}var i=t.localStorage[e];return null!=i&&"true"===String(i).toLowerCase()}e.exports=function(t,e){if(i("noDeprecation"))return t;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw new Error(e);i("traceDeprecation")?console.trace(e):console.warn(e),n=!0}return t.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],131:[function(t,e,i){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var i=function(){};i.prototype=e.prototype,t.prototype=new i,t.prototype.constructor=t}},{}],132:[function(t,e,i){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],133:[function(t,e,i){(function(e,n){(function(){var r=/%[sdj%]/g;i.format=function(t){if(!y(t)){for(var e=[],i=0;i<arguments.length;i++)e.push(o(arguments[i]));return e.join(" ")}i=1;for(var n=arguments,s=n.length,a=String(t).replace(r,(function(t){if("%%"===t)return"%";if(i>=s)return t;switch(t){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(t){return"[Circular]"}default:return t}})),c=n[i];i<s;c=n[++i])m(c)||!b(c)?a+=" "+c:a+=" "+o(c);return a},i.deprecate=function(t,r){if(w(n.process))return function(){return i.deprecate(t,r).apply(this,arguments)};if(!0===e.noDeprecation)return t;var s=!1;return function(){if(!s){if(e.throwDeprecation)throw new Error(r);e.traceDeprecation?console.trace(r):console.error(r),s=!0}return t.apply(this,arguments)}};var s,a={};function o(t,e){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),f(e)?n.showHidden=e:e&&i._extend(n,e),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=c),h(n,t,n.depth)}function c(t,e){var i=o.styles[e];return i?"["+o.colors[i][0]+"m"+t+"["+o.colors[i][1]+"m":t}function l(t,e){return t}function h(t,e,n){if(t.customInspect&&e&&I(e.inspect)&&e.inspect!==i.inspect&&(!e.constructor||e.constructor.prototype!==e)){var r=e.inspect(n,t);return y(r)||(r=h(t,r,n)),r}var s=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(y(e)){var i="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(i,"string")}if(g(e))return t.stylize(""+e,"number");if(f(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,e);if(s)return s;var a=Object.keys(e),o=function(t){var e={};return t.forEach((function(t,i){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),_(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return u(e);if(0===a.length){if(I(e)){var c=e.name?": "+e.name:"";return t.stylize("[Function"+c+"]","special")}if(v(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(E(e))return t.stylize(Date.prototype.toString.call(e),"date");if(_(e))return u(e)}var l,b="",C=!1,D=["{","}"];(p(e)&&(C=!0,D=["[","]"]),I(e))&&(b=" [Function"+(e.name?": "+e.name:"")+"]");return v(e)&&(b=" "+RegExp.prototype.toString.call(e)),E(e)&&(b=" "+Date.prototype.toUTCString.call(e)),_(e)&&(b=" "+u(e)),0!==a.length||C&&0!=e.length?n<0?v(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),l=C?function(t,e,i,n,r){for(var s=[],a=0,o=e.length;a<o;++a)A(e,String(a))?s.push(d(t,e,i,n,String(a),!0)):s.push("");return r.forEach((function(r){r.match(/^\d+$/)||s.push(d(t,e,i,n,r,!0))})),s}(t,e,n,o,a):a.map((function(i){return d(t,e,n,o,i,C)})),t.seen.pop(),function(t,e,i){var n=t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return i[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+i[1];return i[0]+e+" "+t.join(", ")+" "+i[1]}(l,b,D)):D[0]+b+D[1]}function u(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,i,n,r,s){var a,o,c;if((c=Object.getOwnPropertyDescriptor(e,r)||{value:e[r]}).get?o=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(o=t.stylize("[Setter]","special")),A(n,r)||(a="["+r+"]"),o||(t.seen.indexOf(c.value)<0?(o=m(i)?h(t,c.value,null):h(t,c.value,i-1)).indexOf("\n")>-1&&(o=s?o.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+o.split("\n").map((function(t){return" "+t})).join("\n")):o=t.stylize("[Circular]","special")),w(a)){if(s&&r.match(/^\d+$/))return o;(a=JSON.stringify(""+r)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+o}function p(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function y(t){return"string"==typeof t}function w(t){return void 0===t}function v(t){return b(t)&&"[object RegExp]"===C(t)}function b(t){return"object"==typeof t&&null!==t}function E(t){return b(t)&&"[object Date]"===C(t)}function _(t){return b(t)&&("[object Error]"===C(t)||t instanceof Error)}function I(t){return"function"==typeof t}function C(t){return Object.prototype.toString.call(t)}function D(t){return t<10?"0"+t.toString(10):t.toString(10)}i.debuglog=function(t){if(w(s)&&(s=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(s)){var n=e.pid;a[t]=function(){var e=i.format.apply(i,arguments);console.error("%s %d: %s",t,n,e)}}else a[t]=function(){};return a[t]},i.inspect=o,o.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},i.isArray=p,i.isBoolean=f,i.isNull=m,i.isNullOrUndefined=function(t){return null==t},i.isNumber=g,i.isString=y,i.isSymbol=function(t){return"symbol"==typeof t},i.isUndefined=w,i.isRegExp=v,i.isObject=b,i.isDate=E,i.isError=_,i.isFunction=I,i.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},i.isBuffer=t("./support/isBuffer");var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}i.log=function(){var t,e;console.log("%s - %s",(e=[D((t=new Date).getHours()),D(t.getMinutes()),D(t.getSeconds())].join(":"),[t.getDate(),S[t.getMonth()],e].join(" ")),i.format.apply(i,arguments))},i.inherits=t("inherits"),i._extend=function(t,e){if(!e||!b(e))return t;for(var i=Object.keys(e),n=i.length;n--;)t[i[n]]=e[i[n]];return t}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":132,_process:96,inherits:131}],134:[function(t,e,i){(function(i,n){(function(){var r=t("readable-stream"),s=t("end-of-stream"),a=t("inherits"),o=t("stream-shift"),c=n.from&&n.from!==Uint8Array.from?n.from([0]):new n([0]),l=function(t,e){t._corked?t.once("uncork",e):e()},h=function(t,e){return function(i){i?function(t,e){t._autoDestroy&&t.destroy(e)}(t,"premature close"===i.message?null:i):e&&!t._ended&&t.end()}},u=function(t,e,i){if(!(this instanceof u))return new u(t,e,i);r.Duplex.call(this,i),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!i||!1!==i.autoDestroy,this._forwardDestroy=!i||!1!==i.destroy,this._forwardEnd=!i||!1!==i.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),e&&this.setReadable(e)};a(u,r.Duplex),u.obj=function(t,e,i){return i||(i={}),i.objectMode=!0,i.highWaterMark=16,new u(t,e,i)},u.prototype.cork=function(){1==++this._corked&&this.emit("cork")},u.prototype.uncork=function(){this._corked&&0==--this._corked&&this.emit("uncork")},u.prototype.setWritable=function(t){if(this._unwrite&&this._unwrite(),this.destroyed)t&&t.destroy&&t.destroy();else if(null!==t&&!1!==t){var e=this,n=s(t,{writable:!0,readable:!1},h(this,this._forwardEnd)),r=function(){var t=e._ondrain;e._ondrain=null,t&&t()};this._unwrite&&i.nextTick(r),this._writable=t,this._writable.on("drain",r),this._unwrite=function(){e._writable.removeListener("drain",r),n()},this.uncork()}else this.end()},u.prototype.setReadable=function(t){if(this._unread&&this._unread(),this.destroyed)t&&t.destroy&&t.destroy();else{if(null===t||!1===t)return this.push(null),void this.resume();var e,i=this,n=s(t,{writable:!1,readable:!0},h(this)),a=function(){i._forward()},o=function(){i.push(null)};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:(e=t,new r.Readable({objectMode:!0,highWaterMark:16}).wrap(e)),this._readable2.on("readable",a),this._readable2.on("end",o),this._unread=function(){i._readable2.removeListener("readable",a),i._readable2.removeListener("end",o),n()},this._forward()}},u.prototype._read=function(){this._drained=!0,this._forward()},u.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var t;for(this._forwarding=!0;this._drained&&null!==(t=o(this._readable2));)this.destroyed||(this._drained=this.push(t));this._forwarding=!1}},u.prototype.destroy=function(t){if(!this.destroyed){this.destroyed=!0;var e=this;i.nextTick((function(){e._destroy(t)}))}},u.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null,e?e(t):this.emit("error",t)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},u.prototype._write=function(t,e,i){return this.destroyed?i():this._corked?l(this,this._write.bind(this,t,e,i)):t===c?this._finish(i):this._writable?void(!1===this._writable.write(t)?this._ondrain=i:i()):i()},u.prototype._finish=function(t){var e=this;this.emit("preend"),l(this,(function(){var i,n;i=e._forwardEnd&&e._writable,n=function(){!1===e._writableState.prefinished&&(e._writableState.prefinished=!0),e.emit("prefinish"),l(e,t)},i?i._writableState&&i._writableState.finished?n():i._writableState?i.end(n):(i.end(),n()):n()}))},u.prototype.end=function(t,e,i){return"function"==typeof t?this.end(null,null,t):"function"==typeof e?this.end(t,null,e):(this._ended=!0,t&&this.write(t),this._writableState.ending||this.write(c),r.Writable.prototype.end.call(this,i))},e.exports=u}).call(this)}).call(this,t("_process"),t("buffer").Buffer)},{_process:96,buffer:12,"end-of-stream":16,inherits:84,"readable-stream":143,"stream-shift":115}],135:[function(t,e,i){arguments[4][102][0].apply(i,arguments)},{"./_stream_readable":137,"./_stream_writable":139,"core-util-is":13,dup:102,inherits:84,"process-nextick-args":95}],136:[function(t,e,i){arguments[4][103][0].apply(i,arguments)},{"./_stream_transform":138,"core-util-is":13,dup:103,inherits:84}],137:[function(t,e,i){arguments[4][104][0].apply(i,arguments)},{"./_stream_duplex":135,"./internal/streams/BufferList":140,"./internal/streams/destroy":141,"./internal/streams/stream":142,_process:96,"core-util-is":13,dup:104,events:79,inherits:84,isarray:86,"process-nextick-args":95,"safe-buffer":144,"string_decoder/":160,util:11}],138:[function(t,e,i){arguments[4][105][0].apply(i,arguments)},{"./_stream_duplex":135,"core-util-is":13,dup:105,inherits:84}],139:[function(t,e,i){arguments[4][106][0].apply(i,arguments)},{"./_stream_duplex":135,"./internal/streams/destroy":141,"./internal/streams/stream":142,_process:96,"core-util-is":13,dup:106,inherits:84,"process-nextick-args":95,"safe-buffer":144,timers:116,"util-deprecate":130}],140:[function(t,e,i){arguments[4][107][0].apply(i,arguments)},{dup:107,"safe-buffer":144,util:11}],141:[function(t,e,i){arguments[4][108][0].apply(i,arguments)},{dup:108,"process-nextick-args":95}],142:[function(t,e,i){arguments[4][109][0].apply(i,arguments)},{dup:109,events:79}],143:[function(t,e,i){arguments[4][112][0].apply(i,arguments)},{"./lib/_stream_duplex.js":135,"./lib/_stream_passthrough.js":136,"./lib/_stream_readable.js":137,"./lib/_stream_transform.js":138,"./lib/_stream_writable.js":139,dup:112}],144:[function(t,e,i){arguments[4][110][0].apply(i,arguments)},{buffer:12,dup:110}],145:[function(t,e,i){var n={};function r(t,e,i){i||(i=Error);var r=function(t){var i,n;function r(i,n,r){return t.call(this,function(t,i,n){return"string"==typeof e?e:e(t,i,n)}(i,n,r))||this}return n=t,(i=r).prototype=Object.create(n.prototype),i.prototype.constructor=i,i.__proto__=n,r}(i);r.prototype.name=i.name,r.prototype.code=t,n[t]=r}function s(t,e){if(Array.isArray(t)){var i=t.length;return t=t.map((function(t){return String(t)})),i>2?"one of ".concat(e," ").concat(t.slice(0,i-1).join(", "),", or ")+t[i-1]:2===i?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,i){var n,r,a,o;if("string"==typeof e&&(r="not ",e.substr(!a||a<0?0:+a,r.length)===r)?(n="must not be",e=e.replace(/^not /,"")):n="must be",function(t,e,i){return(void 0===i||i>t.length)&&(i=t.length),t.substring(i-e.length,i)===e}(t," argument"))o="The ".concat(t," ").concat(n," ").concat(s(e,"type"));else{var c=function(t,e,i){return"number"!=typeof i&&(i=0),!(i+e.length>t.length)&&-1!==t.indexOf(e,i)}(t,".")?"property":"argument";o='The "'.concat(t,'" ').concat(c," ").concat(n," ").concat(s(e,"type"))}return o+=". Received type ".concat(typeof i)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},{}],146:[function(t,e,i){(function(i){(function(){var n=Object.keys||function(t){var e=[];for(var i in t)e.push(i);return e};e.exports=l;var r=t("./_stream_readable"),s=t("./_stream_writable");t("inherits")(l,r);for(var a=n(s.prototype),o=0;o<a.length;o++){var c=a[o];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(t){if(!(this instanceof l))return new l(t);r.call(this,t),s.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||i.nextTick(u,this)}function u(t){t.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,t("_process"))},{"./_stream_readable":148,"./_stream_writable":150,_process:96,inherits:84}],147:[function(t,e,i){e.exports=r;var n=t("./_stream_transform");function r(t){if(!(this instanceof r))return new r(t);n.call(this,t)}t("inherits")(r,n),r.prototype._transform=function(t,e,i){i(null,t)}},{"./_stream_transform":149,inherits:84}],148:[function(t,e,i){(function(i,n){(function(){var r;e.exports=D,D.ReadableState=C,t("events").EventEmitter;var s=function(t,e){return t.listeners(e).length},a=t("./internal/streams/stream"),o=t("buffer").Buffer,c=n.Uint8Array||function(){};var l,h=t("util");l=h&&h.debuglog?h.debuglog("stream"):function(){};var u,d,p,f=t("./internal/streams/buffer_list"),m=t("./internal/streams/destroy"),g=t("./internal/streams/state").getHighWaterMark,y=t("../errors").codes,w=y.ERR_INVALID_ARG_TYPE,v=y.ERR_STREAM_PUSH_AFTER_EOF,b=y.ERR_METHOD_NOT_IMPLEMENTED,E=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t("inherits")(D,a);var _=m.errorOrDestroy,I=["error","close","destroy","pause","resume"];function C(e,i,n){r=r||t("./_stream_duplex"),e=e||{},"boolean"!=typeof n&&(n=i instanceof r),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",n),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(u||(u=t("string_decoder/").StringDecoder),this.decoder=new u(e.encoding),this.encoding=e.encoding)}function D(e){if(r=r||t("./_stream_duplex"),!(this instanceof D))return new D(e);var i=this instanceof r;this._readableState=new C(e,this,i),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function S(t,e,i,n,r){l("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(l("onEofChunk"),e.ended)return;if(e.decoder){var i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?T(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,O(t)))}(t,a);else if(r||(s=function(t,e){var i;n=e,o.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(i=new w("chunk",["string","Buffer","Uint8Array"],e));var n;return i}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===o.prototype||(e=function(t){return o.from(t)}(e)),n)a.endEmitted?_(t,new E):A(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!i?(e=a.decoder.write(e),a.objectMode||0!==e.length?A(t,a,e,!1):L(t,a)):A(t,a,e,!1)}else n||(a.reading=!1,L(t,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function A(t,e,i,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.needReadable&&T(t)),L(t,e)}Object.defineProperty(D.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),D.prototype.destroy=m.destroy,D.prototype._undestroy=m.undestroy,D.prototype._destroy=function(t,e){e(t)},D.prototype.push=function(t,e){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=o.from(t,e),e=""),i=!0),S(this,t,e,!1,i)},D.prototype.unshift=function(t){return S(this,t,null,!0,!1)},D.prototype.isPaused=function(){return!1===this._readableState.flowing},D.prototype.setEncoding=function(e){u||(u=t("string_decoder/").StringDecoder);var i=new u(e);this._readableState.decoder=i,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=i.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var x=1073741824;function P(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function T(t){var e=t._readableState;l("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(l("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(O,t))}function O(t){var e=t._readableState;l("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,V(t)}function L(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(R,t,e))}function R(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var i=e.length;if(l("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}function M(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function k(t){l("readable nexttick read 0"),t.read(0)}function N(t,e){l("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),V(t),e.flowing&&!e.reading&&t.read(0)}function V(t){var e=t._readableState;for(l("flow",e.flowing);e.flowing&&null!==t.read(););}function F(t,e){return 0===e.length?null:(e.objectMode?i=e.buffer.shift():!t||t>=e.length?(i=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i);var i}function j(t){var e=t._readableState;l("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(B,e,t))}function B(t,e){if(l("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var i=e._writableState;(!i||i.autoDestroy&&i.finished)&&e.destroy()}}function U(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}D.prototype.read=function(t){l("read",t),t=parseInt(t,10);var e=this._readableState,i=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?j(this):T(this),null;if(0===(t=P(t,e))&&e.ended)return 0===e.length&&j(this),null;var n,r=e.needReadable;return l("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&l("length less than watermark",r=!0),e.ended||e.reading?l("reading or ended",r=!1):r&&(l("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=P(i,e))),null===(n=t>0?F(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&j(this)),null!==n&&this.emit("data",n),n},D.prototype._read=function(t){_(this,new b("_read()"))},D.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1,l("pipe count=%d opts=%j",r.pipesCount,e);var a=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?c:g;function o(e,i){l("onunpipe"),e===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),t.removeListener("close",f),t.removeListener("finish",m),t.removeListener("drain",h),t.removeListener("error",p),t.removeListener("unpipe",o),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",d),u=!0,!r.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function c(){l("onend"),t.end()}r.endEmitted?i.nextTick(a):n.once("end",a),t.on("unpipe",o);var h=function(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,V(t))}}(n);t.on("drain",h);var u=!1;function d(e){l("ondata");var i=t.write(e);l("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===t||r.pipesCount>1&&-1!==U(r.pipes,t))&&!u&&(l("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function p(e){l("onerror",e),g(),t.removeListener("error",p),0===s(t,"error")&&_(t,e)}function f(){t.removeListener("finish",m),g()}function m(){l("onfinish"),t.removeListener("close",f),g()}function g(){l("unpipe"),n.unpipe(t)}return n.on("data",d),function(t,e,i){if("function"==typeof t.prependListener)return t.prependListener(e,i);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]:t.on(e,i)}(t,"error",p),t.once("close",f),t.once("finish",m),t.emit("pipe",n),r.flowing||(l("pipe resume"),n.resume()),t},D.prototype.unpipe=function(t){var e=this._readableState,i={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,i)),this;if(!t){var n=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<r;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}var a=U(e.pipes,t);return-1===a||(e.pipes.splice(a,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,i)),this},D.prototype.on=function(t,e){var n=a.prototype.on.call(this,t,e),r=this._readableState;return"data"===t?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===t&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,l("on readable",r.length,r.reading),r.length?T(this):r.reading||i.nextTick(k,this))),n},D.prototype.addListener=D.prototype.on,D.prototype.removeListener=function(t,e){var n=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(M,this),n},D.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(M,this),e},D.prototype.resume=function(){var t=this._readableState;return t.flowing||(l("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(N,t,e))}(this,t)),t.paused=!1,this},D.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},D.prototype.wrap=function(t){var e=this,i=this._readableState,n=!1;for(var r in t.on("end",(function(){if(l("wrapped end"),i.decoder&&!i.ended){var t=i.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(r){(l("wrapped data"),i.decoder&&(r=i.decoder.write(r)),i.objectMode&&null==r)||(i.objectMode||r&&r.length)&&(e.push(r)||(n=!0,t.pause()))})),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));for(var s=0;s<I.length;s++)t.on(I[s],this.emit.bind(this,I[s]));return this._read=function(e){l("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(D.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=t("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(D.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(D.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(D.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),D._fromList=F,Object.defineProperty(D.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(D.from=function(e,i){return void 0===p&&(p=t("./internal/streams/from")),p(D,e,i)})}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":145,"./_stream_duplex":146,"./internal/streams/async_iterator":151,"./internal/streams/buffer_list":152,"./internal/streams/destroy":153,"./internal/streams/from":155,"./internal/streams/state":157,"./internal/streams/stream":158,_process:96,buffer:12,events:79,inherits:84,"string_decoder/":160,util:11}],149:[function(t,e,i){e.exports=h;var n=t("../errors").codes,r=n.ERR_METHOD_NOT_IMPLEMENTED,s=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,o=n.ERR_TRANSFORM_WITH_LENGTH_0,c=t("./_stream_duplex");function l(t,e){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(null===n)return this.emit("error",new s);i.writechunk=null,i.writecb=null,null!=e&&this.push(e),n(t);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function h(t){if(!(this instanceof h))return new h(t);c.call(this,t),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",u)}function u(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?d(this,null,null):this._flush((function(e,i){d(t,e,i)}))}function d(t,e,i){if(e)return t.emit("error",e);if(null!=i&&t.push(i),t._writableState.length)throw new o;if(t._transformState.transforming)throw new a;return t.push(null)}t("inherits")(h,c),h.prototype.push=function(t,e){return this._transformState.needTransform=!1,c.prototype.push.call(this,t,e)},h.prototype._transform=function(t,e,i){i(new r("_transform()"))},h.prototype._write=function(t,e,i){var n=this._transformState;if(n.writecb=i,n.writechunk=t,n.writeencoding=e,!n.transforming){var r=this._readableState;(n.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},h.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},h.prototype._destroy=function(t,e){c.prototype._destroy.call(this,t,(function(t){e(t)}))}},{"../errors":145,"./_stream_duplex":146,inherits:84}],150:[function(t,e,i){(function(i,n){(function(){function r(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,i){var n=t.entry;t.entry=null;for(;n;){var r=n.callback;e.pendingcb--,r(i),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}var s;e.exports=D,D.WritableState=C;var a={deprecate:t("util-deprecate")},o=t("./internal/streams/stream"),c=t("buffer").Buffer,l=n.Uint8Array||function(){};var h,u=t("./internal/streams/destroy"),d=t("./internal/streams/state").getHighWaterMark,p=t("../errors").codes,f=p.ERR_INVALID_ARG_TYPE,m=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,y=p.ERR_STREAM_CANNOT_PIPE,w=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,b=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=u.errorOrDestroy;function I(){}function C(e,n,a){s=s||t("./_stream_duplex"),e=e||{},"boolean"!=typeof a&&(a=n instanceof s),this.objectMode=!!e.objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,s=n.writecb;if("function"!=typeof s)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,s){--e.pendingcb,n?(i.nextTick(s,r),i.nextTick(O,t,e),t._writableState.errorEmitted=!0,_(t,r)):(s(r),t._writableState.errorEmitted=!0,_(t,r),O(t,e))}(t,n,r,e,s);else{var a=P(n)||t.destroyed;a||n.corked||n.bufferProcessing||!n.bufferedRequest||x(t,n),r?i.nextTick(A,t,n,a,s):A(t,n,a,s)}}(n,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function D(e){var i=this instanceof(s=s||t("./_stream_duplex"));if(!i&&!h.call(D,this))return new D(e);this._writableState=new C(e,this,i),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function S(t,e,i,n,r,s,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new w("write")):i?t._writev(r,e.onwrite):t._write(r,s,e.onwrite),e.sync=!1}function A(t,e,i,n){i||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),O(t,e)}function x(t,e){e.bufferProcessing=!0;var i=e.bufferedRequest;if(t._writev&&i&&i.next){var n=e.bufferedRequestCount,s=new Array(n),a=e.corkedRequestsFree;a.entry=i;for(var o=0,c=!0;i;)s[o]=i,i.isBuf||(c=!1),i=i.next,o+=1;s.allBuffers=c,S(t,e,!0,e.length,s,"",a.finish),e.pendingcb++,e.lastBufferedRequest=null,a.next?(e.corkedRequestsFree=a.next,a.next=null):e.corkedRequestsFree=new r(e),e.bufferedRequestCount=0}else{for(;i;){var l=i.chunk,h=i.encoding,u=i.callback;if(S(t,e,!1,e.objectMode?1:l.length,l,h,u),i=i.next,e.bufferedRequestCount--,e.writing)break}null===i&&(e.lastBufferedRequest=null)}e.bufferedRequest=i,e.bufferProcessing=!1}function P(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function T(t,e){t._final((function(i){e.pendingcb--,i&&_(t,i),e.prefinished=!0,t.emit("prefinish"),O(t,e)}))}function O(t,e){var n=P(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(T,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var r=t._readableState;(!r||r.autoDestroy&&r.endEmitted)&&t.destroy()}return n}t("inherits")(D,o),C.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(C.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(D,Symbol.hasInstance,{value:function(t){return!!h.call(this,t)||this===D&&(t&&t._writableState instanceof C)}})):h=function(t){return t instanceof this},D.prototype.pipe=function(){_(this,new y)},D.prototype.write=function(t,e,n){var r,s=this._writableState,a=!1,o=!s.objectMode&&(r=t,c.isBuffer(r)||r instanceof l);return o&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(n=e,e=null),o?e="buffer":e||(e=s.defaultEncoding),"function"!=typeof n&&(n=I),s.ending?function(t,e){var n=new b;_(t,n),i.nextTick(e,n)}(this,n):(o||function(t,e,n,r){var s;return null===n?s=new v:"string"==typeof n||e.objectMode||(s=new f("chunk",["string","Buffer"],n)),!s||(_(t,s),i.nextTick(r,s),!1)}(this,s,t,n))&&(s.pendingcb++,a=function(t,e,i,n,r,s){if(!i){var a=function(t,e,i){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,i));return e}(e,n,r);n!==a&&(i=!0,r="buffer",n=a)}var o=e.objectMode?1:n.length;e.length+=o;var l=e.length<e.highWaterMark;l||(e.needDrain=!0);if(e.writing||e.corked){var h=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:s,next:null},h?h.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else S(t,e,!1,o,n,r,s);return l}(this,s,o,t,e,n)),a},D.prototype.cork=function(){this._writableState.corked++},D.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||x(this,t))},D.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(D.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(D.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),D.prototype._write=function(t,e,i){i(new m("_write()"))},D.prototype._writev=null,D.prototype.end=function(t,e,n){var r=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||function(t,e,n){e.ending=!0,O(t,e),n&&(e.finished?i.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n),this},Object.defineProperty(D.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(D.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),D.prototype.destroy=u.destroy,D.prototype._undestroy=u.undestroy,D.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":145,"./_stream_duplex":146,"./internal/streams/destroy":153,"./internal/streams/state":157,"./internal/streams/stream":158,_process:96,buffer:12,inherits:84,"util-deprecate":130}],151:[function(t,e,i){(function(i){(function(){var n;function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var s=t("./end-of-stream"),a=Symbol("lastResolve"),o=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),h=Symbol("lastPromise"),u=Symbol("handlePromise"),d=Symbol("stream");function p(t,e){return{value:t,done:e}}function f(t){var e=t[a];if(null!==e){var i=t[d].read();null!==i&&(t[h]=null,t[a]=null,t[o]=null,e(p(i,!1)))}}function m(t){i.nextTick(f,t)}var g=Object.getPrototypeOf((function(){})),y=Object.setPrototypeOf((r(n={get stream(){return this[d]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise((function(e,n){i.nextTick((function(){t[c]?n(t[c]):e(p(void 0,!0))}))}));var n,r=this[h];if(r)n=new Promise(function(t,e){return function(i,n){t.then((function(){e[l]?i(p(void 0,!0)):e[u](i,n)}),n)}}(r,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(p(s,!1));n=new Promise(this[u])}return this[h]=n,n}},Symbol.asyncIterator,(function(){return this})),r(n,"return",(function(){var t=this;return new Promise((function(e,i){t[d].destroy(null,(function(t){t?i(t):e(p(void 0,!0))}))}))})),n),g);e.exports=function(t){var e,i=Object.create(y,(r(e={},d,{value:t,writable:!0}),r(e,a,{value:null,writable:!0}),r(e,o,{value:null,writable:!0}),r(e,c,{value:null,writable:!0}),r(e,l,{value:t._readableState.endEmitted,writable:!0}),r(e,u,{value:function(t,e){var n=i[d].read();n?(i[h]=null,i[a]=null,i[o]=null,t(p(n,!1))):(i[a]=t,i[o]=e)},writable:!0}),e));return i[h]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=i[o];return null!==e&&(i[h]=null,i[a]=null,i[o]=null,e(t)),void(i[c]=t)}var n=i[a];null!==n&&(i[h]=null,i[a]=null,i[o]=null,n(p(void 0,!0))),i[l]=!0})),t.on("readable",m.bind(null,i)),i}}).call(this)}).call(this,t("_process"))},{"./end-of-stream":154,_process:96}],152:[function(t,e,i){function n(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function s(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}var a=t("buffer").Buffer,o=t("util").inspect,c=o&&o.custom||"inspect";e.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,i,l;return e=t,i=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,i=""+e.data;e=e.next;)i+=t+e.data;return i}},{key:"concat",value:function(t){if(0===this.length)return a.alloc(0);for(var e,i,n,r=a.allocUnsafe(t>>>0),s=this.head,o=0;s;)e=s.data,i=r,n=o,a.prototype.copy.call(e,i,n),o+=s.data.length,s=s.next;return r}},{key:"consume",value:function(t,e){var i;return t<this.head.data.length?(i=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):i=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,i=1,n=e.data;for(t-=n.length;e=e.next;){var r=e.data,s=t>r.length?r.length:t;if(s===r.length?n+=r:n+=r.slice(0,t),0==(t-=s)){s===r.length?(++i,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=r.slice(s));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(t){var e=a.allocUnsafe(t),i=this.head,n=1;for(i.data.copy(e),t-=i.data.length;i=i.next;){var r=i.data,s=t>r.length?r.length:t;if(r.copy(e,e.length-t,0,s),0==(t-=s)){s===r.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=r.slice(s));break}++n}return this.length-=n,e}},{key:c,value:function(t,e){return o(this,function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?n(Object(i),!0).forEach((function(e){r(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},e,{depth:0,customInspect:!1}))}}],i&&s(e.prototype,i),l&&s(e,l),t}()},{buffer:12,util:11}],153:[function(t,e,i){(function(t){(function(){function i(t,e){r(t,e),n(t)}function n(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function r(t,e){t.emit("error",e)}e.exports={destroy:function(e,s){var a=this,o=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return o||c?(s?s(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(r,this,e)):t.nextTick(r,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!s&&e?a._writableState?a._writableState.errorEmitted?t.nextTick(n,a):(a._writableState.errorEmitted=!0,t.nextTick(i,a,e)):t.nextTick(i,a,e):s?(t.nextTick(n,a),s(e)):t.nextTick(n,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var i=t._readableState,n=t._writableState;i&&i.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this)}).call(this,t("_process"))},{_process:96}],154:[function(t,e,i){var n=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function r(){}e.exports=function t(e,i,s){if("function"==typeof i)return t(e,null,i);i||(i={}),s=function(t){var e=!1;return function(){if(!e){e=!0;for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];t.apply(this,n)}}}(s||r);var a=i.readable||!1!==i.readable&&e.readable,o=i.writable||!1!==i.writable&&e.writable,c=function(){e.writable||h()},l=e._writableState&&e._writableState.finished,h=function(){o=!1,l=!0,a||s.call(e)},u=e._readableState&&e._readableState.endEmitted,d=function(){a=!1,u=!0,o||s.call(e)},p=function(t){s.call(e,t)},f=function(){var t;return a&&!u?(e._readableState&&e._readableState.ended||(t=new n),s.call(e,t)):o&&!l?(e._writableState&&e._writableState.ended||(t=new n),s.call(e,t)):void 0},m=function(){e.req.on("finish",h)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?o&&!e._writableState&&(e.on("end",c),e.on("close",c)):(e.on("complete",h),e.on("abort",f),e.req?m():e.on("request",m)),e.on("end",d),e.on("finish",h),!1!==i.error&&e.on("error",p),e.on("close",f),function(){e.removeListener("complete",h),e.removeListener("abort",f),e.removeListener("request",m),e.req&&e.req.removeListener("finish",h),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",h),e.removeListener("end",d),e.removeListener("error",p),e.removeListener("close",f)}}},{"../../../errors":145}],155:[function(t,e,i){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],156:[function(t,e,i){var n;var r=t("../../../errors").codes,s=r.ERR_MISSING_ARGS,a=r.ERR_STREAM_DESTROYED;function o(t){if(t)throw t}function c(t){t()}function l(t,e){return t.pipe(e)}e.exports=function(){for(var e=arguments.length,i=new Array(e),r=0;r<e;r++)i[r]=arguments[r];var h,u=function(t){return t.length?"function"!=typeof t[t.length-1]?o:t.pop():o}(i);if(Array.isArray(i[0])&&(i=i[0]),i.length<2)throw new s("streams");var d=i.map((function(e,r){var s=r<i.length-1;return function(e,i,r,s){s=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(s);var o=!1;e.on("close",(function(){o=!0})),void 0===n&&(n=t("./end-of-stream")),n(e,{readable:i,writable:r},(function(t){if(t)return s(t);o=!0,s()}));var c=!1;return function(t){if(!o&&!c)return c=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new a("pipe"))}}(e,s,r>0,(function(t){h||(h=t),t&&d.forEach(c),s||(d.forEach(c),u(h))}))}));return i.reduce(l)}},{"../../../errors":145,"./end-of-stream":154}],157:[function(t,e,i){var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(t,e,i,r){var s=function(t,e,i){return null!=t.highWaterMark?t.highWaterMark:e?t[i]:null}(e,r,i);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(r?i:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}}},{"../../../errors":145}],158:[function(t,e,i){arguments[4][109][0].apply(i,arguments)},{dup:109,events:79}],159:[function(t,e,i){(i=e.exports=t("./lib/_stream_readable.js")).Stream=i,i.Readable=i,i.Writable=t("./lib/_stream_writable.js"),i.Duplex=t("./lib/_stream_duplex.js"),i.Transform=t("./lib/_stream_transform.js"),i.PassThrough=t("./lib/_stream_passthrough.js"),i.finished=t("./lib/internal/streams/end-of-stream.js"),i.pipeline=t("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":146,"./lib/_stream_passthrough.js":147,"./lib/_stream_readable.js":148,"./lib/_stream_transform.js":149,"./lib/_stream_writable.js":150,"./lib/internal/streams/end-of-stream.js":154,"./lib/internal/streams/pipeline.js":156}],160:[function(t,e,i){arguments[4][111][0].apply(i,arguments)},{dup:111,"safe-buffer":161}],161:[function(t,e,i){arguments[4][110][0].apply(i,arguments)},{buffer:12,dup:110}],162:[function(t,e,i){(function(i,n){(function(){var r=t("readable-stream").Transform,s=t("duplexify"),a=t("ws"),o=t("safe-buffer").Buffer;e.exports=function(t,e,c){var l,h,u="browser"===i.title,d=!!n.WebSocket,p=u?function t(e,i,n){if(h.bufferedAmount>m)return void setTimeout(t,g,e,i,n);y&&"string"==typeof e&&(e=o.from(e,"utf8"));try{h.send(e)}catch(t){return n(t)}n()}:function(t,e,i){if(h.readyState!==h.OPEN)return void i();y&&"string"==typeof t&&(t=o.from(t,"utf8"));h.send(t,i)};e&&!Array.isArray(e)&&"object"==typeof e&&(c=e,e=null,("string"==typeof c.protocol||Array.isArray(c.protocol))&&(e=c.protocol));c||(c={});void 0===c.objectMode&&(c.objectMode=!(!0===c.binary||void 0===c.binary));var f=function(t,e,i){var n=new r({objectMode:t.objectMode});return n._write=e,n._flush=i,n}(c,p,(function(t){h.close(),t()}));c.objectMode||(f._writev=function(t,e){for(var i=new Array(t.length),n=0;n<t.length;n++)"string"==typeof t[n].chunk?i[n]=o.from(t[n],"utf8"):i[n]=t[n].chunk;this._write(o.concat(i),"binary",e)});var m=c.browserBufferSize||524288,g=c.browserBufferTimeout||1e3;"object"==typeof t?h=t:(h=d&&u?new a(t,e):new a(t,e,c)).binaryType="arraybuffer";h.readyState===h.OPEN?l=f:u?((l=f).cork(),h.onopen=function(){l.uncork(),l.emit("connect")}):(l=s.obj(),h.onopen=function(){l.setReadable(f),l.setWritable(f),l.emit("connect")});l.socket=h,h.onclose=function(){l.end(),l.destroy()},h.onerror=function(t){l.destroy(t)},h.onmessage=function(t){var e=t.data;e=e instanceof ArrayBuffer?o.from(e):o.from(e,"utf8");f.push(e)},f.on("close",(function(){h.close()}));var y=!c.objectMode;return l}}).call(this)}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:96,duplexify:134,"readable-stream":159,"safe-buffer":114,ws:163}],163:[function(t,e,i){var n=null;"undefined"!=typeof WebSocket?n=WebSocket:"undefined"!=typeof MozWebSocket?n=MozWebSocket:"undefined"!=typeof window&&(n=window.WebSocket||window.MozWebSocket),e.exports=n},{}],164:[function(t,e,i){e.exports=function t(e,i){if(e&&i)return t(e)(i);if("function"!=typeof e)throw new TypeError("need wrapper function");return Object.keys(e).forEach((function(t){n[t]=e[t]})),n;function n(){for(var t=new Array(arguments.length),i=0;i<t.length;i++)t[i]=arguments[i];var n=e.apply(this,t),r=t[t.length-1];return"function"==typeof n&&n!==r&&Object.keys(r).forEach((function(t){n[t]=r[t]})),n}}},{}],165:[function(t,e,i){e.exports=function(){for(var t={},e=0;e<arguments.length;e++){var i=arguments[e];for(var r in i)n.call(i,r)&&(t[r]=i[r])}return t};var n=Object.prototype.hasOwnProperty},{}]},{},[8])(8)}))}}),pe=_t({"../../node_modules/.pnpm/path-browserify@1.0.1/node_modules/path-browserify/index.js"(t,e){function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var i,n="",r=0,s=-1,a=0,o=0;o<=t.length;++o){if(o<t.length)i=t.charCodeAt(o);else{if(47===i)break;i=47}if(47===i){if(s===o-1||1===a);else if(s!==o-1&&2===a){if(n.length<2||2!==r||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",r=0):r=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),s=o,a=0;continue}}else if(2===n.length||1===n.length){n="",r=0,s=o,a=0;continue}e&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+t.slice(s+1,o):n=t.slice(s+1,o),r=o-s-1;s=o,a=0}else 46===i&&-1!==a?++a:a=-1}return n}var r={resolve:function(){for(var t,e="",r=!1,s=arguments.length-1;s>=-1&&!r;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=process.cwd()),a=t),i(a),0!==a.length&&(e=a+"/"+e,r=47===a.charCodeAt(0))}return e=n(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),r=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!e)).length||e||(t="."),t.length>0&&r&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(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 n=arguments[e];i(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":r.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=r.resolve(t))===(e=r.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var s=t.length,a=s-n,o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var c=e.length-o,l=a<c?a:c,h=-1,u=0;u<=l;++u){if(u===l){if(c>l){if(47===e.charCodeAt(o+u))return e.slice(o+u+1);if(0===u)return e.slice(o+u)}else a>l&&(47===t.charCodeAt(n+u)?h=u:0===u&&(h=0));break}var d=t.charCodeAt(n+u);if(d!==e.charCodeAt(o+u))break;47===d&&(h=u)}var p="";for(u=n+h+1;u<=s;++u)u!==s&&47!==t.charCodeAt(u)||(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(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,r=-1,s=!0,a=t.length-1;a>=1;--a)if(47===(e=t.charCodeAt(a))){if(!s){r=a;break}}else s=!1;return-1===r?n?"/":".":n&&1===r?"//":t.slice(0,r)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var n,r=0,s=-1,a=!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(n=t.length-1;n>=0;--n){var l=t.charCodeAt(n);if(47===l){if(!a){r=n+1;break}}else-1===c&&(a=!1,c=n+1),o>=0&&(l===e.charCodeAt(o)?-1==--o&&(s=n):(o=-1,s=c))}return r===s?s=c:-1===s&&(s=t.length),t.slice(r,s)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!a){r=n+1;break}}else-1===s&&(a=!1,s=n+1);return-1===s?"":t.slice(r,s)},extname:function(t){i(t);for(var e=-1,n=0,r=-1,s=!0,a=0,o=t.length-1;o>=0;--o){var c=t.charCodeAt(o);if(47!==c)-1===r&&(s=!1,r=o+1),46===c?-1===e?e=o:1!==a&&(a=1):-1!==e&&(a=-1);else if(!s){n=o+1;break}}return-1===e||-1===r||0===a||1===a&&e===r-1&&e===n+1?"":t.slice(e,r)},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 i=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+n:i+t+n:n}("/",t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,r=t.charCodeAt(0),s=47===r;s?(e.root="/",n=1):n=0;for(var a=-1,o=0,c=-1,l=!0,h=t.length-1,u=0;h>=n;--h)if(47!==(r=t.charCodeAt(h)))-1===c&&(l=!1,c=h+1),46===r?-1===a?a=h:1!==u&&(u=1):-1!==a&&(u=-1);else if(!l){o=h+1;break}return-1===a||-1===c||0===u||1===u&&a===c-1&&a===o+1?-1!==c&&(e.base=e.name=0===o&&s?t.slice(1,c):t.slice(o,c)):(0===o&&s?(e.name=t.slice(1,a),e.base=t.slice(1,c)):(e.name=t.slice(o,a),e.base=t.slice(o,c)),e.ext=t.slice(a,c)),o>0?e.dir=t.slice(0,o-1):s&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,e.exports=r}}),fe=class{constructor(){this.view={enableDataInfoBar:!0,expCacheMode:"TABEXPPANEL:"},this.grid={editShowMode:"row",editSaveMode:"cell-blur"},this.appMenu={enableEcho:!0},this.codeList={timeout:36e5}}},me=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 i=this.providers.get(t);if(i)return i(...e)}}),ge=class{static isHelperName(t){return this.helperNames.includes(t)}static handleJudgmentExecute(t,e,i){return i.fn?e?i.fn(t):i.inverse(t):e?i.hash.yes=!0:i.hash.no=!1}};ge.helperNames=["lookup","log","and","camelCase","concat","eq","gt","get","lowerCase","lt","lte","neq","not","or","pascalCase","pluralize","snakeCase","spinalCase","upperCase"];var ye=class{constructor(t,e){t.registerHelper(e,this.onExecute)}},we=class extends ye{constructor(t){super(t,"and")}onExecute(...t){const e=t[t.length-1];t.pop();const i=t.filter((t=>!!t)).length===t.length;return ge.handleJudgmentExecute(this,i,e)}},ve=class extends ye{constructor(t){super(t,"camelCase")}onExecute(t){return t?P(t):""}},be=class extends ye{constructor(t){super(t,"concat")}onExecute(...t){return t.pop(),t.join("")}},Ee=class extends ye{constructor(t){super(t,"eq")}onExecute(t,e,i){const n=T(t,e);return ge.handleJudgmentExecute(this,n,i)}},_e=class extends ye{constructor(t){super(t,"gt")}onExecute(t,e,i){const n=O(t,e);return ge.handleJudgmentExecute(this,n,i)}},Ie=class extends ye{constructor(t){super(t,"gte")}onExecute(t,e,i){const n=L(t,e);return ge.handleJudgmentExecute(this,n,i)}},Ce=class extends ye{constructor(t){super(t,"eqPropertyValue")}onExecute(t,e,i,n){let r=!1;return r=D(t)?!T(R(t,(t=>T(t[e],i))),-1):t.hasOwnProperty(e)&&(r=T(t[e],i)),ge.handleJudgmentExecute(this,r,n)}},De=class extends ye{constructor(t){super(t,"jsonParse")}onExecute(t){return JSON.parse(t)}},Se=class extends ye{constructor(t){super(t,"jsonStringify")}onExecute(t,e){return JSON.stringify(t,null,"number"==typeof e?e:void 0)}},Ae=class extends ye{constructor(t){super(t,"lowerCase")}onExecute(t){return t?t.toLowerCase():""}},xe=class extends ye{constructor(t){super(t,"lt")}onExecute(t,e,i){const n=M(t,e);return ge.handleJudgmentExecute(this,n,i)}},Pe=class extends ye{constructor(t){super(t,"lte")}onExecute(t,e,i){const n=k(t,e);return ge.handleJudgmentExecute(this,n,i)}},Te=class extends ye{constructor(t){super(t,"neq")}onExecute(t,e,i){const n=!T(t,e);return ge.handleJudgmentExecute(this,n,i)}},Oe=class extends ye{constructor(t){super(t,"not")}onExecute(t,e){const i=Handlebars.Utils.isEmpty(t);return ge.handleJudgmentExecute(this,i,e)}},Le=class extends ye{constructor(t){super(t,"or")}onExecute(...t){var e;const i=t[t.length-1];t.pop();const n=t.find((t=>!!t));if(i.fn){const t=(null==(e=i.data)?void 0:e.root)||{};return n?i.fn(t):i.inverse(t)}return n||""}},Re=class extends ye{constructor(t){super(t,"pascalCase")}onExecute(t){return t?N(t):""}},Me=class extends ye{constructor(t){super(t,"snakeCase")}onExecute(t){return t?V(t):""}},ke=class extends ye{constructor(t){super(t,"spinalCase")}onExecute(t){return t?F(t):""}},Ne=class extends ye{constructor(t){super(t,"upperCase")}onExecute(t){return t?t.toUpperCase():""}};var Ve=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((()=>It(ue(),1))),this.hsb=await this.p,this.p=null,t=this.hsb,new we(t),new ve(t),new be(t),new Ee(t),new _e(t),new Ie(t),new De(t),new Se(t),new Ae(t),new xe(t),new Pe(t),new Te(t),new Oe(t),new Le(t),new Re(t),new Me(t),new ke(t),new Ne(t),new Ce(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 Fe(t){const e=[],i=/^%(.+)%$/;for(const n in t){let r=!0,s=t[n];B(t[n])&&i.test(t[n])&&(r=!1,s=t[n].substring(1,t[n].length-1)),e.push({key:n.toLowerCase(),rawValue:r,value:s})}return e}function je(t,...e){if(!t||I(t))return{};return Ue(Array.isArray(t)?t:Fe(t),...e)}function Be(t,e){const i=t.find((t=>!U(t)&&(t[e]||Object.prototype.hasOwnProperty.call(t,e))));return{find:!!i,value:null==i?void 0:i[e]}}function Ue(t,...e){const i=/\$\{[^}]*\}/g,n={};for(const r of t)if(r.rawValue)n[r.key.toLowerCase()]=r.value||null;else{const t=r.value.match(i);if(null!==t){let i=r.value;t.forEach((t=>{const{find:n,value:r}=Be(e,t.slice(2,-1));n&&(i=i.replace(t,"".concat(r)))})),n[r.key.toLowerCase()]=i}else{const{find:t,value:i}=Be(e,r.value);t&&(n[r.key.toLowerCase()]=i)}}return n}function We(t,e){const i={};if(!t)return i;const n=Array.isArray(t)?t:Fe(t),r=e[0];return n.forEach((t=>{const{rawValue:n,value:s}=t;!n&&s&&Object.prototype.hasOwnProperty.call(r,s)&&(i[s]=e.map((t=>t[s])).join(";"))})),i}function ze(t,e){const{deName:i,navFilter:n,pickupDEFName:r,navContexts:s,navParams:a}=t,{context:o,params:c,data:l,derValue:h}=e,u={},d={},p=h||l.srfkey;p&&(i&&(u[i]=p),n&&(d[n]=p),r&&(d["n_".concat(r.toLowerCase(),"_eq")]=p));const f=je(s,l,c,o),m=je(a,l,c,o);return Object.assign(u,f),Object.assign(d,m),{resultContext:u,resultParams:d}}function Ge(t,e){if(t){const i=t.find((t=>t.id===e));if(i)return i}return null}function He(t){const e={},i={},n={};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const s=t[r];if(-1!==r.indexOf(".")){const t=r.split(".");switch(t[0]){case"SRFNAVPARAM":Object.assign(e,{[t[1]]:s});break;case"SRFNAVCTX":Object.assign(i,{[t[1]]:s});break;default:Object.assign(n,{key:s})}}}return{navigateContexts:e,navigateParams:i,other:n}}function qe(t){const{width:e,height:i,widthMode:n,heightMode:r}=t,s={width:"",height:""};return"FULL"===n?s.width="100%":e&&e>0&&(s.width=e>0&&e<=1?"".concat(100*e,"%"):"".concat(e,"PERCENTAGE"===n?"%":"px")),"FULL"===r?s.height="100%":i&&i>0&&(s.height=i>0&&i<=1?"".concat(100*i,"%"):"".concat(i,"PERCENTAGE"===r?"%":"px")),s}function Ke(t,e){const i=[],n=bi.execScriptFn({data:e},t,{singleRowReturn:!0,isAsync:!1});return C(n)?i.push(n):D(n)?i.push(...n):S(n)&&Object.keys(n).forEach((t=>{n[t]&&i.push(t)})),i}function Xe(t,e){const{mainStateAppDEFieldIds:i,demainStates:n}=t;if(i&&n){const t=[];return i.forEach((i=>{t.push(e[i])})),n.find((e=>{const{stateValue:i,state2Value:n,state3Value:r}=e;let s=!0;const a=[i,n,r];for(let e=0;e<t.length;e++)if("".concat(t[e])!=="".concat(a[e])){s=!1;break}return s}))}}function Ye(t,e){const i=ibiz.hub.getApp().model,{demainStateOPPrivs:n,opprivAllowMode:r}=t,s=(null==n?void 0:n.map((t=>t.name)))||[];let a=[];if(r)a=s;else{a=[...i.deopprivs,...e.deopprivs].filter((t=>!s.includes(t.name))).map((t=>t.name))}return a}function $e(t){return t.split(".").pop()}function Qe(t,e){const i=$e(e);return B(t[i])}async function Je(t){return(await ibiz.hub.getAppDataEntity(t)).formTypeAppDEFieldId}function Ze(t,e){var i;return null==(i=e.appDELogics)?void 0:i.find((e=>e.id===t))}function ti(t,e){var i,n;const r=[];return null==(i=t.appDEFields)||i.forEach((t=>{"compute"===e&&t.computeAppDEFLogicId?r.push(t.computeAppDEFLogicId):"change"===e&&t.onChangeAppDEFLogicId?r.push(t.onChangeAppDEFLogicId):"default"===e&&t.defaultValueAppDEFLogicId&&r.push(t.defaultValueAppDEFLogicId)})),(null==(n=t.appDELogics)?void 0:n.filter((t=>r.includes(t.id))))||[]}function ei(t,e){var i;return null==(i=t.appDEFields)?void 0:i.find((t=>t.id===e))}async function ii(t){const[,,e]=t.split("@");return ibiz.hub.getApp(e).getUIAction(t)}function ni(t){return t.detreeNodes.find((t=>t.rootNode))}function ri(t,e){return t.detreeNodes.find((t=>t.id===e))}function si(t,e){const i=e.parentId||ni(t).id;return t.detreeNodeRSs.filter((t=>{return t.parentDETreeNodeId===i&&(n=t.searchMode,r=e.hasQuery,3===n||(r?1===n:2===n));var n,r}))}function ai(t,e){var i;return null==(i=t.degridEditItems)?void 0:i.find((t=>t.codeName===e))}function oi(t){let e;switch(t.detailType){case"TABPANEL":e=t.deformTabPages;break;case"FORMPAGE":case"TABPAGE":case"GROUPPANEL":e=t.deformDetails}return e||[]}function ci(t){const{viewLayoutPanel:e}=t,i=t.controls||[];return e&&i.push(...e.controls||[]),i}function li(t){const{viewLayoutPanel:e}=t,i=t.appViewLogics||[];return e&&i.push(...e.appViewLogics||[]),i}function hi(t){const{viewLayoutPanel:e}=t,i=t.appViewEngines||[];return e&&i.push(...e.appViewEngines||[]),i}async function ui(t,e,n={},r={}){return async function(t,e,n={},r={}){var s;const a=t.appViewNavContexts||[],o=je(a,n,e);e=Object.assign(e.clone(),o);const c=t.appViewNavParams||[],l=je(c,n,e);Object.assign(n,l);const h=t.appDataEntityId,u=$e(h);let d=(null==(s=r.data)?void 0:s[0])||{};e[u]=d[u]||e[u]||n[u];const p=t.getDataAppDEActionId,f=ibiz.hub.getApp(t.appId),m=await f.deService.getService(h);ibiz.loading.showRedirect();try{const t=await m.exec(p||"get",e,n);if(t.ok){d=t.data;let i=d.linkurl;if(i)return e.srfprocessinstanceid&&(i+=";srfprocessinstanceid=".concat(e.srfprocessinstanceid)),ibiz.env.dev&&-1!==i.indexOf("appredirectview?")&&(i=i.slice(i.indexOf("appredirectview?"))),i.startsWith("http://")||i.startsWith("https://")?new Promise((t=>{const e=window.open(i,"_blank");e&&(e.callback=()=>{t({ok:!0,data:[]})})})):i.startsWith("appredirectview?")?(await di(e,i,r),{ok:!0,data:[]}):{ok:!1,data:[]}}}finally{ibiz.loading.hideRedirect()}const g=await ibiz.hub.getAppDataEntity(h,t.appId),y=await async function(t,e,i,n){let r="";const s=e.typeAppDEFieldId;if(s){const{codeName:i}=ei(t,s),r=n[i.toLowerCase()];if(B(r))return"".concat(r);ibiz.log.warn("重定向视图[".concat(e.name,"]自定义类别属性[").concat(s,"]值为空"),n)}const a="".concat(ibiz.env.isMob?"MOB":"","EDITVIEW"),o=i.srfwf;if(B(o))return B(i.wf)?"".concat(a,":").concat(o.toUpperCase(),":").concat(i.wf.toUpperCase()):"".concat(a,":").concat(o.toUpperCase());let c="";if(t.indexTypeAppDEFieldId){const{codeName:e}=ei(t,t.indexTypeAppDEFieldId);c=n[e.toLowerCase()]}if(U(c)&&t.formTypeAppDEFieldId){const{codeName:e}=ei(t,t.formTypeAppDEFieldId);c=n[e.toLowerCase()]}r=B(c)?"".concat(a,":").concat(c.toString().toUpperCase()):"".concat(a);return r}(g,t,n,d),w=y.split(":"),v=2===w.length?y:w.slice(0,2).join(":"),b="".concat(g.name.toUpperCase(),":").concat(y),E=t.redirectAppViewRefs,_=null==E?void 0:E.find((t=>{const e=t.name||t.id;return e===b||e===y||e===v}));if(!_)throw ibiz.log.error("重定向视图引用有:",null==E?void 0:E.map((({refAppViewId:t,name:e,realTitle:i})=>({viewId:t,tag:e,title:i})))),new i(t,"未找到重定向标识[".concat(y,"]或[").concat(b,"]或工作流[").concat(v,"]对应视图"));{const t=_.refAppViewId;if(!t)throw new i(_,"未配置实际引用视图");{const i=await ibiz.commands.execute(Ur.TAG,t,e,n,{...r,data:[d]});if(i)return i}}return{ok:!0,data:[]}}(t,e,n,r)}async function di(t,i,n={}){const r=i.lastIndexOf("?"),s=decodeURIComponent(i.substring(r+1,i.length)),a=J.parse(s,{delimiter:";"}),o=a.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));a[c.toLowerCase()]=a[o.toLowerCase()];const l="".concat(c).concat(ibiz.env.isMob?"Mob":"","RedirectView"),h=await ibiz.hub.getAppView(l);if(delete a.srfdename,"undo"!==a.srfwf){const t=a.processDefinitionKey.split("-")[3],e=t.substring(0,t.lastIndexOf("v")),i=t.substring(t.lastIndexOf("v"));a.wf=e,a.wfVersion=i}a.srfprocessinstanceid&&(t.srfprocessinstanceid=a.srfprocessinstanceid,delete a.srfprocessinstanceid),await ibiz.commands.execute(Ur.TAG,h.id,t,a,n)}function pi(t,i,n){if(Object.is(i,"IN"))return gi(t,n);if(Object.is(i,"NOTIN"))return!gi(t,n);switch(i){case"EQ":return"".concat(t)==="".concat(n);case"NOTEQ":return"".concat(t)!=="".concat(n);case"LT":return fi(t,n)<0;case"LTANDEQ":return fi(t,n)<=0;case"GT":return fi(t,n)>0;case"GTANDEQ":return fi(t,n)>=0;case"ISNULL":return U(t);case"ISNOTNULL":return B(t);case"TESTNULL":return Z(t);case"IN":return gi(t,n);case"NOTIN":return!gi(t,n);case"LIKE":return yi(t,n);case"LEFTLIKE":return yi(t,n,"start");case"RIGHTLIKE":return yi(t,n,"end");default:throw new e("值操作:".concat(i,",暂未支持"))}}function fi(t,i){const n=Number(t),r=Number(i);if(!Number.isNaN(n)&&!Number.isNaN(r))return mi(n,r);const s=new Date(t).getTime(),a=new Date(i).getTime();if(!Number.isNaN(s)&&!Number.isNaN(a))return mi(s,a);throw new e("".concat(t," 和 ").concat(i," 无法比较大小"))}function mi(t,e){return Number.isNaN(t)&&(t=0),Number.isNaN(e)&&(e=0),t>e?1:t<e?-1:0}function gi(t,i){if(!i||"string"!=typeof i)throw new e("范围比较的条件值不存或者不是字符串");if(t){return i.split(",").includes("".concat(t))}return!1}function yi(t,e,i){if(!t||!e)return!1;const n="".concat(t).toUpperCase(),r="".concat(e).toUpperCase(),s=n.indexOf(r);switch(i){case"start":return 0===s;case"end":return s+r.length===n.length;default:return-1!==s}}var wi={singleRowReturn:!1,isAsync:!0},vi=t("ScriptFunction",class{constructor(t,e,i=wi){this.argKeys=[],this.options=i;const n=this.formatCode(e,i);this.calcArgKeys(t,i);const r=new Function(...this.argKeys,n);this.scriptFn=function(...t){return r.apply({},t)}}formatCode(t,e){let i=t;return e.singleRowReturn&&(i="return (".concat(i,")")),e.isAsync&&(i="return (async function() { ".concat(i,"} )();")),i}calcArgKeys(t,e){const i=e.presetParams?Object.keys(e.presetParams):[];i.push(...t);i.push("document","el","selector","env","appSession","topViewSession","viewSession","context","viewParam","activeData","data","app","topView","parentView","view","parent","util"),this.argKeys=Array.from(new Set(i))}convertArgs(t){const{presetParams:e}=this.options,i=e?tt(e,t):t;i.document=document,i.selector=t=>document.getElementsByClassName(t);const n=[];return this.argKeys.forEach((t=>{void 0===i[t]&&this.fillDefaultParams(t,i),n.push(i[t])})),n}fillDefaultParams(t,e){const i=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==i?void 0:i.parentView;break;case"topView":e.topView=null==i?void 0:i.getTopView();break;case"parentView":e.parentView=null==i?void 0:i.parentView;break;case"topViewSession":e.topViewSession=null==i?void 0:i.getTopView().session;break;case"viewSession":e.viewSession=null==i?void 0:i.session;break;case"appSession":e.appSession=ibiz.hub.controller.session}}exec(t){const e=this.convertArgs(t);return this.scriptFn(...e)}}),bi=t("ScriptFactory",class{static createScriptFn(t,e,i){return new vi(t,e,i)}static execScriptFn(t,e,i){return this.createScriptFn(Object.keys(t),e,i).exec(t)}static execSingleLine(t,e={}){return this.execScriptFn(e,t,{singleRowReturn:!0,isAsync:!1})}});function Ei(t,i,n){const r={isPast:!0,infoMessage:n.ruleInfo};if(function(t){return"GROUP"===t.condType}(n)){const e=n.conds;e&&e.length>0&&(r.isPast=function(t,e,i="AND",n=!1){if(!((null==t?void 0:t.length)>0))return!1;let r="AND"===i;for(let n=0,s=t.length;n<s;n++){const s=e(t[n],n);if("AND"===i){if(!s){r=!1;break}}else if("OR"===i&&s){r=!0;break}}return n?!r:r}(e,(e=>{const{isPast:n,infoMessage:s}=Ei(t,i,e);return r.infoMessage=s,n}),n.condOp,!!n.notMode),!r.isPast&&("AND"===n.condOp&&n.notMode||"OR"===n.condOp&&!n.notMode)&&(r.infoMessage=n.ruleInfo))}else{t=(null==n?void 0:n.defname.toLowerCase())||t;try{if(function(t){return"SIMPLE"===t.condType}(n))r.isPast=!function(t,i,n,r,s,a,o){Object.is(s,"CURTIME")&&(n="".concat(new Date));if(Object.is(s,"ENTITYFIELD")){n=a[n=n?n.toLowerCase():""]?a[n]:n}(Z(r)||et(r))&&(r="内容必须符合值规则");const c=pi(t,i,n);if(!c&&o)throw new e(r);return!c}(i[t],n.condOp,n.paramValue,n.ruleInfo,n.paramType,i,n.keyCond);else if(function(t){return"VALUERANGE2"===t.condType}(n))r.isPast=!function(t,i,n,r,s,a,o){U(a)&&(a="值必须符合值范围规则");if(U(t)){if(o)throw new e("值为空");return a="值为空",!0}if(_i(t,/^-?\d*\.?\d+$/,"",o))return!0;const c=Number.parseFloat(t);if(null!==i)if(n){if(c<i){if(o)throw new e(a);return!0}}else if(c<=i){if(o)throw new e(a);return!0}if(null!=r)if(s){if(c>r){if(o)throw new e(a);return!0}}else if(c>=r){if(o)throw new e(a);return!0}return a="",!1}(i[t],n.minValue,n.includeMinValue,n.maxValue,n.includeMaxValue,n.ruleInfo,n.keyCond);else if(function(t){return"REGEX"===t.condType}(n))r.isPast=!_i(i[t],n.regExCode,n.ruleInfo,n.keyCond);else if(function(t){return"STRINGLENGTH"===t.condType}(n))r.isPast=!function(t,i,n,r,s,a,o){U(a)&&(a="内容长度必须符合范围规则");if(U(t)){if(o)throw new e("值为空");return a="值为空",!0}const c=t.length;if(null!==i)if(n){if(c<i){if(o)throw new e(a);return!0}}else if(c<=i){if(o)throw new e(a);return!0}if(null!==r)if(s){if(c>r){if(o)throw new e(a);return!0}}else if(c>=r){if(o)throw new e(a);return!0}return a="",!1}(i[t],n.minValue,n.includeMinValue,n.maxValue,n.includeMaxValue,n.ruleInfo,n.keyCond);else if(function(t){return"SYSVALUERULE"===t.condType}(n)&&(null==n?void 0:n.sysValueRule)){const{ruleType:s,regExCode:a,scriptCode:o,ruleInfo:c}=n.sysValueRule;if(r.infoMessage=n.ruleInfo||c,"REG"===s)r.isPast=!_i(i[t],a,r.infoMessage,n.keyCond);else if("SCRIPT"===s){const{isPast:s,infoMessage:a}=function(t,i,n,r,s){U(r)&&(r="值必须符合脚本规则");const a=i;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=bi.execScriptFn({value:t,data:a},n,{isAsync:!1});"boolean"==typeof e&&(c=e)}catch(t){ibiz.log.error(t),l(t)}if(r="",!c&&s)throw new e(r);return{isPast:c,infoMessage:o||r}}(i[t],i,o,r.infoMessage,n.keyCond);r.isPast=s,r.infoMessage=a||r.infoMessage}}}catch(t){r.isPast=!1}r.isPast=n.notMode?!r.isPast:r.isPast}return r}function _i(t,i,n,r){U(n)&&(n="值必须符合正则规则");if(U(t)){if(r)throw new e("值为空");return n="值为空",!0}if(!new RegExp(i).test(t)){if(r)throw new e(n);return!0}return n="",!1}function Ii(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const n=e.defdlogics;if(!n||0===n.length)throw new i(e,"发现空逻辑组,逻辑无法正常执行!");let r=!0;if("AND"===e.groupOP){r=void 0===n.find((e=>!Ii(t,e)))}else if("OR"===e.groupOP){r=void 0!==e.defdlogics.find((e=>Ii(t,e)))}return e.notMode?!r:r}if(function(t){return"SINGLE"===t.logicType}(e))return pi(t[e.defdname.toLowerCase()],e.condOP,e.value);throw new n(e,"未支持的逻辑类型".concat(e.logicType))}function Ci(t,e){if(function(t){return"GROUP"===t.logicType}(e)){const n=e.panelItemLogics;if(!n||0===n.length)throw new i(e,"发现空逻辑组,逻辑无法正常执行!");let r=!0;if("AND"===e.groupOP){r=void 0===n.find((e=>!Ci(t,e)))}else if("OR"===e.groupOP){r=void 0!==e.panelItemLogics.find((e=>Ci(t,e)))}return e.notMode?!r:r}if(function(t){return"SINGLE"===t.logicType}(e))return pi(t[e.dstModelField.toLowerCase()],e.condOp,e.value);throw new n(e,"未支持的逻辑类型".concat(e.logicType))}var Di=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 i=it(this.cache.get(e));t.viewLayoutPanel=i,t.appCounterRefs&&(i.appCounterRefs=t.appCounterRefs,delete t.appCounterRefs),t.appViewEngines&&(i.appViewEngines=t.appViewEngines,delete t.appViewEngines),t.appViewLogics&&(i.appViewLogics=t.appViewLogics,delete t.appViewLogics),t.appViewRefs&&(i.appViewRefs=t.appViewRefs,delete t.appViewRefs),t.controls&&(i.controls=t.controls,delete t.controls)}}return t}calcLayoutTag(t){const{viewType:e,viewStyle:i}=t;return"APPINDEXVIEW"===e?this.calcIndexViewLayoutTag(t):"".concat(e,"_").concat(i)}calcIndexViewLayoutTag(t){const{viewType:e,viewStyle:i,blankMode:n,mainMenuAlign:r}=t;let s="";return n?s="BLANK_MODE":r&&(s=r.toUpperCase()),""!==s?"".concat(e,"_").concat(i,"_").concat(s):"".concat(e,"_").concat(i)}});function Si(t){const e={};return t.param09&&(e.srfprocessinstanceid=t.param09),e}var Ai=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))(Ai||{})),xi=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))(xi||{})),Pi=t("ViewMode",(t=>(t.ROUTE="ROUTE",t.MODAL="MODAL",t.DRAWER="DRAWER",t.EMBED="EMBED",t.POPOVER="POPOVER",t))(Pi||{})),Ti=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))(Ti||{})),Oi=t("ViewCallTag",(t=>(t.LOAD="Load",t.GET_DATA="GetData",t.GET_ALL_DATA="GetAllData",t.VALIDATE="Validate",t.TOGGLE_COLLAPSE="ToggleCollapse",t))(Oi||{})),Li=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))(Li||{})),Ri=t("StudioViewEvents",class{});Ri.onViewMounted="onMounted",Ri.onViewDestroyed="onDestroyed";var Mi=t("StudioPanelEvents",class{});Mi.onClick="onClick",Mi.onChange="onChange",Mi.onEnter="onEnter",Mi.onLeave="onLeave";var ki=t("StudioControlEvents",class{});ki.onBeforeLoad="onBeforeLoad",ki.onLoadSuccess="onLoadSuccess",ki.onLoadError="onLoadError",ki.onBeforeLoadDraft="onBeforeLoadDraft",ki.onLoadDraftSuccess="onLoadDraftSuccess",ki.onLoadDraftError="onLoadDraftError",ki.onBeforeSave="onBeforeSave",ki.onSaveSuccess="onSaveSuccess",ki.onSaveError="onSaveError",ki.onBeforeRemove="onBeforeRemove",ki.onRemoveSuccess="onRemoveSuccess",ki.onRemoveError="onRemoveError",ki.CLICK="onClick";var Ni=t("Modal",class{constructor(t){this.mode="EMBED",this.viewUsage=4,this.ignoreDismissCheck=!1,this.hooks={shouldDismiss:new W,beforeDismiss:new W},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 Vi(t,e){return t.filter((t=>{const{checkMode:i}=t,n=t.deformItemName||t.degridEditItemName;return 2!==i&&n===e}))}var Fi=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")}}),ji=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 Bi(t,e=!0){const i=await Promise.allSettled(t),n=[],r=[];if(i.forEach((t=>{"fulfilled"===t.status?n.push(t.value):r.push(t.reason)})),r.length>0){const t=1===r.length?r[0]:r;if(e)throw t;ibiz.util.error.handle(t)}return n}var Ui=class{constructor(){this.psModelGroupCondBase=null}parse(t){if(t instanceof Array){const e=this.createPSModelGroupCond();e.parse(t),this.psModelGroupCondBase=e}}testSingleCond(t,e,i){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 n=-1;if(e==i?n=0:e>i&&(n=1),"EQ"===t||"ABSEQ"===t)return 0===n;if("GT"===t)return n>0;if("GTANDEQ"===t)return n>=0;if("LT"===t)return n<0;if("LTANDEQ"===t)return n<=0;if("NOTEQ"===t)return 0!==n}if("LIKE"===t)return null!=e&&null!=i&&-1!==e.toString().toUpperCase().indexOf(i.toString().toUpperCase());if("LEFTLIKE"===t)return null!=e&&null!=i&&0===e.toString().toUpperCase().indexOf(i.toString().toUpperCase())}catch(t){ibiz.log.error(t)}return!1}getPSModelGroupCondBase(){return this.psModelGroupCondBase}},Wi=class{constructor(){this.strCondOp=null}getCondOp(){return this.strCondOp}setCondOp(t){this.strCondOp=t}},zi=class extends Wi{parse(t){const e=t.length;let i=!0,n=!1,r=!1;for(let s=0;s<e;s++)if(i){const e=t[s];this.setCondOp(e),i=!1,n=!0}else if(n){const e=t[s];this.setParam(e),n=!1,r=!0}else if(r){const e=t[s];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}},Gi=class t extends Wi{constructor(){super(...arguments),this.childCondList=[],this.bNotMode=!1}parse(i){const n=i.length;let r=!0,s=!0,a=!1;for(let o=0;o<n;o++){if(r&&s){if("!"===i[o]){this.setNotMode(!0),r=!1;continue}}if(s){const t=i[o];this.setCondOp(t),s=!1,r=!1,a=!0}else if(a){const n=i[o];if(!(n instanceof Array))throw new e("值必须为数组");n.forEach((e=>{if(e.length>0){const i=e[0].toString();if("!"===i||"OR"===i||"AND"===i){const i=new t;i.parse(e),this.childCondList.push(i)}else{const t=new zi;t.parse(e),this.childCondList.push(t)}}}))}}}setNotMode(t){this.bNotMode=t}isNotMode(){return this.bNotMode}getChildPSModelCondBases(){return this.childCondList}},Hi=class extends Gi{},qi=class extends zi{},Ki=class t extends Ui{test(t,e){return this.testCond(this.getPSModelGroupCondBase(),t,e)}testCond(e,i,n){if(e instanceof Gi){const t=e.getChildPSModelCondBases();if(null==t||et(t))return!e.isNotMode();const r="AND"===e.getCondOp();let s=r;for(let e=0;e<t.length;e++){const a=t[e];if(this.testCond(a,i,n)){if(!r){s=!0;break}}else if(r){s=!1;break}}return e.isNotMode()?!s:s}if(e instanceof zi){et(e.getParam())&&ibiz.log.warn("没有指定属性名称",e);const r=i[e.getParam().toLowerCase()];let s=null;const a=e.getValueType(),o=e.getValue();return null==a||et(a)?s=e.getValue():(et(o)&&ibiz.log.warn("没有指定上下文参数名称"),t.PARAMTYPE_WEBCONTEXT===a?s=n.data[o.toLowerCase()]:t.PARAMTYPE_DATACONTEXT===a&&(s=n.getValue(o.toLowerCase()))),this.testSingleCond(e.getCondOp(),r,s)}return ibiz.log.warn("无法识别的条件对象",e),!1}createPSModelSingleCond(){return new qi}createPSModelGroupCond(){return new Hi}};Ki.PARAMTYPE_DATACONTEXT="DATACONTEXT",Ki.PARAMTYPE_WEBCONTEXT="WEBCONTEXT";var Xi=t("PSDEDQCondEngine",Ki);async function Yi(t,e){var i;const n=null==(i=ibiz.hub.getApp(e).model.appPFPluginRefs)?void 0:i.find((e=>e.pluginCode.toLowerCase()===t));if(n)return await ibiz.plugin.loadPlugin(n),"".concat(n.pluginType,"_").concat(n.pluginCode);ibiz.log.error("找不到".concat(t,"的插件模型"))}var $i=t("CONTROL_PROVIDER_PREFIX","CONTROL");function Qi(t){return ibiz.register.get("".concat($i,"_").concat(t))}async function Ji(t){let e;const{controlType:i,controlStyle:n,sysPFPluginId:r,appId:s}=t;if(r){const t=await Yi(r,s);if(t&&(e=Qi(t)),e)return e;ibiz.log.error("找不到部件插件".concat(t,"对应的适配器"))}if(n&&"DEFAULT"!==n){if(e=Qi("".concat(i,"_").concat(n)),e)return e;ibiz.log.error("找不到部件类型:[".concat(i,"]的部件样式:[").concat(n,"]对应的适配器"),t)}if(e=Qi(i),e)return e;"DATAINFOBAR"!==i&&ibiz.log.error("找不到部件类型".concat(i,"对应的适配器"))}var Zi=t("EDITOR_PROVIDER_PREFIX","EDITOR");function tn(t){return ibiz.register.get("".concat(Zi,"_").concat(t))}async function en(t){let e;const{editorType:i,editorStyle:n,predefinedType:r,sysPFPluginId:s,appId:a}=t;if(s){const t=await Yi(s,a);if(t&&(e=tn(t)),e)return e;ibiz.log.error("找不到编辑器插件".concat(t,"对应的适配器"))}if(n&&"DEFAULT"!==n){if(e=tn("".concat(i,"_").concat(n)),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(i,"]的编辑器样式:[").concat(n,"]对应的适配器"),t)}if(r){let s="".concat(r,"_").concat(i);if(n&&"DEFAULT"!==n&&(s+="_".concat(n)),e=tn(s),e)return e;ibiz.log.error("找不到编辑器类型:[".concat(i,"]的预置类型:[").concat(r,"]对应的适配器"),t)}if(e=tn(i),e)return e;ibiz.log.error("找不到编辑器类型".concat(i,"对应的适配器"))}var nn=t("FORMDETAIL_PROVIDER_PREFIX","FORMDETAIL");function rn(t){return ibiz.register.get("".concat(nn,"_").concat(t))}async function sn(t){let e;const{detailType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await Yi(n,r);if(t&&(e=rn(t)),e)return e;ibiz.log.error("找不到表单成员插件".concat(t,"对应的适配器"))}if(e=rn(i),e)return e;ibiz.log.error("找不到表单成员类型".concat(i,"对应的适配器"))}var an=t("GRIDCOLUMN_PROVIDER_PREFIX","GRIDCOLUMN");function on(t){return ibiz.register.get("".concat(an,"_").concat(t))}async function cn(t){let e;const{columnType:i,enableRowEdit:n,sysPFPluginId:r,appId:s}=t;if(r){const t=await Yi(r,s);if(t&&(e=on(t)),e)return e;ibiz.log.error("找不到表格列插件".concat(t,"对应的适配器"))}const a=n?"".concat(i,"_EDIT"):i;if(e=on(a),e)return e;ibiz.log.error("找不到表格列类型".concat(a,"对应的适配器"))}var ln=t("PANELITEM_PROVIDER_PREFIX","PANELITEM");function hn(t){return ibiz.register.get("".concat(ln,"_").concat(t.toUpperCase()))}async function un(t){var e;let i;const{itemType:n,sysPFPluginId:r,appId:s}=t;if(r){const t=await Yi(r,s);if(t&&(i=hn(t)),i)return i;ibiz.log.error("找不到面板成员插件".concat(t,"对应的适配器"))}if("CONTAINER"===n){const e=t.predefinedType||"DEFAULT";if(i=hn("CONTAINER_".concat(e)),i)return i;ibiz.log.error("找不到面板容器预置类型为".concat(e,"的适配器"))}if("RAWITEM"===n){const n=(null==(e=t.rawItem)?void 0:e.predefinedType)||"DEFAULT";if(i=hn("RAWITEM_".concat(n)),i)return i;ibiz.log.error("找不到面板成员直接内容预置类型为".concat(n,"的适配器"))}if(i=hn(n),i)return i;ibiz.log.error("找不到面板成员类型".concat(n,"对应的适配器"))}var dn=t("UIACTION_PROVIDER_PREFIX","UIACTION");function pn(t,e){ibiz.register.register("".concat(dn,"_").concat(t),e)}function fn(t){return ibiz.register.get("".concat(dn,"_").concat(t))}async function mn(t){let i;const{uiactionMode:n,sysPFPluginId:r,appId:s}=t;if(r){const t=await Yi(r,s);if(t&&(i=fn(t)),i)return i;ibiz.log.error("找不到界面行为插件".concat(t,"对应的适配器"))}if(i=fn(n),i)return i;throw new e("找不界面行为模式".concat(n,"对应的适配器"))}var gn=t("VIEW_PROVIDER_PREFIX","VIEW");function yn(t){return ibiz.register.get("".concat(gn,"_").concat(t))}var wn=t("PORTLET_PROVIDER_PREFIX","PORTLET");function vn(t){return ibiz.register.get("".concat(wn,"_").concat(t))}async function bn(t){let e;const{portletType:i,sysPFPluginId:n,appId:r}=t;if(n){const t=await Yi(n,r);if(t&&(e=vn(t)),e)return e;ibiz.log.error("找不到门户部件插件".concat(t,"对应的适配器"))}if(e=vn(i),e)return e;ibiz.log.error("找不到门户部件成员类型".concat(i,"对应的适配器"))}var En=t("APP_COUNTER_PROVIDER_PREFIX","APPCOUNTER");function _n(t,e){ibiz.register.register("".concat(En,"_").concat(t),e)}function In(t){return ibiz.register.get("".concat(En,"_").concat(t))}async function Cn(t){let i;const{codeName:n,counterType:r,sysPFPluginId:s,appId:a}=t;if(s){const t=await Yi(s,a);if(t&&(i=In(t)),i)return i;ibiz.log.error("找不到系统计数器插件".concat(t,"对应的适配器"))}if("CUSTOM"===r){if(i=In(n),i)return i;throw new e("找不到自定义系统计数器".concat(n,"对应的适配器"))}if(i=In(r),i)return i;throw new e("找不系统计数器类型".concat(r,"对应的适配器"))}var Dn=t("AppCounter",class{constructor(t){this.model=t,this.destroyed=!1,this.context=r.create(),this.params={},this.evt=new z,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=it(t)),e&&(this.params=it(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&&B(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()}}),Sn=t("AppDECounter",class extends Dn{async init(t,e){this.appDataEntityId=this.model.appDataEntityId;const n=this.model.getAppDEActionId;if(!n)throw new i(this.model,"未找到获取计数器行为!");this.action=n,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}}),An=t("AppDECounterProvider",class{createCounter(t){return new Sn(t)}});function xn(){_n("DEDR",(()=>new An))}t("DEDQCondUtil",class{static getCond(t){if(this.map.has(t))return this.map.get(t);const e=t.dedqgroupConditions;if(e){const i=new Xi;return i.parse(["OR",this.calcCond(e)]),this.map.set(t,i),i}return null}static calcCond(t){const e=[];return t.forEach((t=>{const i=[];if("GROUP"===t.condType){const e=t;e.notMode&&i.push("!"),i.push(t.condOp);const n=e.dedqconditions;if(n){const t=this.calcCond(n);i.push(t)}}else{if("SINGLE"!==t.condType)throw new n(t,"暂未支持的查询条件类型: ".concat(t.condType));{const e=t;i.push(e.fieldName),e.condValue||i.push("")}}e.push(i)})),e}}).map=new WeakMap;var Pn=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 n(this.codeList,"预定义类型".concat(t,"暂不支持"))}else this.initPromise=void 0})(),this.initPromise}convertData(t){const e={},{valueAppDEFieldId:i,textAppDEFieldId:n,iconClsAppDEFieldId:r,iconClsXAppDEFieldId:s,iconPathAppDEFieldId:a,iconPathXAppDEFieldId:o,disableAppDEFieldId:c,dataAppDEFieldId:l}=this.codeList,h=i?t[i]:t.srfkey;return e.id=h,e.value=h,e.text=n?t[n]:t.srfmajortext,(r||s||a||o)&&(e.sysImage={},r&&(e.sysImage.cssClass=t[r]),s&&(e.sysImage.cssClassX=t[s]),a&&(e.sysImage.imagePath=t[a]),o&&(e.sysImage.imagePathX=t[o])),c&&(e.disableSelect=t[c]),l&&t[l]&&(e.data=bi.execSingleLine(t[l])),e}async load(t={},e={}){const n=ibiz.hub.getApp(t.srfappid),{appDataEntityId:r,appDEDataSetId:s,minorSortAppDEFieldId:a,minorSortDir:o,pvalueAppDEFieldId:c,customCond:l}=this.codeList,h={...e};if(a&&o&&Object.assign(h,{sort:"".concat(a.toLowerCase(),",").concat(o.toLowerCase())}),l){const e=je(bi.execSingleLine(l),h,t);Object.assign(h,e)}if(h.size||(h.size=1e4),this.isPredefined){const t=await n.net.get("/dictionaries/codelist/".concat(this.codeList.codeName),h);return Object.freeze(t.data.items)}if(!r)throw new i(this.codeList,"未配置应用实体");if(!s)throw new i(this.codeList,"未配置数据集");const u=await n.deService.exec(r,s,t,void 0,h);let d=[];return u.data.length&&u.data.forEach((t=>{if(c){const t=this.prepareTreeData(u.data);t&&(d=t)}else d.push(this.convertData(t))})),Object.freeze(d)}prepareTreeData(t,e){const{pvalueAppDEFieldId:i}=this.codeList;let n=[];if(n=t.filter((t=>e?t[i]===e:!t[i])),0!==n.length)return n.map((e=>{const i=this.convertData(e);return i.children=this.prepareTreeData(t,i.value),i}))}async get(t={},e={}){if(this.initPromise&&await this.initPromise,!this.codeList.enableCache)return this.load(t,e);const i=JSON.stringify(t)+JSON.stringify(e);if(this.cache.has(i)){const t=this.cache.get(i);if(t.expirationTime>(new Date).getTime())return t.promise?t.promise:t.items;this.cache.delete(i)}const n=this.load(t,e),{cacheTimeout:r}=this.codeList,s=-1===r||Z(r)?ibiz.config.codeList.timeout:this.codeList.cacheTimeout,a={expirationTime:(new Date).getTime()+s,promise:n};this.cache.set(i,a);const o=await n;return a.items=o,delete a.promise,o}});function Tn(t,i){if(null!=i){const{srfkey:t}=i;if(!Z(t)&&!et(t))return!0}throw new e("执行「".concat(t,"」不存在「srfkey」无法处理"))}function On(t,i){const{srfsessionid:n}=i;if(!Z(n)&&!et(n))return!0;throw new e("执行「".concat(t,"」不存在「srfsessionid」无法处理"))}var Ln=t("DECache",class{constructor(){this.cacheMap=new Map}forceAdd(t,e){const i=this.getCacheByTag(t).get(e.srfkey);i&&(i.assign(e),ibiz.log.warn("forceAdd",e.srfkey,e))}forceUpdate(t,e){this.getCacheByTag(t).set(e.srfkey,it(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{On("add",t),(Z(e.srfkey)||et(e.srfkey))&&(e.srfkey=G()),e.srftempdate=(new Date).getTime();return this.getCacheByTag(t).set(e.srfkey,it(e)),ibiz.log.warn("add",e.srfkey,e),e}catch(t){return ibiz.log.error(t),null}}get(t,e){try{On("get",t);const i=this.getCacheByTag(t).get(e);return ibiz.log.warn("get",e,i),it(i)}catch(t){return ibiz.log.error(t),null}}update(t,e){try{On("update",t),Tn("update",e),e.srftempdate=(new Date).getTime();const i=this.getCacheByTag(t),n=i.get(e.srfkey);if(n)return n.assign(e),i.set(e.srfkey,n),ibiz.log.warn("update",e.srfkey,e),it(n);throw new Error("数据不存在,无法更新!")}catch(t){return ibiz.log.error(t),null}}delete(t,e){try{On("delete",t);const i=this.getCacheByTag(t),n=e;if(i.has(n)){const t=i.get(n);return t.srftempdate=(new Date).getTime(),i.delete(n),ibiz.log.warn("delete",n),t}return null}catch(t){return ibiz.log.error(t),null}}createBatch(t,e){try{On("add",t);const i=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const n=e[t];(Z(n.srfkey)||et(n.srfkey))&&(n.srfkey=G()),n.srftempdate=(new Date).getTime();const r=it(n);i.set(n.srfkey,r),e[t]=r,ibiz.log.warn("add",n.srfkey,n)}return e}catch(t){ibiz.log.error(t)}return[]}updateBatch(t,e){try{On("update",t);const i=this.getCacheByTag(t);for(let t=0;t<e.length;t++){const n=e[t];Tn("update",n),n.srftempdate=(new Date).getTime();const r=i.get(n.srfkey);if(!r)throw new Error("数据[".concat(n.srfdename,"-").concat(n.srfmajortext,"(").concat(n.srfkey,")]不存在,无法更新!"));r.assign(n),i.set(n.srfkey,r),ibiz.log.warn("update",n.srfkey,n),e[t]=it(r)}return e}catch(t){return ibiz.log.error(t),null}}deleteBatch(t,e){try{On("delete",t)}catch(t){return ibiz.log.error(t),e}const i=this.getCacheByTag(t),n=[];for(let t=0;t<e.length;t++){const r=e[t];i.has(r)||n.push(r)}if(n.length>0)throw new Error("未找到以下数据「".concat(n.join("、"),"」,无法删除!"));for(let t=0;t<e.length;t++){const n=e[t];i.delete(n),ibiz.log.warn("delete",n)}return[]}checkData(t,e){return-1!==this.getList(t).findIndex((t=>t.srfkey===e))}getList(t){try{On("getList",t);const e=this.getCacheByTag(t);if(!e)return[];const i=e.values();return Array.from(i)}catch(t){return ibiz.log.error(t),[]}}generatePred(t={}){const e={};t.srfkey&&(e.srfkey=nt(t.srfkey)),delete t.srfkey;for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const n=t[i];e[i]=nt(n)}return rt(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)}}),Rn=new RegExp("(?<=\\$\\{)(.*?)(?=\\})","g");function Mn(t,e){const i=(e.requestPaths||[]).map((t=>({path:t,keys:t.match(Rn)||[]}))).filter((e=>{const{keys:i}=e;return 0===i.length||i.every(((e,n)=>n===i.length-1||null!=t[e]))})).sort(((t,e)=>e.keys.length-t.keys.length));if(i.length>0)return i[0]}function kn(t,e){const i=Mn(t,e);if(i){if(i.keys.length>0){let{path:e}=i;return i.keys.forEach(((n,r)=>{e=r===i.keys.length-1?e.replace(new RegExp("/[^/]+/\\$\\{".concat(n,"\\}")),""):e.replace("${".concat(n,"}"),t[n])})),e}return i.path}return""}var Nn=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(Z(e.page)||et(e.page)||(this.page=e.page),Z(e.size)||et(e.size)||(this.size=e.size),Z(e.query)||et(e.query)||(this.query=e.query),!Z(e.sort)&&!et(e.sort)){const t=e.sort.split(",");t.length>=1&&([this.sortField]=t),t.length>=2&&(this.sortMode=t[1].toUpperCase())}Z(e.srfparentkey)||et(e.srfparentkey)||(this.srfparentkey=e.srfparentkey),Z(e.srfparentdename)||et(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]}}),Vn=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 i=t.codeItems;let n=[];return(null==i?void 0:i.length)&&(n=this.formatStaticItems(i,t.codeItemValueNumber)),this.cache.set(e,Object.freeze(n)),n}setCodeList(t){const{id:e,codeName:i}=t;this.allCodeLists.set(e,t),this.allCodeLists.set(i,t)}getCodeList(t){return this.allCodeLists.get(t)}formatStaticItems(t,e){return t.map((t=>{var i;let n=t.text;t.textLanguageRes&&(n=ibiz.i18n.t(t.textLanguageRes.lanResTag,t.text));let{tooltip:r}=t;t.tooltipLanguageRes&&(r=ibiz.i18n.t(t.tooltipLanguageRes.lanResTag,t.tooltip));const s={text:n,value:e?Number(t.value):t.value,color:t.color,id:t.codeName,textCls:t.textCls,disableSelect:t.disableSelect,tooltip:r,data:t.data?bi.execSingleLine(t.data):void 0,sysImage:t.sysImage};return(null==(i=t.codeItems)?void 0:i.length)&&(s.children=this.formatStaticItems(t.codeItems,e)),Object.freeze(s)}))}async getDynamicCodeList(t,e={},i={}){let n;const r=t.codeName;return this.cache.has(r)?n=this.cache.get(r):(n=new Pn(t),this.cache.set(r,n),await n.init()),n.get(e,i)}async get(t,i,n){const r=this.allCodeLists.get(t);if(!r)throw new e("找不到".concat(t,"代码表"));return"STATIC"===r.codeListType?this.getStatic(r):"DYNAMIC"===r.codeListType?this.getDynamicCodeList(r,i,n):[]}}),Fn=t("ConfigService",class{constructor(t,e,i){this.appId=t,this.folder=e,this.tag=i,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:{}}}),jn=t("CounterService",class{static async getCounter(t,e,i){const n=t.id;if(this.counterMap.has(n)){const t=this.counterMap.get(n);if(!1===t.isDestroyed)return t;this.counterMap.delete(n)}const r=(await Cn(t)).createCounter(t);return await r.init(e,i),this.counterMap.set(n,r),r}static async getCounterByRef(t,e,n){const{appCounter:r}=t;if(!r)throw new i(t,"未配置应用计数器!");return this.getCounter(r,e,n)}});jn.counterMap=new Map;var Bn=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:i}=t;return this.app.net.get("".concat(this.getBaseUrl(),"/process-definitions/").concat(e,"/usertasks/").concat(i))}async getWFLink(t,e){const i=t[this.model.codeName.toLowerCase()],{taskDefinitionKey:n}=t;return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(i,"/usertasks/").concat(n,"/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,i){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/process-instances"),{...e,activedata:this.getActiveData(i,t)})}async wfSubmit(t,e,i){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId),{...e,activedata:this.getActiveData(i,t)})}async wfWithdraw(t,e,i){return this.app.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/withdraw"),{...e,activedata:this.getActiveData(i,t)})}async wfReassign(t,e,i){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/transfer"),{...e,activedata:this.getActiveData(i,t)})}async wfAddStepBefore(t,e,i){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/beforesign"),{...e,activedata:this.getActiveData(i,t)})}async wfAddStepAfter(t,e,i){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/aftersign"),{...e,activedata:this.getActiveData(i,t)})}async wfSendBack(t,e,i){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendback"),{...e,activedata:this.getActiveData(i,t)})}async wfSendCopy(t,e,i){return ibiz.net.post("".concat(this.getBaseUrl(),"/").concat(t[this.model.codeName.toLowerCase()],"/tasks/").concat(e.taskId,"/sendcopy"),{...e,activedata:this.getActiveData(i,t)})}async exec(t,i,n={},r={}){switch(t){case"wfstart":return this.wfStart(i,n,r);case"wfsubmit":return this.wfSubmit(i,n,r);case"reassign":return this.wfReassign(i,n,r);case"addstepbefore":return this.wfAddStepBefore(i,n,r);case"addstepafter":return this.wfAddStepAfter(i,n,r);case"sendback":return this.wfSendBack(i,n,r);case"sendcopy":return this.wfSendCopy(i,n,r);default:throw new e("「".concat(t,"」未实现"))}}}),Un=class{constructor(t){this.model=t}exportData(t,e,i,n){const r=kn(i,this.model),s="".concat(r,"/").concat(this.model.codeName2.toLowerCase(),"/exportdata/").concat(e.toLowerCase(),"/?srfexporttag=").concat(t.codeName);return ibiz.net.request(s,{method:"post",data:n,responseType:"blob"})}},Wn=t("Srfuf",(t=>(t[t.CREATE=0]="CREATE",t[t.UPDATE=1]="UPDATE",t))(Wn||{})),zn=t("AppDataEntity",class t{get srfuf(){return this.srfkey?1:0}constructor(e,i){let n;Object.defineProperty(this,"_entity",{enumerable:!1,configurable:!0,value:e}),Object.defineProperty(this,"_data",{enumerable:!1,configurable:!0,value:it(i instanceof t?i._data:i)}),Object.defineProperty(this,"srfdeid",{get:()=>e.id}),Object.defineProperty(this,"srfdecodename",{get:()=>e.codeName});const r=Ge(e.appDEFields||[],e.keyAppDEFieldId);if(r){const t=r.codeName.toLowerCase();Object.defineProperty(this,"srfkeyfile",{get:()=>t}),Object.defineProperty(this,"srfkey",{set(t){n=t},get(){return this._data[t]||n}}),Object.defineProperty(this,"srfsourcekey",{set(e){this._data[t]=e},get(){return this._data[t]}})}else ibiz.log.warn("实体[".concat(e.codeName,"]未配置主键字段"));const s=Ge(e.appDEFields||[],e.majorAppDEFieldId);if(s){const t=s.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:i}=this,n={};Object.keys(e).forEach((t=>{n[t]={enumerable:!0,set(i){e[t]=i},get:()=>e[t]}})),null==(t=this._entity.appDEFields)||t.forEach((t=>{const r=t.codeName.toLowerCase();n[r]={enumerable:!0,set(n){e[r]=i(n,t.stdDataType)},get:()=>e[r]},e[r]=i(e[r],t.stdDataType)})),Object.defineProperties(this,n)}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(Z(e))return t;if(s.isNumber(e)){const e=Z(t)||""===t?t:Number(t);return Number.isNaN(e)?(ibiz.log.debug("".concat(t,"不能转换成数字")),t):e}return t}}),Gn=t("MethodDto",class t{constructor(t,e,i){this.entity=t,this.isLocalMode=e,this.dto=i,this.dtoMap=new Map,i?(this.app=ibiz.hub.getApp(t.appId),this.fields=i.appDEMethodDTOFields||[]):this.fields=[]}async get(t,e){const i={};for(let r=0;r<this.fields.length;r++){const s=this.fields[r],a=s.codeName.toLowerCase();switch(s.type){case"SIMPLE":break;case"DTOS":{if(void 0!==e[a])break;if(!s.refAppDataEntityId)break;const n=await this.getFieldDto(s),r=(await this.app.deService.getService(s.refAppDataEntityId)).local.getList(t);if(r){const e=[];for(let i=0;i<r.length;i++)e.push(await n.get(t,r[i]));i[a]=e}break}default:throw new n(s,"未支持的应用实体方法输入属性类型: ".concat(s.type))}}return{...e,...i}}async sets(t,e){const i=await this.app.deService.getService(this.entity.id);return this.isLocalMode&&i.local.clear(t),Promise.all(e.map((async e=>{const n=this.fields.filter((t=>"DTOS"===t.type)).map((async i=>{if(!i.refAppDataEntityId)return;const n=i.codeName.toLowerCase(),r=await this.getFieldDto(i),s=e[n];s?await r.sets(t,s):await r.sets(t,[])}));for(let t=0;t<n.length;t++)await n[t];const r=new zn(this.entity,e);return this.isLocalMode&&await i.local.add(t,r),r})))}async getFieldDto(e){if(this.dtoMap.has(e.codeName))return this.dtoMap.get(e.codeName);const i=await ibiz.hub.getAppDataEntity(e.refAppDataEntityId,this.entity.appId),n=Ge(i.appDEMethodDTOs||[],e.refAppDEMethodDTOId),r=new t(i,!0,n);return this.dtoMap.set(e.codeName,r),r}});function Hn(t){return"BUILTIN"===t.actionType||"DATAQUERY"===t.dataSetType}var qn=class{constructor(t,e){this.entity=t,this.method=e;const i=e.appDEMethodInput;if(i){const e=Ge(t.appDEMethodDTOs||[],i.appDEMethodDTOId);e&&(this.dto=new Gn(t,this.isLocalMode,e))}}get isLocalMode(){return Hn(this.method)}async handle(t,e){return this.dto?this.dto.get(t,e):e}},Kn=class{constructor(t,e){this.entity=t,this.method=e;const i=e.appDEMethodReturn;if(i){const e=Ge(t.appDEMethodDTOs||[],i.appDEMethodDTOId);e&&(this.dto=new Gn(t,this.isLocalMode,e))}}get isLocalMode(){return Hn(this.method)}async handle(t,e){if(this.dto){return(await this.dto.sets(t,[e]))[0]}return U(e)&&(e={}),new zn(this.entity,e)}},Xn=class{constructor(t,e){this.entity=t,this.method=e,this.app=ibiz.hub.getApp(t.appId),this.input=new qn(t,e),this.result=new Kn(t,e)}async request(t,e,n,r){const{actionType:s,requestMethod:a}=this.method;if("REMOTE"===s){const e=this.method.codeName.toLowerCase();let s=null;switch(a){case"POST":s=await this.app.net.post(this.mergeRequestPath(t,e),n||r||{});break;case"GET":s=await this.app.net.get(this.mergeRequestPath(t,e),n||r);break;case"PUT":s=await this.app.net.put(this.mergeRequestPath(t,e),n||r||{});break;case"DELETE":s=await this.app.net.delete(this.mergeRequestPath(t,e),n||r);break;default:throw new i(this.method,a?"未支持的请求方式: ".concat(a):"未配置请求方式")}return s}throw new i(this.method,"未支持的行为类型[".concat(s,"]"))}mergeRequestPath(t,e){return"".concat(t,"/").concat(e)}calcPath(t){const e="/".concat(this.entity.codeName2.toLowerCase());return kn(t,this.entity)+e}async getService(){return this.service||(this.service=await this.app.deService.getService(this.entity.id)),this.service}createEntity(t){const e=t=>t instanceof zn?t.clone():new zn(this.entity,t);return D(t)?t.map((t=>e(t))):e(t)}},Yn=class{constructor(t,e,i,n){this.deLogicParams=t,this.params={},this.result=null,this.isEndNode=!1,this.defaultParamName="Default",this.parameters={context:e,data:D(i)?i:[i],params:n}}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)}},$n=class{},Qn=class extends $n{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,r){const s=t.params[this.dstParam];switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new i(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=r[this.value]?r[this.value]:e[this.value];return pi(s[this.dstField],this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new i(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=t.params[this.srcParam];return pi(s[this.dstField],this.op,e[this.value])}case"CURTIME":throw new n(this.model,"暂未支持条件值类型为[当前时间]");default:return pi(s[this.dstField],this.op,this.value)}}},Jn=class t extends $n{constructor(e){super(),this.model=e;const i=e.conds||[];this.conds=i.map((e=>"SINGLE"===e.logicType?new Qn(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,n){let r=!0;if(0===this.conds.length)throw new i(this.model,"界面连接条件逻辑组未配置逻辑项");for(let i=0;i<this.conds.length;i++){const s=this.conds[i].test(t,e,n);if("AND"===this.op&&!1===s){r=!1;break}if("OR"===this.op&&!0===s){r=!0;break}}return this.notMode?!r:r}},Zn=class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const e=this.model.delogicLinkGroupCond;e&&(this.groupCond=new Jn(e))}async exec(t){const{defaultLink:e}=this.model;return!(!e&&this.groupCond)||this.groupCond.test(t,t.context,t.data[0]||{})}},tr=class{constructor(t){var e;this.model=t,this.links=null==(e=t.links||[])?void 0:e.map((t=>new Zn(t)))}},er=class extends tr{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:n,dstDELogicParamId:r,retDELogicParamId:s}=this.model;if(!e)throw new i(this.model,"未指定应用实体");if(!n)throw new i(this.model,"未指定实体行为");const a=t.params[r],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,n,t.context,a,t.viewParam);c.ok&&(t.params[s]=c.data)}},ir=class extends tr{async exec(t){}},nr=class extends tr{async exec(t){t.isEndNode=!0;const{returnParamId:e,returnType:i,rawValue:r}=this.model;if(i)switch(i){case"NONEVALUE":t.result=void 0;break;case"NULLVALUE":t.result=null;break;case"SRCVALUE":t.result=ibiz.util.rawValue.format(r);break;case"LOGICPARAM":t.result=t.params[e];break;default:throw new n(this.model,"暂未支持的结束节点返回值类型: ".concat(i))}}};function rr(t,e){const{srcDELogicParamId:i,srcFieldName:r,srcValue:s}=e,a=e.srcValueType||"SRCDLPARAM";let o,c=r;switch(a){case"SRCDLPARAM":o=t.params[i],t.isEntityParam(i)&&(c=null==c?void 0:c.toLowerCase());break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return ibiz.util.rawValue.format(s);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=it(ibiz.env);break;default:throw new n(e,"暂未支持源值类型".concat(a))}if(o&&c)try{o=bi.execScriptFn({srcValue:o},"srcValue.".concat(c),{singleRowReturn:!0,isAsync:!1})}catch(t){throw ibiz.log.error("从源参数取属性".concat(c,"报错,源参数:"),o),t}return o}var sr=class extends tr{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 n(e,"暂未支持逻辑处理参数操作".concat(e.paramAction))}})))}copyParam(t,e){const{dstDELogicParamId:i}=t,n=rr(e,t);e.params[i]=it(n)}bindParam(t,e){const i=rr(e,t);e.params[t.dstDELogicParamId]=i}setParamValue(t,e){const{dstFieldName:i,dstDELogicParamId:n}=t;let r=i;e.isEntityParam(n)&&(r=null==r?void 0:r.toLowerCase());const s=rr(e,t);r?e.params[n][r]=s:e.params[n]=s}resetParam(t,e){const{dstDELogicParamId:i}=t;e.resetParam(i)}renewParam(t,e){const{dstDELogicParamId:i}=t;e.renewParam(i)}appendParam(t,e){const{dstDELogicParamId:i,dstIndex:n,srcIndex:r,srcSize:s}=t,a=rr(e,t),o=n||0,c=r||0,l=s||a.length;e.params[i].splice(o,0,...a.slice(c,l))}sortParam(t,e){const{dstDELogicParamId:i,dstFieldName:n,dstSortDir:r}=t,s=n.toLowerCase();e.params[i].sort(((t,e)=>"ASC"===r?t[s]-e[s]:e[s]-t[s]))}},ar=class extends tr{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:i,dstDELogicParamId:n,retDELogicParamId:r}=this.model,s=t.params[n],a=ibiz.hub.getApp(t.context.srfappid),o=await a.deService.exec(i,e,t.context,s);o.ok&&(t.params[r]=o.data)}},or=class extends tr{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:n}=this.model;if(!e||!n)throw new i(this.model,"缺少目标参数对象或者源参数对象配置");const r=rr(t,this.model);t.params[e]=r}},cr=class extends tr{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new i(this.model,"缺少目标参数对象配置");t.resetParam(e)}},lr=class extends tr{async exec(t){const{dstDELogicParamId:e}=this.model;if(!e)throw new i(this.model,"缺少目标参数对象配置");t.renewParam(e)}},hr=class extends tr{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:n}=this.model;if(!e||!n)throw new i(this.model,"缺少目标参数对象或者源参数对象配置");const r=rr(t,this.model);t.params[e]=it(r)}},ur=class extends tr{async exec(t){const{dstDELogicParamId:e,dstSortDir:n,dstFieldName:r}=this.model;if(!e||!r)throw new i(this.model,"缺少目标参数对象或目标属性配置");const s=r.toLowerCase();t.params[e].sort(((t,e)=>"ASC"===n?t[s]-e[s]:e[s]-t[s]))}},dr=class extends tr{async exec(t){const{dstDELogicParamId:e,srcDELogicParamId:n,dstIndex:r,srcIndex:s,srcSize:a}=this.model;if(!e||!n)throw new i(this.model,"缺少目标参数对象或者源参数对象配置");const o=rr(t,this.model),c=r||0,l=s||0,h=a||o.length;t.params[e].splice(c,0,...o.slice(l,h))}},pr=class extends tr{async exec(t){const{errorCode:e,errorInfo:i}=this.model;throw new o({response:{status:e,statusText:i}})}},fr=class{constructor(t){this.model=t}calc(t){const e=this.model.id,i=this.model;if(i.default)i.entityListParam?t.params[e]=t.data||[]:t.params[e]=t.data[0]||{};else if(i.appGlobalParam)t.params[e]=it(ibiz.env);else if(i.entityListParam)t.params[e]=[];else{if(i.entityPageParam)throw new n(i,"未支持的逻辑参数类型: 分页查询结果");if(i.entityParam)t.params[e]={};else if(i.lastReturnParam)t.initLastReturnParam(e);else if(i.appContextParam)t.params[e]=t.parameters.context;else if(i.simpleListParam)t.params[e]=[];else if(i.simpleParam)t.params[e]={};else if(i.cloneParam)t.params[e]=it(t.data||{});else{if(i.envParam)throw new n(i,"未支持的逻辑参数类型: 系统环境变量");if(i.fileListParam)throw new n(i,"未支持的逻辑参数类型: 文件对象列表变量");if(i.fileParam)throw new n(i,"未支持的逻辑参数类型: 文件对象变量");if(i.filterParam)throw new n(i,"未支持的逻辑参数类型: 过滤器对象变量");if(i.lastParam)throw new n(i,"未支持的逻辑参数类型: 最后数据变量");if(i.originEntity)throw new n(i,"未支持的逻辑参数类型: 原始数据对象");if(i.sessionParam)throw new n(i,"未支持的逻辑参数类型: 操作会话变量")}}}renew(t){const e=this.model.id,i=this.model;if(i.entityListParam||i.simpleListParam||i.entityPageParam)t.params[e]=[];else{if(!i.simpleParam&&!i.entityParam)throw new n(i,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}},mr=class{constructor(t){var e,r;if(this.model=t,this.nodes=new Map,this.params=new Map,t.customCode){if(!t.scriptCode)throw new i(t,"脚本代码模式没有配置脚本代码");this.scriptFn=bi.createScriptFn([],t.scriptCode,{isAsync:!0})}else{if(!(null==(e=t.delogicNodes)?void 0:e.length))throw new i(t,"实体逻辑没有配置逻辑节点");t.delogicNodes.forEach((t=>{const{logicNodeType:e}=t;let i;switch(e){case"BEGIN":i=new ir(t);break;case"END":i=new nr(t);break;case"DEACTION":i=new er(t);break;case"PREPAREPARAM":i=new sr(t);break;case"DEDATASET":i=new ar(t);break;case"THROWEXCEPTION":i=new pr(t);break;case"BINDPARAM":i=new or(t);break;case"RESETPARAM":i=new cr(t);break;case"COPYPARAM":i=new hr(t);break;case"RENEWPARAM":i=new lr(t);break;case"APPENDPARAM":i=new dr(t);break;case"SORTPARAM":i=new ur(t);break;default:throw new n(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,i)})),null==(r=t.delogicParams)||r.forEach((t=>{this.params.set(t.id,new fr(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,n){if(this.scriptFn)return this.scriptFn.exec({context:t,data:e,params:n});const r=new Yn(this.params,t,e,n);this.initLogicParams(r);const{startDELogicNodeId:s}=this.model;if(!s||!this.nodes.has(s))throw new i(this.model,"未设置起始节点");{const t=this.nodes.get(s);await this.deepExec(t,r)}return r.isEndNode?r.result:r.params[r.defaultParamName]?r.params[r.defaultParamName]:null}async deepExec(t,e){await t.exec(e);const{links:i}=t;for(let n=0;n<i.length;n++){const r=i[n];if(await r.exec(e)&&r.dstNode&&(await this.deepExec(r.dstNode,e),!1===t.model.parallelOutput))break}}},gr=new Map;async function yr(t,e,i={},n={}){gr.has(t)||gr.set(t,new mr(t));return gr.get(t).exec(e,i,n)}async function wr(t,i,n,r,s){const a=await async function(t,e,i){return Ze(t,await ibiz.hub.getAppDataEntity(e,i))}(t,i,n.srfappid);if(!a)throw new e("".concat(i,"找不到实体逻辑").concat(t));return yr(a,n,r,s)}async function vr(t,e,i,n){const r=it(e),s=i?it(i):i,c=n?it(n):n;try{const e=await yr(t,r,s,c);return new a(e)}catch(t){if(t instanceof o)return new a(t,500);throw t}}async function br(t,e,i,n,r){const s=ti(t,e);if(s.length){(await Promise.all(s.map((t=>yr(t,i,n,r))))).forEach((t=>{Object.assign(n,t)}))}}async function Er(t,e,i,n,r={}){if(n){if(!D(n))return br(t,e,i,n,r);await Promise.all(n.map((n=>br(t,e,i,n,r))))}}var _r=class extends Xn{get isLocalMode(){return Hn(this.method)}async inputHandle(t,e){return D(e)?Promise.all(e.map((e=>this.input.handle(t,e)))):this.input.handle(t,e)}async exec(t,e,n){if("DELOGIC"===this.method.actionType){const r=Ze(this.method.appDELogicId,this.entity);if(!r)throw new i(this.method,"缺少实体处理逻辑");return vr(r,t,e,n)}let r;switch(e&&!this.isLocalMode&&(e=await this.inputHandle(t,e)),e&&!["READ","GETDRAFT"].includes(this.method.actionMode)&&await Er(this.entity,"change",t,e,n),this.method.codeName){case"Create":r=await this.create(t,e,n||{});break;case"Get":r=await this.get(t,n);break;case"GetDraft":r=await this.getDraft(t,n);break;case"Remove":r=await this.remove(t,n);break;case"Update":r=await this.update(t,e,n);break;case"CreateTemp":r=await this.createTemp(t,e);break;case"GetTemp":r=await this.getTemp(t,e);break;case"GetDraftTemp":r=await this.getDraftTemp(t,n);break;case"RemoveTemp":r=await this.removeTemp(t,e);break;case"UpdateTemp":r=await this.updateTemp(t,e);break;default:{let i=this.calcPath(t);if(this.method.needResourceKey){let n=t[this.entity.codeName.toLowerCase()];x(n)&&(n=D(e)?null:null==e?void 0:e[this.entity.keyAppDEFieldId]),i="".concat(i,"/").concat(n)}const s=await this.request(i,t,e,n);s.data=await this.result.handle(t,s.data),r=s}}return r.data&&await Er(this.entity,"compute",t,r.data,n),r}async create(t,i,n){if(!i)throw new e("create行为没有传data");if(this.isLocalMode)return this.createTemp(t,this.createEntity(i));const r=this.calcPath(t),s=await this.app.net.post(r,i,n);return s.data=await this.result.handle(t,s.data),s}async remove(t,e){if(this.isLocalMode)return this.removeTemp(t,e);const i=this.calcPath(t);return await this.app.net.delete("".concat(i,"/").concat(t[this.entity.codeName.toLowerCase()]),e)}async update(t,i,n){if(!i)throw new e("update行为没有传data");if(this.isLocalMode)return this.updateTemp(t,this.createEntity(i));const r=this.calcPath(t),s=await this.app.net.put("".concat(r,"/").concat(t[this.entity.codeName.toLowerCase()]),i,n);return s.data=await this.result.handle(t,s.data),s}async get(t,e={}){if(this.isLocalMode)return this.getTemp(t,e);const i=this.calcPath(t),n=await this.app.net.get("".concat(i,"/").concat(t[this.entity.codeName.toLowerCase()]),e);return n.data=await this.result.handle(t,n.data),n}async getDraft(t,e){if(this.isLocalMode)return this.getDraftTemp(t,e);const i=this.calcPath(t),n=await this.app.net.get("".concat(i,"/getdraft"),e);return n.data=await this.result.handle(t,n.data),n}async createTemp(t,e){try{const i=await this.getService(),n=this.createEntity(e);let r;return r=D(n)?await Promise.all(n.map((e=>i.local.add(t,e)))):await i.local.add(t,n),new a(r)}catch(t){return new a(t,500)}}async getDraftTemp(t,e){try{const t=this.createEntity({});return t?new a(t):new a(t,500)}catch(t){return new a(t,500)}}async removeTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const i=(await this.getService()).local.delete(t,e);return i?new a(i):new a(i,500)}catch(t){return new a(t,500)}}async updateTemp(t,e){try{const i=await this.getService(),n=this.createEntity(e);let r;return r=D(n)?await Promise.all(n.map((e=>i.local.update(t,e)))):await i.local.update(t,n),r?new a(r):new a(r,500)}catch(t){return new a(t,500)}}async getTemp(t,e){try{let e=null;!e&&t&&(e=t[this.entity.codeName.toLowerCase()]);const i=(await this.getService()).local.get(t,e);return i?new a(i):new a(i,500)}catch(t){return new a(t,500)}}async removeBatchTemp(t,e){return new a(!0)}},Ir=class extends Xn{get isLocalMode(){return Hn(this.method)}async exec(t,e,i){const r=e&&D(e)?e:i||{};if(this.isLocalMode){const e=await this.searchLocal(null,new Nn(t,r));return new a(e,200)}let s;switch(this.method.dataSetType){case"INDEXDE":case"CODELIST":case"MULTIFORM":s=await this.fetchCodeListSet(t,r);break;case"REMOTE":{const n=this.calcPath(t);s=await this.request(n,t,e,i)}break;default:throw new n(this.method,"数据来源类型".concat(this.method.dataSetType,"暂未支持"))}const o=s.data||[];return s.data=o.map((t=>this.createEntity(t))),s.data&&Er(this.entity,"compute",t,s.data,r),s}async selectLocal(t,e={}){let i=(await this.getService()).local.getList(t);i=$(i,"srfordervalue");const n={},r={},s={},a={};e.srfkey&&(n.srfkey=nt(e.srfkey),delete e.srfkey);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const i=e[t];null==i?(r[t]=nt(null),s[t]=nt(void 0),a[t]=nt("")):n[t]=nt(i)}if(!et(n)){const t=rt(n),e=rt(r),o=rt(s),c=rt(a);i=i.filter((i=>{if(et(r)){if(t(i))return!0}else if(t(i)&&(e(i)||o(i)||c(i)))return!0;return!1}))}return i.map((t=>t.clone()))}async searchLocal(t,e,i=this.entity.quickSearchAppDEFieldIds){const n=await this.getService();let r=[];t?(r=n.local.getList(e.context),r.length>0&&(r=r.filter((i=>t.test(i,e))))):(r=await this.selectLocal(e.context),r.length>0&&e.query&&""!==e.query&&i&&(r=r.filter((t=>{const n=new RegExp(e.query);for(let e=0;e<i.length;e+=1){const r=t[i[e]];if(n.test(r))return!0}return!1})))),Z(e.sortField)||et(e.sortField)||(r="DESC"===e.sortMode?Q(r,e.sortField):$(r,e.sortField));const{page:s,size:a}=e,o=s*a,c=(s+1)*a-1;return r.slice(o,c).map((t=>it(t)))}async fetchCodeListSet(t,e){const{appCodeListId:n}=this.method;if(!n)throw new i(this.method,"没有指定数据来源代码表");const r=await this.app.codeList.get(n,t,e),{keyAppDEFieldId:s,majorAppDEFieldId:o}=this.entity,c=r.map((t=>({[s]:t.value,[o]:t.text})));return new a(c,200)}},Cr=class extends Ir{mergeRequestPath(t,e){return"".concat(t,"/ac/").concat(e,"?srfac=ac")}},Dr=t("DEService",class{constructor(t){this.model=t,this.methodMap=new Map,this.local=new Ln,this.configCache=new Fn(t.appId,"PSAppDataEntity",t.codeName),this.wf=new Bn(t),this.file=new Un(t)}getMethod(t,e=!1){const i=e?"ac-".concat(t):t;if(this.methodMap.has(i))return this.methodMap.get(i);const r=Ge(this.model.appDEMethods,t);let s=null;switch(r.methodType){case"DEACTION":s=new _r(this.model,r);break;case"FETCH":case"FETCHTEMP":s=e?new Cr(this.model,r):new Ir(this.model,r);break;default:throw new n(r,"未支持的服务方法类型: ".concat(r.methodType))}return this.methodMap.set(i,s),s}exec(t,i,n,r){const s=this.getMethod(t);if(s)return s.exec(i,n,r);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}execAc(t,i,n,r={}){const s=this.getMethod(t,!0);if(s)return s.exec(i,n,r);throw new e("".concat(this.model.codeName,"未支持「").concat(t,"」方法"))}aiChatSse(t,e,i={},n={}){const r=ibiz.hub.getApp(this.model.appId),s=this.calcSsePath(e);return new Promise(((e,a)=>{r.net.sse("/".concat(s),{srfactag:"AIChat",...i},{headers:{"Content-Type":"application/json"},body:JSON.stringify(n),onmessage:e=>{if(e.data){const i=JSON.parse(e.data);t(i)}},onclose:()=>{e()},onerror:t=>{a(t)}})}))}calcSsePath(t){const e=t[this.model.codeName.toLowerCase()],i="/".concat(this.model.codeName2.toLowerCase(),"/ssechatcompletion").concat(e?"/".concat(e):"");return kn(t,this.model)+i}}),Sr=t("ControlVO",class t{get srfuf(){return Z(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 i=t.dataKey;this.linkProperty(e,i,t)})),Object.keys(t).forEach((t=>{Object.prototype.hasOwnProperty.call(this,t)||this.linkProperty(t,t)}))}linkProperty(t,e,i){const n=!i||i.isOriginField;"srfuf"!==t&&(n||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=it(this.$origin),i=new t(e,this.$dataUIMap);return Object.keys(this).forEach((t=>{i[t]=this[t]})),i}}),Ar=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,i,n){return await this.app.deService.exec(this.model.appDataEntityId,t,e,i,n)}handleResponse(t){return t}toUIData(t){return new Sr(t,this.dataUIMap)}}),xr=t("MDControlService",class extends Ar{async fetch(t,e={}){var i;const n=(null==(i=this.model.fetchControlAction)?void 0:i.appDEMethodId)||"fetchdefault";let r=await this.exec(n,t,e);return r=this.handleResponse(r),r}async get(t,e={}){var i;const n=(null==(i=this.model.getControlAction)?void 0:i.appDEMethodId)||"get";let r=await this.exec(n,t,void 0,e);return r=this.handleResponse(r),r}async getDraft(t,e={}){var i;const n=(null==(i=this.model.getDraftControlAction)?void 0:i.appDEMethodId)||"getdraft";let r=await this.exec(n,t,void 0,e);return r=this.handleResponse(r),r}async remove(t,e={}){var i;const n=(null==(i=this.model.removeControlAction)?void 0:i.appDEMethodId)||"remove";return await this.exec(n,t,void 0,e)}async create(t,e){var i;const n=(null==(i=this.model.createControlAction)?void 0:i.appDEMethodId)||"create";let r=await this.exec(n,t,e.getOrigin());return r=this.handleResponse(r),r}async update(t,e){var i;const n=(null==(i=this.model.updateControlAction)?void 0:i.appDEMethodId)||"update";let r=await this.exec(n,t,e.getOrigin());return r=this.handleResponse(r),r}async exportData(t,i,n={}){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&&(H(e.data)?e.data=e.data.map((t=>this.toUIData(t))):e.data=this.toUIData(e.data)),e}}),Pr=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 i=!0;const n=this.entityModel;if(!n.enableDEMainState)return ibiz.log.debug("".concat(n.codeName,"实体不存在或者为启用主状态,返回true")),i;ibiz.log.debug("操作标识".concat(t,"主状态计算开始"),e,n);const r=Xe(n,e);if(r){ibiz.log.debug("匹配主状态",r);const e=Ye(r,n);ibiz.log.debug("允许的主状态权限集合",e),i=e.includes(t)}else ibiz.log.debug("没匹配主状态,返回false"),i=!1;return ibiz.log.debug("操作标识".concat(t,"权限计算结束:").concat(i)),i}}),Tr=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 i=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!i)throw new e("未找到应用实体[".concat(t,"]"));const n=this.constructorCache.get(t);let r;r=n?await n(i):new Pr(i),this.cache.set(t,r)}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,i){if(this.enablePermission){const e=await ibiz.hub.getApp(this.appModel.appId),n=await e.getOPPriv(t,i);if(this.enablePermission&&(null==n?void 0:n.mapSysUniResCode)&&!this.calcByResCode(n.mapSysUniResCode))return!1}if(e&&i){return(await this.getService(i)).calcByDataAccessAction(t,e)}return!0}}),Or=t("V7AuthService",class{async login(t,e){try{const i=await ibiz.net.post("/v7/login",{loginname:t,password:e}),{data:n}=i;if(n&&n.token){q(c.TOKEN,n.token,0,!0);const t=(new Date).getTime()+1e3*(n.expirein||7199);q(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"),K(c.TOKEN),K(c.TOKEN_EXPIRES),!0}catch(t){ibiz.notification.error({title:"登出失败",desc:t.message||""})}return!1}}),Lr=t("TreeNodeData",class{constructor(t,e,i){this.leaf=!1,this.leaf=!0===i.leaf,this.parent=e,this.parent&&(this.context={...this.parent.context}),i.navContext&&(this.context=Object.assign(this.context||{},i.navContext)),i.navParams&&(this.params={...i.navParams}),this.nodeId=t.id}calcIcon(t){const{sysImage:e}=t,i={};return e&&(e.cssClass&&(i.cssClass=e.cssClass),e.imagePath&&(i.imagePath=e.imagePath)),Object.values(i).length>0?i:void 0}}),Rr=t("TreeCodeListNodeData",class extends Lr{constructor(t,e,i){super(t,e,i);const{data:n}=i;if(this.deData=n,this.text=n.text,this.value=n.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=$e(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:this.value})}this.srfkey=this.value,this.srfmajortext=this.text,this.icon=this.calcIcon(t)}}),Mr=t("TreeDataSetNodeData",class extends Lr{constructor(t,e,i){super(t,e,i);const{data:n}=i;if(this.deData=n,this.text=n.srfmajortext,this.value=n.srfkey,this.id=e?"".concat(e.id,":").concat(t.id,"@").concat(n.srfkey):t.id+n.srfkey,this.id=this.id.toLowerCase(),t.appDataEntityId){const e=$e(t.appDataEntityId);this.context=Object.assign(this.context||{},{[e]:n.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:i,detreeNodeDataItems:n}=t;i&&this.deData[i]&&(e.imagePath=this.deData[i]),e&&(this.icon=e);const r=null==n?void 0:n.find((t=>"icon"===t.id));return r&&(e.htmlStr=this.calcDataItemScript(r)),Object.values(e).length>0?e:void 0}calcDataItemScript(t){if(t.customCode&&t.scriptCode)return bi.execScriptFn({data:this.deData},t.scriptCode,{isAsync:!1})}calcTextHtml(t){let e;const{detreeNodeDataItems:i}=t,n=null==i?void 0:i.find((t=>"text"===t.id));return n&&(e=this.calcDataItemScript(n)),e}}),kr=t("TreeStaticNodeData",class extends Lr{constructor(t,e,i){var n,r;super(t,e,i);const s="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=s,e&&i.parentValueLevel){let t=e;for(let e=1;e<i.parentValueLevel;e++)t=null==t?void 0:t.parent;(null==t?void 0:t.deData)&&(this.deData=t.deData),this.value=s||(null==t?void 0:t.value)}this.srfkey=(null==(n=this.deData)?void 0:n.srfkey)||this.value,this.srfmajortext=(null==(r=this.deData)?void 0:r.srfmajortext)||this.text,this.icon=this.calcIcon(t)}}),Nr=t("UIMapField",class{constructor(t,e,i={}){this.isOriginField=!1,this.isRequestNeed=!0,this.uiKey=t,this.dataKey=e,Z(i.isOriginField)||(this.isOriginField=i.isOriginField),Z(i.dataType)||(this.dataType=i.dataType)}convertVal(t){if(!this.dataType)return t;if(s.isNumber(this.dataType)){const e=Z(t)||""===t?t:Number(t);return Number.isNaN(e)?(ibiz.log.debug("".concat(t,"不能转换成数字")),t):e}return t}}),Vr=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}}),Fr=t("MqttService",class{constructor(t,e,i){if(this.appId=i,this.evt=new z,this.options={connectTimeout:6e3,clientId:G(),username:"",password:"",keepalive:60,clean:!0},U(t)||U(e))throw new Error("mqttTopic or token is empty");this.options.username=t,this.options.password=e}async connect(){const t=await Promise.resolve().then((()=>It(de(),1))),e=t.default?t.default:t,{location:i}=window;this.client=e.connect("ws://".concat(i.host).concat(ibiz.env.baseUrl,"/").concat(this.appId).concat(ibiz.env.mqttUrl),this.options),this.client.on("connect",(()=>{ibiz.log.debug("mqtt connect")})),this.client.on("error",(t=>{ibiz.log.error("mqtt error",t)})),this.client.on("message",((t,e)=>{this.evt.emit("message",JSON.parse(e.toString())),ibiz.log.debug("mqtt message",t,e.toString())})),this.client.on("reconnect",(()=>{ibiz.log.debug("mqtt reconnect")})),this.client.on("close",(()=>{console.debug("mqtt close")}))}close(){var t;null==(t=this.client)||t.end()}}),jr=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 i=await ibiz.hub.getAppDataEntity(t,this.appModel.appId);if(!i)throw new e("未找到应用实体[".concat(t,"]"));const n=this.constructorCache.get(t);let r;r=n?await n(i):new Dr(i),this.cache.set(t,r)}return this.cache.get(t)}clearTempCache(t){this.cache.forEach((e=>{e.local.clear(t)}))}async exec(t,e,i,n,r){return(await this.getService(t)).exec(e,i,n,r)}}),Br=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,i,r={},s={}){const a=it(i),o=await ibiz.hub.config.view.get(t);if(!o)throw new e("应用视图[".concat(t,"]不存在"));if((a.srfkey||0===r.srfuf)&&o.appDataEntityId){const t=$e(o.appDataEntityId);a.srfkey&&(a[t]=a.srfkey,a.srfkey=void 0),0===r.srfuf&&(a[t]=void 0,delete r.srfuf)}if(o.redirectView){return ui(await ibiz.hub.getAppView(t),a,r,s)}const{openMode:c="INDEXVIEWTAB"}=o;switch(s.openMode||c){case"INDEXVIEWTAB":return s.noWaitRoute?(this.openIndexViewTab(o,a,r),{ok:!0}):this.openIndexViewTab(o,a,r);case"POPUP":throw new n(o,"未支持的视图打开模式: POPUP");case"POPUPMODAL":return this.openModal(o,a,r);case"POPUPAPP":throw new n(o,"未支持的视图打开模式: POPUPAPP");case"POPOVER":return this.openPopover(o,s.event,a,r);case"DRAWER_LEFT":case"DRAWER_RIGHT":case"DRAWER_TOP":case"DRAWER_BOTTOM":return this.openDrawer(o,a,r);case"USER":return this.openUserCustom(o,a,r);default:return this.openIndexViewTab(o,a,r)}}openIndexViewTab(t,e,i={}){return ibiz.openView.root(t.id,e,i)}async openModal(t,e,i={}){return ibiz.openView.modal(t.id,e,i)}async openPopover(t,i,n,r={}){if(!i)throw new e("气泡打开缺少event");return ibiz.openView.popover(t.id,i,n,r)}async openDrawer(t,e,i={}){return ibiz.openView.drawer(t.id,e,i)}async openUserCustom(t,e,i={}){return ibiz.openView.custom(t.id,e,i)}};Br.TAG="ibiz.app-view.open";var Ur=t("OpenAppViewCommand",Br),Wr=class t{constructor(){ibiz.commands.register(t.TAG,this.exec.bind(this))}async exec(t,i,r={},s={}){const a=ibiz.hub.getApp(i.srfappid).getAppFunc(t);if(!a)throw new e("找不到叫".concat(t,"的应用功能"));const{navigateContexts:o,navigateParams:c,appFuncType:l}=a,h=i.clone();Object.assign(h,je(o,r,i));const u=je(c,r,i);switch(l){case"APPVIEW":return this.openAppView(a,h,u,s);case"OPENHTMLPAGE":return this.openHtmlPage(a);case"PDTAPPFUNC":return this.openPdAppFunc(a,h,u);case"JAVASCRIPT":return this.executeJavaScript(a,h,u);case"CUSTOM":return this.custom(a,h,u);default:throw new n(a,"未支持的应用功能类型: ".concat(l))}}async openAppView(t,i,n,r){if(!t.appViewId)throw new e("应用视图[".concat(t.appViewId,"]不存在"));return ibiz.commands.execute(Ur.TAG,t.appViewId,i,n,r)}openHtmlPage(t){const e=t.htmlPageUrl;window.open(e,"_blank")}openPdAppFunc(t,i,n){throw ibiz.log.warn("openPdAppFunc",t,i,n),new e("未实现")}executeJavaScript(t,i,n){throw ibiz.log.warn("executeJavaScript",t,i,n),new e("未实现")}custom(t,i,n){throw ibiz.log.warn("custom",t,i,n),new e("未实现")}};Wr.TAG="ibiz.app-func.exec";var zr=t("AppFuncCommand",Wr);function Gr(){new zr,new Ur}var Hr=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 Fn(t.appId,"PSSysApp",t.codeName),this.deService=new jr(t),this.codeList=new Vn(t),this.authority=new Tr(t)}get appId(){return this.model.appId}async init(){await this.authority.init(),await this.loadAppModelStyle(),ibiz.env.enableMqtt&&(this.mqtt=new Fr(ibiz.appData.mqtttopic,h(),this.model.appId),this.mqtt.evt.on("message",(t=>{ibiz.mc.command.asyncAction.next(t)})),await this.mqtt.connect())}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 i=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUIActions.find((e=>e.id===t));if(i)return i}return this.model.appDEUIActions.find((e=>e.id===t))}async getOPPriv(t,e){var i,n;let r=null==(i=this.model.deopprivs)?void 0:i.find((e=>e.name===t));if(!r&&e){r=null==(n=(await ibiz.hub.getAppDataEntity(e,this.model.appId)).deopprivs)?void 0:n.find((e=>e.name===t))}return r}async getDEUILogic(t,e){return(await ibiz.hub.getAppDataEntity(e,this.model.appId)).appDEUILogics.find((e=>e.id===t))}}),qr=class{parse(t){return t}},Kr=class{constructor(){this.appMenu=new qr}},Xr=class{constructor(){this.viewConfigs=new Map}has(t){return this.viewConfigs.has(t)}set(t,e){this.viewConfigs.set(t,e)}async get(t){if(!this.viewConfigs.has(t)){const i=await ibiz.hub.getAppView(t);if(!i)throw new e("视图[".concat(t,"]不存在"));this.set(i.id,{id:i.id,codeName:i.codeName,openMode:i.openMode,viewType:i.viewType,width:i.width,height:i.height,appDataEntityId:i.appDataEntityId,redirectView:i.redirectView})}return this.viewConfigs.get(t)}getSync(t){return this.viewConfigs.has(t)?this.viewConfigs.get(t):null}},Yr=class{constructor(){this.view=new Xr}},$r=t("FormNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))($r||{})),Qr=t("GridNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Qr||{})),Jr=t("PanelNotifyState",(t=>(t.LOAD="LOAD",t.DRAFT="DRAFT",t.SAVE="SAVE",t))(Jr||{})),Zr=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}}),ts=t("LoadingState",class{constructor(){this.isLoading=!1,this.counter=new Zr(u)}begin(){this.isLoading=!0,this.counter.increment()}end(){this.counter.decrement((()=>{this.isLoading=!1}))}}),es=t("CTXState",class{}),is=t("CTX",class{constructor(t){this.parent=t,this.isDestroyed=!1,this.evt=new z(3e3),this.controllersMap=new Map,this.state=new es}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}}),ns=t("ActivityCounter",class extends Zr{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())}}),rs=t("UIActionButtonState",class{constructor(t,e,i){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=i,this.appId=e}async init(){if(!this.uiActionId)return void(this.isInit=!0);const t=await ii(this.uiActionId);if([,this.appDeName]=this.uiActionId.split("@"),!t)return;const{dataAccessAction:e,noPrivDisplayMode:i,actionTarget:n,uiactionMode:r,uiactionTag:s}=t;this.dataAccessAction=e,1===i?this.noPermissionHidden=!1:6===i&&(this.visible=!1),(n&&"NONE"!==n||"SYS"===r&&["Save","SaveAndExit","SaveAndNew","Edit","Remove","RemoveAndExit"].includes(s))&&(this.noDataDisabled=!0),this.isInit=!0}async calcPermission(t,e){if(!this.dataAccessAction)return;const i=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 i.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)}}),ss=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((i=>i.update(t,e))))}}),as=t("QXEventEx",class extends z{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((i=>{i(t,...e)}))}async asyncEmit(t,...e){const i=super.asyncEmit(t,...e),n=this.anyEventFns.map((i=>i(t,...e))),r=Promise.all(n),s=await i,a=await r;return s.concat(...a)}reset(){super.reset(),X(this.anyEventFns)}}),os=t("ControllerEvent",class{constructor(t){this.getBaseArgs=t,this.isDestroyed=!1,this.evt=new as}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 cs(t,e){return(!Z(t)&&""!==t||!Z(e)&&""!==e)&&t!==e}function ls(t){let e=Array.isArray(t)?t[0]:t;return e&&e instanceof Sr&&(e=e.getOrigin()),e}function hs(t,i,n){const r=[];return t.forEach((t=>{const{valueRuleType:s}=t,a=t.sysValueRule,o=t.defvalueRule;if("SYSVALUERULE"===s&&a)"REG"===a.ruleType?r.push({pattern:new RegExp(a.regExCode),message:a.ruleInfo,trigger:"change blur"}):"SCRIPT"===a.ruleType&&r.push({validator:(t,e,i,n)=>{if(!e)return!0;try{bi.execScriptFn({rule:t,value:e,callback:i,source:n},a.scriptCode,{isAsync:!1})}catch(t){return console.error(t),!1}return!0},trigger:"change blur"});else if("DEFVALUERULE"===s&&o){const t=n||i;r.push({validator:(i,n,r,s)=>{if(U(s[t]))return!0;const{isPast:a,infoMessage:c}=Ei(t,s,o.groupCond);return a||r(new e(c||o.ruleInfo)),!0},trigger:"change blur"})}})),r}function us(t){const e=[],{maxLength:i,minLength:n}=t,{maxValue:r,minValue:s}=t;return i&&e.push({validator:(t,e,n)=>{if(Z(e)||!(e.length>i))return!0;n(new Error("内容长度必须小于等于".concat(i,",当前长度为").concat(e.length)))}}),n&&e.push({validator:(t,e,i)=>{if(Z(e)||!(e.length<n))return!0;i(new Error("内容长度必须大于等于".concat(n,",当前长度为").concat(e.length)))}}),Z(r)||e.push({validator:(t,e,i)=>{if(!(!Z(e)&&Y(e)&&e>r))return!0;i(new Error("值必须小于等于".concat(r)))}}),Z(s)||e.push({validator:(t,e,i)=>{if(!(!Z(e)&&Y(e)&&e<s))return!0;i(new Error("值必须大于等于".concat(s)))}}),e}var ds=t("ValueExUtil",class{static mergeDefault(t){return st(t,{textSeparator:",",valueSeparator:","})}static toText(t,i){if(Z(i)||""===i)return"";const{valueType:n,objectNameField:r,textSeparator:s}=this.mergeDefault(t);if(["OBJECTS","OBJECT"].includes(n)){if(!r)throw new e("缺少objectNameField");const t=r.toLowerCase();return"OBJECTS"===n?i.map((e=>e[t]||"---")).join(s):i[t]}return"SIMPLES"===n?i.join(s):"".concat(i)}});function ps(t,i){var r;const{name:s,valueType:a,defaultValue:o,valueFormat:c}=t,{data:l,context:h,params:u}=i;if(Z(a)&&Z(o))return;if("RESET"===a)return null;const d=l[s];if(!at(d)){if(!a&&o)return o;switch(a){case"APPDATA":if(Object.prototype.hasOwnProperty.call(u,o))return u[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 ct().format(c);case"PARAM":return l[o];case"SESSION":case"APPLICATION":if(!(null==(r=ibiz.appData)?void 0:r.context))throw new e("appdata.context不存在");return ibiz.appData.context[o];case"CONTEXT":return u[o];case"UNIQUEID":return G();default:throw new n({},"默认值类型[".concat(a,"]未支持"))}}}var fs="__self",ms=t("BaseController",class{constructor(t,e,i,n){this.model=t,this.context=e,this.params=i,this.ctx=n,this.state={},this.name="",this.evt=new os(this.getEventArgs.bind(this)),this.mountCounter=new ns(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(fs),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(fs)||this.mountCounter.attend(fs)}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)}}),gs=class t{constructor(t){this.msgGroupId=t,this.viewMsgMap=new Map}async init(t){var i,n;const r=ibiz.hub.getApp(t.srfappid).model,s=null==(i=r.appViewMsgGroups)?void 0:i.find((t=>t.id===this.msgGroupId));if(!s)throw new e("找不到视图消息组".concat(this.msgGroupId,"的模型"));this.msgGroup=s;const a=s.appViewMsgGroupDetails.map((t=>t.appViewMsgId));if(null==(n=r.appViewMsgs)||n.forEach((t=>{const e=a.indexOf(t.id);-1!==e&&(this.viewMsgMap.set(t.id,t),a.splice(e,1))})),a.length)throw new e("没有找到".concat(a.join(","),"视图消息模型"))}getDeFieldName(t,e){var i,n;if(e)return null==(n=null==(i=ei(t,e))?void 0:i.name)?void 0:n.toLowerCase()}static async fetchDataSet(t,e,n){const{appDataEntityId:r,appDEDataSetId:s}=t;if(!s)throw new i(t,"未配置实体数据集");const a=await ibiz.hub.getApp(e.srfappid).deService.exec(r,s,e,n);return a.data.length?a.data:[]}async calcViewMessages(t,e){const i=this.msgGroup.appViewMsgGroupDetails,n=[];return(null==i?void 0:i.length)&&await Promise.all(i.map((async i=>{if(1===this.viewMsgMap.get(i.appViewMsgId).dynamicMode){const r=await this.calcDynaMsgs(i,t,e);n.push(...r)}else{const t=this.calcStaticMsg(i);n.push(t)}}))),n}calcStaticMsg(t){const{position:e}=t,{title:i,message:n,removeMode:r,position:s,messageType:a}=this.viewMsgMap.get(t.appViewMsgId);return{title:i,message:n,position:e||s,messageType:a,removeMode:r}}async calcDynaMsgs(e,n,r){const s=this.viewMsgMap.get(e.appViewMsgId),{appDataEntityId:a,orderValueAppDEFieldId:o,titleAppDEFieldId:c,removeFlagAppDEFieldId:l,msgTypeAppDEFieldId:h,contentAppDEFieldId:u,msgPosAppDEFieldId:d}=s;if(!a)throw new i(s,"未配置应用实体");const p=await ibiz.hub.getAppDataEntity(a,n.srfappid),f={...r},m=this.getDeFieldName(p,o);m&&(f.sort="".concat(m,",asc"));const g=await t.fetchDataSet(s,n,f);if(!g.length)return[];const y=this.calcStaticMsg(e),w=this.getDeFieldName(p,c),v=this.getDeFieldName(p,d),b=this.getDeFieldName(p,u),E=this.getDeFieldName(p,h),_=this.getDeFieldName(p,l);return g.map((t=>{const e={};return v&&!Z(t[v])&&(e.position=t[v]),w&&!Z(t[w])&&(e.title=t[w]),b&&!Z(t[b])&&(e.message=t[b]),E&&!Z(t[E])&&(e.messageType=t[E]),_&&!Z(t[_])&&(e.removeMode=t[_]),tt(y,e)}))}},ys=t("ViewController",class extends ms{constructor(t,e,i,n){super(ibiz.util.layoutPanel.fill(t),r.create({},e),i||{},new is(n)),this.session={},this.modal=new Ni({}),this.providers={},this.engines=[],this.slotProps={},this.counters={},this.viewLoading=new ts,this.isCloseView=!1,this._isActive=!0,n&&n.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=hi(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 jn.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=>{at(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 Ji(t);this.providers[t.name]=e;const i=ci(this.model);i&&await Promise.all(i.map((async t=>{const e=await Ji(t);this.providers[t.name||t.id]=e}))),await this.initCounters();const n=li(this.model);n.length&&(this.scheduler=ibiz.scheduler.createViewScheduler(n),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,(Z(this.context.srfsessionid)||et(this.context.srfsessionid))&&(this.context.srfsessionid=G());const t=this.model.appViewNavContexts;let e={};B(t)&&(e=je(t,this.params,this.context)),Object.assign(this.context,e);const i=this.model.appViewNavParams;let n={};B(i)&&(n=je(i,this.params,this.context)),Object.assign(this.params,n),this.state.isMounted&&this.callUIAction("Refresh")}async call(t,e){let i;for(const n of this.engines)if(i=await n.call(t,e),void 0!==i)break;return i}async callUIAction(t,i){const n=this.call(t,i);if(void 0===n)throw new e("没有引擎支持预置界面行为".concat(t));return n}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 gs(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,...i]=t,n={title:e.title,desc:e.message};"WARN"===e.messageType?await ibiz.modal.warning(n):"ERROR"===e.messageType?await ibiz.modal.error(n):await ibiz.modal.info(n),i.length&&this.alertViewMessage(i)}}),ws=(t("MobViewController",class extends ys{}),t("WFStepTraceViewController",class extends ys{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),i=Object.assign(this.context.clone(),this.params),n=await t.wf.getWFHistory(i);n.data&&(this.state.historyData=n.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,i){const{navigateContexts:n,navigateParams:r}=this.model;let s={};n&&t&&(s=je(n,t,i,e));const a=Object.assign(e.clone(),s);let o={};return r&&t&&(o=je(r,t,i,e)),{context:a,params:o}}toObj(t){if(!t)return;return new Function("return (".concat(t,");"))()}toBoolean(t){return Object.is("true",t)}})),vs=(t("CodeListEditorController",class extends ws{async loadCodeList(t){const{context:e,params:n}=this.handlePublicParams(t,this.context,this.params);if(this.model.appCodeListId){const t=await ibiz.hub.getApp(this.context.srfappid);let i=[];return i=await t.codeList.get(this.model.appCodeListId,e,n),i}throw new i(this.model,"编辑器类型[".concat(this.model.editorType,"],未配置代码表"))}}),t("ControlController",class extends ms{constructor(t,e,i,n){super(t,e,i,n),this.controlParams={},this.providers={},this.registerToCtx();const r=ibiz.util.layoutPanel.get("".concat(t.controlType,"_DEFAULT"));r&&(this.controlPanel=r)}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 Ji(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(),i={...this.params};let n=this.getData()||[];return(null==t?void 0:t.data)&&(n=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(i,t.viewParam),{context:e,params:i,data:n}}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={};B(t)&&(e=je(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 i;const{ctrlMsg:n}=this.model,r=null==(i=null==n?void 0:n.ctrlMsgItems)?void 0:i.find((e=>e.name===t));let s,a;if(r&&r.content){a=Z(r.timeout)?void 0:r.timeout/1e3;const t={...this.getEventArgs()};(null==e?void 0:e.data)&&(t.data=e.data),s=bi.execScriptFn(t,"`".concat(r.content,"`"),{isAsync:!1,singleRowReturn:!0})}else{const e="CONTROL.".concat(this.model.controlType,".").concat(t).toUpperCase();s=ibiz.i18n.t(e,""),s===e&&(s="")}if(!s&&(null==e?void 0:e.default)&&(s=e.default),!s&&(null==e?void 0:e.error)&&(s=s||e.error.message),s){if(null==e?void 0:e.error)throw ibiz.log.error(e.error),new d(s,a);ibiz.message.success(s,a,0===a)}}})),bs=t("MDControlController",class extends vs{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:i,sortQuery:n,noSort:r}=this.state,s={...this.params};return i&&(s.page=e-1,s.size=i),!r&&n&&(s.sort=n),await this._evt.emit("onBeforeLoad",void 0),Object.assign(s,{...this.state.searchParams}),t&&Object.assign(s,t),s}async load(t={}){if(this.state.isSimple)return[];await this.startLoading();try{const e=!0===t.isInitialLoad,i=!0===t.isLoadMore;e?this.state.curPage=1:i&&(this.state.curPage+=1);const{context:n}=this.handlerAbilityParams(t),r=await this.getFetchParams(null==t?void 0:t.viewParam),s=await this.service.fetch(n,r);"number"==typeof s.total&&(this.state.total=s.total),i?this.state.items.push(...s.data):this.state.items=s.data,await this.afterLoad(t,s.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:i,params:n,data:r}=this.handlerAbilityParams(t);if(!(null==r?void 0:r.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 s=!1;try{const e=$e(this.model.appDataEntityId);await Bi(r.map((async t=>{if(0!==t.srfuf){const r=i.clone();r[e]=t.srfkey,await this.service.remove(r,n),s=!0}this.afterRemove(t)}))),!0!==(null==t?void 0:t.silent)&&this.actionNotification("REMOVESUCCESS",{data:r,default:"数据[".concat(r.map((t=>t.srfmajortext)).join("、"),"]删除成功!")}),s&&await this.refresh()}catch(t){throw await this._evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t,data:r}),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;p(e,t)||(this.state.selectedData=t,this._evt.emit("onSelectionChange",{data:t}))}async onRowClick(t){const{selectedData:e}=this.state,i=e.filter((e=>e.srfkey!==t.srfkey));i.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(i),1===this.state.mdctrlActiveMode&&await this.setActive(t)}async onDbRowClick(t){2===this.state.mdctrlActiveMode&&await this.setActive(t)}async importData(){}async exportData(t){}}),Es=t("AppMenuController",class extends vs{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,n,r=!0){const s=f(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!s)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:n}),!s.appFuncId)throw new i(s,"没有配置应用功能");const a=this.context.clone();this.routeDepth&&r&&Object.assign(a,{toRouteDepth:this.routeDepth+1}),await ibiz.commands.execute(zr.TAG,s.appFuncId,a,this.params)}initMenuItemState(t){var e;const i={permitted:!0,visible:!0};if(t.hidden)i.visible=!1;else{let n=!0;t.accessKey&&(n=this.app.authority.calcByResCode(t.accessKey));let r=n;if(null==(e=t.appMenuItems)?void 0:e.length){const e=t.appMenuItems.map((t=>this.initMenuItemState(t).visible));r=r&&e.includes(!0)}i.permitted=n,i.visible=r}return this.state.menuItemsState[t.id]=i,i}getAllItems(){const t=[],e=i=>{i.forEach((i=>{t.push(i),i.appMenuItems&&i.appMenuItems.length>0&&e(i.appMenuItems)}))};return e(this.model.appMenuItems),t}getCounter(t){const{counters:e}=this.ctx.view;return e[t]?e[t]:null}}),_s=(t("AppMenuIconViewController",class extends Es{async onClickMenuItem(t,n){const r=f(this.model,t,{compareField:"id",childrenFields:["appMenuItems"]});if(!r)throw new e("找不到名为".concat(t,"的菜单项"));if(this.evt.emit("onClick",{eventArg:t,event:n}),!r.appFuncId)throw new i(r,"没有配置应用功能");const s=this.context.clone();1===this.routeDepth&&Object.assign(s,{toRouteDepth:1}),await ibiz.commands.execute(zr.TAG,r.appFuncId,s,this.params)}}),t("CalendarService",class extends xr{async search(t,e={}){const{sysCalendarItems:i}=this.model;if(!i)return[];const n=i.map((async i=>{const n=i.appDEDataSetId||"fetchdefault";return this.exec2(n,t,e,void 0,i.appDataEntityId)}));return(await Promise.all(n)).map(((t,e)=>this.setCalendarConfigData(t.data,e))).flat()}setCalendarConfigData(t,i){const{sysCalendarItems:n}=this.model;if(!n)throw new e("未找到日历项模型");const r=n[i];if(!r)throw new e("未找到日历项模型");return t.map((t=>new Vr(r,t)))}async exec2(t,e,i={},n={},r=this.model.appDataEntityId){return await this.app.deService.exec(r,t,e,i,n)}}));t("CalendarController",class extends bs{initState(){super.initState(),this.state.selectedDate=new Date,this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new _s(this.model),await this.service.init(this.context)}async load(t={}){const e=!0===t.isInitialLoad,{context:i}=this.handlerAbilityParams(t),n=await this.getFetchParams(null==t?void 0:t.viewParam);let r;await this.startLoading();try{r=await this.service.search(i,n)}finally{await this.endLoading()}return await this.afterLoad(t,r),this.state.isLoaded=!0,this.state.items=r,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),r}getCurSelectDate(t){const{selectedDate:e}=this.state,{start:i,end:n}=t;if(!i||!n){const t=new Date(e.getFullYear(),e.getMonth(),1),i=new Date(e.getFullYear(),e.getMonth()+1,1);return{start:ct(t).format("YYYY-MM-DD HH:mm:ss"),end:ct(i).format("YYYY-MM-DD HH:mm:ss")}}return{start:i,end:n}}async getFetchParams(t={}){const{curPage:e,size:i,sortQuery:n,noSort:r}=this.state,s={...this.params};!r&&n&&(s.sort=n),await this._evt.emit("onBeforeLoad",void 0),Object.assign(s,{...this.state.searchParams}),i&&(s.page=e-1,s.size=i),t&&Object.assign(s,t);const a=this.getCurSelectDate(s);return Object.assign(s,a),s}async onRowClick(t){const{selectedData:e}=this.state,i=e.filter((e=>e.deData.srfkey!==t.deData.srfkey));i.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(i),1===this.state.mdctrlActiveMode&&await this.setActive(t)}setSelectDate(t){this.state.selectedDate=t}});ct.extend(lt),ct.extend(ht),ct.extend(ut),ct.extend(dt),ct.extend(pt);var Is="$default_group",Cs=class{constructor(t,e){this.model=t,this.chartGenerator=e,this.staticOptions={},this.autoCompleteCategory=!0,this.model=t,this.chartGenerator=e;const{chartSeriesEncode:n,caption:r,id:s,userParam:a}=t;if(!t.catalogField)throw new i(t,"缺少分类属性配置");if(!t.valueField)throw new i(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}=n||{};this.xAxisIndex=_(o),this.yAxisIndex=_(c),this.seriesName=r||s,this.staticOptions=this.calcStaticOptions(),a&&(this.seriesUserParam=Ls(a))}calcStaticOptions(){return{type:this.model.seriesType,name:this.seriesName,emphasis:{label:{fontSize:20,show:!0}},label:{position:"top",show:!0}}}translateVal(t,e,i=!1){if(Z(e))return;if(Z(t))return e;const n=this.chartGenerator.codeListMap.get(t);if(null==n?void 0:n.length){const t=n.find((t=>t.value===e));if(t)return t.text}return i?void 0:e}calcGroupData(t){this.groupData={};const e=this.groupData,{seriesCodeListId:i,catalogCodeListId:n}=this.model;return t.forEach((t=>{let r=Is;if(this.groupField){const e=this.translateVal(i,t[this.groupField]);if(Z(e))return;r=e}if(!e[r]&&(e[r]=new Map,n&&this.autoCompleteCategory)){this.chartGenerator.codeListMap.get(n).forEach((t=>{e[r].set(t.text,{value:0})}))}const s=this.translateVal(n,t[this.catalogField],!0);s&&(e[r].get(s)||e[r].set(s,{value:0}),e[r].get(s).value+=t[this.valueField],e[r].get(s).deData=t)})),e}calcGroupSeries(t){return Object.keys(t).map((e=>{const i=t[e],n=this.calcSeriesData(i);let r={...this.staticOptions,data:n};return e!==Is&&(r.name=e),this.seriesUserParam&&(r=ot(r,this.seriesUserParam)),r}))}calcSeriesData(t){const e=[];return t.forEach(((t,i)=>{var n;e.push([i,t.value,null==(n=t.deData)?void 0:n.srfkey])})),e}calcByData(t){const e=this.dataPreprocess(t),i=this.calcGroupData(e);return this.addTimeData(i),this.calcGroupSeries(i)}getSrfkeyByParams(t){return t.value[2]}dataPreprocess(t){const e=[];t.forEach((t=>{e.push(it(t))}));const{groupMode:i}=this.model;return i&&e.forEach((t=>{let e="";if("DAY"===i||"YEAR"===i||"MONTH"===i){if("DAY"===i?e="YYYY-MM-DD":"YEAR"===i?e="YYYY":"MONTH"===i&&(e="YYYY-MM"),t[this.catalogField]){const i=ct(t[this.catalogField]).format(e);t[this.catalogField]=i}}else if("QUARTER"===i){if(t[this.catalogField]){const e="".concat(ct(t[this.catalogField]).format("YYYY"),"-").concat(ct(t[this.catalogField]).quarter());t[this.catalogField]=e}}else if("YEARWEEK"===i&&t[this.catalogField]){const e="".concat(ct(t[this.catalogField]).format("YYYY"),"-").concat(ct(t[this.catalogField]).week());t[this.catalogField]=e}})),e}sortTimeData(t){const{groupMode:e}=this.model;Object.keys(t).forEach((i=>{const n=t[i];let r=[];"DAY"===e||"YEAR"===e||"MONTH"===e?r=Array.from(n.keys()).sort(((t,e)=>ct(t).diff(ct(e)))):"QUARTER"!==e&&"YEARWEEK"!==e||(r=Array.from(n.keys()).sort(((t,e)=>{const[i,n]=t.split("-"),[r,s]=e.split("-");return i!==r?parseInt(i,10)-parseInt(r,10):parseInt(n,10)-parseInt(s,10)})));const s=new Map;r.forEach((t=>{s.set(t,n.get(t))})),t[i]=s}))}addTimeData(t){const{groupMode:e}=this.model;if(!e||"CODELIST"===e)return;const i=[];Object.keys(t).forEach((e=>{t[e].forEach(((t,e)=>{i.push(ct(e))}))}));const n=ct.max(i),r=ct.min(i);if("DAY"===e){let e=r;const i=n;for(;null==e?void 0:e.isSameOrBefore(i,"day");){const i=e.format("YYYY-MM-DD");Object.keys(t).forEach((e=>{t[e].get(i)||t[e].set(i,{value:0})})),e=e.add(1,"day")}}else if("YEAR"===e){let e=r.year();const i=n.year();for(;e<=i;){const i=e.toString();Object.keys(t).forEach((e=>{t[e].get(i)||t[e].set(i,{value:0})})),e+=1}}else if("MONTH"===e){let e=r.clone().startOf("month");const i=n.clone().startOf("month");for(;e.isSameOrBefore(i);){const i=e.format("YYYY-MM");Object.keys(t).forEach((e=>{t[e].get(i)||t[e].set(i,{value:0})})),e=e.add(1,"month")}}else if("QUARTER"===e){const e=[];Object.keys(t).forEach((i=>{t[i].forEach(((t,i)=>{e.push(i)}))}));const i=e.reduce(((t,e)=>e<t?e:t),e[0]),n=e.reduce(((t,e)=>e>t?e:t),e[0]),[r]=i.split("-"),[s]=n.split("-");for(let e=parseInt(r,10);e<=parseInt(s,10);e++)for(let i=1;i<=4;i++){const n="".concat(e,"-").concat(i);Object.keys(t).forEach((e=>{t[e].get(n)||t[e].set(n,{value:0})}))}}else if("YEARWEEK"===e){const e=[];Object.keys(t).forEach((i=>{t[i].forEach(((t,i)=>{e.push(i)}))}));const i=e.reduce(((t,e)=>e<t?e:t),e[0]),n=e.reduce(((t,e)=>e>t?e:t),e[0]),[r]=i.split("-"),[s]=n.split("-");for(let e=parseInt(r,10);e<=parseInt(s,10);e++){const i=ct("".concat(e,"-12-31")).isoWeek();for(let n=1;n<=i;n++){const i="".concat(e,"-").concat(n);Object.keys(t).forEach((e=>{t[e].get(i)||t[e].set(i,{value:0})}))}}}this.sortTimeData(t)}},Ds=class extends Cs{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new i(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new i(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex;const{stack:e,step:n}=this.model;return n&&(t.step="middle"),t}},Ss=class extends Cs{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new i(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new i(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,this.model,t}},As=class extends Cs{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 i;const n=t.get(e);return{name:e,value:[n.value,null==(i=n.deData)?void 0:i.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},xs=class extends Cs{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 i;const n=t.get(e);return{name:e,value:[n.value,null==(i=n.deData)?void 0:i.srfkey]}}))}getSrfkeyByParams(t){return t.value[1]}},Ps=class extends Cs{calcStaticOptions(){if(void 0===this.xAxisIndex)throw new i(this.model,"序列没有配置X坐标轴");if(void 0===this.yAxisIndex)throw new i(this.model,"序列没有配置Y坐标轴");const t=super.calcStaticOptions();return t.xAxisIndex=this.xAxisIndex,t.yAxisIndex=this.yAxisIndex,t}},Ts=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 i=this.indicator[t];(!i||i.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})))}}},Os=class extends Cs{calcStaticOptions(){return super.calcStaticOptions()}calcRadarCoordSystem(t){const e=this.calcGroupData(t);this.chartGenerator.radarMap.has(this.catalogField)||this.chartGenerator.radarMap.set(this.catalogField,new Ts(this.chartGenerator.radarMap.size));const i=this.chartGenerator.radarMap.get(this.catalogField);Object.values(e).forEach((t=>{Object.keys(t).forEach((e=>{i.updateIndicator(e,t.get(e).value)}))}))}calcByData(t){const e=this.groupData,i=this.chartGenerator.radarMap.get(this.catalogField),n=Object.keys(e).map((t=>{const n=e[t],r=i.indicatorKeys.map((t=>n.has(t)?n.get(t):0));return{name:t===Is?this.seriesName:t,value:r}}));let r={...this.staticOptions,data:n};return this.seriesUserParam&&(r=ot(r,this.seriesUserParam)),r}getSrfkeyByParams(t){return t.value[1]}};function Ls(t){const e={};return t&&Object.keys(t).forEach((i=>{const n=i.indexOf(".");if(-1===n)return;const r=i.slice(n+1);if(r)try{e[r]=JSON.parse(t[i])}catch(n){e[r]=t[i]}})),e}var Rs=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:i,chartXAxises:n,chartYAxises:r,userParam:s}=t;e&&(this.staticOptions.title=this.calcTitleOption(e)),i&&(this.staticOptions.legend=this.calcLegendOption(i)),(null==n?void 0:n.length)&&(this.staticOptions.xAxis=this.calcXYAxisOption(n)),(null==r?void 0:r.length)&&(this.staticOptions.yAxis=this.calcXYAxisOption(r)),s&&(this.chartUserParam=Ls(s))}initSeriesGenerators(){var t;null==(t=this.model.dechartSerieses)||t.forEach((t=>{let e;switch(t.seriesType){case"line":e=new Ds(t,this);break;case"bar":e=new Ss(t,this);break;case"scatter":e=new Ps(t,this);break;case"pie":e=new xs(t,this);break;case"funnel":e=new As(t,this);break;case"radar":e=new Os(t,this);break;default:ibiz.log.error("图表暂未支持序列类型".concat(t.seriesType))}e&&this.seriesGenerators.push(e)}))}calcTitleOption(t){const{showTitle:e,title:i,subTitle:n,titlePos:r}=t,s={show:e,text:i,subtext:n,left:"center"},a=null==r?void 0:r.toLowerCase();return"left"===a||"right"===a?s.left=a:"bottom"!==a&&"top"!==a||(s.top=a),s}calcLegendOption(t){var e;const{showLegend:i,legendPos:n}=t,r={};r.show=i,1===(null==(e=this.model.dechartSerieses)?void 0:e.length)&&(r.show=!1);const s=null==n?void 0:n.toLowerCase();return"left"===s||"right"===s?(r.left=s,r.top="middle",r.orient="vertical"):"bottom"===s&&(r.top=s),r}calcXYAxisOption(t){const e=[];return t.forEach((t=>{const{position:i,dataShowMode:n,userParam:r}=t;let s={type:t.echartsType,name:t.caption,max:t.maxValue,min:t.minValue,position:i,axisLabel:{formatter:t=>1===n?t.length>4?"".concat(t.slice(0,4).split("").join("\n"),"\n..."):t.split("").join("\n"):2===n&&t.length>4?"".concat(t.slice(0,4),"..."):t,rotate:3===n?45:0}};r&&(s=ot(s,Ls(r))),e.push(s)})),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 i;if(this.codeListMap.clear(),!(null==(i=this.model.dechartSerieses)?void 0:i.length))return;const n=ibiz.hub.getApp(t.srfappid),r=async i=>{if(!i||this.codeListMap.has(i))return;const r=await n.codeList.get(i,t,e);this.codeListMap.set(i,r)};await Promise.all(this.model.dechartSerieses.map((async t=>{const{seriesCodeListId:e,catalogCodeListId:i}=t;await r(e),await r(i)})))}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((i=>{const n=i.calcByData(t);n instanceof Array?e.push(...n):e.push(n)})),this.options.series=e,this.options=ot(this.staticOptions,this.options),this.chartUserParam&&(this.options=ot(this.options,this.chartUserParam)),this.options}getSrfkeyByParams(t){const i=this.seriesGenerators[t.seriesIndex];if(!i)throw new e("找不到".concat(t.seriesIndex,"序列的generator!"));return i.getSrfkeyByParams(t)}},Ms=t("ChartService",class extends xr{}),ks=(t("ChartController",class extends bs{initState(){super.initState(),this.state.size=1e3}async onCreated(){await super.onCreated(),this.service=new Ms(this.model),await this.service.init(this.context),this.generator=new Rs(this.model),await this.generator.init(this.context,this.params),window.addEventListener("resize",this.resizeChart)}async afterLoad(t,e){const i=await super.afterLoad(t,e);return e.forEach((t=>{Object.assign(t,{srfcount:1})})),this.calcOptions(),i}initChart(t){this.chart=t,this.chart.on("click",(t=>{const e=this.generator.getSrfkeyByParams(t),i=this.state.items.find((t=>t.srfkey===e));console.log("实体数据",i)}))}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 vs{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)}}),Ns=class{};function Vs(t,e){const{srcDEUILogicParamId:i,srcFieldName:r,srcValue:s}=e,a=e.srcValueType||"SRCDLPARAM",o=r;let c;switch(a){case"SRCDLPARAM":c=t.params[i];break;case"NULLVALUE":return null;case"NONEVALUE":return;case"SRCVALUE":return ibiz.util.rawValue.format(s);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=it(ibiz.env);break;default:throw new n(e,"暂未支持源值类型".concat(a))}if(c&&o)try{c=bi.execScriptFn({srcValue:c},"srcValue.".concat(o),{singleRowReturn:!0,isAsync:!1})}catch(t){throw ibiz.log.error("从源参数取属性".concat(o,"报错,源参数:"),c),t}return c}var Fs=class extends Ns{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,r){const s=Vs(t,{srcDEUILogicParamId:this.dstParam,srcFieldName:this.dstField});switch(this.type){case"ENTITYFIELD":{if(!this.value)throw new i(this.model,"当前条件值类型为[数据对象属性],缺少配置条件值");const t=null!=r[this.value]?r[this.value]:e[this.value];return pi(s,this.op,t)}case"SRCENTITYFIELD":{if(!this.value)throw new i(this.model,"当前条件值类型为[源数据对象属性],缺少配置条件值");const e=Vs(t,{srcDEUILogicParamId:this.srcParam,srcFieldName:this.value});return pi(s,this.op,e)}case"CURTIME":throw new n(this.model,"暂未支持条件值类型为[当前时间]");default:return pi(s,this.op,this.value)}}},js=class t extends Ns{constructor(e){super(),this.model=e;const i=e.deuilogicLinkConds||[];this.conds=i.map((e=>"SINGLE"===e.logicType?new Fs(e):new t(e)))}get op(){return this.model.groupOP}get notMode(){return!0===this.model.notMode}test(t,e,n){let r=!0;if(0===this.conds.length)throw new i(this.model,"界面连接条件逻辑组未配置逻辑项");for(let i=0;i<this.conds.length;i++){const s=this.conds[i].test(t,e,n);if("AND"===this.op&&!1===s){r=!1;break}if("OR"===this.op&&!0===s){r=!0;break}}return this.notMode?!r:r}},Bs=class{constructor(t){this.model=t,this.srcNode=null,this.dstNode=null,this.groupCond=null;const{linkMode:e,deuilogicLinkGroupCond:i}=this.model;0===(e||0)&&i&&(this.groupCond=new js(i))}async exec(t){const{linkMode:e}=this.model,{context:i,data:r}=t;switch(e||0){case 0:return!this.groupCond||this.groupCond.test(t,i,r&&r.length>0?r[0]:{});case 1:return!0;case 2:throw new n(this.model,"未支持的逻辑连接类型: 异步结束");case 3:throw new n(this.model,"未支持的逻辑连接类型: 异步拒绝");case 9:throw new n(this.model,"未支持的逻辑连接类型: 异常处理");default:throw new n(this.model,"未支持的逻辑连接类型:".concat(e))}}},Us=class{constructor(t){this.model=t,this.links=(t.deuilogicLinks||[]).map((t=>new Bs(t)))}},Ws=class extends Us{async exec(t){const{dstAppDataEntityId:e,dstAppDEActionId:n,dstDEUILogicParamId:r,retDEUILogicParamId:s}=this.model;if(!e)throw new i(this.model,"未指定应用实体");if(!n)throw new i(this.model,"未指定实体行为");const a=t.params[r],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(e,n,t.context,a,t.viewParam);c.ok&&(t.params[s]=c.data)}},zs=class extends Us{async exec(t){const{dstAppDEUIActionId:e,dstDEUILogicParamId:n}=this.model,{data:r,parameters:s}=t;if(!e)throw new i(this.model,"未配置界面行为");let a=[r];if(n){const e=t.params[n];a=e instanceof Array?e:[e]}await ha.execAndResolved(e,{...s,context:t.context,params:t.viewParam,data:a})}},Gs=class extends Us{async exec(t){}},Hs=class extends Us{async exec(t){t.isEndNode=!0;const{returnType:e,rawValue:i,returnParamId:r}=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(i);break;case"LOGICPARAM":t.result=t.params[r];break;default:throw new n(this.model,"暂未支持的结束节点返回值类型: ".concat(e))}}},qs=class extends Us{async exec(t){const e=this.model.deuilogicNodeParams;if(null==e?void 0:e.length)for(const i of e)switch(i.paramAction){case"SETPARAMVALUE":await this.setParamValue(i,t);break;case"RESETPARAM":await this.resetParam(i,t);break;case"COPYPARAM":await this.copyParam(i,t);break;case"BINDPARAM":await this.bindParam(i,t);break;case"RENEWPARAM":await this.renewParam(i,t);break;case"APPENDPARAM":await this.appendParam(i,t);break;case"SORTPARAM":await this.sortParam(i,t);break;default:throw new n(i,"暂未支持逻辑处理参数操作".concat(i.paramAction))}}setParamValue(t,i){const{dstFieldName:n,dstDEUILogicParamId:r}=t;if(!r)throw new e("没有目标参数对象id");let s=n;i.isEntityParam(r)&&(s=null==s?void 0:s.toLowerCase());const a=Vs(i,t);if(s)try{bi.execScriptFn({srcVal:a,dstParam:i.params[r]},"dstParam.".concat(n," = srcVal"),{singleRowReturn:!1,isAsync:!1})}catch(t){throw ibiz.log.error("给目标参数属性".concat(n,"赋值报错,目标参数:"),i.params[r]),t}else i.params[r]=a}copyParam(t,e){const{dstDEUILogicParamId:i}=t,n=Vs(e,t);e.params[i]=it(n)}bindParam(t,e){const i=Vs(e,t);e.params[t.dstDEUILogicParamId]=i}resetParam(t,e){const{dstDEUILogicParamId:i}=t;e.resetParam(i)}renewParam(t,e){const{dstDEUILogicParamId:i}=t;e.renewParam(i)}appendParam(t,e){const{dstDEUILogicParamId:i,dstIndex:n,srcIndex:r,srcSize:s}=t,a=Vs(e,t),o=n||0,c=r||0,l=s||a.length;e.params[i].splice(o,0,...a.slice(c,l))}sortParam(t,e){const{dstDEUILogicParamId:i,dstFieldName:n,dstSortDir:r}=t,s=n;e.params[i].sort(((t,e)=>"ASC"===r?t[s]-e[s]:e[s]-t[s]))}},Ks=class extends Us{async exec(t){t.isEndNode=!0;const{invokeMethod:n,invokeCtrlId:r,invokeParamId:s}=this.model;if(!r)throw new i(this.model,"没有配置界面对象");if(!s)throw new i(this.model,"没有配置操作参数");if(!n)throw new i(this.model,"没有配置调用方法");const a=t.params[s];if(!a)throw new e("没有找到操作参数".concat(s));const o=t.params[r];if(!o)throw new e("没有找到界面对象".concat(r));if(!o[n]||!j(o[n]))throw new e("没有找到调用方法".concat(n));await o[n](a)}},Xs=class extends Us{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:n}=this.model;if(!e||!n)throw new i(this.model,"缺少目标参数对象或者源参数对象配置");const r=Vs(t,this.model);t.params[e]=r}},Ys=class extends Us{constructor(){super(...arguments),this.typeMap={INFO:"info",QUESTION:"success",WARNING:"warning",ERROR:"error"}}async exec(t){const{msgBoxType:e,buttonsType:r,msgBoxParamId:s}=this.model;if(!e)throw new i(this.model,"缺少消息类型的配置");if(!r)throw new i(this.model,"缺少按钮类型的配置");let{title:a}=this.model,{message:o}=this.model;if(s){const e=t.params[s];e.title&&(a=e.title),e.message&&(o=e.message)}const c={type:this.typeMap[e],title:a||"消息",desc:o};let l=[];switch(r){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 n(this.model,"".concat(r,"暂未支持"))}const h=await ibiz.modal.confirm(c);t.setLastReturn(l[h?0:1])}},$s=class extends Us{async exec(t){const{dstDEUILogicParamId:e,name:n}=this.model;if(!e)throw new i(this.model,"缺少目标参数对象配置");const r=t.params[e];console.log("逻辑节点".concat(n,"操作参数值:"),r)}},Qs=class extends Us{async exec(t){const{dstDEUILogicParamId:e}=this.model;if(!e)throw new i(this.model,"缺少目标参数对象配置");t.resetParam(e)}},Js=class extends Us{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:n}=this.model;if(!e||!n)throw new i(this.model,"缺少目标参数对象或者源参数对象配置");const r=Vs(t,this.model);t.params[e]=it(r)}},Zs=class extends Us{async exec(t){const{dstDEUILogicParamId:e,srcDEUILogicParamId:n,dstIndex:r,srcIndex:s,srcSize:a}=this.model;if(!e||!n)throw new i(this.model,"缺少目标参数对象或者源参数对象配置");const o=Vs(t,this.model),c=r||0,l=s||0,h=a||o.length;t.params[e].splice(c,0,...o.slice(l,h))}},ta=class extends Us{async exec(t){const{dstDEUILogicParamId:e,dstSortDir:n,dstFieldName:r}=this.model;if(!e||!r)throw new i(this.model,"缺少目标参数对象或目标属性配置");const s=r;t.params[e].sort(((t,e)=>"ASC"===n?t[s]-e[s]:e[s]-t[s]))}},ea=class extends Us{async exec(t){const{dstDEUILogicParamId:e}=this.model;if(!e)throw new i(this.model,"缺少目标参数对象配置");t.renewParam(e)}},ia=class extends Us{async exec(t){const{dstAppDEDataSetId:e,dstAppDataEntityId:n,dstDEUILogicParamId:r,retDEUILogicParamId:s}=this.model;if(!r)throw new i(this.model,"缺少配置过滤参数");const a=t.params[r],o=ibiz.hub.getApp(t.context.srfappid),c=await o.deService.exec(n,e,t.context,a);c.ok&&(t.params[s]=c.data)}},na=class extends Us{async exec(t){const{errorInfo:i}=this.model;throw new e(i)}},ra=class extends Us{async exec(t){t.isEndNode=!0;const{eventName:n,eventParamId:r,fireCtrlId:s}=this.model;if(!s)throw new i(this.model,"没有配置触发对象");if(!n)throw new i(this.model,"没有配置事件名称参数");if(!r)throw new i(this.model,"没有配置事件参数");const a=t.params[s];if(!a)throw new e("没有找到触发对象".concat(s));const o=t.params[r];if(!o)throw new e("没有找到事件参数对象".concat(r));await a.evt.emit(n,o)}},sa=class extends Us{async exec(t){const{dstAppDELogicId:n,dstAppDataEntityId:r,dstDEUILogicParamId:s,retDEUILogicParamId:a}=this.model;if(!r)throw new i(this.model,"没有配置实体");if(!n)throw new i(this.model,"没有配置实体逻辑");if(!s)throw new i(this.model,"没有配置传入逻辑参数");const o=t.params[s];if(!o)throw new e("没有找到传入参数".concat(s));const c=await wr(n,r,t.context,o,t.params);a&&(t.params[a]=c)}},aa=class{constructor(t){this.model=t}calc(t){const e=this.model.id,i=this.model,{parameters:r}=t,{context:s,params:a,data:o}=r,c=ibiz.hub.getApp(s.srfappid);if("layoutPanel"!==i.codeName)if(i.default)i.entityListParam?t.params[e]=o||[]:t.params[e]=o&&o.length>0?o[0]:{};else if(i.activeContainerParam)t.params[e]=r.ctrl||r.view;else if(i.activeCtrlParam)t.params[e]=r.ctrl;else if(i.ctrlParam){const n=r.view.getController(i.codeName.toLowerCase());n?t.params[e]=n:ibiz.log.error("视图逻辑初始化参数,未找到".concat(i.codeName,"指定部件对象"))}else if(i.activeViewParam)t.params[e]=r.view;else if(i.appGlobalParam)t.params[e]=ibiz.env;else if(i.applicationParam)t.params[e]=c;else if(i.entityListParam)t.params[e]=[];else{if(i.entityPageParam)throw new n(i,"未支持的逻辑参数类型: 分页查询结果");if(i.entityParam)t.params[e]={};else if(i.lastReturnParam)t.initLastReturnParam(e);else if(i.navContextParam)t.params[e]=s;else{if(i.navViewParamParam)throw new n(i,"未支持的逻辑参数类型: 视图路由参数");if(i.routeViewSessionParam)throw new n(i,"未支持的逻辑参数类型: 路由视图会话");if(i.simpleListParam)t.params[e]=[];else if(i.simpleParam)t.params[e]={};else if(i.viewNavDataParam)t.params[e]=a;else if(i.viewSessionParam)throw new n(i,"未支持的逻辑参数类型: 当前视图会话")}}else t.params[e]=r.view.layoutPanel.panelItems}renew(t){const e=this.model.id,i=this.model;if(i.entityListParam||i.simpleListParam||i.entityPageParam)t.params[e]=[];else{if(!i.simpleParam&&!i.entityParam)throw new n(i,"未支持的逻辑参数类型重新建立变量");t.params[e]={}}}},oa=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 i(t,"界面逻辑没有配置逻辑节点");t.deuilogicNodes.forEach((t=>{const{logicNodeType:e}=t;let i;switch(e){case"BEGIN":i=new Gs(t);break;case"END":i=new Hs(t);break;case"DEACTION":i=new Ws(t);break;case"DEUIACTION":i=new zs(t);break;case"PREPAREJSPARAM":i=new qs(t);break;case"RESETPARAM":i=new Qs(t);break;case"COPYPARAM":i=new Js(t);break;case"BINDPARAM":i=new Xs(t);break;case"VIEWCTRLINVOKE":i=new Ks(t);break;case"MSGBOX":i=new Ys(t);break;case"DEBUGPARAM":i=new $s(t);break;case"APPENDPARAM":i=new Zs(t);break;case"SORTPARAM":i=new ta(t);break;case"RENEWPARAM":i=new ea(t);break;case"DEDATASET":i=new ia(t);break;case"THROWEXCEPTION":i=new na(t);break;case"VIEWCTRLFIREEVENT":i=new ra(t);break;case"DELOGIC":i=new sa(t);break;default:throw new n(t,"未支持的逻辑节点类型: ".concat(e))}this.nodes.set(t.id,i)})),t.deuilogicParams.forEach((t=>{this.params.set(t.id,new aa(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 ks(this.params,t);this.initLogicParams(e);const{startDEUILogicNodeId:n}=this.model;if(!n||!this.nodes.has(n))throw new i(this.model,"未设置起始节点");{const t=this.nodes.get(n);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:i}=t;for(let n=0;n<i.length;n++){const r=i[n];if(await r.exec(e)&&r.dstNode&&(await this.deepExec(r.dstNode,e),!1===t.model.parallelOutput))break}}},ca=new Map;async function la(t,i,n){const r=ibiz.hub.getApp(n.context.srfappid),s=await r.getDEUILogic(t,i);if(!s)throw new e("找不到实体".concat(i,"的界面逻辑").concat(t));ca.has(s)||ca.set(s,new oa(s));const a=ca.get(s);return await a.exec(n),null}var ha=t("UIActionUtil",class{static async exec(t,i){const n=await ii(t);if(!n)throw new e("没找到".concat(t,"的界面行为模型"));if("SINGLEDATA"===n.actionTarget){if(!1===await i.view.call("Validate"))return{cancel:!0}}return(await mn(n)).exec(n,i)}static async execAndResolved(t,e){var i,n;const r=await this.exec(t,e);if(r.closeView)e.view.modal.ignoreDismissCheck=!0,e.view.closeView({ok:!0});else if(r.refresh)switch(r.refreshMode){case 1:e.view.callUIAction("Refresh");break;case 2:null==(i=e.view.parentView)||i.callUIAction("Refresh");break;case 3:null==(n=e.view.getTopView())||n.callUIAction("Refresh")}}}),ua=class{async exec(t,e){const{context:n,params:r,data:s}=e,a={refresh:t.reloadData,refreshMode:t.refreshMode,closeView:t.closeEditView},{appDEUILogicId:o,appDataEntityId:c,uilogicAttachMode:l}=t;if("REPLACE"===l){if(!o)throw new i(t,"没有配置实体界面逻辑");return await la(o,c,e),a}if(!await this.isConfirm(t,e))return this.returnError(a);const h=await this.execAction(t,e);if(Object.assign(a,h),!0===a.cancel)return this.returnError(a);const u=await this.doNextAction(t,{...e,context:a.nextContext||n,data:a.data||s,params:a.nextParams||r});if(u&&(Object.assign(a,u),!0===u.cancel))return this.returnError(a);if("AFTER"===t.uilogicAttachMode){if(!o)throw new i(t,"没有配置实体界面逻辑");await la(o,c,e)}return a}returnError(t){return Object.assign(t,{refresh:!1,closeView:!1})}async isConfirm(t,e){const i=this.calcMessage("confirm",t,e);return!t.enableConfirm||!i||ibiz.confirm.warning({title:"操作确认",desc:i})}async doNextAction(t,e){const i=t.nextId;if(i)return ha.exec(i,e)}async handleParams(t,e,i,n){let r=[];const s=$e(t.appDataEntityId);switch(t.actionTarget){case"NONE":r=[];break;case"SINGLEDATA":r=[i[0]];break;case"MULTIDATA":r=i;break;case"MULTIKEY":r=s&&i.length>0?i.map((t=>({[s]:t.srfkey||t[s]}))):[{}];break;case"SINGLEKEY":{const t=i[0]||{};r=s?[{[s]:t.srfkey||t[s]}]:[{}]}}const a=e.clone(),o=[...t.navigateContexts||[]];if(s&&"NONE"!==t.actionTarget){const{valueItem:e,paramItem:i}=t,n=i||s,r=e||"srfkey";o.unshift({key:n,value:r,rawValue:!1})}const c=["MULTIKEY","MULTIDATA"].includes(t.actionTarget)&&i.length>0,l=je(o,c?We(o,i):i[0]||{},n,e);Object.assign(a,l);const h=t.navigateParams;return{resultContext:a,resultData:r,resultParams:je(h,c?We(h,i):i[0]||{},n,a)}}calcMessage(t,e,i){let n,r;const{confirmMsg:s,cmlanguageRes:a,successMsg:o,smlanguageRes:c}=e;switch(t){case"confirm":n=s,r=a;break;case"success":n=o,r=c}if(r){const t=ibiz.i18n.t(r.lanResTag,r.defaultContent||n);t!==r.lanResTag&&(n=t)}if(n){const{data:t}=i,e={...i};return 1===t.length?[e.data]=t:0===t.length&&delete e.data,bi.execScriptFn(e,"`".concat(n,"`"),{isAsync:!1,singleRowReturn:!0})}}},da=t("BackendUIActionProvider",class extends ua{async execAction(t,e){const{context:n,params:r,data:s,event:a}=e,o={},c=t.appDataEntityId,l=t.appDEMethodId;if(!c||!l)throw new i(t,"未配置实体或实体行为");const{resultContext:h,resultParams:u,resultData:d}=await this.handleParams(t,n,s,r),p={...u},f=t.frontAppViewId;if(f){const t=await ibiz.commands.execute(Ur.TAG,f,h,u,{event:a});if(!(null==t?void 0:t.ok))return o.cancel=!0,o;(null==t?void 0:t.ok)&&t.data&&(0===d.length&&d.push({}),d.forEach((e=>{e.srfactionparam=t.data})))}const m=ibiz.hub.getApp(null==n?void 0:n.srfappid),g=d.map((t=>{var e;return(null==(e=t.getOrigin)?void 0:e.call(t))||t||{}})).map((t=>Object.assign(t,p))),y=["MULTIKEY","MULTIDATA"].includes(t.actionTarget),w=await m.deService.exec(c,l,h,y?g:g[0],p);if(w.ok){const i=this.calcMessage("success",t,e);i&&ibiz.message.success(i)}return Object.assign(o,{data:H(w.data)?w.data:[w.data],nextContext:h,nextParams:p}),o}}),pa=t("SysUIActionProvider",class extends ua{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:i}=e,n=this.predefinedActionMap.get(t.predefinedType)||t.uiactionTag;if("Exit"===n)return{closeView:!0};return await i.callUIAction(n,e)||{}}}),fa=t("FrontUIActionProvider",class extends ua{async execAction(t,e){const{context:r,params:s,data:a,event:o,noWaitRoute:c}=e;let l={};switch(t.frontProcessType){case"OPENHTMLPAGE":{const e=m.fill(t.htmlPageUrl,r,null==a?void 0:a[0]);window.open(e,"_blank");break}case"TOP":case"WIZARD":{const e=t.frontAppViewId;if(!e)throw new i(t,"未配置打开视图");const{resultContext:n,resultParams:h}=await this.handleParams(t,r,a,s),u=await ibiz.commands.execute(Ur.TAG,e,n,h,{event:o,noWaitRoute:c});(null==u?void 0:u.ok)||(l.cancel=!0),(null==u?void 0:u.ok)&&u.data&&(l.data=u.data,l.nextContext=n,l.nextParams={...s,...h});break}case"OTHER":l=this.doOther(t,e);break;default:throw new n(t,"未支持的前台处理模式[".concat(t.frontProcessType,"]"))}return l}doOther(t,e){const{scriptCode:n}=t,{context:r,params:s,data:a,event:o}=e;if(n){return bi.execScriptFn({context:r,params:s,data:a,el:null==o?void 0:o.target},n)||{}}throw new i(t,"自定义类型缺少配置脚本代码")}}),ma=t("WFWithdrawUIActionProvider",class extends ua{async execAction(t,e){const{view:i}=e;let n=!1;return await ibiz.modal.confirm({title:"提示",desc:"是否确认执行撤回操作?"})&&i&&(await i.call("WFWithdraw",e),n=!0),{refresh:!1,closeView:n}}});function ga(){const t=new fa;pn("FRONT",(()=>t));const e=new da;pn("BACKEND",(()=>e));const i=new pa;pn("SYS",(()=>i));const n=new ma;pn("DEUIACTION_WFWithdraw",(()=>n))}var ya=t("ToolbarController",class extends vs{get _evt(){return this.evt}initState(){super.initState(),this.state.buttonsState=new ss,this.state.viewMode="EMBED",this.state.extraButtons={}}async doUIAction(t,i,n={}){if("DEUIACTION"===t.itemType){const r=t.uiactionId,s=await ii(r);if(!s)throw new e("没有找到界面行为模型".concat(r));const a=["SYS","BACKEND","WFBACKEND"].includes(s.uiactionMode)&&!1!==s.showBusyIndicator;a&&this.state.buttonsState.setLoading(t.id);try{const t=await this.ctx.view.call("GetData")||[],e=this.getEventArgs();e.params=Object.assign(n,e.params),await ha.execAndResolved(r,{...e,data:t,event:i})}finally{a&&this.state.buttonsState.setLoading("")}}}async onCreated(){await super.onCreated(),this.state.viewMode=this.ctx.view.modal.mode,g(this.model,(t=>{if("DEUIACTION"===t.itemType){const e=t,i=new rs(e.id,this.context.srfappid,e.uiactionId);this.state.buttonsState.addState(e.id,i)}}),{childrenFields:["detoolbarItems"]}),await this.calcButtonState()}async onItemClick(t,e,i){const n="extra"===t.buttonType;await this._evt.emit("onClick",{event:e,eventArg:t.id,buttonType:n?"extra":"deuiaction"}),n||await this.doUIAction(t,e,i)}async calcButtonState(t,e){let i=t;if(t&&t instanceof Sr&&(i=t.getOrigin()),await this.state.buttonsState.update(i,e),this.scheduler){const t={};i&&(t.data=[i]),g(this.model,(e=>{const i=this.state.buttonsState[e.id];if(i.visible){const n=this.scheduler.triggerItemVisible(e.id,t);void 0!==n&&(i.visible=n)}if(!i.disabled){const n=this.scheduler.triggerItemEnable(e.id,t);void 0!==n&&(i.disabled=!n)}}),{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];g(this.model,(t=>{t.controlLogics&&e.push(...t.controlLogics)}),{childrenFields:["detoolbarItems"]}),super.initControlScheduler(e)}}),wa=t("ContextMenuController",class extends ya{}),va=(t("DashboardController",class extends vs{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=ls(t.data);e&&this.dataChangeNotify(e)}))}async initPortlets(t,e){(null==t?void 0:t.length)&&await Promise.all(t.map((async t=>{var i;const n=await bn(t);if(n){this.providers[t.id]=n;const r=await n.createController(t,this,e);this.portlets[t.id]=r,(null==(i=t.controls)?void 0:i.length)&&await this.initPortlets(t.controls,r)}})))}async dataChangeNotify(t){await Bi(Object.values(this.portlets).map((async e=>e.dataChangeNotify(t))))}}),t("CustomDashboardController",class{constructor(t){var e,i;this.customModelData=[],this.layoutColNum=12,this.layoutRowH=80,this.model=null,this.model=t,this.config=new Fn(t.appId,"dynadashboard","dashboard_".concat((null==(e=this.model.appDataEntityId)?void 0:e.toLowerCase())||"app","_").concat(null==(i=this.model.codeName)?void 0:i.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}})),ba=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,i){this.model=t,this.dashboard=e,this.parent=i,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}=qe(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 va}onDataChange(t){let e=t.data[0];e&&e instanceof Sr&&(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 i=new ss;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const n=new rs(t.id,this.dashboard.context.srfappid,e);i.addState(t.id,n)}})),await i.update(),this.state.actionGroupState=i;const{appDataEntityId:n}=this.dashboard.view.model;n&&this.dashboard.view.evt.on("onDataChange",this.onDataChange)}async onActionClick(t,e,i=[]){const n=t.uiactionId;await ha.execAndResolved(n,{context:this.dashboard.context,params:this.dashboard.params,data:i,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=Ke(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)}}),Ea=(t("ContainerPortletController",class extends ba{}),t("ViewPortletController",class extends ba{}),t("MenuPortletController",class extends ba{}),t("DataViewControlService",class extends xr{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.dedataViewDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),i=t.appDEFieldId;let n;if(i){const r=i.toLowerCase();n=new Nr(e,r,{isOriginField:!0,dataType:t.dataType})}else n=new Nr(e,e);this.dataUIMap.set(e,n)}))}})),_a=t("DataViewControlController",class extends bs{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 Ea(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 i=new ss;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const n=new rs(t.id,this.context.srfappid,e);i.addState(t.id,n)}})),await i.update(),t.groupActionGroupState=i}))}async onRowClick(t){var e;super.onRowClick(t);const{groupAppDEFieldId:i}=this.model;if(i)if(this.state.groups.forEach((t=>{t.selectedData=[]})),this.state.selectedData.forEach((t=>{const e=t[i],n=this.state.groups.find((t=>t.key===e));n&&n.selectedData.push(t)})),this.state.singleSelect)this.state.groups.forEach((e=>{var i,n;let r=t;-1!==e.selectedData.indexOf(r)?(r&&r instanceof Sr&&(r=r.getOrigin()),r&&(null==(i=e.groupActionGroupState)||i.update(r,this.model.appDataEntityId))):null==(n=e.groupActionGroupState)||n.update(void 0,this.model.appDataEntityId)}));else{const i=this.state.groups.find((e=>-1!==e.children.indexOf(t)));i&&(null==(e=i.groupActionGroupState)||e.update(i.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 i=0;i<e.length;i++)"ACTIONITEM"===e[i].itemType&&(t=e[i]);return t}getOptItemAction(t){var e;const n=new ss,r=this.getOptItemModel();if(r){if(!r.deuiactionGroup)throw new i(this.model,"操作项没有配置界面行为组");if(!(null==(e=r.deuiactionGroup.uiactionGroupDetails)?void 0:e.length))return ibiz.log.debug("操作项界面行为组没有配置界面行为"),n;r.deuiactionGroup.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const i=new rs(t.id,this.context.srfappid,e);n.addState(t.id,i)}})),n.update(t.getOrigin())}return n}async onActionClick(t,e,i){const n=t.uiactionId;await ha.execAndResolved(n,{context:this.context,params:this.params,data:[e],view:this.view,event:i})}async handleDataGroup(){const{enableGroup:t,groupMode:e,groupAppDEFieldId:n}=this.model;if(t&&e){if(!n)throw new i(this.model,"分组属性没有配置");"AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup()}}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,i=new Map;e.forEach((e=>{const n=e[t];Z(n)||(i.has(n)||i.set(n,[]),i.get(n).push(e))}));const n=[];i.forEach(((t,e)=>{n.push({caption:e,key:e,children:[...t]})})),this.state.groups=n}}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 i(this.model,"分组代码表没有配置");const{items:n}=this.state,r=new Map;this.groupCodeListItems.forEach((t=>{r.set(t.value,[])})),n.forEach((e=>{const i=e[t],n=r.get(i);n&&n.push(e)}));const s=[];r.forEach(((t,e)=>{const i=this.groupCodeListItems.find((t=>t.value===e));s.push({caption:i.text,key:i.value,children:t})})),this.state.groups=s}setSort(t,e){if(t&&e)super.setSort(t,e);else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const i=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(i.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}onClickNew(t,e){const i={...this.params,srfgroup:e};ha.execAndResolved("new",{context:this.context,params:i,data:[],view:this.view,event:t})}async onGroupToolbarClick(t,e,i){const n=t.uiactionId,r={...this.params,srfgroup:i.key};await ha.execAndResolved(n,{context:this.context,params:r,data:i.selectedData||[],view:this.view,event:e})}}),Ia=t("ExpBarControlController",class extends vs{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 i(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 i=null==(t=e.appDEFields)?void 0:t.filter((t=>t.enableQuickSearch)),n=[];null==i||i.forEach((t=>{(null==t?void 0:t.lnlanguageRes)&&t.lnlanguageRes.lanResTag?n.push(ibiz.i18n.t(t.lnlanguageRes.lanResTag,t.logicName)):(null==t?void 0:t.logicName)&&n.push(t.logicName)})),n.length>0&&(this.state.placeHolder=n.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:i,params:n}=t,r=this.getNavViewMsg(e[0],i,n);this._evt.emit("onNavViewChange",{navViewMsg:r})}prepareParams(t,e,i,n){const{navDER:r,navFilter:s,navigateContexts:a,navigateParams:o,appDataEntityId:c}=t,l={deName:c?$e(c):void 0,navFilter:s,pickupDEFName:null==r?void 0:r.pickupDEFName,navContexts:a,navParams:o},h={context:i,params:n,data:e},{resultContext:u,resultParams:d}=ze(l,h),p=Object.assign(i.clone(),u,{currentSrfNav:e[this.navKeyName]});this.state.srfnav=e[this.navKeyName];return{context:p,params:{...d}}}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,i){const n=this.calcViewModelId(),r=this.prepareParams(this.XDataModel,t,e,i);return{key:t[this.navKeyName],context:r.context,params:r.params,viewId:n,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())}}),Ca=(t("CalendarExpBarController",class extends Ia{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 i(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 i=new Date(e.beginTime);this.xDataController.setSelectDate(i)}getNavViewMsg(t){const e=this.getCalendarItemModel(t.itemType);if(e){const{context:i,params:n}=this.prepareParams(e,t.deData?t.deData:t,this.context,this.params);return i.currentSrfNav=t.navId,this.state.srfnav=t.navId,{key:t.navId,context:i,params:n,viewId:e.navAppViewId}}return{key:t.navId,context:this.context,params:this.params}}}),t("TreeExpBarController",class extends Ia{constructor(){super(...arguments),this.navKeyName="id",this.navNodeModelIds=[]}get xDataController(){const t=this.view.getController(this.model.xdataControlName);if(!t)throw new i(this.model,"无法获取多数据部件[".concat(this.model.xdataControlName,"]控制器"));return t}getNodeModel(t){const{detreeNodes:e}=this.XDataModel;let i;return e&&e.forEach((e=>{e.id===t&&(i=e)})),i}xDataActive(t){const{nodeData:e}=t;super.xDataActive({...t,data:[e]})}getNavViewMsg(t,i,n){const r=t.id,s=t.deData||t,a=this.getNodeModel(t.nodeId);if(!a)throw new e("找不到".concat(t.nodeId,"的节点模型"));const o=this.prepareParams(a,s,i,n);return o.context.currentSrfNav=r,this.state.srfnav=r,{key:r,viewId:a.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,i)=>{0===i?t.push(e):t.push("".concat(t[i-1],":").concat(e))})),t.pop(),this.defaultExpandedKeys=t}}}),t("ChartExpBarController",class extends Ia{getNavViewMsg(t,e,i){var n;const r=null==(n=this.XDataModel.dechartSerieses)?void 0:n[0].navAppViewId,s=this.prepareParams(this.XDataModel,t,e,i);return{key:t[this.navKeyName],context:s.context,params:s.params,viewId:r,isCache:this.isCache}}}),t("FormController",class extends vs{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 Sr,this.state.isLoaded=!1,this.state.processing=!1,this.state.modified=!1}async dataChangeNotify(t){await Bi(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=y(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,i=void 0){await Promise.all(t.map((async t=>{const n=await sn(t);if(!n)return;e.providers[t.id]=n;const r=await n.createController(t,e,i);e.details[t.id]=r,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(r);const s=oi(t);s.length&&await this.initDetailControllers(s,e,r)})))}getData(){return[this.state.data]}async setDataValue(t,e){if(!Object.prototype.hasOwnProperty.call(this.state.data,t)||cs(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||{}})}})),Da=t("SearchFormService",class extends Ar{async getDraft(t,e={}){let i={ok:!0,status:200,data:this.getFilteredData({...e})};return i=this.handleResponse(i),i}initUIDataMap(){g(this.model,(t=>{if("FORMITEM"===t.detailType){const e=t.id.toLowerCase();this.dataUIMap.set(e,new Nr(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((i=>{void 0!==t[i.dataKey]&&(e[i.dataKey]=t[i.dataKey])})),e}}),Sa=(t("SearchFormController",class extends Ca{async onCreated(){await super.onCreated(),this.service=new Da(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 i;Object.assign(t,e),await this.evt.emit("onBeforeLoadDraft",{params:t});try{i=await this.service.getDraft(this.context,t)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}return this.state.data=i.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 i=this.state.data[e];null!=i&&""!==i&&(t[e]=i)})),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,i=!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 i},set:t=>(i=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)})}})),Aa=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,i){this.model=t,this.form=e,this.parent=i,this.state=this.createState()}async init(){await this.onInit()}async onInit(){this.state.showMoreMode=this.model.showMoreMode;const{layoutPos:t,sysCss:e,labelSysCss:i}=this.model;if(t){const{width:e,height:i}=qe(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(i)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==i?void 0:i.cssName)&&this.state.class.label.push(i.cssName)}createState(){var t;return new Sa(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 i;this.parent&&!this.parent.state.visible||null==(i=this.model.defdgroupLogics)||i.forEach((i=>{const n=i.relatedDetailNames||[];if(e||v(n,t))try{const t=Ii(this.form.data,i);switch(i.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=Ke(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=Ke(this.model.labelDynaClass,t);e.length&&(this.state.class.labelDyna=e)}}}),xa=t("FormButtonState",class extends Sa{constructor(){super(...arguments),this.loading=!1}}),Pa=(t("FormButtonController",class extends Aa{createState(){var t;return new xa(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 ha.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 Sa{constructor(){super(...arguments),this.showMask=!1}})),Ta=(t("FormDRUIPartController",class extends Aa{constructor(){super(...arguments),this.refreshItems=["srfkey"],this.paramItem="srfkey",this.isNewData=!1}createState(){var t;return new Pa(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),v(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;B(e)&&(t=Object.assign(t,je(e,this.form.data,this.form.params,this.form.context)));const i=je(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(i))this.navContext=t,this.navParams=i,this.force();else if(this.embedView){if(this.isNewData)return;this.embedView.callUIAction("Refresh")}}else this.state.viewComponentKey=G(),this.navContext=t,this.navParams=i}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 Sa{constructor(){super(...arguments),this.isShowMore=!1,this.actionGroupState=null}})),Oa=t("FormGroupPanelController",class extends Aa{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 Ta(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 i=new ss;e.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const n=new rs(t.id,this.form.context.srfappid,e);i.addState(t.id,n)}})),await i.update(),this.state.actionGroupState=i}async onActionClick(t,e){const i=t.uiactionId;await ha.execAndResolved(i,{context:this.form.context,params:this.form.params,data:[this.data],view:this.form.view,event:e})}}),La=t("FormItemState",class extends Sa{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)})}}),Ra=(t("FormItemController",class extends Aa{constructor(t,e,i){super(t,e,i),this.rules=[],this.context=e.context,this.params=e.params}createState(){var t;return new La(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 en(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this),await this.initRules()))}async initRules(){this.rules=[];const t=Vi(this.form.model.deformItemVRs||[],this.name);t&&this.rules.push(...hs(t,this.name,this.valueItemName)),this.model.editor&&this.rules.push(...us(this.model.editor)),this.rules.length>0&&(this.validator=new ft({[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 i=!1;e&&e.length>0&&e.forEach((e=>{t.includes(e)&&(i=!0)})),i&&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&&U(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:i,createDV:n,updateDVT:r,updateDV:s}=this.model,a=t?i:r,o=t?n:s,c=ps({name:this.name,valueType:a,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}})),Ma=t("FormMDCtrlControlController",class extends Ra{async onInit(){const{model:t}=this.parent,{contentControl:i}=t;if(!i)throw new e("表单多数据部件未配置嵌入部件");this.controlModel=i;const n=await Ji(this.controlModel);n&&(this.provider=n)}}),ka=t("FormMDCtrlDataViewController",class extends Ma{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(){}}),Na=t("EditFormService",class extends Ar{async get(t,e={}){var i;let n=await this.exec((null==(i=this.model.getControlAction)?void 0:i.appDEMethodId)||"get",t,void 0,e);return n=this.handleResponse(n),n}async getDraft(t,e={}){var i;let n=await this.exec((null==(i=this.model.getDraftControlAction)?void 0:i.appDEMethodId)||"getdraft",t,void 0,e);return n=this.handleResponse(n),n}async remove(t,e={}){var i;return await this.exec((null==(i=this.model.removeControlAction)?void 0:i.appDEMethodId)||"remove",t,void 0,e)}async create(t,e){var i;const n=e instanceof Sr?e.getOrigin():e,r=this.getFilteredData(n);let s=await this.exec((null==(i=this.model.createControlAction)?void 0:i.appDEMethodId)||"create",t,r);return s=this.handleResponse(s),s}async update(t,e){var i;const n=e instanceof Sr?e.getOrigin():e,r=this.getFilteredData(n);let s=await this.exec((null==(i=this.model.updateControlAction)?void 0:i.appDEMethodId)||"update",t,r);return s=this.handleResponse(s),s}async goBack(t,e){var n;const r=null==(n=this.model.goBackControlAction)?void 0:n.appDEMethodId;if(!r)throw new i(this.model,"缺少返回操作实体行为");let s=await this.exec(r,t,e instanceof Sr?e.getOrigin():e);return s=this.handleResponse(s),s}async updateFormItem(t,e,i={}){let n=await this.exec(t,e,i);return n=this.handleResponse(n),n}async wfStart(t,e,i){var n;const r=(null==(n=this.model.wfstartControlAction)?void 0:n.appDEMethodId)||"wfstart";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(r,t,e,i instanceof Sr?i.getOrigin():i)}async wfSubmit(t,e,i){var n;const r=this.model;let s="";s=e.type?e.type:(null==(n=r.wfsubmitControlAction)?void 0:n.appDEMethodId)||"wfsubmit";return(await this.app.deService.getService(this.model.appDataEntityId)).wf.exec(s,t,e,i instanceof Sr?i.getOrigin():i)}initUIDataMap(){super.initUIDataMap();const t=["srfwfmemo","srfwftransferor","srfactionparam","srffrontuf","srfnextform"];g(this.model,(e=>{if("FORMITEM"===e.detailType||"MDCTRL"===e.detailType){const i=e,n=i.fieldName||i.id.toLowerCase(),r=i.fieldName||e.appDEFieldId;let s;s=r?new Nr(n,r,{isOriginField:!0,dataType:i.dataType}):new Nr(n,n,{isOriginField:t.includes(n)}),this.dataUIMap.set(n,s)}}),{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((i=>{void 0!==t[i.dataKey]&&(e[i.dataKey]=t[i.dataKey])})),e}}),Va=t("EditFormController",class extends Ca{get view(){return this.ctx.view}async onCreated(){await super.onCreated(),this.service=new Na(this.model),await this.service.init(this.context),this.autoSave=A(this.autoSave.bind(this),500,{trailing:!0})}async onMounted(){await super.onMounted(),this.state.loadDefault&&this.load()}async loadDraft(t){const{context:e,params:i}=this.handlerAbilityParams(t),n=await this.getDraftParams();let r;Object.assign(i,n);try{await this.startLoading(),await this.evt.emit("onBeforeLoadDraft",{params:i}),r=await this.service.getDraft(e,i)}catch(t){throw await this.evt.emit("onLoadDraftError",void 0),this.actionNotification("GETDRAFTERROR",{error:t}),t}finally{await this.endLoading()}return this.state.data=r.data,w(this.data,n),this.formStateNotify("DRAFT"),await this.evt.emit("onLoadDraftSuccess",void 0),this.actionNotification("GETDRAFTSUCCESS"),this.state.isLoaded=!0,this.data}async copy(){const t=it(this.context),e=it(this.params),i=(await ibiz.hub.getAppDataEntity(this.model.appDataEntityId)).keyAppDEFieldId;if(i&&this.params[i]){t[$e(this.model.appDataEntityId)]=this.params[i],delete e[i],delete this.params[i],delete e.srfcopymode,delete this.params.srfcopymode}let n;try{await this.startLoading(),await this.evt.emit("onBeforeLoad",void 0),n=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 n.data.$origin.srfsourcekey=void 0,this.state.modified=!1,this.state.data=n.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(!Qe(this.context,this.model.appDataEntityId))return this.loadDraft();const{context:e,params:i}=this.handlerAbilityParams(t),n=it(i);let r;try{await this.startLoading(),await this.evt.emit("onBeforeLoad",void 0),r=await this.service.get(e,n)}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=r.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 b(500,this.save.bind(this))}if(!await this.validate())throw new e("请检查表单填写!");await this.startLoading(),await this.evt.emit("onBeforeSave",void 0);const{context:i,data:n}=this.handlerAbilityParams(t),r=n[0],s=0===r.srfuf;let a;try{a=s?await this.service.create(i,r):await this.service.update(i,r)}catch(t){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(s?"CREATE":"UPDATE","ERROR"),{error:t}),t}finally{await this.endLoading()}return a.data&&E(this.data,a.data),this.state.modified=!1,await this.evt.emit("onSaveSuccess",void 0),this.formStateNotify("SAVE"),this.actionNotification("".concat(s?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(this.data.srfmajortext||"","保存成功")}),"ROUTE"===this.view.modal.mode&&ibiz.mc.command.send(this.data.$origin,s?"OBJECTCREATED":"OBJECTUPDATED"),this.data}async remove(t){const{context:e,params:i}=this.handlerAbilityParams(t);let n,r=!1;if(await this.evt.emit("onBeforeRemove",void 0),1===this.data.srfuf){if(r=await ibiz.modal.confirm({title:"提示",desc:"确认删除吗?"}),!r)return!1;await this.startLoading();try{n=await this.service.remove(e,i)}catch(t){throw await this.evt.emit("onRemoveError",void 0),this.actionNotification("REMOVEERROR",{error:t}),t}finally{await this.endLoading()}r=n.ok}return this.state.data=new Sr,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"),r}async goBack(){let t;await this.startLoading();try{t=await this.service.goBack(this.context,this.data)}finally{await this.endLoading()}t.data&&E(this.data,t.data)}async updateFormItem(t){var i;const n=null==(i=this.model.deformItemUpdates)?void 0:i.find((e=>e.id===t));if(!n)throw new e("没找到".concat(t,"表单项更新"));const{appDEMethodId:r,defiupdateDetails:s,customCode:a,scriptCode:o}=n,c=null==s?void 0:s.map((t=>t.id));let l;if(a&&o)l=bi.execScriptFn({...this.getEventArgs(),data:this.data},o,{isAsync:!1});else{const t={...this.params,...this.data.getOrigin()},e=await this.service.updateFormItem(r,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:i,params:n}=this.handlerAbilityParams(t);try{await this.service.wfStart(i,n,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:i,params:n}=this.handlerAbilityParams(t);try{await this.service.wfSubmit(i,n,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)}}}),Fa=t("FormMDCtrlFormController",class extends Ma{constructor(){super(...arguments),this.controlControllerArray=[],this.state={data:[]}}onControlMounted(t,e){const i=t.ctrl;this.controlControllerArray[e]=i,i.load()}async onInit(){super.onInit(),this.service=new Na(this.model.contentControl),await this.service.init(this.parent.form.context)}async fetch(t,e={}){let i=await this.service.exec("fetchdefault",t,e);return i=this.handleResponse(i),i}handleResponse(t){const e=t;return e.ok&&(D(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 i=this.controlControllerArray[e];i&&(i.save(),this.state.data[e]&&E(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))}}),ja=t("FormMDCtrlGridController",class extends Ma{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:i}=t;if(!i)throw new e("表单多数据部件未配置嵌入部件");E(i,{enableRowEdit:!0,enableRowNew:!0}),this.controlModel=i;const n=await Ji(this.controlModel);n&&(this.provider=n)}async validate(){const{rows:t}=this.gridController.state;return-1===(await Promise.all(t.map((t=>this.gridController.validate(t))))).findIndex((t=>!t))}}),Ba=t("FormMDCtrlListController",class extends Ma{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(){}}),Ua=t("FormMDCtrlRepeaterFormController",class extends Ra{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)}}),Wa=t("FormMDCtrlRepeaterFormOneController",class extends Ua{get data(){return this.parent.state.contentCtrlData}onDataItemChange(t){this.parent.state.contentCtrlData=t,this.parent.setFormDataValue()}}),za=t("FormMDCtrlRepeaterGridController",class extends Ra{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:i}=t,n=await en(e);if(n){const r=await n.createController(e,{unitName:e.unitName,valueFormat:e.valueFormat,context:this.parent.form.context,params:this.parent.form.params,dataType:i});this.editorMap[t.codeName]={provider:n,controller:r}}this.columns.push({codeName:t.codeName,caption:t.caption})}const e=oi(t);e.length&&this.initColumns(e)}))}rowDataChange(t,e,i){const n=this.data[i];Object.prototype.hasOwnProperty.call(n,e)&&!cs(n[e],t)||(n[e]=t,this.onDataItemChange(n,i))}}),Ga=t("FormMDCtrlState",class extends Sa{constructor(){super(...arguments),this.contentCtrlData=[]}}),Ha=(t("FormMDCtrlController",class extends Aa{createState(){var t;return new Ga(null==(t=this.parent)?void 0:t.state)}async onInit(){switch(await super.onInit(),this.model.contentType){case"FORM":this.mdCtrlContentController=new Fa(this);break;case"GRID":this.mdCtrlContentController=new ja(this);break;case"LIST":this.mdCtrlContentController=new Ba(this);break;case"DATAVIEW":this.mdCtrlContentController=new ka(this);break;case"REPEATER":"DEFAULT"===this.model.detailStyle&&(this.mdCtrlContentController=new Ua(this)),"STYLE3"===this.model.detailStyle&&(this.mdCtrlContentController=new Wa(this)),"STYLE2"===this.model.detailStyle&&(this.mdCtrlContentController=new za(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 Va{constructor(t,e,i,n,r){super(t,e,i,n),this.state.data=r,this.state.isSimple=!0}async initDetailControllers(t=this.model.deformDetails,e=this,i=void 0){await Promise.all(t.map((async t=>{const n=await sn(t);if(!n)return;e.providers[t.id]=n;const r=await n.createController(t,e,i);e.details[t.id]=r,"FORMITEM"!==t.detailType&&"MDCTRL"!==t.detailType||e.formItems.push(r);const s=oi(t);s.length&&await this.initDetailControllers(s,e,r)})))}}),t("FormPageState",class extends Ta{})),qa=(t("FormPageController",class extends Oa{createState(){var t;return new Ha(null==(t=this.parent)?void 0:t.state)}}),t("FormRawItemState",class extends Sa{})),Ka=(t("FormRawItemController",class extends Aa{createState(){var t;return new qa(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPageState",class extends Sa{})),Xa=(t("FormTabPageController",class extends Aa{createState(){var t;return new Ka(null==(t=this.parent)?void 0:t.state)}}),t("FormTabPanelState",class extends Sa{})),Ya=(t("FormTabPanelController",class extends Aa{createState(){var t;return new Xa(null==(t=this.parent)?void 0:t.state)}}),t("GridColumnController",class{constructor(t,e){var i;this.isAdaptiveColumn=!1,this.isCustomCode=!1,this.model=t,this.grid=e,this.isAdaptiveColumn="STAR"===t.widthUnit,this.isAdaptiveColumn&&(this.grid.hasAdaptiveColumn=!0),(null==(i=this.deGridDataItem)?void 0:i.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 bi.execScriptFn({data:t.data},this.deGridDataItem.scriptCode,{singleRowReturn:!0,isAsync:!1})}})),$a=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}}))}}),Qa=t("GridService",class extends xr{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.degridDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),i=t.appDEFieldId;let n;if(i){const r=i.toLowerCase();n=new Nr(e,r,{isOriginField:!0,dataType:t.dataType})}else n=new Nr(e,e);this.dataUIMap.set(e,n)}))}async updateGridEditItem(t,e,i={}){const n=await this.app.deService.getService(this.model.appDataEntityId);let r=await n.exec(t,e,i);return r=this.handleResponse(r),r}}),Ja=t("GridController",class extends bs{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 Qa(this.model),await this.service.init(this.context),this.initColumnStates(),await this.initGridColumns(),this.dataChangeNotify=y(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:n}=this.model;if(this.groupFieldColumn=Object.values(this.fieldColumns).find((e=>e.model.appDEFieldId===t)),!this.groupFieldColumn)throw new i(this.model,"没有配置分组属性的属性列");const r=this.groupFieldColumn.model.id;if(!this.groupFieldColumn.model.appCodeListId)throw new i(this.groupFieldColumn.model,"分组属性的属性列".concat(r,"没有配置代码表"));const s=this.state.columnStates.findIndex((t=>t.key===this.groupFieldColumn.model.codeName));if(-1!==s&&0!==s){if(this.isMultistageHeader)throw new i(this.model,"请将分组属性列".concat(r,"配置为第一列"));const t=this.state.columnStates.splice(s,1);this.state.columnStates.unshift(...t)}if("CODELIST"===n){if(!e)throw new i(this.model,"代码表分组模式需要配置代码表");if(this.groupFieldColumn.model.appCodeListId!==e)throw new i(this.model,"分组代码表与属性列".concat(r,"的代码表不一致"))}}async afterLoad(t,e){return await super.afterLoad(t,e),await Bi(Object.values(this.fieldColumns).map((async t=>{await t.loadCodeList()})),!1),this.state.rows=e.map((t=>{const e=new $a(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:i}=this.model;if(e){const e=new Map,n="CODELIST"===i,r=this.groupFieldColumn.model.id;n&&this.groupCodeListItems.forEach((t=>{e.set(t.value,[])})),t.forEach((t=>{const i=t[r];n||e.has(i)||e.set(i,[]),e.has(i)&&e.get(i).push(t)})),this.state.groups=[],e.forEach(((t,e)=>{const i=this.groupCodeListItems.find((t=>t.value===e));this.state.groups.push({caption:(null==i?void 0:i.text)||"".concat(e),key:e,children:t})}))}}async loadRemoteAgg(){const{aggMode:t,aggAppDataEntityId:e,aggAppDEDataSetId:n}=this.model;if("ALL"!==t)return;if(!n||!e)throw new i(this.model,"缺少配置聚合实体或聚合数据集");const r=await this.getFetchParams(),s=ibiz.hub.getApp(this.context.srfappid),a=await s.deService.exec(e,n,this.context,void 0,r);a.data.length&&([this.state.remoteAggResult]=a.data)}calcAggResult(t){Object.values(this.fieldColumns).forEach((e=>{const i=e.calcFieldAgg(t);i&&(this.state.aggResult[e.model.id]=i)}))}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 i=e.children.findIndex((e=>e.srfkey===t.srfkey));-1!==i&&e.children.splice(i,1)}}))}async newRow(){const{enableRowEdit:t,enableRowNew:i}=this.model;if(!t||!i||"row"!==ibiz.config.grid.editShowMode)return void ibiz.log.error("不支持新建行");if(this.state.rows.find((t=>t.showRowEdit)))throw new e("请先完成当前行编辑中的行的操作");const n={...this.params},r=this.calcDefaultValue({},!0);let s;Object.assign(n,r);try{s=await this.service.getDraft(this.context,n)}catch(t){throw this.actionNotification("GETDRAFTERROR",{error:t}),t}const a=s.data;w(a,r),this.state.items.unshift(a);const o=new $a(a,this);this.state.rows.unshift(o),this.gridStateNotify(o,"DRAFT"),this.switchRowEdit(this.state.rows[0],!0),this.actionNotification("GETDRAFTSUCCESS",{data:a})}async save(t){if(this.state.isSimple)return;const i=this.state.rows.find((e=>e.data.srfkey===t.srfkey));if(!i)throw new e("行数据不存在");if(!i.modified)return void ibiz.log.debug("值没有发生改变");if(i.processing)return void await b(500,this.save.bind(this),[t]);if(!await this.validate(i))throw new e("行数据校验不通过,保存取消");let n;await this.startLoading();const r=0===t.srfuf,s=$e(this.model.appDataEntityId),a=this.context.clone();a[s]=t.srfkey;try{n=r?await this.service.create(a,t):await this.service.update(a,t)}catch(t){throw await this.evt.emit("onSaveError",void 0),this.actionNotification("".concat(r?"CREATE":"UPDATE","ERROR"),{error:t,data:i.data}),t}finally{await this.endLoading()}const o=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(o,1,n.data),i.data=n.data,i.modified=!1,this.actionNotification("".concat(r?"CREATE":"UPDATE","SUCCESS"),{default:"".concat(n.data.srfmajortext||"","保存成功"),data:n.data}),this.gridStateNotify(i,"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 Bi(t.map((t=>this.save(t))))}async initColumnsController(t){var e;const i=await cn(t);if(!i)return;this.providers[t.codeName]=i;const n=await i.createController(t,this);this.columns[t.codeName]=n,"DEFGRIDCOLUMN"===t.columnType?(this.fieldColumns[t.codeName]=n,t.enableRowEdit&&(this.editColumns[t.codeName]=n)):"UAGRIDCOLUMN"===t.columnType?this.uaColumns[t.codeName]=n:"GROUPGRIDCOLUMN"===t.columnType&&(this.isMultistageHeader=!0,await Promise.all((null==(e=t.degridColumns)?void 0:e.map((async t=>{await this.initColumnsController(t)})))||[]))}initColumnStates(){g(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:i,frozenLastColumn:n}=this.model;t.forEach(((t,r)=>{t.uaColumn?t.fixed=r+1<=Math.floor(e/2)?"left":"right":i&&r<i?t.fixed="left":n&&r>=e-n&&(t.fixed="right")}))}async initGridColumns(){this.model.degridColumns&&await Promise.all(this.model.degridColumns.map((async t=>this.initColumnsController(t))))}async setRowValue(t,e,i){if(!Object.prototype.hasOwnProperty.call(t.data,e)||cs(t.data[e],i)){t.data[e]=i,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 Bi(Object.values(this.editColumns).map((async i=>i.dataChangeNotify(t,e))))}gridStateNotify(t,e){Object.values(this.editColumns).forEach((i=>{i.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,i,n=!0){if(!this.allowRowEdit)return;const r=void 0===i?!t.showRowEdit:i;if(t.showRowEdit!==r){if(!1===r)if(n)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=it(t.data);const e=this.calcDefaultValue(t.data,!1);Object.assign(t.data,e)}}t.showRowEdit=r,Object.values(this.editColumns).forEach((e=>{t.editColStates[e.fieldName].editable=r})),this.evt.emit("onRowEditChange",{row:t})}}setSort(t,e){if(t&&e){const i=this.fieldIdNameMap.get(t).toLowerCase();super.setSort(i,e)}else{const{minorSortAppDEFieldId:t,minorSortDir:e}=this.model;if(t&&e){const i=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(i.toLowerCase(),",").concat(e.toLowerCase())}else this.state.sortQuery=""}}async updateGridEditItem(t,i){var n;const r=null==(n=this.model.degridEditItemUpdates)?void 0:n.find((t=>t.id===i));if(!r)throw new e("没找到".concat(i,"编辑列更新"));const{appDEMethodId:s,degeiupdateDetails:a,customCode:o,scriptCode:c}=r,l=a.map((t=>t.id));let h;if(o&&c)h=bi.execScriptFn({...this.getEventArgs(),data:t.data},c,{isAsync:!1});else{const e={...this.params,...t.data.getOrigin()},i=await this.service.updateGridEditItem(s,this.context,e);h=i.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),i=await this.getFetchParams(null==t?void 0:t.viewParam);let n;await this.startLoading();try{n=await this.service.fetch(e,i)}finally{await this.endLoading()}return n.data}async exportData(t){const i=this.fieldColumns,n=Object.keys(i).map((t=>i[t].model.id)),r=Object.keys(i).map((t=>i[t].model.caption)),s=(a=n,(await(async()=>{var n;const r=null==(n=t.params)?void 0:n.type;let s=[];if("activatedPage"===r&&(s=this.state.rows.map((t=>t.data))),"maxRowCount"===r||"customPage"===r){const{size:e}=this.state,{startPage:i,endPage:n}=t.params,a="customPage"===r?{page:0,offset:(i-1)*e,size:(n-i+1)*e}:{size:1e3,page:0};s=await this.loadData({viewParam:a})}if("selectedRows"===r&&(s=this.getData()),0===s.length)throw new e("无导出数据");return(t=>{const e=new Map;Object.keys(i).forEach((t=>{i[t].codeList&&e.set(t,i[t].codeListItems)}));const n=it(t.map((t=>t.getOrigin())));return n.forEach((t=>{Object.keys(t).forEach((i=>{var n;e.get(i)&&(t[i]=(null==(n=e.get(i).find((e=>e.value===t[i])))?void 0:n.text)||t[i])}))})),n})(s)})()).map((t=>a.map((e=>t[e])))));var a;if(!ibiz.util.getExportExcel)throw new e("ibiz.util.getExportExcel不存在");const o=await ibiz.util.getExportExcel();if(!o)throw new e("导出模块加载错误");o.exportJsonToExcel({header:r,data:s,filename:this.model.logicName,autoWidth:!0})}calcDefaultValue(t,e){const i={};return Object.values(this.editColumns).forEach((n=>{const{createDV:r,createDVT:s,updateDV:a,updateDVT:o}=n.editItem,c=e?s:o,l=e?r:a,h=ps({name:n.fieldName,valueType:c,defaultValue:l,valueFormat:n.valueFormat},{data:t,context:this.context,params:this.params});void 0!==h&&(i[n.fieldName]=h)})),i}}),Za=t("GridFieldColumnController",class extends Ya{constructor(){super(...arguments),this.codeList=void 0}get isLinkColumn(){return!!this.model.enableLinkView&&!!this.model.linkAppViewId}get hasAction(){return!!this.model.deuiactionId}async onInit(){await super.onInit(),this.loadCodeList=A(this.loadCodeList,300),this.loadCodeList()}clickable(t){const e=t.data[this.model.codeName];return(this.isLinkColumn||this.hasAction)&&e}handlePublicParams(t,e,i){const{userParam:n}=this.model;if(!n)return{context:e,params:i};const{navigateContexts:r,navigateParams:s}=He(n);let a={};r&&t&&(a=je(r,t,i,e));const o=Object.assign(e.clone(),a);let c={};s&&t&&(c=je(s,t,i,e));return{context:o,params:{...i,...c}}}async openLinkView(t,e){if(!t.data[this.model.codeName])return;const i=this.model.linkValueItem||"srfkey",r=t.data[i];if(null==r)throw new n(this.model,"未在行数据中取到 ".concat(i," 的值"));const{linkAppViewId:s}=this.model;if(!s)return;const a=Si(t.data),o=Object.assign(this.context.clone(),{srfkey:r,...a}),c=it(this.params),{context:l,params:h}=this.handlePublicParams(t.data,o,c),u=await ibiz.commands.execute(Ur.TAG,s,l,h,{event:e});(null==u?void 0:u.ok)&&this.grid.load()}async triggerAction(t,e){const i=this.model.deuiactionId;await ha.execAndResolved(i,{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 i=await e.codeList.get(t,this.context,this.params);return this.codeListItems=i,i}calcFieldAgg(t){const{aggField:e,aggMode:i,aggValueFormat:r,unitName:s}=this.model;if("NONE"===i)return;const a=e||this.model.id;let o;if(t=t.filter((t=>!Z(t[a]))),"PAGE"!==this.grid.model.aggMode)throw"ALL"===this.grid.model.aggMode?new n(this.model,"远程聚合暂未支持"):new n(this.grid.model,"暂未支持聚合模式".concat(this.grid.model.aggMode));switch(i){case"SUM":o=t.map((t=>t[a])).reduce(((t,e)=>t+e),0);break;case"AVG":o=t.map((t=>t[a])).reduce(((t,e)=>t+e),0)/t.length;break;case"MAX":o=Math.max(...t.map((t=>t[a])));break;case"MIN":o=Math.min(...t.map((t=>t[a])));break;default:throw new n(this.model,"暂未支持属性列聚合模式".concat(i))}let c="".concat(o);if(r)try{c=ibiz.util.text.format("".concat(o),r)}catch(t){ibiz.log.error("".concat(o," 值格式化错误"))}return c&&s&&(c+=s),c}formatValue(t=""){if("SIMPLE"!==this.model.valueType)return ds.toText(this.model,t);const e="".concat(t);if(!this.valueFormat)return e;return s.isDate(this.dataType)?ct(e).format(this.valueFormat):ibiz.util.text.format(e,this.valueFormat)}}),to=(t("GridUAColumnController",class extends Ya{initActionStates(t){var e;const{deuiactionGroup:n}=this.model;if(!n)throw new i(this.model,"操作列没有配置界面行为组");if(!(null==(e=n.uiactionGroupDetails)?void 0:e.length))return void ibiz.log.debug("操作列界面行为组没有配置界面行为");const r=new ss;n.uiactionGroupDetails.forEach((t=>{const e=t.uiactionId;if(e){const i=new rs(t.id,this.grid.context.srfappid,e);r.addState(t.id,i)}})),t.uaColStates[this.model.codeName]=r}async onActionClick(t,e,i){const n=t.uiactionId;await ha.execAndResolved(n,{context:this.context,params:this.params,data:[e.data],view:this.grid.view,event:i})}}),t("GridFieldEditColumnController",class extends Za{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=ai(this.grid.model,this.model.codeName);t&&(this.editItem=t,this.editItem.editor&&"HIDDEN"!==this.editItem.editor.editorType&&(this.editorProvider=await en(this.editItem.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.editItem.editor,this),await this.initRules())))}async initRules(){this.rules=[];const t=Vi(this.grid.model.degridEditItemVRs||[],this.fieldName);t&&this.rules.push(...hs(t,this.fieldName,this.valueItemName)),this.editItem.editor&&this.rules.push(...us(this.editItem.editor)),this.rules.length>0&&(this.validator=new ft({[this.fieldName]:this.rules}))}async setRowValue(t,e,i){i=i||this.fieldName,await this.grid.setRowValue(t,i,e)}async dataChangeNotify(t,i){this.calcColumnDisabled(t);const n=t.editColStates[this.fieldName].required;this.calcColumnRequired(t);if(n!==t.editColStates[this.fieldName].required||i.includes(this.fieldName)||i.includes(this.valueItemName)){if(!await this.validate(t))throw new e("".concat(this.editItem.codeName,"校验报错,").concat(t.errors[this.fieldName]))}i.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 i=this.grid.scheduler.triggerItemEnable(this.fieldName,{data:[t.data]});void 0!==i&&(e=i)}t.editColStates[this.fieldName].disabled=!e}calcColumnRequired(t){let e=!1!==this.editItem.allowEmpty;if(e&&this.grid.scheduler){const i=this.grid.scheduler.triggerItemBlank(this.fieldName,{data:[t.data]});void 0!==i&&(e=i)}t.editColStates[this.fieldName].required=!e}calcColumnReadonly(t){var e;const i=!!(null==(e=this.editItem.editor)?void 0:e.readOnly);t.editColStates[this.fieldName].readonly=i}calcEnableCond(t){const{enableCond:e}=this.editItem,i=0===t.data.srfuf;switch(e){case 0:return!1;case 1:return i;case 2:return!i;default:return!0}}async validate(t){const e=this.fieldName;if("cell"!==ibiz.config.grid.editShowMode&&t.editColStates[e].required&&U(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(i){const{errors:n}=i;return t.errors[e]=n[0].message,!1}return t.errors[e]=null,!0}}),t("GridGroupColumnController",class extends Ya{}),t("ListService",class extends xr{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),i=t.appDEFieldId;let n;if(i){const r=i.toLowerCase();n=new Nr(e,r,{isOriginField:!0,dataType:t.dataType})}else n=new Nr(e,e);this.dataUIMap.set(e,n)}))}})),eo=(t("ListController",class extends bs{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 to(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 i=this.fieldIdNameMap.get(t);this.state.sortQuery="".concat(i.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,i;super.setSelection(t);const n=null==t?void 0:t[0];null==(e=this.batchToolbarController)||e.calcButtonState(n,this.model.appDataEntityId),null==(i=this.quickToolbarController)||i.calcButtonState(n,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,i=new Map;e.forEach((e=>{const n=i.get(e[t])||[];n.push(e),i.set(e[t],n)}));const n=[];i.forEach(((t,e)=>{n.push({caption:e,key:e,children:[...t]})})),this.state.groups=n}}async handleCodeListGroup(){const{groupAppDEFieldId:t,groupCodeListId:e}=this.model;if(t&&e){const{items:i}=this.state,n=[],r=ibiz.hub.getApp(this.context.srfappid),s=await r.codeList.get(e,this.context,this.params),a=[];s.forEach((e=>{const r=i.filter((i=>i[t]===e.value));n.push({caption:e.text,key:e.value,children:[...r]}),a.push(e.value)}));const o=i.filter((e=>-1===a.indexOf(e[t])));o.length>0&&n.push({caption:"其他",key:"其他",children:[...o]}),this.state.groups=n}}}),t("PanelController",class extends vs{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,i=void 0){t&&await Promise.all(t.map((async t=>{var n,r;const s=await un(t);if(!s)return;e.providers[t.id]=s;const a=await s.createController(t,e,i);e.panelItems[t.id]=a,(null==(n=t.panelItems)?void 0:n.length)&&!a.isDataContainer&&await this.initPanelItemControllers(t.panelItems,e,a),(null==(r=t.panelTabPages)?void 0:r.length)&&await this.initPanelItemControllers(t.panelTabPages,e,a)})))}async load(){const t=await this.prepareData();if(!t)throw new e("未获取到面板数据");const i=this.convertData(t);this.state.data=i,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];g(this.model,(t=>{t.controlLogics&&e.push(...t.controlLogics)}),{childrenFields:["rootPanelItems","panelItems","panelTabPages"]}),super.initControlScheduler(e)}})),io=(t("ViewLayoutPanelController",class extends eo{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 i=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=i(t.panelItems||[]):(null==(e=this.model.rootPanelItems)?void 0:e.length)&&(this.model.rootPanelItems=i(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,i=!0;Object.defineProperty(this,"visible",{enumerable:!0,configurable:!0,get(){var t;return!1!==(null==(t=this.parent)?void 0:t.visible)&&i},set:t=>(i=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)})}})),no=(t("PanelItemController",class{constructor(t,e,i){this.model=t,this.panel=e,this.parent=i,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:i}=this.model;if(t){const{width:e,height:i}=qe(t);this.state.layout.width="".concat(e),this.state.layout.height="".concat(i)}(null==e?void 0:e.cssName)&&this.state.class.container.push(e.cssName),(null==i?void 0:i.cssName)&&this.state.class.label.push(i.cssName)}createState(){var t;return new io(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 i=this.panel.scheduler.triggerItemEnable(this.model.id,{data:[t]});void 0!==i&&(e=i)}this.state.disabled=!e}calcItemVisible(t){let{visible:e}=this.dynaLogicResult;if(e&&this.panel.scheduler){const i=this.panel.scheduler.triggerItemVisible(this.model.id,{data:[t]});void 0!==i&&(e=i)}this.state.visible=e}calcItemRequired(t){let e=!this.dynaLogicResult.required;if(e&&this.panel.scheduler){const i=this.panel.scheduler.triggerItemBlank(this.model.id,{data:[t]});void 0!==i&&(e=i)}this.state.required=!e}calcDynamicLogic(t,e=!1){var i;this.parent&&!this.parent.state.visible||null==(i=this.model.panelItemGroupLogics)||i.forEach((i=>{const n=i.relatedItemNames||[];if(e||v(n,t))try{const t=Ci(this.data,i);switch(i.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=Ke(this.model.dynaClass,t);e.length&&(this.state.class.containerDyna=e)}if(this.model.labelDynaClass){const e=Ke(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 vs{async onCreated(){await super.onCreated(),this.mountCounter.enroll(this.model.embeddedAppDEViewId),this.initNavParam()}initNavParam(){const{navigateContexts:t,navigateParams:e}=this.model,i=this.context.clone(),n={...this.params};t&&Object.assign(i,je(t,this.params,this.context)),e&&Object.assign(n,je(e,this.params,this.context)),this.state.context=i,this.state.params=n}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 i;let n;this.model=t,this.searchBar=e,t.appDEFieldId&&(n=ei(e.appDataEntity,t.appDEFieldId)),this.fieldName=n?n.codeName.toLowerCase():t.id,this.label=t.caption||(null==n?void 0:n.logicName)||t.id,this.valueOP=null==(i=t.defsearchMode)?void 0:i.valueOP}get context(){return this.searchBar.context}get params(){return this.searchBar.params}async init(){if(!this.model.editor)throw new i(this.model,"缺少编辑器模型");this.editorProvider=await en(this.model.editor),this.editorProvider&&(this.editor=await this.editorProvider.createController(this.model.editor,this))}}),ro=(t("SearchBarController",class extends vs{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=je(bi.execSingleLine(this.state.selectedGroupItem.data),this.params,this.context);Object.assign(e,t)}const i=this.calcFilters();return i&&(e.filters=i),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 no(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(g(this.state.filterNodes[0],(i=>{i.leaf&&(i.field&&i.valueOP&&!Z(i.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 vs{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:i,navigateContexts:n,navigateParams:r,appDataEntityId:s}=t,a={deName:$e(s),navFilter:i,pickupDEFName:null==e?void 0:e.pickupDEFName,navContexts:n,navParams:r},o={context:this.context,params:this.params,data:{}},{resultContext:c,resultParams:l}=ze(a,o);return{context:Object.assign(this.context.clone(),c,{currentSrfNav:this.state.activeName}),params:{...this.params,...l}}}getNavViewMsg(t){const{context:e,params:i}=this.prepareParams(t);return{key:t.codeName.toLowerCase(),context:e,params:i,viewId:t.embeddedAppDEViewId,isCache:this.isCache}}}),t("TreeService",class extends xr{async fetchChildNodes(t,e){const{hasQuery:i}=e;let n=[];if(t){const r=si(this.model,{parentId:null==t?void 0:t.nodeId,hasQuery:i});if(0===r.length)return;(await Bi(r.map((async i=>{const n=ri(this.model,i.childDETreeNodeId);return this.fetchNodeDatasByType(n,i,t,e)})),!1)).forEach((t=>{n.push(...t)}))}else{const t=ni(this.model);n=await this.fetchNodeDatasByType(t,void 0,void 0,e)}return n}async fetchNodeDatasByType(t,e,i,r){const s=0===si(this.model,{parentId:t.id,hasQuery:r.hasQuery}).length,a={...r,leaf:s};let o=[];switch(t.treeNodeType){case"STATIC":o=[await this.getStaticNodeData(t,e,i,a)];break;case"DE":o=await this.getDENodeDatas(t,e,i,a);break;case"CODELIST":o=await this.getCodeListNodeDatas(t,e,i,a);break;default:throw new n(t,"".concat(t.treeNodeType,"节点类型未支持"))}const{expandFirstOnly:c,expanded:l,rootNode:h}=t,u=h&&!this.model.rootVisible;return s||await Promise.all(o.map((async(t,e)=>{var i;if(l&&(!c||c&&0===e)||(null==(i=r.defaultExpandedKeys)?void 0:i.length)&&r.defaultExpandedKeys.includes(t.id)||u){const e=await this.fetchChildNodes(t,r);t.children=e}}))),o}async getStaticNodeData(t,e,i,n){return new kr(t,i,{parentValueLevel:null==e?void 0:e.parentValueLevel,leaf:!!n.leaf})}getNodeRSFilterParams(t,e,i){const{parentValueLevel:n,navigateContexts:r,navigateParams:s,parentFilter:a,parentDER1N:o}=t,c=null==o?void 0:o.pickupDEFName,l={...i.params},h={...i.context,...(null==e?void 0:e.context)||{}};let u,d,p,f={};if(e){u=e;for(let t=1;t<n;t++)u=null==u?void 0:u.parent}if(u){f=u.deData||{};const t=ri(this.model,u.nodeId);t.appDataEntityId&&(p=$e(t.appDataEntityId)),d=u.value}const{resultContext:m,resultParams:g}=ze({deName:p,navFilter:a?"n_".concat(a,"_eq"):void 0,pickupDEFName:c,navParams:s,navContexts:r},{derValue:d,context:h,params:l,data:f});return Object.assign(h,m),Object.assign(l,g),{context:h,params:l,navContext:m,navParams:g}}async getDENodeDatas(t,e,i,n){const{appDEDataSetId:r,appDataEntityId:s}=t,{context:a,params:o,navContext:c,navParams:l}=e?this.getNodeRSFilterParams(e,i,n):{context:n.context,params:n.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(s,r,a,o);if(h.data.length){return h.data.map((e=>new Mr(t,i,{data:e,leaf:!!n.leaf,navContext:c,navParams:l})))}return[]}async getCodeListNodeDatas(t,e,i,n){const{context:r,params:s,navContext:a,navParams:o}=e?this.getNodeRSFilterParams(e,i,n):{context:n.context,params:n.params,navContext:{},navParams:{}},c=await this.app.codeList.get(t.codeListId,r,s);if(c.length){return c.map((e=>new Rr(t,i,{data:e,leaf:!!n.leaf,navContext:a,navParams:o})))}return[]}})),so=(t("TreeController",class extends bs{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 ro(this.model),await this.service.init(this.context),this.model.detreeNodes.forEach((t=>{var e,i;(null==(i=null==(e=t.decontextMenu)?void 0:e.detoolbarItems)?void 0:i.length)&&(this.contextMenus[t.decontextMenu.id]=new wa(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 i;e&&await this.startLoading();try{i=await this.loadNodes()}finally{e&&await this.endLoading()}return await this.afterLoad(t,i),this.state.isLoaded=!0,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),i}async loadNodes(t){const e=await this.getFetchParams(),i=!!e.query;let n;this.state.isLoading=!0;try{n=await this.service.fetchChildNodes(t,{context:this.context.clone(),params:e,hasQuery:i,defaultExpandedKeys:this.state.expandedKeys})||[]}finally{this.state.isLoading=!1}return t?t.children=n:this.state.rootNodes=n,this.state.items=[],g({children:this.state.rootNodes},(t=>{this.state.items.push(t)})),this.state.expandedKeys=this.calcExpandedKeys(n),n}async onTreeNodeClick(t){if(this.state.singleSelect){const{selectedData:e}=this.state,i=e.filter((e=>e.id!==t.id));i.length===e.length?this.setSelection(this.state.singleSelect?[t]:e.concat([t])):this.setSelection(i)}1===this.state.mdctrlActiveMode&&await this.setActive(t)}onExpandChange(t,e){const i=this.state.expandedKeys.includes(t.id);if(e&&!i)this.state.expandedKeys.push(t.id);else if(!e&&i){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)),i=this.state.items.filter((t=>e.includes(t.id)));super.setSelection(i)}getNodeModel(t){var e;return null==(e=this.model.detreeNodes)?void 0:e.find((e=>e.id===t))}async doUIAction(t,e,i){const n=this.getEventArgs(),r=this.parseTreeNodeData(e),s=await ha.exec(t,{...n,...r,event:i});if(s.closeView)this.view.closeView();else if(s.refresh)switch(s.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 g({children:t},(t=>{var i;(null==(i=t.children)?void 0:i.length)&&e.push(t.id)})),e=Array.from(new Set(e)),e}async refreshNodeChildren(t,e=!1){const i=t.srfkey?"srfkey":"id",n=this.state.items.find((e=>e[i]===t[i]));if(!n)return void ibiz.log.error("找不到对应的树节点数据",t);if(e){const{parent:t}=n;if(!t||!this.model.rootVisible&&this.state.rootNodes.includes(t))return void this.refresh()}const r=e?n.parent:n,s=await this.loadNodes(r);this.evt.emit("onAfterRefreshParent",{parentNode:r,children:s})}}),t("WizardPanelService",class extends Ar{async initialize(t,e={},i={}){var n;const r=null==(n=this.model.initControlAction)?void 0:n.appDEMethodId;let s=await this.exec(r,t,e,i);return s=this.handleResponse(s),s}async finish(t,e={},i={}){var n;const r=null==(n=this.model.finishControlAction)?void 0:n.appDEMethodId;let s=await this.exec(r,t,e,i);return s=this.handleResponse(s),s}})),ao=(t("WizardPanelController",class extends vs{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,i,n;t.firstForm&&(this.firstForm=t);const r="".concat(this.model.name,"_form_").concat(null==(e=t.formTag)?void 0:e.toLowerCase()),s=null==(n=null==(i=this.model.dewizard)?void 0:i.dewizardSteps)?void 0:n.find((e=>e.id===t.dewizardStepId)),a=null==s?void 0:s.stepTag;this.stepTags[r]=a})),null==(e=null==(t=this.model.dewizard)?void 0:t.dewizardSteps)||e.forEach((t=>{this.steps.push(t.stepTag)})),this.service=new so(this.model),await this.service.init(this.context);const{deeditForms:i}=this.model;i&&i.length>0&&await Promise.all(i.map((async t=>{const{formTag:e}=t.dewizardForm;if(e){const i=await Ji(t);i&&(this.providers[e]=i)}})))}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,i=this.formControllers.get(t);if(!i)throw new e("找不到".concat(t,"的表单控制器"));return i}onFormMounted(t,e){const i=e.ctrl;this.formControllers.set(t,i),i.load()}onFormSaved(t){const e=t.data[0],i=$e(this.model.appDataEntityId);!this.context[i]&&e&&e.srfkey&&(this.context[i]=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=$e(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 i;if(t.srfnextform){if(!this.model.dewizard.dewizardForms.find((e=>e.formTag===t.srfnextform)))throw new e("找不到标识为".concat(t.srfnextform,"的向导表单"));i=t.srfnextform}else{const{formTag:t}=this.activeWizardForm,n=this.model.dewizard.dewizardSteps;if(n&&t){const r=n.findIndex((e=>e.stepTag===t)),s=n[r+1];if(!s)throw new e("找不到下一个向导步骤");const a=this.model.dewizard.dewizardForms.find((t=>t.formTag===s.stepTag));a&&(i=a.formTag)}}if(!i)throw new e("找不到下一个向导表单");this.state.activeFormTag=i,this.tagHistory.push(i)}async onFinishClick(){await this.activeFormController.save(),await this.finish()}}),t("MDCtrlService",class extends xr{initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.delistDataItems)||t.forEach((t=>{const e=t.id.toLowerCase(),i=t.appDEFieldId;let n;if(i){const r=i.toLowerCase();n=new Nr(e,r,{isOriginField:!0,dataType:t.dataType})}else n=new Nr(e,e);this.dataUIMap.set(e,n)}))}})),oo=t("MobMDCtrlRowState",class{constructor(t,e){this.data=t,this.controller=e,this.uaColStates={},this.data=t}}),co=(t("MDCtrlController",class extends bs{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 ao(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 oo(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 oo(t,this)));this.state.rows=e}getAllData(){return this.state.rows.map((t=>t.data))}async onActionClick(t,e,i){const n=t.uiactionId;await ha.execAndResolved(n,{context:this.context,params:this.params,data:[e.data],view:this.view,event:i})}initActionStates(t){const{deuiactionGroup:e,deuiactionGroup2:i}=this.model;e&&this.initUIActionGroup(t,e),i&&this.initUIActionGroup(t,i)}initUIActionGroup(t,e){var i;(null==(i=e.uiactionGroupDetails)?void 0:i.length)||ibiz.log.debug("操作列界面行为组没有配置界面行为");const n=new ss;(e.uiactionGroupDetails||[]).forEach((t=>{const e=t.uiactionId;if(e){const i=new rs(t.id,this.context.srfappid,e);n.addState(t.id,i)}})),n.update(t.data.getOrigin()),t.uaColStates[e.id]=n}async handleDataGroup(){const{enableGroup:t,groupMode:e,groupAppDEFieldId:n}=this.model;if(t&&e){if(!n)throw new i(this.model,"分组属性没有配置");"AUTO"===e?this.handleAutoGroup():"CODELIST"===e&&await this.handleCodeListGroup()}}handleAutoGroup(){const{groupAppDEFieldId:t}=this.model;if(t){const{items:e}=this.state,i=new Map;e.forEach((e=>{const n=e[t];Z(n)||(i.has(n)||i.set(n,[]),i.get(n).push(new oo(e,this)))}));const n=[];i.forEach(((t,e)=>{n.push({caption:e,key:e,children:[...t]})})),this.state.groups=n}}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 i(this.model,"分组代码表没有配置");const{items:n}=this.state,r=new Map;this.groupCodeListItems.forEach((t=>{r.set(t.value,[])})),n.forEach((e=>{const i=e[t],n=r.get(i);n&&n.push(new oo(e,this))}));const s=[];r.forEach(((t,e)=>{const i=this.groupCodeListItems.find((t=>t.value===e));s.push({caption:i.text,key:i.value,children:t})})),this.state.groups=s}}),t("KanbanService",class extends Ea{async updateGroup(t,e){var i;const n=(null==(i=this.model.updateGroupControlAction)?void 0:i.appDEMethodId)||"update";let r=await this.exec(n,t,e.getOrigin());return r=this.handleResponse(r),r}})),lo=(t("KanbanController",class extends _a{get enableEditOrder(){return!0===this.model.enableCardEditOrder}get enableEditGroup(){return!0===this.model.enableCardEditGroup}async initControlService(){this.service=new co(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 n=this.model.minorSortAppDEFieldId,{minorSortDir:r}=this.model;if(!n)throw new i(this.model,"排序属性没配置");if(!r)throw new i(this.model,"排序方向没配置");const s="ASC"===r;t.forEach((t=>{const i=t[n];if(Z(i))t[n]=0;else{const n=Number(i);if(Number.isNaN(n))throw new e("".concat(t.srfmajortext,"的排序属性无法转换成数值"))}})),t.sort(((t,e)=>s?t[n]-e[n]:e[n]-t[n]))}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:i,to:n,fromIndex:r,toIndex:s}=t,a=this.model.groupAppDEFieldId,o=this.model.minorSortAppDEFieldId,c=[],l=this.state.groups.find((t=>t.key===i)),h=this.state.groups.find((t=>t.key===n));if(!this.enableEditOrder){if(t.from===t.to)return void ibiz.message.warning("当前看板不允许调整次序");const e=l.children[r];return e[a]=t.to,this.updateChangedItems([e])}const u=t=>t+(100-t%100),d=[...h.children],p=[...h.children],f=l.children[r];t.from!==t.to?(f[a]=t.to,p.splice(s,0,f)):(p.splice(r,1),p.splice(s,0,f));const m=l.children.splice(r,1);let g;h.children.splice(s,0,...m),e||(d.reverse(),p.reverse());let y,w=[];p.forEach(((t,e)=>{void 0===g?t!==d[e]&&(g=d[e]?d[e][o]||100:0===e?100:u(d[e-1][o]),t[o]=g,c.push(t)):(g>=t[o]?(w.length>0&&(w.forEach((t=>{t[o]=u(y),c.push(t),y=t[o]})),g=y,y=0,w=[]),t[o]=u(g),c.push(t)):(0===w.length&&(y=g),w.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=$e(this.model.appDataEntityId),i=this.context.clone();i[e]=t.srfkey;const n=await this.service.updateGroup(i,t);if(n.data){const e=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(e,1,n.data)}})))}finally{this.state.updating=!1,await this.afterLoad({},this.state.items)}}}),t("TreeGridExService",class extends ro{constructor(){super(...arguments),this.multipleUiMap=new Map}initUIDataMap(){var t;super.initUIDataMap(),null==(t=this.model.detreeNodes)||t.forEach((t=>{var e;const i=new Map;null==(e=t.detreeNodeDataItems)||e.forEach((t=>{const e=t.id.toLowerCase(),n=t.appDEFieldId.toLowerCase(),r=new Nr(e,n,{isOriginField:!0,dataType:t.dataType});i.set(e,r)})),this.multipleUiMap.set(t.id,i)}))}async getDENodeDatas(t,e,i,n){const{appDEDataSetId:r,appDataEntityId:s}=t,{context:a,params:o,navContext:c,navParams:l}=e?this.getNodeRSFilterParams(e,i,n):{context:n.context,params:n.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(s,r,a,o);if(h.data.length){const{data:e}=this.handleResponseForMultiple(h,t.id);return e.map((e=>new Mr(t,i,{data:e,leaf:!!n.leaf,navContext:c,navParams:l})))}return[]}handleResponseForMultiple(t,e){const i=super.handleResponse(t);return i.headers&&(i.headers["x-page"]&&(i.page=Number(i.headers["x-page"])),i.headers["x-per-page"]&&(i.size=Number(i.headers["x-per-page"])),i.headers["x-total"]&&(i.total=Number(i.headers["x-total"]))),i.ok&&(H(i.data)?i.data=i.data.map((t=>this.toUIDataForMultiple(t,e))):i.data=this.toUIDataForMultiple(i.data,e)),i}toUIDataForMultiple(t,e){const i=this.multipleUiMap.get(e);return new Sr(t,i)}})),ho=(t("TreeGridExController",class extends bs{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 lo(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 cn(t);if(!e)return;this.providers[t.codeName]=e;const i=await e.createController(t,this);this.columns[t.codeName]=i,"DEFGRIDCOLUMN"===t.columnType?this.fieldColumns[t.codeName]=i:"UAGRIDCOLUMN"===t.columnType&&(this.uaColumns[t.codeName]=i)}initColumnStates(){g(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,i)=>{t.uaColumn?t.fixed=i+1<=Math.floor(e/2)?"left":"right":t.fixed="right"}))}async load(t={}){const e=!0===t.isInitialLoad,i=await this.loadNodes();return this.state.expandedKeys=this.calcExpandedKeys(i),await this.afterLoad(t,i),this.state.isLoaded=!0,await this.evt.emit("onLoadSuccess",{isInitialLoad:e}),i}async loadNodes(t){const e=await this.getFetchParams(),i=!!e.query,n=t?void 0:this.state.defaultExpandedKeys;let r;await this.startLoading();try{r=await this.service.fetchChildNodes(t,{context:this.context.clone(),params:e,hasQuery:i,defaultExpandedKeys:n})||[]}finally{await this.endLoading()}return t?t.children=r:this.state.rootNodes=r,this.state.items=[],g({children:this.state.rootNodes},(t=>{this.state.items.push(t)})),r}calcExpandedKeys(t){let e=[];return g({children:t},(t=>{var i;(null==(i=t.children)?void 0:i.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 Ja{}),t("TreeGridService",class extends Qa{}),t("MEditViewPanelService",class extends xr{})),uo=(t("MEditViewPanelController",class extends bs{constructor(){super(...arguments),this.showButton=!0,this.parameters=[]}async onCreated(){await super.onCreated(),this.service=new ho(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 initParameters(){var t,e;if(this.model.embeddedAppViewId){const i=await ibiz.hub.getAppView(this.model.embeddedAppViewId);if(i.appDataEntityId){const n=await ibiz.hub.getAppDataEntity(i.appDataEntityId);this.parameters=i&&n?[{parameterName:null==(t=n.keyAppDEFieldId)?void 0:t.toLowerCase(),pathName:null==(e=n.codeName)?void 0:e.toLowerCase()}]:[]}}}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,i={id:t[e]?t[e]:"mockId:".concat(G()),context:this.context.clone(),params:{},data:t,srfmajortext:""};return this.parameters.forEach((e=>{const{parameterName:n,pathName:r}=e;t[n]&&!Object.is(t[n],"")&&Object.assign(i.context,{[r]:t[n]}),t.srfmajortext&&!Object.is(t.srfmajortext,"")?Object.assign(i,{srfmajortext:t.srfmajortext}):0===t.srfuf&&Object.assign(i,{srfmajortext:"草稿--新建"})})),i}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 i=!1;t.id===this.state.activeTab&&e===this.state.panelUiItems.length-1&&e>0&&(i=!0),await this.handleDelete(t),i&&(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,i){const n=this.state.panelUiItems.findIndex((t=>t.id===i));if(!n)throw new e("编辑视图面板部件UI数据不存在");let r;await this.startLoading();const s=0===t.srfuf,a=$e(this.model.appDataEntityId),o=this.context.clone();o[a]=t.srfkey;try{r=s?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(s?"CREATE":"UPDATE","ERROR"),{error:t,data:this.state.panelUiItems[n].data}),t}finally{await this.endLoading()}const c=this.state.items.findIndex((e=>e.srfkey===t.srfkey));this.state.items.splice(c,1,r.data),this.state.panelUiItems.splice(n,1,this.handlePanelItemParams(r.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()}})),po=class{constructor(){this.convert=new Kr,this.controller=new uo,this.appMap=new Map,this.apps=new Map,this.view2appMap=new Map,this.views=new Map,this.dataEntities=new Map,this.config=new Yr,this.defaultAppIndexViewName="Index"}calcAppViewId(t){let e="";if(-1!==t.indexOf(".")){const i=t.split(".");e=i[i.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 i=this.calcAppViewId(t);this.view2appMap.set(i,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 i=this.calcAppViewId(t),n=this.view2appMap.get(i)||ibiz.env.appId;if(this.appMap.has(n)||await this.createApp(n),this.views.has(i))return this.views.get(i);if(this.modelLoaderProvider){const t=await this.modelLoaderProvider.getAppView(n,i);return this.registerAppView(t),t}throw new e("视图[".concat(i,"]不存在"))}async getAppDataEntity(t,i=ibiz.env.appId){if(this.dataEntities.has(i)){const e=this.dataEntities.get(i);if(e.has(t))return e.get(t)}if(this.modelLoaderProvider){let e;return e=-1!==t.indexOf(".")?await this.modelLoaderProvider.getAppDataEntity(i,t):await this.modelLoaderProvider.getAppDataEntityByCodeName(i,t),this.registerAppDataEntity(e,i),e}throw new e("未找到应用实体[".concat(t,"]"))}async createApp(t){if(this.appMap.has(t))return this.appMap.get(t);let i;if(this.apps.has(t))i=this.apps.get(t);else{if(!this.modelLoaderProvider)throw new e("未找到应用[".concat(t,"]模型"));i=await this.modelLoaderProvider.getApp(t),this.registerApp(i)}const n=new Hr(i);return this.appMap.set(t,n),await n.init(),this.configCache||(this.configCache=new Fn(ibiz.env.appId,"PSSysHub","Global")),n}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)}},fo=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:i,engineCat:n}=t,r="".concat(n,"_").concat(i),s=this.viewEngines.get(r);if(s)return s(...e);ibiz.log.error("没有".concat(r,"对应的引擎"),t)}}),mo=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:i,childNames:n}=this.view;ibiz.log.debug("".concat(i.id,"的子组件:").concat(n.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,i,n;let r=!1;const{model:s}=this.view;if(!1===s.showCaptionBar){const e=null==(t=this.viewLayoutPanel)?void 0:t.panelItems.view_captionbar;e&&(e.state.visible=!1)}else r=!0;if(ibiz.env.isMob){if(this.leftToolbar)r=!0;else{const t=null==(e=this.viewLayoutPanel)?void 0:e.panelItems.lefttoolbar;t&&(t.state.visible=!1)}if(this.rightToolbar)r=!0;else{const t=null==(i=this.viewLayoutPanel)?void 0:i.panelItems.righttoolbar;t&&(t.state.visible=!1)}}else if(this.toolbar)r=!0;else{const t=null==(n=this.viewLayoutPanel)?void 0:n.panelItems.view_toolbar;t&&(t.state.visible=!1)}return r}calcViewFooterVisible(){let t=!1;return this.footerToolbar&&(t=!0),t}async loadEntityData(){const{appDataEntityId:t}=this.view.model,{evt:i,context:n,params:r}=this.view;if(!t)throw new e("该视图没有实体,无法加载实体数据");const s=ibiz.hub.getApp(n.srfappid),a=await s.deService.exec(t,"get",n,r),{data:o}=a;o&&(this.view.state.srfactiveviewdata=o,i.emit("onDataChange",{actionType:"LOAD",data:[o]}),o.srfkey&&i.emit("onViewInfoChange",{dataInfo:o.srfmajortext||""}))}}),go=(t("MDViewEngine",class extends mo{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 i=!!this.searchForm;e.state.keepAlive=i,e.state.visible=i&&!!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?this.openData(e):"New"===t?this.newData(e):"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,n;const{data:r,event:s}=t,a=(t.context||this.view.context).clone(),o=t.params||this.view.params;a[((null==(e=r[0].srfdecodename)?void 0:e.toLowerCase())||$e(this.xdataControl.model.appDataEntityId)).toLowerCase()]=r[0].srfkey;const c=await(null==(n=this.view.scheduler)?void 0:n.triggerCustom("opendata",{context:a,params:o,data:r,event:s,view:this.view}));if(-1===c)throw new i(this.view.model,"缺少newdata的视图逻辑");return{cancel:!c.ok}}async newData(t){var e,n,r;const{data:s,event:a,copyMode:o}=t;if(!(null==(n=null==(e=this.view.model.viewLayoutPanel)?void 0:e.appViewLogics)?void 0:n.find((t=>"newdata"===t.id))))throw new i(this.view.model,"缺少newdata的视图逻辑");const c=it(this.view.params);o&&(c.srfcopymode=o);const l=await(null==(r=this.view.scheduler)?void 0:r.triggerCustom("newdata",{context:this.view.context,params:c,data:s,event:a,view:this.view}));if(-1===l)throw new i(this.view.model,"缺少newdata的视图逻辑");return{cancel:!l.ok}}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 i||t instanceof n?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}}),yo=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)}},wo=class{constructor(){this.layoutPanel=new Di,this.text=new Fi,this.hbs=new Ve,this.rawValue=new ji,this.error=new yo,this.error.register(new go)}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)}},vo=class{constructor(t,e){this.logic=t,this.scheduler=e,this.type=t.logicType}execute(t){throw new e("Method not implemented.")}destroy(){}},bo=class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createExecutor(t,e){const i=this.constructorMap.get(t.logicType);if(!i)throw new n(t,"逻辑类型 ".concat(t.logicType," 暂未支持!"));return i(t,e)}},Eo=class extends vo{constructor(){super(...arguments),this.initialized=!1}convertScriptArgs(t){return t}init(t,e,i){this.convertScriptArgs=e;const n=this.logic.scriptCode;this.scriptFn=bi.createScriptFn(t,n,i),this.initialized=!0}execute(t){const e=this.convertScriptArgs(t);return this.scriptFn.exec(e)}},_o=class extends vo{execute(t){const{appDEUILogicId:e,appDataEntityId:n}=this.logic;if(!e)throw new i(this.logic,"没有配置实体界面逻辑");la(e,n,t)}},Io=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 i=this.createTrigger(t);this.triggers.set(t.id,i),i.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((i=>{i.match(t)&&e.push(i)})),e}triggerAndExecute(t,e={}){const i=this.getMatchTriggers(t);if(i.length>0){const t=this.getExecuteParams(e);return i.map((e=>e.execute(t)))}}triggerItemDynaLogic(t,e,i){const n={itemName:t,triggerType:e},r=this.triggerAndExecute(n,i);if(null==r?void 0:r.length)return r.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 i=this.triggers.get(t);if(!i)return-1;const n=this.getExecuteParams(e);return i.execute(n)}triggerControlEvent(t,e,i){const n={ctrlName:t,eventName:e,triggerType:"CTRLEVENT"};this.triggerAndExecute(n,i)}},Co=class extends Io{constructor(t){const e=t.filter((t=>"APPVIEWENGINE"!==t.triggerType));e.forEach((t=>{"CTRLEVENT"===t.triggerType&&(t.ctrlName=t.itemName)})),super(e)}},Do=class extends Io{constructor(t){t.forEach((t=>{t.triggerType=t.logicTrigger})),super(t)}triggerViewEvent(t){const e={eventName:t.eventName,triggerType:"VIEWEVENT"};this.triggerAndExecute(e,t)}},So=class{constructor(){this.constructorMap=new Map}register(t,e){this.constructorMap.set(t,e)}createTrigger(t,e){const i=this.constructorMap.get(t.triggerType);if(!i)throw new n(t,"触发器类型 ".concat(t.triggerType," 暂未支持!"));return i(t,e)}},Ao=class{constructor(){this.executorFactory=new bo,this.triggerFactory=new So}createViewScheduler(t){return new Do(t)}createControlScheduler(t){return new Co(t)}},xo=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}},Po=class extends xo{},To=class extends xo{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:i,data:n}=t;return{context:e,params:i,data:(null==n?void 0:n[0])||{},env:ibiz.env}}),{singleRowReturn:!0,isAsync:!1})}match(t){var e,i;return super.match(t)&&(null==(e=t.itemName)?void 0:e.toLowerCase())===(null==(i=this.logic.itemName)?void 0:i.toLowerCase())}execute(t){return!!this.executor.execute(t)}},Oo=class extends xo{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)}},Lo=class extends vo{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,n){const{context:r,params:s,...a}=n,{data:o}=n;if(!(null==o?void 0:o[0]))throw new e("opendata没有可操作数据!");let c;if(t.openDataAppViews)c=await this.calcOpenViewRef(t,n);else if(c=t.openDataAppView,!c)throw new i(t,"opendata视图逻辑没有配置默认打开视图");const l=c.refAppViewId;if(!l)throw new i(t,"opendata视图逻辑的默认打开视图没有实际引用视图");const h=c.navigateContexts||[],u=Object.assign(r,je(h,o[0],s,r));let d={};const p=c.navigateParams;return B(p)&&(d=je(p,o[0],s,r)),ibiz.commands.execute(Ur.TAG,l,u,d,a)}async calcOpenViewRef(t,n){const r=n.view.model.appDataEntityId,s=await Je(r);if(!s)throw new i(t,"".concat(r,"实体缺少表单类型应用实体属性"));const{data:a}=n,o=a[0][s];if(!o)throw new i(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:r,params:s,...a}=e,{data:o,view:c}=e,{enableWizardAdd:l,enableBatchAdd:h,batchAddOnly:u,newDataAppView:d}=t;let p;if(l){if(p=await this.getWizardNewViewRef(t,e),!p)return{ok:!1}}else if(h){const e=$e(c.parentView.model.appDataEntityId),n=t.batchAddAppViews;if(p=null==n?void 0:n.find((t=>t.refMode.toLowerCase()!==e)),!p)throw new i(t,"没有找到批添加需要打开的选择视图")}else{if(u)throw new n(t,"batchAddOnly暂未支持");if(p=d,!p||!p.refAppViewId)throw new i(t,"newdata视图逻辑没有配置默认新建数据视图")}let f={},m={};const g=(null==o?void 0:o[0])||{},y=p.navigateContexts;B(y)&&(f=je(y,g,s,r)),f=Object.assign(r,f);const w=p.navigateParams;if(B(w)&&(m=je(w,g,s,r)),s.srfcopymode){const t=(await ibiz.hub.getAppDataEntity(c.model.appDataEntityId)).keyAppDEFieldId;t&&g&&(m[t]=g.srfkey,m.srfcopymode=!0)}m.srfuf=0;const v=await ibiz.commands.execute(Ur.TAG,p.refAppViewId,f,m,a);return h&&v.data&&await this.doBatchAdd(t,v.data,r,p),v}async getWizardNewViewRef(t,n){var r;const{wizardAppView:s,newDataAppViews:a}=t,{context:o,params:c,...l}=n;if(!s||!s.refAppViewId)throw new i(t,"缺少默认索引实体选择视图");const h=await ibiz.commands.execute(Ur.TAG,s.refAppViewId,o,c,{...l,openMode:"POPUPMODAL"});if(!h.ok)return;const u=null==(r=h.data)?void 0:r[0];if(!u)throw new e("请选中一条数据");const d=u.srfkey,p=null==a?void 0:a.find((t=>t.refMode===d));if(!p)throw new e("没有找到与索引类型".concat(d,"相关的实体的编辑视图"));return p}async doBatchAdd(t,e,n,r){var s;if(null==e?void 0:e.length){const a=await ibiz.hub.getAppDataEntity(t.appDataEntityId,n.srfappid),o=a.minorAppDERSs,c=r.refMode.toLowerCase();if(!o)throw new i(a,"实体没有从关系集合!");let l;null==o||o.forEach((t=>{const e=$e(t.majorAppDataEntityId);c===e&&(l=t.parentAppDEFieldId)}));const h=null==(s=r.navigateParams)?void 0:s.find((t=>"keymapping"===t.key));let u=[];if(h){const t=h.value.split(";"),i={};for(const e of t){const[t,n]=e.split(":");t&&n&&(i[t]=n)}u=e.map((t=>{const e={[l]:t.srfkey};for(const n in i)if(Object.prototype.hasOwnProperty.call(i,n)){const r=i[n];Object.prototype.hasOwnProperty.call(t,n)&&(e[r]=t[n])}return e}))}else u=e.map((t=>({[l]:t.srfkey})));const d=ibiz.hub.getApp(n.srfappid).deService;await d.exec(a.id,"Create",n,u)}}},Ro=class extends xo{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const i=t.eventNames.split(";");this.listenEventNames=i.map((t=>Ri[t]||t))}match(t){return super.match(t)&&this.listenEventNames.includes(t.eventName)}},Mo=class extends xo{constructor(t,e){super(t,e),this.logic=t,this.scheduler=e,this.listenEventNames=[];const i=t.eventNames.split(";");this.listenEventNames=i.map((t=>ki[t]||t))}match(t){return super.match(t)&&t.ctrlName.toLowerCase()===this.logic.ctrlName.toLowerCase()&&this.listenEventNames.includes(t.eventName)}},ko=class extends vo{execute(t){ha.execAndResolved(this.logic.appDEUIActionId,t)}};var No=It(pe(),1);t("PluginStaticResource",class{constructor(t){this.styleElementMap=new Map,this.url=new URL(t);const e=No.default.dirname(this.url.pathname);this.baseDir=e}dir(t){return No.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,i)=>{const n=document.createElement("link");n.setAttribute("type","text/css"),n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.onload=t,n.onerror=i,document.head.appendChild(n)})))}));try{await Promise.all(e)}catch(t){ibiz.log.error(t)}}}),t("RemotePluginItem",class{constructor(t,e,i){this.tag=t,this.repo=e,this.config=i}})}}}));
2
2
  //# sourceMappingURL=index.system.min.js.map