hzzt-kfb-slide 1.0.21 → 1.0.23

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 (114) hide show
  1. package/dist/components/{annotateCnpFlB7l.js → annotateCEdf17JQ.js} +1 -1
  2. package/dist/components/{annotateD6iDpO7f.js → annotateCdrBq7m9.js} +1 -1
  3. package/dist/components/{annotateDcVXJrRC.js → annotateDaCoAYvk.js} +3 -3
  4. package/dist/components/{annotateS9m_7F_t.js → annotateDaK1jE3r.js} +1 -1
  5. package/dist/components/{arrowDIoD5hwi.js → arrowBheYCQhb.js} +1 -1
  6. package/dist/components/{arrowCircleDZAzyMrh.js → arrowCircle8n_E-zon.js} +1 -1
  7. package/dist/components/{arrowCircleCsL3Zm90.js → arrowCircleCIYWu4oI.js} +1 -1
  8. package/dist/components/{arrowBLK7t0VD.js → arrowD6uQqBCH.js} +1 -1
  9. package/dist/components/{arrowDownBYGkm1jY.js → arrowDown1zNbYUsw.js} +1 -1
  10. package/dist/components/{arrowDownPZKOLUgK.js → arrowDownmooxKjZD.js} +1 -1
  11. package/dist/components/{arrowLeftDrzMmH78.js → arrowLeftC4Km9_T8.js} +1 -1
  12. package/dist/components/{arrowLeft4tXIB3LW.js → arrowLeftCkdpHF1s.js} +1 -1
  13. package/dist/components/{arrowRightBuyDbO_G.js → arrowRightBNW_c51s.js} +1 -1
  14. package/dist/components/{arrowRightDylomche.js → arrowRightD2Dn7gNf.js} +1 -1
  15. package/dist/components/{arrowUpByK5cnFA.js → arrowUpDSEsQOF8.js} +1 -1
  16. package/dist/components/{arrowUpDfS53des.js → arrowUpVMgKMDpa.js} +1 -1
  17. package/dist/components/{bilateralXZdekUUl.js → bilateralCuVbPXBS.js} +1 -1
  18. package/dist/components/{bilateralVwNc0Md7.js → bilateralD6Gt3vTK.js} +1 -1
  19. package/dist/components/{channelCqYZgNjT.js → channelBKgSvf8R.js} +1 -1
  20. package/dist/components/{channelEMKDDh6Y.js → channelCqNdrLRp.js} +1 -1
  21. package/dist/components/{checkCQyihNov.js → checkBTxTPUmG.js} +1 -1
  22. package/dist/components/{checkB2ka5Rvj.js → checkBgFKeiEk.js} +1 -1
  23. package/dist/components/{configBXX7OsBg.js → configBwcIvofN.js} +1 -1
  24. package/dist/components/{configB3o5JhZB.js → configVzpNBK4j.js} +1 -1
  25. package/dist/components/{customiCFpF8Iu.js → customBzNUnI1_.js} +1 -1
  26. package/dist/components/{customU1g0C3oa.js → customXQMwCWH-.js} +1 -1
  27. package/dist/components/{deleteBiWQF7Vc.js → deleter46PUcR7.js} +1 -1
  28. package/dist/components/{deleteBrANmTTw.js → deleteuKM3eNg9.js} +1 -1
  29. package/dist/components/{dotk8dz87xn.js → dotAjbwYIjc.js} +1 -1
  30. package/dist/components/{dotCjaHTvme.js → dotB5fcm7HI.js} +1 -1
  31. package/dist/components/{dotFQ8rH5rz.js → dotBcS-s4Ji.js} +4 -4
  32. package/dist/components/{dotC9jetQq2.js → dotC60HsnQC.js} +1 -1
  33. package/dist/components/{dotDRiHDpuw.js → dotDRxxoGDN.js} +1 -1
  34. package/dist/components/{dotCMMhOOTW.js → dota_h96wsk.js} +1 -1
  35. package/dist/components/{downloadB4im9Upm.js → download0raNbGIQ.js} +1 -1
  36. package/dist/components/{downloadBr2LFWrC.js → downloadCeZHm1b2.js} +3 -3
  37. package/dist/components/{downloadDRon7MZm.js → downloadPtg2z7ow.js} +1 -1
  38. package/dist/components/{downloadB8Niyy0n.js → downloadQG7ZwYfQ.js} +1 -1
  39. package/dist/components/{ellipseDq3cWSCR.js → ellipseBZ8yYlaL.js} +1 -1
  40. package/dist/components/{ellipseB44Nxbvs.js → ellipseYlyaoyZy.js} +1 -1
  41. package/dist/components/{expandLeftDYwT6cWU.js → expandLeftBz3QWv76.js} +1 -1
  42. package/dist/components/{expandLeftHydSM9I8.js → expandLeftghSpebGj.js} +1 -1
  43. package/dist/components/{expandRightB0o_qftH.js → expandRightChb52_6H.js} +1 -1
  44. package/dist/components/{expandRightBkJGFUn8.js → expandRightDd6ZAOUC.js} +1 -1
  45. package/dist/components/{flagC2vvXfFF.js → flagBDAHGxBH.js} +1 -1
  46. package/dist/components/{flagem1I0mtm.js → flagBMUYJUOS.js} +1 -1
  47. package/dist/components/{flipDhhbDPtH.js → flipBP-wAUm3.js} +1 -1
  48. package/dist/components/{flipg8wC3G4c.js → flipjqZMkNdX.js} +1 -1
  49. package/dist/components/{fontBFr03tyR.js → fontD7bsQ6Kn.js} +1 -1
  50. package/dist/components/{fontBqBTMpbk.js → fontuqvRNpUO.js} +1 -1
  51. package/dist/components/{fullscreenDh2GPwvi.js → fullscreen37xb3o_w.js} +2 -2
  52. package/dist/components/{fullscreenZRiW7ADA.js → fullscreen9MksDRTj.js} +1 -1
  53. package/dist/components/{fullscreenC-D2FWP0.js → fullscreenCGg-0cLE.js} +1 -1
  54. package/dist/components/{fullscreenDNjPXieL.js → fullscreenD0Tzcmnh.js} +1 -1
  55. package/dist/components/{fulltailorGkgjt3NS.js → fulltailorBSTnzZ4Z.js} +1 -1
  56. package/dist/components/{fulltailorKQAWkx12.js → fulltailorCoKvg5RU.js} +1 -1
  57. package/dist/components/indexDTYgyrVJ.js +4 -0
  58. package/dist/components/{indexBt-hoAPX.js → indexDv4bEiVT.js} +1865 -1846
  59. package/dist/components/{infoC6LJqUo4.js → infoCliobJhI.js} +1 -1
  60. package/dist/components/{infoCEoYs9tl.js → infoDPbhLlzT.js} +1 -1
  61. package/dist/components/{levelC7dSBXiF.js → levelDVFlbZm1.js} +1 -1
  62. package/dist/components/{levelCpxuxE75.js → leveltna91jcl.js} +1 -1
  63. package/dist/components/{lineCSiG-rgX.js → lineCD0z4dkx.js} +1 -1
  64. package/dist/components/{lineCLScyilQ.js → lineDzSSW3FQ.js} +1 -1
  65. package/dist/components/{measureD5dd2m65.js → measureBPBCptL3.js} +1 -1
  66. package/dist/components/{measureMfshwA5D.js → measureD5T3GJdx.js} +1 -1
  67. package/dist/components/{microscopeBXDxbZQk.js → microscopeC0PdDwyZ.js} +3 -3
  68. package/dist/components/{microscopeKE1n-1VJ.js → microscopeCrL6eo86.js} +1 -1
  69. package/dist/components/{microscopeDOR4ITmp.js → microscopeDcthRXKH.js} +1 -1
  70. package/dist/components/{microscopeD6LeGX-I.js → microscopeDegPy72f.js} +1 -1
  71. package/dist/components/{moveB_UjIkjG.js → move070cVXtD.js} +1 -1
  72. package/dist/components/{moveDhB-bvPR.js → moveBwSb5kHc.js} +3 -3
  73. package/dist/components/{moveDMTQN7MR.js → moveDIVhruOl.js} +1 -1
  74. package/dist/components/{moveD6QC3XSH.js → moveDqW3yXmH.js} +1 -1
  75. package/dist/components/{nextBmwSx2_j.js → nextBZAAY1k5.js} +1 -1
  76. package/dist/components/{next_FHavUbD.js → nexthP2NziP8.js} +1 -1
  77. package/dist/components/{polygonD4sIeJsL.js → polygonBME7HxkO.js} +1 -1
  78. package/dist/components/{polygonCrlqZ6Rg.js → polygonm12gSiRd.js} +1 -1
  79. package/dist/components/{prevBLPvjPjZ.js → prevBeRhvwg-.js} +1 -1
  80. package/dist/components/{prevBAQ8fAS8.js → prevBjt_4jy1.js} +1 -1
  81. package/dist/components/{processL_p7JcxZ.js → processB0ltLhs4.js} +1 -1
  82. package/dist/components/{processDkNDXOUw.js → processBts7MflP.js} +1 -1
  83. package/dist/components/{processCg3zvbbP.js → processCU2pn9qa.js} +3 -3
  84. package/dist/components/{processBa-REUiu.js → processDp8eVPwV.js} +1 -1
  85. package/dist/components/{rectangleD8kKz7rC.js → rectangleBayqQAM3.js} +1 -1
  86. package/dist/components/{rectangle7nBuNG6m.js → rectangleDF-sjc4U.js} +1 -1
  87. package/dist/components/{rotateCGfb57rP.js → rotateCHwgvi0w.js} +1 -1
  88. package/dist/components/{rotateCNC4_D0p.js → rotateDAZpn-EP.js} +1 -1
  89. package/dist/components/{rotateCHSOw1s1.js → rotateDTWjJwsV.js} +1 -1
  90. package/dist/components/{rotateDdVyoRpL.js → rotateDptIMits.js} +4 -4
  91. package/dist/components/{settingBHm__JEG.js → settingD62IUtKU.js} +1 -1
  92. package/dist/components/{setting4mQSpijG.js → settingDCHoGlD6.js} +1 -1
  93. package/dist/components/{settingC6jzPy4x.js → settingDDrDpNDx.js} +3 -3
  94. package/dist/components/{settingD8jduAuZ.js → settingbRL2Yq3Q.js} +1 -1
  95. package/dist/components/{starjty5rmfV.js → starC7c9npWd.js} +1 -1
  96. package/dist/components/{starCevkgLLp.js → stargRYGEmWK.js} +1 -1
  97. package/dist/components/{tailorDae0iTNE.js → tailorBANgQtgd.js} +1 -1
  98. package/dist/components/{tailorDm6UVe3p.js → tailorDNkQPURv.js} +1 -1
  99. package/dist/components/{useCommon1IVEtxgB.js → useCommonBnNHmM1A.js} +1 -1
  100. package/dist/components/{useCommonBJEdoExC.js → useCommonD_oGx4Eb.js} +1 -1
  101. package/dist/components/{voiceUjxBlsqB.js → voiceDUWhgryp.js} +1 -1
  102. package/dist/components/{voiceDNQTpuEE.js → voiceTmNBX9My.js} +1 -1
  103. package/dist/components/{zoomCQevD3FV.js → zoomCBwLbhKZ.js} +1 -1
  104. package/dist/components/{zoomBIixAFT8.js → zoomDhb7eteA.js} +1 -1
  105. package/dist/components/{zoomIn00fV4-DA.js → zoomInBRC0loE6.js} +1 -1
  106. package/dist/components/{zoomInB43tFyCf.js → zoomInDzdlJrl-.js} +1 -1
  107. package/dist/components/{zoomOutD2EOybys.js → zoomOutCughQp6N.js} +1 -1
  108. package/dist/components/{zoomOutBQ0kfk_c.js → zoomOutDFJC7cdD.js} +1 -1
  109. package/dist/index.cjs.js +1 -1
  110. package/dist/index.css +1 -1
  111. package/dist/index.es.js +1 -1
  112. package/package.json +1 -1
  113. package/types/components/KfbImage.vue.d.ts +9 -0
  114. package/dist/components/indexCQfbU-rB.js +0 -4
@@ -0,0 +1,4 @@
1
+ "use strict";var bn=Object.defineProperty,En=Object.defineProperties;var xn=Object.getOwnPropertyDescriptors;var Bt=Object.getOwnPropertySymbols;var Nn=Object.prototype.hasOwnProperty,zn=Object.prototype.propertyIsEnumerable;var Be=Math.pow,$t=(n,o,t)=>o in n?bn(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t,Y=(n,o)=>{for(var t in o||(o={}))Nn.call(o,t)&&$t(n,t,o[t]);if(Bt)for(var t of Bt(o))zn.call(o,t)&&$t(n,t,o[t]);return n},se=(n,o)=>En(n,xn(o));var ge=(n,o,t)=>new Promise((l,c)=>{var s=g=>{try{p(t.next(g))}catch(m){c(m)}},u=g=>{try{p(t.throw(g))}catch(m){c(m)}},p=g=>g.done?l(g.value):Promise.resolve(g.value).then(s,u);p((t=t.apply(n,o)).next())});const e=require("vue"),b=require("element-plus"),be=require("@vueuse/core"),ne=require("kfb-view"),Dt=require("dayjs"),Sn=require("v-lazy-image"),ut=Symbol("I18N_INJECT_KEY");function me(){const n=e.inject(ut),o=t=>t;return{locale:n==null?void 0:n.locale,t:(n==null?void 0:n.t)||o}}const Tn={install(n,o){n.provide(ut,o==null?void 0:o.global)}},ee=e.ref({annotate:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./annotateDaK1jE3r.js")))),arrowCircle:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowCircleCIYWu4oI.js")))),check:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./checkBgFKeiEk.js")))),dot:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./dotAjbwYIjc.js")))),flip:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./flipjqZMkNdX.js")))),info:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./infoCliobJhI.js")))),microscope:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./microscopeDcthRXKH.js")))),move:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./moveDqW3yXmH.js")))),next:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./nextBZAAY1k5.js")))),prev:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./prevBeRhvwg-.js")))),process:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./processB0ltLhs4.js")))),rotate:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./rotateDAZpn-EP.js")))),fullscreen:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fullscreenD0Tzcmnh.js")))),setting:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./settingbRL2Yq3Q.js")))),tailor:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./tailorBANgQtgd.js")))),fulltailor:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fulltailorBSTnzZ4Z.js")))),download:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./download0raNbGIQ.js")))),config:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./configBwcIvofN.js")))),arrowDown:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowDown1zNbYUsw.js")))),arrowUp:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowUpDSEsQOF8.js")))),arrowLeft:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowLeftCkdpHF1s.js")))),arrowRight:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowRightBNW_c51s.js")))),zoomIn:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./zoomInBRC0loE6.js")))),zoomOut:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./zoomOutCughQp6N.js")))),level:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./leveltna91jcl.js")))),channel:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./channelBKgSvf8R.js")))),delete:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./deleteuKM3eNg9.js")))),expandLeft:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./expandLeftBz3QWv76.js")))),expandRight:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./expandRightChb52_6H.js")))),markMeasure:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./measureBPBCptL3.js")))),markLine:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./lineDzSSW3FQ.js")))),markArrow:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrowBheYCQhb.js")))),markBilateral:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./bilateralCuVbPXBS.js")))),markRectangle:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./rectangleDF-sjc4U.js")))),markEllipse:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./ellipseYlyaoyZy.js")))),markPolygon:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./polygonBME7HxkO.js")))),markFlag:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./flagBDAHGxBH.js")))),markStar:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./stargRYGEmWK.js")))),markDot:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./dota_h96wsk.js")))),markFont:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fontD7bsQ6Kn.js")))),markVoice:e.markRaw(e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./voiceDUWhgryp.js"))))}),le=e.defineComponent({__name:"KfbIcon",props:{name:{type:[String,Number],required:!0},component:{type:Object,required:!1}},setup(n){return(o,t)=>(e.openBlock(),e.createBlock(e.unref(b.ElIcon),e.normalizeProps(e.guardReactiveProps(o.$attrs)),{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.component||e.unref(ee)[n.name])))]),_:1},16))}}),Bn={class:"hzzt-kfb-tool-config"},$n={class:"tabs-item-box"},Dn={class:"hzzt-kfb-tool-config__block flex align-items-center"},Ln={class:"hzzt-kfb-tool-config__icon flex align-items-center justify-content-center"},Mn={class:"margin-l-4 flex-1"},Pn={class:"tabs-item-box",style:{"padding-left":"32px"}},Rn={class:"flex align-items-center"},In={class:"margin-t-2 margin-b-2",style:{width:"150px"}},An={class:"flex align-items-center"},Fn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Hn={class:"flex align-items-center"},Un={class:"margin-t-2 margin-b-2",style:{width:"150px"}},jn={class:"flex align-items-center"},On={class:"margin-t-2 margin-b-2",style:{width:"150px"}},qn={class:"flex align-items-center"},Kn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Wn={class:"flex align-items-center"},Gn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Yn={class:"flex align-items-center"},Zn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Xn={class:"flex align-items-center"},Jn={class:"margin-t-2 margin-b-2",style:{width:"150px"}},Qn={class:"flex align-items-center"},eo={class:"margin-t-2 margin-b-2",style:{width:"150px"}},to={class:"margin-l-2",style:{"font-size":"12px",color:"var(--el-text-color-secondary)"}},no={class:"flex align-items-center"},oo={class:"margin-t-2 margin-b-2",style:{width:"150px"}},lo=e.defineComponent({name:"KfbToolConfig",__name:"KfbToolConfig",props:{menus:{default:()=>[]},menusModifiers:{}},emits:["update:menus"],setup(n){const o=e.useModel(n,"menus"),{t}=me(),l=e.computed(()=>o.value.filter(v=>v.name!=="line"&&v.name!=="config"&&v.name!=="zoom"&&v.props.name!=="config")),c=e.ref("operate"),s=(v,w)=>{console.log(v,w)},u={fullscreen:t("全屏"),next:t("上一张"),prev:t("上一张"),flip:t("镜像翻转"),setting:t("工具"),rotate:t("旋转"),dot:t("打点"),annotate:t("标注"),tailor:t("区域截图"),fulltailor:t("全屏截图"),process:t("图像处理"),microscope:t("镜下"),move:t("快速移动"),info:t("信息"),download:t("下载")},p=e.inject("show-keyboard",e.ref(!1)),g=e.inject("show-watermark",e.ref(!1)),m=e.inject("show-menu-text",e.ref(!0)),N=be.useStorage("default-open-ai",!1),r=e.inject("menu-config-other-setting",{screenshotLocally:!1,screenshotIncludeAnnotations:!0,screenshotFormat:"image/jpeg",screenshotWatermark:{time:!1,mac:!1,scale:!1,ratio:!1},screenshotSize:{w:200,h:200},labelDisplayDuration:15});function k(v){return v in u}function y(v){var w;return((w=v.props)==null?void 0:w.text)||(k(v.name)?u[v.name]:"")}return(v,w)=>(e.openBlock(),e.createElementBlock("div",Bn,[e.createVNode(e.unref(b.ElTabs),{modelValue:c.value,"onUpdate:modelValue":w[14]||(w[14]=f=>c.value=f),class:"demo-tabs",onTabClick:s},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElTabPane),{label:e.unref(t)("操作设置"),name:"operate"},{default:e.withCtx(()=>[e.createElementVNode("div",$n,[e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,f=>(e.openBlock(),e.createBlock(e.unref(b.ElCol),{key:f.name,span:8},{default:e.withCtx(()=>{var i,a;return[e.createElementVNode("div",Dn,[e.createElementVNode("div",Ln,[(i=f.props)!=null&&i.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent((a=f.props)==null?void 0:a.component),{key:1,size:24})):(e.openBlock(),e.createBlock(le,{key:0,size:24,name:f.name},null,8,["name"]))]),e.createElementVNode("p",Mn,e.toDisplayString(y(f)),1),e.createVNode(e.unref(b.ElSwitch),{modelValue:f.show,"onUpdate:modelValue":d=>f.show=d,"active-text":"","inactive-text":""},null,8,["modelValue","onUpdate:modelValue"])])]}),_:2},1024))),128))]),_:1})])]),_:1},8,["label"]),e.createVNode(e.unref(b.ElTabPane),{label:e.unref(t)("其他设置"),name:"other"},{default:e.withCtx(()=>[e.createElementVNode("div",Pn,[e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",Rn,[e.createElementVNode("p",In,e.toDisplayString(e.unref(t)("工具列表显示切换"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(m),"onUpdate:modelValue":w[0]||(w[0]=f=>e.isRef(m)?m.value=f:null),"inactive-text":e.unref(t)("隐藏"),"active-text":e.unref(t)("显示"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1}),e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",An,[e.createElementVNode("p",Fn,e.toDisplayString(e.unref(t)("小键盘显示切换"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(p),"onUpdate:modelValue":w[1]||(w[1]=f=>e.isRef(p)?p.value=f:null),"inactive-text":e.unref(t)("隐藏"),"active-text":e.unref(t)("显示"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",Hn,[e.createElementVNode("p",Un,e.toDisplayString(e.unref(t)("默认开启AI分析"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(N),"onUpdate:modelValue":w[2]||(w[2]=f=>e.isRef(N)?N.value=f:null),"inactive-text":e.unref(t)("禁用"),"active-text":e.unref(t)("启用"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1}),e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",jn,[e.createElementVNode("p",On,e.toDisplayString(e.unref(t)("水印文字"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(g),"onUpdate:modelValue":w[3]||(w[3]=f=>e.isRef(g)?g.value=f:null),"inactive-text":e.unref(t)("禁用"),"active-text":e.unref(t)("启用"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",qn,[e.createElementVNode("p",Kn,e.toDisplayString(e.unref(t)("截图本地下载"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(r).screenshotLocally,"onUpdate:modelValue":w[4]||(w[4]=f=>e.unref(r).screenshotLocally=f),"inactive-text":e.unref(t)("禁用"),"active-text":e.unref(t)("启用"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1}),e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",Wn,[e.createElementVNode("p",Gn,e.toDisplayString(e.unref(t)("截图包含标注"))+": ",1),e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(r).screenshotIncludeAnnotations,"onUpdate:modelValue":w[5]||(w[5]=f=>e.unref(r).screenshotIncludeAnnotations=f),"inactive-text":e.unref(t)("否"),"active-text":e.unref(t)("是"),class:"margin-r-2"},null,8,["modelValue","inactive-text","active-text"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:11},{default:e.withCtx(()=>[e.createElementVNode("div",Yn,[e.createElementVNode("p",Zn,e.toDisplayString(e.unref(t)("下载图片格式设置"))+": ",1),e.createVNode(e.unref(b.ElRadioGroup),{modelValue:e.unref(r).screenshotFormat,"onUpdate:modelValue":w[6]||(w[6]=f=>e.unref(r).screenshotFormat=f)},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElRadio),{value:"image/png"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("PNG")),1)]),_:1}),e.createVNode(e.unref(b.ElRadio),{value:"image/jpeg"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("JPG")),1)]),_:1})]),_:1},8,["modelValue"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:20},{default:e.withCtx(()=>[e.createElementVNode("div",Xn,[e.createElementVNode("p",Jn,e.toDisplayString(e.unref(t)("截图水印"))+": ",1),e.createVNode(e.unref(b.ElCheckbox),{modelValue:e.unref(r).screenshotWatermark.time,"onUpdate:modelValue":w[7]||(w[7]=f=>e.unref(r).screenshotWatermark.time=f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("时间")),1)]),_:1},8,["modelValue"]),e.createVNode(e.unref(b.ElCheckbox),{modelValue:e.unref(r).screenshotWatermark.mac,"onUpdate:modelValue":w[8]||(w[8]=f=>e.unref(r).screenshotWatermark.mac=f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("设备编码")),1)]),_:1},8,["modelValue"]),e.createVNode(e.unref(b.ElCheckbox),{modelValue:e.unref(r).screenshotWatermark.scale,"onUpdate:modelValue":w[9]||(w[9]=f=>e.unref(r).screenshotWatermark.scale=f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("放大倍数")),1)]),_:1},8,["modelValue"]),e.createVNode(e.unref(b.ElCheckbox),{modelValue:e.unref(r).screenshotWatermark.ratio,"onUpdate:modelValue":w[10]||(w[10]=f=>e.unref(r).screenshotWatermark.ratio=f)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("比例尺")),1)]),_:1},8,["modelValue"])])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:20},{default:e.withCtx(()=>[e.createElementVNode("div",Qn,[e.createElementVNode("p",eo,e.toDisplayString(e.unref(t)("标签显示时间"))+": ",1),e.createVNode(e.unref(b.ElInput),{type:"number",modelValue:e.unref(r).labelDisplayDuration,"onUpdate:modelValue":w[11]||(w[11]=f=>e.unref(r).labelDisplayDuration=f),modelModifiers:{number:!0},min:0,style:{width:"150px"}},{append:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("秒")),1)]),_:1},8,["modelValue"]),e.createElementVNode("span",to,e.toDisplayString(e.unref(t)("0表示不自动关闭")),1)])]),_:1})]),_:1}),e.createVNode(e.unref(b.ElRow),{gutter:10},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElCol),{span:20},{default:e.withCtx(()=>[e.createElementVNode("div",no,[e.createElementVNode("p",oo,e.toDisplayString(e.unref(t)("截图初始化大小"))+": ",1),e.createElementVNode("div",null,[e.createVNode(e.unref(b.ElInput),{type:"number",modelValue:e.unref(r).screenshotSize.w,"onUpdate:modelValue":w[12]||(w[12]=f=>e.unref(r).screenshotSize.w=f),style:{width:"150px"}},{prepend:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("宽")),1)]),_:1},8,["modelValue"]),e.createVNode(e.unref(b.ElInput),{type:"number",modelValue:e.unref(r).screenshotSize.h,"onUpdate:modelValue":w[13]||(w[13]=f=>e.unref(r).screenshotSize.h=f),style:{width:"150px","margin-left":"24px"}},{prepend:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("高")),1)]),_:1},8,["modelValue"])])])]),_:1})]),_:1})])]),_:1},8,["label"])]),_:1},8,["modelValue"])]))}}),ao={class:"hzzt-kfb-toolbox"},ro={class:"hzzt-kfb-toolbox__component"},Le=e.defineComponent({name:"KfbToolbox",__name:"KfbToolbox",props:{menu:{},process:{},microscope:{},divideMode:{type:Boolean}},emits:["tool"],setup(n,{emit:o}){const t=n,l=o,{t:c}=me(),s={prev:c("上一张"),next:c("下一张"),config:c("配置"),info:c("信息"),flip:c("镜像"),tailor:c("区域截图"),fulltailor:c("全屏截图")},u=e.inject("kfbViewRef"),p=e.ref(!1),g=e.ref([]),m={fullscreen:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./fullscreen9MksDRTj.js"))),line:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./linej48TZYKp.js"))),setting:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./settingD62IUtKU.js"))),rotate:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./rotateDTWjJwsV.js"))),dot:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./dotC60HsnQC.js"))),annotate:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./annotateCEdf17JQ.js"))),process:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./processBts7MflP.js"))),microscope:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./microscopeCrL6eo86.js"))),move:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./moveDIVhruOl.js"))),custom:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./customBzNUnI1_.js"))),zoom:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./zoomCBwLbhKZ.js"))),download:e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./downloadQG7ZwYfQ.js")))},N=e.computed(()=>g.value.filter(y=>y.show!==!1).map(y=>({component:m[y.name],props:y.props,slots:y.slots})));e.watch(()=>[t.menu],([y])=>{g.value=r(y)},{immediate:!0});function r(y){return y.map(v=>{var f,i;const w=typeof v=="string"?v:v.name;return s[w]?{name:"custom",show:typeof v=="string"?!0:v.show!==!1,props:se(Y({text:s[w],component:e.h(le,{name:w})},typeof v=="string"?{}:v.props),{name:w})}:w=="custom"&&!s[w]&&typeof v!="string"?{name:"custom",show:typeof v=="string"?!0:v.show!==!1,props:se(Y({},typeof v=="string"?{}:v.props),{component:e.h(le,{name:(f=v.props)==null?void 0:f.name,component:(i=v.props)==null?void 0:i.component})}),slots:typeof v=="string"?void 0:v.slots}:w==="process"?{name:w,props:typeof v=="string"?{process:t.process}:Y({process:t.process},v.props),slots:typeof v=="string"?void 0:v.slots,show:typeof v=="string"?!0:v.show!==!1}:w==="microscope"?{name:w,props:typeof v=="string"?{process:t.process}:Y({microscope:t.microscope},v.props),slots:typeof v=="string"?void 0:v.slots,show:typeof v=="string"?!0:v.show!==!1}:{name:w,props:typeof v=="string"?{}:v.props,slots:typeof v=="string"?void 0:v.slots,show:typeof v=="string"?!0:v.show!==!1}})}function k(y,v){const w={annotate:()=>u.value.startDraw(v),process:()=>u.value.forceRedraw(v),microscope:()=>u.value.scopeChange(v),move:()=>u.value.fastMove(v),endDraw:()=>u.value.endDraw(),info:()=>u.value.info(),zoom:()=>u.value.zoomTo(v),flip:()=>u.value.toggleFlip(v),config:()=>p.value=!0,grid:()=>u.value.updateGrid(v),ruler:()=>u.value.updateGrid(v),graduation:()=>u.value.updateGraduation(v),navigator:()=>u.value.updateNavigator(v),tool:()=>{u.value.updateGrid({show:v}),u.value.updateGraduation({show:v}),u.value.updateGrid({ruler:v}),u.value.updateNavigator(v)}};w[y]?w[y]():l("tool",y,v)}return(y,v)=>(e.openBlock(),e.createElementBlock("div",ao,[e.renderSlot(y.$slots,"left"),e.createElementVNode("div",ro,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(w,f)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(w.component),e.mergeProps({ref_for:!0},w.props,{key:f,onTool:k}),{default:e.withCtx(()=>[w.slots?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(w.slots,i=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i)))),256)):e.createCommentVNode("",!0)]),_:2},1040))),128))]),e.renderSlot(y.$slots,"right"),e.createVNode(e.unref(b.ElDialog),{modelValue:p.value,"onUpdate:modelValue":v[1]||(v[1]=w=>p.value=w),top:"5vh",width:"800px",title:e.unref(c)("用户偏好配置")},{default:e.withCtx(()=>[e.createVNode(lo,{menus:g.value,"onUpdate:menus":v[0]||(v[0]=w=>g.value=w)},null,8,["menus"])]),_:1},8,["modelValue","title"])]))}}),Ve="data:image/svg+xml,%3csvg%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3e%3cpath%20d='M556.45%20126.8H904.7c31.31%200%2056.26%2025.47%2057.3%2056.78v656.85c-0.68%2031.26-26.03%2056.35-57.3%2056.72H617.28l74.32-291.24-77.38-56.14%2032.3-27.32c8.28-6.66%2015.51-11.46%2025.7-11.46%209.96%200.24%2019.33%204.77%2025.7%2012.45h-0.06l198.87%20214.09-0.58-522.46c-0.75-13.7-12.21-24.35-25.93-24.08H542.45l14-64.19z%20m-118.47%200l-14.01%2064.24H152.41c-13.6%200-24.31%209.84-26.22%2023.44v522.63l242.33-292.28-13.08%2060.14%20204.6%20148.46-62.22%20243.77H118.15a56.398%2056.398%200%200%201-39.86-16.73A56.35%2056.35%200%200%201%2062%20840.43V183.57c0-31.25%2024.89-56.72%2056.14-56.72h319.83v-0.05z%20m203.67%20224.68c-0.86-34.98%2017.31-67.68%2047.47-85.42%2030.16-17.74%2067.56-17.74%2097.73%200%2030.16%2017.74%2048.33%2050.44%2047.47%2085.42%200%2053.22-43.15%2096.37-96.37%2096.37-53.22%200-96.37-43.14-96.37-96.37h0.07z%20m0%200'%20fill='%23ffffff'%3e%3c/path%3e%3c/svg%3e",Ue={shape:"50%",width:.3,color:"#FA0404",borderWidth:5},ct={r:0,g:0,b:0,c:0,s:0,l:0,ga:1};function io(n){const o=e.reactive(Y(Y({},ct),n.process));e.watch(()=>n.process,s=>{c(s)});const t=e.computed(()=>{const s=[1+o.r+o.l+.5*o.c,0,0,0,-.25*o.c],u=[0,1+o.g+o.l+.5*o.c,0,0,-.25*o.c],p=[0,0,1+o.b+o.l+.5*o.c,0,-.25*o.c],g=[0,0,0,1,0];return`${s.join(" ")}
2
+ ${u.join(" ")}
3
+ ${p.join(" ")}
4
+ ${g.join(" ")}`}),l=e.computed(()=>String(1+o.s));function c(s){s&&Object.assign(o,s)}return{imageProcess:o,matrixValues:t,saturateValues:l,forceRedraw:c}}function so(n,o,t,l,c,s){const u=e.inject("menu-config-other-setting",{screenshotLocally:!1,screenshotIncludeAnnotations:!0,screenshotFormat:"image/jpeg",screenshotWatermark:{time:!1,mac:!1,scale:!1,ratio:!1},screenshotSize:{w:200,h:200},labelDisplayDuration:15});function p(){t.value.$on(ne.KfbView.events.EVENT_TAILORING_SCREENSHOT,g)}function g({base64:i}){const a=Dt().format("YYYY_MM_DD_hh_mm_ss"),d=new Image;d.src=i,d.onload=()=>{const S=document.createElement("canvas"),B=S.getContext("2d");S.width=d.width,S.height=d.height,B&&(B.drawImage(d,0,0,d.width,d.height),f(B,S,a));const P=S.toDataURL(u.screenshotFormat);u.screenshotLocally&&v(P,y()),n("tool","screen-shot",{imgUrl:P,timeStr:a,format:u.screenshotFormat})}}function m(i,a){var W,I;const d=window.devicePixelRatio||1,{width:S,height:B}=t.value.$options,P=S>B?(S-B)/2:0,L=S>B?0:(B-S)/2,H=S>B?B:S;if(i==="fulltailor"&&!a.value)t.value.tailoring.init({left:P,top:L,height:H,width:H,now:!0,shape:(W=u.screenshotIncludeAnnotations)!=null?W:!0});else if(i==="fulltailor"&&a.value.length>1){const Z=[];a.value.forEach(_=>{const C=document.createElement("canvas");C.width=H,C.height=H;const D=C.getContext("2d");D&&(D.fillStyle="#FFFFFF",D.fillRect(0,0,C.width,C.height));const V=_.kfbView.viewer.drawer.canvas;D==null||D.drawImage(V,P*d,L*d,H*d,H*d,0,0,H,H);const x=C.toDataURL();C.remove(),Z.push(x)});const j=document.createElement("canvas"),G=[],E=[];for(let _=0;_<Z.length;_++){const C=new Image;G.push(C);const D=new Promise((V,x)=>{C.onload=()=>{V()},C.onerror=x,C.src=Z[_]});E.push(D)}Promise.all(E).then(()=>{const _=G.length>4?3:2,C=N(G,_),D=H*_;j.width=D,j.height=D;const V=j.getContext("2d");V&&(V.fillStyle="#FFFFFF",V.fillRect(0,0,j.width,j.height));const x=G.length===2||G.length>=5&&G.length<=6,$=C.length*H,A=x?(j.height-$)/2:0;C.forEach((M,T)=>{M.forEach((F,O)=>{const ae=O*H,ke=A+T*H;V==null||V.drawImage(F,ae,ke,H,H)})});const U=Dt().format("YYYY_MM_DD_hh_mm_ss");V&&f(V,j,U);const Q=j.toDataURL(u.screenshotFormat);u.screenshotLocally&&v(Q,y()),n("tool","screen-shot",{imgUrl:Q,timeStr:U,format:u.screenshotFormat}),j.remove()})}else{const Z=Number(u.screenshotSize.w)/1,j=Number(u.screenshotSize.h)/1;t.value.tailoring.init({left:S/2-Z/2,top:B/2-j/2,height:j,width:Z,color:"#ff0000",contents:[o("双击区域内表示完成截图"),o("双击区域外或按ESC表示取消截图"),(G,E)=>`${o("区域大小为")}${G}*${E},${o("可拉动缩放")}`],shape:(I=u.screenshotIncludeAnnotations)!=null?I:!0})}}function N(i,a){const d=[];for(let S=0;S<i.length;S+=a)d.push(i.slice(S,S+a));return d}function r(i){const a=(i||"").toLowerCase();return a.includes("png")?"png":a.includes("webp")?"webp":a.includes("bmp")?"bmp":a.includes("gif")?"gif":"jpg"}function k(i){return String(i!=null?i:"").trim().replace(/[\\/:*?"<>|]/g,"_").replace(/\s+/g,"")}function y(){var B,P;const i=k((B=s.value)==null?void 0:B.pathology_number)||o("未知病理号"),a=k((P=s.value)==null?void 0:P.paraffin_block_number)||o("未知蜡块号"),d=`${l.value}x`,S=r(u.screenshotFormat);return`${i}-${a}-${d}.${S}`}function v(i,a){const d=document.createElement("a");d.href=i,d.download=a,d.style.display="none",document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(d.href)}function w(i){if(t.value.area){const a=t.value.area.imageToViewerElementCoordinates(0,0),d=t.value.area.imageToViewerElementCoordinates(i,0);return Math.abs(d.x-a.x)}return 0}function f(i,a,d){var S,B,P,L,H;if(i.font="16px Arial",i.fillStyle="rgba(0, 0, 0, 0.9)",i.textAlign="left",u.screenshotWatermark.mac){const W=(P=(B=(S=c.value)==null?void 0:S.ext)==null?void 0:B.machineNum)!=null?P:"未知设备号";i.fillText(W,5,15)}if(u.screenshotWatermark.time&&i.fillText(d,a.width-180,15),u.screenshotWatermark.scale&&i.fillText(`${l.value}x`,5,a.height-10),u.screenshotWatermark.ratio){const W=[.1,.4,.6,1,2,4,8,10,20,40,60,100,140,200],I=[5e3,2e3,1250,1e3,500,250,200,100,50,25,20,10,5,2],Z=W.findIndex($=>$>=l.value);let j=8,G="";~Z?(G=I[Z].toString(),j=w(I[Z]/(((H=c.value)==null?void 0:H.scanResolution)||1))):(G=I[I.length-1].toString(),j=w(I[I.length-1]/(((L=c.value)==null?void 0:L.scanResolution)||1))),i.beginPath();const E=a.width,_=a.height,C=E-10-j,D=_-24;i.beginPath(),i.strokeStyle="#000000",i.lineWidth=3,i.moveTo(C,D-8),i.lineTo(C,D),i.lineTo(C+j,D),i.lineTo(C+j,D-8),i.stroke(),i.beginPath(),i.fillStyle="#000000",i.font="bold 12px Arial";const V=parseFloat(G).toFixed(0)+"um",x=i.measureText(V).width;i.fillText(V,C+j/2-x/2,a.height-5)}}return{tailorEvent:p,shotScreen:m}}const uo=["onClick"],co=["src"],fo={key:2,style:{width:"18px"},class:"margin-r-3"},mo={key:1,class:"hzzt-kfb-sub-menu"},vo=["onClick"],po={class:"flex align-items-center"},ho=["src"],go={key:2,style:{width:"18px"},class:"margin-r-2"},wo=e.defineComponent({__name:"KfbMenu",props:{menus:{}},emits:["tool"],setup(n,{emit:o}){const t=e.ref({top:"0",left:"0",display:"none"}),l=e.inject("kfbView",e.ref({})),c=e.inject("currentLabel"),s=n,u=o,p=e.inject("is-count-drawing",void 0),g=e.inject("end-count-draw",void 0),{t:m}=me(),N=[{label:m("测量"),value:"Measure",icon:ee.value.markMeasure},{label:m("直线"),value:"line",icon:ee.value.markLine},{label:m("箭头"),value:"arrow",icon:ee.value.markArrow},{label:m("双箭头"),value:"bilateral",icon:ee.value.markBilateral},{label:m("矩形"),value:"rectangle",icon:ee.value.markRectangle},{label:m("圆形"),value:"ellipse",icon:ee.value.markEllipse},{label:m("曲线"),value:"polygon",icon:ee.value.markPolygon},{label:m("星星"),value:"star",icon:ee.value.markStar},{label:m("旗帜"),value:"flag",icon:ee.value.markFlag},{label:m("点"),value:"dot",icon:ee.value.markDot},{label:m("文字"),value:"font",icon:ee.value.markFont},{label:m("语音"),value:"voice",icon:ee.value.markVoice}],r=e.computed(()=>{var f;return c!=null&&c.value?[{label:m("删除"),value:"delete",icon:ee.value.delete}]:(f=s.menus)!=null&&f.length?s.menus.map(i=>i.value==="annotate"?se(Y({},i),{children:N,icon:ee.value.annotate}):se(Y({},i),{icon:i.icon||ee.value[i.value]})):[{label:m("上一张"),value:"prev",icon:ee.value.prev},{label:m("下一张"),value:"next",icon:ee.value.next},{label:m("标注"),value:"annotate",icon:ee.value.annotate,children:N},{label:m("区域截图"),value:"tailor",icon:ee.value.tailor},{label:m("全屏截图"),value:"fulltailor",icon:ee.value.fulltailor},{label:m("镜像翻转"),value:"flip",icon:ee.value.flip},{label:m("切片信息"),value:"info",icon:ee.value.info}]});e.watch(()=>l.value,(f,i)=>{i!=null&&i.viewer&&(i.viewer.removeHandler("canvas-contextmenu",k),i.viewer.removeHandler("canvas-click",y)),f!=null&&f.viewer&&(f.viewer.addHandler("canvas-contextmenu",k),f.viewer.addHandler("canvas-click",y))}),e.onMounted(()=>{var f;(f=l.value)!=null&&f.viewer&&(l.value.viewer.addHandler("canvas-contextmenu",k),l.value.viewer.addHandler("canvas-click",y)),document.body.addEventListener("click",y)}),e.onBeforeUnmount(()=>{var f;(f=l.value)!=null&&f.viewer&&(l.value.viewer.removeHandler("canvas-contextmenu",k),l.value.viewer.removeHandler("canvas-click",y)),document.body.removeEventListener("click",y)});function k(f){if(f.preventDefault=!0,p!=null&&p.value){g==null||g(),u("tool","count-draw-end"),y();return}t.value.top=`${f.position.y}px`,t.value.left=`${f.position.x}px`,t.value.display==="block"?t.value.display="none":t.value.display="block"}function y(){t.value.display="none"}function v(f,i){f.children||((i==null?void 0:i.value)==="annotate"?u("tool","annotate",{tool:f.value.substring(0,1).toLocaleUpperCase()+f.value.substring(1),once:!0}):u("tool",f.value),y())}function w(f){return f==null||typeof f!="object"&&typeof f!="function"?!1:typeof f=="function"||"render"in f||"setup"in f}return(f,i)=>(e.openBlock(),e.createElementBlock("div",{class:"hzzt-kfb-menu",style:e.normalizeStyle(t.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(a,d)=>(e.openBlock(),e.createElementBlock("div",{key:d,class:"hzzt-kfb-menu-item"},[e.createElementVNode("div",{class:"flex align-items-center",onClick:S=>v(a)},[w(a.icon)?(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:0,class:"margin-r-3",size:18},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.icon)))]),_:2},1024)):a.icon?(e.openBlock(),e.createElementBlock("img",{key:1,style:{width:"18px"},class:"margin-r-2",src:a.icon},null,8,co)):(e.openBlock(),e.createElementBlock("div",fo)),e.createElementVNode("span",null,e.toDisplayString(a.label),1)],8,uo),a.children?(e.openBlock(),e.createBlock(le,{key:0,name:"arrowRight",class:"margin-r-2",size:14})):e.createCommentVNode("",!0),a.children?(e.openBlock(),e.createElementBlock("div",mo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.children,(S,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"hzzt-kfb-menu-item",onClick:P=>v(S,a)},[e.createElementVNode("div",po,[w(S.icon)?(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:0,class:"margin-r-2",size:18},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(S.icon)))]),_:2},1024)):S.icon?(e.openBlock(),e.createElementBlock("img",{key:1,style:{width:"18px"},class:"margin-r-2",src:S.icon},null,8,ho)):(e.openBlock(),e.createElementBlock("div",go)),e.createElementVNode("span",null,e.toDisplayString(S.label),1)])],8,vo))),128))])):e.createCommentVNode("",!0)]))),128))],4))}}),ye=(n,o)=>{const t=n.__vccOpts||n;for(const[l,c]of o)t[l]=c;return t},yo=ye(wo,[["__scopeId","data-v-a80d92ce"]]),_o={key:0,class:"hzzt-kfb-microscope"},ko=e.defineComponent({__name:"KfbMicroscope",props:e.mergeDefaults({shape:{},width:{},color:{},borderWidth:{}},Y({},Ue)),setup(n,{expose:o}){const t=n,l=e.reactive(Y(Y({},Ue),t));e.watch(()=>t,r=>{N({name:"change",value:r})});const c=e.ref("200px"),s=e.ref(!1),u=e.computed(()=>({borderRadius:l.shape,borderColor:l.color,borderWidth:l.borderWidth+"px",width:c.value,height:c.value})),p=e.inject("kfbView",e.ref({}));e.watch(()=>p.value,(r,k)=>{k!=null&&k.viewer&&k.viewer.removeHandler("zoom",g),r!=null&&r.viewer&&r.viewer.addHandler("zoom",g)}),e.onMounted(()=>{var r;(r=p.value)!=null&&r.viewer&&p.value.viewer.addHandler("zoom",g)}),e.onBeforeUnmount(()=>{var r;(r=p.value)!=null&&r.viewer&&p.value.viewer.removeHandler("zoom",g)});function g(){setTimeout(()=>{N({name:"change",value:l})},100)}function m(r){let{x:k,y}=p.value.viewer.viewport.getCenter(!0);r==="top"?y-=.006:r==="bottom"?y+=.006:r==="left"?k-=.006:r==="right"&&(k+=.006),p.value.area.moveToLabel({x:k,y})}function N({name:r,value:k}){var v,w;const y=(w=(v=p.value.$options)==null?void 0:v.pxConversion)==null?void 0:w.imageCapRes;if(r==="visible"){if(s.value=k,k){const f=p.value.area.imageToViewerElementRectangle({x:0,y:0,width:l.width*1e3/y,height:l.width*1e3/y});c.value=f.width+"px"}}else if(r==="change"){Object.assign(l,k);const f=p.value.area.imageToViewerElementRectangle({x:0,y:0,width:l.width*1e3/y,height:l.width*1e3/y});c.value=f.width+"px"}}return o({scopeChange:N}),(r,k)=>s.value?(e.openBlock(),e.createElementBlock("div",_o,[e.createElementVNode("div",{class:"hzzt-kfb-microscope__container",style:e.normalizeStyle(u.value)},null,4),e.createElementVNode("div",{class:"hzzt-kfb-microscope__top",onClick:k[0]||(k[0]=y=>m("top"))},[e.createVNode(le,{size:"24",name:"arrowUp"})]),e.createElementVNode("div",{class:"hzzt-kfb-microscope__bottom",onClick:k[1]||(k[1]=y=>m("bottom"))},[e.createVNode(le,{size:"24",name:"arrowDown"})]),e.createElementVNode("div",{class:"hzzt-kfb-microscope__left",onClick:k[2]||(k[2]=y=>m("left"))},[e.createVNode(le,{size:"24",name:"arrowLeft"})]),e.createElementVNode("div",{class:"hzzt-kfb-microscope__right",onClick:k[3]||(k[3]=y=>m("right"))},[e.createVNode(le,{size:"24",name:"arrowRight"})])])):e.createCommentVNode("",!0)}}),Co=ye(ko,[["__scopeId","data-v-cf5949b8"]]),Vo={class:"hzzt-kfb-label flex column"},bo={class:"hzzt-kfb-label__header"},Eo={class:"hzzt-kfb-label__hint"},xo=["src"],No={class:"ellipsis flex-1"},zo={class:"hzzt-kfb-label__dialog-imgs"},So={class:"hzzt-kfb-label__dialog-cell hzzt-kfb-label__dialog-cell--label"},To=["src"],Bo={class:"hzzt-kfb-label__dialog-cell hzzt-kfb-label__dialog-cell--preview"},$o=["src"],Do=e.defineComponent({__name:"KfbLabel",props:{visible:{type:Boolean},info:{},slide:{},pathologyHandle:{type:Function}},emits:["tool"],setup(n,{emit:o}){var f;const{t}=me(),l=n,c=o,s=e.ref((f=l.visible)!=null?f:!0),u=e.ref(!1);e.watch(()=>l.visible,i=>{i!==void 0&&(s.value=i)});const p=e.inject("menu-config-other-setting",{screenshotLocally:!1,screenshotIncludeAnnotations:!0,screenshotFormat:"image/jpeg",screenshotWatermark:{time:!1,mac:!1,scale:!1,ratio:!1},screenshotSize:{w:200,h:200},labelDisplayDuration:15});let g;function m(){g!==void 0&&(clearTimeout(g),g=void 0)}function N(){var a;m();const i=Number((a=p.labelDisplayDuration)!=null?a:15);!i||i<=0||!s.value||(g=setTimeout(()=>{s.value=!1,g=void 0},i*1e3))}e.watch(s,i=>{i?N():m()},{immediate:!0}),e.watch(()=>p.labelDisplayDuration,()=>{s.value&&N()}),e.watch(()=>{var i;return(i=l.slide)==null?void 0:i.file},()=>{s.value&&N()}),e.onUnmounted(m);const r=e.computed(()=>l.slide.pathology_id?t("修改病理号"):t("绑定病理号")),k=e.computed(()=>t(`点击标签旋转${l.pathologyHandle?",点击病理号重绑":""}`));function y(){l.slide.angle||(l.slide.angle=0),l.slide.angle+=90,l.slide.angle>360&&(l.slide.angle=l.slide.angle%360),c("tool","rotate",l.slide.angle)}function v(){u.value=!0}function w(){l.pathologyHandle&&l.pathologyHandle(l.slide).then(()=>{u.value=!1})}return(i,a)=>(e.openBlock(),e.createElementBlock("div",Vo,[e.withDirectives(e.createElementVNode("div",bo,[e.createVNode(e.unref(b.ElTooltip),{effect:"dark",placement:"right",content:k.value},{default:e.withCtx(()=>[e.createElementVNode("span",Eo,[e.createVNode(le,{size:"14",name:"info"})])]),_:1},8,["content"])],512),[[e.vShow,s.value]]),e.withDirectives(e.createElementVNode("div",{class:"hzzt-kfb-label__img flex justify-content-center align-items-center",onClick:y},[e.createElementVNode("img",{src:i.info.labelImg,style:e.normalizeStyle({transform:`rotate(${i.slide.angle}deg)`})},null,12,xo)],512),[[e.vShow,s.value]]),i.pathologyHandle?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,class:"hzzt-kfb-label__pathology flex align-items-center justify-content-between",onClick:v},[e.createElementVNode("span",No,e.toDisplayString(i.slide.pathology_number),1),e.createVNode(le,{size:"14",name:"annotate"})],512)),[[e.vShow,s.value]]):e.createCommentVNode("",!0),e.createElementVNode("span",{onClick:a[0]||(a[0]=d=>s.value=!s.value),style:e.normalizeStyle({transform:`translateY(${s.value?"-50%":0})`}),class:"hzzt-kfb-label__expend flex align-items-center justify-content-center"},[s.value?(e.openBlock(),e.createBlock(le,{key:0,size:"10",name:"arrowLeft"})):(e.openBlock(),e.createBlock(le,{key:1,size:"10",name:"arrowRight"}))],4),e.createVNode(e.unref(b.ElDialog),{modelValue:u.value,"onUpdate:modelValue":a[5]||(a[5]=d=>u.value=d),"append-to-body":!0,title:r.value,width:"450px",class:"hzzt-kfb-label-dialog"},{footer:e.withCtx(()=>[e.createVNode(e.unref(b.ElButton),{onClick:a[4]||(a[4]=d=>u.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("取消")),1)]),_:1}),e.createVNode(e.unref(b.ElButton),{type:"primary",onClick:w},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("确认")),1)]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",zo,[e.createElementVNode("div",So,[e.createElementVNode("img",{src:i.slide.labelImg,style:e.normalizeStyle({transform:`rotate(${i.slide.angle||0}deg)`})},null,12,To)]),e.createElementVNode("div",Bo,[e.createElementVNode("img",{src:i.slide.previewImg},null,8,$o)])]),e.createVNode(e.unref(b.ElForm),{class:"margin-t-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElFormItem),{label:e.unref(t)("病理号")},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElInput),{modelValue:i.slide.pathology_number,"onUpdate:modelValue":a[1]||(a[1]=d=>i.slide.pathology_number=d),placeholder:e.unref(t)("输入病理号"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(t)("蜡块号")},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElInput),{modelValue:i.slide.paraffin_block_number,"onUpdate:modelValue":a[2]||(a[2]=d=>i.slide.paraffin_block_number=d),placeholder:e.unref(t)("输入蜡块号"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),i.slide.slide_id?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(b.ElFormItem),{key:0,label:e.unref(t)("试剂")},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElInput),{modelValue:i.slide.reagent,"onUpdate:modelValue":a[3]||(a[3]=d=>i.slide.reagent=d),placeholder:e.unref(t)("输入试剂"),clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]))]),_:1})]),_:1},8,["modelValue","title"])]))}}),Lo=ye(Do,[["__scopeId","data-v-8dcb5a3c"]]);function Mo(n,o){const t=e.ref(1),l=e.ref(null),c=e.ref(null);function s(){n.value.viewer.addHandler("canvas-drag",p=>{l.value||(l.value=p.position)}),n.value.viewer.addHandler("canvas-drag-end",p=>{if(t.value!==1){c.value=p.position;const g=n.value.viewer.viewport.containerSize.x,m=n.value.viewer.viewport.containerSize.y,N=(c.value.x-l.value.x)/(g*o.value)*(t.value-1),r=(c.value.y-l.value.y)/(m*o.value)*(t.value-1),k=n.value.viewer.viewport.getCenter(),y=new ne.OpenSeadragon.Point(k.x-N,k.y-r);n.value.viewer.viewport.panTo(y),l.value=null}})}function u({name:p,value:g}){p==="ratio"&&(t.value=g/1)}return{moveEvent:s,fastMove:u}}const Po=22,Ne="rgba(0,0,0,0)",Me="countColor",$e="countDotKey",je={measure:!1,lineWidth:1,fillStyle:Ne,strokeStyle:Ne};function Ro(n){return se(Y({tool:"Dot",once:!1,clear:!0,custom:!0,subType:"count"},je),{__other__:{[Me]:n},__data__:se(Y({},je),{subType:"count",custom:!0,__other__:{[Me]:n}})})}function Io(n){var o,t;return!!((t=n==null?void 0:n.custom)!=null?t:(o=n==null?void 0:n.__data__)!=null&&o.custom)}function Ft(n){var o,t;return(t=n==null?void 0:n.subType)!=null?t:(o=n==null?void 0:n.__data__)==null?void 0:o.subType}function ze(n){const o=n==null?void 0:n[Me];return typeof o=="string"&&o!==Ne?o:void 0}function Ht(n){var t,l,c;const o=[n==null?void 0:n.strokeStyle,(t=n==null?void 0:n.__data__)==null?void 0:t.strokeStyle,(c=(l=n==null?void 0:n.__data__)==null?void 0:l.__data__)==null?void 0:c.strokeStyle];for(const s of o)if(s&&s!==Ne)return s}function Oe(n){var o,t,l,c,s,u,p;return Ke(n)?(c=(l=(t=ze(n==null?void 0:n.__other__))!=null?t:ze((o=n==null?void 0:n.__data__)==null?void 0:o.__other__))!=null?l:Ht(n))!=null?c:"":(p=(u=n==null?void 0:n.strokeStyle)!=null?u:(s=n==null?void 0:n.__data__)==null?void 0:s.strokeStyle)!=null?p:""}function Ao(n){var o,t,l,c;return(c=(l=(t=ze(n==null?void 0:n.__other__))!=null?t:ze((o=n==null?void 0:n.__data__)==null?void 0:o.__other__))!=null?l:Ht(n))!=null?c:"#004BFF"}function Ke(n){return Ft(n)==="count"}function xe(n){var o;return n?Ke(n)?!0:!!(ze(n.__other__)||ze((o=n.__data__)==null?void 0:o.__other__)):!1}let lt=0;function Fo(){return lt=(lt+1)%1e5,Date.now()*1e5+lt}function Ho(){return`cd-${Date.now()}-${Math.random().toString(36).slice(2,11)}`}function pe(n){var t,l,c,s;if(!n)return;const o=[(t=n.__other__)==null?void 0:t[$e],(c=(l=n.__data__)==null?void 0:l.__other__)==null?void 0:c[$e],(s=n.__data__)==null?void 0:s[$e]];for(const u of o)if(typeof u=="string"&&u)return u}function it(n){var l,c;const o=new Set,t=[];for(const s of n){const u=(c=pe(s))!=null?c:`id:${(l=s.id)!=null?l:""}`;o.has(u)||(o.add(u),t.push(s))}return t}function Ut(n,o){const t=pe(n),l=pe(o);if(t&&l&&t===l||n.id!=null&&o.id!=null&&n.id===o.id)return!0;const c=Pe(n),s=Pe(o);return!c||!s?!1:Math.hypot(c.x-s.x,c.y-s.y)<.5}function Lt(n,o){if(!n.length)return-1;const t=pe(o);if(t){const l=n.findIndex(c=>pe(c)===t);if(l>-1)return l}if(o.id!=null){const l=n.map((c,s)=>({item:c,index:s})).filter(({item:c})=>c.id===o.id).map(({index:c})=>c);if(l.length===1)return l[0];if(l.length>1){const c=Pe(o);if(!c)return l[0];let s=l[0],u=1/0;for(const p of l){const g=Pe(n[p]);if(!g)continue;const m=Math.hypot(g.x-c.x,g.y-c.y);m<u&&(u=m,s=p)}return s}}return n.findIndex(l=>Ut(l,o))}function Mt(n,o){return n?Ke(n)?!0:!!(o&&n.tool==="Dot"):!1}function Pe(n){var o;if((o=n.points)!=null&&o.length){const t=n.points[0];return{x:t.x,y:t.y}}return n.region&&n.region.width!=null&&n.region.height!=null?{x:n.region.x+n.region.width/2,y:n.region.y+n.region.height/2}:null}function Pt(n,o){var l;const t=Pe(o);return!t||!((l=n.area)!=null&&l.imageToViewerElementCoordinates)?null:n.area.imageToViewerElementCoordinates(t.x,t.y)}function Rt(n,o,t,l=Po){const c=Pt(t,n);if(c)return o.find(s=>{if(n.id!=null&&s.id===n.id)return!1;const u=Pt(t,s);return u?Math.hypot(u.x-c.x,u.y-c.y)<=l:!1})}function It(n,o=[]){var s;const t=Ao(n);let l=n.id;(l==null||o.some(u=>u.id===l))&&(l=Fo());let c=pe(n);return(!c||o.some(u=>pe(u)===c))&&(c=Ho()),se(Y(Y({},n),je),{id:l,tool:"Dot",subType:"count",custom:!0,__other__:se(Y({},n.__other__||{}),{[Me]:t,[$e]:c}),__data__:se(Y({},n.__data__||{}),{subType:"count",custom:!0,measure:!1,lineWidth:1,fillStyle:Ne,__other__:se(Y({},((s=n.__data__)==null?void 0:s.__other__)||{}),{[Me]:t,[$e]:c})})})}function Uo(n,o){const t=e.ref([]),l=e.ref(!1);let c=!1,s;e.watch(()=>{var f;return(f=n.slide)==null?void 0:f.file},()=>{t.value=[],l.value=!1,c=!1,s=void 0});function u(){requestAnimationFrame(()=>{const f=o.value.board;f!=null&&f.isInDraw&&f.endDraw&&f.endDraw()})}function p(){l.value=!1,c=!1,s=void 0}function g(){p(),u()}function m(f){l.value=!0,c=!1,s=void 0}function N(f){if(!l.value)return;const i=It(f,t.value),a=Rt(i,t.value,o.value);a&&(c=!0,s=a)}function r(f){if(c&&s){c=!1;const S=s;return s=void 0,p(),u(),{action:"selected",nearby:S}}const i=It(f,t.value),a=Rt(i,t.value,o.value);if(a)return p(),u(),{action:"selected",nearby:a};const d=Lt(t.value,i);return d>-1?{action:"selected",nearby:t.value[d]}:(t.value.push(i),t.value=it(t.value),{action:"added"})}function k(f){const i=Lt(t.value,f);return i>-1?(t.value=t.value.filter((a,d)=>d!==i),!0):!1}function y(f){const i=pe(f),a=o.value.labelList||[],d=new Set(a.filter(xe).map(B=>pe(B)).filter(B=>!!B)),S=new Set(a.map(B=>B.id).filter(B=>B!=null));t.value=t.value.filter(B=>{const P=pe(B);return i&&P===i||f.id!=null&&B.id===f.id?!1:P?d.has(P):B.id!=null?S.has(B.id):!0}),t.value=it(t.value)}function v(f){k(f),y(f)}function w(f){const i=f.id;t.value=t.value.map(a=>a.id!==i?a:se(Y({},a),{points:f.points,region:f.region}))}return{countLabelList:t,isCountDrawing:l,beginCountDraw:m,endCountDraw:g,clearCountDrawState:p,scheduleBoardEndDraw:u,onCountDotPress:N,handleCountAdd:r,handleCountDelete:v,handleCountMove:w,removeOneCountDot:k,isSameCountDot:Ut}}function jo(n,o,t,l,c){const s=e.ref(void 0),u=e.ref([]),p=e.ref([]);function g(E,_){var D,V;s.value&&(s.value.select=!1,s.value=void 0);const C=(t.value.labelList||[]).findIndex(x=>x.id===E.id);if(C>-1){s.value=(D=t.value.labelList)==null?void 0:D[C],s.value.select=!0;const x=t.value.area.getCenterPoint(E.region);t.value.area.moveToLabel(x),(V=t.value.viewer)!=null&&V.canvas&&t.value.viewer.canvas.focus(),G()}_&&c(_)}const{countLabelList:m,isCountDrawing:N,beginCountDraw:r,endCountDraw:k,clearCountDrawState:y,scheduleBoardEndDraw:v,onCountDotPress:w,handleCountAdd:f,handleCountDelete:i,handleCountMove:a}=Uo(n,t);e.watch(()=>n.aiLabelList,I);let d=!1;function S(E){const _=pe(E);u.value=u.value.filter(C=>!(_&&pe(C)===_||E.id!=null&&C.id===E.id))}function B(E){i(E),S(E),I(),queueMicrotask(()=>I())}function P(){t.value.$on(ne.KfbView.events.EVENT_INIT_COMPLETE,L("init-complete")),t.value.$on(ne.KfbView.events.EVENT_UPDATE_ZRENDER,L("update-zrender")),t.value.$on(ne.KfbView.events.EVENT_START_PAINTING,E=>{E&&Mt(E,N.value)&&w(E)}),t.value.$on(ne.KfbView.events.EVENT_END_PAINTING,L("add")),t.value.$on(ne.KfbView.events.EVENT_AREA_MOVE_END,L("move")),t.value.$on(ne.KfbView.events.EVENT_ADD_POLYGON_POINT,L("add-point")),t.value.$on(ne.KfbView.events.EVENT_DELETE_POLYGON_POINT,L("delete-point")),t.value.$on(ne.KfbView.events.EVENT_DELETE_LABEL,L("delete")),t.value.$on(ne.KfbView.events.EVENT_STOP_PAINTING,()=>{N.value&&(y(),o("tool","count-draw-end"))}),t.value.$on(ne.KfbView.events.EVENT_SELECT_LABEL,E=>{s.value=E,N.value&&(y(),v(),o("tool","count-draw-end")),G(),o("tool","select-label",s.value)}),t.value.$on(ne.KfbView.events.EVENT_CANCEL_SELECT_LABEL,()=>{s.value=void 0,o("tool","cancel-select-label",s.value)}),L("list")()}function L(E){return _=>H(E,_)}function H(E,_){var C,D,V,x,$,A;if(E==="add"&&_&&Mt(_,N.value)){const U=f(_);I(),U.action==="selected"&&requestAnimationFrame(()=>{g(U.nearby)});return}if(E==="delete"&&_&&xe(_)){if(d)return;d=!0;try{B(_)}finally{d=!1}return}if(E==="delete"&&(_==null?void 0:_.tool)==="Dot"&&((D=_.custom)!=null?D:(C=_==null?void 0:_.__data__)!=null&&C.custom)){if(d)return;d=!0;try{B(_)}finally{d=!1}return}if(E==="move"&&_&&xe(_)){a(_),I();return}if(E==="add"&&_&&((_==null?void 0:_.subType)||((V=_==null?void 0:_.__data__)==null?void 0:V.subType))==="voice")l(_);else if(E==="add"&&_&&((_==null?void 0:_.subType)||((x=_==null?void 0:_.__data__)==null?void 0:x.subType))==="measure")_.id=new Date().getTime(),p.value.push(_),I();else if(E==="move"&&_&&((_==null?void 0:_.subType)||(($=_==null?void 0:_.__data__.__data__)==null?void 0:$.subType))==="measure")p.value.forEach(U=>{U.id===_.id&&(U.points=_.points)}),I();else if(E==="delete"&&_&&((_==null?void 0:_.subType)||((A=_==null?void 0:_.__data__.__data__)==null?void 0:A.subType))==="measure")p.value.forEach((U,Q)=>{U.id===_.id&&p.value.splice(Q,1)}),I();else if(E==="init-complete")n.initHandle&&n.initHandle();else if(E==="update-zrender")n.zrenderUpdateHandle&&n.zrenderUpdateHandle(t);else return n.labelHandle(E,n.slide,_,u.value).then(U=>{u.value=U.filter(Q=>!xe(Q)),I()}).catch(()=>{I()})}function W(){u.value=u.value.filter(E=>!xe(E))}function I(E){var C;E!=null&&E.length&&(u.value=E.filter(D=>!xe(D))),W();const _=it(m.value);if(_.length!==m.value.length&&(m.value=_),(C=t.value)!=null&&C.initLabelList){const D=[...u.value,...p.value,..._,...n.aiLabelList||[]];D.find(({id:V})=>{var x;return V===((x=s.value)==null?void 0:x.id)})||(s.value=void 0),t.value.initLabelList(D)}}function Z(E,_){g(E,_)}function j(E){return n.labelHandle("add",n.slide,E,u.value).then(_=>{u.value=_,I()}).catch(()=>{I()})}function G(){var _,C,D,V;(((_=s.value)==null?void 0:_.subType)||((D=(C=s.value)==null?void 0:C.__data__)==null?void 0:D.subType))==="voice"&&((V=s.value)!=null&&V.src)&&new Audio(s.value.src).play()}return{currentLabel:s,localLabelList:u,countLabelList:m,isCountDrawing:N,beginCountDraw:r,endCountDraw:k,initLabel:P,jumpToLabel:Z,reloadLabelList:I,eventHandel:L,addHandle:j}}function Oo(){function n(o,t){o.save(),o.strokeStyle="rgba(0,0,0,0)",o.miterLimit=4,o.font="15px",o.fillStyle=t,o.font="15px",o.scale(.02734375,.02734375),o.save(),o.font="15px",o.beginPath(),o.moveTo(512,427.023),o.moveTo(422,427.023),o.translate(512,427.023),o.rotate(0),o.arc(0,0,90,3.141592653589793,6.283185307179586,!0),o.rotate(0),o.translate(-512,-427.023),o.translate(512,427.023),o.rotate(0),o.arc(0,0,90,0,3.141592653589793,!0),o.rotate(0),o.translate(-512,-427.023),o.fill(),o.stroke(),o.restore(),o.save(),o.font="15px",o.beginPath(),o.moveTo(512,910.402),o.bezierCurveTo(492.86,910.402,474.51800000000003,904.548,458.95799999999997,893.4730000000001),o.bezierCurveTo(444.895,883.4630000000001,434.032,869.8770000000001,427.36899999999997,854.013),o.lineTo(255.043,585.177),o.lineTo(254.889,584.927),o.bezierCurveTo(225.522,537.209,210,482.605,210,427.021),o.bezierCurveTo(210,346.35400000000004,241.414,270.515,298.454,213.47500000000002),o.bezierCurveTo(355.494,156.43500000000006,431.333,125.021,512,125.021),o.bezierCurveTo(592.6669999999999,125.021,668.506,156.435,725.546,213.475),o.bezierCurveTo(782.587,270.515,814,346.354,814,427.021),o.bezierCurveTo(814,482.87,798.345,537.692,768.726,585.56),o.lineTo(768.462,585.9789999999999),o.lineTo(596.381,854.6949999999999),o.bezierCurveTo(589.626,870.4209999999999,578.721,883.871,564.677,893.7499999999999),o.bezierCurveTo(549.192,904.6449999999999,530.977,910.4019999999999,512,910.4019999999999),o.closePath(),o.moveTo(309.246,551.141),o.lineTo(484.74,824.9209999999999),o.lineTo(485.934,828.1179999999999),o.bezierCurveTo(490.083,839.2249999999999,500.31500000000005,846.4019999999999,512,846.4019999999999),o.bezierCurveTo(523.584,846.4019999999999,533.791,839.3309999999999,538.004,828.387),o.lineTo(539.169,825.3589999999999),o.lineTo(714.43,551.678),o.bezierCurveTo(737.701,513.983,750,470.884,750,427.021),o.bezierCurveTo(750,363.449,725.244,303.682,680.2909999999999,258.72900000000004),o.bezierCurveTo(635.3389999999999,213.77800000000005,575.5719999999999,189.02100000000004,511.99999999999994,189.02100000000004),o.bezierCurveTo(448.428,189.02100000000004,388.66099999999994,213.77700000000004,343.70799999999997,258.72900000000004),o.bezierCurveTo(298.755,303.68100000000004,274,363.449,274,427.021),o.bezierCurveTo(274,470.661,286.186,513.573,309.246,551.1410000000001),o.closePath(),o.fill(),o.stroke(),o.restore(),o.restore()}return{drawDot:n}}function qo(n,o){const{t}=me(),l=e.ref(!1),c=e.ref();let s=null;const u=e.ref(!1),p=e.ref(0);let g=0;const m=e.ref([]),N=e.ref(void 0);let r=!1;e.onBeforeUnmount(()=>{var S;v();const d=(S=N.value)==null?void 0:S.src;d!=null&&d.startsWith("blob:")&&URL.revokeObjectURL(d)});function k(d,S){d.save(),d.strokeStyle="rgba(0,0,0,0)",d.miterLimit=4,d.font="15px ''",d.fillStyle=S,d.font=" 15px ''",d.scale(.03125,.03125),d.save(),d.font=" 15px ''",d.beginPath(),d.moveTo(515.041727,670.617766),d.bezierCurveTo(606.625894,670.617766,681.137374,596.113511,681.137374,504.52212),d.lineTo(681.137374,229.350568),d.bezierCurveTo(681.137374,137.76640100000003,606.625894,63.254920999999996,515.041727,63.254920999999996),d.bezierCurveTo(423.44311000000005,63.254920999999996,348.93885500000005,137.766401,348.93885600000004,229.350568),d.lineTo(348.93885600000004,504.52212),d.bezierCurveTo(348.93885600000004,596.113512,423.44311100000004,670.617767,515.041727,670.617766),d.closePath(),d.fill(),d.stroke(),d.restore(),d.save(),d.font=" 15px ''",d.beginPath(),d.moveTo(801.643237,874.001665),d.lineTo(558.391759,874.001665),d.lineTo(558.391759,828.578057),d.bezierCurveTo(719.899527,807.264291,844.993269,668.7898399999999,844.993269,501.55986699999994),d.translate(801.643237,501.55986699999994),d.rotate(0),d.arc(0,0,43.350032,0,3.141592653589793,!0),d.rotate(0),d.translate(-801.643237,-501.55986699999994),d.bezierCurveTo(758.2932050000001,635.684865,649.166725,744.811345,515.0345020000001,744.811346),d.bezierCurveTo(380.9095040000001,744.811346,271.79024900000013,635.6848659999999,271.79024900000013,501.55986699999994),d.translate(228.44021750000013,501.5664510740879),d.rotate(0),d.arc(0,0,43.350032,-.00015188164315591997,-3.1414407719461273,!0),d.rotate(0),d.translate(-228.44021750000013,-501.5664510740879),d.bezierCurveTo(185.09018600000013,668.7898389999999,310.1911530000001,807.271516,471.69169500000015,828.578057),d.lineTo(471.69169500000015,874.001665),d.lineTo(228.440217,874.001665),d.translate(228.440217,917.3516970000001),d.rotate(0),d.arc(0,0,43.350032,-1.5707963267948966,1.5707963267948966,!0),d.rotate(0),d.translate(-228.440217,-917.3516970000001),d.lineTo(801.643237,960.701729),d.translate(801.643237,917.3516970000001),d.rotate(0),d.arc(0,0,43.350032,1.5707963267948966,4.71238898038469,!0),d.rotate(0),d.translate(-801.643237,-917.3516970000001),d.closePath(),d.fill(),d.stroke(),d.restore(),d.restore()}function y(){return ge(this,null,function*(){try{c.value=yield navigator.mediaDevices.getUserMedia({audio:!0}),s=new MediaRecorder(c.value),m.value=[],s.addEventListener("dataavailable",d=>{m.value.push(d.data)}),s.addEventListener("stop",()=>ge(this,null,function*(){if(N.value){const d=new Blob(m.value,{type:n.audioType||"audio/wav"});N.value.src=URL.createObjectURL(d)}u.value=!1,r&&(yield a())})),s.start(),u.value=!0,g=window.setInterval(()=>{p.value++},1e3)}catch(d){b.ElMessage.error(t("麦克风启用失败,请确认是否开启麦克风权限"))}})}function v(){c.value&&s?(s.stop(),c.value.getTracks().forEach(d=>d.stop()),s=null,c.value=void 0):(s=null,c.value=void 0),u.value=!1,g&&(clearInterval(g),g=0),p.value=0}function w(d){l.value=!0,N.value=d,m.value=[],r=!1}function f(){u.value&&v(),l.value=!1,u.value=!1,r=!1}function i(){return ge(this,null,function*(){if(!u.value&&!m.value.length){b.ElMessage.error(t("请先录音"));return}u.value&&v(),u.value=!1,r=!0,m.value.length&&(yield a()),l.value=!1})}function a(){return ge(this,null,function*(){if(n.uploadHandle&&N.value){const d=b.ElLoading.service({text:t("录音上传中")}),S=new Blob(m.value,{type:n.audioType||"audio/wav"});m.value=[];try{yield n.uploadHandle(n.slide,N.value,S).then(B=>{N.value.src=B}),d.close(),o(N.value)}catch(B){d.close()}}})}return{voiceVisible:l,voiceForm:N,recordTime:p,isRecording:u,drawVoice:k,startRecording:y,stopRecording:v,initVoice:w,cancelRecord:f,confirmRecord:i}}function Ko(n,o,t){const l=e.ref([]),c=e.ref(0),s=e.ref(!1);let u=null;e.watch(()=>{var y;return(y=n.analysis)==null?void 0:y.hotmap_path},y=>{var v,w,f;if((w=(v=o.value)==null?void 0:v.viewer)!=null&&w.world){c.value=0;const i=o.value.viewer.world.getItemAt(0);i&&(i.tilesMatrix={},i.draw())}y&&((f=n.analysis)!=null&&f.zoom_roi)&&t({x:n.analysis.zoom_roi.x,y:n.analysis.zoom_roi.y,width:n.analysis.zoom_roi.w,height:n.analysis.zoom_roi.h},5)}),e.onMounted(()=>{window.addEventListener("mousemove",m),window.addEventListener("mouseup",r)}),e.onBeforeUnmount(()=>{window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",r)});function p(y,v,w){var i,a,d,S;const f=se(Y({},v),{file:(i=n.analysis)==null?void 0:i.hotmap_path});if((a=n.analysis)!=null&&a.hotmap_info){if(w[v.x+"_"+v.y+"_"+Number(v.scale)])if(((d=n.analysis)==null?void 0:d.hotmap_type)==="drag")g(y,f);else return n.tileHandle(f,n.slide)}else if(((S=n.analysis)==null?void 0:S.hotmap_type)==="drag")g(y,f);else return n.tileHandle(f,n.slide);return y}function g(y,v){const w=l.value.find(f=>f.url===y)||{url:y,x:v.x,y:v.y,img:void 0,load:""};if(!(w!=null&&w.img)&&(l.value.push(w),w.load!=="success")){const f=new Image;f.src=n.tileHandle(v,n.slide),f.onload=()=>{w.load="success"},w.img=f}}function m(y){s.value&&u&&(c.value+=y.x-u.x,c.value<0?c.value=0:c.value>o.value.$options.width&&(c.value=o.value.$options.width,s.value=!1),o.value.viewer.forceRedraw()),u={x:y.x,y:y.y}}function N(y){const{x:v,y:w}=y;s.value=!0,u={x:v,y:w}}function r(){s.value=!1,u=null}function k(y){const{context:v,sourceWidth:w,sourceHeight:f,position:i,size:a,initRendered:d,tile:S,pixelDensityRatio:B}=y,P=S.getUrl(),L=c.value*B,H=i.original.x;if(H<L&&H+a.x>L){const W=L-H,I=a.x-W,Z=l.value.find(G=>G.url===P),j=(Z==null?void 0:Z.load)==="success"?Z.img:d.canvas;v.drawImage(j,0,0,w*W/a.x,f,i.x,i.y,W,a.y),v.drawImage(d.canvas,w*W/a.x,0,w*I/a.x,f,i.x+W,i.y,I,a.y)}else if(H+a.x<=L){const W=l.value.find(Z=>Z.url===P),I=(W==null?void 0:W.load)==="success"?W.img:d.canvas;v.drawImage(I,0,0,w,f,i.x,i.y,a.x,a.y)}else H>=L&&v.drawImage(d.canvas,0,0,w,f,i.x,i.y,a.x,a.y)}return{getHotmapUrl:p,hotmapImgs:l,handlerImage:k,hotmapLine:c,lineMouseDown:N}}function Wo(n,o,t){const l=e.getCurrentInstance(),c=e.ref(!1),s=new BroadcastChannel("sync_kfb_view");s.onmessage=r=>{const k=r.data;m(k)},e.onMounted(()=>{var r,k,y;(r=t.value)==null||r.addEventListener("mouseenter",u),(k=t.value)==null||k.addEventListener("mousemove",u),(y=t.value)==null||y.addEventListener("mouseleave",p)}),e.onBeforeUnmount(()=>{var r,k,y;(r=t.value)==null||r.removeEventListener("mouseenter",u),(k=t.value)==null||k.removeEventListener("mousemove",u),(y=t.value)==null||y.removeEventListener("mouseleave",p),s.close()});function u(){c.value=!0}function p(){c.value=!1}function g(){let r;o.value.viewer.addHandler("pan",k=>{var w,f,i,a;if(!r){r=(f=(w=k.center)==null?void 0:w.clone)==null?void 0:f.call(w);return}const y=k.center,v=(i=y==null?void 0:y.minus)==null?void 0:i.call(y,r);r=(a=y==null?void 0:y.clone)==null?void 0:a.call(y),n.syncPosition&&N({position:v,type:"sync_position"})}),o.value.viewer.addHandler("zoom",k=>{n.syncZoom&&N({zoom:k.zoom,type:"sync_zoom"})}),o.value.viewer.addHandler("animation-finish",()=>{var v;if(n.syncZoom&&N({zoom:o.value.viewer.viewport.getZoom(!0),type:"sync_zoom"}),!r)return;const k=o.value.viewer.viewport.getCenter(!0),y=(v=k==null?void 0:k.minus)==null?void 0:v.call(k,r);r=void 0,n.syncPosition&&N({position:y,type:"sync_position"})})}function m(r){r.uuid&&r.type==="sync_position"&&r.uuid!==(l==null?void 0:l.uid)?o.value&&o.value.viewer.viewport.panBy(r.position,!0):r.uuid&&r.type==="sync_zoom"&&r.uuid!==(l==null?void 0:l.uid)&&o.value&&o.value.viewer.viewport.zoomTo(r.zoom)}function N(r){var k;c.value&&s.postMessage(se(Y({},r),{uuid:l==null?void 0:l.uid,fileName:(k=n.slide)==null?void 0:k.file}))}return{initSync:g}}const Go={class:"hzzt-kfb-keyword flex wrap"},Yo=["onMouseenter"],Zo=e.defineComponent({__name:"KfbKeyword",setup(n){const o=e.ref([{code:"Q",icon:"zoomIn"},{code:"W",icon:"arrowUp"},{code:"E",icon:"zoomOut"},{code:"A",icon:"arrowLeft"},{code:"S",icon:"arrowDown"},{code:"D",icon:"arrowRight"}]),t=e.inject("kfbView",e.ref({}));let l=null;function c(u,p){u.preventDefault(),l&&clearTimeout(l),l=setInterval(()=>{p==="E"&&(t.value.viewer.viewport.zoomBy(1.1),t.value.viewer.viewport.applyConstraints()),p==="Q"&&(t.value.viewer.viewport.zoomBy(.9),t.value.viewer.viewport.applyConstraints()),p==="W"&&(t.value.viewer.viewport.panBy(t.value.viewer.viewport.deltaPointsFromPixels(new ne.OpenSeadragon.Point(0,-40))),t.value.viewer.viewport.applyConstraints()),p==="S"&&(t.value.viewer.viewport.panBy(t.value.viewer.viewport.deltaPointsFromPixels(new ne.OpenSeadragon.Point(0,40))),t.value.viewer.viewport.applyConstraints()),p==="A"&&(t.value.viewer.viewport.panBy(t.value.viewer.viewport.deltaPointsFromPixels(new ne.OpenSeadragon.Point(-40,0))),t.value.viewer.viewport.applyConstraints()),p==="D"&&(t.value.viewer.viewport.panBy(t.value.viewer.viewport.deltaPointsFromPixels(new ne.OpenSeadragon.Point(40,0))),t.value.viewer.viewport.applyConstraints())},120)}function s(){l&&(clearInterval(l),l=null)}return e.onBeforeUnmount(()=>{clearTimeout(l)}),(u,p)=>(e.openBlock(),e.createElementBlock("div",Go,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,g=>(e.openBlock(),e.createElementBlock("div",{key:g.code,class:"hzzt-kfb-keyword__code flex column align-items-center justify-content-center",onMouseenter:m=>c(m,g.code),onMouseleave:s},[e.createElementVNode("p",null,e.toDisplayString(g.code),1),e.createVNode(le,{size:"14",name:g.icon},null,8,["name"])],40,Yo))),128))]))}}),Xo=ye(Zo,[["__scopeId","data-v-7b625d72"]]);function Jo(n,o,t={}){const{panSensitivity:l=.2,zoomSensitivity:c=1.1,damping:s=.6,minThreshold:u=.05}=t;let p=!1,g=null,m=0,N=0,r=!1;const k=()=>{p=document.pointerLockElement===o.value,p||y()},y=()=>{m=0,N=0,g&&(cancelAnimationFrame(g),g=null),r=!1},v=d=>ge(this,null,function*(){try{d.key==="l"&&o.value&&(document.pointerLockElement?(document.exitPointerLock(),console.log("鼠标已解锁!")):(yield o.value.requestPointerLock(),console.log("鼠标已锁定!")))}catch(S){console.error("无法锁定鼠标:",S)}}),w=d=>{if(p){d.preventDefault();const S=Math.pow(c,Math.sign(d.deltaY)*-1);n.value.viewer.viewport.zoomBy(S),n.value.viewer.viewport.applyConstraints()}},f=d=>{p&&(m+=d.movementX*l,N+=d.movementY*l,!r&&(Math.abs(m)>1||Math.abs(N)>1)&&(r=!0,g=requestAnimationFrame(i)))},i=()=>{const d=n.value.viewer.viewport;if(Math.abs(m)>u||Math.abs(N)>u){const S=d.deltaPointsFromPixels(new ne.OpenSeadragon.Point(m,N));d.panBy(S),d.applyConstraints()}m*=s,N*=s,Math.abs(m)>u||Math.abs(N)>u?g=requestAnimationFrame(i):y()},a=()=>{p&&document.exitPointerLock()};return e.onMounted(()=>{var d;(d=o.value)==null||d.addEventListener("keydown",v),document.addEventListener("wheel",w,{passive:!1}),document.addEventListener("click",a),document.addEventListener("mousemove",f),document.addEventListener("pointerlockchange",k)}),e.onBeforeUnmount(()=>{var d;(d=o.value)==null||d.removeEventListener("keydown",v),document.removeEventListener("click",a),document.removeEventListener("wheel",w),document.removeEventListener("mousemove",f),document.removeEventListener("pointerlockchange",k),y()}),{setConfig:d=>{Object.assign(t,d)}}}const Qo=e.defineComponent({__name:"KfbLevel",props:e.mergeModels({slides:{default:()=>[]}},{"model-value":{default:0},"model-valueModifiers":{}}),emits:["update:model-value"],setup(n){const o=n,t=e.useModel(n,"model-value"),l=e.inject("kfbView",e.ref({})),c=e.computed(()=>Array.from(new Array(o.slides.length+1)).map((u,p)=>p));function s(){const u=l.value.viewer.world.getItemAt(0),p=Object.keys(u.tilesMatrix);p.forEach((g,m)=>{m>p.length-4&&(u.tilesMatrix[g]={})}),u.draw()}return(u,p)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hzzt-kfb-level flex column align-items-center",u.slides.length>5?"hzzt-kfb-level--large":""])},[e.createVNode(le,{name:"level",size:"24",class:"margin-b-4 margin-t-2"}),e.createVNode(e.unref(b.ElSlider),{modelValue:t.value,"onUpdate:modelValue":p[0]||(p[0]=g=>t.value=g),vertical:"",min:c.value[0],step:1,max:c.value[c.value.length-1],"show-stops":"","show-tooltip":!0,placement:"left",height:u.slides.length>5?"180px":"130px",onInput:s},null,8,["modelValue","min","max","height"])],2))}}),el={DAPI:"#4A6CF7",480:"#00BFFF",520:"#32CD32",570:"#FFAA33",620:"#FF6347",670:"#DC143C",780:"#4B0082"};function tl(n){const o=n.r===""||n.r===void 0?NaN:Number(n.r),t=n.g===""||n.g===void 0?NaN:Number(n.g),l=n.b===""||n.b===void 0?NaN:Number(n.b);if(![o,t,l].some(c=>!Number.isFinite(c)))return`rgb(${o}, ${t}, ${l})`}function st(n){return((n==null?void 0:n.channel)||[]).map(t=>{const l=tl(t),c=el[t.eqt_num];return{label:t.eqt_num,defaultColor:l||c||"#ffffff"}})}function nl(n,o){const t=new Set(o);return((n==null?void 0:n.channel)||[]).map(l=>l.eqt_num).filter(l=>t.has(l))}function ol(n,o){return JSON.stringify(nl(n,o))}const ll={key:0,class:"flex hzzt-kfb-channel"},al=["onClick"],rl=e.defineComponent({__name:"KfbChannel",props:e.mergeModels({info:{}},{"model-value":{default:()=>[]},"model-valueModifiers":{}}),emits:e.mergeModels(["load"],["update:model-value"]),setup(n,{emit:o}){const t=n,l=o,c=e.useModel(n,"model-value"),s=e.computed(()=>st(t.info).map(p=>({label:p.label,color:p.defaultColor})));function u(p){const g=st(t.info).map(r=>r.label),m=c.value.includes(p)?c.value.filter(r=>r!==p):[...c.value,p],N=new Set(m);c.value=g.filter(r=>N.has(r)),l("load")}return(p,g)=>s.value.length>0?(e.openBlock(),e.createElementBlock("div",ll,[e.createVNode(le,{name:"channel",size:"32"}),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,m=>(e.openBlock(),e.createElementBlock("div",{key:m.label,style:e.normalizeStyle({background:m.color}),class:e.normalizeClass(["hzzt-kfb-channel__box",c.value.includes(m.label)?"":"hzzt-kfb-channel__box--unactive"]),onClick:N=>u(m.label)},e.toDisplayString(m.label),15,al))),128))])):e.createCommentVNode("",!0)}}),il={class:"flex align-items-center justify-content-between"},sl={class:"hzzt-kfb-title"},ul={class:"hzzt-kfb-annotation__container flex-1"},cl=["onClick"],dl=e.defineComponent({__name:"KfbAnnotation",props:e.mergeModels({annotation:{},annotations:{}},{expand:{type:Boolean},expandModifiers:{}}),emits:e.mergeModels(["select"],["update:expand"]),setup(n,{emit:o}){const t=e.useModel(n,"expand"),l=o,{t:c}=me();function s(p){let g="";return p.subType==="count"?g=p.tool||"":g=p.subType||p.tool||"",`mark${g.substring(0,1).toLocaleUpperCase()}${g.substring(1)}`}function u(p){l("select",p)}return(p,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hzzt-kfb-annotation flex column",t.value?"hzzt-kfb-annotation--expand":""])},[e.createElementVNode("div",il,[e.withDirectives(e.createElementVNode("div",sl,[e.createElementVNode("span",null,e.toDisplayString(e.unref(c)("标注列表")),1)],512),[[e.vShow,t.value]]),e.createVNode(le,{class:"hzzt-kfb-annotation__icon",name:t.value?"expandLeft":"expandRight",onClick:g[0]||(g[0]=m=>t.value=!t.value)},null,8,["name"])]),e.withDirectives(e.createElementVNode("div",ul,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.annotations,(m,N)=>{var r;return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hzzt-kfb-annotation__item",((r=p.annotation)==null?void 0:r.id)===m.id?"hzzt-kfb-annotation__item--active":""]),key:N,onClick:k=>u(m)},[e.createVNode(le,{size:"16",color:m.subType==="count"?e.unref(Oe)(m):void 0,name:s(m)},null,8,["color","name"]),e.createElementVNode("span",null,e.toDisplayString(e.unref(c)("标注"))+e.toDisplayString(N+1),1)],10,cl)}),128))],512),[[e.vShow,t.value]])],2))}}),fl=ye(dl,[["__scopeId","data-v-8560f6f0"]]);function De(n,o,t){return Math.min(t,Math.max(o,n))}function At(n){const o=((n==null?void 0:n.trim())||"").toLowerCase().replace(/\s+/g,""),t=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+)?\s*\)$/i.exec(o);if(t){const u=De(parseInt(t[1],10),0,255),p=De(parseInt(t[2],10),0,255),g=De(parseInt(t[3],10),0,255);return{r:u/255,g:p/255,b:g/255}}let l=o;l.startsWith("#")&&l.length===4&&(l=`#${l[1]}${l[1]}${l[2]}${l[2]}${l[3]}${l[3]}`);const c=/^#([0-9a-f]{6})$/.exec(l);if(!c)return{r:0,g:0,b:0};const s=parseInt(c[1],16);return{r:(s>>16&255)/255,g:(s>>8&255)/255,b:(s&255)/255}}function at(n,o){let t=Math.round(De(n,0,255)),l=Math.round(De(o,0,255));t>l&&([t,l]=[l,t]),l-t<1&&(l=Math.min(255,t+1));const c=[];for(let s=0;s<256;s++)s<=t?c.push(0):s>=l?c.push(1):c.push((s-t)/(l-t));return c.join(" ")}function rt(){return Array.from({length:256},(n,o)=>o/255).join(" ")}const ml="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0";function vl(n){return n.lower!==0||n.upper!==255||Math.abs(n.gamma-1)>.001}function pl(n,o){const t=e.reactive({}),l=e.ref([]);function c(i){return{color:i,lower:0,upper:255,gamma:1}}function s(){l.value=st(n.value);const i=new Set(l.value.map(a=>a.label));Object.keys(t).forEach(a=>{i.has(a)||delete t[a]});for(const a of l.value)t[a.label]||(t[a.label]=c(a.defaultColor))}e.watch(()=>{var i;return(i=n.value)==null?void 0:i.channel},()=>s(),{deep:!0,immediate:!0});const u=e.computed(()=>l.value.map(i=>i.label)),p=e.computed(()=>ml),g=e.computed(()=>l.value.some(i=>{const a=t[i.label];return!!a&&vl(a)}));function m(i){const a=u.value[i];return a&&t[a]||null}const N=e.computed(()=>{const i=m(0);return i?at(i.lower,i.upper):rt()}),r=e.computed(()=>{const i=m(1);return i?at(i.lower,i.upper):rt()}),k=e.computed(()=>{const i=m(2);return i?at(i.lower,i.upper):rt()}),y=e.computed(()=>{var d,S;const i=(S=(d=m(0))==null?void 0:d.gamma)!=null?S:1;return 1/Math.max(.01,i)}),v=e.computed(()=>{var d,S;const i=(S=(d=m(1))==null?void 0:d.gamma)!=null?S:1;return 1/Math.max(.01,i)}),w=e.computed(()=>{var d,S;const i=(S=(d=m(2))==null?void 0:d.gamma)!=null?S:1;return 1/Math.max(.01,i)});function f(){s();for(const i of l.value)t[i.label]=c(i.defaultColor)}return{channelParams:t,orderedLabels:u,filterMatrix:p,filterActive:g,redTransferTable:N,greenTransferTable:r,blueTransferTable:k,gammaExponentR:y,gammaExponentG:v,gammaExponentB:w,syncFromFile:s,resetToDefaults:f,displayRows:e.computed(()=>l.value)}}const hl={class:"fluo-adjust"},gl={class:"fluo-adjust__left"},wl={class:"fluo-adjust__left-inner"},yl=["onClick"],_l={key:0,class:"fluo-adjust__right"},kl={class:"fluo-adjust__chart-row"},Cl={class:"fluo-adjust__chart-col"},Vl={class:"fluo-adjust__section-title"},bl={class:"fluo-adjust__gamma-col"},El={class:"fluo-adjust__gamma-label"},xl={class:"fluo-adjust__gamma-val"},Nl={class:"fluo-adjust__nums"},zl={class:"fluo-adjust__num-item"},Sl={class:"fluo-adjust__num-lab"},Tl={class:"fluo-adjust__num-item"},Bl={class:"fluo-adjust__num-lab"},$l={class:"fluo-adjust__num-item"},Dl={class:"fluo-adjust__num-lab"},Ll={class:"fluo-adjust__footer"},Ml=e.defineComponent({__name:"KfbFluorescenceChannelAdjust",props:e.mergeModels({displayRows:{},channelParams:{}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:e.mergeModels(["apply","reset","save"],["update:modelValue"]),setup(n,{emit:o}){const t=n,l=o,c=e.useModel(n,"modelValue"),{t:s}=me(),u=e.ref(null),p=e.ref(null),g=e.computed(()=>t.displayRows.map(V=>{const x=t.channelParams[V.label];return x?{row:V,param:x}:null}).filter(V=>V!==null)),m=e.computed(()=>{var x;const V=u.value;return V&&(x=t.channelParams[V])!=null?x:null}),N=e.computed(()=>{const V=m.value;return V?Math.max(0,Math.min(254,V.upper-16)):254}),r=e.computed(()=>{const V=m.value;return V?Math.min(255,Math.max(1,V.lower+16)):1});let k=null;function y(V){const{r:x,g:$,b:A}=At(V);return .2126*x+.7152*$+.0722*A>.55?"#000":"#fff"}function v(V){u.value=V,e.nextTick(()=>S())}function w(V,x,$,A){if(V<=x)return 0;if(V>=$)return 255;const U=(V-x)/($-x);return 1+Math.pow(U,A)*254}function f(){const V=p.value;if(!V)return null;const x=34,$=10,A=10,U=28,Q=V.clientWidth||268,M=V.clientHeight||208,T=Q-x-$,F=M-A-U;return{canvas:V,padL:x,padR:$,padT:A,padB:U,plotW:T,plotH:F,cw:Q,ch:M}}function i(V,x){return x.padL+V/255*x.plotW}function a(V,x){return x.padT+x.plotH-V/255*x.plotH}function d(V,x){return Math.round(Math.min(255,Math.max(0,(V-x.padL)/x.plotW*255)))}function S(){const V=p.value,x=m.value,$=f();if(!V||!x||!$)return;const A=window.devicePixelRatio||1,U=$.cw,Q=$.ch;V.width=Math.floor(U*A),V.height=Math.floor(Q*A);const M=V.getContext("2d");if(!M)return;M.setTransform(A,0,0,A,0,0),M.fillStyle="#0a0d24",M.fillRect(0,0,U,Q),M.strokeStyle="rgba(255,255,255,0.2)",M.lineWidth=1;const T=[0,51,102,153,204,255];for(const ue of T){const he=i(ue,$);M.beginPath(),M.moveTo(he,$.padT),M.lineTo(he,$.padT+$.plotH),M.stroke();const Ce=a(ue,$);M.beginPath(),M.moveTo($.padL,Ce),M.lineTo($.padL+$.plotW,Ce),M.stroke(),M.fillStyle="rgba(255,255,255,0.45)",M.font="10px sans-serif",M.textAlign="center",M.fillText(String(ue),he,$.padT+$.plotH+14),M.textAlign="right",M.fillText(String(ue),$.padL-4,Ce+3)}const F=w(x.lower,x.lower,x.upper,x.gamma),O=w(x.upper,x.lower,x.upper,x.gamma),ae=i(x.lower,$),ke=a(F,$),We=i(x.upper,$),Ge=a(O,$),Ee=m.value?At(m.value.color):{r:.2,g:1,b:.3};M.strokeStyle=`rgb(${Math.round(Ee.r*255)}, ${Math.round(Ee.g*255)}, ${Math.round(Ee.b*255)})`,M.lineWidth=2,M.beginPath();for(let ue=x.lower;ue<=x.upper;ue++){const he=w(ue,x.lower,x.upper,x.gamma),Ce=i(ue,$),Re=a(he,$);ue===x.lower?M.moveTo(Ce,Re):M.lineTo(Ce,Re)}M.stroke();for(const[ue,he]of[[ae,ke],[We,Ge]])M.fillStyle="#5470c6",M.beginPath(),M.arc(ue,he,6,0,Math.PI*2),M.fill(),M.strokeStyle="#fff",M.lineWidth=2,M.stroke()}function B(V,x){const $=m.value,A=f();if(!$||!A)return null;const U=w($.lower,$.lower,$.upper,$.gamma),Q=w($.upper,$.lower,$.upper,$.gamma),M=i($.lower,A),T=a(U,A),F=i($.upper,A),O=a(Q,A),ae=10;return Be(V-M,2)+Be(x-T,2)<=ae*ae?"lower":Be(V-F,2)+Be(x-O,2)<=ae*ae?"upper":null}function P(V){const x=p.value;if(!x||!m.value)return;const $=x.getBoundingClientRect(),A=V.clientX-$.left,U=V.clientY-$.top;k=B(A,U),k&&(window.addEventListener("mousemove",L),window.addEventListener("mouseup",H,{once:!0}))}function L(V){if(!k||!m.value)return;const x=p.value,$=f();if(!x||!$)return;const A=x.getBoundingClientRect(),U=V.clientX-A.left,Q=d(U,$),M=m.value;k==="lower"?(M.lower=Math.min(Q,M.upper-16),M.lower=Math.max(0,M.lower)):(M.upper=Math.max(Q,M.lower+16),M.upper=Math.min(255,M.upper)),S(),I()}function H(){k=null,window.removeEventListener("mousemove",L)}function W(V){const x=t.channelParams[V];if(!x)return;let $=Math.round(Math.min(255,Math.max(0,x.lower))),A=Math.round(Math.min(255,Math.max(0,x.upper)));A-$<16&&(A=Math.min(255,$+16)),$>A-16&&($=Math.max(0,A-16)),x.lower=$,x.upper=A,x.gamma=Math.min(10,Math.max(.5,x.gamma))}function I(){g.value.forEach(({row:V})=>W(V.label)),l("apply"),e.nextTick(()=>S())}function Z(){I()}function j(){I()}function G(){I()}function E(){var x;const V=(x=g.value[0])==null?void 0:x.row.label;u.value=V!=null?V:null,e.nextTick(()=>S())}function _(){H()}function C(){l("reset"),e.nextTick(()=>I())}function D(){l("save")}return e.watch(()=>[c.value,u.value,t.channelParams],()=>{c.value&&e.nextTick(()=>S())},{deep:!0}),e.watch(()=>m.value?[m.value.lower,m.value.upper,m.value.gamma,m.value.color]:null,()=>{c.value&&e.nextTick(()=>S())},{deep:!0}),e.onBeforeUnmount(()=>{H()}),(V,x)=>(e.openBlock(),e.createBlock(e.unref(b.ElDialog),{modelValue:c.value,"onUpdate:modelValue":x[4]||(x[4]=$=>c.value=$),"append-to-body":!0,title:e.unref(s)("图像处理"),width:"550px",top:"6vh",draggable:"",class:"kfb-fluorescence-adjust-dialog","destroy-on-close":!1,onOpen:E,onClosed:_},{footer:e.withCtx(()=>[e.createElementVNode("div",Ll,[e.createVNode(e.unref(b.ElButton),{type:"info",onClick:C},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("重置")),1)]),_:1}),e.createVNode(e.unref(b.ElButton),{type:"primary",onClick:D},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("保存")),1)]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",hl,[e.createElementVNode("div",gl,[e.createElementVNode("div",wl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,({row:$,param:A})=>(e.openBlock(),e.createElementBlock("div",{key:$.label,class:e.normalizeClass(["fluo-adjust__ch-item",{"fluo-adjust__ch-item--active":$.label===u.value}]),onClick:U=>v($.label)},[e.createElementVNode("span",{class:"fluo-adjust__ch-tag",style:e.normalizeStyle({background:A.color,color:y(A.color)})},e.toDisplayString($.label),5),e.createVNode(e.unref(b.ElColorPicker),{modelValue:A.color,"onUpdate:modelValue":U=>A.color=U,"show-alpha":"",size:"small",onChange:I},null,8,["modelValue","onUpdate:modelValue"])],10,yl))),128))]),e.createElementVNode("button",{type:"button",class:"fluo-adjust__update-btn",onClick:Z},e.toDisplayString(e.unref(s)("更新通道")),1)]),m.value?(e.openBlock(),e.createElementBlock("div",_l,[e.createElementVNode("div",kl,[e.createElementVNode("div",Cl,[e.createElementVNode("div",Vl,e.toDisplayString(e.unref(s)("图像调整")),1),e.createElementVNode("canvas",{ref_key:"curveCanvasRef",ref:p,class:"fluo-adjust__curve-canvas",width:"268",height:"208",onMousedown:e.withModifiers(P,["prevent"])},null,544)]),e.createElementVNode("div",bl,[e.createVNode(e.unref(b.ElSlider),{modelValue:m.value.gamma,"onUpdate:modelValue":x[0]||(x[0]=$=>m.value.gamma=$),vertical:"",height:"140px",min:.5,max:3.5,step:.01,onInput:G},null,8,["modelValue"]),e.createElementVNode("span",El,e.toDisplayString(e.unref(s)("伽马值")),1),e.createElementVNode("span",xl,e.toDisplayString(m.value.gamma.toFixed(2)),1)])]),e.createElementVNode("div",Nl,[e.createElementVNode("div",zl,[e.createElementVNode("span",Sl,e.toDisplayString(e.unref(s)("下限位")),1),e.createVNode(e.unref(b.ElInputNumber),{modelValue:m.value.lower,"onUpdate:modelValue":x[1]||(x[1]=$=>m.value.lower=$),size:"small",min:0,max:N.value,step:1,"controls-position":"right",onChange:j},null,8,["modelValue","max"])]),e.createElementVNode("div",Tl,[e.createElementVNode("span",Bl,e.toDisplayString(e.unref(s)("上限位")),1),e.createVNode(e.unref(b.ElInputNumber),{modelValue:m.value.upper,"onUpdate:modelValue":x[2]||(x[2]=$=>m.value.upper=$),size:"small",min:r.value,max:255,step:1,"controls-position":"right",onChange:j},null,8,["modelValue","min"])]),e.createElementVNode("div",$l,[e.createElementVNode("span",Dl,e.toDisplayString(e.unref(s)("伽马值")),1),e.createVNode(e.unref(b.ElInputNumber),{modelValue:m.value.gamma,"onUpdate:modelValue":x[3]||(x[3]=$=>m.value.gamma=$),size:"small",min:.5,max:10,step:.1,"controls-position":"right",onChange:G},null,8,["modelValue"])])])])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue","title"]))}}),Pl=ye(Ml,[["__scopeId","data-v-0c396ba1"]]);function jt(n){const{t:o}=me();return e.computed(()=>{var c;const l=((c=n==null?void 0:n.analysis)==null?void 0:c.result)||"";return l.indexOf("疑似阳性")>-1?{type:"warning",name:l}:l.indexOf("阳性")>-1?{type:"danger",name:l}:l.indexOf("阴性")>-1?{type:"success",name:l}:l.indexOf("不合格")>-1?{type:"danger",name:l}:l.indexOf("合格")>-1?{type:"success",name:l}:{type:"info",name:l||o("未知")}})}const Rl=["element-loading-text"],Il={key:1,class:"hzzt-kfb-view__main flex align-items-center justify-content-center"},Al={class:"hzzt-kfb-view__filter",height:"0",width:"0"},Fl={id:"colorMatrixFilter"},Hl=["values"],Ul=["values"],jl=["exponent"],Ol=["exponent"],ql=["exponent"],Kl={key:3,class:"hzzt-kfb-view__filter",height:"0",width:"0"},Wl=["id"],Gl=["values"],Yl=["tableValues"],Zl=["tableValues"],Xl=["tableValues"],Jl=["exponent"],Ql=["exponent"],ea=["exponent"],ta={class:"flex nowrap justify-content-center overflow-hidden"},na=["src"],oa=["src"],la={class:"flex-1"},aa={class:"flex-1"},ra={class:"flex-1"},ia={class:"flex-1"},sa={class:"flex-1"},ua={class:"flex-1"},ca=["src"],da={key:2,class:"margin-l-2"},fa={key:10,class:"hzzt-kfb-view__watermark"},Se=e.defineComponent({name:"HzztKfbView",__name:"index",props:{slide:{},fileHandle:{},labelHandle:{},tileHandle:{},initHandle:{},zrenderUpdateHandle:{},navigatorHandle:{},pathologyHandle:{},uploadHandle:{},options:{},labelDrawing:{},process:{default:()=>Y({},ct)},microscope:{default:()=>Y({},Ue)},menus:{},syncPosition:{type:Boolean},syncZoom:{type:Boolean},audioType:{},watermark:{},analysis:{},aiLabelList:{},showLabel:{type:Boolean},showZrender:{type:Boolean}},emits:["tool"],setup(n,{expose:o,emit:t}){e.useCssVars(h=>({"974774ca":ue.value}));const l=n,c=t,{t:s,locale:u}=me(),p=e.ref(),g=e.ref(),m=e.ref(),N=e.ref(!1),r=e.ref({}),k=e.ref(!1),y=e.ref(0),v=e.ref(0),w=e.ref(0),f=e.ref([]),i=e.ref(!0),a=e.ref({width:0,height:0,fileNum:0,scanScale:1,fileName:"",ratiomap:{}}),d=e.useId().replace(/:/g,"_"),S=e.ref(!1),B=e.computed(()=>{var h;return!!((h=a.value.channel)!=null&&h.length)}),P=e.computed(()=>S.value&&W.value),{channelParams:L,filterMatrix:H,filterActive:W,redTransferTable:I,greenTransferTable:Z,blueTransferTable:j,gammaExponentR:G,gammaExponentG:E,gammaExponentB:_,resetToDefaults:C,displayRows:D}=pl(a),V=e.inject("show-kfb-label",e.ref(!0)),x=e.inject("show-keyboard",e.ref(!1)),$=e.inject("show-watermark",e.ref(!1)),A=e.ref(!1);let U=!1,Q,M,T,F=null;function O(){Q!==void 0&&(clearTimeout(Q),Q=void 0),M!==void 0&&(clearTimeout(M),M=void 0),T!==void 0&&(clearTimeout(T),T=void 0)}function ae(h,z=200){let R;return(...q)=>{R&&clearTimeout(R),R=setTimeout(()=>h(...q),z)}}let ke=!0;const We=ae(h=>{c("tool","rotateChange",h)},200),Ge=b.ElLoading.directive;e.watch(()=>{var h;return(h=l.slide)==null?void 0:h.file},()=>{wt(),Q=setTimeout(()=>{Q=void 0,U||vt()},100)}),e.onMounted(()=>{vt()}),e.onBeforeUnmount(()=>{U=!0,O(),wt()});const Ee=jt(l),ue=e.computed(()=>{var h,z;return`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='100'><text x='30' y='80' font-family='Arial' font-size='16' fill='${((h=l.watermark)==null?void 0:h.color)||"rgba(0,0,0,0.2)"}' transform='rotate(-30)' text-anchor='middle'>${((z=l.watermark)==null?void 0:z.text)||"水印文字"}</text></svg>")`}),{imageProcess:he,matrixValues:Ce,saturateValues:Re,forceRedraw:Ot}=io(l),{tailorEvent:qt,shotScreen:Kt}=so(c,s,r,v,a,e.computed(()=>l.slide)),{moveEvent:Wt,fastMove:Gt}=Mo(r,v),{initSync:Yt}=Wo(l,r,p);Jo(r,p);const{drawDot:Zt}=Oo(),{voiceVisible:Ye,voiceForm:Ze,drawVoice:Xt,recordTime:Jt,isRecording:dt,startRecording:Qt,stopRecording:en,initVoice:tn,cancelRecord:nn,confirmRecord:on}=qo(l,cn),{currentLabel:Xe,localLabelList:Je,isCountDrawing:Ie,beginCountDraw:ln,endCountDraw:Qe,initLabel:an,jumpToLabel:ft,reloadLabelList:rn,eventHandel:sn,addHandle:un}=jo(l,c,r,tn,et);function cn(h){un(h)}const{getHotmapUrl:dn,handlerImage:fn,hotmapLine:mn,lineMouseDown:mt,hotmapImgs:vn}=Ko(l,r,tt);function vt(){var z,R,q;if(U||!((z=l.slide)!=null&&z.file)||!l.fileHandle||k.value)return;k.value=!0;const h=Number((q=(R=l.slide)==null?void 0:R.rotate)!=null?q:0);y.value=Number.isFinite(h)?h:0,ke=!0,l.fileHandle(l.slide).then(ie=>{var X,J,ce,_e,oe;U||(a.value=ie,f.value=(((X=a.value)==null?void 0:X.channel)||[]).map(te=>te.eqt_num),r.value=new ne.KfbView(se(Y({el:g.value,fileName:(J=l.slide)==null?void 0:J.file,showZrender:l.showZrender,scale:a.value.scanScale,lang:(u==null?void 0:u.value)==="en-US"?"en":u==null?void 0:u.value,navigator:{style:"left: 0;bottom: 0",thumbnail:a.value.thumbnailImg,width:200,height:180},grid:{show:!1,ruler:!1,pxConversion:!0},thumb:{bgColor:"rgba(0,0,0,0)"},graduation:{show:!0,right:120,bottom:(_e=(ce=a.value)==null?void 0:ce.channel)!=null&&_e.length?120:30,tick:{number:3,height:8}},pxConversion:{units:["um","mm"],binary:1e3,imageCapRes:a.value.imageCapRes||a.value.scanResolution||1},openSeadragonOptions:{maxZoomLevel:a.value.scanScale*20,pixelsPerArrowPress:200,animationTime:0,tileSources:gt()},tileDrawing:fn,label:{drawing:(te,re,fe)=>{if(Io(re)){const K=te.getContext("2d");K.save(),K.beginPath();const de=Ft(re),ve=Oe(re);de==="count"?(K.translate(fe.x-14,fe.y-22),Zt(K,ve)):de==="voice"?(K.translate(fe.x-16,fe.y-18),Xt(K,ve)):l.labelDrawing&&l.labelDrawing(K,re),K.restore()}}}},l.options||{}),{measure:Y({defaultShow:!0,scale:.1,handler:(te,re)=>re.subType==="measure"?[...te]:[]},((oe=l.options)==null?void 0:oe.measure)||{})})),Ae(),pn(),r.value.viewer.viewport.setRotation(y.value),an(),_n(),Yt(),M=setTimeout(()=>{var te,re;M=void 0,!U&&(te=l.analysis)!=null&&te.hotmap_path&&(re=l.analysis)!=null&&re.zoom_roi&&tt({x:l.analysis.zoom_roi.x,y:l.analysis.zoom_roi.y,width:l.analysis.zoom_roi.w,height:l.analysis.zoom_roi.h},5)},200))}).finally(()=>{U||(k.value=!1,V.value||(Vt({show:!1,ruler:!1}),bt({show:!1}),T=setTimeout(()=>{T=void 0,!U&&Et(!1)},100)))})}function pn(){var z,R;const h=(R=(z=r.value)==null?void 0:z.navigator)==null?void 0:R.element;h&&(h.style.zIndex="5")}function pt(h,z,R){const q=document.createElement("canvas");q.width=h.width,q.height=h.height;const ie=q.getContext("2d");if(ie&&ie.drawImage(h,0,0),getComputedStyle(z).position==="static"&&(z.style.position="relative"),R.fillHost)q.style.cssText=["position:absolute","left:0","top:0","width:100%","height:100%","pointer-events:none",`z-index:${R.zIndex}`].join(";");else{const J=["position:absolute",`left:${R.left}px`,`top:${R.top}px`,`width:${R.width}px`,`height:${R.height}px`,"pointer-events:none",`z-index:${R.zIndex}`];R.clipPath&&J.push(`clip-path:${R.clipPath}`),q.style.cssText=J.join(";")}z.appendChild(q);let X=!1;return()=>{X||(X=!0,q.remove())}}function hn(){var J,ce,_e,oe,te,re,fe;const h=[],z=(_e=(ce=(J=r.value)==null?void 0:J.viewer)==null?void 0:ce.drawer)==null?void 0:_e.canvas,R=g.value;if(z&&R){const K=z.getBoundingClientRect(),de=R.getBoundingClientRect(),ve=(te=(oe=r.value)==null?void 0:oe.navigator)==null?void 0:te.element;let Te;if(ve&&ve.style.display!=="none"){const we=ve.getBoundingClientRect();if(we.width&&we.height){const nt=we.left-K.left,ot=we.top-K.top,xt=nt+we.width,Vn=ot+we.height;if(xt>0&&Vn>0&&nt<K.width&&ot<K.height){const Nt=Math.max(0,nt),zt=Math.max(0,ot),St=Math.min(K.width,xt),Tt=K.width,Fe=K.height;Te=`polygon(0px 0px, ${Tt}px 0px, ${Tt}px ${Fe}px, ${St}px ${Fe}px, ${St}px ${zt}px, ${Nt}px ${zt}px, ${Nt}px ${Fe}px, 0px ${Fe}px)`}}}h.push(pt(z,R,{zIndex:1,left:K.left-de.left,top:K.top-de.top,width:K.width,height:K.height,clipPath:Te}))}const q=(fe=(re=r.value)==null?void 0:re.navigator)==null?void 0:fe.element,ie=q==null?void 0:q.querySelector("canvas");q&&ie&&q.style.display!=="none"&&h.push(pt(ie,q,{zIndex:2,fillHost:!0}));let X=!1;return()=>{X||(X=!0,h.forEach(K=>K()))}}function Ae(){var z,R,q;const h=(q=(R=(z=r.value)==null?void 0:z.viewer)==null?void 0:R.drawer)==null?void 0:q.canvas;if(h){if(B.value){h.style.filter=P.value?`url(#${d})`:"none";return}h.style.filter="url(#colorMatrixFilter)"}}function gn(){var fe;F=null;const h=(fe=r.value)==null?void 0:fe.viewer;if(!(h!=null&&h.world))return;const z=h.world.getItemAt(0);if(!z)return;const R=hn();let q=!1,ie=0;const X=()=>{var K;q||(q=!0,R(),clearTimeout(_e),h.removeHandler("tile-loaded",J),(K=oe==null?void 0:oe.removeHandler)==null||K.call(oe,"fully-loaded-change",ce))},J=()=>{ie++,ie>=2&&requestAnimationFrame(()=>X())},ce=K=>{var de;K.fullyLoaded&&((de=h.forceRedraw)==null||de.call(h),requestAnimationFrame(()=>X()))},_e=setTimeout(X,8e3);h.addHandler("tile-loaded",J);let oe;const te=h.viewport.getZoom(),re=h.viewport.getCenter();h.world.removeItem(z),h.addTiledImage({tileSource:gt(),success:function(){var K,de,ve;h.viewport.zoomTo(te),h.viewport.panTo(re),Ae(),oe=(K=h.world)==null?void 0:K.getItemAt(0),(de=oe==null?void 0:oe.addHandler)==null||de.call(oe,"fully-loaded-change",ce),(ve=h.forceRedraw)==null||ve.call(h)}})}function ht(){var h,z,R;(R=(z=(h=r.value)==null?void 0:h.viewer)==null?void 0:z.forceRedraw)==null||R.call(z)}function wn(){c("tool","save_fluorescence_channel",JSON.parse(JSON.stringify(L)))}e.watch(B,()=>Ae(),{flush:"post"}),e.watch(P,()=>Ae(),{flush:"post"}),e.watch([H,I,Z,j,G,E,_],()=>{B.value&&P.value&&ht()});function yn(){var ie,X;const h=a.value.tileWidth||a.value.imageBlockLen||256,z=a.value.tileHeight||a.value.imageBlockLen||256,R={};(ie=l.analysis)!=null&&ie.hotmap_path&&(((X=l.analysis)==null?void 0:X.hotmap_info)||[]).forEach(J=>{R[J[0]/h+"_"+J[1]/z+"_"+J[2]]=!0});let q=10;return a.value.ratiomap&&Object.keys(a.value.ratiomap).forEach(J=>{const ce=a.value.fileNum-Math.sqrt(a.value.scanScale/Number(J));ce>0&&(q=q?Math.min(q,ce):ce)}),{height:a.value.height,width:a.value.width,tileWidth:h,tileHeight:z,minLevel:Math.floor(q||8),getTileUrl:(J,ce,_e)=>{var fe,K,de,ve,Te;const oe=J,te={file:((fe=l.slide)==null?void 0:fe.file)||"",x:ce,y:_e,scale:"0",level:J,channel:ol(a.value,f.value)};a.value.fileNum===J?(J=a.value.scanScale,te.scale=J.toFixed(6)):(J=a.value.scanScale/Math.pow(2,a.value.fileNum-J),te.scale=J.toFixed(6)),te.level=oe,te.file=w.value===0?te.file:((de=(K=l.slide)==null?void 0:K.children)==null?void 0:de[w.value-1])||"";const re=l.tileHandle(te,l.slide);return(ve=l.analysis)!=null&&ve.hotmap_path?(R.length||(((Te=l.analysis)==null?void 0:Te.hotmap_info)||[]).forEach(we=>{R[we[0]/h+"_"+we[1]/z+"_"+we[2]]=!0}),dn(re,te,R)):re}}}function gt(){return F||(F=yn()),F}function _n(){r.value.viewer.addHandler("rotate",h=>{y.value=h.degrees||0,!ke&&(console.log("rotateChange",y.value,"isInitRotate",ke),We(y.value))}),r.value.viewer.addHandler("zoom",h=>{const z=r.value.viewer.viewport.viewportToImageZoom(h.zoom||0)*Number(r.value.$options.scale);v.value=Number(z.toFixed(2))}),r.value.$on(ne.KfbView.events.EVENT_NAVIGATOR_VESTIGE,h=>{l.navigatorHandle&&l.navigatorHandle("add",l.slide,h)}),l.navigatorHandle&&l.navigatorHandle("list",l.slide).then(h=>{var z,R;(R=(z=r.value.navigator)==null?void 0:z.drawPointList)==null||R.call(z,h)}),qt(),Wt(),ke=!1}function wt(){var h;if(O(),F=null,S.value=!1,!!((h=r.value)!=null&&h.destroy)){try{r.value.destroy()}catch(z){console.warn("kfbView destroy error:",z)}r.value={},a.value={width:0,height:0,fileNum:0,scanScale:1,fileName:"",ratiomap:{}},vn.value=[],f.value=[],v.value=0,y.value=0,w.value=0}}function yt(h,z){h==="annotate"?_t(z):h==="info"?N.value=!0:h==="flip"?Ct():h==="delete"?sn("delete")(Xe.value):c("tool",h,z)}function _t(h){if(h.tool==="Voice"&&(h.subType="voice",h.tool="Dot",h.custom=!0),h.tool==="Measure"&&(h.subType="measure",h.tool="Line"),(h==null?void 0:h.subType)==="count"){Object.assign(h,Y({once:!1,clear:!0,custom:!0},je));const z=Oe(h);z&&z!==Ne&&ln(z)}r.value.board.startDraw(h)}function kt(){if(Ie.value){Qe(),c("tool","count-draw-end");return}const h=r.value.board;h!=null&&h.isInDraw&&h.endDraw&&h.endDraw()}function Ct(){r.value.viewer.viewport.toggleFlip()}function kn(h){var z,R;(R=(z=m.value)==null?void 0:z.scopeChange)==null||R.call(z,h)}function Cn(){N.value=!0}function Vt(h){var z;(z=r.value)!=null&&z.grid&&r.value.grid.updated(h)}function bt(h){var z;(z=r.value)!=null&&z.graduation&&r.value.graduation.updated(h)}function Et(h){var z;(z=r.value)!=null&&z.navigator&&(r.value.navigator.element.style.display=h?"flex":"none")}function et(h){const z=r.value.viewer.viewport.imageToViewportZoom(Number(h/r.value.$options.scale));r.value.viewer.viewport.zoomTo(z)}function tt(h,z){r.value.area&&(r.value.area.moveToLabel(r.value.viewer.viewport.imageToViewportCoordinates(h.x+h.width/2,h.y+h.height/2)),et(z))}return e.provide("kfbView",r),e.provide("currentLabel",Xe),e.provide("is-count-drawing",Ie),e.provide("end-count-draw",()=>{Ie.value?(Qe(),c("tool","count-draw-end")):kt()}),o({kfbView:r,degrees:y,zoom:v,localLabelList:Je,isCountDrawing:Ie,forceRedraw:Ot,toggleFlip:Ct,startDraw:_t,endDraw:kt,endCountDraw:Qe,shotScreen:Kt,info:Cn,scopeChange:kn,updateGrid:Vt,updateGraduation:bt,updateNavigator:Et,fastMove:Gt,zoomTo:et,jumpToLabel:ft,jumpToPosition:tt,reloadLabelList:rn,isFluorescenceSlide:()=>{var h,z;return!!((z=(h=a.value)==null?void 0:h.channel)!=null&&z.length)},openFluorescenceChannelAdjust:()=>{var h,z;(z=(h=a.value)==null?void 0:h.channel)!=null&&z.length&&(S.value=!0)}}),(h,z)=>{var R,q,ie;return e.openBlock(),e.createElementBlock("div",{ref_key:"mainKfbViewRef",ref:p,class:"hzzt-kfb-view"},[h.slide.file?e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"kfbViewMainRef",ref:g,class:"hzzt-kfb-view__main","element-loading-text":e.unref(s)("加载中"),"element-loading-background":"rgba(0, 0, 0, 0.8)"},null,8,Rl)),[[e.unref(Ge),k.value]]):(e.openBlock(),e.createElementBlock("div",Il,z[6]||(z[6]=[e.createElementVNode("img",{style:{width:"50%"},src:Ve},null,-1)]))),h.analysis&&h.analysis.result?(e.openBlock(),e.createBlock(e.unref(b.ElTag),{key:2,class:"hzzt-kfb-view__tag",type:e.unref(Ee).type},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(Ee).name),1)]),_:1},8,["type"])):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",Al,[e.createElementVNode("filter",Fl,[e.createElementVNode("feColorMatrix",{values:e.unref(Ce),type:"matrix"},null,8,Hl),e.createElementVNode("feColorMatrix",{values:e.unref(Re),type:"saturate"},null,8,Ul),e.createElementVNode("feComponentTransfer",null,[e.createElementVNode("feFuncR",{id:"feFuncR",type:"gamma",exponent:e.unref(he).ga,amplitude:"1",offset:"0"},null,8,jl),e.createElementVNode("feFuncG",{id:"feFuncG",type:"gamma",exponent:e.unref(he).ga,amplitude:"1",offset:"0"},null,8,Ol),e.createElementVNode("feFuncB",{id:"feFuncB",type:"gamma",exponent:e.unref(he).ga,amplitude:"1",offset:"0"},null,8,ql)])])])),B.value?(e.openBlock(),e.createElementBlock("svg",Kl,[e.createElementVNode("filter",{id:e.unref(d),"color-interpolation-filters":"sRGB"},[e.createElementVNode("feColorMatrix",{type:"matrix",values:e.unref(H)},null,8,Gl),e.createElementVNode("feComponentTransfer",null,[e.createElementVNode("feFuncR",{type:"table",tableValues:e.unref(I)},null,8,Yl),e.createElementVNode("feFuncG",{type:"table",tableValues:e.unref(Z)},null,8,Zl),e.createElementVNode("feFuncB",{type:"table",tableValues:e.unref(j)},null,8,Xl)]),e.createElementVNode("feComponentTransfer",null,[e.createElementVNode("feFuncR",{type:"gamma",amplitude:1,exponent:e.unref(G)},null,8,Jl),e.createElementVNode("feFuncG",{type:"gamma",amplitude:1,exponent:e.unref(E)},null,8,Ql),e.createElementVNode("feFuncB",{type:"gamma",amplitude:1,exponent:e.unref(_)},null,8,ea)])],8,Wl)])):e.createCommentVNode("",!0),e.createVNode(yo,{menus:h.menus,onTool:yt},null,8,["menus"]),e.createVNode(Co,e.mergeProps(h.microscope,{ref_key:"microscopeRef",ref:m}),null,16),e.unref(V)&&h.slide.file&&a.value.labelImg?(e.openBlock(),e.createBlock(Lo,{key:4,visible:i.value,info:a.value,slide:h.slide,pathologyHandle:h.pathologyHandle,onTool:yt},null,8,["visible","info","slide","pathologyHandle"])):e.createCommentVNode("",!0),e.unref(x)?(e.openBlock(),e.createBlock(Xo,{key:5})):e.createCommentVNode("",!0),(R=h.slide.children)!=null&&R.length?(e.openBlock(),e.createBlock(Qo,{key:6,modelValue:w.value,"onUpdate:modelValue":z[0]||(z[0]=X=>w.value=X),slides:h.slide.children},null,8,["modelValue","slides"])):e.createCommentVNode("",!0),(ie=(q=a.value)==null?void 0:q.channel)!=null&&ie.length?(e.openBlock(),e.createBlock(rl,{key:7,modelValue:f.value,"onUpdate:modelValue":z[1]||(z[1]=X=>f.value=X),info:a.value,onLoad:gn},null,8,["modelValue","info"])):e.createCommentVNode("",!0),e.unref(Je).length?(e.openBlock(),e.createBlock(fl,{key:8,expand:A.value,"onUpdate:expand":z[2]||(z[2]=X=>A.value=X),style:e.normalizeStyle({top:h.analysis&&h.analysis.result?"24px":"4px"}),annotation:e.unref(Xe),annotations:e.unref(Je),onSelect:e.unref(ft)},null,8,["expand","style","annotation","annotations","onSelect"])):e.createCommentVNode("",!0),e.createVNode(e.unref(b.ElDialog),{modelValue:N.value,"onUpdate:modelValue":z[3]||(z[3]=X=>N.value=X),"append-to-body":!0,title:e.unref(s)("图像信息"),width:"700px",top:"5vh"},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElForm),{"label-position":"left"},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ElFormItem),{class:"flex","label-width":"0px"},{default:e.withCtx(()=>[e.createElementVNode("div",ta,[e.createElementVNode("img",{src:a.value.labelImg,style:{height:"180px",width:"auto","object-fit":"contain",background:"#f5f5f5"}},null,8,na),e.createElementVNode("img",{src:a.value.previewImg,style:{height:"180px","object-fit":"cover"},class:"flex-1"},null,8,oa)])]),_:1}),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("文件名")},{default:e.withCtx(()=>[e.createElementVNode("span",la,e.toDisplayString(a.value.fileName),1)]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("图像像素")},{default:e.withCtx(()=>[e.createElementVNode("span",aa,e.toDisplayString(a.value.width)+"Pixel - "+e.toDisplayString(a.value.height)+"Pixel",1)]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("扫描倍率")},{default:e.withCtx(()=>[e.createElementVNode("span",ra,e.toDisplayString(a.value.scanScale),1)]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("扫描时刻")},{default:e.withCtx(()=>[e.createElementVNode("span",ia,e.toDisplayString(a.value.scanTime),1)]),_:1},8,["label"]),e.createVNode(e.unref(b.ElFormItem),{label:e.unref(s)("扫描时间")},{default:e.withCtx(()=>[e.createElementVNode("span",sa,e.toDisplayString(a.value.scanDuration||0)+"s",1)]),_:1},8,["label"]),a.value.ext?(e.openBlock(),e.createBlock(e.unref(b.ElFormItem),{key:0,label:e.unref(s)("扫描设备")},{default:e.withCtx(()=>[e.createElementVNode("span",ua,e.toDisplayString(a.value.ext.machineNum||""),1)]),_:1},8,["label"])):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["modelValue","title"]),e.createVNode(e.unref(b.ElDialog),{modelValue:e.unref(Ye),"onUpdate:modelValue":z[4]||(z[4]=X=>e.isRef(Ye)?Ye.value=X:null),"append-to-body":!0,title:e.unref(s)("语音输入"),width:"500px",top:"5vh"},{footer:e.withCtx(()=>[e.createVNode(e.unref(b.ElButton),{onClick:e.unref(nn)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("取消")),1)]),_:1},8,["onClick"]),e.createVNode(e.unref(b.ElButton),{type:"primary",onClick:e.unref(on)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("确定")),1)]),_:1},8,["onClick"])]),default:e.withCtx(()=>[e.createVNode(e.unref(b.ElForm),{"label-position":"left"},{default:e.withCtx(()=>{var X;return[e.createVNode(e.unref(b.ElFormItem),null,{default:e.withCtx(()=>{var J;return[(J=e.unref(Ze))!=null&&J.src?(e.openBlock(),e.createElementBlock("audio",{key:0,class:"width-100%",src:e.unref(Ze).src,controls:"",preload:"auto"},null,8,ca)):e.createCommentVNode("",!0)]}),_:1}),(X=e.unref(Ze))!=null&&X.src?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(b.ElFormItem),{key:0},{default:e.withCtx(()=>[e.unref(dt)?(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:1,type:"danger",onClick:e.unref(en)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("结束录音")),1)]),_:1},8,["onClick"])):(e.openBlock(),e.createBlock(e.unref(b.ElButton),{key:0,type:"primary",onClick:e.unref(Qt)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(s)("开始录音")),1)]),_:1},8,["onClick"])),e.unref(dt)?(e.openBlock(),e.createElementBlock("span",da,e.toDisplayString(e.unref(s)("录音时长"))+":"+e.toDisplayString(e.unref(Jt))+"s",1)):e.createCommentVNode("",!0)]),_:1}))]}),_:1})]),_:1},8,["modelValue","title"]),h.analysis&&h.analysis.hotmap_path&&h.analysis.hotmap_type!=="switch"?(e.openBlock(),e.createElementBlock("div",{key:9,class:"hzzt-kfb-view__hotmap",style:e.normalizeStyle({left:e.unref(mn)+"px"})},[e.createVNode(e.unref(b.ElIcon),{class:"icon-caret-left",size:"30",onMousedown:e.unref(mt)},{default:e.withCtx(()=>z[7]||(z[7]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M672 192 288 511.936 672 832z"})],-1)])),_:1,__:[7]},8,["onMousedown"]),e.createVNode(e.unref(b.ElIcon),{class:"icon-caret-right",size:"30",onMousedown:e.unref(mt)},{default:e.withCtx(()=>z[8]||(z[8]=[e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M384 192v640l384-320.064z"})],-1)])),_:1,__:[8]},8,["onMousedown"])],4)):e.createCommentVNode("",!0),e.unref($)?(e.openBlock(),e.createElementBlock("div",fa)):e.createCommentVNode("",!0),e.createVNode(Pl,{modelValue:S.value,"onUpdate:modelValue":z[5]||(z[5]=X=>S.value=X),"display-rows":e.unref(D),"channel-params":e.unref(L),onApply:ht,onReset:e.unref(C),onSave:wn},null,8,["modelValue","display-rows","channel-params","onReset"]),e.renderSlot(h.$slots,"default")],512)}}});function ma(n,o){var i;const t=be.useStorage("default-open-ai",!!((i=n.ai)!=null&&i.default)),l=e.ref(t.value),c=e.ref(t.value),s=e.ref([]),u=e.computed(()=>{var a,d,S,B;return(a=o.value)!=null&&a.analysis?Object.prototype.toString.call((d=o.value)==null?void 0:d.analysis)==="[object Array]"?(S=o.value)==null?void 0:S.analysis:[(B=o.value)==null?void 0:B.analysis]:[]}),p=e.computed(()=>u.value.find(a=>(a==null?void 0:a.class)==="IQC")),g=e.computed(()=>!!p.value),m=e.computed(()=>u.value.find(a=>(a==null?void 0:a.class)!=="IQC")),N=e.computed(()=>!!m.value),r=e.computed(()=>l.value?m.value:c.value?p.value:void 0);e.watch(()=>{var a;return(a=o==null?void 0:o.value)==null?void 0:a.id},()=>{k(),y()}),e.onMounted(()=>{k(),y()});function k(){N.value&&l.value&&(c.value=!1),g.value&&c.value&&(l.value=!1)}function y(){var a;(a=o.value)!=null&&a.id&&u.value.length?N.value&&l.value||g.value&&c.value?v():s.value=[]:s.value=[]}function v(){n.ai.handle(o.value,r.value).then(a=>{s.value=a}).catch(()=>{s.value=[]})}function w(){c.value=!1,y()}function f(){l.value=!1,y()}return{hasAi:N,hasIqc:g,currentAnalysis:r,aiLabelList:s,enableAi:l,enableIqc:c,toggleIqc:f,toggleAi:w}}var va=e.defineComponent({name:"Edit",__name:"edit",setup(n){return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),e.createElementVNode("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}}),pa=va,ha=e.defineComponent({name:"View",__name:"view",setup(n){return(o,t)=>(e.openBlock(),e.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),ga=ha;const wa=["src"],ya=["src"],He=e.defineComponent({name:"KfbImage",__name:"KfbImage",props:{src:{type:String,required:!0,default:""},fit:{type:String,validator:n=>["","contain","cover","fill","none","scale-down"].includes(n),default:""},retryTimes:{type:Number,default:0},load:{type:Function,default:()=>({})},hover:{type:Boolean,default:!1},rotate:{type:Number,default:0}},setup(n){const o=n;let t=0;const l=e.ref(!1),c=e.reactive({x:0,y:0}),s=e.computed(()=>Y(Y({height:"100%",width:"100%",display:"block"},o.rotate?{transform:`rotate(${o.rotate}deg)`}:{}),o.fit?{objectFit:o.fit}:{})),u=e.computed(()=>({top:`${c.y+10}px`,left:`${c.x}px`,transform:"translateY(-50%)",width:`${4*300/3}px`,height:"300px",background:"rgba(0,0,0,0.8)",zIndex:"10000"}));function p(r){const k=r.target;t<o.retryTimes?(k.src=o.src,t++):k.src=Ve}function g(r){if(!o.hover)return;const k=r.currentTarget,y=k.querySelector("img"),v=(y==null?void 0:y.src)||"";if(!v||v.indexOf(Ve)>-1)return;const{x:w,y:f}=m(k),i=4*300/3,a=300;c.x=Math.min(Math.max(w,i/2),window.innerWidth-i/2),c.y=Math.min(Math.max(f,a/2+48),window.innerHeight-a/2),l.value=!0}function m(r){const k=r.getBoundingClientRect();return{x:k.right+4,y:Math.max(k.top+k.height/2,168)}}function N(){l.value=!1}return(r,k)=>(e.openBlock(),e.createElementBlock("div",{class:"relative hzzt-kfb-image-wrap",onMouseenter:g,onMouseleave:N},[e.createElementVNode("img",{src:n.src,onError:p,style:e.normalizeStyle(s.value)},null,44,wa),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[l.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed hzzt-kfb-img-triangle-left",style:e.normalizeStyle(u.value)},[e.createElementVNode("img",{src:n.src,style:e.normalizeStyle(Y({objectFit:"contain",height:"100%",width:"100%"},n.rotate?{transform:`rotate(${n.rotate}deg)`}:{})),onMouseenter:k[0]||(k[0]=()=>{l.value=!0}),onMouseleave:N},null,44,ya)],4)):e.createCommentVNode("",!0)]))],32))}}),_a={},ka={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"};function Ca(n,o){return e.openBlock(),e.createElementBlock("svg",ka,o[0]||(o[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z"},null,-1)]))}const Va=ye(_a,[["render",Ca]]),ba={},Ea={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function xa(n,o){return e.openBlock(),e.createElementBlock("svg",Ea,o[0]||(o[0]=[e.createElementVNode("g",{id:"Frame"},[e.createElementVNode("path",{id:"Vector",d:"M5.33333 2.66659H14V3.99992H5.33333V2.66659ZM2 2.33325H4V4.33325H2V2.33325ZM2 6.99992H4V8.99992H2V6.99992ZM2 11.6666H4V13.6666H2V11.6666ZM5.33333 7.33325H14V8.66659H5.33333V7.33325ZM5.33333 11.9999H14V13.3333H5.33333V11.9999Z",fill:"currentColor","fill-opacity":"0.9"})],-1)]))}const Na=ye(ba,[["render",xa]]);function za(n,o){const t=new URL(n);return t.searchParams.set("file_index",String(o)),t.href}function Sa(n){return[...n].sort((o,t)=>o.left-t.left)}function Ta(n){var c,s;if(n.length<2)return null;const o=window.screenX+window.outerWidth/2,t=Sa(n);let l=t.findIndex(u=>o>=u.left&&o<u.left+u.width);return l<0&&(l=t.findIndex(u=>o>=u.left&&o<=u.left+u.width)),l<0&&(l=0),(s=(c=t[l+1])!=null?c:t[l-1])!=null?s:null}function Ba(){return ge(this,null,function*(){var g,m;const n=window;if(typeof n.getScreenDetails=="function")try{const N=yield n.getScreenDetails(),r=Ta(N.screens);if(r)return{left:r.availLeft,top:r.availTop,width:Math.max(480,r.availWidth),height:Math.max(360,r.availHeight)}}catch(N){}const o=window.screen,t=(g=o.availLeft)!=null?g:0,l=(m=o.availTop)!=null?m:0,c=t+o.availWidth,s=window.screenX+window.outerWidth;return{left:Math.max(c,s),top:l,width:Math.max(480,Math.min(1600,o.availWidth)),height:Math.max(360,o.availHeight)}})}function $a(){return ge(this,arguments,function*(n={}){var g,m;const o=(g=n.url)!=null?g:window.location.href,t=(m=n.target)!=null?m:"_blank",{left:l,top:c,width:s,height:u}=yield Ba(),p=["popup=yes",`left=${Math.round(l)}`,`top=${Math.round(c)}`,`width=${Math.round(s)}`,`height=${Math.round(u)}`,"noopener","noreferrer"].join(",");return window.open(o,t,p)})}const Da={class:"hzzt-kfb-slides"},La={class:"hzzt-kfb-slides__row"},Ma={class:"hzzt-kfb-slides__top"},Pa={key:0,class:"flex align-items-center"},Ra={class:"text-primary"},Ia={key:1},Aa={class:"text-primary"},Fa={class:"flex align-items-center"},Ha={key:0},Ua=["data-index","onClick","onContextmenu"],ja={key:0},Oa={class:"hzzt-kfb-slides__gallery"},qa=["onClick"],Ka={key:0,class:"hzzt-kfb-slides__read"},Wa=["onClick"],Ga={key:1},Ya={class:"hzzt-kfb-slides__unUploaded"},Za={class:"margin-l-2 ellipsis"},Xa={key:1,class:"flex column hzzt-kfb-slides__list"},Ja={class:"hzzt-kfb-slides__header"},Qa={class:"w-30%"},er={class:"w-40%"},tr={class:"w-20%"},nr=["data-index","onClick","onContextmenu"],or={key:0,style:{height:"100%",width:"100%",display:"flex","align-items":"center"}},lr={class:"w-30% flex"},ar={class:"hzzt-kfb-slides__gallery hzzt-kfb-slides__gallery--list"},rr={key:1,class:"hzzt-kfb-slides__read"},ir={class:"w-40% flex"},sr=["onClick"],ur=["onClick"],cr={key:1},dr={class:"hzzt-kfb-slides__unUploaded"},fr={class:"margin-l-2 ellipsis"},mr={class:"flex column py-2"},vr={class:"flex align-items-center justify-content-center"},pr={class:"margin-r-1"},hr={class:"margin-r-1 margin-l-2"},gr=e.defineComponent({__name:"KfbSlideList",props:{slides:{},editPathology:{type:Boolean},pathologyNumber:{}},emits:["select","tool"],setup(n,{expose:o,emit:t}){const l=n,c=t,s=e.inject("file-index",{value:0}),u=e.inject("divide",{value:!1}),p=e.inject("sync",{value:!1}),g=e.ref(!1),m=e.ref(null),N=e.ref(null),r=e.reactive({show:!1,x:0,y:0,slide:null,index:-1});let k=null;const y=e.reactive({});let v=null;const w=e.computed(()=>l.slides.filter(E=>!!E.read)),{t:f}=me();function i(E,_){return`${E}-${_}`}function a(E,_){return!!y[i(E,_)]}function d(){Object.keys(y).forEach(E=>delete y[E])}function S(){return ge(this,null,function*(){m.value&&(v==null||v.disconnect(),v=new IntersectionObserver(E=>{E.forEach(_=>{if(!_.isIntersecting)return;const C=_.target,D=C.dataset.index,V=D?Number(D):NaN;Number.isNaN(V)||(y[i(V,"label")]=!0,y[i(V,"preview")]=!0),v==null||v.unobserve(C)})},{root:m.value,rootMargin:"200px 0px",threshold:.01}),yield e.nextTick(),m.value.querySelectorAll("[data-index]").forEach(E=>v==null?void 0:v.observe(E)))})}function B(E){s.value=E,c("select",E)}function P(E){E.check=!E.check}function L(E){var V;if(!m.value)return;const _=m.value.querySelector(`[data-index="${E}"]`),C=m.value.querySelector('[data-index="0"]');if(!(_!=null&&_.getBoundingClientRect)||!(C!=null&&C.getBoundingClientRect))return;const D=(V=C.getBoundingClientRect().y)!=null?V:0;m.value.scrollTop=_.getBoundingClientRect().y-D}function H(){u.value||(p.value=!1)}function W(){r.show=!1,r.slide=null,r.index=-1,k&&(document.removeEventListener("pointerdown",k,!0),k=null)}function I(){k&&document.removeEventListener("pointerdown",k,!0),k=E=>{const _=N.value;_&&E.target instanceof Node&&_.contains(E.target)||W()},document.addEventListener("pointerdown",k,!0)}function Z(){const E=N.value;if(!E)return;const _=E.getBoundingClientRect(),C=8;let D=r.x,V=r.y;_.right>window.innerWidth-C&&(D=Math.max(C,window.innerWidth-_.width-C)),_.bottom>window.innerHeight-C&&(V=Math.max(C,window.innerHeight-_.height-C)),r.x=D,r.y=V}function j(){return ge(this,null,function*(){const E=r.index>=0?r.index:s.value,_=za(window.location.href,E);yield $a({url:_}),W()})}function G(E,_,C){r.x=E.clientX,r.y=E.clientY,r.slide=_,r.index=C,r.show=!0,e.nextTick(()=>{Z(),I()})}return o({jumpToSlide:L}),e.watch(()=>[l.slides.length,g.value],()=>ge(this,null,function*(){d(),yield S()}),{immediate:!0}),e.onMounted(()=>{S()}),e.onBeforeUnmount(()=>{v==null||v.disconnect(),v=null,k&&(document.removeEventListener("pointerdown",k,!0),k=null)}),(E,_)=>(e.openBlock(),e.createElementBlock("div",Da,[e.createElementVNode("div",La,[e.createElementVNode("div",Ma,[E.editPathology?(e.openBlock(),e.createElementBlock("div",Pa,[e.createVNode(e.unref(b.ElIcon),{class:"margin-r-2 pointer text-primary",size:"16",onClick:_[0]||(_[0]=C=>c("tool","edit-pathology"))},{default:e.withCtx(()=>[e.createVNode(e.unref(pa))]),_:1}),e.createElementVNode("span",Ra,e.toDisplayString(E.pathologyNumber||e.unref(f)("未知"))+"("+e.toDisplayString(w.value.length)+"/"+e.toDisplayString(E.slides.length)+")",1)])):(e.openBlock(),e.createElementBlock("span",Ia,[e.createTextVNode(e.toDisplayString(e.unref(f)("已读"))+":",1),e.createElementVNode("span",Aa,e.toDisplayString(w.value.length),1),e.createTextVNode("/"+e.toDisplayString(E.slides.length),1)])),e.createElementVNode("div",Fa,[E.editPathology?(e.openBlock(),e.createBlock(e.unref(b.ElIcon),{key:0,class:"margin-r-2 pointer",size:"16",onClick:_[1]||(_[1]=C=>c("tool","view-all"))},{default:e.withCtx(()=>[e.createVNode(e.unref(ga))]),_:1})):e.createCommentVNode("",!0),e.createVNode(e.unref(b.ElIcon),{class:"margin-r-2 pointer",size:"16",color:g.value?"#999":"#000",onClick:_[2]||(_[2]=C=>g.value=!g.value)},{default:e.withCtx(()=>[e.createVNode(Va)]),_:1},8,["color"]),e.createVNode(e.unref(b.ElIcon),{class:"pointer",name:"cus-list",size:"16",color:g.value?"#000":"#999",onClick:_[3]||(_[3]=C=>g.value=!g.value)},{default:e.withCtx(()=>[e.createVNode(Na)]),_:1},8,["color"])])]),e.createElementVNode("div",{class:"flex-1 overflow-auto",style:{width:"100%",padding:"0 8px"},ref_key:"slidesRef",ref:m},[g.value?(e.openBlock(),e.createElementBlock("ul",Xa,[e.createElementVNode("li",Ja,[_[7]||(_[7]=e.createElementVNode("div",{class:"w-10%"},null,-1)),e.createElementVNode("div",Qa,e.toDisplayString(e.unref(f)("缩略图")),1),e.createElementVNode("div",er,e.toDisplayString(e.unref(f)("切片名")),1),e.createElementVNode("div",tr,e.toDisplayString(e.unref(f)("评分")),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.slides,(C,D)=>(e.openBlock(),e.createElementBlock("li",{key:D,"data-index":D,class:"flex align-items-center overflow-hidden hzzt-kfb-slides__row-li",style:e.normalizeStyle({backgroundColor:e.unref(s)===D?"rgba(6, 85, 195, 0.1)":"#fff"}),onClick:V=>C.isNotUpload?()=>{}:B(D),onContextmenu:e.withModifiers(V=>G(V,C,D),["prevent"])},[C.isNotUpload?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",or,[e.createElementVNode("div",{class:"w-10% text-center",onClick:e.withModifiers(()=>{},["stop"])},[e.createVNode(e.unref(b.ElCheckbox),{modelValue:C.check,"onUpdate:modelValue":V=>C.check=V,style:{width:"14px",height:"16px"}},null,8,["modelValue","onUpdate:modelValue"])]),e.createElementVNode("div",lr,[e.createElementVNode("div",ar,[C.labelImg?(e.openBlock(),e.createBlock(He,{key:0,rotate:C.angle||0,"retry-times":1,src:a(D,"label")?C.labelImg:e.unref(Ve),fit:"cover",hover:"",class:"hzzt-kfb-slides__list-thumb hzzt-kfb-slides__list-thumb--label"},null,8,["rotate","src"])):e.createCommentVNode("",!0),e.createVNode(He,{"retry-times":1,fit:"cover",src:a(D,"preview")?C.previewImg:e.unref(Ve),class:"hzzt-kfb-slides__list-thumb"},null,8,["src"]),C.read?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",rr,e.toDisplayString(e.unref(f)("未读")),1))])]),e.createElementVNode("div",ir,[e.createVNode(e.unref(b.ElTooltip),{effect:"dark",placement:"bottom",content:`${C.name}`},{default:e.withCtx(()=>[e.createElementVNode("span",{style:{"line-height":"16px"},class:"margin-l-1 ellipsis hzzt-kfb-slides__text",dir:"rtl",onClick:e.withModifiers(V=>P(C),["stop"])},e.toDisplayString(C.name),9,sr)]),_:2},1032,["content"])]),e.createElementVNode("div",{class:"w-20% flex text-center pointer",style:e.normalizeStyle({color:C.gradeColor}),onClick:V=>c("tool","grade",C)},e.toDisplayString(C.grade),13,ur)])),C.isNotUpload?(e.openBlock(),e.createElementBlock("div",cr,[e.createElementVNode("span",dr,e.toDisplayString(e.unref(f)("未扫描")),1),e.createElementVNode("span",fr,e.toDisplayString(C.name),1)])):e.createCommentVNode("",!0)],44,nr))),128))])):(e.openBlock(),e.createElementBlock("div",Ha,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.slides,(C,D)=>(e.openBlock(),e.createElementBlock("div",{key:D,class:e.normalizeClass(["hzzt-kfb-slides__box",e.unref(s)===D?"hzzt-kfb-slides__box--active":""]),"data-index":D,onClick:V=>C.isNotUpload?()=>{}:B(D),onContextmenu:e.withModifiers(V=>G(V,C,D),["prevent"])},[C.isNotUpload?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ja,[e.createElementVNode("div",Oa,[C.labelImg?(e.openBlock(),e.createBlock(He,{key:0,rotate:C.angle||0,"retry-times":1,src:a(D,"label")?C.labelImg:e.unref(Ve),class:"hzzt-kfb-slides__img hzzt-kfb-slides__img--label",fit:"cover",hover:""},null,8,["rotate","src"])):e.createCommentVNode("",!0),e.createVNode(He,{"retry-times":1,src:a(D,"preview")?C.previewImg:e.unref(Ve),class:"hzzt-kfb-slides__img1",fit:"cover"},null,8,["src"])]),e.createElementVNode("div",{class:"flex justify-content-between align-items-center",onClick:e.withModifiers(()=>{},["stop"])},[e.createVNode(e.unref(b.ElCheckbox),{modelValue:C.check,"onUpdate:modelValue":V=>C.check=V,style:{width:"14px",height:"16px"}},null,8,["modelValue","onUpdate:modelValue"]),e.createVNode(e.unref(b.ElTooltip),{effect:"dark",placement:"bottom",content:`${C.name}`},{default:e.withCtx(()=>[e.createElementVNode("span",{style:{"line-height":"16px","text-align":"center",width:"calc(100% - 14px)"},class:"margin-l-1 ellipsis",onClick:e.withModifiers(V=>P(C),["stop"])},e.toDisplayString(C.name),9,qa)]),_:2},1032,["content"])]),C.read?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ka,e.toDisplayString(e.unref(f)("未读")),1)),e.renderSlot(E.$slots,"slide-extra",{slide:C},void 0,!0),C.grade?(e.openBlock(),e.createElementBlock("div",{key:1,class:"hzzt-kfb-slides__grade",style:e.normalizeStyle({background:C.gradeColor}),onClick:V=>c("tool","grade",C)},e.toDisplayString(C.grade),13,Wa)):e.createCommentVNode("",!0),e.renderSlot(E.$slots,"slide",{slide:C},void 0,!0)])),C.isNotUpload?(e.openBlock(),e.createElementBlock("div",Ga,[e.createElementVNode("span",Ya,e.toDisplayString(e.unref(f)("未扫描")),1),e.createElementVNode("span",Za,e.toDisplayString(C.name),1)])):e.createCommentVNode("",!0)],42,Ua))),128))]))],512),e.renderSlot(E.$slots,"footer",{},void 0,!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[r.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"hzzt-kfb-slides__ctx-mask",onClick:W,onContextmenu:e.withModifiers(W,["prevent"])},null,32)):e.createCommentVNode("",!0),r.show?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"contextMenuPanelRef",ref:N,class:"hzzt-kfb-slides__ctx-panel",style:e.normalizeStyle({left:`${r.x}px`,top:`${r.y}px`}),role:"menu",onClick:_[4]||(_[4]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(E.$slots,"slide-contextmenu",{slide:r.slide,index:r.index,close:W,openOnOtherScreen:j},()=>[e.createElementVNode("button",{type:"button",class:"hzzt-kfb-slides__ctx-item",onClick:j},e.toDisplayString(e.unref(f)("在新窗口打开")),1)],!0)],4)):e.createCommentVNode("",!0)])),e.createElementVNode("div",mr,[e.createElementVNode("div",vr,[e.createElementVNode("span",pr,e.toDisplayString(e.unref(f)("分屏")),1),e.createVNode(e.unref(b.ElSwitch),{onChange:H,modelValue:e.unref(u),"onUpdate:modelValue":_[5]||(_[5]=C=>e.isRef(u)?u.value=C:null)},null,8,["modelValue"]),e.createElementVNode("span",hr,e.toDisplayString(e.unref(f)("同步")),1),e.createVNode(e.unref(b.ElSwitch),{disabled:!e.unref(u),modelValue:e.unref(p),"onUpdate:modelValue":_[6]||(_[6]=C=>e.isRef(p)?p.value=C:null)},null,8,["disabled","modelValue"])])])])]))}}),wr=ye(gr,[["__scopeId","data-v-d5b18108"]]),yr={class:"hzzt-kfb-ai overflow-hidden"},_r={class:"flex align-items-center margin-t-1"},kr=["onClick"],Cr={style:{color:"var(--el-color-success)"}},Vr={class:"flex-1 flex overflow-auto wrap margin-t-1"},br=["onClick"],Er={key:0,style:{"margin-left":"2px"}},xr=e.defineComponent({name:"KfbAiList",__name:"list",props:{data:{default:()=>[]},analysis:{}},setup(n,{expose:o}){const t=n,{t:l}=me(),c=e.inject("kfbViewRef"),s=e.ref(-1),u=e.ref(1),p=e.ref(100),g=e.ref(!0),m=e.ref([]),N=e.computed(()=>t.data.filter(B=>m.value.includes(B.cls||""))),r=e.computed(()=>N.value.slice((u.value-1)*p.value,u.value*p.value)),k=e.computed(()=>{const B=new Set;return t.data.forEach(P=>{const L=P.cls||"";L&&!B.has(L)&&B.add(L)}),Array.from(B)}),y=e.computed(()=>m.value.length!==0&&m.value.length!==k.value.length),v=jt(t);e.watch(()=>k.value,B=>{w(),m.value=[...B]}),e.onMounted(()=>{m.value=[...k.value]});function w(){s.value=-1,u.value=1,p.value=100,g.value=!0}function f(B){const P=N.value.findIndex(L=>L.id===B.id);s.value=P,c.value.jumpToLabel(B,5)}function i(B){const P=t.data.filter(L=>L.cls===B);return P.length?`(${P.length})`:""}function a(){s.value=-1,g.value=m.value.length==k.value.length}function d(B){m.value=B?[...k.value]:[],s.value=-1}function S(B,P){B.stopPropagation(),B.preventDefault(),m.value=[P],a()}return o({labelList:N}),(B,P)=>(e.openBlock(),e.createElementBlock("div",yr,[e.createElementVNode("div",_r,[e.createVNode(e.unref(b.ElPopover),{placement:"bottom",trigger:"click",width:"160"},{reference:e.withCtx(()=>[e.createVNode(e.unref(b.ElButton),{class:"margin-r-1",type:"primary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("分类"))+" ",1),e.createVNode(le,{name:"arrowDown"})]),_:1})]),default:e.withCtx(()=>[e.createElementVNode("div",null,[e.createVNode(e.unref(b.ElCheckbox),{modelValue:g.value,"onUpdate:modelValue":P[0]||(P[0]=L=>g.value=L),indeterminate:y.value,onChange:d},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(l)("全选")),1)]),_:1},8,["modelValue","indeterminate"]),e.createVNode(e.unref(b.ElCheckboxGroup),{modelValue:m.value,"onUpdate:modelValue":P[1]||(P[1]=L=>m.value=L),class:"flex column",onChange:a},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.value,L=>(e.openBlock(),e.createBlock(e.unref(b.ElCheckbox),{key:L,value:L},{default:e.withCtx(()=>[e.createElementVNode("p",{onClick:H=>S(H,L)},[e.createTextVNode(e.toDisplayString(L),1),e.createElementVNode("span",Cr,e.toDisplayString(i(L)),1)],8,kr)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])])]),_:1}),e.createVNode(e.unref(b.ElTag),{type:e.unref(v).type,class:"margin-l-1"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(v).name),1)]),_:1},8,["type"])]),e.renderSlot(B.$slots,"default",{analysis:B.analysis}),e.createElementVNode("div",Vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(L,H)=>(e.openBlock(),e.createElementBlock("div",{key:H+(u.value-1)*p.value,class:e.normalizeClass(`hzzt-kfb-ai__img ${s.value===H+(u.value-1)*p.value?"hzzt-kfb-ai__img--active":""}`),onClick:W=>f(L)},[e.createVNode(e.unref(Sn),{"retry-times":1,src:L.imageUrl,"error-src":e.unref(Ve)},null,8,["src","error-src"]),e.createElementVNode("div",{style:e.normalizeStyle({color:L.strokeStyle}),class:"ellipsis"},[e.createTextVNode(e.toDisplayString(L.cls)+" ",1),L.score?(e.openBlock(),e.createElementBlock("span",Er,e.toDisplayString(L.score),1)):e.createCommentVNode("",!0)],4)],10,br))),128))]),e.createVNode(e.unref(b.ElPagination),{class:"wrap","current-page":u.value,"onUpdate:currentPage":P[2]||(P[2]=L=>u.value=L),"page-size":p.value,"onUpdate:pageSize":P[3]||(P[3]=L=>p.value=L),"page-sizes":[100,200,300,400],layout:"total, sizes, prev, pager, next",total:N.value.length},null,8,["current-page","page-size","total"])]))}}),Nr={class:"hzzt-kfb-slide"},zr={class:"flex flex-1 overflow-hidden"},Sr={class:"flex flex-1"},Tr={key:0,style:{height:"100%",width:"100%"},class:"flex wrap"},Br=["onClick"],qe=e.defineComponent({name:"HzztKfbSlide",__name:"HzztKfbSlide",props:e.mergeModels({menus:{default:()=>[]},kfb:{},slides:{default:()=>[]},ai:{},teleport:{type:Boolean,default:!1},watermark:{},process:{},microscope:{},showList:{type:Boolean,default:!0},showKfbLabel:{type:Boolean,default:!0},showKeyboard:{type:Boolean,default:!1},showMenuText:{type:Boolean,default:!0},showWatermark:{type:Boolean,default:!1},showZrender:{type:Boolean,default:!1},editPathology:{type:Boolean,default:!1},pathologyNumber:{}},{index:{default:0},indexModifiers:{}}),emits:e.mergeModels(["tool"],["update:index"]),setup(n,{expose:o,emit:t}){const l=n,c=t,s=e.useSlots(),u=e.useModel(n,"index"),p=e.computed(()=>l.slides[u.value]),g=e.computed(()=>l.slides.filter(({check:T})=>T)),m=e.ref(),N=e.ref(),r=e.ref(),k=e.ref(),y=be.useStorage("kfb-showKeyboard",l.showKeyboard),v=be.useStorage("kfb-showKfbLabel",l.showKfbLabel),w=be.useStorage("kfb-showWatermark",l.showWatermark),f=be.useStorage("kfb-showMenuText",l.showMenuText),i=be.useStorage("kfb-menuConfigOtherSetting",{screenshotLocally:!1,screenshotIncludeAnnotations:!0,screenshotFormat:"image/jpeg",screenshotWatermark:{time:!1,mac:!1,scale:!1,ratio:!1},screenshotSize:{w:200,h:200},labelDisplayDuration:15}).value;i.screenshotIncludeAnnotations===void 0&&(i.screenshotIncludeAnnotations=!0),i.labelDisplayDuration===void 0&&(i.labelDisplayDuration=15);const a=e.ref(!1),d=e.ref(!1),{t:S}=me(),B=e.computed(()=>{var T;if(a.value){const F=g.value.findIndex(({id:O})=>{var ae;return O===((ae=p.value)==null?void 0:ae.id)});return((T=r.value)==null?void 0:T[F])||N.value}else return N.value}),P=e.computed(()=>g.value.length<=1?{height:"100%",width:"100%"}:g.value.length<=2?{height:"100%",width:"calc((100% - 4px) / 2)"}:g.value.length<=4?{height:"calc((100% - 4px) / 2)",width:"calc((100% - 4px) / 2)"}:g.value.length<=6?{height:"calc((100% - 4px) / 2)",width:"calc((100% - 4px * 2) / 3)"}:g.value.length<=9?{height:"calc((100% - 4px * 2) / 3)",width:"calc((100% - 4px * 2) / 3)"}:{height:"100%",width:"100%"});e.watch(()=>g.value,T=>{a.value&&T.length<=1&&(a.value=!1)}),e.watch(()=>p.value,T=>{if(T){const F=T.read;T.read=!0,c("tool","choose",{slide:T,read:F})}}),Object.entries({keyboard:y,kfbLabel:v,watermark:w,menuText:f}).forEach(([T,F])=>{e.watch(()=>F.value,O=>{c("tool",T,O)})});const{hasAi:H,hasIqc:W,currentAnalysis:I,aiLabelList:Z,enableAi:j,enableIqc:G,toggleIqc:E,toggleAi:_}=ma(l,p);function C(T,F){if(T==="next"&&l.slides[u.value+1]&&u.value++,T==="prev"&&l.slides[u.value-1]&&u.value--,(T==="label"||T==="tool")&&(v.value=F),T.includes("tailor")){B.value.shotScreen(T,r);return}c("tool",T,F)}function D(T){var O,ae;const F=se(Y({},l.kfb),{showZrender:l.showZrender,watermark:l.watermark,process:l.process,microscope:l.microscope,slide:T,aiLabelList:p.value.id===T.id?((O=k.value)==null?void 0:O.labelList)||[]:[],syncPosition:d.value,syncZoom:d.value,handle:void 0,analysis:p.value.id===T.id?I.value:void 0});return(ae=l.kfb)!=null&&ae.handle?l.kfb.handle(T,F):F}function V(T){u.value=l.slides.findIndex(F=>F.id===T.id)}function x(T){a.value&&(l.slides[T].check=!0)}function $(){var T;(T=a.value?r.value:[N.value])==null||T.forEach(F=>{v.value||(F.updateGrid({show:v.value,ruler:v.value}),y.value=v.value),F.updateGraduation({show:v.value}),F.updateNavigator(v.value)})}function A(T){u.value=T,m.value&&m.value.jumpToSlide(T)}function U(T,F){B.value&&B.value.jumpToLabel(T,F)}function Q(T,F){B.value&&B.value.jumpToPosition(T,F)}function M(T){B.value.shotScreen(T,r)}return e.provide("kfbViewRef",B),e.provide("kfbViewRefs",r),e.provide("show-keyboard",y),e.provide("show-kfb-label",v),e.provide("show-menu-text",f),e.provide("show-watermark",w),e.provide("file-index",u),e.provide("divide",a),e.provide("sync",d),e.provide("menu-config-other-setting",i),o({divide:a,sync:d,slide:p,kfbViewRef:B,kfbViewRefs:r,jumpToSlide:A,jumpToLabel:U,jumpToPosition:Q,shotScreen:M,analysis:I,enableAi:j,enableIqc:G,showAiList:e.computed(()=>{var T;return!!((T=l.ai)!=null&&T.enable)&&Z.value.length})}),(T,F)=>(e.openBlock(),e.createElementBlock("div",Nr,[T.menus.length?(e.openBlock(),e.createBlock(Le,{key:0,menu:T.menus,divideMode:a.value,process:T.process,microscope:T.microscope,onTool:C},{left:e.withCtx(()=>[e.renderSlot(T.$slots,"left")]),right:e.withCtx(()=>[e.createVNode(e.unref(b.ElSwitch),{modelValue:e.unref(v),"onUpdate:modelValue":F[0]||(F[0]=O=>e.isRef(v)?v.value=O:null),"active-text":e.unref(S)("隐藏标签"),"active-value":!1,"inactive-value":!0,class:"margin-r-2",onChange:$},null,8,["modelValue","active-text"]),T.ai&&T.ai.enable&&e.unref(W)?(e.openBlock(),e.createBlock(e.unref(b.ElSwitch),{key:0,modelValue:e.unref(G),"onUpdate:modelValue":F[1]||(F[1]=O=>e.isRef(G)?G.value=O:null),"active-text":e.unref(S)("AI质控"),class:"margin-r-2",onChange:e.unref(E)},null,8,["modelValue","active-text","onChange"])):e.createCommentVNode("",!0),T.ai&&T.ai.enable&&e.unref(H)?(e.openBlock(),e.createBlock(e.unref(b.ElSwitch),{key:1,modelValue:e.unref(j),"onUpdate:modelValue":F[2]||(F[2]=O=>e.isRef(j)?j.value=O:null),"active-text":e.unref(S)("AI分析"),class:"margin-r-2",onChange:e.unref(_)},null,8,["modelValue","active-text","onChange"])):e.createCommentVNode("",!0),e.renderSlot(T.$slots,"right")]),_:3},8,["menu","divideMode","process","microscope"])):e.createCommentVNode("",!0),e.createElementVNode("div",zr,[T.showList?(e.openBlock(),e.createBlock(e.Teleport,{key:0,defer:"",to:"#kfb-slide-list",disabled:!T.teleport},[e.createVNode(wr,{ref_key:"slidesRef",ref:m,style:e.normalizeStyle(T.teleport?"":"width: 250px"),editPathology:T.editPathology,pathologyNumber:T.pathologyNumber,slides:T.slides,onSelect:x,onTool:C},e.createSlots({slide:e.withCtx(({slide:O})=>[e.renderSlot(T.$slots,"list",{slide:O})]),"slide-extra":e.withCtx(({slide:O})=>[e.renderSlot(T.$slots,"slide-extra",{slide:O})]),footer:e.withCtx(()=>[e.renderSlot(T.$slots,"listFooter")]),_:2},[e.unref(s)["slide-contextmenu"]?{name:"slide-contextmenu",fn:e.withCtx(O=>[e.renderSlot(T.$slots,"slide-contextmenu",e.normalizeProps(e.guardReactiveProps(O)))]),key:"0"}:void 0]),1032,["style","editPathology","pathologyNumber","slides"])],8,["disabled"])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{defer:"",to:"#kfb-slide-view",disabled:!T.teleport},[e.createElementVNode("div",Sr,[g.value.length&&a.value?(e.openBlock(),e.createElementBlock("ul",Tr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,O=>(e.openBlock(),e.createElementBlock("li",{key:O.id,style:e.normalizeStyle(P.value),class:e.normalizeClass(p.value.id===O.id?"hzzt-kfb-view-screen-active":""),onClick:ae=>V(O)},[(e.openBlock(),e.createBlock(Se,e.mergeProps({ref_for:!0,ref_key:"kfbViewRefs",ref:r,key:`kfb-${O.id}`},{ref_for:!0},D(O),{onTool:C}),{default:e.withCtx(()=>[e.renderSlot(T.$slots,"kfb",{slide:O})]),_:2},1040))],14,Br))),128))])):p.value?(e.openBlock(),e.createBlock(Se,e.mergeProps({key:1,ref_key:"kfbViewRef",ref:N},D(p.value),{onTool:C}),{default:e.withCtx(()=>[e.renderSlot(T.$slots,"kfb",{slide:p.value})]),_:3},16)):e.createCommentVNode("",!0)])],8,["disabled"])),T.ai&&T.ai.enable&&e.unref(Z).length?(e.openBlock(),e.createBlock(e.Teleport,{key:1,defer:"",to:"#kfb-slide-ai",disabled:!T.teleport},[e.createVNode(xr,{style:e.normalizeStyle(T.teleport?"":"width: 350px"),ref_key:"kfbAiRef",ref:k,data:e.unref(Z),slide:p.value,analysis:e.unref(I)},{default:e.withCtx(({analysis:O})=>[e.renderSlot(T.$slots,"analysis",{analysis:O})]),_:3},8,["style","data","slide","analysis"])],8,["disabled"])):e.createCommentVNode("",!0),e.renderSlot(T.$slots,"default")])]))}});qe.name="HzztKfbSlide";Se.name="HzztKfbView";Le.name="HzztKfbToolbox";const $r=(n,o)=>{n.use(Tn,o==null?void 0:o.i18n),n.component(qe.name,qe),n.component(Se.name,Se),n.component(Le.name,Le)},Dr={install:$r};exports.DEFAULT_MICROSCOPE=Ue;exports.DEFAULT_PROCESS=ct;exports.I18N_INJECT_KEY=ut;exports._export_sfc=ye;exports._sfc_main=le;exports._sfc_main$1=qe;exports._sfc_main$2=Se;exports._sfc_main$3=Le;exports.getCountDrawStartOptions=Ro;exports.getLabelStrokeStyle=Oe;exports.index=Dr;exports.isCountDotLabel=Ke;exports.useLocalI18n=me;