ht-emr 0.4.2

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.
@@ -0,0 +1,977 @@
1
+ var tc=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var RT=tc((LT,si)=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const r of i)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const r={};return i.integrity&&(r.integrity=i.integrity),i.referrerPolicy&&(r.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?r.credentials="include":i.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(i){if(i.ep)return;i.ep=!0;const r=t(i);fetch(i.href,r)}})();const Os="0.4.1";var $n=(o=>(o.HALF="half",o.ONE_THIRD="one-third",o.QUARTER="quarter",o))($n||{}),fi=(o=>(o.ARABIC="arabic",o.CHINESE="chinese",o))(fi||{}),Ne=(o=>(o.INLINE="inline",o.BLOCK="block",o.SURROUND="surround",o.FLOAT_TOP="float-top",o.FLOAT_BOTTOM="float-bottom",o))(Ne||{}),St=(o=>(o.BEFORE="before",o.AFTER="after",o.OUTER_BEFORE="outer-before",o.OUTER_AFTER="outer-after",o))(St||{}),Rl=(o=>(o.ROW="row",o.COLUMN="column",o))(Rl||{});const ee="​",Fr=`
2
+ `,Ss=" ",Cr="&nbsp;",nc=["·","、",":",":",",",",",".","。",";",";","?","?","!","!"],gl={[$n.HALF]:1/2,[$n.ONE_THIRD]:1/3,[$n.QUARTER]:1/4},br={ENGLISH:"A-Za-z",NUMBER:"0-9.$¥"},oc="中";var Qe=(o=>(o.LEFT="left",o.CENTER="center",o.RIGHT="right",o.ALIGNMENT="alignment",o.JUSTIFY="justify",o))(Qe||{});const Qi=/[0-9.]/,ic=/[\uD800-\uDBFF][\uDC00-\uDFFF]/,sc=/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\u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DEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,rc=new RegExp(`${sc.source}|${ic.source}`,"g"),lc=/[、,。?!;:……「」“”‘’*()【】〔〕〖〗〘〙〚〛《》———﹝﹞–—\\/·.,!?;:`~<>()[\]{}'"|]/,Ms=new RegExp(`^[${ee}
3
+ ]`),ac=/[^0-9\+\-\.eE,]/,cc=/\s/;function dc(o,e){let t;return function(...n){t&&window.clearTimeout(t),t=window.setTimeout(()=>{o.apply(this,n)},e)}}function uc(o,e){let t=0,n;return function(...i){const r=Date.now();r-t>=e?(window.clearTimeout(n),o.apply(this,i),t=r):(window.clearTimeout(n),n=window.setTimeout(()=>{o.apply(this,i),t=r},e))}}function ji(o,e){if(!o||typeof o!="object")return o;let t={};return Array.isArray(o)?t=o.map(n=>ji(n,e)):Object.keys(o).forEach(n=>{e.includes(n)||(t[n]=ji(o[n],e))}),t}function xe(o){if(typeof structuredClone=="function")return structuredClone(o);if(!o||typeof o!="object")return o;let e={};return Array.isArray(o)?e=o.map(t=>xe(t)):Object.keys(o).forEach(t=>{e[t]=xe(o[t])}),e}function Ki(o){return o&&o.nodeType===1&&o.tagName.toLowerCase()==="body"}function es(o,e,t){if(o&&!Ki(o))for(o=o;o;){if(!e||e(o)||Ki(o))return e&&!e(o)&&Ki(o)?null:o;o=o.parentNode}return null}function Ee(){function o(){return((1+Math.random())*65536|0).toString(16).substring(1)}return o()+o()+"-"+o()+"-"+o()+"-"+o()+"-"+o()+o()+o()}function be(o){const e=[];if(Intl.Segmenter){const n=new Intl.Segmenter().segment(o);for(const{segment:i}of n)e.push(i)}else{const t=new Map;for(const i of o.matchAll(rc))t.set(i.index,i[0]);let n=0;for(;n<o.length;){const i=t.get(n);i?(e.push(i),n+=i.length):(e.push(o[n]),n++)}}return e}function pl(o,e){const t=document.createElement("a");t.href=o,t.download=e,t.click()}function hc(o,e){Rc(3,o,e)}function Rc(o,e,t){let n=0,i=0;const r=function(s){n=new Date().getTime()-i<300?n+1:0,i=new Date().getTime(),n>=o-1&&(t(s),n=0)};e.addEventListener("click",r)}function ri(o){return Object.prototype.toString.call(o)==="[object Object]"}function ts(o){return Array.isArray(o)}function ns(o){return Object.prototype.toString.call(o)==="[object Number]"}function gc(o){return Object.prototype.toString.call(o)==="[object String]"}function fl(o,e){if(ri(o)&&ri(e)){const t=e;for(const[n,i]of Object.entries(o))t[n]?t[n]=fl(i,t[n]):t[n]=i}else ts(o)&&ts(e)&&e.push(...o);return e}function Xs(o){setTimeout(()=>{o()},0)}function pc(o){const e=["零","一","二","三","四","五","六","七","八","九"],t=["","十","百","千","万","十","百","千","亿","十","百","千","万","十","百","千","亿"];if(!o||isNaN(o))return"零";const n=o.toString().split("");let i="";for(let r=0;r<n.length;r++){const s=n.length-1-r;i=`${t[r]}${i}`,i=`${e[Number(n[s])]}${i}`}return i=i.replace(/零(千|百|十)/g,"零").replace(/十零/g,"十"),i=i.replace(/零+/g,"零"),i=i.replace(/零亿/g,"亿").replace(/零万/g,"万"),i=i.replace(/亿万/g,"亿"),i=i.replace(/零+$/,""),i=i.replace(/^一十/g,"十"),i}function Mn(o,e,t){for(let n=0;n<o.length;n++){const i=o[n],r=e[i];r!==void 0?t[i]=r:delete t[i]}}function yr(o,e){if(!(!e.length||!o.length))for(let t=o.length-1;t>=0;t--)e.includes(o[t])&&o.splice(t,1)}function at(o,e){const t={};for(const n in o)e.includes(n)&&(t[n]=o[n]);return t}function $t(o,e){const t={};for(const n in o)e.includes(n)||(t[n]=o[n]);return t}function fc(o){const t=new TextEncoder().encode(o),n=Array.from(t,r=>String.fromCharCode(r));return window.btoa(n.join(""))}function mc(o){let e=o.parentElement;for(;e;){const n=window.getComputedStyle(e).getPropertyValue("overflow-y");if(e.scrollHeight>e.clientHeight&&(n==="auto"||n==="scroll"))return e;e=e.parentElement}return document.documentElement}function ml(o,e){return o.length!==e.length?!1:!o.some(t=>!e.includes(t))}function Tc(o,e){if(!ri(o)||!ri(e))return!1;const t=Object.keys(o),n=Object.keys(e);return t.length!==n.length?!1:!t.some(i=>e[i]!==o[i])}function Lc(o,e){const t=o.x,n=o.x+o.width,i=o.y,r=o.y+o.height,s=e.x,l=e.x+e.width,a=e.y,c=e.y+e.height;return!(t>l||n<s||i>c||r<a)}function Tl(o){return o==null}function li(o){return o.replace(/\r\n|\r/g,`
4
+ `)}function xr(o,e,t=0){const n=Math.max(0,Math.floor(t));if(n>=o.length)return typeof e=="string"&&e===""?{index:o.length,length:0}:{index:-1,length:0};if(typeof e=="string"){if(e==="")return{index:n,length:0};const a=o.indexOf(e,n);return a===-1?{index:-1,length:0}:{index:a,length:e.length}}const i=e.flags,r=i.includes("g")?i:i+"g",s=new RegExp(e.source,r);s.lastIndex=n;const l=s.exec(o);return l?{index:l.index,length:l[0].length}:{index:-1,length:0}}function Ll(o,e){if(!e){o.scrollTop=0;return}const t=[];let n=e.offsetParent;for(;n&&o!==n&&o.contains(n);)t.push(n),n=n.offsetParent;const i=e.offsetTop+t.reduce((a,c)=>a+c.offsetTop,0),r=i+e.offsetHeight,s=o.scrollTop,l=s+o.clientHeight;i<s?o.scrollTop=i:r>l&&(o.scrollTop=r-o.clientHeight)}const Ic=12,Pc={width:1,color:"#000000",dragWidth:2,dragColor:"#0000FF",dragFloatImageDisabled:!1},Rt="editor-component",re="ce",mi=`${re}-clipboard`,Hi={print:{imagePreviewerDisabled:!1,backgroundDisabled:!1},readonly:{imagePreviewerDisabled:!1},form:{controlDeletableDisabled:!1}};var mt=(o=>(o.UP="top",o.DOWN="down",o.LEFT="left",o.RIGHT="right",o))(mt||{});const Vn=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent),Oc=typeof navigator<"u"&&/iPad|iPhone/.test(navigator.userAgent),Sc=/Mobile|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),Mc=typeof navigator<"u"&&/Firefox/.test(navigator.userAgent);var O=(o=>(o.TEXT="text",o.TEXTFIELD="TextField",o.BUTTON="button",o.IMAGE="image",o.TABLE="table",o.HYPERLINK="hyperlink",o.SUPERSCRIPT="superscript",o.SUBSCRIPT="subscript",o.SEPARATOR="separator",o.PAGE_BREAK="pageBreak",o.CONTROL="control",o.AREA="area",o.CHECKBOX="checkbox",o.RADIO="radio",o.LATEX="latex",o.TAB="tab",o.DATE="date",o.BLOCK="block",o.TITLE="title",o.LIST="list",o.SPLIT_TAG="splitTag",o.LABEL="label",o.MENSTRUAL_HISTORY="menstrualHistory",o.FETAL_HEART_POSITION="fetalHeartPosition",o.TOOTH_POSITION="toothPosition",o.SPECIAL_SYMBOLS="specialSymbols",o.MACRO="macro",o.CUSTOM_MACRO="customMacro",o.REUSABLE_ITEM="reusableItem",o))(O||{});const rn=["bold","color","highlight","font","size","italic","underline","strikeout","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],Vt=["rowFlex","rowMargin"],Xc=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","url","areaId","hyperlinkId","dateId","dateFormat","groupIds","rowMargin","textDecoration","deletePerson","newElEditPerson","deleteTime","newElEditTime"],Ec=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","rowMargin","dashArray","trList","tdPadding","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig"],Nc=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],qn=["tdId","trId","tableId"],Es=["level","titleId","title"],Mo=["listId","listType","listStyle"],os=["control","controlId","controlComponent"],Ft=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"],Yn=["areaId","area"],is=[...qn,...Es,...Mo,...Yn],wt=[O.TEXT,O.HYPERLINK,O.SUBSCRIPT,O.SUPERSCRIPT,O.CONTROL,O.DATE],Fc=[O.IMAGE,O.LATEX],Cc=[O.BLOCK,O.PAGE_BREAK,O.SEPARATOR,O.TABLE],bc=["HR","TABLE","UL","OL"],yc=[O.TITLE,O.LIST];class oo{static sandbox=["allow-scripts","allow-same-origin"];static allow=["fullscreen"];element;constructor(e){this.element=e}_defineIframeProperties(e){Object.defineProperties(e,{parent:{get:()=>null},__POWERED_BY_CANVAS_EDITOR__:{get:()=>!0}})}render(e){const{iframeBlock:t}=this.element.block||{},n=document.createElement("iframe");n.setAttribute("data-id",this.element.id),n.sandbox.add(...t?.sandbox||oo.sandbox),n.setAttribute("allow",[t?.allow||oo.allow].join(" ")),n.style.border="none",n.style.width="100%",n.style.height="100%",t?.src?n.src=t.src:t?.srcdoc&&(n.srcdoc=t.srcdoc),e.append(n),this._defineIframeProperties(n.contentWindow)}}class Il{draw;options;imageCache;container;floatImageContainer;floatImage;constructor(e){this.draw=e,this.options=e.getOptions(),this.container=e.getContainer(),this.imageCache=new Map,this.floatImageContainer=null,this.floatImage=null}getOriginalMainImageList(){const e=[],t=n=>{for(const i of n)if(i.type===O.TABLE){const r=i.trList;for(let s=0;s<r.length;s++){const l=r[s];for(let a=0;a<l.tdList.length;a++){const c=l.tdList[a];t(c.value)}}}else i.type===O.IMAGE&&e.push(i)};return t(this.draw.getOriginalMainElementList()),e}_countImagesBeforeTarget(e,t){let n=0;for(const i of e){if(i===t)break;if(i.type===O.TABLE){const r=i.trList;for(const s of r)for(const l of s.tdList)n+=this._countImagesBeforeTarget(l.value,t)}else i.type===O.IMAGE&&n++}return n}createFloatImage(e){const{scale:t}=this.options;let n=this.floatImageContainer,i=this.floatImage;n||(n=document.createElement("div"),n.classList.add(`${re}-float-image`),this.container.append(n),this.floatImageContainer=n),i||(i=document.createElement("img"),n.append(i),this.floatImage=i),n.style.display="none",i.style.width=`${e.width*t}px`,i.style.height=`${e.height*t}px`;const r=this.draw.getHeight(),s=this.draw.getPageGap(),l=this.draw.getPageNo()*(r+s),a=e.imgFloatPosition;n.style.left=`${a.x*t}px`,n.style.top=`${l+a.y*t}px`,i.src=e.value}dragFloatImage(e,t){if(!this.floatImageContainer)return;this.floatImageContainer.style.display="block";const n=parseFloat(this.floatImageContainer.style.left)+e,i=parseFloat(this.floatImageContainer.style.top)+t;this.floatImageContainer.style.left=`${n}px`,this.floatImageContainer.style.top=`${i}px`}destroyFloatImage(){this.floatImageContainer&&(this.floatImageContainer.style.display="none")}addImageObserver(e){this.draw.getImageObserver().add(e)}getFallbackImage(e,t){const i=(e-Math.ceil(e/8)*8)/2,r=(t-Math.ceil(t/8)*8)/2,s=`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}">
5
+ <rect width="${e}" height="${t}" fill="url(#mosaic)" />
6
+ <defs>
7
+ <pattern id="mosaic" x="${i}" y="${r}" width="16" height="16" patternUnits="userSpaceOnUse">
8
+ <rect width="8" height="8" fill="#cccccc" />
9
+ <rect width="8" height="8" fill="#cccccc" transform="translate(8, 8)" />
10
+ </pattern>
11
+ </defs>
12
+ </svg>`,l=new Image;return l.src=`data:image/svg+xml;base64,${fc(s)}`,l}_drawImageWithCrop(e,t,n,i,r,s,l){if(n.imgCrop){const{x:a,y:c,width:d,height:u}=n.imgCrop;e.drawImage(t,a,c,d,u,i,r,s,l)}else e.drawImage(t,i,r,s,l)}_renderCaption(e,t,n,i,r,s){if(!t.imgCaption?.value)return;const{scale:l,imgCaption:a}=this.options;let c=t.imgCaption.value;if(c.includes("{imageNo}")){const I=this.draw.getOriginalMainElementList(),L=this._countImagesBeforeTarget(I,t)+1;c=c.replace(/\{imageNo\}/g,String(L))}const d=(t.imgCaption.size||a.size)*l,u=t.imgCaption.font||a.font,h=t.imgCaption.color||a.color;e.save(),e.font=`${d}px ${u}`,e.fillStyle=h,e.textAlign="center";let R=c;const g=e.measureText(c);if(g.width>r){let I=0,L=c.length;for(;I<L;){const S=Math.ceil((I+L)/2),M=c.substring(0,S);e.measureText(M+"...").width<=r?I=S:L=S-1}R=c.substring(0,I)+"..."}const m=(t.imgCaption.top??a.top)*l,f=i+s+m+g.actualBoundingBoxAscent,T=n+r/2;e.fillText(R,T,f),e.restore()}render(e,t,n,i){const{scale:r}=this.options,s=t.width*r,l=t.height*r;if(this.imageCache.has(t.value)){const a=this.imageCache.get(t.value);this._drawImageWithCrop(e,a,t,n,i,s,l),this._renderCaption(e,t,n,i,s,l)}else{const a=this.draw.getRenderCount(),c=new Promise((d,u)=>{const h=new Image;h.setAttribute("crossOrigin","Anonymous"),h.src=t.value,h.onload=()=>{this.imageCache.set(t.value,h),d(t),a===this.draw.getRenderCount()&&(t.imgDisplay===Ne.FLOAT_BOTTOM?this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}):(this._drawImageWithCrop(e,h,t,n,i,s,l),this._renderCaption(e,t,n,i,s,l)))},h.onerror=R=>{const g=this.getFallbackImage(s,l);g.onload=()=>{this._drawImageWithCrop(e,g,t,n,i,s,l),this.imageCache.set(t.value,g),this._renderCaption(e,t,n,i,s,l)},u(R)}});this.addImageObserver(c)}}}const ko=82;function Gn(o){return ss[o]==null&&xc(o),ss[o]}function xc(o){const e=vc[o];if(e==null)return;const t=e.substring(3,5),n=1*t.charCodeAt(0)-ko,i=1*t.charCodeAt(1)-ko,r=e.substring(5),s=[[]];let l=1/0,a=-1/0,c=1/0,d=-1/0,u=0;for(;u<r.length;){const h=r.substring(u,u+2);if(h==" R")s.push([]);else{const R=h.charCodeAt(0)-ko-n,g=h.charCodeAt(1)-ko;l=Math.min(g,l),a=Math.max(g,a),c=Math.min(R,c),d=Math.max(R,d),s[s.length-1].push([R,g])}u+=2}ss[o]={w:i-n,xmin:c,xmax:d,ymin:l,ymax:a,polylines:s}}const ss={},vc={1:" 9MWRMNV RRMVV RPSTS",2:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",3:" 11MXVNTMRMPNOPOSPURVTVVU",4:" 12MWOMOV ROMRMTNUPUSTURVOV",5:" 12MWOMOV ROMUM ROQSQ ROVUV",6:" 9MVOMOV ROMUM ROQSQ",7:" 15MXVNTMRMPNOPOSPURVTVVUVR RSRVR",8:" 9MWOMOV RUMUV ROQUQ",9:" 3PTRMRV",10:" 7NUSMSTRVPVOTOS",11:" 9MWOMOV RUMOS RQQUV",12:" 6MVOMOV ROVUV",13:" 12LXNMNV RNMRV RVMRV RVMVV",14:" 9MWOMOV ROMUV RUMUV",15:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",16:" 10MWOMOV ROMSMUNUQSROR",17:" 17MXRMPNOPOSPURVSVUUVSVPUNSMRM RSTVW",18:" 13MWOMOV ROMSMUNUQSROR RRRUV",19:" 13MWUNSMQMONOOPPTRUSUUSVQVOU",20:" 6MWRMRV RNMVM",21:" 9MXOMOSPURVSVUUVSVM",22:" 6MWNMRV RVMRV",23:" 12LXNMPV RRMPV RRMTV RVMTV",24:" 6MWOMUV RUMOV",25:" 7MWNMRQRV RVMRQ",26:" 9MWUMOV ROMUM ROVUV",27:" 9MWRMNV RRMVV RPSTS",28:" 16MWOMOV ROMSMUNUPSQ ROQSQURUUSVOV",29:" 6MVOMOV ROMUM",30:" 9MWRMNV RRMVV RNVVV",31:" 12MWOMOV ROMUM ROQSQ ROVUV",32:" 9MWUMOV ROMUM ROVUV",33:" 9MWOMOV RUMUV ROQUQ",34:" 20MXRMPNOPOSPURVSVUUVSVPUNSMRM RQQTR RTQQR",35:" 3PTRMRV",36:" 9MWOMOV RUMOS RQQUV",37:" 6MWRMNV RRMVV",38:" 12LXNMNV RNMRV RVMRV RVMVV",39:" 9MWOMOV ROMUV RUMUV",40:" 12MWOMUM RPQTR RTQPR ROVUV",41:" 14MXRMPNOPOSPURVSVUUVSVPUNSMRM",42:" 9MWOMOV RUMUV ROMUM",43:" 10MWOMOV ROMSMUNUQSROR",44:" 10MWOMRQOV ROMUM ROVUV",45:" 6MWRMRV RNMVM",46:" 15MWNONNOMPMQNRPRV RVOVNUMTMSNRP",47:" 13LXRMRV RPONPNSPTTTVSVPTOPO",48:" 6MWOMUV RUMOV",49:" 12LXRMRV RNOOPOSQTSTUSUPVO",50:" 13MXOVQVOROPPNRMSMUNVPVRTVVV",200:" 12MWRMPNOPOSPURVTUUSUPTNRM",201:" 4MWPORMRV",202:" 9MWONQMSMUNUPTROVUV",203:" 15MWONQMSMUNUPSQ RRQSQURUUSVQVOU",204:" 7MWSMSV RSMNSVS",205:" 14MWPMOQQPRPTQUSTURVQVOU RPMTM",206:" 14MWTMRMPNOPOSPURVTUUSTQRPPQOS",207:" 6MWUMQV ROMUM",208:" 19MWQMONOPQQSQUPUNSMQM RQQOROUQVSVUUURSQ",209:" 14MWUPTRRSPROPPNRMTNUPUSTURVPV",210:" 6PURURVSVSURU",211:" 7PUSVRVRUSUSWRY",212:" 12PURPRQSQSPRP RRURVSVSURU",213:" 13PURPRQSQSPRP RSVRVRUSUSWRY",214:" 12PURMRR RSMSR RRURVSVSURU",215:" 17NWPNRMSMUNUPRQRRSRSQUP RRURVSVSURU",216:" 3PTRMRQ",217:" 6NVPMPQ RTMTQ",218:" 10NVQMPNPPQQSQTPTNSMQM",219:" 16MWUNSMQMONOPQQTRUSUUSVQVOU RRLRW",220:" 3MWVLNW",221:" 7OVTLRNQPQSRUTW",222:" 7NUPLRNSPSSRUPW",223:" 3PTRLRW",224:" 3LXNRVR",225:" 6LXRNRV RNRVR",226:" 6LXNPVP RNTVT",227:" 6MWOOUU RUOOU",228:" 9MWRORU ROPUT RUPOT",229:" 6PURQRRSRSQRQ",230:" 7PUSMRORQSQSPRP",231:" 7PUSNRNRMSMSORQ",232:" 7LXSOVRSU RNRVR",233:" 12MXRLPW RULSW ROPVP ROSVS",234:" 21LXVRURTSSURVOVNUNSORRQSPSNRMPMONOPQSSUUVVV",235:" 20LXNNOQOSNV RVNUQUSVV RNNQOSOVN RNVQUSUVV",501:" 9I[RFJ[ RRFZ[ RMTWT",502:" 24G\\KFK[ RKFTFWGXHYJYLXNWOTP RKPTPWQXRYTYWXYWZT[K[",503:" 19H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZV",504:" 16G\\KFK[ RKFRFUGWIXKYNYSXVWXUZR[K[",505:" 12H[LFL[ RLFYF RLPTP RL[Y[",506:" 9HZLFL[ RLFYF RLPTP",507:" 23H]ZKYIWGUFQFOGMILKKNKSLVMXOZQ[U[WZYXZVZS RUSZS",508:" 9G]KFK[ RYFY[ RKPYP",509:" 3NVRFR[",510:" 11JZVFVVUYTZR[P[NZMYLVLT",511:" 9G\\KFK[ RYFKT RPOY[",512:" 6HYLFL[ RL[X[",513:" 12F^JFJ[ RJFR[ RZFR[ RZFZ[",514:" 9G]KFK[ RKFY[ RYFY[",515:" 22G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF",516:" 14G\\KFK[ RKFTFWGXHYJYMXOWPTQKQ",517:" 25G]PFNGLIKKJNJSKVLXNZP[T[VZXXYVZSZNYKXIVGTFPF RSWY]",518:" 17G\\KFK[ RKFTFWGXHYJYLXNWOTPKP RRPY[",519:" 21H\\YIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",520:" 6JZRFR[ RKFYF",521:" 11G]KFKULXNZQ[S[VZXXYUYF",522:" 6I[JFR[ RZFR[",523:" 12F^HFM[ RRFM[ RRFW[ R\\FW[",524:" 6H\\KFY[ RYFK[",525:" 7I[JFRPR[ RZFRP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18I\\QMONMPLSLUMXOZQ[T[VZXXYUYSXPVNTMQM",616:" 18H[LMLb RLPNNPMSMUNWPXSXUWXUZS[P[NZLX",617:" 18I\\XMXb RXPVNTMQMONMPLSLUMXOZQ[T[VZXX",618:" 9KXOMO[ ROSPPRNTMWM",619:" 18J[XPWNTMQMNNMPNRPSUTWUXWXXWZT[Q[NZMX",620:" 9MYRFRWSZU[W[ ROMVM",621:" 11I\\MMMWNZP[S[UZXW RXMX[",622:" 6JZLMR[ RXMR[",623:" 12G]JMN[ RRMN[ RRMV[ RZMV[",624:" 6J[MMX[ RXMM[",625:" 10JZLMR[ RXMR[P_NaLbKb",626:" 9J[XMM[ RMMXM RM[X[",627:" 24H]QMONMPLRKUKXLZN[P[RZUWWTYPZM RQMSMTNUPWXXZY[Z[",628:" 31I\\UFSGQIOMNPMTLZKb RUFWFYHYKXMWNUORO RROTPVRWTWWVYUZS[Q[OZNYMV",629:" 17I\\JPLNNMOMQNROSRSVR[ RZMYPXRR[P_Ob",630:" 24I[TMQMONMPLSLVMYNZP[R[TZVXWUWRVOTMRKQIQGRFTFVGXI",631:" 19JZWOVNTMQMONOPPRSS RSSOTMVMXNZP[S[UZWX",632:" 23JYTFRGQHQIRJUKXK RXKTMQONRMUMWNYP[S]T_TaSbQbP`",633:" 19H\\IQJOLMNMONOPNTL[ RNTPPRNTMVMXOXRWWTb",634:" 27G\\HQIOKMMMNNNPMUMXNZO[Q[SZUWVUWRXMXJWGUFSFRHRJSMUPWRZT",635:" 9LWRMPTOXOZP[R[TYUW",636:" 19I[OMK[ RYNXMWMUNQROSNS RNSPTQUSZT[U[VZ",637:" 9JZKFMFOGPHX[ RRML[",638:" 21H]OMIb RNQMVMYO[Q[SZUXWT RYMWTVXVZW[Y[[Y\\W",639:" 14I[LMOMNSMXL[ RYMXPWRUURXOZL[",640:" 29JZTFRGQHQIRJUKXK RUKRLPMOOOQQSTTVT RTTPUNVMXMZO\\S^T_TaRbPb",641:" 18J[RMPNNPMSMVNYOZ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TFVGWHXJXLWNUQK[Y[",703:" 16H\\MFXFRNUNWOXPYSYUXXVZS[P[MZLYKW",704:" 7H\\UFKTZT RUFU[",705:" 18H\\WFMFLOMNPMSMVNXPYSYUXXVZS[P[MZLYKW",706:" 24H\\XIWGTFRFOGMJLOLTMXOZR[S[VZXXYUYTXQVOSNRNOOMQLT",707:" 6H\\YFO[ RKFYF",708:" 30H\\PFMGLILKMMONSOVPXRYTYWXYWZT[P[MZLYKWKTLRNPQOUNWMXKXIWGTFPF",709:" 24H\\XMWPURRSQSNRLPKMKLLINGQFRFUGWIXMXRWWUZR[P[MZLX",710:" 6MWRYQZR[SZRY",711:" 9MWSZR[QZRYSZS\\R^Q_",712:" 12MWRMQNROSNRM RRYQZR[SZRY",713:" 15MWRMQNROSNRM RSZR[QZRYSZS\\R^Q_",714:" 9MWRFRT RRYQZR[SZRY",715:" 21I[LKLJMHNGPFTFVGWHXJXLWNVORQRT RRYQZR[SZRY",716:" 3NVRFRM",717:" 6JZNFNM RVFVM",718:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",719:" 27H\\PBP_ RTBT_ RYIWGTFPFMGKIKKLMMNOOUQWRXSYUYXWZT[P[MZKX",720:" 3G][BIb",721:" 11KYVBTDRGPKOPOTPYR]T`Vb",722:" 11KYNBPDRGTKUPUTTYR]P`Nb",723:" 3NVRBRb",724:" 3E_IR[R",725:" 6E_RIR[ RIR[R",726:" 6E_IO[O RIU[U",727:" 6G]KKYY RYKKY",728:" 9JZRLRX RMOWU RWOMU",729:" 6MWRQQRRSSRRQ",730:" 8MWSFRGQIQKRLSKRJ",731:" 8MWRHQGRFSGSIRKQL",732:" 9E_UMXP[RXTUW RIR[R",733:" 12H]SBLb RYBRb RLOZO RKUYU",734:" 35E_\\O\\N[MZMYNXPVUTXRZP[L[JZIYHWHUISJRQNRMSKSIRGPFNGMIMKNNPQUXWZY[[[\\Z\\Y",735:" 28G]IIJKKOKUJYI[ R[IZKYOYUZY[[ RIIKJOKUKYJ[I RI[KZOYUYYZ[[",737:" 6KYOBO[ RUBU[",738:" 6F^RBR[ RI[[[",739:" 4F^[BI[[[",740:" 18E_RIQJRKSJRI RIYHZI[JZIY R[YZZ[[\\Z[Y",741:" 33F^RHNLKPJSJUKWMXOXQWRU RRHVLYPZSZUYWWXUXSWRU RRUQYP\\ RRUSYT\\ RP\\T\\",742:" 26F^RNQKPINHMHKIJKJOKRLTNWR\\ RRNSKTIVHWHYIZKZOYRXTVWR\\",743:" 20F^RGPJLOIR RRGTJXO[R RIRLUPZR] R[RXUTZR]",744:" 48F^RTTWVXXXZW[U[SZQXPVPSQ RSQUOVMVKUISHQHOINKNMOOQQ RQQNPLPJQISIUJWLXNXPWRT RRTQYP\\ RRTSYT\\ RP\\T\\",745:" 55F^RRR[Q\\ RRVQ\\ RRIQHOHNINKONRR RRISHUHVIVKUNRR RRRNOLNJNIOIQJR RRRVOXNZN[O[QZR RRRNULVJVIUISJR RRRVUXVZV[U[SZR",746:" 55F^ISJSLTMVMXLZ RISIRJQLQMRNTNWMYLZ RRGPIOLOOQUQXPZR\\ RRGTIULUOSUSXTZR\\ R[S[RZQXQWRVTVWWYXZ R[SZSXTWVWXXZ RKVYV",750:" 18PSSRRSQSPRPQQPRPSQSSRUQV RQQQRRRRQQQ",751:" 16PTQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",752:" 9NVPOTU RTOPU RNRVR",753:" 28MWRKQMOPMR RRKSMUPWR RRMOQ RRMUQ RROPQ RROTQ RQQSQ RMRWR",754:" 26MWMRMQNOONQMSMUNVOWQWR RPNTN ROOUO RNPVP RNQVQ RMRWR",755:" 14LRLFLRRRLF RLIPQ RLLOR RLOMQ",756:" 10MWRKQMOPMR RRKSMUPWR",757:" 11MWWRWQVOUNSMQMONNOMQMR",758:" 13G]]R]P\\MZJWHTGPGMHJJHMGPGR",759:" 11MWMRMSNUOVQWSWUVVUWSWR",760:" 7LXLPNRQSSSVRXP",761:" 6RURUTTURTPRO",762:" 7RVRRUPVNVLUKTK",763:" 7NRRROPNNNLOKPK",764:" 21MWWHVGTFQFOGNHMJMLNNOOUSVTWVWXVZU[S\\P\\N[MZ",765:" 21G]IWHVGTGQHOINKMMMONPOTUUVWWYW[V\\U]S]P\\N[M",766:" 31G]RRTUUVWWYW[V\\U]S]Q\\O[NYMWMUNTOPUOVMWKWIVHUGSGQHOINKMMMONPORR",767:" 22H\\KFK[ RHF[FQP[Z RZV[Y\\[ RZVZY RWYZY RWYZZ\\[",768:" 30KYUARBPCNELHKLKRLUNWQXSXVWXUYR RKPLMNKQJSJVKXMYPYVXZV]T_R`Oa",796:" 3>f>RfR",797:" 3D`D``D",798:" 3RRR>Rf",799:" 3D`DD``",800:" 3D`DR`R",801:" 3F^FY^K",802:" 3KYK^YF",803:" 3RRRDR`",804:" 3KYKFY^",805:" 3F^FK^Y",806:" 3KYKRYR",807:" 3MWMWWM",808:" 3RRRKRY",809:" 3MWMMWW",810:" 8GRRGPGMHJJHMGPGR",811:" 8GRGRGTHWJZM\\P]R]",812:" 8R]R]T]W\\ZZ\\W]T]R",813:" 8R]]R]P\\MZJWHTGRG",814:" 9D`DOGQKSPTTTYS]Q`O",815:" 9PUUDSGQKPPPTQYS]U`",816:" 9OTODQGSKTPTTSYQ]O`",817:" 9D`DUGSKQPPTPYQ]S`U",818:" 5KYRJYNKVRZ",819:" 5JZJRNKVYZR",820:" 5KYKVKNYVYN",821:" 5JZLXJPZTXL",822:" 23JZJ]L]O\\Q[TXUVVSVOULTJSIQIPJOLNONSOVPXS[U\\X]Z]",823:" 23I]]Z]X\\U[SXPVOSNONLOJPIQISJTLUOVSVVUXT[Q\\O]L]J",824:" 23JZZGXGUHSIPLONNQNUOXPZQ[S[TZUXVUVQUNTLQIOHLGJG",825:" 23G[GJGLHOIQLTNUQVUVXUZT[S[QZPXOUNQNNOLPISHUGXGZ",826:" 21E[EPFRHTJUMVQVUUXSZP[NZLWLSMQNNPLSKVKYL\\M^",827:" 19EYETHVKWPWSVVTXQYNYLXKVKSLPNNQMTMYN\\P_",828:" 26OUQOOQOSQUSUUSUQSOQO RQPPQPSQTSTTSTQSPQP RRQQRRSSRRQ",829:" 11RWRMSMUNVOWQWSVUUVSWRW",830:" 9D`DRJR RORUR RZR`R",831:" 5D`DUDO`O`U",832:" 6JZRDJR RRDZR",833:" 9D`DR`R RJYZY RP`T`",834:" 9D`DR`R RDRRb R`RRb",840:" 18KYQKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK",841:" 6LXLLLXXXXLLL",842:" 5KYRJKVYVRJ",843:" 6LXRHLRR\\XRRH",844:" 12JZRIPOJOOSMYRUWYUSZOTORI",845:" 6KYRKRY RKRYR",846:" 6MWMMWW RWMMW",847:" 9MWRLRX RMOWU RWOMU",850:" 35NVQNOONQNSOUQVSVUUVSVQUOSNQN ROQOS RPPPT RQOQU RRORU RSOSU RTPTT RUQUS",851:" 27NVNNNVVVVNNN ROOOU RPOPU RQOQU RRORU RSOSU RTOTU RUOUU",852:" 17MWRLMUWURL RROOT RROUT RRRQT RRRST",853:" 17LULRUWUMLR RORTU RORTO RRRTS RRRTQ",854:" 17MWRXWOMORX RRUUP RRUOP RRRSP RRRQP",855:" 17OXXROMOWXR RURPO RURPU RRRPQ RRRPS",856:" 22LXRLNWXPLPVWRL RRRRL RRRLP RRRNW RRRVW RRRXP",857:" 11RYRKRY RRKYNRQ RSMVNSO",860:" 13MWRLRX ROOUO RMUOWQXSXUWWU",861:" 11LXRLRX RLQMOWOXQ RPWTW",862:" 14KYMNWX RWNMX ROLLOKQ RULXOYQ",863:" 18I[NII[ RVI[[ RMM[[ RWMI[ RNIVI RMMWM",864:" 21I[RGRV RMJWP RWJMP RIVL\\ R[VX\\ RIV[V RL\\X\\",865:" 11G[MJSV RKPSL RG\\[\\[RG\\",866:" 14LXPLPPLPLTPTPXTXTTXTXPTPTLPL",867:" 32KYYPXNVLSKQKNLLNKQKSLVNXQYSYVXXVYT RYPWNUMSMQNPOOQOSPUQVSWUWWVYT",868:" 10KYRJKV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{U{[z_ydwitmqqmtiwdy_z[{U{OzIyEw@t;q7m3i0d-_+[*U)O)",908:" 34>fRAPCMDJDGCEA>H@JAMAZB]D_G`M`PaRc RRATCWDZD]C_AfHdJcMcZb]`_]`W`TaRc",909:" 33AcRAPCMDJDGCEABGAKAPBTDXG\\L`Rc RRATCWDZD]C_AbGcKcPbT`X]\\X`Rc RBHbH",997:" 3MWMXWX",998:" 3JZJZZZ",999:" 3JZJ]Z]",1001:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1002:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1003:" 24KYVLWKWOVLTKQKOLNMMPMSNVOWQXTXVWWU RQKOMNPNSOVQX",1004:" 26JZNKNX ROKOX RLKSKVLWMXPXSWVVWSXLX RSKULVMWPWSVVUWSX",1005:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1006:" 20JXNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXQX",1007:" 36K[VLWKWOVLTKQKOLNMMPMSNVOWQXTXVW RQKOMNPNSOVQX RTXUWVU RVSVX RWSWX RTSYS",1008:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1009:" 12NWRKRX RSKSX RPKUK RPXUX",1010:" 19LXSKSURWQX RTKTUSWQXPXNWMUNTOUNV RQKVK",1011:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1012:" 14KXOKOX RPKPX RMKRK RMXWXWTVX",1013:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1014:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1015:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1016:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1017:" 47KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RPWPUQTSTTUUZV[W[XZ RTUUXVZW[",1018:" 37JZNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX RSRTSUWVXWXXW RSRUSVWWX",1019:" 32KZVMWKWOVMULSKQKOLNMNOOPQQTRVSWT RNNOOQPTQVRWSWVVWTXRXPWOVNTNXOV",1020:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1021:" 20J[NKNUOWQXTXVWWUWK ROKOUPWQX RLKQK RUKYK",1022:" 15KYMKRX RNKRU RWKRX RKKPK RTKYK",1023:" 24I[LKOX RMKOT RRKOX RRKUX RSKUT RXKUX RJKOK RVKZK",1024:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1025:" 20LYNKRRRX ROKSR RWKSRSX RLKQK RTKYK RPXUX",1026:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1027:" 18KYRKMX RRNVX RRKWX ROTTT RKXPX RTXYX",1028:" 35JZNKNX ROKOX RLKSKVLWNVPSQ RSKULVNUPSQ ROQSQVRWTWUVWSXLX RSQURVTVUUWSX",1029:" 14KXOKOX RPKPX RMKWKWOVK RMXRX",1030:" 15KYRKLX RRMWX RRKXX RMWVW RLXXX",1031:" 22JYNKNX ROKOX RSOSS RLKVKVOUK ROQSQ RLXVXVTUX",1032:" 16LYVKNX RWKOX ROKNONKWK RNXWXWTVX",1033:" 27J[NKNX ROKOX RVKVX RWKWX RLKQK RTKYK ROQVQ RLXQX RTXYX",1034:" 44KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK RQOQT RTOTT RQQTQ RQRTR",1035:" 12NWRKRX RSKSX RPKUK RPXUX",1036:" 27JZNKNX ROKOX RWKOS RQQVX RRQWX RLKQK RTKYK RLXQX RTXYX",1037:" 15KYRKMX RRNVX RRKWX RKXPX RTXYX",1038:" 30I\\MKMX RNNRX RNKRU RWKRX RWKWX RXKXX RKKNK RWKZK RKXOX RUXZX",1039:" 21JZNKNX ROMVX ROKVV RVKVX RLKOK RTKXK RLXPX",1040:" 36JZMJLM RXJWM RPPOS RUPTS RMVLY RXVWY RMKWK RMLWL RPQTQ RPRTR RMWWW RMXWX",1041:" 32KZQKOLNMMPMSNVOWQXTXVWWVXSXPWMVLTKQK RQKOMNPNSOVQX RTXVVWSWPVMTK",1042:" 21J[NKNX ROKOX RVKVX RWKWX RLKYK RLXQX RTXYX",1043:" 25JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXQX",1044:" 20K[MKRQ RNKSQMX RMKWKXOVK RNWWW RMXWXXTVX",1045:" 16KZRKRX RSKSX RNKMOMKXKXOWK RPXUX",1046:" 33KZMONLOKPKQLRORX RXOWLVKUKTLSOSX RMONMOLPLQMRO RXOWMVLULTMSO RPXUX",1047:" 40KZRKRX RSKSX RQNNOMQMRNTQUTUWTXRXQWOTNQN RQNOONQNROTQU RTUVTWRWQVOTN RPKUK RPXUX",1048:" 21KZNKVX ROKWX RWKNX RLKQK RTKYK RLXQX RTXYX",1049:" 33J[RKRX RSKSX RLPMONOOSQU RTUVSWOXOYP RMONROTQUTUVTWRXO RPKUK RPXUX",1050:" 35KZMVNXQXMRMONMOLQKTKVLWMXOXRTXWXXV ROUNRNOOMQK RTKVMWOWRVU RNWPW RUWWW",1051:" 18KYTKKX RSMTX RTKUX RNTTT RIXNX RRXWX",1052:" 34JYPKLX RQKMX RNKUKWLWNVPSQ RUKVLVNUPSQ ROQRQTRUSUUTWQXJX RRQTSTUSWQX",1053:" 25KXVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUU RRKPMOONRNVPX",1054:" 26JYPKLX RQKMX RNKTKVLWNWQVTUVTWQXJX RTKULVNVQUTTVSWQX",1055:" 22JYPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXTXUUSX",1056:" 20JXPKLX RQKMX RSORS RNKXKWNWK ROQRQ RJXOX",1057:" 33KYVLWLXKWNVLTKRKPLOMNOMRMUNWPXRXTWUVVS RRKPMOONRNVPX RRXTVUS RSSXS",1058:" 27J[PKLX RQKMX RXKTX RYKUX RNKSK RVK[K ROQVQ RJXOX RRXWX",1059:" 12NWTKPX RUKQX RRKWK RNXSX",1060:" 19LXUKRUQWPX RVKSURWPXOXMWLUMTNUMV RSKXK",1061:" 27JZPKLX RQKMX RYKOR RRPTX RSPUX RNKSK RVK[K RJXOX RRXWX",1062:" 14KXQKMX RRKNX ROKTK RKXUXVUTX",1063:" 30I\\OKKX ROMPX RPKQV RYKPX RYKUX RZKVX RMKPK RYK\\K RIXMX RSXXX",1064:" 21JZPKLX RPKTX RQKTU RXKTX RNKQK RVKZK RJXNX",1065:" 32KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK",1066:" 24JYPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RJXOX",1067:" 46KYRKPLOMNOMRMUNWPXRXTWUVVTWQWNVLTKRK RRKPMOONRNVPX RRXTVUTVQVMTK ROWOVPUQURVRZS[T[UZ RRVSZT[",1068:" 35JZPKLX RQKMX RNKUKWLXMXOWQTROR RUKWMWOVQTR RSRTWUXVXWW RSRTSUWVX RJXOX",1069:" 28KZWLXLYKXNWLUKRKPLOMOOPPUSVT RONPOURVSVVUWSXPXNWMULXMWNW",1070:" 16KZTKPX RUKQX RPKNNOKZKYNYK RNXSX",1071:" 20J[PKMUMWOXSXUWVUYK RQKNUNWOX RNKSK RWK[K",1072:" 15KYOKPX RPKQV RYKPX RMKRK RVK[K",1073:" 24I[NKMX ROKNV RTKMX RTKSX RUKTV RZKSX RLKQK RXK\\K",1074:" 21KZPKTX RQKUX RYKLX RNKSK RVK[K RJXOX RRXWX",1075:" 20LYPKRQPX RQKSQ RYKSQQX RNKSK RVK[K RNXSX",1076:" 16LYXKLX RYKMX RQKONPKYK RLXUXVUTX",1101:" 32LZQOPPPQOQOPQOTOVQVWWXXX RTOUQUWWX RURRSPTOUOWPXSXTWUU RRSPUPWQX",1102:" 29JYNKNX ROKOX RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLKOK",1103:" 24LXVQUQURVRVQUPSOQOOPNRNUOWQXSXUWVV RQOPPOROUPWQX",1104:" 32L[VKVX RWKWX RVRUPSOQOOPNRNUOWQXSXUWVU RQOPPOROUPWQX RTKWK RVXYX",1105:" 26LXOSVSVRUPSOQOOPNRNUOWQXSXUWVV RUSUQSO RQOPPOROUPWQX",1106:" 20LWTKULUMVMVLTKRKPMPX RRKQMQX RNOSO RNXSX",1107:" 42LYQOOQOSQUSUUSUQSOQO RQOPQPSQU RSUTSTQSO RTPUOVO RPTOUOXPYTYVZ ROWPXTXVYV[T\\P\\N[NYPX",1108:" 28J[NKNX ROKOX RORPPROTOVPWRWX RTOUPVRVX RLKOK RLXQX RTXYX",1109:" 18NWRKRLSLSKRK RRORX RSOSX RPOSO RPXUX",1110:" 23NWSKSLTLTKSK RSOSZR\\ RTOTZR\\P\\O[OZPZP[O[ RQOTO",1111:" 27JZNKNX ROKOX RWOOU RRSVX RSSWX RLKOK RTOYO RLXQX RTXYX",1112:" 12NWRKRX RSKSX RPKSK RPXUX",1113:" 44F_JOJX RKOKX RKRLPNOPORPSRSX RPOQPRRRX RSRTPVOXOZP[R[X RXOYPZRZX RHOKO RHXMX RPXUX RXX]X",1114:" 28J[NONX ROOOX RORPPROTOVPWRWX RTOUPVRVX RLOOO RLXQX RTXYX",1115:" 28LYQOOPNRNUOWQXTXVWWUWRVPTOQO RQOPPOROUPWQX RTXUWVUVRUPTO",1116:" 32JYNON\\ ROOO\\ RORPPROTOVPWRWUVWTXRXPWOU RTOUPVRVUUWTX RLOOO RL\\Q\\",1117:" 29KYUOU\\ RVOV\\ RURTPROPONPMRMUNWPXRXTWUU RPOOPNRNUOWPX RS\\X\\",1118:" 22KXOOOX RPOPX RPRQPSOUOVPVQUQUPVP RMOPO RMXRX",1119:" 26LYTOUPUQVQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWOVPVPWQX",1120:" 14LWPKPVRXTXUWUV RQKQVRX RNOTO",1121:" 28J[NONUOWQXSXUWVU ROOOUPWQX RVOVX RWOWX RLOOO RTOWO RVXYX",1122:" 15KYNORX ROORV RVORX RLOQO RTOXO",1123:" 24I[LOOX RMOOU RROOX RROUX RSOUU RXOUX RJOOO RVOZO",1124:" 21KYNOUX ROOVX RVONX RLOQO RTOXO RLXPX RSXXX",1125:" 23KYNORX ROORV RVORXP[N\\M\\L[LZMZM[L[ RLOQO RTOXO",1126:" 16LXUONX RVOOX ROONQNOVO RNXVXVVUX",1127:" 32K[QOOPNQMSMUNWPXQXSWUUWRXO RQOOQNSNUOWPX RQOSOUPWWXX RSOTPVWXXYX",1128:" 40KXRKPMOOMUK\\ RQLPNNTL\\ RRKTKVLVNUPRQ RTKULUNTPRQ RRQTRUTUVTWRXQXOWNT RRQSRTTTVRX",1129:" 19KYLQNOPORPSSSXR\\ RLQNPPPRQSS RWOVRSXQ\\",1130:" 39KYSOQOOPNQMSMUNWPXRXTWUVVTVRUPRNQLQKRJTJUKVM RQOOQNSNVPX RRXTVUTUQSO RQLRKTKVM",1131:" 27LXVPTOQOOPOQPRRS RQOPPPQRS RRSOTNUNWPXSXUW RRSPTOUOWPX",1132:" 28LWRKQLQMSNVNVMSNPOOPNRNTOVPWRXSYS[R\\P\\O[ RSNQOPPOROTPVRX",1133:" 26IYJRKPLONOOPOQMX RMONPNQLX ROQPPROTOVPVRS\\ RTOUPURR\\",1134:" 35IYJSKQLPNPOQOVPX RMPNQNUOWPXQXSWTVUTVQVNULTKRKQLQNRPURWS RQXSVTTUQUNTK",1135:" 13NWROPVPWQXSXUWVU RSOQVQWRX",1136:" 26KYOOLX RPOMX RUOVPWPVOTORQOR RORPSRWTXVWWU RORQSSWTX",1137:" 15LXLKNKPLWX RNKOLVX RRPMX RRPNX",1138:" 26KZOOK\\ RPOL\\ RNUNWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1139:" 19JYNOMX ROONUMX RVRVOWOVRTUQWNXMX RLOOO",1140:" 36MXRKQLQMSNVN RTNQOPPPRRSUS RTNROQPQRRS RSSPTOUOWQXSYTZT[S\\Q\\ RSSQTPUPWQX",1141:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1142:" 20IZPPMX RPPNX RTPSX RTPTX RKQMOXO RKQMPXP",1143:" 29JXSOQOOPNQMSJ\\ RQOOQNSK\\ RSOUPVRVTUVTWRXPXNWMU RSOUQUTTVRX",1144:" 28K[YOQOOPNQMSMUNWPXRXTWUVVTVRUPYP RQOOQNSNVPX RRXTVUTUQSO",1145:" 14KZSPQX RSPRX RMQOOXO RMQOPXP",1146:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1147:" 35KZOPNQMSMUNWPXRXUWWUXRXPWOUOTPSRRUO\\ RMUNVPWRWUVWTXR RXQWPUPSR RRUQXP\\",1148:" 17KXMONOPPS[T\\ RNOOPR[T\\U\\ RVOTRNYL\\",1149:" 28I[TKQ\\ RUKP\\ RJRKPLONOOPOVPWSWUVWT RMONPNTOWPXSXUWWTXRYO",1150:" 36JZNPPPPONPMQLSLUMWNXPXQWRUSR RLUNWPWRU RRRRWSXUXWVXTXRWPVOVPWP RRUSWUWWV",1151:" 32KZVOTVTWUXWXXWYU RWOUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1152:" 32JXOKMR RPKNRNVPX RNROPQOSOUPVRVTUVTWRXPXNWMUMR RSOUQUTTVRX RMKPK",1153:" 22KXUPUQVQUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1154:" 35KZWKTVTWUXWXXWYU RXKUVUWVX RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RUKXK",1155:" 23KWNURTTSURUPSOQOOPNQMSMUNWPXRXTWUV RQOOQNSNVPX",1156:" 23MXWKXLXKVKTLSNPYO[N\\ RVKULTNQYP[N\\L\\L[M\\ RPOVO",1157:" 34KYVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX",1158:" 29KZPKLX RQKMX ROQPPROTOVPVRUUUWVX RTOUPURTUTWUXWXXWYU RNKQK",1159:" 26MWSKSLTLTKSK RNROPPOROSPSRRURWSX RQORPRRQUQWRXTXUWVU",1160:" 26MWTKTLULUKTK RORPPQOSOTPTRRYQ[O\\M\\M[N\\ RROSPSRQYP[O\\",1161:" 32KXPKLX RQKMX RVPUQVQVPUOTORQPROR RORPSQWRXTXUWVU RORQSRWSX RNKQK",1162:" 16NVSKPVPWQXSXTWUU RTKQVQWRX RQKTK",1163:" 46F^GRHPIOKOLPLQJX RJOKPKQIX RLQMPOOQOSPSQQX RQORPRQPX RSQTPVOXOZPZRYUYWZX RXOYPYRXUXWYX[X\\W]U",1164:" 33J[KRLPMOOOPPPQNX RNOOPOQMX RPQQPSOUOWPWRVUVWWX RUOVPVRUUUWVXXXYWZU",1165:" 28KXQOOPNQMSMUNWPXRXTWUVVTVRUPSOQO RQOOQNSNVPX RRXTVUTUQSO",1166:" 35JYKRLPMOOOPPPQM\\ RNOOPOQL\\ RPQROTOVPWRWTVVUWSXQXOVOT RTOVQVTUVSX RJ\\O\\",1167:" 28KYVOR\\ RWOS\\ RUSUQSOQOOPNQMSMUNWPXRXTV RQOOQNSNVPX RP\\U\\",1168:" 22LXMRNPOOQORPRQPX RPOQPQQOX RRQSPUOVOWPWQVQWP",1169:" 24LYVPVQWQVPTOQOOPORQSTTVU ROQQRTSVTVWTXQXOWNVOVOW",1170:" 16NWSKPVPWQXSXTWUU RTKQVQWRX RPOUO",1171:" 33IZJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVTWUXWXXWYU RWOUVUWVX",1172:" 24JXKRLPMOOOPPPROUOWPX RNOOPORNUNWPXQXSWUUVRVOUOVP",1173:" 37H\\IRJPKOMONPNRMUMWNX RLOMPMRLULWNXOXQWRV RTORVRWTX RUOSVSWTXUXWWYUZRZOYOZP",1174:" 38JZMRNPPOROSPSR RQORPRRQUPWNXMXLWLVMVLW RXPWQXQXPWOVOTPSRRURWSX RQUQWRXTXVWWU",1175:" 35IYJRKPLONOOPORNUNWOX RMONPNRMUMWOXQXSWTV RVOTVSYR[ RWOUVTYR[P\\M\\L[M[N\\",1176:" 27KYWOWPVQNVMWMX RNQOOROUQ ROPRPUQVQ RNVOVRWUW ROVRXUXVV",1177:" 39H[RKSLSMTMTLRKOKMLLNLX ROKNLMNMX RXKYLYMZMZLXKVKTMTX RVKUMUX RJOWO RJXOX RRXWX",1178:" 29J[UKVLWLWKQKOLNNNX RQKPLONOX RVOVX RWOWX RLOWO RLXQX RTXYX",1179:" 27J[WKQKOLNNNX RQKPLONOX RUKVLVX RWKWX RLOVO RLXQX RTXYX",1180:" 48F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX RYKZL[L[KUKSLRNRX RUKTLSNSX RZOZX R[O[X RHO[O RHXMX RPXUX RXX]X",1181:" 46F_PKQLQMRMRLPKMKKLJNJX RMKLLKNKX R[KUKSLRNRX RUKTLSNSX RYKZLZX R[K[X RHOZO RHXMX RPXUX RXX]X",1182:" 12NWRORX RSOSX RPOSO RPXUX",1184:" 21LXVPTOROPPOQNSNUOWQXSXUW RROPQOSOVQX ROSSS",1185:" 35LYSKQLPMOONRNUOWPXRXTWUVVTWQWNVLUKSK RSKQMPOOSOVPX RRXTVUTVPVMUK ROQVQ",1186:" 34KZTKQ\\ RUKP\\ RQONPMRMUNWQXTXWWXUXRWPTOQO RQOOPNRNUOWQX RTXVWWUWRVPTO",1187:" 22LXUPVRVQUPSOQOOPNRNTOVRX RQOOQOTPVRXSYS[R\\P\\",1191:" 45I[VKWLXLVKSKQLPM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MPLRLUMVM",1208:" 51LYQKOLNNOPQQTQVPWNVLTKQK RQKPLONPPQQ RTQUPVNULTK RQQORNTNUOWQXTXVWWUWTVRTQ RQQPROTOUPWQX RTXUWVUVTURTQ",1209:" 36LYOVOUNUNVOWQXSXUWVVWSWNVLTKQKOLNNNPORQSTSWQ RSXUVVSVNULTK RQKPLONOPPRQS",1210:" 6NVRVQWRXSWRV",1211:" 8NVSWRXQWRVSWSYQ[",1212:" 12NVROQPRQSPRO RRVQWRXSWRV",1213:" 14NVROQPRQSPRO RSWRXQWRVSWSYQ[",1214:" 15NVRKQLRSSLRK RRLRO RRVQWRXSWRV",1215:" 29LYNNONOONONNOLQKTKVLWNWOVQSRRSRTST RTKVMVPUQSR RRWRXSXSWRW",1216:" 6OVRKRP RSKRP",1217:" 12LXOKOP RPKOP RUKUP RVKUP",1218:" 10MWQKPLPNQOSOTNTLSKQK",1219:" 9MWRJRP ROKUO RUKOO",1220:" 3KZXHM\\",1221:" 16MWUHSJQMPPPTQWSZU\\ RSJRLQPQTRXSZ",1222:" 16MWOHQJSMTPTTSWQZO\\ RQJRLSPSTRXQZ",1223:" 12MWPHP\\ RQHQ\\ RPHUH RP\\U\\",1224:" 12MWSHS\\ RTHT\\ ROHTH RO\\T\\",1225:" 38LWSHQIPJPLRNSP RQIPL RSNRQ RPJQLSNSPRQPRRSSTSVQXPZ RRSSV RPXQ[ RSTRVPXPZQ[S\\",1226:" 38MXQHSITJTLRNQP RSITL RQNRQ RTJSLQNQPRQTRRSQTQVSXTZ RRSQV RTXS[ RQTRVTXTZS[Q\\",1227:" 4MWTHPRT\\",1228:" 4MWPHTRP\\",1229:" 3OURHR\\",1230:" 6MWPHP\\ RTHT\\",1231:" 3I[LRXR",1232:" 6I[RLRX RLRXR",1233:" 9JZRMRX RMRWR RMXWX",1234:" 9JZRMRX RMMWM RMRWR",1235:" 6JZMMWW RWMMW",1236:" 6NVRQQRRSSRRQ",1237:" 15I[RLQMRNSMRL RLRXR RRVQWRXSWRV",1238:" 6I[LPXP RLTXT",1239:" 9I[WLMX RLPXP RLTXT",1240:" 9I[LNXN RLRXR RLVXV",1241:" 4JZWLMRWX",1242:" 4JZMLWRMX",1243:" 10JZWKMOWS RMTWT RMXWX",1244:" 10JZMKWOMS RMTWT RMXWX",1245:" 21H[YUWUUTTSRPQOONNNLOKQKRLTNUOUQTRSTPUOWNYN",1246:" 16JZLTLRMPOPUSWSXR RLRMQOQUTWTXRXP",1247:" 8JZMSRPWS RMSRQWS",1248:" 7NVSKPO RSKTLPO",1249:" 7NVQKTO RQKPLTO",1250:" 14LXNKOMQNSNUMVK RNKONQOSOUNVK",1251:" 8NVSLRMQLRKSLSNQP",1252:" 8NVSKQMQORPSORNQO",1253:" 8NVQLRMSLRKQLQNSP",1254:" 8NVQKSMSORPQORNSO",1256:" 11JZWMQMONNOMQMSNUOVQWWW",1257:" 11JZMMMSNUOVQWSWUVVUWSWM",1258:" 11JZMMSMUNVOWQWSVUUVSWMW",1259:" 11JZMWMQNOONQMSMUNVOWQWW",1260:" 14JZWMQMONNOMQMSNUOVQWWW RMRUR",1261:" 13I[TOUPXRUTTU RUPWRUT RLRWR",1262:" 13MWRMRX ROPPORLTOUP RPORMTO",1263:" 13I[POOPLROTPU ROPMROT RMRXR",1264:" 13MWRLRW ROTPURXTUUT RPURWTU",1265:" 37KYVSUPSOQOOPNQMSMUNWPXRXTWUVVTWQWNVLTKQKPLQLRK RQOOQNSNVPX RRXTVUTVQVNULTK",1266:" 15JZLKRX RMKRV RXKRX RLKXK RNLWL",1267:" 10G[IOLORW RKORX R[FRX",1268:" 26I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[",1269:" 40I[XIXJYJYIXHVHTJSLROQUPYO[ RUITKSORUQXPZN\\L\\K[KZLZL[ RQNOONQNSOUQVSVUUVSVQUOSNQN",1270:" 26H\\ZRYTWUVUTTSSQPPONNMNKOJQJRKTMUNUPTQSSPTOVNWNYOZQZR",1271:" 26JZXKLX ROKPLPNOOMOLNLLMKOKSLVLXK RUTTUTWUXWXXWXUWTUT",1272:" 41J[YPXPXQYQYPXOWOVPUTTVSWQXOXMWLVLTMSORRPSNSLRKPKOLONPQUWWXXXYW ROXMVMTOR RONPPVWWX",1273:" 29J[UPSOQOPQPRQTSTUS RUOUSVTXTYRYQXNVLSKRKOLMNLQLRMUOWRXSXVW",1274:" 34KZQHQ\\ RTHT\\ RWLVLVMWMWLUKPKNLNNOPVSWT RNNOOVRWTWVVWTXQXOWNVNUOUOVNV",1275:" 12KYRKN\\ RVKR\\ RNQWQ RMVVV",1276:" 40LXTLSLSMTMTLSKQKPLPNQPTRUS RPNQOTQUSUUSW RQPOROTPVSXTY ROTPUSWTYT[S\\Q\\P[PZQZQ[P[",1277:" 29LXRKQLRMSLRK RRMRQ RRQQSRVSSRQ RRVR\\ RPOONNOOPPOTOUNVOUPTO",1278:" 42LXRMSLRKQLRMRQQRSURV RRQSRQURVRZQ[R\\S[RZ RPOONNOOPPOTOUNVOUPTO RPXOWNXOYPXTXUWVXUYTX",1279:" 12LYVKVX RNKVK RQQVQ RNXVX",1281:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRQQRRSSRRQ",1282:" 33LYQKPLPMQN RTKULUMTN RRNPOOQORPTRUSUUTVRVQUOSNRN RRURY RSUSY ROWVW",1283:" 23LYRKPLONOOPQRRSRUQVOVNULSKRK RRRRX RSRSX ROUVU",1284:" 24H\\QKNLLNKQKSLVNXQYSYVXXVYSYQXNVLSKQK RRKRY RKRYR",1285:" 25JYRRPQOQMRLTLUMWOXPXRWSUSTRR RWMRR RRMWMWR RRMVNWR",1286:" 25JZLLMKOKQLRNRPQRPSNT ROKPLQNQQPS RVKUX RWKTX RNTXT",1287:" 27JYNKNU ROKNR RNROPQOSOUPVQVTTVTXUYVYWX RSOUQUTTV RLKOK",1288:" 27LYONRKRQ RVNSKSQ RRQPROTOUPWRXSXUWVUVTURSQ RRTRUSUSTRT",1289:" 27JZRKRY RMKMPNRPSTSVRWPWK RLMMKNM RQMRKSM RVMWKXM ROVUV",1290:" 27JYNKNX ROKOX RLKSKVLWNWOVQSROR RSKULVNVOUQSR RLXVXVUUX",1291:" 20LYWKTKQLONNQNSOVQXTYWY RWKTLRNQQQSRVTXWY",1292:" 23JZRRPQOQMRLTLUMWOXPXRWSUSTRR RSLQQ RWMRR RXQSS",1293:" 12KYPMTW RTMPW RMPWT RWPMT",1294:" 34J[OUMULVLXMYOYPXPVNTMRMONMOLQKTKVLWMXOXRWTUVUXVYXYYXYVXUVU RNMPLULWM",1295:" 34J[OOMOLNLLMKOKPLPNNPMRMUNWOXQYTYVXWWXUXRWPUNULVKXKYLYNXOVO RNWPXUXWW",1401:" 21F^KHK\\ RLHL\\ RXHX\\ RYHY\\ RHH\\H RH\\O\\ RU\\\\\\",1402:" 20H]KHRQJ\\ RJHQQ RJHYHZMXH RK[X[ RJ\\Y\\ZWX\\",1403:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",1404:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",1405:" 12KYOBOb RPBPb ROBVB RObVb",1406:" 12KYTBTb RUBUb RNBUB RNbUb",1407:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",1408:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",1409:" 24KYU@RCPFOIOLPOSVTYT\\S_Ra RRCQEPHPKQNTUUXU[T^RaOd",1410:" 24KYO@RCTFUIULTOQVPYP\\Q_Ra RRCSETHTKSNPUOXO[P^RaUd",1411:" 13AXCRGRR` RGSRa RFSRb RX:Rb",1412:" 32F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`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GTF RPOMPLQKSKWLYMZP[T[WZXYYWYSXQWPTO RPONPMQLSLWMYNZP[ RT[VZWYXWXSWQVPTO",2209:" 48H\\XMWPURRSQSNRLPKMKLLINGQFSFVGXIYLYRXVWXUZR[O[MZLXLWMVNWMX RQSORMPLMLLMIOGQF RSFUGWIXLXRWVVXTZR[",2210:" 6MWRYQZR[SZRY",2211:" 8MWR[QZRYSZS\\R^Q_",2212:" 12MWRMQNROSNRM RRYQZR[SZRY",2213:" 14MWRMQNROSNRM RR[QZRYSZS\\R^Q_",2214:" 15MWRFQHRTSHRF RRHRN RRYQZR[SZRY",2215:" 32I[MJNKMLLKLJMHNGPFSFVGWHXJXLWNVORQRT RSFUGVHWJWLVNTP RRYQZR[SZRY",2216:" 6NVRFQM RSFQM",2217:" 12JZNFMM ROFMM RVFUM RWFUM",2218:" 14KYQFOGNINKOMQNSNUMVKVIUGSFQF",2219:" 9JZRFRR RMIWO RWIMO",2220:" 3G][BIb",2221:" 20KYVBTDRGPKOPOTPYR]T`Vb RTDRHQKPPPTQYR\\T`",2222:" 20KYNBPDRGTKUPUTTYR]P`Nb RPDRHSKTPTTSYR\\P`",2223:" 12KYOBOb RPBPb ROBVB RObVb",2224:" 12KYTBTb RUBUb RNBUB RNbUb",2225:" 40KYTBRCQDPFPHQJRKSMSOQQ RRCQEQGRISJTLTNSPORSTTVTXSZR[Q]Q_Ra RQSSUSWRYQZP\\P^Q`RaTb",2226:" 40KYPBRCSDTFTHSJRKQMQOSQ RRCSESGRIQJPLPNQPURQTPVPXQZR[S]S_Ra RSSQUQWRYSZT\\T^S`RaPb",2227:" 4KYUBNRUb",2228:" 4KYOBVROb",2229:" 3NVRBRb",2230:" 6KYOBOb RUBUb",2231:" 3E_IR[R",2232:" 6E_RIR[ RIR[R",2233:" 9F^RJR[ RJRZR RJ[Z[",2234:" 9F^RJR[ RJJZJ RJRZR",2235:" 6G]KKYY RYKKY",2236:" 6MWRQQRRSSRRQ",2237:" 15E_RIQJRKSJRI RIR[R RRYQZR[SZRY",2238:" 6E_IO[O RIU[U",2239:" 9E_YIK[ RIO[O RIU[U",2240:" 9E_IM[M RIR[R RIW[W",2241:" 4F^ZIJRZ[",2242:" 4F^JIZRJ[",2243:" 10F^ZFJMZT RJVZV RJ[Z[",2244:" 10F^JFZMJT RJVZV RJ[Z[",2245:" 21F_[WYWWVUTRPQOONMNKOJQJSKUMVOVQURTUPWNYM[M",2246:" 24F^IUISJPLONOPPTSVTXTZS[Q RISJQLPNPPQTTVUXUZT[Q[O",2247:" 8G]JTROZT RJTRPZT",2248:" 7LXTFOL RTFUGOL",2249:" 7LXPFUL RPFOGUL",2250:" 18H\\KFLHNJQKSKVJXHYF RKFLINKQLSLVKXIYF",2251:" 8MWRHQGRFSGSIRKQL",2252:" 8MWSFRGQIQKRLSKRJ",2253:" 8MWRHSGRFQGQIRKSL",2254:" 8MWQFRGSISKRLQKRJ",2255:" 10E[HMLMRY RKMR[ R[BR[",2256:" 13F^ZJSJOKMLKNJQJSKVMXOYSZZZ",2257:" 13F^JJJQKULWNYQZSZVYXWYUZQZJ",2258:" 13F^JJQJUKWLYNZQZSYVWXUYQZJZ",2259:" 13F^JZJSKOLMNKQJSJVKXMYOZSZZ",2260:" 16F^ZJSJOKMLKNJQJSKVMXOYSZZZ RJRVR",2261:" 11E_XP[RXT RUMZRUW RIRZR",2262:" 11JZPLRITL RMORJWO RRJR[",2263:" 11E_LPIRLT ROMJROW RJR[R",2264:" 11JZPXR[TX RMURZWU RRIRZ",2265:" 44I\\XRWOVNTMRMONMQLTLWMYNZP[R[UZWXXUYPYKXHWGUFRFPGOHOIPIPH RRMPNNQMTMXNZ RR[TZVXWUXPXKWHUF",2266:" 15H\\JFR[ RKFRY RZFR[ RJFZF RKGYG",2267:" 10AbDMIMRY RHNR[ Rb:R[",2268:" 32F^[CZD[E\\D\\C[BYBWCUETGSJRNPZO^N` RVDUFTJRVQZP]O_MaKbIbHaH`I_J`Ia",2269:" 50F^[CZD[E\\D\\C[BYBW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TLSPS[",2302:" 51F^IGJKKMMOPPTPWOYMZK[G RIGJJKLMNPOTOWNYLZJ[G RPONPMQLSLVMXOZQ[S[UZWXXVXSWQVPTO RPPNQMSMVNY RVYWVWSVQTP",2303:" 30F^MJMV RNKNU RVKVU RWJWV RIGKIMJPKTKWJYI[G RIYKWMVPUTUWVYW[Y",2304:" 48F^[ILIJJILINJPLQNQPPQNQLPJ[J RIMJOKPMQ RQMPKOJMI RIXXXZW[U[SZQXPVPTQSSSUTWIW R[TZRYQWP RSTTVUWWX",2305:" 48F]OUMTLTJUIWIXJZL[M[OZPXPWOUJPINIKJILHOGSGWHYJZLZOYRVUUWUYV[X[YZZX RMSKPJNJKKILH RSGVHXJYLYOXRVU",2306:" 48G_HKKHMKMV RJILLLV RMKPHRKRU ROIQLQU RRKUHWKW[ RTIVLV[ RWKZH[J\\M\\P[SZUXWUYP[ RYIZJ[M[PZSYUWWTYP[",2307:" 41F^ISMSLRKOKMLJNHQGSGVHXJYMYOXRWS[S RITOTMRLOLMMJOHQG RSGUHWJXMXOWRUT[T RKXYX RKYYY",2308:" 30F_GLJIMLMX RIJLMLX RMLPISLSX ROJRMRX RSLVIYLYW[Y RUJXMXXZZ]W",2309:" 33G]ZIJY RZIWJQJ RXKUKQJ RZIYLYR RXKXNYR RQRJR RPSMSJR RQRQY RPSPVQY",2310:" 33F^HOJKOU RJMOWRPWPZO[M[KZIXHWHUITKTMUPVRWUWXUZ RWHVIUKUMWQXTXWWYUZ",2311:" 36F^IOLLPN RKMOORLUN RQMTOWLYN RVMXO[L RIULRPT RKSOURRUT RQSTUWRYT RVSXU[R",2312:" 48F^JHNJPLQOQRPUNWJY RJHMIOJQLRO RRRQUOWMXJY RZHWIUJSLRO RRRSUUWWXZY RZHVJTLSOSRTUVWZY RIP[P RIQ[Q",2317:" 12NVQQQSSSSQQQ RQQSS RSQQS",2318:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2319:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2320:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2321:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2322:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2323:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2324:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2325:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2326:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2327:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2328:" 49JZMLWX RMLONQOTOVNWMWKUKUMTO RONTO RQOWM RVKVN RULWL RWXUVSUPUNVMWMYOYOWPU RUVPU RSUMW RNVNY RMXOX",2329:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLWY",2330:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2331:"103EfNSOUQVSVUUVSVQUOSNQNOONPMSMVNYP[S\\V\\Y[[Y\\W]T]P\\MZJXIUHRHOIMJKLIOHSHXI]KaMcPeTfYf]e`cba RKLJNIRIXJ\\L`NbQdUeYe]d_cba RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU RaLaNcNcLaL RbLbN RaMcM RaVaXcXcVaV RbVbX RaWcW",2332:" 30D`H@Hd RM@Md RW@Wd R\\@\\d RMMWK RMNWL RMOWM RMWWU RMXWV RMYWW",2367:" 12NVQQQSSSSQQQ RQQSS RSQQS",2368:" 18JZMPQRTTVVWYW[V]U^ RMQST RMRPSTUVWWY",2369:" 18JZWKVMTOPQMR RSPMS RUFVGWIWKVNTPQRMT",2370:" 32H\\PMMNLOKQKSLUMVPWTWWVXUYSYQXOWNTMPM RMNLPLSMUNVPW RWVXTXQWOVNTM",2371:" 36H\\SMONLPKRKTLVNWQWUVXTYRYPXNVMSM RXNSM RVMQNLP RONKR RLVQW RNWSVXT RUVYR",2372:" 34J[SMPNNPMRMTNVPWRWUVWTXRXPWNUMSM ROPUM RNRVN RMTWO RNUXP ROVWR RPWVT",2373:" 18JZOGO^ RUFU] RMNWL RMOWM RMWWU RMXWV",2374:" 18JZNFNX RVLV^ RNNVL RNOVM RNWVU RNXVV",2375:" 25JZNBNW RNNQLTLVMWOWQVSSUQVNW RNNQMTMVN RUMVOVQUSSU",2376:" 18E_HIHL R\\I\\L RHI\\I RHJ\\J RHK\\K RHL\\L",2377:" 18JZMNMQ RWNWQ RMNWN RMOWO RMPWP RMQWQ",2378:" 36JZQCVMRTRU RULQS RTITKPRRUUY RW\\UYSXQXOYN[N]O_Ra RW\\UZSYOYO]P_Ra RSXPZN]",2379:" 26JZPOOMOKMKMMNNPOSOUNWL RNKNN RMLOL RMMSO RPOUN RWLSY",2380:" 86A^GfHfIeIdHcGcFdFfGhIiKiNhPfQdR`RUQ;Q4R/S-U,V,X-Y/Y3X6W8U;P?JCHEFHEJDNDREVGYJ[N\\R\\V[XZZW[T[PZMYKWITHPHMIKKJNJRKUMW RGdGeHeHdGd RU;Q?LCIFGIFKENERFVGXJ[ RR\\U[WZYWZTZPYMXKVITH",2381:" 89IjNQOOQNSNUOVQVSUUSVQVOUNTMQMNNKPISHWH[I^K`NaRaW`[_]]`ZcVfQiMk RWHZI]K_N`R`W_[^]\\`YcTgQi RPOTO ROPUP RNQVQ RNRVR RNSVS ROTUT RPUTU ReLeNgNgLeL RfLfN ReMgM ReVe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ZWX RWPSNPNNOMPLSLUMXNYPZSZWX",2618:" 21KYOMO[P[ ROMPMP[ RPSQPSNUMXM RPSQQSOUNXNXM",2619:" 50J[XPWNTMQMNNMPNRPSUUWV RVUWWWXVZ RWYTZQZNY ROZNXMX RXPWPVN RWOTNQNNO RONNPOR RNQPRUTWUXWXXWZT[Q[NZMX",2620:" 16MXRFR[S[ RRFSFS[ ROMVMVN ROMONVN",2621:" 25H\\LMLWMZO[R[TZWW RLMMMMWNYPZRZTYWW RWMW[X[ RWMXMX[",2622:" 14JZLMR[ RLMMMRY RXMWMRY RXMR[",2623:" 26F^IMN[ RIMJMNX RRMNX RRPN[ RRPV[ RRMVX R[MZMVX R[MV[",2624:" 16I[LMW[X[ RLMMMX[ RXMWML[ RXMM[L[",2625:" 17JZLMR[ RLMMMRY RXMWMRYNb RXMR[ObNb",2626:" 20I[VNL[ RXMNZ RLMXM RLMLNVN RNZXZX[ RL[X[",2651:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRTXTZV[XZYY[V RWRUXUZV[",2652:" 23LZLVNSPO RSFMXMZO[P[RZTXUUURVVWWXWZV RTFNXNZO[",2653:" 22LXTSSTTTTSSRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[",2654:" 33K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RZFTXTZV[XZYY[V R[FUXUZV[",2655:" 23LXOYQXRWSUSSRRQROSNTMVMXNZP[S[VYXV RQROTNVNYP[",2656:" 27OXRRUOWLXIXGWFUGTIKdKfLgNfOcPZQ[S[UZVYXV RTISNRRO[M`Kd",2657:" 38K[UUTSRRPRNSMTLVLXMZO[Q[SZTX RPRNTMVMYO[ RVRPd RWRT[R`PdOfMgLfLdMaO_R]V[YY[V",2658:" 30L[LVNSPO RSFL[ RTFM[ ROUQSSRTRVSVUUXUZV[ RTRUSUUTXTZV[XZYY[V",2659:" 19NVSLRMSNTMSL RQROXOZQ[SZTYVV RRRPXPZQ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" 14MXSMRNSOTNSM RP[OZPYQZQ[P]N_",2764:" 17MXUFTGRS RUGRS RUFVGRS RPYOZP[QZPY",2765:" 34H]OJPKOLNKNJOHPGSFWFZG[I[KZMYNSPQQQSRTTT RWFYGZIZKYMXNVO RPYOZP[QZPY",2766:" 8MXVFTHSJSKTLUKTJ",2767:" 8MXUHTGUFVGVHUJSL",2768:" 55E_\\N[O\\P]O]N\\M[MYNWPRXPZN[K[HZGXGVHTISKRPPROTMUKUITGRFPGOIOLPRQUSXUZW[Y[ZYZX RK[IZHXHVITJSPP ROLPQQTSWUYWZYZZY",2769:" 41H]TBL_ RYBQ_ RZJYKZL[K[JZHYGVFRFOGMIMKNMONVRXT RMKOMVQWRXTXWWYVZS[O[LZKYJWJVKULVKW",2770:" 3G]_BEb",2771:" 20KZZBVESHQKOONTNXO]P`Qb RVESIQMPPOUOZP_Qb",2772:" 20JYSBTDUGVLVPUUSYQ\\N_Jb RSBTEUJUOTTSWQ[N_",2773:" 9J[TFTR ROIYO RYIOO",2774:" 3E_IR[R",2775:" 6E_RIR[ RIR[R",2776:" 6E_IO[O RIU[U",2777:" 6NWUFSM RVFSM",2778:" 12I[PFNM RQFNM RYFWM RZFWM",2779:" 14KZSFQGPIPKQMSNUNWMXKXIWGUFSF",2801:" 18H\\RFK[ RRFY[ RRIX[ RMUVU RI[O[ RU[[[",2802:" 31G]LFL[ RMFM[ RIFYFYLXF RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2803:" 45G]LFL[ RMFM[ RIFUFXGYHZJZLYNXOUP RUFWGXHYJYLXNWOUP RMPUPXQYRZTZWYYXZU[I[ RUPWQXRYTYWXYWZU[",2804:" 14I[NFN[ ROFO[ RKFZFZLYF RK[R[",2805:" 31F^NFNLMTLXKZJ[ RXFX[ RYFY[ RKF\\F RG[\\[ RG[Gb RH[Gb R[[\\b R\\[\\b",2806:" 22G\\LFL[ RMFM[ RSLST RIFYFYLXF RMPSP RI[Y[YUX[",2807:" 71C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WRXNXIWGVF RLXMVOUPURVSXT]U^V^W] RT^U_V_ RSXS_T`V`W]W\\",3068:" 78F^OFI[ RPFJ[ RQFK[ RLFWFZG[I[KZNYOVPNP RYGZIZKYNXO RWFXGYIYKXNVP RRPTQURWXXYYYZX RWYXZYZ RURVZW[Y[ZXZW RF[N[ RMFPG RNFOH RRFPH RSFPG RJZG[ RJYH[ RKYL[ RJZM[",3069:" 44G^ZH[H\\F[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJUI[JYKY",3070:" 54G]TFN[ RUFO[ RVFP[ RMFKL R]F\\L RMF]F RK[S[ RNFKL RPFLI RRFMG RYF\\G RZF\\H R[F\\I R\\F\\L ROZL[ ROYM[ RPYQ[ ROZR[",3071:" 48F_NFKQJUJXKZN[R[UZWXXU\\G ROFLQKUKYLZ RPFMQLULYN[ RKFSF RYF_F RLFOG RMFNH RQFOH RRFOG RZF\\G R^F\\G",3072:" 35H\\NFNHOYO[ ROGPX RPFQW R[GO[ RLFSF RXF^F RMFNH RQFPH RRFOG RYF[G R]F[G",3073:" 57E_MFMHKYK[ RNGLX ROFMW RUFMWK[ RUFUHSYS[ RVGTX RWFUW R]GUWS[ RJFRF RUFWF RZF`F RKFNG RLFMH RPFNI RQFNG R[F]G R_F]G",3074:" 54G]NFT[ ROFU[ RPFV[ R[GIZ RLFSF RXF^F RF[L[ RQ[X[ RMFOH RQFPH RRFPG RYF[G R]F[G RIZG[ RIZK[ RTZR[ RTYS[ RUYW[",3075:" 51G]MFQPN[ RNFRPO[ ROFSPP[ R\\GSP RKFRF RYF_F RK[S[ RLFNG RPFOH RQFNG RZF\\G R^F\\G ROZL[ ROYM[ RPYQ[ ROZR[",3076:" 35G]ZFH[ R[FI[ R\\FJ[ R\\FNFLL RH[V[XU ROFLL RPFMI RRFNG RR[VZ RT[WX RU[XU",3101:" 54I]NPNOOOOQMQMONNPMTMVNWOXQXXYZZ[ RVOWQW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WZXZYY",3269:" 52H]TBL_ RYBQ_ RZKZJYJYL[L[JZHYGVFRFOGMIMLNNPPVSWUWXVZ RNLONVRWT ROGNINKOMUPWRXTXWWYVZS[O[LZKYJWJULULWKWKV",3270:" 8G^_BEbFb R_B`BFb",3271:" 32JZZBXCUERHPKNOMSMXN\\O_Qb RSHQKOONTN\\ RZBWDTGRJQLPOOSN\\ RNTO]P`Qb",3272:" 32JZSBUEVHWLWQVUTYR\\O_LaJb RVHVPUUSYQ\\ RSBTDUGVP RVHUQTUSXRZP]M`Jb",3273:" 39J[TFSGUQTR RTFTR RTFUGSQTR ROIPIXOYO ROIYO ROIOJYNYO RYIXIPOOO RYIOO RYIYJONOO",3274:" 8F_JQ[Q[R RJQJR[R",3275:" 16F_RIRZSZ RRISISZ RJQ[Q[R RJQJR[R",3276:" 16F_JM[M[N RJMJN[N RJU[U[V RJUJV[V",3277:" 11MWUFTGRM RUGRM RUFVGRM",3278:" 22H\\PFOGMM RPGMM RPFQGMM RZFYGWM RZGWM RZF[GWM",3279:" 30KZSFQGPIPKQMSNUNWMXKXIWGUFSF RSFPIQMUNXKWGSF RUFQGPKSNWMXIUF",3301:" 62F^IHJIIJHIIGKFMFOGPHQKQOPRNTLUIV ROHPKPPOR RMFNGOJOPNSLU RLVOY RKVOZ RIVN[UV R\\G[H\\H\\G[FYFWGVHUJUYW[[W RWHVJVXXZ RYFXGWJWWYY",3302:"101E_GQGRHSJSLRLOKMIJIHKF RKOIK RJSKRKPIMHKHIIGKFNFPGQHRJRRQUOW RPHQJQT RNFOGPJPUOW RRISGUFWFYGZH[J\\K RYHZJ RWFXGYJZK\\K R\\KRP RYM[O\\R\\U[XYZV[S[PZJWIWHX RXNYN[P RVNYO[Q\\S RTZRZLWKW RZYXZUZRYNWKVIVHXHZI[JZIY",3303:" 79F^RHPFNFLGJJINIRJVLYNZQ[T[WZYY[W RLHKJJMJRKVMYPZ RNFMGLIKMKQLUMWOYRZUZXY[W RUFRHQIPKPLQNTPURUT RQ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[IYKXNXPY RJYNYOZ RG[JZMZN[PY RRJLX RNSVS",3502:"110F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RRIQJPLPU RQKQS RRIRRQTPU RRIXFZG[I[KYMUO RXGZIZK RVGXHYIYLWN RWNZP[R[X RYPZRZW RWNXOYQYX RJ[MYPXTXWY RLZOYTYVZ RJ[NZSZU[WYYX[X RUOUX RURYR RUUYU",3503:" 69E]NGLHJJILHOHSIVJXMZP[S[VZXYZW[U RJKINISKWNYQZTZWY RNGLIKKJNJRKUNXQYTYWXYW[U RPJPV RQJQT RRIRSQUPV RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RWIWX",3504:" 72G^IFWFYGZIZX RKGWGYIYW RIFJGLHWHXIXX ROKNLMNMOKOJPJRKQMQMV RNMNT RKPNP ROKOSNUMV RI[LYOXSXVY RKZNYSYUZ RI[MZRZT[VYXXZX RRHRX RRMTNVNXM RRSTRVRXS",3505:" 94G]IHKFMFOGQF RLGNG RIHKGMHOHQF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RQMRJSHTGVFXF[G RTHVGXGZH RRJSIUHWHYI[G RQURRSPTOVOXP RTPVPWQ RRRSQUQVRXP RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RQMQX",3506:" 91F]JHLFOFQGSF RMGPG RJHLGNHQHSF RPKOLNNNOLOKPKRLQNQNV ROMOT RLPOP RPKPSOUNV RSJSYRZQZMXKXIYG[ RTJTX RTPXP RPZOZMYJY RUIUOXO RXQUQUWTYP[N[LZJZG[ RSJUIXFZG\\G]F RWGYH[H RVHXIZI\\H]F RXIXW",3507:" 87E^NGLHJJILHOHRIUJWLYNZQ[U[XZZX[V[SZQYPWOUO RJKINISJV RNGLIKKJNJSKVLXNZ RYXZWZSYQ RU[WZXYYWYSXQWPUO RPJPW RQJQU RRIRTQVPW RPJRIUFWGYGZF RTGVHXH RSHUIWIYHZF RYHUOU[ RUSYS RUVYV",3508:"112F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZOYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOWNYLZM[P[TZXX[ RXMYNZPZUYX RWNXNYPYUX[ RUOUY RURYR RUUYU",3509:" 67I\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZSZOXMXKYI[ RWKWW RRZQZOYLY RYHXJXVWXUZS[P[NZKZI[",3510:" 65H\\LHNFQFTGVF ROGSG RLHNGQHTHVF RSKRLQNQOOONPNROQQQQV RRMRT ROPRP RSKSSRUQV RYHWJVMVXUZ RWKWW RYHXJXVWXUZR[O[LZJXJVKULUMVLWKW RJVMV",3511:"115F^HHJFMFOGQF RKGNG RHHJGLHOHQF RMKLLKNKOIOHPHRIQKQKW RLMLU RIPLP RMKMTLVKW RJ[MYPXSXUY RLZNYRYTZ RJ[NZQZS[UY RRIQJPLPU RQKQS RRIRRQTPU RRITGVFXFZG RWGXGYH RTGVGXIZG RUOXLYM[N RWMYN[N R[NYQWSUU RWSYTZX[Z\\Z RYVZZ RWSXTYZZ[[[\\Z RUOUY",3512:" 85G]IHKFNFPGRF RLGOG RIHKGMHPHRF RNKMLLNLOJOIPIRJQLQLW RMMMU RJPMP RNKNTMVLW RK[NYRXWX[Y RMZPYWYZZ RK[OZVZY[[Y RSIRJQLQU RRKRS RSISRRTQU RSIUGWFYF[G RXGYGZH RUGWGYI[G RWGWX",3513:"107D`LJKKJMJOHOGPGRHQJQJU RKLKS RHPKP RLJLRKTJU RE[GYIXKXMYNYOX RHYKYMZ RE[GZJZL[M[NZOX RLJPFTJTWUYVY RPGSJSXRYSZTYSX RPPSP RNHOHRKROOO ROQRQRXQYS[VYWX RTJX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RJRX RRMTNVNXM RRSTRVRXS",3526:" 57H\\XGWIROOSMWJ[ RVKNV RZFWJUNRRMXLZ RJHLFOGUGZF RKGOHSHWG RJHNIRIVHXG RLZNYRXVXZY RMZQYUYYZ RJ[OZUZX[ZY RMPQP RTPXP",3601:" 53J[PRNTMVMXNZP[RYUX RMVNXOYQZ RNTNVOXQYRY RNPPPSOUNVMXOWPWXXYYY RONNOQO RTOWOVNVYWZ RMOOMPNROUPUYW[YY RMORT",3602:" 44I[LHMJMXKY RNJMHNGNXQZ RLHOFOXQYRZ RKYMYOZP[RZUYWY ROPROTNUMVNXOYOWPWY RTNVOVX RROSOUPUY",3603:" 35JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMUNWOXO RSNTOVO RPORNTPVPXO",3604:" 41IZRMPNMOMXKY RNONXQZ RRMOOOXQYRZ RKYMYOZP[RZUYWY RMHPFQIWOWY RPINHOGPIVOVX RMHUPUY",3605:" 32JXNONXLYMYOZP[ ROOOYQZ RPOPXRYSYQZP[ RNORNTMWQURPU RSNVQ RPORNUR",3606:" 41JWNHNXLYMYOZP[ ROHOYQZ RPHPXRYSYQZP[ RNHQGSFTGVHWH RRGSHUH RPHQGSIUIWH RKMNM RPMTM",3607:" 56I[MOMXKYLYNZO[PZRYUX RNPNYPZ ROOOXQYRY RMOOORNTMUNWOYOWPW\\V_TaRbQaO`M` RSNVPV\\ RSaQ`P` RRNSOUPUZV]V_ RTaS`Q_O_M`",3608:" 47I[LHMJMXKYLYNZO[ RNJMHNGNYPZ RLHOFOXQYO[ ROPROTNUMVNXOYOWPWYU[T] RTNVOVYU[ RROSOUPUYT]T`UbVbT`",3609:" 35MWRFPHRITHRF RRGQHSHRG RRMQNOOQPQYS[UY RRPSORNQORPRYSZ RRMSNUOSPSXTYUY",3610:" 39MWRFPHRITHRF RRGQHSHRG RRMQNOOQPQYS[T] RRPSORNQORPRYS[ RRMSNUOSPSYT]T`RbPbPaRb",3611:" 50IZLHMJMXKYLY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XWX RMNNONXQZ RLMNNOOOWPXRY RUMVNXOYOWPWX RTNVOVW RUMSOUPUX",3623:" 57E_HMIOIXL[NYQX RINJOJXMZ RHMJNKOKWLXNY RQMOOQPQXT[VYYX[X RPNRORXUZ RQMRNTOSPSWTXVY RYMZN\\O]O[P[X RXNZOZW RYMWOYPYX",3624:" 59H[KOLONPOQSYTZV[XY RMNOOTYVZ RKOMMONPOTWUXWYXY RRSUMVNXNYM RUNVOWO RTOVPXOYM RQUN[MZKZJ[ RNZMYLY ROYMXKYJ[ RMTPT RSTVT",3625:" 60I[KOLOMPMXKY RLNNONYPZ RKOMMOOOXQYRY RKYLYNZO[PZRYUX RUMVNXOYOWPW\\V_TaRbQaO`M` RTNVOV\\ RSaQ`P` RUMSOUPUZV]V_ RTaS`Q_O_M`",3626:" 38I[XML[ RLONPQPTOXM RMNOOSO RLONMPNTNXM RL[PYSXVXXY RQYUYWZ RL[PZTZV[XY RNTVT",3700:" 42H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJYLYNZO[QZVYXY",3701:" 27H\\OHPIQKQXOY RQIPHQGRIRYTZ ROHRFSHSXUYVY ROYPYRZS[TZVY",3702:" 48H\\LHNHPGQFSGVHXH RPHRG RLHNIPIRHSG RVHVP RWIWO RXHXPQPNQLSKVK[ RK[OYSXVXZY RNZQYVYYZ RK[PZUZX[ZY",3703:" 57H\\LHMHOGPFRGVHXH ROHQG RLHNIPIRG RVHVO RWIWN RXHXOVOSPQQ RQPSQVRXRXY RWSWX RVRVY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3704:" 41H\\UFKPKUTU RVUZU[V[TZU RLPLT RMNMU RTGTXRY RUJVHUGUYWZ RUFWHVJVXXYYY RRYSYUZV[WZYY",3705:" 53H\\LFLO RLFXF RMGVG RLHUHWGXF RVLUMSNOOLO RSNTNVOVY RUMWNWX RVLWMYNZNXOXY RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3706:" 59H\\LHLXJY RMIMXPZ RNHNXPYQZ RLHNHRGTFUGWHXH RSGUH RRGTIVIXH RNPOPSOUNVM RSOTOVPVY RUNWPWX RVMWNYOZOXPXY RJYLYNZO[QZVYXY",3707:" 38H\\KHMFPGUGZF RLGOHTHWG RKHOIRIVHZF RZFYHWKSOQRPUPXQ[ RRQQTQWRZ RUMSPRSRVSYQ[",3708:" 71H\\LILO RMJMN RNINO RLINISHUGVF RSHTHVIVO RUGWHWN RVFWGYHZHXIXO RLONOVRXR RXOVONRLR RLRLXJY RMSMXPZ RNRNXPYQZ RVRVY RWSWX RXRXY RJYLYNZO[QZVYXY",3709:" 60H\\LHLQJR RMIMROS RNHNQPRQR RLHNHSGUF RSGTHVIVY RTGWIWX RUFVGXHZHXIXY RJRKRMSNTOSQRUQVQ RKYMXOXQYRZ ROYQZ RKYMYOZP[RZVYXY",3710:" 11LXRXPZR[TZRX RRYQZSZRY",3711:" 14LXR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3712:" 22LXRMPORPTORM RRNQOSORN RRXPZR[TZRX RRYQZSZRY",3713:" 25LXRMPORPTORM RRNQOSORN RR^R\\PZRXSZS\\R^P_ RRYQZR[RY",3714:" 30LXRFQGOHQIRT RRISHRGQHRIRT RRFSGUHSIRT RRXPZR[TZRX RRYQZSZRY",3715:" 51I[LJMHNGQFSFVGWHXJXLWNUPSQ RMJNH RVHWIWMVN RLJNKNIOGQF RSFUGVIVMUOSQ RRQRTSQQQRT RRXPZR[TZRX RRYQZSZRY",3716:" 14LXTFRGQIQKRMTKRIRG RRJRLSKRJ",3717:" 14LXRLRJPHRFSHSJRLPM RRGQHRIRG",3718:" 62E_YNZO[O\\N RXOYP[P RXPYQZQ[P\\N RYNST RRUL[HVNP ROOSKOFJLPRTXVZX[Z[[Z\\X RLZIV RRKOG RKLPQTWVYXZ[Z RMZIU RRLNG RKKQQUWVXXY[Y\\X",3719:" 60H\\PBP_ RTBT_ RTFVGWIWKYJ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 ROIUFWHUISG RTGVH RLMOM RQMUM",3907:" 41J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW]V_U`SaQaO`MaObQa RTNVPV]U_ RPaNa RRNUQU^T`Sa",3908:" 42I[NHLFMJMXLYN[ RNHNXMYNZOYNX RNHPFOJOXPYN[ ROORNTMWPWYT]T`UbVbT` RTNVPVYU[ RRNUQUZT]",3909:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQXPYR[ RRPSORNQORPRXQYRZSYRX RRMTOSPSXTYR[",3910:" 37MWRFPHRJTHRF RRGQHRISHRG RRMPOQPQYT] RRPSORNQORPRYS[ RRMTOSPSZT]T`RbPaPbRb",3911:" 51IZNHLFMJMXLYN[ RNHNXMYNZOYNX RNHPFOJOXPYN[ ROPRNTMVPSROU RSNUP RRNTQ RRSSTTYV[XY RSSTUUYVZ RSRTSVXWYXY",3912:" 21MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[",3913:" 66E_GOHOIPIXHYJ[ RINJOJXIYJZKYJX RGOIMKOKXLYJ[ RKONNPMSOSXTYR[ RPNRORXQYRZSYRX RNNQPQXPYR[ RSOVNXM[O[X\\YZ[ RXNZOZXYYZZ[YZX RVNYPYXXYZ[",3914:" 44I[KOLOMPMXLYN[ RMNNONXMYNZOYNX RKOMMOOOXPYN[ ROORNTMWOWXXYV[ RTNVOVXUYVZWYVX RRNUPUXTYV[",3915:" 28JZMPMXP[UYWX RNPNXPZ ROOOWRZ RMPOOTMWPWX RTNVPVX RRNUQUY",3916:" 47IZLMMOMXKYMYM_LbN` RNON` RLMNNOOOXQYRZ RNYOYQZ ROZP[UYWX ROZO_PbN` ROORNTMWPWX RTNVPVX RRNUQUY",3917:" 31J[MPMXP[UY RNPNXPZ ROOOWRZ RMPOOTMWPW_XbV` RTNVPV` RRNUQU_TbV`",3918:" 31KXMONOOPOXNYP[ RONPOPXOYPZQYPX RMOOMQOQXRYP[ RQOUMWOUPSN RTNVO",3919:" 41JZMPMSOUURWTWX RNPNSOT ROOOSPT RUSVTVX RTSUTUY RMPSMVNTOQN RRNUN RWXQ[MYOXSZ ROYQZ",3920:" 27MWRHPFQJQXPYR[ RRHRXQYRZSYRX RRHTFSJSXTYR[ RNMQM RSMVM",3921:" 40I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPWXXYYY RVPWOVNUOVPVYWZ RVMTOUPUYW[YY",3922:" 36I[LMMOMXQ[SYWW RMNNONXQZ RLMNNOOOWRYSY RVMXOWPWW RVPWOVNUOVPVW RVMTOUPUX",3923:" 59E_HMIOIXM[OYQX RINJOJXMZ RHMJNKOKWNYOY RRMPOQPQXU[WY[W RRPSORNQORPRXUZ RRMTOSPSWVYWY RZM\\O[P[W RZP[OZNYOZPZW RZMXOYPYX",3924:" 39I[LONPUZV[XY RMNOOUYWZ RLONMONVXXY RXMVMVOXOXMVOSS RQUNYL[N[NYLYL[ RNTQT RSTVT",3925:" 49I[KOLOMPMYP[UY RMNNONYPZ RKOMMOOOXRZ RVMXOWPW]V_U`SaQaO`MaObQa RVPWOVNUOVPV^U_ RPaNa RVMTOUPU^T`Sa",3926:" 43L[RNOPOORNTMWOWSRU RTNVOVS RRNUPUSTT RRUWWW]V_U`SaQaO`MaObQa RVWV^U_ RPaNa RTVUWU^T`Sa"},Ke={"\\frac":{glyph:0,arity:2,flags:{}},"\\binom":{glyph:0,arity:2,flags:{}},"\\sqrt":{glyph:2267,arity:1,flags:{opt:!0,xfl:!0,yfl:!0}},"^":{glyph:0,arity:1,flags:{}},_:{glyph:0,arity:1,flags:{}},"(":{glyph:2221,arity:0,flags:{yfl:!0}},")":{glyph:2222,arity:0,flags:{yfl:!0}},"[":{glyph:2223,arity:0,flags:{yfl:!0}},"]":{glyph:2224,arity:0,flags:{yfl:!0}},"\\langle":{glyph:2227,arity:0,flags:{yfl:!0}},"\\rangle":{glyph:2228,arity:0,flags:{yfl:!0}},"|":{glyph:2229,arity:0,flags:{yfl:!0}},"\\|":{glyph:2230,arity:0,flags:{yfl:!0}},"\\{":{glyph:2225,arity:0,flags:{yfl:!0}},"\\}":{glyph:2226,arity:0,flags:{yfl:!0}},"\\#":{glyph:2275,arity:0,flags:{}},"\\$":{glyph:2274,arity:0,flags:{}},"\\&":{glyph:2273,arity:0,flags:{}},"\\%":{glyph:2271,arity:0,flags:{}},"\\begin":{glyph:0,arity:1,flags:{}},"\\end":{glyph:0,arity:1,flags:{}},"\\left":{glyph:0,arity:1,flags:{}},"\\right":{glyph:0,arity:1,flags:{}},"\\middle":{glyph:0,arity:1,flags:{}},"\\cdot":{glyph:2236,arity:0,flags:{}},"\\pm":{glyph:2233,arity:0,flags:{}},"\\mp":{glyph:2234,arity:0,flags:{}},"\\times":{glyph:2235,arity:0,flags:{}},"\\div":{glyph:2237,arity:0,flags:{}},"\\leqq":{glyph:2243,arity:0,flags:{}},"\\geqq":{glyph:2244,arity:0,flags:{}},"\\leq":{glyph:2243,arity:0,flags:{}},"\\geq":{glyph:2244,arity:0,flags:{}},"\\propto":{glyph:2245,arity:0,flags:{}},"\\sim":{glyph:2246,arity:0,flags:{}},"\\equiv":{glyph:2240,arity:0,flags:{}},"\\dagger":{glyph:2277,arity:0,flags:{}},"\\ddagger":{glyph:2278,arity:0,flags:{}},"\\ell":{glyph:662,arity:0,flags:{}},"\\vec":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overrightarrow":{glyph:2261,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\overleftarrow":{glyph:2263,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\bar":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\overline":{glyph:2231,arity:1,flags:{hat:!0,xfl:!0}},"\\widehat":{glyph:2247,arity:1,flags:{hat:!0,xfl:!0,yfl:!0}},"\\hat":{glyph:2247,arity:1,flags:{hat:!0}},"\\acute":{glyph:2248,arity:1,flags:{hat:!0}},"\\grave":{glyph:2249,arity:1,flags:{hat:!0}},"\\breve":{glyph:2250,arity:1,flags:{hat:!0}},"\\tilde":{glyph:2246,arity:1,flags:{hat:!0}},"\\underline":{glyph:2231,arity:1,flags:{mat:!0,xfl:!0}},"\\not":{glyph:2220,arity:1,flags:{}},"\\neq":{glyph:2239,arity:1,flags:{}},"\\ne":{glyph:2239,arity:1,flags:{}},"\\exists":{glyph:2279,arity:0,flags:{}},"\\in":{glyph:2260,arity:0,flags:{}},"\\subset":{glyph:2256,arity:0,flags:{}},"\\supset":{glyph:2258,arity:0,flags:{}},"\\cup":{glyph:2257,arity:0,flags:{}},"\\cap":{glyph:2259,arity:0,flags:{}},"\\infty":{glyph:2270,arity:0,flags:{}},"\\partial":{glyph:2265,arity:0,flags:{}},"\\nabla":{glyph:2266,arity:0,flags:{}},"\\aleph":{glyph:2077,arity:0,flags:{}},"\\wp":{glyph:2190,arity:0,flags:{}},"\\therefore":{glyph:740,arity:0,flags:{}},"\\mid":{glyph:2229,arity:0,flags:{}},"\\sum":{glyph:2402,arity:0,flags:{big:!0}},"\\prod":{glyph:2401,arity:0,flags:{big:!0}},"\\bigoplus":{glyph:2284,arity:0,flags:{big:!0}},"\\bigodot":{glyph:2281,arity:0,flags:{big:!0}},"\\int":{glyph:2412,arity:0,flags:{yfl:!0}},"\\oint":{glyph:2269,arity:0,flags:{yfl:!0}},"\\oplus":{glyph:1284,arity:0,flags:{}},"\\odot":{glyph:1281,arity:0,flags:{}},"\\perp":{glyph:738,arity:0,flags:{}},"\\angle":{glyph:739,arity:0,flags:{}},"\\triangle":{glyph:842,arity:0,flags:{}},"\\Box":{glyph:841,arity:0,flags:{}},"\\rightarrow":{glyph:2261,arity:0,flags:{}},"\\to":{glyph:2261,arity:0,flags:{}},"\\leftarrow":{glyph:2263,arity:0,flags:{}},"\\gets":{glyph:2263,arity:0,flags:{}},"\\circ":{glyph:902,arity:0,flags:{}},"\\bigcirc":{glyph:904,arity:0,flags:{}},"\\bullet":{glyph:828,arity:0,flags:{}},"\\star":{glyph:856,arity:0,flags:{}},"\\diamond":{glyph:743,arity:0,flags:{}},"\\ast":{glyph:728,arity:0,flags:{}},"\\log":{glyph:0,arity:0,flags:{txt:!0}},"\\ln":{glyph:0,arity:0,flags:{txt:!0}},"\\exp":{glyph:0,arity:0,flags:{txt:!0}},"\\mod":{glyph:0,arity:0,flags:{txt:!0}},"\\lim":{glyph:0,arity:0,flags:{txt:!0,big:!0}},"\\sin":{glyph:0,arity:0,flags:{txt:!0}},"\\cos":{glyph:0,arity:0,flags:{txt:!0}},"\\tan":{glyph:0,arity:0,flags:{txt:!0}},"\\csc":{glyph:0,arity:0,flags:{txt:!0}},"\\sec":{glyph:0,arity:0,flags:{txt:!0}},"\\cot":{glyph:0,arity:0,flags:{txt:!0}},"\\sinh":{glyph:0,arity:0,flags:{txt:!0}},"\\cosh":{glyph:0,arity:0,flags:{txt:!0}},"\\tanh":{glyph:0,arity:0,flags:{txt:!0}},"\\csch":{glyph:0,arity:0,flags:{txt:!0}},"\\sech":{glyph:0,arity:0,flags:{txt:!0}},"\\coth":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsin":{glyph:0,arity:0,flags:{txt:!0}},"\\arccos":{glyph:0,arity:0,flags:{txt:!0}},"\\arctan":{glyph:0,arity:0,flags:{txt:!0}},"\\arccsc":{glyph:0,arity:0,flags:{txt:!0}},"\\arcsec":{glyph:0,arity:0,flags:{txt:!0}},"\\arccot":{glyph:0,arity:0,flags:{txt:!0}},"\\text":{glyph:0,arity:1,flags:{}},"\\mathnormal":{glyph:0,arity:1,flags:{}},"\\mathrm":{glyph:0,arity:1,flags:{}},"\\mathit":{glyph:0,arity:1,flags:{}},"\\mathbf":{glyph:0,arity:1,flags:{}},"\\mathsf":{glyph:0,arity:1,flags:{}},"\\mathtt":{glyph:0,arity:1,flags:{}},"\\mathfrak":{glyph:0,arity:1,flags:{}},"\\mathcal":{glyph:0,arity:1,flags:{}},"\\mathbb":{glyph:0,arity:1,flags:{}},"\\mathscr":{glyph:0,arity:1,flags:{}},"\\rm":{glyph:0,arity:1,flags:{}},"\\it":{glyph:0,arity:1,flags:{}},"\\bf":{glyph:0,arity:1,flags:{}},"\\sf":{glyph:0,arity:1,flags:{}},"\\tt":{glyph:0,arity:1,flags:{}},"\\frak":{glyph:0,arity:1,flags:{}},"\\cal":{glyph:0,arity:1,flags:{}},"\\bb":{glyph:0,arity:1,flags:{}},"\\scr":{glyph:0,arity:1,flags:{}},"\\quad":{glyph:0,arity:0,flags:{}},"\\,":{glyph:0,arity:0,flags:{}},"\\.":{glyph:0,arity:0,flags:{}},"\\;":{glyph:0,arity:0,flags:{}},"\\!":{glyph:0,arity:0,flags:{}},"\\alpha":{glyph:2127,flags:{}},"\\beta":{glyph:2128,flags:{}},"\\gamma":{glyph:2129,flags:{}},"\\delta":{glyph:2130,flags:{}},"\\varepsilon":{glyph:2131,flags:{}},"\\zeta":{glyph:2132,flags:{}},"\\eta":{glyph:2133,flags:{}},"\\vartheta":{glyph:2134,flags:{}},"\\iota":{glyph:2135,flags:{}},"\\kappa":{glyph:2136,flags:{}},"\\lambda":{glyph:2137,flags:{}},"\\mu":{glyph:2138,flags:{}},"\\nu":{glyph:2139,flags:{}},"\\xi":{glyph:2140,flags:{}},"\\omicron":{glyph:2141,flags:{}},"\\pi":{glyph:2142,flags:{}},"\\rho":{glyph:2143,flags:{}},"\\sigma":{glyph:2144,flags:{}},"\\tau":{glyph:2145,flags:{}},"\\upsilon":{glyph:2146,flags:{}},"\\varphi":{glyph:2147,flags:{}},"\\chi":{glyph:2148,flags:{}},"\\psi":{glyph:2149,flags:{}},"\\omega":{glyph:2150,flags:{}},"\\epsilon":{glyph:2184,flags:{}},"\\theta":{glyph:2185,flags:{}},"\\phi":{glyph:2186,flags:{}},"\\varsigma":{glyph:2187,flags:{}},"\\Alpha":{glyph:2027,flags:{}},"\\Beta":{glyph:2028,flags:{}},"\\Gamma":{glyph:2029,flags:{}},"\\Delta":{glyph:2030,flags:{}},"\\Epsilon":{glyph:2031,flags:{}},"\\Zeta":{glyph:2032,flags:{}},"\\Eta":{glyph:2033,flags:{}},"\\Theta":{glyph:2034,flags:{}},"\\Iota":{glyph:2035,flags:{}},"\\Kappa":{glyph:2036,flags:{}},"\\Lambda":{glyph:2037,flags:{}},"\\Mu":{glyph:2038,flags:{}},"\\Nu":{glyph:2039,flags:{}},"\\Xi":{glyph:2040,flags:{}},"\\Omicron":{glyph:2041,flags:{}},"\\Pi":{glyph:2042,flags:{}},"\\Rho":{glyph:2043,flags:{}},"\\Sigma":{glyph:2044,flags:{}},"\\Tau":{glyph:2045,flags:{}},"\\Upsilon":{glyph:2046,flags:{}},"\\Phi":{glyph:2047,flags:{}},"\\Chi":{glyph:2048,flags:{}},"\\Psi":{glyph:2049,flags:{}},"\\Omega":{glyph:2050,flags:{}}};function jo(o,e="math"){const t=o.charCodeAt(0);if(65<=t&&t<=90){const n=t-65;return e=="text"||e=="rm"?n+2001:e=="tt"?n+501:e=="bf"||e=="bb"?n+3001:e=="sf"?n+2501:e=="frak"?n+3301:e=="scr"||e=="cal"?n+2551:n+2051}if(97<=t&&t<=122){const n=t-97;return e=="text"||e=="rm"?n+2101:e=="tt"?n+601:e=="bf"||e=="bb"?n+3101:e=="sf"?n+2601:e=="frak"?n+3401:e=="scr"||e=="cal"?n+2651:n+2151}if(48<=t&&t<=57){const n=t-48;return e=="it"?n+2750:e=="bf"?n+3200:e=="tt"?n+700:n+2200}return{".":2210,",":2211,":":2212,";":2213,"!":2214,"?":2215,"'":2216,'"':2217,"*":2219,"/":2220,"-":2231,"+":2232,"=":2238,"<":2241,">":2242,"~":2246,"@":2273,"\\":804}[o]}const _t={SUB_SUP_SCALE:.5,SQRT_MAG_SCALE:.5,FRAC_SCALE:.85,LINE_SPACING:.5,FRAC_SPACING:.4};function Wc(o){o=o.replace(/\n/g," ");let e=0;const t=[];let n="";for(;e<o.length;)o[e]==" "?n.length&&(t.push(n),n=""):o[e]=="\\"?n.length==1&&n[0]=="\\"?(n+=o[e],t.push(n),n=""):(n.length&&t.push(n),n=o[e]):/[A-Za-z0-9\.]/.test(o[e])?n+=o[e]:(n.length&&n!="\\"&&(t.push(n),n=""),n+=o[e],t.push(n),n=""),e++;return n.length&&t.push(n),t}function Dc(o){return{type:Ke[o]?"symb":"char",mode:"math",text:o,chld:[],bbox:null}}function rs(o){let e=0,t={type:"node",text:"",mode:"math",chld:[],bbox:null};function n(){if(o[e]!="[")return null;let r=0,s=e;for(;s<o.length;){if(o[s]=="[")r++;else if(o[s]=="]"&&(r--,!r))break;s++}const l=rs(o.slice(e+1,s));return e=s,l}function i(r){let s=e,l=s,a=0,c=0;const d=[];for(;s<o.length;){if(o[s]=="{")a||(l=s),a++;else if(o[s]=="}"){if(a--,!a&&(d.push(rs(o.slice(l+1,s))),c++,c==r))break}else if(a==0&&(d.push(Dc(o[s])),c++,c==r))break;s++}return e=s,d}for(e=0;e<o.length;e++){const r=Ke[o[e]],s={type:"",text:o[e],mode:"math",chld:[],bbox:null};if(r)if(r.arity){e++,s.type="func";let l=null;r.flags.opt&&(l=n(),l&&e++);const a=i(r.arity);s.chld=a,l&&s.chld.push(l)}else s.type="symb";else o[e]=="{"?(s.type="node",s.text="",s.chld=i(1)):s.type="char";t.chld.push(s)}return t.chld.length==1&&(t=t.chld[0]),t}function Pl(o){let e=0;for(;e<o.length;){if(o[e].text=="\\begin"){let t;for(t=e;t<o.length&&o[t].text!="\\end";t++);const n=o.splice(e+1,t-(e+1));Pl(n),o[e].text=o[e].chld[0].text,o[e].chld=n,o.splice(e+1,1)}e++}}function xt(o,e,t,n,i,r){if(t==null&&(t=e),!!o.bbox){r&&(o.bbox.x*=e,o.bbox.y*=t),o.bbox.w*=e,o.bbox.h*=t;for(let s=0;s<o.chld.length;s++)xt(o.chld[s],e,t,0,0,!0);o.bbox.x+=n,o.bbox.y+=i}}function Ol(o){let e=1/0,t=-1/0,n=1/0,i=-1/0;for(let r=0;r<o.length;r++)o[r].bbox&&(e=Math.min(e,o[r].bbox.x),n=Math.min(n,o[r].bbox.y),t=Math.max(t,o[r].bbox.x+o[r].bbox.w),i=Math.max(i,o[r].bbox.y+o[r].bbox.h));return{x:e,y:n,w:t-e,h:i-n}}function Vc(o){if(!o.length)return null;const e=Ol(o);for(let n=0;n<o.length;n++)o[n].bbox&&(o[n].bbox.x-=e.x,o[n].bbox.y-=e.y);return{type:"node",text:"",mode:"math",chld:o,bbox:e}}function Yc(o,e="center"){for(let c=0;c<o.length;c++)if(o[c].text=="^"||o[c].text=="'"){let d=0,u=c;for(;u>0&&(o[u].text=="^"||o[u].text=="_"||o[u].text=="'");)u--;d=o[u].bbox.y,o[c].text=="'"?o[c].bbox.y=d:(xt(o[c],_t.SUB_SUP_SCALE,null,0,0),Ke[o[u].text]&&Ke[o[u].text].flags.big?o[c].bbox.y=d-o[c].bbox.h:o[u].text=="\\int"?o[c].bbox.y=d:o[c].bbox.y=d-o[c].bbox.h/2)}else if(o[c].text=="_"){let d=1,u=c;for(;u>0&&(o[u].text=="^"||o[u].text=="_"||o[u].text=="'");)u--;d=o[u].bbox.y+o[u].bbox.h,xt(o[c],_t.SUB_SUP_SCALE,null,0,0),Ke[o[u].text]&&Ke[o[u].text].flags.big?o[c].bbox.y=d:o[u].text=="\\int"?o[c].bbox.y=d-o[c].bbox.h:o[c].bbox.y=d-o[c].bbox.h/2}function t(c,d,u,h,R){let g=c,m=R,f=1/0,T=-1/0;for(;h>0?g<o.length:g>=0;){if(o[g].text==d)m++;else if(o[g].text==u){if(m--,m==0)break}else o[g].text=="^"||o[g].text=="_"||o[g].bbox&&(f=Math.min(f,o[g].bbox.y),T=Math.max(T,o[g].bbox.y+o[g].bbox.h));g+=h}return[f,T]}for(let c=0;c<o.length;c++)if(o[c].text=="\\left"){const[d,u]=t(c,"\\left","\\right",1,0);d!=1/0&&u!=-1/0&&(o[c].bbox.y=d,xt(o[c],1,(u-d)/o[c].bbox.h,0,0))}else if(o[c].text=="\\right"){const[d,u]=t(c,"\\right","\\left",-1,0);d!=1/0&&u!=-1/0&&(o[c].bbox.y=d,xt(o[c],1,(u-d)/o[c].bbox.h,0,0))}else if(o[c].text=="\\middle"){const[d,u]=t(c,"\\right","\\left",-1,1),[h,R]=t(c,"\\left","\\right",1,1),g=Math.min(d,h),m=Math.max(u,R);g!=1/0&&m!=-1/0&&(o[c].bbox.y=g,xt(o[c],1,(m-g)/o[c].bbox.h,0,0))}if(!o.some(c=>c.text=="&"||c.text=="\\\\"))return;const n=[];let i=[],r=[];for(let c=0;c<o.length;c++)o[c].text=="&"?(i.push(r),r=[]):o[c].text=="\\\\"?(r.length&&(i.push(r),r=[]),n.push(i),i=[]):r.push(o[c]);r.length&&i.push(r),i.length&&n.push(i);const s=[],l=[];for(let c=0;c<n.length;c++){const d=[];for(let u=0;u<n[c].length;u++){const h=Vc(n[c][u]);h&&(s[u]=s[u]||0,s[u]=Math.max(h.bbox.w+1,s[u])),d[u]=h}l.push(d)}const a=[];for(let c=0;c<l.length;c++){let d=1/0,u=-1/0;for(let h=0;h<l[c].length;h++)l[c][h]&&(d=Math.min(d,l[c][h].bbox.y),u=Math.max(u,l[c][h].bbox.y+l[c][h].bbox.h));a.push([d,u])}for(let c=0;c<a.length;c++)(a[c][0]==1/0||a[c][1]==1/0)&&(a[c][0]=c==0?0:a[c-1][1],a[c][1]=a[c][0]+2);for(let c=1;c<l.length;c++){const d=a[c-1][1]-a[c][0]+_t.LINE_SPACING;for(let u=0;u<l[c].length;u++)l[c][u]&&(l[c][u].bbox.y+=d);a[c][0]+=d,a[c][1]+=d}o.splice(0,o.length);for(let c=0;c<l.length;c++){let d=0;for(let u=0;u<l[c].length;u++){const h=l[c][u];if(!h){d+=s[u];continue}h.bbox.x+=d,d+=s[u]-h.bbox.w,e=="center"?h.bbox.x+=(s[u]-h.bbox.w)/2:e=="left"||(e=="right"||e=="equation"&&u!=l[c].length-1)&&(h.bbox.x+=s[u]-h.bbox.w),o.push(h)}}}function nn(o,e="math"){const t={"\\text":"text","\\mathnormal":"math","\\mathrm":"rm","\\mathit":"it","\\mathbf":"bf","\\mathsf":"sf","\\mathtt":"tt","\\mathfrak":"frak","\\mathcal":"cal","\\mathbb":"bb","\\mathscr":"scr","\\rm":"rm","\\it":"it","\\bf":"bf","\\sf":"tt","\\tt":"tt","\\frak":"frak","\\cal":"cal","\\bb":"bb","\\scr":"scr"}[o.text]??e;if(!o.chld.length){if(Ke[o.text])if(Ke[o.text].flags.big)o.text=="\\lim"?o.bbox={x:0,y:0,w:3.5,h:2}:o.bbox={x:0,y:-.5,w:3,h:3};else if(Ke[o.text].flags.txt){let n=0;for(let i=1;i<o.text.length;i++)n+=Gn(jo(o.text[i],"text")).w;n/=16,o.bbox={x:0,y:0,w:n,h:2}}else if(Ke[o.text].glyph){let n=Gn(Ke[o.text].glyph).w;n/=16,o.text=="\\int"||o.text=="\\oint"?o.bbox={x:0,y:-1.5,w:n,h:5}:o.bbox={x:0,y:0,w:n,h:2}}else o.bbox={x:0,y:0,w:1,h:2};else{let n=0;for(let i=0;i<o.text.length;i++)Gn(jo(o.text[i],t))&&(t=="tt"?n+=16:n+=Gn(jo(o.text[i],t)).w);n/=16,o.bbox={x:0,y:0,w:n,h:2}}o.mode=t;return}if(o.text=="\\frac"){const n=o.chld[0],i=o.chld[1],r=_t.FRAC_SCALE;nn(n),nn(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const s=Math.max(n.bbox.w,i.bbox.w)*r;xt(n,r,null,(s-n.bbox.w*r)/2,0),xt(i,r,null,(s-i.bbox.w*r)/2,n.bbox.h+_t.FRAC_SPACING),o.bbox={x:0,y:-n.bbox.h+1-_t.FRAC_SPACING/2,w:s,h:n.bbox.h+i.bbox.h+_t.FRAC_SPACING}}else if(o.text=="\\binom"){const n=o.chld[0],i=o.chld[1];nn(n),nn(i),n.bbox.x=0,n.bbox.y=0,i.bbox.x=0,i.bbox.y=0;const r=Math.max(n.bbox.w,i.bbox.w);xt(n,1,null,(r-n.bbox.w)/2+1,0),xt(i,1,null,(r-i.bbox.w)/2+1,n.bbox.h),o.bbox={x:0,y:-n.bbox.h+1,w:r+2,h:n.bbox.h+i.bbox.h}}else if(o.text=="\\sqrt"){const n=o.chld[0];nn(n);const i=o.chld[1];let r=0;i&&(nn(i),r=Math.max(i.bbox.w*_t.SQRT_MAG_SCALE-.5,0),xt(i,_t.SQRT_MAG_SCALE,null,0,.5)),xt(n,1,null,1+r,.5),o.bbox={x:0,y:2-n.bbox.h-.5,w:n.bbox.w+1+r,h:n.bbox.h+.5}}else if(Ke[o.text]&&Ke[o.text].flags.hat){const n=o.chld[0];nn(n);const i=n.bbox.y-.5;n.bbox.y=.5,o.bbox={x:0,y:i,w:n.bbox.w,h:n.bbox.h+.5}}else if(Ke[o.text]&&Ke[o.text].flags.mat){const n=o.chld[0];nn(n),o.bbox={x:0,y:0,w:n.bbox.w,h:n.bbox.h+.5}}else{let n=0,i=0,r=1;for(let u=0;u<o.chld.length;u++){const h=o.chld[u],R={"\\quad":2,"\\,":6/18,"\\:":8/18,"\\;":10/18,"\\!":-6/18}[h.text]??null;if(h.text=="\\\\"){i+=r,n=0,r=1;continue}else{if(h.text=="&")continue;if(R!=null){n+=R;continue}else{if(nn(h,t),xt(h,1,null,n,i),h.text=="^"||h.text=="_"||h.text=="'"){let g=u;for(;g>0&&(o.chld[g].text=="^"||o.chld[g].text=="_"||o.chld[g].text=="'");)g--;const m=Ke[o.chld[g].text]&&Ke[o.chld[g].text].flags.big;if(h.text=="'"){let f=g+1,T=0;for(;f<u;)o.chld[f].text=="'"&&T++,f++;h.bbox.x=o.chld[g].bbox.x+o.chld[g].bbox.w+h.bbox.w*T,n=Math.max(n,h.bbox.x+h.bbox.w)}else if(m){const f=o.chld[g].bbox.x+(o.chld[g].bbox.w-h.bbox.w*_t.SUB_SUP_SCALE)/2;h.bbox.x=f,n=Math.max(n,o.chld[g].bbox.x+o.chld[g].bbox.w+(h.bbox.w*_t.SUB_SUP_SCALE-o.chld[g].bbox.w)/2)}else h.bbox.x=o.chld[g].bbox.x+o.chld[g].bbox.w,n=Math.max(n,h.bbox.x+h.bbox.w*_t.SUB_SUP_SCALE)}else n+=h.bbox.w;e=="text"&&(n+=1),r=Math.max(h.bbox.y+h.bbox.h-i,r)}}}i+=r;const s={bmatrix:["[","]"],pmatrix:["(",")"],Bmatrix:["\\{","\\}"],cases:["\\{"]},l={bmatrix:"center",pmatrix:"center",Bmatrix:"center",cases:"left",matrix:"center",aligned:"equation"}[o.text]??"left",a=!!s[o.text],c=!!s[o.text]&&s[o.text].length>1;Yc(o.chld,l);const d=Ol(o.chld);o.text=="\\text"&&(d.x-=1,d.w+=2);for(let u=0;u<o.chld.length;u++)xt(o.chld[u],1,null,-d.x+(a?1.5:0),-d.y);o.bbox={x:0,y:0,w:d.w+1.5*Number(a)+1.5*Number(c),h:d.h},a&&o.chld.unshift({type:"symb",text:s[o.text][0],mode:o.mode,chld:[],bbox:{x:0,y:0,w:1,h:d.h}}),c&&o.chld.push({type:"symb",text:s[o.text][1],mode:o.mode,chld:[],bbox:{x:d.w+2,y:0,w:1,h:d.h}}),(a||c||o.text=="matrix")&&(o.type="node",o.text="",o.bbox.y-=(o.bbox.h-2)/2)}}function wc(o){function e(n,i,r){const s=[];if(n.bbox){if(i+=n.bbox.x,r+=n.bbox.y,n.text=="\\frac"){const l=n.chld[1].bbox.y-(n.chld[0].bbox.y+n.chld[0].bbox.h),a={type:"symb",mode:n.mode,text:"\\bar",bbox:{x:i,y:r+(n.chld[1].bbox.y-l/2)-l/2,w:n.bbox.w,h:l},chld:[]};s.push(a)}else if(n.text=="\\sqrt"){const l=n.chld[0].bbox.y,a=Math.max(0,n.chld[0].bbox.x-n.chld[0].bbox.h/2),c={type:"symb",mode:n.mode,text:"\\sqrt",bbox:{x:i+a,y:r+l/2,w:n.chld[0].bbox.x-a,h:n.bbox.h-l/2},chld:[]};s.push(c),s.push({type:"symb",text:"\\bar",mode:n.mode,bbox:{x:i+n.chld[0].bbox.x,y:r,w:n.bbox.w-n.chld[0].bbox.x,h:l},chld:[]})}else if(n.text=="\\binom"){const l=Math.min(n.chld[0].bbox.x,n.chld[1].bbox.x),a={type:"symb",mode:n.mode,text:"(",bbox:{x:i,y:r,w:l,h:n.bbox.h},chld:[]};s.push(a),s.push({type:"symb",text:")",mode:n.mode,bbox:{x:i+n.bbox.w-l,y:r,w:l,h:n.bbox.h},chld:[]})}else if(Ke[n.text]&&Ke[n.text].flags.hat){const l=n.chld[0].bbox.y,a={type:"symb",mode:n.mode,text:n.text,bbox:{x:i,y:r,w:n.bbox.w,h:l},chld:[]};s.push(a)}else if(Ke[n.text]&&Ke[n.text].flags.mat){const l=n.chld[0].bbox.h,a={type:"symb",text:n.text,mode:n.mode,bbox:{x:i,y:r+l,w:n.bbox.w,h:n.bbox.h-l},chld:[]};s.push(a)}else if(n.type!="node"&&n.text!="^"&&n.text!="_"){const l={type:n.type=="func"?"symb":n.type,text:n.text,mode:n.mode,bbox:{x:i,y:r,w:n.bbox.w,h:n.bbox.h},chld:[]};s.push(l)}}for(let l=0;l<n.chld.length;l++){const a=e(n.chld[l],i,r);s.push(...a)}return s}const t=e(o,-o.bbox.x,-o.bbox.y);o.type="node",o.text="",o.chld=t}function Uc(o){const e=[];for(let t=0;t<o.chld.length;t++){const n=o.chld[t];let i=n.bbox.h/2,r=!1;if(Ke[n.text]&&Ke[n.text].flags.hat&&!Ke[n.text].flags.xfl&&!Ke[n.text].flags.yfl&&(i*=4,r=!0),Ke[n.text]&&Ke[n.text].glyph){const s=Gn(Ke[n.text].glyph);for(let l=0;l<s.polylines.length;l++){const a=[];for(let c=0;c<s.polylines[l].length;c++){let d=s.polylines[l][c][0],u=s.polylines[l][c][1];if(Ke[n.text].flags.xfl)d=(d-s.xmin)/Math.max(s.xmax-s.xmin,1)*n.bbox.w,d+=n.bbox.x;else if(s.w/16*i>n.bbox.w)d=d/Math.max(s.w,1)*n.bbox.w,d+=n.bbox.x;else{d=d/16*i;const h=(n.bbox.w-s.w/16*i)/2;d+=n.bbox.x+h}if(Ke[n.text].flags.yfl)u=(u-s.ymin)/Math.max(s.ymax-s.ymin,1)*n.bbox.h,u+=n.bbox.y;else{if(u=u/16*i,r){const h=(s.ymax+s.ymin)/2;u-=h/16*i}u+=n.bbox.y+n.bbox.h/2}a.push([d,u])}e.push(a)}}else if(Ke[n.text]&&Ke[n.text].flags.txt||n.type=="char"){let s=n.bbox.x;const l=!!(Ke[n.text]&&Ke[n.text].flags.txt);for(let a=Number(l);a<n.text.length;a++){const c=Gn(jo(n.text[a],l?"text":n.mode));if(!c){console.warn("unmapped character: "+n.text[a]);continue}for(let d=0;d<c.polylines.length;d++){const u=[];for(let h=0;h<c.polylines[d].length;h++){let R=c.polylines[d][h][0],g=c.polylines[d][h][1];R/=16,g/=16,R*=i,g*=i,n.mode=="tt"&&(c.w>16?R*=16/c.w:R+=(16-c.w)/2/16),R+=s,g+=n.bbox.y+n.bbox.h/2,u.push([R,g])}e.push(u)}n.mode=="tt"?s+=i:s+=c.w/16*i}}}return e}function tn(o){return Math.round(o*100)/100}class Zc{_latex;_tree;_tokens;_polylines;constructor(e){this._latex=e,this._tokens=Wc(e),this._tree=rs(this._tokens),Pl(this._tree.chld),nn(this._tree),wc(this._tree),this._polylines=Uc(this._tree)}resolveScale(e){if(e==null)return[16,16,16,16];let t=e.SCALE_X??16,n=e.SCALE_Y??16;if(e.MIN_CHAR_H!=null){let s=0;for(let a=0;a<this._tree.chld.length;a++){const c=this._tree.chld[a];(c.type=="char"||Ke[c.text]&&(Ke[c.text].flags.txt||!Object.keys(Ke[c.text].flags).length))&&(s=Math.min(c.bbox.h,s))}const l=Math.max(1,e.MIN_CHAR_H/s);t*=l,n*=l}if(e.MAX_W!=null){const s=t;t=Math.min(t,e.MAX_W/this._tree.bbox.w),n*=t/s}if(e.MAX_H!=null){const s=n;n=Math.min(n,e.MAX_H/this._tree.bbox.h),t*=n/s}const i=e.MARGIN_X??t,r=e.MARGIN_Y??n;return[i,r,t,n]}polylines(e){e||(e={});const t=[],[n,i,r,s]=this.resolveScale(e);for(let l=0;l<this._polylines.length;l++){t.push([]);for(let a=0;a<this._polylines[l].length;a++){const[c,d]=this._polylines[l][a];t[t.length-1].push([n+c*r,i+d*s])}}return t}pathd(e){e||(e={});let t="";const[n,i,r,s]=this.resolveScale(e);for(let l=0;l<this._polylines.length;l++)for(let a=0;a<this._polylines[l].length;a++){const[c,d]=this._polylines[l][a];t+=a?"L":"M",t+=`${tn(n+c*r)} ${tn(i+d*s)}`}return t}svg(e){e||(e={});const[t,n,i,r]=this.resolveScale(e),s=tn(this._tree.bbox.w*i+t*2),l=tn(this._tree.bbox.h*r+n*2);let a=`<svg
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ width="${s}" height="${l}"
15
+ fill="none" stroke="${e.FG_COLOR??"black"}" stroke-width="${e.STROKE_W??1}"
16
+ stroke-linecap="round" stroke-linejoin="round"
17
+ >`;e.BG_COLOR&&(a+=`<rect x="0" y="0" width="${s}" height="${l}" fill="${e.BG_COLOR}" stroke="none"></rect>`),a+='<path d="';for(let c=0;c<this._polylines.length;c++){a+="M";for(let d=0;d<this._polylines[c].length;d++){const[u,h]=this._polylines[c][d];a+=tn(t+u*i)+" "+tn(n+h*r)+" "}}return a+='"/>',a+="</svg>",{svg:`data:image/svg+xml;base64,${window.btoa(a)}`,width:Math.ceil(s),height:Math.ceil(l)}}pdf(e){e||(e={});const[t,n,i,r]=this.resolveScale(e),s=tn(this._tree.bbox.w*i+t*2),l=tn(this._tree.bbox.h*r+n*2);let a=`%PDF-1.1
18
+ %%¥±ë
19
+ 1 0 obj
20
+ << /Type /Catalog
21
+ /Pages 2 0 R
22
+ >>endobj
23
+ 2 0 obj
24
+ << /Type /Pages
25
+ /Kids [3 0 R]
26
+ /Count 1
27
+ /MediaBox [0 0 ${s} ${l}]
28
+ >>
29
+ endobj
30
+ 3 0 obj
31
+ << /Type /Page
32
+ /Parent 2 0 R
33
+ /Resources
34
+ << /Font
35
+ << /F1
36
+ << /Type /Font
37
+ /Subtype /Type1
38
+ /BaseFont /Times-Roman
39
+ >>
40
+ >>
41
+ >>
42
+ /Contents [`,c="",d=4;for(let u=0;u<this._polylines.length;u++){c+=`${d} 0 obj
43
+ << /Length 0 >>
44
+ stream
45
+ 1 j 1 J ${e.STROKE_W??1} w
46
+ `;for(let h=0;h<this._polylines[u].length;h++){const[R,g]=this._polylines[u][h];c+=`${tn(t+R*i)} ${tn(l-(n+g*r))} ${h?"l":"m"} `}c+=`
47
+ S
48
+ endstream
49
+ endobj
50
+ `,a+=`${d} 0 R `,d++}return a+=`]
51
+ >>
52
+ endobj
53
+ `,c+=`
54
+ trailer
55
+ << /Root 1 0 R
56
+ /Size 0
57
+ >>startxref
58
+
59
+ %%EOF
60
+ `,a+c}boxes(e){e||(e={});const[t,n,i,r]=this.resolveScale(e),s=[];for(let l=0;l<this._tree.chld.length;l++){const{x:a,y:c,w:d,h:u}=this._tree.chld[l].bbox;s.push({x:t+a*i,y:n+c*r,w:d*i,h:u*r})}return s}box(e){e||(e={});const[t,n,i,r]=this.resolveScale(e);return{x:t+this._tree.bbox.x*i,y:n+this._tree.bbox.y*r,w:this._tree.bbox.w*i,h:this._tree.bbox.h*r}}}class Sl extends Il{static convertLaTextToSVG(e){return new Zc(e).svg({SCALE_X:10,SCALE_Y:10,MARGIN_X:0,MARGIN_Y:0})}render(e,t,n,i){const{scale:r}=this.options,s=t.width*r,l=t.height*r;if(this.imageCache.has(t.value)){const a=this.imageCache.get(t.value);e.drawImage(a,n,i,s,l)}else{const a=new Promise((c,d)=>{const u=new Image;u.src=t.laTexSVG,u.onload=()=>{e.drawImage(u,n,i,s,l),this.imageCache.set(t.value,u),c(t)},u.onerror=h=>{d(h)}});this.addImageObserver(a)}}}var kt=(o=>(o.UL="ul",o.OL="ol",o))(kt||{}),Jn=(o=>(o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.CHECKBOX="checkbox",o))(Jn||{}),Nt=(o=>(o.DISC="disc",o.CIRCLE="circle",o.SQUARE="square",o.DECIMAL="decimal",o.CHECKBOX="checkbox",o))(Nt||{});const Qc={inheritStyle:!1},ls={[Jn.DISC]:"•",[Jn.CIRCLE]:"◦",[Jn.SQUARE]:"▫︎",[Jn.CHECKBOX]:"☑️"},Kc={[kt.OL]:"ol",[kt.UL]:"ul"},Hc={[Nt.DISC]:"disc",[Nt.CIRCLE]:"circle",[Nt.SQUARE]:"square",[Nt.DECIMAL]:"decimal",[Nt.CHECKBOX]:"checkbox"};var tt=(o=>(o.FIRST="first",o.SECOND="second",o.THIRD="third",o.FOURTH="fourth",o.FIFTH="fifth",o.SIXTH="sixth",o))(tt||{});const _c={defaultFirstSize:26,defaultSecondSize:24,defaultThirdSize:22,defaultFourthSize:20,defaultFifthSize:18,defaultSixthSize:16},Ml={[tt.FIRST]:"defaultFirstSize",[tt.SECOND]:"defaultSecondSize",[tt.THIRD]:"defaultThirdSize",[tt.FOURTH]:"defaultFourthSize",[tt.FIFTH]:"defaultFifthSize",[tt.SIXTH]:"defaultSixthSize"},as={[tt.FIRST]:1,[tt.SECOND]:2,[tt.THIRD]:3,[tt.FOURTH]:4,[tt.FIFTH]:5,[tt.SIXTH]:6},Ac={H1:tt.FIRST,H2:tt.SECOND,H3:tt.THIRD,H4:tt.FOURTH,H5:tt.FIFTH,H6:tt.SIXTH};var Fn=(o=>(o.IFRAME="iframe",o.VIDEO="video",o))(Fn||{}),Y=(o=>(o.TEXT="text",o.SELECT="select",o.CHECKBOX="checkbox",o.RADIO="radio",o.DATE="date",o.NUMBER="number",o.TEXTFIELD="TextField",o.BUTTON="button",o.MENSTRUAL_HISTORY="menstrualHistory",o))(Y||{}),p=(o=>(o.PREFIX="prefix",o.POSTFIX="postfix",o.PRE_TEXT="preText",o.PRETEXTFIX="preTextFix",o.PRETEXTFIX_TEXT="preTextFixText",o.POSTTEXTFIX="postTextFix",o.POSTTEXTFIX_TEXT="postTextFixText",o.POST_TEXT="postText",o.PLACEHOLDER="placeholder",o.TEXTFIXLABEL="textFixLabel",o.VALUE="value",o.DELETEPERSON="deletePerson",o.CHECKBOX="checkbox",o.RADIO="radio",o.UNDERLINE="underline",o))(p||{}),Xl=(o=>(o.ROW_START="rowStart",o.VALUE_START="valueStart",o))(Xl||{}),ai=(o=>(o.ACTIVE="active",o.INACTIVE="inactive",o))(ai||{}),gt=(o=>(o.COMPONENT="component",o.MENU="menu",o.MAIN="main",o.FOOTER="footer",o.CONTEXTMENU="contextmenu",o.POPUP="popup",o.CATALOG="catalog",o.COMMENT="comment",o))(gt||{}),Rn=(o=>(o.PAGE="page",o.TABLE="table",o))(Rn||{}),B=(o=>(o.EDIT="edit",o.CLEAN="clean",o.READONLY="readonly",o.FORM="form",o.PRINT="print",o.DESIGN="design",o.GRAFFITI="graffiti",o))(B||{}),De=(o=>(o.HEADER="header",o.MAIN="main",o.FOOTER="footer",o))(De||{}),wn=(o=>(o.PAGING="paging",o.CONTINUITY="continuity",o))(wn||{}),pn=(o=>(o.VERTICAL="vertical",o.HORIZONTAL="horizontal",o))(pn||{}),Ns=(o=>(o.BREAK_ALL="break-all",o.BREAK_WORD="break-word",o))(Ns||{}),Fs=(o=>(o.SPEED="speed",o.COMPATIBILITY="compatibility",o))(Fs||{}),vt=(o=>(o.ALL="all",o.EMPTY="empty",o.EXTERNAL="external",o.INTERNAL="internal",o.DASH="dash",o))(vt||{}),Yt=(o=>(o.TOP="top",o.RIGHT="right",o.BOTTOM="bottom",o.LEFT="left",o))(Yt||{}),Fo=(o=>(o.FORWARD="forward",o.BACK="back",o))(Fo||{}),Cs=(o=>(o.CONTAIN="contain",o.COVER="cover",o))(Cs||{}),Dn=(o=>(o.REPEAT="repeat",o.NO_REPEAT="no-repeat",o.REPEAT_X="repeat-x",o.REPEAT_Y="repeat-y",o))(Dn||{});const kc={color:"#FFFFFF",image:"",size:Cs.COVER,repeat:Dn.NO_REPEAT,applyPageNumbers:[]};var Tt=(o=>(o.TOP="top",o.MIDDLE="middle",o.BOTTOM="bottom",o))(Tt||{});const Gc={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#ffffff",verticalAlign:Tt.BOTTOM},Jc={placeholderColor:"#9c9b9b",bracketColor:"#2284FE",textFixColor:"blue",prefix:"[",postfix:"]",preTextFix:"{",postTextFix:"}",textFixLabel:"",preTextFixText:"",postTextFixText:"",borderWidth:1,borderColor:"#000000",activeBackgroundColor:"",disabledBackgroundColor:"",existValueBackgroundColor:"",noValueBackgroundColor:""},Bc={bottom:30,inactiveAlpha:1,maxHeightRadio:$n.HALF,disabled:!1,editable:!0},zc={opacity:.1,backgroundColor:"#E99D00",activeOpacity:.5,activeBackgroundColor:"#E99D00",disabled:!1,deletable:!0},$c={top:30,inactiveAlpha:1,maxHeightRadio:$n.HALF,disabled:!1,editable:!0},qc={defaultColor:"#1976d2",defaultBackgroundColor:"#e3f2fd",defaultBorderRadius:4,defaultPadding:[4,4,4,4]},jc={color:"#666666",font:"Microsoft YaHei",size:12,top:5},ed={disabled:!0,color:"#CCCCCC",lineWidth:1.5},td={font:"Microsoft YaHei",fontSize:12,lineDash:[3,1]},Co={PAGE_NO:"{pageNo}",PAGE_COUNT:"{pageCount}"},nd={bottom:60,size:12,font:"Microsoft YaHei",color:"#000000",rowFlex:Qe.CENTER,format:Co.PAGE_NO,numberType:fi.ARABIC,disabled:!1,startPageNo:1,fromPageNo:0,maxPageNo:null},El={data:"",color:"#DCDFE6",opacity:1,size:16,font:"Microsoft YaHei"},od={width:14,height:14,gap:5,lineWidth:1,fillStyle:"#5175f4",strokeStyle:"#000000",verticalAlign:Tt.BOTTOM},id={lineWidth:1,strokeStyle:"#000000"},sd={tdPadding:[5,5,5,5],defaultTrMinHeight:24,defaultColMinWidth:40,defaultBorderColor:"#000000",overflow:!0};var Ti=(o=>(o.TEXT="text",o.IMAGE="image",o))(Ti||{});const cs={data:"",type:Ti.TEXT,width:0,height:0,color:"#AEB5C0",opacity:.3,size:200,font:"Microsoft YaHei",repeat:!1,gap:[10,10],numberType:fi.ARABIC},rd={tipDisabled:!0};var bs=(o=>(o.PAGE="page",o.CONTINUITY="continuity",o))(bs||{});const ld={size:12,font:"Microsoft YaHei",color:"#000000",disabled:!0,right:20,type:bs.CONTINUITY},ad={color:"#000000",lineWidth:1,padding:[0,5,0,5],disabled:!0},cd={top:0,left:5},dd={defaultLineColor:"#000000",defaultLineWidth:2},ud={disabled:!0,color:"#CCCCCC",radius:1};function ys(o={}){const e={...sd,...o.table},t={...$c,...o.header},n={...Bc,...o.footer},i={...nd,...o.pageNumber},r={...cs,...o.watermark},s={...Jc,...o.control},l={...Gc,...o.checkbox},a={...od,...o.radio},c={...Pc,...o.cursor},d={..._c,...o.title},u={...El,...o.placeholder},h={...zc,...o.group},R={...td,...o.pageBreak},g={...rd,...o.zone},m={...kc,...o.background},f={...ed,...o.lineBreak},T={...ud,...o.whiteSpace},I={...id,...o.separator},L={...ld,...o.lineNumber},S={...ad,...o.pageBorder},M={...cd,...o.badge},X={...dd,...o.graffiti},x={...qc,...o.label},F={...jc,...o.imgCaption},D={...Qc,...o.list},V={print:{...Hi.print,...o.modeRule?.print},readonly:{...Hi.readonly,...o.modeRule?.readonly},form:{...Hi.form,...o.modeRule?.form}};return{mode:B.EDIT,locale:"zhCN",defaultType:"TEXT",defaultColor:"#000000",defaultFont:"SimSun",defaultSize:16,minSize:5,maxSize:72,defaultRowMargin:1,defaultBasicRowMarginHeight:8,defaultTabWidth:32,width:794,height:1123,scale:1,pageGap:20,underlineColor:"#000000",strikeoutColor:"#FF0000",rangeAlpha:.6,rangeColor:"#AECBFA",rangeMinWidth:5,searchMatchAlpha:.6,searchMatchColor:"#FFFF00",searchNavigateMatchColor:"#AAD280",highlightAlpha:.6,highlightMarginHeight:8,resizerColor:"#4182D9",resizerSize:5,marginIndicatorSize:35,marginIndicatorColor:"#BABABA",margins:[75.591,56.693,56.693,56.693],pageMode:wn.PAGING,renderMode:Fs.SPEED,defaultHyperlinkColor:"#0000FF",paperDirection:pn.VERTICAL,inactiveAlpha:.6,historyMaxRecordCount:100,wordBreak:Ns.BREAK_WORD,printPixelRatio:3,maskMargin:[0,0,0,0],letterClass:[br.ENGLISH,br.NUMBER],contextMenuDisableKeys:[],shortcutDisableKeys:[],scrollContainerSelector:"",pageOuterSelectionDisable:!1,...o,table:e,header:t,footer:n,pageNumber:i,watermark:r,control:s,checkbox:l,radio:a,cursor:c,title:d,placeholder:u,group:h,pageBreak:R,zone:g,background:m,lineBreak:f,whiteSpace:T,separator:I,lineNumber:L,pageBorder:S,badge:M,modeRule:V,graffiti:X,label:x,imgCaption:F,list:D}}const Nl=new Map;function hd(o){return Nl.get(o)}function Go(o,e){Nl.set(o,e)}function ds(o){const e=[];for(let t=0;t<o.length;t++){const n=o[t],i=be(n.value);for(let r=0;r<i.length;r++)e.push({...n,value:i[r]})}return e}function ct(o,e){const{isHandleFirstElement:t=!0,isForceCompensation:n=!1,editorOptions:i}=e,r=o[0];(n||t&&r?.type!==O.LIST&&(r?.type&&r.type!==O.TEXT||!Ms.test(r?.value)))&&o.unshift({value:ee});let s=0;for(;s<o.length;){let l=o[s];if(l.type===O.TITLE){o.splice(s,1);const a=l.valueList||[];if(ct(a,{...e,isHandleFirstElement:!1,isForceCompensation:!1}),a.length){const c=l.titleId||Ee(),d=i.title;for(let u=0;u<a.length;u++){const h=a[u];h.title=l.title,l.level&&(h.titleId=c,h.level=l.level),ci(h)&&(h.size||(h.size=d[Ml[h.level]]),h.bold===void 0&&(h.bold=!0)),o.splice(s,0,h),s++}}s--}else if(l.type===O.LIST){o.splice(s,1);const a=l.valueList||[];if(ct(a,{...e,isHandleFirstElement:!0,isForceCompensation:!1}),a.length){const c=Ee();for(let d=0;d<a.length;d++){const u=a[d];u.listId=c,u.listType=l.listType,u.listStyle=l.listStyle,o.splice(s,0,u),s++}}s--}else if(l.type===O.AREA){o.splice(s,1);const a=l?.valueList||[];if(ct(a,{...e,isHandleFirstElement:!0,isForceCompensation:!0}),a.length){const c=Ee();for(let d=0;d<a.length;d++){const u=a[d];if(u.areaId=l.areaId||c,u.area=l.area,u.areaIndex=d,u.type===O.TABLE){const h=u.trList;for(let R=0;R<h.length;R++){const g=h[R];for(let m=0;m<g.tdList.length;m++){const T=g.tdList[m].value;for(let I=0;I<T.length;I++){const L=T[I];L.areaId=l.areaId||c,L.area=l.area}}}}o.splice(s,0,u),s++}}s--}else if(l.type===O.TABLE){const a=l.id||Ee();if(l.id=a,l.trList){const{defaultTrMinHeight:c}=i.table;for(let d=0;d<l.trList.length;d++){const u=l.trList[d],h=u.id||Ee();u.id=h,(!u.minHeight||u.minHeight<c)&&(u.minHeight=c),u.height<u.minHeight&&(u.height=u.minHeight);for(let R=0;R<u.tdList.length;R++){const g=u.tdList[R],m=g.id||Ee();g.id=m,ct(g.value,{...e,isHandleFirstElement:!0,isForceCompensation:!0}),!g.value[0].size&&g.value[1]?.size&&ci(g.value[1])&&(g.value[0].size=g.value[1].size);for(let f=0;f<g.value.length;f++){const T=g.value[f];T.tdId=m,T.trId=h,T.tableId=a}}}}}else if(l.type===O.HYPERLINK){o.splice(s,1);const a=ds(l.valueList||[]);if(a.length){const c=Ee();for(let d=0;d<a.length;d++){const u=a[d];u.type=l.type,u.url=l.url,u.hyperlinkId=c,o.splice(s,0,u),s++}}s--}else if(l.type===O.DATE){o.splice(s,1);const a=ds(l.valueList||[]);if(a.length){const c=Ee();for(let d=0;d<a.length;d++){const u=a[d];u.type=l.type,u.dateFormat=l.dateFormat,u.dateId=c,o.splice(s,0,u),s++}}s--}else if(l.type===O.CONTROL){if(!l.control){s++;continue}if(l.control.type=="TextField"){const{preTextFix:a,postTextFix:c,preTextFixText:d,postTextFixText:u,value:h,placeholder:R,code:g,type:m,valueSets:f}=l.control,T=m,{editorOptions:{control:I,checkbox:L,radio:S}}=e,M=l.controlId||Ee();o.splice(s,1);const X=at(l,[...is,...Vt]),x=at(l.control,Ft),F={...x,color:i.control.textFixColor,fontWeight:"blod"},D={...x,color:void 0},V=be(a||I.preTextFix);for(let v=0;v<V.length;v++){const b=V[v];o.splice(s,0,{...X,...F,controlId:M,value:b,type:l.type,control:l.control,controlComponent:p.PRETEXTFIX}),s++}if(d){const v=be(d);for(let b=0;b<v.length;b++){const P=v[b];o.splice(s,0,{...X,...x,controlId:M,value:P,type:l.type,control:l.control,controlComponent:p.PRETEXTFIX_TEXT}),s++}}if(h&&h.length||T===Y.CHECKBOX||T===Y.RADIO||T===Y.SELECT&&g&&(!h||!h.length)){let v=h?xe(h):[];if(T===Y.CHECKBOX){const b=g?g.split(","):[];if(Array.isArray(f)&&f.length){const P=v.reduce((N,U)=>N.concat(U.value.split("").map(w=>({...U,value:w}))),[]);let y=0;for(let N=0;N<f.length;N++){const U=f[N];o.splice(s,0,{...X,...x,controlId:M,value:"",type:l.type,control:l.control,controlComponent:p.CHECKBOX,checkbox:{code:U.code,value:b.includes(U.code)}}),s++;const w=be(U.value);for(let Q=0;Q<w.length;Q++){const K=w[Q],z=Q===w.length-1;o.splice(s,0,{...X,...D,...P[y],controlId:M,value:K===`
61
+ `?ee:K,letterSpacing:z?L.gap:0,control:l.control,controlComponent:p.VALUE}),y++,s++}}}}else if(T===Y.RADIO){if(Array.isArray(f)&&f.length){const b=v.reduce((y,N)=>y.concat(N.value.split("").map(U=>({...N,value:U}))),[]);let P=0;for(let y=0;y<f.length;y++){const N=f[y];o.splice(s,0,{...X,...x,controlId:M,value:"",type:l.type,control:l.control,controlComponent:p.RADIO,radio:{code:N.code,value:g===N.code}}),s++;const U=be(N.value);for(let w=0;w<U.length;w++){const Q=U[w],K=w===U.length-1;o.splice(s,0,{...X,...D,...b[P],controlId:M,value:Q===`
62
+ `?ee:Q,letterSpacing:K?S.gap:0,control:l.control,controlComponent:p.VALUE}),P++,s++}}}}else{if((!h||!h.length)&&Array.isArray(f)&&f.length){const b=g?g.split(",").map(P=>P.trim()).filter(P=>P):[];if(b.length>1){const P=[];for(const y of b){const N=f.find(U=>U.code===y);N&&P.push({value:N.value})}P.length>0&&(v=P)}else if(b.length===1){const P=f.find(y=>y.code===b[0]);P&&(v=[{value:P.value}])}}for(let b=0;b<v.length;b++){const P=v[b];if(P.type===O.CONTROL&&P.control){const y=P,N=y.controlId||Ee(),U=y.control?.value||[],w=y.control?.placeholder||"",Q=y.control?.type,K=Q===Y.TEXTFIELD,z=Q===Y.TEXT,$=Q===Y.CHECKBOX,le=Q===Y.RADIO,Pe=Q===Y.BUTTON,se=K?p.PRETEXTFIX:p.PREFIX,J=K?p.POSTTEXTFIX:p.POSTFIX,ie={...X,controlId:N,type:O.CONTROL,control:y.control},Xe=K?i.control.textFixColor:z?"#87d068":Pe?"transparent":i.control.bracketColor,ge=Pe?"#1677FF":void 0,pe=K?y.control?.preTextFix||I.preTextFix:y.control?.prefix||I.prefix,H=be(pe);for(let j=0;j<H.length;j++)o.splice(s,0,{...ie,color:Xe,highlight:ge,originControlId:M,value:H[j],controlComponent:se}),s++;if(Pe){const j=y.control.buttonLabel||y.control.label||"按钮",G=be(j);for(let ae=0;ae<G.length;ae++){const Ie=G[ae];o.splice(s,0,{...ie,originControlId:M,value:Ie,controlComponent:p.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if($){const j=y.control?.valueSets||[],G=y.control?.code||"",ae=G?G.split(","):[];for(let Ie=0;Ie<j.length;Ie++){const me=j[Ie];o.splice(s,0,{...ie,originControlId:M,value:"",controlComponent:p.CHECKBOX,checkbox:{code:me.code,value:ae.includes(me.code)}}),s++;const Oe=be(me.value||"");for(let Ue=0;Ue<Oe.length;Ue++){const Ye=Oe[Ue],ve=Ue===Oe.length-1;o.splice(s,0,{...ie,...D,originControlId:M,value:Ye===`
63
+ `?ee:Ye,letterSpacing:ve?L.gap:0,controlComponent:p.VALUE}),s++}}}else if(le){const j=y.control?.valueSets||[],G=y.control?.code||"";for(let ae=0;ae<j.length;ae++){const Ie=j[ae];o.splice(s,0,{...ie,originControlId:M,value:"",controlComponent:p.RADIO,radio:{code:Ie.code,value:G===Ie.code}}),s++;const me=be(Ie.value||"");for(let Oe=0;Oe<me.length;Oe++){const Ue=me[Oe],Ye=Oe===me.length-1;o.splice(s,0,{...ie,...D,originControlId:M,value:Ue===`
64
+ `?ee:Ue,letterSpacing:Ye?S.gap:0,controlComponent:p.VALUE}),s++}}}else if(U.length>0)for(let j=0;j<U.length;j++){const G=U[j];if(G.type===O.CONTROL&&G.control){const ae=G,Ie=ae.controlId||Ee(),me=ae.control?.value||[],Oe=ae.control?.type===Y.TEXTFIELD,Ue=ae.control?.type===Y.TEXT,Ye={...ie,controlId:Ie,control:ae.control},ve=Oe?i.control.textFixColor:Ue?"#87d068":i.control.bracketColor,qe=Oe?ae.control?.preTextFix||I.preTextFix:ae.control?.prefix||I.prefix,je=be(qe);for(let Ae=0;Ae<je.length;Ae++)o.splice(s,0,{...Ye,color:ve,originControlId:N,value:je[Ae],controlComponent:Oe?p.PRETEXTFIX:p.PREFIX}),s++;for(let Ae=0;Ae<me.length;Ae++){const We=me[Ae];if(We.type===O.MENSTRUAL_HISTORY||We.type===O.FETAL_HEART_POSITION||We.type===O.TOOTH_POSITION||We.type===O.MACRO||We.type===O.CUSTOM_MACRO||We.type===O.REUSABLE_ITEM||We.type===O.LIST||We.type===O.SPECIAL_SYMBOLS){const Ct=We.id||Ee();We.id||(We.id=Ct);const rt=ae.control?.value?.find(Pt=>Pt.id===Ct||Pt.type===We.type&&Pt.value===We.value);rt&&Go(Ct,rt),o.splice(s,0,{...Ye,...We,id:Ct,originControlId:N,controlComponent:p.VALUE,type:We.type})}else o.splice(s,0,{...Ye,...D,...We,originControlId:N,value:We.value===`
65
+ `?ee:We.value,controlComponent:p.VALUE});s++}if(me.length===0){const Ae=ae.control?.placeholder||"";if(Ae){const We=be(Ae);for(let lt=0;lt<We.length;lt++)o.splice(s,0,{...Ye,color:i.control.placeholderColor,originControlId:N,value:We[lt],controlComponent:p.PLACEHOLDER}),s++}}const pt=Oe?ae.control?.postTextFix||I.postTextFix:ae.control?.postfix||I.postfix,_e=be(pt);for(let Ae=0;Ae<_e.length;Ae++)o.splice(s,0,{...Ye,color:ve,originControlId:N,value:_e[Ae],controlComponent:Oe?p.POSTTEXTFIX:p.POSTFIX}),s++}else{if(G.type===O.MENSTRUAL_HISTORY||G.type===O.FETAL_HEART_POSITION||G.type===O.TOOTH_POSITION||G.type===O.MACRO||G.type===O.CUSTOM_MACRO||G.type===O.REUSABLE_ITEM||G.type===O.LIST||G.type===O.SPECIAL_SYMBOLS){const Ie=G.id||Ee();G.id||(G.id=Ie);const me=y.control?.value?.find(Oe=>Oe.id===Ie||Oe.type===G.type&&Oe.value===G.value);me&&Go(Ie,me),o.splice(s,0,{...ie,...G,id:Ie,originControlId:M,controlComponent:p.VALUE,type:G.type})}else o.splice(s,0,{...ie,...D,...G,originControlId:M,value:G.value===`
66
+ `?ee:G.value,controlComponent:p.VALUE});s++}}else if(w){const j=be(w);for(let G=0;G<j.length;G++)o.splice(s,0,{...ie,color:i.control.placeholderColor,originControlId:M,value:j[G],controlComponent:p.PLACEHOLDER}),s++}else if((Q===Y.SELECT||Q===Y.DATE||Q===Y.NUMBER)&&!y.control?.code&&w){const G=be(w);for(let ae=0;ae<G.length;ae++)o.splice(s,0,{...ie,color:i.control.placeholderColor,originControlId:M,value:G[ae],controlComponent:p.PLACEHOLDER}),s++}const te=K?y.control?.postTextFix||I.postTextFix:y.control?.postfix||I.postfix,_=be(te);for(let j=0;j<_.length;j++)o.splice(s,0,{...ie,color:Xe,highlight:ge,originControlId:M,value:_[j],controlComponent:J}),s++}else if(P.type===O.MENSTRUAL_HISTORY||P.type===O.FETAL_HEART_POSITION||P.type===O.TOOTH_POSITION||P.type===O.MACRO||P.type===O.CUSTOM_MACRO||P.type===O.REUSABLE_ITEM||P.type===O.LIST||P.type===O.SPECIAL_SYMBOLS){const y=P.id||Ee();P.id||(P.id=y);const N=h?.find(U=>U.id===y||U.type===P.type&&U.value===P.value);N&&Go(y,N),o.splice(s,0,{...X,...P,id:y,controlId:M,control:l.control,controlComponent:p.VALUE,type:P.type}),s++}else{const y=be(P.value||"");for(let N=0;N<y.length;N++){const U=y[N];o.splice(s,0,{...X,...D,...P,controlId:M,value:U===`
67
+ `?ee:U,type:P.type||O.TEXT,control:l.control,controlComponent:p.VALUE}),s++}}}}}else if(R){const v={...x,color:i.control.placeholderColor},b=be(R);for(let P=0;P<b.length;P++){const y=b[P];o.splice(s,0,{...X,...v,controlId:M,value:y===`
68
+ `?ee:y,type:l.type,control:l.control,controlComponent:p.PLACEHOLDER}),s++}}if(u){const v=be(u);for(let b=0;b<v.length;b++){const P=v[b];o.splice(s,0,{...X,...x,controlId:M,value:P,type:l.type,control:l.control,controlComponent:p.POSTTEXTFIX_TEXT}),s++}}const E=be(c||I.postTextFix);for(let v=0;v<E.length;v++){const b=E[v];o.splice(s,0,{...X,...F,controlId:M,value:b,type:l.type,control:l.control,controlComponent:p.POSTTEXTFIX}),s++}s--}else{const{prefix:a,postfix:c,preText:d,postText:u,value:h,placeholder:R,code:g,type:m,valueSets:f}=l.control,{editorOptions:{control:T,checkbox:I,radio:L}}=e,S=l.controlId||Ee();o.splice(s,1);const M=at(l,[...is,...Vt]),X=at(l.control,Ft),x={...X,color:m===Y.TEXT?"#87d068":m===Y.BUTTON?"transparent":i.control.bracketColor,highlight:m===Y.BUTTON?"#1677FF":void 0},F={...X,color:void 0},D=be(a||T.prefix);for(let E=0;E<D.length;E++){const v=D[E];o.splice(s,0,{...M,...x,controlId:S,value:v===`
69
+ `?ee:v,type:l.type,control:l.control,controlComponent:p.PREFIX}),s++}if(d){const E=be(d);for(let v=0;v<E.length;v++){const b=E[v];o.splice(s,0,{...M,...X,controlId:S,value:b,type:l.type,control:l.control,controlComponent:p.PRE_TEXT}),s++}}if(h&&h.length||m===Y.CHECKBOX||m===Y.RADIO||m===Y.BUTTON||m===Y.SELECT&&g&&(!h||!h.length)){let E=h?xe(h):[];if(m===Y.CHECKBOX){const v=g?g.split(","):[];if(Array.isArray(f)&&f.length){const b=E.reduce((y,N)=>y.concat(N.value.split("").map(U=>({...N,value:U}))),[]);let P=0;for(let y=0;y<f.length;y++){const N=f[y];o.splice(s,0,{...M,...X,controlId:S,value:"",type:l.type,control:l.control,controlComponent:p.CHECKBOX,checkbox:{code:N.code,value:v.includes(N.code)}}),s++;const U=be(N.value);for(let w=0;w<U.length;w++){const Q=U[w],K=w===U.length-1;o.splice(s,0,{...M,...F,...b[P],controlId:S,value:Q===`
70
+ `?ee:Q,letterSpacing:K?I.gap:0,control:l.control,controlComponent:p.VALUE}),P++,s++}}}}else if(m===Y.RADIO){if(Array.isArray(f)&&f.length){const v=E.reduce((P,y)=>P.concat(y.value.split("").map(N=>({...y,value:N}))),[]);let b=0;for(let P=0;P<f.length;P++){const y=f[P];o.splice(s,0,{...M,...X,controlId:S,value:"",type:l.type,control:l.control,controlComponent:p.RADIO,radio:{code:y.code,value:g===y.code}}),s++;const N=be(y.value);for(let U=0;U<N.length;U++){const w=N[U],Q=U===N.length-1;o.splice(s,0,{...M,...F,...v[b],controlId:S,value:w===`
71
+ `?ee:w,letterSpacing:Q?L.gap:0,control:l.control,controlComponent:p.VALUE}),b++,s++}}}}else{if(m===Y.BUTTON){const v=l.control.buttonLabel||l.control.label||"按钮",b=be(v);for(let P=0;P<b.length;P++){const y=b[P];o.splice(s,0,{...M,...X,controlId:S,value:y,type:O.CONTROL,control:l.control,controlComponent:p.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if((!h||!h.length)&&Array.isArray(f)&&f.length){const v=g?g.split(","):[];if(v.length>1){const b=[];for(const P of v){const y=f.find(N=>N.code===P.trim());y&&b.push({value:y.value})}b.length>0&&(E=b)}else{const b=f.find(P=>P.code===g);b&&(E=[{value:b.value}])}}if(m!==Y.BUTTON)for(let v=0;v<E.length;v++){const b=E[v];if(b.type===O.CONTROL&&b.control){const P=b,y=P.controlId||Ee(),N=P.control?.value||[],U=P.control?.placeholder||"",w=P.control?.type,Q=w===Y.TEXTFIELD,K=w===Y.TEXT,z=w===Y.CHECKBOX,$=w===Y.RADIO,le=w===Y.BUTTON,Pe=Q?p.PRETEXTFIX:p.PREFIX,se=Q?p.POSTTEXTFIX:p.POSTFIX,J={...M,controlId:y,type:O.CONTROL,control:P.control},ie=Q?i.control.textFixColor:K?"#87d068":le?"transparent":i.control.bracketColor,Xe=le?"#1677FF":void 0,ge=Q?P.control?.preTextFix||T.preTextFix:P.control?.prefix||T.prefix,pe=be(ge);for(let _=0;_<pe.length;_++)o.splice(s,0,{...J,color:ie,highlight:Xe,originControlId:S,value:pe[_],controlComponent:Pe}),s++;if(le){const _=P.control.buttonLabel||P.control.label||"按钮",j=be(_);for(let G=0;G<j.length;G++){const ae=j[G];o.splice(s,0,{...J,originControlId:S,value:ae,controlComponent:p.VALUE,color:"#fff",highlight:"#1677FF"}),s++}}else if(z){const _=P.control?.valueSets||[],j=P.control?.code||"",G=j?j.split(","):[];for(let ae=0;ae<_.length;ae++){const Ie=_[ae];o.splice(s,0,{...J,...X,originControlId:S,value:"",controlComponent:p.CHECKBOX,checkbox:{code:Ie.code,value:G.includes(Ie.code)}}),s++;const me=be(Ie.value||"");for(let Oe=0;Oe<me.length;Oe++){const Ue=me[Oe],Ye=Oe===me.length-1;o.splice(s,0,{...J,...F,originControlId:S,value:Ue===`
72
+ `?ee:Ue,letterSpacing:Ye?I.gap:0,controlComponent:p.VALUE}),s++}}}else if($){const _=P.control?.valueSets||[],j=P.control?.code||"";for(let G=0;G<_.length;G++){const ae=_[G];o.splice(s,0,{...J,...X,originControlId:S,value:"",controlComponent:p.RADIO,radio:{code:ae.code,value:j===ae.code}}),s++;const Ie=be(ae.value||"");for(let me=0;me<Ie.length;me++){const Oe=Ie[me],Ue=me===Ie.length-1;o.splice(s,0,{...J,...F,originControlId:S,value:Oe===`
73
+ `?ee:Oe,letterSpacing:Ue?L.gap:0,controlComponent:p.VALUE}),s++}}}else if(N.length>0)for(let _=0;_<N.length;_++){const j=N[_];if(j.type===O.CONTROL&&j.control){const G=j,ae=G.controlId||Ee(),Ie=G.control?.value||[],me=G.control?.type===Y.TEXTFIELD,Oe=G.control?.type===Y.TEXT,Ue={...J,controlId:ae,control:G.control},Ye=me?i.control.textFixColor:Oe?"#87d068":i.control.bracketColor,ve=me?G.control?.preTextFix||T.preTextFix:G.control?.prefix||T.prefix,qe=be(ve);for(let _e=0;_e<qe.length;_e++)o.splice(s,0,{...Ue,color:Ye,originControlId:y,value:qe[_e],controlComponent:me?p.PRETEXTFIX:p.PREFIX}),s++;for(let _e=0;_e<Ie.length;_e++){const Ae=Ie[_e];o.splice(s,0,{...Ue,...F,...Ae,originControlId:y,value:Ae.value===`
74
+ `?ee:Ae.value,controlComponent:p.VALUE}),s++}if(Ie.length===0){const _e=G.control?.placeholder||"";if(_e){const Ae=be(_e);for(let We=0;We<Ae.length;We++)o.splice(s,0,{...Ue,color:i.control.placeholderColor,originControlId:y,value:Ae[We],controlComponent:p.PLACEHOLDER}),s++}}const je=me?G.control?.postTextFix||T.postTextFix:G.control?.postfix||T.postfix,pt=be(je);for(let _e=0;_e<pt.length;_e++)o.splice(s,0,{...Ue,color:Ye,originControlId:y,value:pt[_e],controlComponent:me?p.POSTTEXTFIX:p.POSTFIX}),s++}else o.splice(s,0,{...J,...F,...j,originControlId:S,value:j.value===`
75
+ `?ee:j.value,controlComponent:p.VALUE}),s++}else if(U){const _=be(U);for(let j=0;j<_.length;j++)o.splice(s,0,{...J,color:i.control.placeholderColor,originControlId:S,value:_[j],controlComponent:p.PLACEHOLDER}),s++}else if((w===Y.SELECT||w===Y.DATE||w===Y.NUMBER)&&!P.control?.code&&U){const j=be(U);for(let G=0;G<j.length;G++)o.splice(s,0,{...J,color:i.control.placeholderColor,originControlId:S,value:j[G],controlComponent:p.PLACEHOLDER}),s++}const H=Q?P.control?.postTextFix||T.postTextFix:P.control?.postfix||T.postfix,te=be(H);for(let _=0;_<te.length;_++)o.splice(s,0,{...J,color:ie,highlight:Xe,originControlId:S,value:te[_],controlComponent:se}),s++}else if(b.type===O.MENSTRUAL_HISTORY||b.type===O.FETAL_HEART_POSITION||b.type===O.TOOTH_POSITION||b.type===O.MACRO||b.type===O.CUSTOM_MACRO||b.type===O.REUSABLE_ITEM||b.type===O.LIST||b.type===O.SPECIAL_SYMBOLS){const P=b.id||Ee();b.id||(b.id=P);const y=l.control?.value;if(y){const N=y.find(U=>U.id===P||U.type===b.type&&U.value===b.value);N&&Go(P,N)}o.splice(s,0,{...M,...b,id:P,controlId:S,control:l.control,controlComponent:p.VALUE,type:b.type}),s++}else{const P=be(b.value||"");for(let y=0;y<P.length;y++){const N=P[y];o.splice(s,0,{...M,...F,...b,controlId:S,value:N===`
76
+ `?ee:N,type:b.type||O.TEXT,control:l.control,controlComponent:p.VALUE}),s++}}}}}else if(R){const E={...X,color:i.control.placeholderColor},v=be(R);for(let b=0;b<v.length;b++){const P=v[b];o.splice(s,0,{...M,...E,controlId:S,value:P===`
77
+ `?ee:P,type:l.type,control:l.control,controlComponent:p.PLACEHOLDER}),s++}}if(u){const E=be(u);for(let v=0;v<E.length;v++){const b=E[v];o.splice(s,0,{...M,...X,controlId:S,value:b,type:l.type,control:l.control,controlComponent:p.POST_TEXT}),s++}}const V=be(c||T.postfix);for(let E=0;E<V.length;E++){const v=V[E];o.splice(s,0,{...M,...x,controlId:S,value:v===`
78
+ `?ee:v,type:l.type,control:l.control,controlComponent:p.POSTFIX}),s++}s--}}else if((!l.type||wt.includes(l.type))&&l.type!==O.SPECIAL_SYMBOLS&&l.value?.length>1){o.splice(s,1);const a=be(l.value);for(let c=0;c<a.length;c++)o.splice(s+c,0,{...l,value:a[c]});l=o[s]}if((l.value===`
79
+ `||l.value==`\r
80
+ `)&&(l.value=ee),(l.type===O.IMAGE||l.type===O.BLOCK)&&(l.id=l.id||Ee()),l.type===O.LATEX){const{svg:a,width:c,height:d}=Sl.convertLaTextToSVG(l.value);l.width=l.width||c,l.height=l.height||d,l.laTexSVG=a,l.id=l.id||Ee()}(l.type===O.MACRO||l.type===O.CUSTOM_MACRO||l.type===O.REUSABLE_ITEM)&&(l.id=l.id||Ee()),(l.type===O.MENSTRUAL_HISTORY||l.type===O.TOOTH_POSITION||l.type===O.FETAL_HEART_POSITION||l.type===O.SPECIAL_SYMBOLS)&&(l.id=l.id||Ee()),s++}}function Rd(o,e){const t=Object.keys(o),n=Object.keys(e);if(t.length!==n.length)return!1;for(let i=0;i<t.length;i++){const r=t[i];if(r!=="value"&&!(r==="groupIds"&&Array.isArray(o[r])&&Array.isArray(e[r])&&ml(o[r],e[r]))&&o[r]!==e[r])return!1}return!0}function Sn(o,e={}){const{extraPickAttrs:t}=e,n=[...Ec];t&&n.push(...t);const i={value:o?.value===ee?`
81
+ `:o?.value};return o&&n.forEach(r=>{const s=o[r];s!==void 0&&(i[r]=s)}),i}function Ge(o,e={}){const{extraPickAttrs:t,isClassifyArea:n=!1,isClone:i=!0,editorOptions:r}=e,s=(i?xe(o):o).filter(c=>c.type!==O.SPLIT_TAG),l=[];let a=0;for(;a<s.length;){let c=s[a];if(a===0&&c.value===ee&&!c.listId&&(!c.type||c.type===O.TEXT)){a++;continue}if(c.areaId){const u=c.areaId,h=c.area,R=[];for(;a<s.length;){const m=s[a];if(u!==m.areaId){a--;break}delete m.area,delete m.areaId,R.push(m),a++}const g=Ge(R,e);if(n){const m={type:O.AREA,value:"",areaId:u,area:h};m.valueList=g,c=m}else{l.splice(a,0,...g);continue}}else if(c.titleId&&c.level){const u=c.titleId;if(u){const h=c.level,R={type:O.TITLE,title:c.title,titleId:u,value:"",level:h},g=[];for(;a<s.length;){const m=s[a];if(u!==m.titleId){a--;break}delete m.level,delete m.title,g.push(m),a++}R.valueList=Ge(g,e),c=R}}else if(c.listId&&c.listType){const u=c.listId;if(u){const h=c.listType,R=c.listStyle,g=c?.label,m={type:O.LIST,value:"",label:g||"",listId:u,listType:h,listStyle:R},f=[];for(;a<s.length;){const T=s[a];if(u!==T.listId){a--;break}delete T.listType,delete T.listStyle,f.push(T),a++}m.valueList=Ge(f,e),c=m}}else if(c.type===O.TABLE){if(c.pagingId){let u=a+1,h=0;for(;u<s.length;){const R=s[u];if(R.pagingId===c.pagingId){c.height+=R.height;const g=R.trList.filter(m=>!m.pagingRepeat).filter(m=>(m.tdList=m.tdList.filter(f=>{if(f.originalId){for(let T=0;T<c.trList.length;T++){const L=c.trList[T].tdList.find(({id:S})=>S===f.originalId);if(L){f.value[0]?.type===O.SPLIT_TAG&&f.value.splice(0,1),L.value.push(...f.value),L.rowspan=L.originalRowspan??L.rowspan;break}}return!1}return!0}),!m.originalId));c.trList.push(...g),c.trList?.forEach(m=>m.minHeight=m.originalMinHeight??m.minHeight),u++,h++}else break}a+=h}if(c.trList)for(let u=0;u<c.trList.length;u++){const h=c.trList[u];delete h.id;for(let R=0;R<h.tdList.length;R++){const g=h.tdList[R],m={colspan:g.colspan,rowspan:g.rowspan,value:Ge(g.value,{...e,isClassifyArea:!1})};Nc.forEach(f=>{const T=g[f];T!==void 0&&(m[f]=T)}),h.tdList[R]=m}}}else if(c.type===O.HYPERLINK){const u=c.hyperlinkId;if(u){const h={type:O.HYPERLINK,value:"",url:c.url},R=[];for(;a<s.length;){const g=s[a];if(u!==g.hyperlinkId){a--;break}delete g.type,delete g.url,R.push(g),a++}h.valueList=Ge(R,e),c=h}}else if(c.type===O.DATE){const u=c.dateId;if(u){const h={type:O.DATE,value:"",dateFormat:c.dateFormat},R=[];for(;a<s.length;){const g=s[a];if(u!==g.dateId){a--;break}delete g.type,delete g.dateFormat,R.push(g),a++}h.valueList=Ge(R,e),c=h}}else if(c.type!==O.BUTTON){if(c.controlId){const u=c.controlId;if(!(c.controlComponent===p.PREFIX||c.controlComponent===p.PRETEXTFIX||c.controlComponent===p.PRETEXTFIX_TEXT)&&c.controlComponent===p.VALUE){if(c.type===O.MENSTRUAL_HISTORY||c.type===O.FETAL_HEART_POSITION||c.type===O.TOOTH_POSITION||c.type===O.MACRO||c.type===O.CUSTOM_MACRO||c.type===O.REUSABLE_ITEM||c.type===O.LIST||c.type===O.SPECIAL_SYMBOLS){let f=!1;for(let T=a-1;T>=0;T--){const I=s[T],L=I.controlComponent===p.PREFIX||I.controlComponent===p.PRETEXTFIX||I.controlComponent===p.PRETEXTFIX_TEXT;if(I.controlId===u&&L){f=!0;break}if(I.controlId!==u)break}if(!f){const T=xe(c);delete T.controlId,delete T.control,delete T.controlComponent,delete T.originControlId,l.push(T),a++;continue}}a++;continue}if(c.controlComponent===p.PLACEHOLDER||c.controlComponent===p.POSTFIX||c.controlComponent===p.POSTTEXTFIX||c.controlComponent===p.POSTTEXTFIX_TEXT||c.controlComponent===p.POST_TEXT||c.controlComponent===p.PRE_TEXT||c.controlComponent===p.CHECKBOX||c.controlComponent===p.RADIO){a++;continue}const R=(m,f,T,I)=>{if(I===Y.CHECKBOX||I===Y.RADIO){let S=-1;for(let M=m;M<s.length&&s[M].controlId===f;M++)S=M;return S}const L=T?[p.POSTTEXTFIX,p.POSTTEXTFIX_TEXT]:[p.POSTFIX];for(let S=m;S<s.length;S++){const M=s[S];if(M.controlId===f&&L.includes(M.controlComponent))return S}return-1},g=(m,f,T)=>{const I=[];let L=m;for(;L<=f;){const S=s[L];if(S.controlId&&S.controlId!==T&&S.control){const D=S.control?.type,V=D===Y.TEXTFIELD,E=V?p.PRETEXTFIX:p.PREFIX,v=S.controlComponent===E,b=D===Y.CHECKBOX||D===Y.RADIO;if(v||b&&(S.controlComponent===p.CHECKBOX||S.controlComponent===p.RADIO)){const P=R(L+1,S.controlId,V,D);if(P!==-1){const y=s.slice(L,P+1).map(U=>{const w=xe(U);return delete w.originControlId,w}),N=Ge(y,e);N.length>0&&I.push(N[0]),L=P+1;continue}}}if(!(S.controlId===T&&(S.controlComponent===p.VALUE||!S.controlComponent)&&(!S.originControlId||S.originControlId===T)||S.originControlId===T&&S.controlComponent===p.VALUE||S.controlId===T&&(S.controlComponent===p.CHECKBOX||S.controlComponent===p.RADIO)&&!S.originControlId)){L++;continue}if(S.type===O.MENSTRUAL_HISTORY||S.type===O.FETAL_HEART_POSITION||S.type===O.TOOTH_POSITION||S.type===O.MACRO||S.type===O.CUSTOM_MACRO||S.type===O.REUSABLE_ITEM||S.type===O.LIST||S.type===O.SPECIAL_SYMBOLS){const D=xe(S);delete D.controlId,delete D.control,delete D.controlComponent,delete D.originControlId,I.push(D),L++;continue}if(S.controlComponent===p.CHECKBOX||S.controlComponent===p.RADIO){I.push(xe(S)),L++;continue}const x=c.control?.type;if(x===Y.CHECKBOX||x===Y.RADIO){let D=L-1,V=!1;for(;D>=m-1;){const E=s[D];if(E.controlId===T&&!E.originControlId)if(E.controlComponent===p.CHECKBOX){V=E.checkbox?.value===!0;break}else if(E.controlComponent===p.RADIO){V=E.radio?.value===!0;break}else if(E.controlComponent===p.VALUE){D--;continue}else break;D--}if(V){const E={value:S.value||""},v=[...Vt,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const b of v){const P=S[b];if(P!==void 0){if(b==="color"&&r){const y=r.control?.bracketColor,N=r.control?.placeholderColor;if(P===y||P===N)continue}E[b]=P}}I.push(E)}}else{const D={value:S.value||""},V=[...Vt,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const E of V){const v=S[E];if(v!==void 0){if(E==="color"&&r){const b=r.control?.bracketColor,P=r.control?.placeholderColor;if(v===b||v===P)continue}D[E]=v}}I.push(D)}L++}return I};if(c.controlComponent===p.PREFIX){const m=c.control?.type===Y.TEXTFIELD,f=R(a+1,u,m);if(f!==-1){const T=g(a+1,f-1,u),I=at(c,Ft),L={...c.control,...I,value:T},S={...at(c,Vt),type:O.CONTROL,value:"",control:L,controlId:u};c=Sn(S,{extraPickAttrs:t}),a=f}}if(c.controlComponent===p.PRETEXTFIX){const m=R(a+1,u,!0);if(m!==-1){const f=g(a+1,m-1,u),T=at(c,Ft),I={...c.control,...T,value:f},L={...at(c,Vt),type:O.CONTROL,value:"",control:I,controlId:u};c=Sn(L,{extraPickAttrs:t}),a=m}}if(c.controlComponent===p.PRETEXTFIX_TEXT){const m=R(a+1,u,!0);if(m!==-1){const f=g(a+1,m-1,u),T=at(c,Ft),I={...c.control,...T,value:f},L={...at(c,Vt),type:O.CONTROL,value:"",control:I,controlId:u};c=Sn(L,{extraPickAttrs:t}),a=m}}}}const d=Sn(c,{extraPickAttrs:t});if(!c.type||c.type===O.TEXT||c.type===O.SUBSCRIPT||c.type===O.SUPERSCRIPT)for(;a<s.length;){const u=s[a+1];if(a++,u&&Rd(d,Sn(u,{extraPickAttrs:t}))){const h=u.value===ee?`
82
+ `:u.value;d.value+=h}else break}else a++;l.push(d)}return l}function Fl(o){switch(window.getComputedStyle(o).textAlign){case"left":case"start":return Qe.LEFT;case"center":return Qe.CENTER;case"right":case"end":return Qe.RIGHT;case"justify":return Qe.ALIGNMENT;case"justify-all":return Qe.JUSTIFY;default:return Qe.LEFT}}function Cl(o){return o===Qe.ALIGNMENT?"justify":o}function gd(o){switch(o){case Qe.LEFT:return"flex-start";case Qe.CENTER:return"center";case Qe.RIGHT:return"flex-end";case Qe.ALIGNMENT:case Qe.JUSTIFY:return"space-between";default:return"flex-start"}}function ci(o){return!o.type||wt.includes(o.type)}function pd(o){return!o.type||o.type===O.TEXT}function vr(o){return o.filter(e=>ci(e)).map(e=>e.value).join("").replace(new RegExp(ee,"g"),"")}function jn(o,e){const t=o[e];if(!t)return null;const n=o[e+1];return!t.listId&&t.value===ee&&n&&n.value!==ee&&t.areaId===n.areaId?n:t}function ze(o,e,t,n){let i=jn(o,t);if(!i)return;const{isBreakWhenWrap:r=!1,editorOptions:s,ignoreContextKeys:l=[]}=n||{},{mode:a}=s||{};a!==B.DESIGN&&i.title?.disabled&&(i=$t(i,Es));let c=!1;for(let d=0;d<e.length;d++){const u=e[d];if(r&&!i.listId&&Ms.test(u.value)&&(c=!0),c||!i.listId&&u.type===O.LIST){const R=[...qn,...Vt,...Yn];yr(R,l),Mn(R,i,u),u.valueList?.forEach(g=>{Mn(R,i,g)});continue}u.valueList?.length&&ze(o,u.valueList,t,n);const h=[...is];io(u)||h.push(...Vt),yr(h,l),Mn(h,i,u)}}function fd(o,e){let t="span";o.type===O.SUPERSCRIPT?t="sup":o.type===O.SUBSCRIPT&&(t="sub");const n=document.createElement(t);return n.style.fontFamily=o.font||e.defaultFont,o.rowFlex&&(n.style.textAlign=Cl(o.rowFlex)),o.color&&(n.style.color=o.color),o.bold&&(n.style.fontWeight="600"),o.italic&&(n.style.fontStyle="italic"),n.style.fontSize=`${o.size||e.defaultSize}px`,o.highlight&&(n.style.backgroundColor=o.highlight),o.underline&&(n.style.textDecoration="underline",n.style.textDecorationStyle=o.textDecoration?.style||"solid"),o.strikeout&&(n.style.textDecoration+=" line-through"),o.type&&n.setAttribute("data-type",o.type),o.rowMargin&&(n.style.lineHeight=(o.rowMargin??e.defaultRowMargin).toString()),n.innerText=o.value.replace(new RegExp(`${ee}`,"g"),`
83
+ `),n}function bl(o){let e=0;const t=new Map;for(let n=0;n<o.length;n++){const i=o[n];if(n===0){if(i.checkbox)continue;i.value=i.value.replace(Ms,"")}if(i.listWrap){const r=t.get(e)||[];r.push(i),t.set(e,r)}else{const r=i.value.split(`
84
+ `);for(let s=0;s<r.length;s++){s>0&&(e+=1);const l=r[s],a=t.get(e)||[];a.push({...i,value:l}),t.set(e,a)}}}return t}function md(o){const e=[];if(!o.length)return e;let t=o[0]?.rowFlex||null;e.push({rowFlex:t,data:[o[0]]});for(let n=1;n<o.length;n++){const i=o[n],r=i.rowFlex||null;t===r&&!io(i)&&!io(o[n-1])?e[e.length-1].data.push(i):(e.push({rowFlex:r,data:[i]}),t=r)}for(let n=0;n<e.length;n++){const i=e[n];i.data=Ge(i.data)}return e}function Xo(o,e){const t=ys(e);function n(s){const l=document.createElement("div");for(let a=0;a<s.length;a++){const c=s[a];if(c.type===O.TABLE){const d=document.createElement("table");d.setAttribute("cellSpacing","0"),d.setAttribute("cellpadding","0"),d.setAttribute("border","0");const u="1px solid #000000";!c.borderType||c.borderType===vt.ALL?(d.style.borderTop=u,d.style.borderLeft=u):c.borderType===vt.EXTERNAL&&(d.style.border=u),d.style.width=`${c.width}px`;const h=document.createElement("colgroup");for(let g=0;g<c.colgroup.length;g++){const m=c.colgroup[g],f=document.createElement("col");f.setAttribute("width",`${m.width}`),h.append(f)}d.append(h);const R=c.trList;for(let g=0;g<R.length;g++){const m=document.createElement("tr"),f=R[g];m.style.height=`${f.height}px`;for(let T=0;T<f.tdList.length;T++){const I=document.createElement("td");(!c.borderType||c.borderType===vt.ALL)&&(I.style.borderBottom=I.style.borderRight="1px solid");const L=f.tdList[T];I.colSpan=L.colspan,I.rowSpan=L.rowspan,I.style.verticalAlign=L.verticalAlign||"top",L.borderTypes?.includes(Yt.TOP)&&(I.style.borderTop=u),L.borderTypes?.includes(Yt.RIGHT)&&(I.style.borderRight=u),L.borderTypes?.includes(Yt.BOTTOM)&&(I.style.borderBottom=u),L.borderTypes?.includes(Yt.LEFT)&&(I.style.borderLeft=u);const S=Xo(L.value,e);I.innerHTML=S.innerHTML,L.backgroundColor&&(I.style.backgroundColor=L.backgroundColor),m.append(I)}d.append(m)}l.append(d)}else if(c.type===O.HYPERLINK){const d=document.createElement("a");d.innerText=c.valueList.map(u=>u.value).join(""),c.url&&(d.href=c.url),l.append(d)}else if(c.type===O.TITLE){const d=document.createElement(`h${as[c.level]}`),u=n(c.valueList);d.innerHTML=u.innerHTML,l.append(d)}else if(c.type===O.LIST){const d=document.createElement(Kc[c.listType]);c.listStyle&&(d.style.listStyleType=Hc[c.listStyle]);const u=Ge(c.valueList);bl(u).forEach(R=>{const g=document.createElement("li"),m=n(R);g.innerHTML=m.innerHTML,d.append(g)}),l.append(d)}else if(c.type===O.IMAGE){const d=document.createElement("img");c.value&&(d.src=c.value,d.width=c.width,d.height=c.height),l.append(d)}else if(c.type===O.BLOCK){if(c.block?.type===Fn.VIDEO){const d=c.block.videoBlock?.src;if(d){const u=document.createElement("video");u.style.display="block",u.controls=!0,u.src=d,u.width=c.width||e?.width||window.innerWidth,u.height=c.height,l.append(u)}}else if(c.block?.type===Fn.IFRAME){const{src:d,srcdoc:u,sandbox:h,allow:R}=c.block.iframeBlock||{};if(d||u){const g=document.createElement("iframe");g.sandbox.add(...h||oo.sandbox),g.setAttribute("allow",[R||oo.allow].join(" ")),g.style.display="block",g.style.border="none",d?g.src=d:u&&(g.srcdoc=u),g.width=`${c.width||e?.width||window.innerWidth}`,g.height=`${c.height}`,l.append(g)}}}else if(c.type===O.SEPARATOR){const d=document.createElement("hr");c.dashArray?.length&&d.setAttribute("data-dash-array",c.dashArray.join(",")),l.append(d)}else if(c.type===O.CHECKBOX){const d=document.createElement("input");d.type="checkbox",c.checkbox?.value&&d.setAttribute("checked","true"),l.append(d)}else if(c.type===O.RADIO){const d=document.createElement("input");d.type="radio",c.radio?.value&&d.setAttribute("checked","true"),l.append(d)}else if(c.type===O.TAB){const d=document.createElement("span");d.innerHTML=`${Cr}${Cr}`,l.append(d)}else if(c.type===O.CONTROL){const d=document.createElement("span"),u=n(c.control?.value||[]);d.innerHTML=u.innerHTML,l.append(d)}else if(c.type===O.PAGE_BREAK){const d=document.createElement("div");d.style.breakAfter="page",l.append(d)}else if(!c.type||c.type===O.LATEX||wt.includes(c.type)){let d="";if(c.type===O.DATE?d=c.valueList?.map(h=>h.value).join("")||"":d=c.value,!d)continue;const u=fd(c,t);s[a-1]?.type===O.TITLE&&(d=d.replace(/^\n/,"")),u.innerText=d.replace(new RegExp(`${ee}`,"g"),`
85
+ `),l.append(u)}}return l}const i=document.createElement("div"),r=md(o);for(let s=0;s<r.length;s++){const l=r[s],a=!l.rowFlex||l.rowFlex===Qe.LEFT,c=document.createElement("div");if(!a){const d=l.data[0];io(d)?(c.style.display="flex",c.style.justifyContent=gd(d.rowFlex)):(c.style.textAlign=Cl(l.rowFlex),l.rowFlex==="justify"&&(c.style.textAlignLast="justify"))}c.innerHTML=n(l.data).innerHTML,a?c.childNodes.forEach(d=>{i.append(d.cloneNode(!0))}):i.append(c)}return i}function Td(o){if(!o||o.nodeType!==3)return null;const e=o.parentNode,t=e.nodeName==="FONT"?e.parentNode:e,n=Fl(t),i=o.textContent,r=window.getComputedStyle(t);if(!i||t.nodeName==="STYLE")return null;const s={value:i,color:r.color,bold:Number(r.fontWeight)>500,italic:r.fontStyle.includes("italic"),size:Math.floor(parseFloat(r.fontSize))};return t.nodeName==="SUB"||r.verticalAlign==="sub"?s.type=O.SUBSCRIPT:(t.nodeName==="SUP"||r.verticalAlign==="super")&&(s.type=O.SUPERSCRIPT),n!==Qe.LEFT&&(s.rowFlex=n),r.backgroundColor!=="rgba(0, 0, 0, 0)"&&(s.highlight=r.backgroundColor),r.textDecorationLine.includes("underline")&&(s.underline=!0),r.textDecorationLine.includes("line-through")&&(s.strikeout=!0),s}function Eo(o,e){const t=[];function n(a){if(a.nodeType===3){const c=Td(a);c&&t.push(c)}else if(a.nodeType===1){const c=a.childNodes;for(let d=0;d<c.length;d++){const u=c[d];if(u.nodeName==="BR")t.push({value:`
86
+ `});else if(u.nodeName==="A"){const h=u,R=h.innerText;R&&t.push({type:O.HYPERLINK,value:"",valueList:[{value:R}],url:h.href})}else if(/H[1-6]/.test(u.nodeName)){const R=Eo(Ld(u,"div").outerHTML,e);t.push({value:"",type:O.TITLE,level:Ac[u.nodeName],valueList:R}),u.nextSibling&&!bc.includes(u.nextSibling.nodeName)&&t.push({value:`
87
+ `})}else if(u.nodeName==="UL"||u.nodeName==="OL"){const h=u,R={value:"",type:O.LIST,valueList:[]};u.nodeName==="OL"?R.listType=kt.OL:(R.listType=kt.UL,R.listStyle=h.style.listStyleType),h.querySelectorAll("li").forEach(g=>{const m=Eo(g.innerHTML,e);m.forEach(f=>{f.value===`
88
+ `&&(f.listWrap=!0)}),m.unshift({value:`
89
+ `}),R.valueList.push(...m)}),t.push(R)}else if(u.nodeName==="HR")t.push({value:`
90
+ `,type:O.SEPARATOR});else if(u.nodeName==="IMG"){const{src:h,width:R,height:g}=u;h&&R&&g&&t.push({width:R,height:g,value:h,type:O.IMAGE,rowFlex:Fl(u.parentElement)})}else if(u.nodeName==="VIDEO"){const{src:h,width:R,height:g}=u;h&&R&&g&&t.push({value:"",type:O.BLOCK,block:{type:Fn.VIDEO,videoBlock:{src:h}},width:R,height:g})}else if(u.nodeName==="IFRAME"){const{src:h,srcdoc:R,width:g,height:m}=u;(h||R)&&g&&m&&t.push({value:"",type:O.BLOCK,block:{type:Fn.IFRAME,iframeBlock:{src:h,srcdoc:R}},width:parseInt(g),height:parseInt(m)})}else if(u.nodeName==="TABLE"){const h=u,R={type:O.TABLE,value:`
91
+ `,colgroup:[],trList:[]},g=h.querySelectorAll("colgroup col");if(h.querySelectorAll("tr").forEach(m=>{const f=Number(window.getComputedStyle(m).height.replace("px","")),T={height:f,minHeight:f,tdList:[]};m.querySelectorAll("th,td").forEach(I=>{const L=I,S=Eo(L.innerHTML,e),M={colspan:L.colSpan,rowspan:L.rowSpan,value:S,verticalAlign:window.getComputedStyle(I).verticalAlign,width:parseFloat(window.getComputedStyle(I).width)};L.style.backgroundColor&&(M.backgroundColor=L.style.backgroundColor),T.tdList.push(M)}),R.trList.push(T)}),R.trList.length){const m=R.trList[0].tdList.reduce((T,I)=>T+I.colspan,0),f=Math.ceil(e.innerWidth/m);for(let T=0;T<m;T++){const I=g[T]?.getAttribute("width");R.colgroup.push({width:I?parseFloat(I):f})}t.push(R)}}else if(u.nodeName==="INPUT"&&u.type===p.CHECKBOX)t.push({type:O.CHECKBOX,value:"",checkbox:{value:u.checked}});else if(u.nodeName==="INPUT"&&u.type===p.RADIO)t.push({type:O.RADIO,value:"",radio:{value:u.checked}});else if(n(u),u.nodeType===1&&d!==c.length-1){const h=u;window.getComputedStyle(h).display==="block"&&!/(\n|\r\n)$/.test(h.textContent)&&t.push({value:`
92
+ `})}}}}const i=document.createElement("div");document.body.appendChild(i);const r=i.attachShadow({mode:"open"}),s=document.createElement("div");s.innerHTML=o,r.appendChild(s);const l=[];return s.childNodes.forEach(a=>{a.nodeType!==1&&!a.textContent?.trim()&&l.push(a)}),l.forEach(a=>a.remove()),n(s),i.remove(),t}function Oo(o){function e(t){let n="";for(let i=0;i<t.length;i++){const r=t[i];if(r.type===O.TABLE){n+=`
93
+ `;const s=r.trList;for(let l=0;l<s.length;l++){const a=s[l];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c],u=e(Ge(d.value)),h=c===0,R=a.tdList.length-1===c;n+=`${h?"":" "}${u}${R?`
94
+ `:""}`}}}else if(r.type===O.TAB)n+=" ";else if(r.type===O.HYPERLINK)n+=r.valueList.map(s=>s.value).join("");else if(r.type===O.TITLE)n+=`${e(Ge(r.valueList))}`;else if(r.type===O.LIST){const s=Ge(r.valueList),l=bl(s);let a="";r.listType===kt.UL&&(a=ls[r.listStyle]),l.forEach((c,d)=>{const u=l.size-1===d;n+=`
95
+ ${a||`${d+1}.`}${e(c)}${u?`
96
+ `:""}`})}else if(r.type===O.CHECKBOX)n+=r.checkbox?.value?"☑":"□";else if(r.type===O.RADIO)n+=r.radio?.value?"☉":"○";else if(!r.type||r.type===O.LATEX||wt.includes(r.type)){let s="";if(r.type===O.CONTROL){const l=r.control.value?.[0]?.value||"";s=l?`${r.control?.preText||""}${l}${r.control?.postText||""}`:""}else r.type===O.DATE?s=r.valueList?.map(l=>l.value).join("")||"":s=r.value;n+=s.replace(new RegExp(`${ee}`,"g"),`
97
+ `)}}return n}return e(Ge(o))}function _i(o){return ji(o,["metrics","style"])}function io(o){return!!o?.type&&(Cc.includes(o.type)||o.imgDisplay===Ne.INLINE)}function Ld(o,e){const t=document.createElement(e);for(let n=0;n<o.attributes.length;n++){const i=o.attributes[n];t.setAttribute(i.name,i.value)}return t.innerHTML=o.innerHTML,t}function xs(o){const e=[];for(let t=0;t<o.length;t++){const n=o[t];n?.imgDisplay===Ne.SURROUND&&e.push(n)}return e}function Id(o,e){for(let t=o.length-1;t>=0;t--)o[t].imgFloatPosition?.pageNo===e&&o.splice(t,1)}function bo(o,e,t=St.BEFORE){if(!o[e]?.hide&&!o[e]?.control?.hide&&!o[e]?.area?.hide)return e;let n=e;if(t===St.BEFORE)for(n=e-1;n>0;){if(!o[n]?.hide&&!o[n]?.control?.hide&&!o[n]?.area?.hide)return n;n--}else for(n=e+1;n<o.length;){if(!o[n]?.hide&&!o[n]?.control?.hide&&!o[n]?.area?.hide)return n;n++}return n}const yl=`${mi}-control`;function Pd(o){localStorage.setItem(mi,JSON.stringify({text:o.text,elementList:o.elementList}))}function xl(){const o=localStorage.getItem(mi);return o?JSON.parse(o):null}function vl(){localStorage.removeItem(mi)}function Od(o){localStorage.setItem(yl,JSON.stringify(o))}function Wl(){const o=localStorage.getItem(yl);return o?JSON.parse(o):null}function Sd(){return!!Wl()?.element}async function Md(o,e,t){if(!o&&!e&&!t.length)return;const n=new Blob([o],{type:"text/plain"}),i=new Blob([e],{type:"text/html"});if(window.ClipboardItem){const r=new ClipboardItem({[n.type]:n,[i.type]:i});await window.navigator.clipboard.write([r])}else{const r=document.createElement("div");r.setAttribute("contenteditable","true"),r.innerHTML=e,document.body.append(r);const s=window.getSelection(),l=document.createRange(),a=document.createElement("span");a.innerText=`
98
+ `,r.append(a),l.selectNodeContents(r),s?.removeAllRanges(),s?.addRange(l),document.execCommand("copy"),r.remove()}Pd({text:o,elementList:t})}async function Dl(o,e){const t=Xo(o,e);document.body.append(t);const n=t.innerText;t.remove();const i=t.innerHTML;!n&&!i&&!o.length||await Md(n,i,Ge(o))}function Xd(o){let e=!1;for(let t=0;t<o.items.length;t++)if(o.items[t].kind==="file"){e=!0;break}return e}function vs(o,e){const t=o.getDraw();if(t.isReadonly()||t.isDisabled()||t.getControl().getIsDisabledPasteControl())return;const n=t.getRange(),{startIndex:i}=n.getRange(),r=t.getElementList();if(~i&&!n.getIsSelectAll()){const s=r[i];if(s?.titleId||s?.listId){let l=0;for(;l<e.length;){const a=e[l];if(s.titleId&&/^\n/.test(a.value))break;if(yc.includes(a.type)){if(e.splice(l,1),a.valueList)for(let c=0;c<a.valueList.length;c++){const d=a.valueList[c];d.value===ee||d.value===`
99
+ `||(e.splice(l,0,d),l++)}l--}l++}}ze(r,e,i,{isBreakWhenWrap:!0,editorOptions:t.getOptions()})}t.insertElementList(e)}function Vl(o,e){const t=o.getDraw();if(t.isReadonly()||t.isDisabled())return;const n=Eo(e,{innerWidth:t.getOriginalInnerWidth()});vs(o,n)}function Ws(o,e){const t=o.getDraw();if(t.isReadonly()||t.isDisabled())return;const n=t.getRange(),{startIndex:i}=n.getRange(),r=t.getElementList(),s=new FileReader;s.readAsDataURL(e),s.onload=()=>{const l=new Image,a=s.result;l.src=a,l.onload=()=>{const c={value:a,type:O.IMAGE,width:l.width,height:l.height};~i&&ze(r,[c],i,{editorOptions:t.getOptions()}),t.insertElementList([c])}}}function Ed(o,e){const t=o.getDraw();if(t.isReadonly()||t.isDisabled())return;const n=e.clipboardData;if(!n)return;const{paste:i}=t.getOverride();if(i&&i(e)?.preventDefault!==!1)return;if(!Xd(n)){const s=n.getData("text"),l=xl();if(l&&li(s)===li(l.text)){vs(o,l.elementList);return}}vl();let r=!1;for(let s=0;s<n.items.length;s++)if(n.items[s].type==="text/html"){r=!0;break}for(let s=0;s<n.items.length;s++){const l=n.items[s];if(l.kind==="string"){if(l.type==="text/plain"&&!r){l.getAsString(a=>{o.input(a)});break}if(l.type==="text/html"&&r){l.getAsString(a=>{Vl(o,a)});break}}else if(l.kind==="file"&&l.type.includes("image")){const a=l.getAsFile();a&&Ws(o,a)}}}async function Nd(o,e){const t=o.getDraw();if(t.isReadonly()||t.isDisabled())return;const{paste:n}=t.getOverride();if(n&&n()?.preventDefault!==!1)return;const i=await navigator.clipboard.readText(),r=xl();if(r&&li(i)===li(r.text)){vs(o,r.elementList);return}if(vl(),e?.isPlainText)i&&o.input(i);else{const s=await navigator.clipboard.read();let l=!1;for(const a of s)if(a.types.includes("text/html")){l=!0;break}for(const a of s)if(a.types.includes("text/plain")&&!l){const d=await(await a.getType("text/plain")).text();d&&o.input(d)}else if(a.types.includes("text/html")&&l){const d=await(await a.getType("text/html")).text();d&&Vl(o,d)}else if(a.types.some(c=>c.startsWith("image/"))){const c=a.types.find(u=>u.startsWith("image/")),d=await a.getType(c);Ws(o,d)}}}class Fd{draw;container;agentCursorDom;canvasEvent;eventBus;constructor(e,t){this.draw=e,this.container=e.getContainer(),this.canvasEvent=t,this.eventBus=e.getEventBus();const n=document.createElement("textarea");n.autocomplete="off",n.classList.add(`${re}-inputarea`),n.innerText="",this.container.append(n),this.agentCursorDom=n,n.onkeydown=i=>this._keyDown(i),n.oninput=this._input.bind(this),n.onpaste=i=>this._paste(i),n.addEventListener("compositionstart",this._compositionstart.bind(this)),n.addEventListener("compositionupdate",this._compositionupdate.bind(this)),n.addEventListener("compositionend",this._compositionend.bind(this)),n.addEventListener("keydown",this._keydown.bind(this)),this.eventBus.on("rangeStyleChange",i=>{this.agentCursorDom.style.fontSize=Math.max(i.size,18)+"px"})}getAgentCursorDom(){return this.agentCursorDom}_keyDown(e){this.canvasEvent.keydown(e)}_input(e){const t=e.data;t&&this.canvasEvent.input(t),this.eventBus.isSubscribe("input")&&this.eventBus.emit("input",e)}_paste(e){this.draw.isReadonly()||!e.clipboardData||(Ed(this.canvasEvent,e),e.preventDefault())}_compositionstart(){this.agentCursorDom.style.zIndex="1000",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="#000",this.agentCursorDom.style.background="#fff",this.canvasEvent.compositionstart()}_compositionupdate(){this.agentCursorDom.style.width="9999px";let e=this.agentCursorDom.scrollWidth;const t=this.container.clientWidth,n=Math.max(t-this.agentCursorDom.offsetLeft,100);e>n&&(e=n),this.agentCursorDom.style.width=e+"px"}_compositionend(e){this.agentCursorDom.style.zIndex="-1",this.agentCursorDom.style.width="0px",this.agentCursorDom.style.color="",this.agentCursorDom.style.background="",this.canvasEvent.compositionend(e)}_keydown(e){this.canvasEvent.isComposing&&e.code==="Escape"&&this.canvasEvent.compositionCancel()}}class Cd{ANIMATION_CLASS=`${re}-cursor--animation`;draw;container;options;position;cursorDom;cursorAgent;blinkTimeout;hitLineStartIndex;constructor(e,t){this.draw=e,this.container=e.getContainer(),this.position=e.getPosition(),this.options=e.getOptions(),this.cursorDom=document.createElement("div"),this.cursorDom.classList.add(`${re}-cursor`),this.container.append(this.cursorDom),this.cursorAgent=new Fd(e,t),this.blinkTimeout=null}getCursorDom(){return this.cursorDom}getAgentDom(){return this.cursorAgent.getAgentCursorDom()}getAgentIsActive(){return this.getAgentDom()===document.activeElement}getAgentDomValue(){return this.getAgentDom().value}clearAgentDomValue(){this.getAgentDom().value=""}getHitLineStartIndex(){return this.hitLineStartIndex}_blinkStart(){this.cursorDom.classList.add(this.ANIMATION_CLASS)}_blinkStop(){this.cursorDom.classList.remove(this.ANIMATION_CLASS)}_setBlinkTimeout(){this._clearBlinkTimeout(),this.blinkTimeout=window.setTimeout(()=>{this._blinkStart()},500)}_clearBlinkTimeout(){this.blinkTimeout&&(this._blinkStop(),window.clearTimeout(this.blinkTimeout),this.blinkTimeout=null)}focus(){if(Sc&&this.draw.isReadonly())return;const e=this.cursorAgent.getAgentCursorDom();document.activeElement!==e&&(e.focus(),e.setSelectionRange(0,0))}drawCursor(e){let t=this.position.getCursorPosition();if(!t)return;const{scale:n,cursor:i}=this.options,{color:r,width:s,isShow:l=!0,isBlink:a=!0,isFocus:c=!0,hitLineStartIndex:d}={...i,...e},u=this.draw.getHeight(),h=this.draw.getPageGap();this.hitLineStartIndex=d,d&&(t=this.position.getPositionList()[d]);const{metrics:R,coordinate:{leftTop:g,rightTop:m},ascent:f,pageNo:T}=t,S=(this.draw.getZone().isMainActive()?T:this.draw.getPageNo())*(u+h),M=Ic*n,X=Math.min(R.height/4,M),x=R.height+X*2,F=this.cursorAgent.getAgentCursorDom();c&&setTimeout(()=>{this.focus()});const D=R.boundingBoxDescent<0?0:R.boundingBoxDescent,V=g[1]+f+D-(x-X)+S,E=d?g[0]:m[0];if(F.style.left=`${E}px`,F.style.top=`${V+x-M}px`,!l){this.recoveryCursor();return}const v=this.cursorDom.style.top,b=this.draw.isReadonly();this.cursorDom.style.width=`${s*n}px`,this.cursorDom.style.backgroundColor=r,this.cursorDom.style.left=`${E}px`,this.cursorDom.style.top=`${V}px`,this.cursorDom.style.display=b?"none":"block",this.cursorDom.style.height=`${x}px`,a?this._setBlinkTimeout():this._clearBlinkTimeout(),Xs(()=>{this.moveCursorToVisible({cursorPosition:t,direction:parseInt(v)>V?mt.UP:mt.DOWN})})}recoveryCursor(){this.cursorDom.style.display="none",this._clearBlinkTimeout()}moveCursorToVisible(e){const{cursorPosition:t,direction:n}=e;if(!t||!n)return;const{pageNo:i,coordinate:{leftTop:r,leftBottom:s}}=t,l=mc(this.container),a={left:0,right:0,top:0,bottom:0},c=l===document.documentElement;if(c)a.right=window.innerWidth,a.bottom=window.innerHeight;else{const{left:m,right:f,top:T,bottom:I}=l.getBoundingClientRect();a.left=m,a.right=f,a.top=T,a.bottom=I}const d=i*(this.draw.getHeight()+this.draw.getPageGap())+this.container.getBoundingClientRect().top,u=n===mt.UP,h=s[0]+(c?0:a.left),R=u?r[1]+d:s[1]+d,{maskMargin:g}=this.options;if(a.top+=g[0],a.bottom-=g[2],!(h>=a.left&&h<=a.right&&R>=a.top&&R<=a.bottom)){const{scrollLeft:m,scrollTop:f}=l;u?l.scroll(m,f-(a.top-R)):l.scroll(m,f+R-a.bottom)}}}var us=(o=>(o[o.LEFT=0]="LEFT",o[o.CENTER=1]="CENTER",o[o.RIGHT=2]="RIGHT",o))(us||{});function on(o){return Vn?o.metaKey:o.ctrlKey}var Te=(o=>(o.Delete="Delete",o.Backspace="Backspace",o.Enter="Enter",o.Left="ArrowLeft",o.Right="ArrowRight",o.Up="ArrowUp",o.Down="ArrowDown",o.ESC="Escape",o.TAB="Tab",o.META="Meta",o.LEFT_BRACKET="[",o.RIGHT_BRACKET="]",o.COMMA=",",o.PERIOD=".",o.LEFT_ANGLE_BRACKET="<",o.RIGHT_ANGLE_BRACKET=">",o.EQUAL="=",o.MINUS="-",o.PLUS="+",o.A="a",o.B="b",o.C="c",o.D="d",o.E="e",o.F="f",o.G="g",o.H="h",o.I="i",o.J="j",o.K="k",o.L="l",o.M="m",o.N="n",o.O="o",o.P="p",o.Q="q",o.R="r",o.S="s",o.T="t",o.U="u",o.V="v",o.W="w",o.X="x",o.Y="y",o.Z="z",o.A_UPPERCASE="A",o.B_UPPERCASE="B",o.C_UPPERCASE="C",o.D_UPPERCASE="D",o.E_UPPERCASE="E",o.F_UPPERCASE="F",o.G_UPPERCASE="G",o.H_UPPERCASE="H",o.I_UPPERCASE="I",o.J_UPPERCASE="J",o.K_UPPERCASE="K",o.L_UPPERCASE="L",o.M_UPPERCASE="M",o.N_UPPERCASE="N",o.O_UPPERCASE="O",o.P_UPPERCASE="P",o.Q_UPPERCASE="Q",o.R_UPPERCASE="R",o.S_UPPERCASE="S",o.T_UPPERCASE="T",o.U_UPPERCASE="U",o.V_UPPERCASE="V",o.W_UPPERCASE="W",o.X_UPPERCASE="X",o.Y_UPPERCASE="Y",o.Z_UPPERCASE="Z",o.ZERO="0",o.ONE="1",o.TWO="2",o.THREE="3",o.FOUR="4",o.FIVE="5",o.SIX="6",o.SEVEN="7",o.EIGHT="8",o.NINE="9",o))(Te||{});class di{element;control;constructor(e,t){this.element=e,this.control=t}setElement(e){this.element=e}getElement(){return this.element}getCode(){return this.element.control?.code||null}getValue(){const e=this.control.getElementList(),{startIndex:t}=this.control.getRange(),n=e[t],i=[];let r=t;for(;r>0;){const l=e[r];if(l.controlId!==n.controlId||l.controlComponent===p.PREFIX||l.controlComponent===p.PRE_TEXT)break;l.controlComponent===p.VALUE&&i.unshift(l),r--}let s=t+1;for(;s<e.length;){const l=e[s];if(l.controlId!==n.controlId||l.controlComponent===p.POSTFIX||l.controlComponent===p.POST_TEXT)break;l.controlComponent===p.VALUE&&i.push(l),s++}return i}setValue(){return-1}setSelect(e,t={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return;const{control:i}=this.element,r=t.elementList||this.control.getElementList(),{startIndex:s}=t.range||this.control.getRange(),l=r[s];let a=s;for(;a>0;){const d=r[a];if(d.controlId!==l.controlId||d.controlComponent===p.PREFIX||d.controlComponent===p.PRE_TEXT)break;if(d.controlComponent===p.CHECKBOX){const u=d.checkbox;u.value=e.includes(u.code)}a--}let c=s+1;for(;c<r.length;){const d=r[c];if(d.controlId!==l.controlId||d.controlComponent===p.POSTFIX||d.controlComponent===p.POST_TEXT)break;if(d.controlComponent===p.CHECKBOX){const u=d.checkbox;u.value=e.includes(u.code)}c++}i.code=e.join(","),this.control.repaintControl({curIndex:s,isSetCursor:!1}),this.control.emitControlContentChange({context:t})}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getRange();this.control.shrinkBoundary();const{startIndex:n,endIndex:i}=t;return e.key===Te.Backspace||e.key===Te.Delete?this.control.removeControl(n):i}cut(){return-1}}class hs extends di{setSelect(e,t={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return;const{control:i}=this.element,r=t.elementList||this.control.getElementList(),{startIndex:s}=t.range||this.control.getRange(),l=r[s];let a=s;for(;a>0;){const d=r[a];if(d.controlId!==l.controlId||d.controlComponent===p.PREFIX||d.controlComponent===p.PRE_TEXT)break;if(d.controlComponent===p.RADIO){const u=d.radio;u.value=e.includes(u.code)}a--}let c=s+1;for(;c<r.length;){const d=r[c];if(d.controlId!==l.controlId||d.controlComponent===p.POSTFIX||d.controlComponent===p.POST_TEXT)break;if(d.controlComponent===p.RADIO){const u=d.radio;u.value=e.includes(u.code)}c++}i.code=e.join(","),this.control.repaintControl({curIndex:s,isSetCursor:!1}),this.control.emitControlContentChange({context:t})}}function Wr(o){const e=o.getDraw(),t=e.getPosition(),n=e.getRange();o.isAllowDrag=!0,o.cacheRange=xe(n.getRange()),o.cacheElementList=e.getElementList(),o.cachePositionList=t.getPositionList(),o.cachePositionContext=t.getPositionContext()}function Dr(o,e){const{checkbox:t,control:n}=o;if(!n)e.getCheckboxParticle().setSelect(o);else{const i=n?.code?n.code.split(","):[];if(t?.value){const s=i.findIndex(l=>l===t.code);i.splice(s,1)}else t?.code&&i.push(t.code);const r=e.getControl().getActiveControl();r instanceof di&&r.setSelect(i)}}function Vr(o,e){const{radio:t,control:n}=o;if(!n)e.getRadioParticle().setSelect(o);else{const i=t?.code?[t.code]:[],r=e.getControl().getActiveControl();r instanceof hs&&r.setSelect(i)}}function bd(o,e){const t=e.getDraw();let n=t.isReadonly();const i=t.getRange(),r=t.getPosition(),s=i.getRange();if(o.button===us.RIGHT&&(s.isCrossRowCol||!i.getIsCollapsed()))return;const a=o.target.dataset.index;if(a&&t.setPageNo(Number(a)),!e.isAllowDrag&&!n&&s.startIndex!==s.endIndex&&i.getIsPointInRange(o.offsetX,o.offsetY,t.getPageNo())){Wr(e);return}e.isAllowSelection=!0;const c=xe(r.getPositionContext()),d=r.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!d)return;const{index:u,isDirectHit:h,isCheckbox:R,isRadio:g,isImage:m,isLabel:f,isMacro:T,isTable:I,tdValueIndex:L,hitLineStartIndex:S}=d;e.mouseDownStartPosition={...d,index:I?L:u,originalIndex:u,x:o.offsetX,y:o.offsetY};const M=t.getElementList(),X=r.getPositionList(),x=I?L:u;let F;I?F=t.getTd().value[L]:F=M[x];const D=!!(h&&m),V=!!(h&&R),E=!!(h&&g),v=!!(h&&f),b=!!(h&&T),P=ge=>ge&&(ge.type===O.MACRO||ge.type===O.CUSTOM_MACRO||ge.type===O.REUSABLE_ITEM||ge.type===O.MENSTRUAL_HISTORY||ge.type===O.FETAL_HEART_POSITION||ge.type===O.TOOTH_POSITION||ge.type===O.LIST||ge.type===O.SPECIAL_SYMBOLS),y=ge=>ge&&!!ge.originControlId&&!!ge.controlId,N=ge=>ge&&!!ge.originControlId&&!!ge.controlId&&(ge.controlComponent===p.POSTFIX||ge.controlComponent===p.POSTTEXTFIX||ge.controlComponent===p.POST_TEXT||ge.controlComponent===p.PLACEHOLDER),U=t.getMode()===B.FORM,w=U?t.getControl().getActiveTextControlLimit():null;let Q=x;const K=!!(w&&(!F?.controlId||F.controlId===w.controlId&&(F.originControlId||null)===w.originControlId||w.parentControlId&&F.controlId===w.parentControlId&&!F.originControlId));if(U&&(F?.controlId||F?.originControlId)){let ge;const pe=F.originControlId||F.controlId;for(let H=x;H>=0;H--){const te=M[H];if(te.controlId===pe&&!te.originControlId&&te.control?.type){ge=te.control.type;break}if(te.controlId!==F.controlId&&te.controlId!==pe)break}if(ge===Y.TEXT&&y(F))F.controlComponent===p.PREFIX||F.controlComponent===p.PRE_TEXT||F.controlComponent===p.PRETEXTFIX||F.controlComponent===p.PRETEXTFIX_TEXT?Q=Math.max(x-1,0):(F.controlComponent===p.POSTFIX||F.controlComponent===p.POST_TEXT||F.controlComponent===p.POSTTEXTFIX||F.controlComponent===p.POSTTEXTFIX_TEXT)&&(Q=x);else if(ge===Y.TEXTFIELD){const H=F.controlComponent;if(!y(F)){if(!(x>0&&N(M[x-1]))){if(!(F.controlComponent===p.VALUE&&P(F))){if(H===p.PRETEXTFIX||H===p.PRETEXTFIX_TEXT||H===p.POSTTEXTFIX||H===p.POSTTEXTFIX_TEXT||H===p.TEXTFIXLABEL||H===p.PREFIX||H===p.POSTFIX||H===p.PRE_TEXT||H===p.POST_TEXT||H===p.PLACEHOLDER)for(let te=x+1;te<M.length;te++){const _=M[te];if(_.controlId!==pe&&_.originControlId!==pe)break;if(_.controlComponent===p.VALUE&&!P(_)){Q=te;break}if(_.controlComponent===p.POSTTEXTFIX||_.controlComponent===p.POSTFIX){for(let j=x-1;j>=0;j--){const G=M[j];if(G.controlId!==pe&&G.originControlId!==pe)break;if(G.controlComponent===p.VALUE&&!P(G)){Q=j;break}}break}}else if(H===p.VALUE&&x>0){const te=M[x-1];if(te&&(te.controlId===pe||te.originControlId===pe)&&te.controlComponent===p.VALUE&&P(te)){let _=!1;for(let j=x-2;j>=0;j--){const G=M[j];if(G.controlId!==pe&&G.originControlId!==pe||G.controlComponent!==p.VALUE&&!G.originControlId&&G.controlId===pe)break;if(!P(G)){Q=j+1,_=!0;break}}if(!_)for(let j=x;j<M.length;j++){const G=M[j];if(G.controlId!==pe&&G.originControlId!==pe||(G.controlComponent===p.POSTTEXTFIX||G.controlComponent===p.POSTFIX)&&!G.originControlId&&G.controlId===pe)break;if(!P(G)){Q=j,_=!0;break}}}}}}}}}if(~u){K&&(Q=Math.min(Math.max(Q,w.startIndex),w.endIndex));let ge=Q,pe=Q;if(o.shiftKey){const{startIndex:H}=i.getRange();~H&&r.getPositionContext().tdId===c.tdId&&(x>H?ge=H:pe=H)}if(K&&(ge=Math.min(Math.max(ge,w.startIndex),w.endIndex),pe=Math.min(Math.max(pe,w.startIndex),w.endIndex),Q=Math.min(Math.max(Q,w.startIndex),w.endIndex)),i.setRange(ge,pe),r.setCursorPosition(X[Q]),n=t.isReadonly(),V&&!n)Dr(F,t);else if(E&&!n)Vr(F,t);else if(F.controlComponent===p.VALUE&&(F.control?.type===Y.CHECKBOX||F.control?.type===Y.RADIO)){let H=x;for(;H>0;){const te=M[H];if(te.controlComponent===p.CHECKBOX){Dr(te,t);break}else if(te.controlComponent===p.RADIO){Vr(te,t);break}H--}}else{const H=F?.control?.type===Y.BUTTON&&!F.control?.buttonText,te=h&&H;let _=!1;if(U&&F?.controlId&&F?.controlComponent===p.VALUE&&!F.originControlId)for(let Ie=x;Ie>=0;Ie--){const me=M[Ie];if(me.controlId!==F.controlId)break;if(me.control?.type===Y.TEXTFIELD){_=!0;break}}const j=_&&P(F),G=b&&!j?Q+1:void 0;t.render({curIndex:b&&!j?G:Q,isCompute:!1,isSubmitHistory:!1,isSetCursor:!D&&!V&&!E&&!(te&&U)&&!j});const ae=M[Q];if(!n&&h&&ae?.controlId&&o.button===us.LEFT){const me=t.getControl().getActiveControl(),Oe=me?.getElement()?.control?.type;me&&(Oe===Y.NUMBER||Oe===Y.SELECT)&&me.getElement()?.controlId===ae.controlId&&ae.controlComponent!==p.POSTFIX&&ae.controlComponent!==p.POSTTEXTFIX&&ae.controlComponent!==p.POSTTEXTFIX_TEXT&&ae.controlComponent!==p.POST_TEXT&&typeof me.awake=="function"&&me.awake()}}S&&e.getDraw().getCursor().drawCursor({hitLineStartIndex:S})}const z=t.getEventBus();if(v&&z.isSubscribe("labelMousedown")&&z.emit("labelMousedown",{evt:o,element:F}),b&&(F.type===O.MACRO||F.type===O.CUSTOM_MACRO||F.type===O.REUSABLE_ITEM)){const ge=t.getMode();ge===B.EDIT&&F.type===O.CUSTOM_MACRO?z.isSubscribe("macroClick")&&z.emit("macroClick",{evt:o,element:F}):ge===B.FORM&&z.isSubscribe("macroValueChange")&&z.emit("macroValueChange",{evt:o,element:F})}const $=t.getPreviewer();if($.clearResizer(),D){const ge={dragDisable:n||!F.controlId&&t.getMode()===B.FORM};F.type===O.LATEX&&(ge.mime="svg",ge.srcKey="laTexSVG"),$.drawResizer(F,X[x],ge),t.getCursor().drawCursor({isShow:!1}),Wr(e),(F.imgDisplay===Ne.SURROUND||F.imgDisplay===Ne.FLOAT_TOP||F.imgDisplay===Ne.FLOAT_BOTTOM)&&t.getImageParticle().createFloatImage(F),z.isSubscribe("imageMousedown")&&z.emit("imageMousedown",{evt:o,element:F})}const le=t.getTableTool();le.dispose(),I&&!n&&t.getMode()!==B.FORM&&le.render();const Pe=t.getHyperlinkParticle();Pe.clearHyperlinkPopup(),F.type===O.HYPERLINK&&(on(o)?Pe.openHyperlink(F):Pe.drawHyperlinkPopup(F,X[x]));const se=t.getDateParticle();se.clearDatePicker(),F.type===O.DATE&&!n&&se.renderDatePicker(F,X[x]);const J=t.getMenstrualHistoryParticle();J.clearMenstrualHistoryEditor(),F.type===O.MENSTRUAL_HISTORY&&h&&(t.getMode()===B.FORM||t.getMode()===B.EDIT)&&J.renderMenstrualHistoryEditor(F,X[x]);const ie=t.getFetalHeartPositionParticle();ie.clearFetalHeartPositionEditor(),F.type===O.FETAL_HEART_POSITION&&h&&(t.getMode()===B.FORM||t.getMode()===B.EDIT)&&ie.renderFetalHeartPositionEditor(F,X[x]);const Xe=t.getToothPositionParticle();Xe.clearToothPositionEditor(),F.type===O.TOOTH_POSITION&&h&&(t.getMode()===B.FORM||t.getMode()===B.EDIT)&&Xe.renderToothPositionEditor(F,X[x])}function Jo(o){const e=Ee();return Reflect.set(o,"dragId",e),e}function Bo(o,e){return e.findIndex(t=>t.dragId===o)}function Yr(o,e,t){const n=t.getDraw();if(o.imgDisplay===Ne.SURROUND||o.imgDisplay===Ne.FLOAT_TOP||o.imgDisplay===Ne.FLOAT_BOTTOM){const i=e.offsetX-t.mouseDownStartPosition.x,r=e.offsetY-t.mouseDownStartPosition.y,s=o.imgFloatPosition;o.imgFloatPosition={x:s.x+i,y:s.y+r,pageNo:n.getPageNo()}}n.getImageParticle().destroyFloatImage()}function yd(o,e){if(e.isAllowDrop){const t=e.getDraw();if(t.isReadonly()||t.isDisabled()){e.mousedown(o);return}const n=t.getPosition(),i=n.getPositionList(),r=n.getPositionContext(),s=t.getRange(),l=e.cacheRange,a=e.cacheElementList,c=e.cachePositionList,d=e.cachePositionContext,u=s.getRange(),h=l.startIndex===l.endIndex,R=h?l.startIndex-1:l.startIndex,g=l.endIndex;if(u.startIndex>=R&&u.endIndex<=g&&e.cachePositionContext?.tdId===r.tdId){t.clearSideEffect();let se=!1,J=!1;if(h){const ie=a[g];if(ie.type===O.IMAGE||ie.type===O.LATEX){if(Yr(ie,o,e),ie.imgDisplay===Ne.SURROUND||ie.imgDisplay===Ne.FLOAT_TOP||ie.imgDisplay===Ne.FLOAT_BOTTOM)t.getPreviewer().drawResizer(ie),se=!0;else{const Xe=c[g];t.getPreviewer().drawResizer(ie,Xe)}J=ie.imgDisplay===Ne.SURROUND}}s.replaceRange({...l}),t.render({isCompute:J,isSubmitHistory:se,isSetCursor:!1});return}const m=a.slice(R+1,g+1),f=m.find(se=>se.controlId);if(f){const se=a[R+1],J=a[g];if(!((!se.controlId||se.controlComponent===p.PREFIX)&&(!J.controlId||J.controlComponent===p.POSTFIX)||se.controlId===J.controlId&&se.controlComponent===p.PREFIX&&J.controlComponent===p.POSTFIX||se.control?.type===Y.TEXT&&se.controlComponent===p.VALUE&&J.control?.type===Y.TEXT&&J.controlComponent===p.VALUE)){t.render({curIndex:u.startIndex,isCompute:!1,isSubmitHistory:!1});return}}const T=t.getControl(),I=t.getElementList(),L=!f||!!I[u.startIndex].controlId||!T.getIsElementListContainFullControl(m),S=t.getOptions(),M=m.map(se=>{if(!se.type||se.type===O.TEXT){const J={value:se.value},ie=rn;return L||ie.push(...os),ie.forEach(Xe=>{const ge=se[Xe];ge!==void 0&&(J[Xe]=ge)}),J}else{let J=xe(se);return L&&(J=$t(J,os)),ct([J],{isHandleFirstElement:!1,editorOptions:S}),J}});ze(I,M,u.startIndex,{editorOptions:t.getOptions()});const X=a[R],x=c[R],F=Jo(a[R]),D=Jo(a[g]),V=M.length;let E=u.startIndex,v=E+V;const b=T.getActiveControl();if(b&&a[E].controlComponent!==p.POSTFIX?(v=b.setValue(M),E=v-V):t.spliceElementList(I,E+1,0,M),!~v){t.render({isSetCursor:!1});return}const P=Jo(I[E]),y=Jo(I[v]),N=Bo(F,a),U=Bo(D,a),w=a[U];if(w.controlId&&w.controlComponent!==p.POSTFIX)s.replaceRange({...l,startIndex:N,endIndex:U}),T.getActiveControl()?.cut();else{let se=!0;if(d?.isTable){const{tableId:J,trIndex:ie,tdIndex:Xe}=d;se=!t.getOriginalElementList().some(pe=>pe.id===J&&pe?.trList?.[ie]?.tdList?.[Xe]?.deletable===!1)}se&&t.spliceElementList(a,N+1,U-N)}const Q=I[u.startIndex],K=i[u.startIndex];let z=r.index;z&&(Q.tableId&&!X.tableId?x.index<z&&(z-=V):!Q.tableId&&X.tableId&&K.index<z&&(z+=V),n.setPositionContext({...r,index:z}));const $=Bo(P,I),le=Bo(y,I);s.setRange(h?le:$,le,u.tableId,u.startTdIndex,u.endTdIndex,u.startTrIndex,u.endTrIndex),t.clearSideEffect();let Pe=null;if(h){const J=t.getElementList()[le];(J.type===O.IMAGE||J.type===O.LATEX)&&(Yr(J,o,e),Pe=J)}if(t.render({isSetCursor:!1}),b?T.emitControlContentChange():X.controlId&&T.emitControlContentChange({context:{range:l,elementList:a},controlElement:X}),Pe)if(Pe.imgDisplay===Ne.SURROUND||Pe.imgDisplay===Ne.FLOAT_TOP||Pe.imgDisplay===Ne.FLOAT_BOTTOM)t.getPreviewer().drawResizer(Pe);else{const J=n.getPositionList()[le];t.getPreviewer().drawResizer(Pe,J)}}else e.isAllowDrag&&e.cacheRange?.startIndex!==e.cacheRange?.endIndex&&e.mousedown(o)}function xd(o,e){const t=e.getDraw();if(!t.getOptions().pageOuterSelectionDisable)return;const n=t.getPageContainer(),{x:i,y:r,width:s,height:l}=n.getBoundingClientRect();o.x>=i&&o.x<=i+s&&o.y>=r&&o.y<=r+l||e.setIsAllowSelection(!1)}function vd(o,e){const t=e.getDraw(),n=t.getControl(),i=t.getPageList(),r=t.getPageNo(),s=i[r],a=t.getPosition().getPositionByXY({x:o.offsetX,y:o.offsetY});if(~a.index){const P=t.getElementList(),y=a.isTable?a.tdValueIndex:a.index,N=P[y];N?.control?.type===Y.BUTTON&&!N.control?.buttonText?s&&(s.style.cursor="pointer"):s&&(s.style.cursor="text")}else s&&(s.style.cursor="text");if(e.isAllowDrag){const P=o.offsetX,y=o.offsetY,{startIndex:N,endIndex:U}=e.cacheRange,w=e.cachePositionList;for(let K=N+1;K<=U;K++){const{coordinate:{leftTop:z,rightBottom:$}}=w[K];if(P>=z[0]&&P<=$[0]&&y>=z[1]&&y<=$[1])return}const Q=e.cacheRange?.startIndex;if(Q){const K=e.cacheElementList[Q];K?.type===O.IMAGE&&(K.imgDisplay===Ne.SURROUND||K.imgDisplay===Ne.FLOAT_TOP||K.imgDisplay===Ne.FLOAT_BOTTOM)&&(t.getPreviewer().clearResizer(),t.getImageParticle().dragFloatImage(o.movementX,o.movementY))}e.dragover(o),e.isAllowDrop=!0;return}if(!e.isAllowSelection||!e.mouseDownStartPosition)return;const d=o.target.dataset.index;d&&t.setPageNo(Number(d));const u=t.getPosition(),h=u.getPositionByXY({x:o.offsetX,y:o.offsetY});if(!~h.index)return;const{index:R,isTable:g,tdValueIndex:m,tdIndex:f,trIndex:T,tableId:I,trId:L,tdId:S}=h,{index:M,isTable:X,tdIndex:x,tdId:F,trIndex:D,tableId:V}=e.mouseDownStartPosition,E=g?m:R,v=t.getRange();let b;if(S!==F&&S&&F){const P=t.getTdByPosition({...e.mouseDownStartPosition,isTable:!!e.mouseDownStartPosition.tableId,index:e.mouseDownStartPosition.originalIndex??e.mouseDownStartPosition.index}),y=t.getTdByPosition({...h,isTable:!!h.tableId,index:h.index});if(t.isSplitTd(P,y)){const N=(P.valueStartIndex??0)+M,U=(y.valueStartIndex??0)+m;b=[{index:N,element:P.value[M],originalId:P.originalId,isCurrent:!1,length:P.value.length,startIndex:P.valueStartIndex??0},{index:U,element:y.value[m],originalId:y.originalId,isCurrent:!0,length:y.value.length,startIndex:y.valueStartIndex??0}]}}if(g&&X&&S!==F&&!b)v.setRange(E,E,I,x,f,D,T),u.setPositionContext({isTable:!!g,index:R,trIndex:T,tdIndex:f,tdId:S,trId:L,tableId:I});else{let P=~E?E:0;if((X||g)&&V!==I&&!b)return;u.setPositionContext({isTable:!!g,index:R,trIndex:T,tdIndex:f,tdId:S,trId:L,tableId:I});let y=M,N,U;if(b)[{element:N},{element:U}]=b;else{const K=t.getElementList();N=K[y+1],U=K[P]}if(y===P||N?.controlComponent===p.PLACEHOLDER&&U?.controlComponent===p.PLACEHOLDER&&N.controlId===U.controlId)return;if(y>P&&([y,P]=[P,y]),t.getMode()===B.FORM){const K=n.getActiveTextControlLimit();K&&(y=Math.min(Math.max(y,K.startIndex),K.endIndex),P=Math.min(Math.max(P,K.startIndex),K.endIndex));const z=t.getElementList(),$=z[y],le=z[P];if($?.control?.type===Y.TEXTFIELD||le?.control?.type===Y.TEXTFIELD){const Pe=$?.controlId||le?.controlId;if(Pe){let se=-1,J=-1;for(let ie=y;ie>=0;ie--){const Xe=z[ie];if(Xe.controlId!==Pe)break;if(Xe.controlComponent===p.PRETEXTFIX||Xe.controlComponent===p.PRETEXTFIX_TEXT||Xe.controlComponent===p.TEXTFIXLABEL||Xe.controlComponent===p.PREFIX||Xe.controlComponent===p.PRE_TEXT){se=ie+1;break}}for(let ie=P;ie<z.length;ie++){const Xe=z[ie];if(Xe.controlId!==Pe)break;if(Xe.controlComponent===p.POSTTEXTFIX||Xe.controlComponent===p.POSTTEXTFIX_TEXT||Xe.controlComponent===p.POSTFIX||Xe.controlComponent===p.POST_TEXT){J=ie-1;break}}se!==-1&&y<se&&(y=se),J!==-1&&P>J&&(P=J)}}}let Q;if(b){const[K,z]=b.sort(($,le)=>$.index-le.index);Q={originalId:b[0].originalId??b[1].originalId,startIndex:K.index,endIndex:z.index},K.isCurrent?(y=K.index,P=K.length-1):(y=0,P=Q.endIndex-z.startIndex)}v.setRange(y,P,void 0,void 0,void 0,void 0,void 0,Q)}t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}function Wd(o){const e=o.getDraw(),t=e.getRange(),n=t.getRange(),i=e.getElementList(),r=i[n.startIndex];if(!r.hide&&!r.control?.hide&&!r.area?.hide)return;let s=n.startIndex;for(;s>0;){const l=i[s];let a=null;l.controlId?(a=e.getControl().removeControl(s),a!==null&&(s=a)):(e.spliceElementList(i,s,1),a=s-1,s--);const c=i[a];if(!c||!c.hide&&!c.control?.hide&&!c.area?.hide){if(a){n.startIndex=a,n.endIndex=a,t.replaceRange(n);const d=e.getPosition(),u=d.getPositionList();d.setCursorPosition(u[a])}break}}}function Dd(o,e,t){if(t.originControlId){const n=t.originControlId;for(let i=e;i<o.length;i++){const r=o[i];if(r.controlId===n)return r.controlComponent===p.POSTFIX||r.controlComponent===p.POSTTEXTFIX||r.controlComponent===p.POST_TEXT?{isInParent:!1}:{isInParent:!0,parentControlId:n};if(r.controlId&&r.controlId!==n&&r.originControlId!==n)break}}if(!t.originControlId&&t.controlId){const n=o[e];if(n?.controlId&&n.controlId!==t.controlId&&(n.controlComponent===p.PREFIX||n.controlComponent===p.PRETEXTFIX))for(let i=e-1;i>=0;i--){const r=o[i];if(r.controlId===t.controlId&&(r.controlComponent===p.PREFIX||r.controlComponent===p.PRETEXTFIX)){for(let s=i-1;s>=0;s--){const l=o[s];if(l.controlId&&l.controlId!==t.controlId&&(l.controlComponent===p.PRETEXTFIX||l.controlComponent===p.PREFIX))return{isInParent:!0,parentControlId:l.controlId};if(l.controlId&&l.controlId!==t.controlId&&(l.controlComponent===p.POSTFIX||l.controlComponent===p.POSTTEXTFIX))return{isInParent:!1}}break}}if(n?.controlId&&n.controlId!==t.controlId&&!n.originControlId&&(n.controlComponent===p.POSTFIX||n.controlComponent===p.POSTTEXTFIX))return t.originControlId===n.controlId?{isInParent:!0,parentControlId:n.controlId}:{isInParent:!1}}return{isInParent:!1}}function Vd(o,e){const t=e.getDraw();if(t.isReadonly())return;const n=t.getRange();if(!n.getIsCanInput())return;n.getIsCollapsed()&&Wd(e);const i=t.getControl(),{startIndex:r,endIndex:s,isCrossRowCol:l}=n.getRange();let a;const c=t.getElementList();if(n.getIsCollapsed()&&r>0){const u=c[r-1],h=c[r],g=t.getPosition().getPositionList(),m=g[r],f=g[r-1],T=m&&f&&m.rowIndex===f.rowIndex,I=u?.controlComponent===p.PREFIX||u?.controlComponent===p.PRETEXTFIX||u?.controlComponent===p.PRE_TEXT||u?.controlComponent===p.PRETEXTFIX_TEXT,L=u?.controlComponent===p.POSTFIX||u?.controlComponent===p.POSTTEXTFIX||u?.controlComponent===p.POSTTEXTFIX_TEXT||u?.controlComponent===p.POST_TEXT,S=!!u?.controlId,M=h?.controlComponent===p.PLACEHOLDER,X=h?.controlComponent===p.POSTFIX||h?.controlComponent===p.POSTTEXTFIX||h?.controlComponent===p.POSTTEXTFIX_TEXT||h?.controlComponent===p.POST_TEXT,x=!!h&&!h.controlId&&!h.control;if(M&&I&&S&&T)return;const{isInParent:F,parentControlId:D}=Dd(c,r,u);if(L&&S&&T&&F){if(u.originControlId&&D)for(let V=r;V<c.length;V++){const E=c[V];if(E.controlId===D&&!E.originControlId){if(E.controlComponent===p.VALUE){n.setRange(V,V),t.render({curIndex:V,isSubmitHistory:!1});return}if(E.controlComponent===p.POSTFIX||E.controlComponent===p.POSTTEXTFIX||E.controlComponent===p.POST_TEXT)return}E.controlId!==D&&E.originControlId}return}if(L&&S&&T&&!F&&!(x&&!M&&!X)){const V=r-1;a=i.removeControl(V),t.getGlobalEvent().setCanvasEventAbility(),a===null?(n.setRange(V,V),t.render({curIndex:V,isSubmitHistory:!1})):(n.setRange(a,a),t.render({curIndex:a}));return}if(X&&h?.controlId&&T){const V=r;a=i.removeControl(V),t.getGlobalEvent().setCanvasEventAbility(),a===null?(n.setRange(V,V),t.render({curIndex:V,isSubmitHistory:!1})):(n.setRange(a,a),t.render({curIndex:a}));return}}if(l){const u=t.getTableParticle().getRangeRowCol();if(!u)return;let h=!1;for(let R=0;R<u.length;R++){const g=u[R];for(let m=0;m<g.length;m++){const f=g[m];f.value.length>1&&(t.spliceElementList(f.value,1,f.value.length-1),h=!0)}}a=h?0:null}else if(i.getActiveControl()&&i.getIsRangeCanCaptureEvent())a=i.keydown(o),a&&i.emitControlContentChange();else{const u=t.getPosition().getCursorPosition();if(!u)return;const{index:h}=u,R=n.getIsCollapsed(),g=t.getElementList();if(R&&h===0){const I=g[h];if(I.value===ee){I.listId&&t.getListParticle().unsetList(),o.preventDefault();return}}const m=g[r];if(R&&m.rowFlex&&m.value===ee){const I=n.getRangeRowElementList();if(I){const L=g[r-1];I.forEach(S=>{S.rowFlex=L?.rowFlex})}}const f=m.value===ee?g[r-1]:m,T=g[s+1];if(f?.titleId&&T?.titleId&&f.level===T.level&&f.titleId!==T.titleId){const I=f.titleId,L=T.titleId;let S=s+1;for(;S<g.length&&g[S]?.titleId===L;)g[S].titleId=I,S++}R?t.spliceElementList(g,h,1):t.spliceElementList(g,r+1,s-r),a=R?h-1:r}t.getGlobalEvent().setCanvasEventAbility(),a===null?(n.setRange(r,r),t.render({curIndex:r,isSubmitHistory:!1})):(n.setRange(a,a),t.render({curIndex:a}))}function Yd(o){const e=o.getDraw(),n=e.getRange().getRange(),i=e.getElementList(),r=i[n.startIndex+1];if(!r.hide&&!r.control?.hide&&!r.area?.hide)return;const s=n.startIndex+1;for(;s<i.length;){const l=i[s];let a=null;l.controlId?a=e.getControl().removeControl(s):(e.spliceElementList(i,s,1),a=s);const c=i[a];if(!c||!c.hide&&!c.control?.hide&&!c.area?.hide)break}}function wd(o,e){const t=e.getDraw();if(t.isReadonly())return;const n=t.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:r,isCrossRowCol:s,splitTdRange:l}=n.getRange(),a=t.getElementList(),c=t.getControl();n.getIsCollapsed()&&Yd(e);let d;if(s){const u=t.getTableParticle().getRangeRowCol();if(!u)return;let h=!1;for(let R=0;R<u.length;R++){const g=u[R];for(let m=0;m<g.length;m++){const f=g[m];f.value.length>1&&(t.spliceElementList(f.value,1,f.value.length-1),h=!0)}}d=h?0:null}else if(c.getActiveControl()&&c.getIsRangeWithinControl())d=c.keydown(o),d&&c.emitControlContentChange();else if(a[r+1]?.controlId)d=c.removeControl(r+1);else{t.removeSplitTdOtherRangeElements();const u=t.getPosition(),h=u.getCursorPosition();if(!h)return;const{index:R}=h,g=u.getPositionContext();if(g.isDirectHit&&g.isImage)t.spliceElementList(a,R,1),d=R-1;else{const m=n.getIsCollapsed();if(!m)t.spliceElementList(a,i+1,r-i);else if(a[R+1])t.spliceElementList(a,R+1,1);else{let f=!0;if(g.isTable){const T=t.getTd();if(T?.linkTdNextId){const I=t.getTdById(T.linkTdNextId);I&&(f=!1,t.spliceElementList(I.value,1,1))}}if(f)return}d=m?R:i,d===0&&l&&(d=t.fixPosition(!0)??d)}}t.getGlobalEvent().setCanvasEventAbility(),d===null?(n.setRange(i,i),t.render({curIndex:i,isSubmitHistory:!1})):(n.setRange(d,d),t.render({curIndex:d}))}function Ud(o,e){const t=e.getDraw();if(t.isReadonly())return;const n=t.getRange();if(!n.getIsCanInput())return;const{startIndex:i,endIndex:r}=n.getRange(),s=n.getIsCollapsed(),l=t.getElementList(),a=l[i],c=l[r];if(s&&c.listId&&c.value===ee&&l[r+1]?.listId!==c.listId){t.getListParticle().unsetList();return}let d={value:ee};if(o.shiftKey&&a.listId&&(d.listWrap=!0),ze(l,[d],i,{isBreakWhenWrap:!0,editorOptions:t.getOptions()}),o.shiftKey&&c.areaId&&c.areaId!==l[r+1]?.areaId&&(d=$t(d,Yn)),!(l[i+1]?.titleId&&(!a.titleId||a.titleId!==l[i+1]?.titleId))&&!(c.titleId&&c.titleId!==l[r+1]?.titleId)){const f=n.getRangeAnchorStyle(l,r);if(f){const T=[...Vt],I=f.controlComponent===p.POSTFIX||f.controlComponent===p.POSTTEXTFIX||f.controlComponent===p.POSTTEXTFIX_TEXT||f.controlComponent===p.POST_TEXT,L=f.control?.type===Y.BUTTON&&!f.control?.buttonText;!I&&!L&&T.push(...rn),T.forEach(S=>{const M=f[S];M!==void 0&&(d[S]=M)})}}const u=t.getControl(),h=u.getActiveControl();let R;const g=h?.getElement();if(g?.control?.type===Y.BUTTON&&!g.control?.buttonText&&g?.controlId){const f=g.controlId;let T=r;for(;T+1<l.length&&l[T+1]?.controlId===f;)T++;t.spliceElementList(l,T+1,0,[d]),R=T+1}else if(h&&u.getIsRangeWithinControl())R=u.setValue([d]),u.emitControlContentChange();else{const T=t.getPosition().getCursorPosition();if(!T)return;const{index:I}=T;if(s){if(t.spliceElementList(l,I+1,0,[d]),c.titleId&&l[I+2]?.titleId===c.titleId){const L=Ee();let S=I+2;for(;S<l.length&&l[S]?.titleId===c.titleId;)l[S].titleId=L,S++}}else t.spliceElementList(l,i+1,r-i,[d]);R=I+1}~R&&(n.setRange(R,R),t.render({curIndex:R})),o.preventDefault()}function wr(o){return o&&(o.type===O.MACRO||o.type===O.CUSTOM_MACRO||o.type===O.REUSABLE_ITEM||o.type===O.MENSTRUAL_HISTORY||o.type===O.FETAL_HEART_POSITION||o.type===O.TOOTH_POSITION||o.type===O.LIST||o.type===O.SPECIAL_SYMBOLS)}function Zd(o,e){const t=e.getDraw();if(t.isReadonly())return;const i=t.getPosition(),r=i.getCursorPosition();if(!r)return;const s=i.getPositionContext(),{index:l}=r;if(l<=0&&!s.isTable)return;const a=t.getRange(),{startIndex:c,endIndex:d}=a.getRange(),u=a.getIsCollapsed(),h=t.getElementList(),R=t.getControl(),g=t.getMode()===B.FORM,m=g?R.getActiveTextControlLimit():null,f=h[l],T=f?.controlComponent===p.PREFIX||f?.controlComponent===p.PRETEXTFIX||f?.controlComponent===p.PRE_TEXT;let I=!1;if(T&&f?.originControlId){const D=f.originControlId;for(let V=l-1;V>=0;V--){const E=h[V];if(E.controlId===D&&!E.originControlId){I=!0;break}if(E.controlId&&E.controlId!==D&&E.originControlId!==D)break}}if(g&&R.getActiveControl()&&T&&!m&&!I){R.initNextControl({direction:mt.UP});return}let L=1;if(on(o)){const D=t.getLetterReg(),V=o.shiftKey&&!u&&c===r?.index?d:c;if(D.test(h[V]?.value)){let E=V-1;for(;E>0;){const v=h[E];if(!D.test(v.value))break;L++,E--}}}if(g){const D=h[c],V=D?.controlId;if(V&&D?.controlComponent===p.VALUE){let E=!1;for(let v=c;v>=0;v--){const b=h[v];if(b.controlId!==V)break;if(b.control?.type===Y.TEXTFIELD){E=!0;break}}if(E){if(D.controlComponent===p.VALUE&&wr(D))return;const v=c-L;if(v>=0){const b=h[v];if(b&&b.controlId===V&&b.controlComponent===p.VALUE&&wr(b))return}}}}const S=m?Math.max(c-L,m.startIndex):c-L;let M=S,X=S;if(o.shiftKey&&r&&(c!==d?c===r.index?(M=c,X=d-L):(M=S,X=d):X=d),!o.shiftKey){const D=h[c];if(D.type===O.TABLE){const V=D.trList,E=V.length-1,v=V[E],b=v.tdList.length-1,P=v.tdList[b];i.setPositionContext({isTable:!0,index:c,trIndex:E,tdIndex:b,tdId:P.id,trId:v.id,tableId:D.id}),M=P.value.length-1,X=M}else if(D.tableId&&c===0){const E=t.getOriginalElementList()[s.index],v=t.getTd();if(v?.linkTdPrevId){const b=t.getTdById(v.linkTdPrevId);b&&(i.setPositionContext({...s,isTable:!0,index:b.tableIndex,trIndex:b.trIndex,tdId:b.id,trId:b.trId,tableId:b.tableId}),M=b.value.length-1,X=M)}else{const b=E.trList;e:for(let P=0;P<b.length;P++){const y=b[P];if(y.id!==D.trId)continue;const N=y.tdList;for(let U=0;U<N.length;U++)if(N[U].id===D.tdId){if(P===0&&U===0)i.setPositionContext({isTable:!1}),M=s.index-1,X=M,t.getTableTool().dispose();else{let Q=P,K=U-1;K<0&&(Q=P-1,K=b[Q].tdList.length-1);const z=b[Q],$=z.tdList[K];i.setPositionContext({isTable:!0,index:s.index,trIndex:Q,tdIndex:K,tdId:$.id,trId:z.id,tableId:D.tableId}),M=$.value.length-1,X=M}break e}}}}}if(!~M||!~X)return;const x=t.getElementList();M=bo(x,M),X=bo(x,X),a.setRange(M,X);const F=M===X;t.updateTableTool(),t.render({curIndex:F?M:void 0,isSetCursor:F,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function Ur(o){return o&&(o.type===O.MACRO||o.type===O.CUSTOM_MACRO||o.type===O.REUSABLE_ITEM||o.type===O.MENSTRUAL_HISTORY||o.type===O.FETAL_HEART_POSITION||o.type===O.TOOTH_POSITION||o.type===O.LIST||o.type===O.SPECIAL_SYMBOLS)}function Qd(o,e){const t=e.getDraw();if(t.isReadonly())return;const i=t.getPosition(),r=i.getCursorPosition();if(!r)return;const{index:s}=r,l=i.getPositionList(),a=i.getPositionContext();if(s>l.length-1&&!a.isTable)return;const c=t.getRange(),{startIndex:d,endIndex:u}=c.getRange(),h=c.getIsCollapsed();let R=t.getElementList();const g=t.getControl(),m=t.getMode()===B.FORM,f=m?g.getActiveTextControlLimit():null,T=R[s],I=T?.controlComponent===p.POSTFIX||T?.controlComponent===p.POSTTEXTFIX||T?.controlComponent===p.POST_TEXT;let L=!1;if(I&&T?.originControlId){const E=T.originControlId;for(let v=s+1;v<R.length;v++){const b=R[v];if(b.controlId===E&&!b.originControlId){L=!0;break}if(b.controlId&&b.controlId!==E&&b.originControlId!==E)break}}if(m&&g.getActiveControl()&&I&&!f&&!L){g.initNextControl({direction:mt.DOWN});return}let S=1;if(on(o)){const E=t.getLetterReg(),v=o.shiftKey&&!h&&d===r?.index?u:d;if(E.test(R[v+1]?.value)){let b=v+2;for(;b<R.length;){const P=R[b];if(!E.test(P.value))break;S++,b++}}}if(m){const E=R[u],v=E?.controlId;if(v&&E?.controlComponent===p.VALUE){let b=!1;for(let P=u;P>=0;P--){const y=R[P];if(y.controlId!==v)break;if(y.control?.type===Y.TEXTFIELD){b=!0;break}}if(b){if(E.controlComponent===p.VALUE&&Ur(E))return;const P=u+S;if(P<R.length){const y=R[P];if(y&&y.controlId===v&&y.controlComponent===p.VALUE&&Ur(y))return}}}}const M=f?Math.min(u+S,f.endIndex):u+S;let X=M,x=M;if(o.shiftKey&&r&&(d!==u?d===r.index?(X=d,x=M):(X=d+S,x=u):X=d),!o.shiftKey){const E=R[u],v=R[u+1];if(v?.type===O.TABLE){const P=v.trList[0],y=P.tdList[0];i.setPositionContext({isTable:!0,index:u+1,trIndex:0,tdIndex:0,tdId:y.id,trId:P.id,tableId:v.id}),X=0,x=0}else if(E.tableId&&!v){const b=t.getTd(),P=b?.linkTdNextId?t.getTdById(b.linkTdNextId):void 0;if(P?.value.length)i.setPositionContext({...a,isTable:!0,index:P.tableIndex,trIndex:P.trIndex,tdId:P.id,trId:P.trId,tableId:P.tableId}),X=0,x=X;else{const N=t.getOriginalElementList()[a.index].trList;e:for(let U=0;U<N.length;U++){const w=N[U];if(w.id!==E.trId)continue;const Q=w.tdList;for(let K=0;K<Q.length;K++)if(Q[K].id===E.tdId){if(U===N.length-1&&K===Q.length-1)i.setPositionContext({isTable:!1}),X=a.index,x=X,R=t.getElementList(),t.getTableTool().dispose();else{let $=U,le=K+1;le>Q.length-1&&($=U+1,le=0);const Pe=N[$],se=Pe.tdList[le];i.setPositionContext({isTable:!0,index:a.index,trIndex:$,tdIndex:le,tdId:se.id,trId:Pe.id,tableId:E.tableId}),X=0,x=X}break e}}}}}const F=R.length-1;if(X>F||x>F)return;const D=t.getElementList();X=bo(D,X,St.AFTER),x=bo(D,x,St.AFTER),c.setRange(X,x);const V=X===x;t.updateTableTool(),t.render({curIndex:V?X:void 0,isSetCursor:V,isSubmitHistory:!1,isCompute:!1}),o.preventDefault()}function Kd(o,e){const t=e.getDraw();if(t.isReadonly())return;o.preventDefault();const i=t.getControl();if(i.getActiveControl()&&i.getIsRangeWithinControl())i.initNextControl({direction:o.shiftKey?mt.UP:mt.DOWN});else{const s=t.getRange(),l=t.getElementList(),{startIndex:a,endIndex:c}=s.getRange(),d=s.getRangeAnchorStyle(l,c),h={...d?at(d,rn):null,type:O.TAB,value:""};ze(l,[h],a,{editorOptions:t.getOptions()}),t.insertElementList([h])}}function Ai(o){const{positionList:e,index:t,isUp:n,rowNo:i,cursorX:r}=o;let s=-1;const l=[];if(n){let a=t-1;for(;a>=0;){const c=e[a];if(a--,c.rowNo!==i){if(l[0]&&l[0].rowNo!==c.rowNo)break;l.unshift(c)}}}else{let a=t+1;for(;a<e.length;){const c=e[a];if(a++,c.rowNo!==i){if(l[0]&&l[0].rowNo!==c.rowNo)break;l.push(c)}}}for(let a=0;a<l.length;a++){const c=l[a],{coordinate:{leftTop:[d],rightTop:[u]}}=c;if(a===l.length-1&&(s=c.index),!(r<d||r>u)){s=c.index;break}}return s}function Hd(o,e){const t=e.getDraw();if(t.isReadonly())return;const i=t.getPosition(),r=i.getCursorPosition();if(!r)return;const s=t.getRange(),{startIndex:l,endIndex:a}=s.getRange();let c=i.getPositionList();const d=o.key===Te.Up;let u=-1,h=-1;const R=i.getPositionContext();if(!o.shiftKey&&R.isTable&&(d&&r.rowIndex===0||!d&&r.rowIndex===t.getRowCount()-1)){const{index:m,trIndex:f,tdIndex:T,tableId:I}=R;if(d){const L=t.getOriginalElementList();if(f===0)if(L[m].originalId){const M=m-1,X=L[M];for(let x=X.trList.length-1;x>=0;x--){const F=X.trList[x].tdList.find(D=>D.tdIndex===T);if(F?.value.length){i.setPositionContext({isTable:!0,tableId:X.id,index:M,trIndex:x,tdIndex:T}),u=F.value.length-1,h=F.value.length-1;break}}}else i.setPositionContext({isTable:!1}),u=m-1,h=u,t.getTableTool().dispose();else{let S=-1,M=-1;const X=L[m].trList,x=X[f].tdList[T].colIndex;e:for(let V=f-1;V>=0;V--){const v=X[V].tdList;for(let b=0;b<v.length;b++){const P=v[b];if(P.colIndex===x||P.colIndex+P.colspan-1>=x&&P.colIndex<=x){S=V,M=b;break e}}}if(!~S||!~M)return;const F=X[S],D=F.tdList[M];i.setPositionContext({isTable:!0,index:m,trIndex:S,tdIndex:M,tdId:D.id,trId:F.id,tableId:I}),u=D.value.length-1,h=u}}else{const L=t.getOriginalElementList(),S=L[m],M=S.trList;if(f===M.length-1){const X=m+1,x=L[X];if(x&&[S.id,S.originalId].includes(x.originalId)){for(let D=T;D>=0;D--)if(x.trList[0].tdList[D].value.length){i.setPositionContext({isTable:!0,index:X,tableId:x.id,trIndex:0,tdIndex:D}),u=0,h=0;break}}else i.setPositionContext({isTable:!1}),u=m,h=u,t.getTableTool().dispose()}else{let X=-1,x=-1;const F=M[f].tdList[T].colIndex;e:for(let E=f+1;E<M.length;E++){const b=M[E].tdList;for(let P=0;P<b.length;P++){const y=b[P];if(y.colIndex===F||y.colIndex+y.colspan-1>=F&&y.colIndex<=F){X=E,x=P;break e}}}if(!~X||!~x)return;const D=M[X],V=D.tdList[x];i.setPositionContext({isTable:!0,index:m,trIndex:X,tdIndex:x,tdId:V.id,trId:D.id,tableId:I}),u=V.value.length-1,h=u}}}else{let m=r;o.shiftKey&&(l===r.index?m=c[a]:m=c[l]);const{index:f,rowNo:T,rowIndex:I,coordinate:{rightTop:[L]}}=m;if(d&&I===0||!d&&I===t.getRowCount()-1)return;const S=Ai({positionList:c,index:f,rowNo:T,isUp:d,cursorX:L});if(S<0)return;u=S,h=S,o.shiftKey&&(l!==a?l===r.index?u=l:h=a:d?h=a:u=l);const X=t.getElementList()[S];if(X.type===O.TABLE){const{scale:x}=t.getOptions(),F=t.getMargins(),D=X.trList;let V=-1,E=-1,v=-1;if(d)e:for(let b=D.length-1;b>=0;b--){const y=D[b].tdList;for(let N=0;N<y.length;N++){const U=y[N],w=U.x*x+F[3],Q=U.width*x;if(L>=w&&L<=w+Q){const K=U.positionList,z=K[K.length-1],$=Ai({positionList:K,index:z.index+1,rowNo:z.rowNo-1,isUp:d,cursorX:L})||z.index;V=b,E=N,v=$;break e}}}else e:for(let b=0;b<D.length;b++){const y=D[b].tdList;for(let N=0;N<y.length;N++){const U=y[N],w=U.x*x+F[3],Q=U.width*x;if(L>=w&&L<=w+Q){const K=U.positionList,z=Ai({positionList:K,index:-1,rowNo:-1,isUp:d,cursorX:L})||0;V=b,E=N,v=z;break e}}}if(~V&&~E&&~v){const b=D[V],P=b.tdList[E];i.setPositionContext({isTable:!0,index:S,trIndex:V,tdIndex:E,tdId:P.id,trId:b.id,tableId:X.id}),u=v,h=u,c=i.getPositionList()}}}if(!~u||!~h)return;u>h&&([u,h]=[h,u]),s.setRange(u,h);const g=u===h;t.render({curIndex:g?u:void 0,isSetCursor:g,isSubmitHistory:!1,isCompute:!1}),g||(t.getCursor().moveCursorToVisible({cursorPosition:c[d?u:h],direction:d?mt.UP:mt.DOWN}),t.updateTableTool())}function _d(o,e){if(e.isComposing)return;const t=e.getDraw();if(o.key===Te.Backspace)Vd(o,e);else if(o.key===Te.Delete)wd(o,e);else if(o.key===Te.Enter)Ud(o,e);else if(o.key===Te.Left)Zd(o,e);else if(o.key===Te.Right)Qd(o,e);else if(o.key===Te.Up||o.key===Te.Down)Hd(o,e);else if(on(o)&&o.key.toLocaleLowerCase()===Te.Z){if(t.isReadonly()&&t.getMode()!==B.FORM)return;t.getHistoryManager().undo(),o.preventDefault()}else if(on(o)&&o.key.toLocaleLowerCase()===Te.Y){if(t.isReadonly()&&t.getMode()!==B.FORM)return;t.getHistoryManager().redo(),o.preventDefault()}else if(on(o)&&o.key.toLocaleLowerCase()===Te.C)e.copy(),o.preventDefault();else if(on(o)&&o.key.toLocaleLowerCase()===Te.X)e.cut(),o.preventDefault();else if(on(o)&&o.key.toLocaleLowerCase()===Te.A)e.selectAll(),o.preventDefault();else if(on(o)&&o.key.toLocaleLowerCase()===Te.S){if(t.isReadonly())return;const n=t.getListener();n.saved&&n.saved(t.getValue());const i=t.getEventBus();i.isSubscribe("saved")&&i.emit("saved",t.getValue()),o.preventDefault()}else if(o.key===Te.ESC){e.clearPainterStyle();const n=t.getZone();n.isMainActive()||n.setZone(De.MAIN),o.preventDefault()}else o.key===Te.TAB&&Kd(o,e)}function Ad(o){return/[\u4e00-\u9fa5\u3000-\u303f\uff00-\uffef]/.test(o)}function kd(o){return/[a-zA-Z]/.test(o)}function Gd(o,e){return Ad(o)?e:kd(o)?"Times New Roman":e}function Jd(o){return o?.type===O.CONTROL&&(o.controlComponent===p.PREFIX||o.controlComponent===p.PRE_TEXT||o.controlComponent===p.PRETEXTFIX||o.controlComponent===p.PRETEXTFIX_TEXT)}function Bd(o){return o?.type===O.CONTROL&&(o.controlComponent===p.POSTFIX||o.controlComponent===p.POST_TEXT||o.controlComponent===p.POSTTEXTFIX||o.controlComponent===p.POSTTEXTFIX_TEXT)}function Rs(o,e){const t=e.getDraw(),n=t.getControl(),i=t.getElementList(),l=t.getPosition().getCursorPosition()?.index;if(t.isReadonly()||t.isDisabled())return;const c=t.getPosition().getCursorPosition();if(!o||!c)return;const d=e.isComposing;if(d&&e.compositionInfo?.value===o)return;const u=t.getRange();if(!u.getIsCanInput())return;if(t.getMode()===B.FORM){const se=n.getActiveTextControlLimit();if(!n.getActiveControl()||!n.getIsRangeWithinControl()&&!n.getIsRangeInPostfix())return;if(se){const pe=u.getRange();if(pe.startIndex<se.startIndex||pe.endIndex>se.endIndex){const H=Math.min(Math.max(pe.endIndex,se.startIndex),se.endIndex);u.setRange(H,H),t.render({curIndex:H,isSubmitHistory:!1});return}}const{endIndex:ie}=u.getRange(),Xe=t.getElementList(),ge=Xe[ie];if(!ge?.originControlId){if(ge?.controlId&&ge?.controlComponent===p.VALUE)for(let pe=ie;pe>=0;pe--){const H=Xe[pe];if(H.controlId!==ge.controlId||H.originControlId)break;if(H.control?.type===Y.TEXTFIELD)return}}}const R=u.getDefaultStyle()||e.compositionInfo?.defaultStyle||null,g=$d(e,t.getElementList());d||t.getCursor().clearAgentDomValue();const{TEXT:m,HYPERLINK:f,SUBSCRIPT:T,SUPERSCRIPT:I,DATE:L,TAB:S}=O,M=o.replaceAll(`
100
+ `,ee),{startIndex:X,endIndex:x}=u.getRange(),F=u.getRangeAnchorStyle(g,X);if(!F)return;const D=X>0?g[X-1]:null,V=!!(F.controlId||F.control),v={...!V&&D?D:F,...R},b=t.isDesignMode(),P=t.getOptions(),y=g[x+1],N=Jd(y)&&!y?.originControlId,U=Bd(F)&&!F.originControlId||F.type===O.CONTROL&&F.controlComponent===p.VALUE&&y?.type!==O.CONTROL&&!F.originControlId,w=N||U,Q=w?{...F,type:void 0,control:void 0,controlId:void 0,controlComponent:void 0,originControlId:void 0,color:P.defaultColor,highlight:void 0}:F,K=w||V?Q:v,z=be(M).map(se=>{const J={value:se};if(b||!K.title?.disabled&&!K.control?.disabled){const ie=g[x+1];(!K.type||K.type===m||K.type===f&&ie?.type===f||K.type===L&&ie?.type===L||K.type===T&&ie?.type===T||K.type===I&&ie?.type===I)&&Xc.forEach(Xe=>{if(Xe==="groupIds"&&!ie?.groupIds)return;const ge=K[Xe];ge!==void 0&&(J[Xe]=ge)}),(R||K.type===S)&&rn.forEach(Xe=>{const ge=R?.[Xe]||K[Xe];ge!==void 0&&(J[Xe]=ge)}),d&&(J.underline=!0)}if(!w){const ie=F.originControlId&&(F.controlComponent===p.POSTFIX||F.controlComponent===p.POSTTEXTFIX||F.controlComponent===p.POSTTEXTFIX_TEXT||F.controlComponent===p.POST_TEXT),Xe=!F.originControlId&&F.controlId&&(F.controlComponent===p.POSTFIX||F.controlComponent===p.POSTTEXTFIX||F.controlComponent===p.POSTTEXTFIX_TEXT||F.controlComponent===p.POST_TEXT)&&y?.controlId&&y.controlId!==F.controlId,ge=F.controlId&&F.originControlId&&(F.controlComponent===p.VALUE||F.controlComponent===p.PLACEHOLDER);if(ie&&!J.controlId){const pe=F.originControlId;let H=null;for(let te=X;te>=0;te--){const _=g[te];if(_.controlId===pe&&!_.originControlId&&_.control){H=_.control;break}}J.controlId=pe,J.controlComponent=p.VALUE,H&&(J.control=H)}else if(Xe&&!J.controlId){if(y?.controlId&&y.controlId!==F.controlId)if(y.controlComponent===p.PREFIX||y.controlComponent===p.PRETEXTFIX)for(let pe=X;pe>=0;pe--){const H=g[pe];if(H.controlId===F.controlId&&(H.controlComponent===p.PREFIX||H.controlComponent===p.PRETEXTFIX)){for(let te=pe-1;te>=0;te--){const _=g[te];if(_.controlId&&_.controlId!==F.controlId&&(_.controlComponent===p.PRETEXTFIX||_.controlComponent===p.PRETEXTFIX_TEXT||_.controlComponent===p.PREFIX||_.controlComponent===p.PRE_TEXT)){J.controlId=_.controlId,J.controlComponent=p.VALUE,_.control&&(J.control=_.control);break}if(_.controlId&&_.controlId!==F.controlId&&(_.controlComponent===p.POSTFIX||_.controlComponent===p.POSTTEXTFIX))break}break}}else(y.controlComponent===p.POSTFIX||y.controlComponent===p.POSTTEXTFIX)&&(J.controlId=y.controlId,J.controlComponent=p.VALUE,y.control&&(J.control=y.control));if(!J.controlId)for(let pe=X;pe>=0;pe--){const H=g[pe];if(H.controlId===F.controlId&&(H.controlComponent===p.PREFIX||H.controlComponent===p.PRETEXTFIX)){for(let te=pe-1;te>=0;te--){const _=g[te];if(_.controlId&&_.controlId!==F.controlId&&(_.controlComponent===p.PRETEXTFIX||_.controlComponent===p.PRETEXTFIX_TEXT||_.controlComponent===p.PREFIX||_.controlComponent===p.PRE_TEXT)){J.controlId=_.controlId,J.controlComponent=p.VALUE,_.control&&(J.control=_.control);break}if(_.controlId&&_.controlId!==F.controlId&&(_.controlComponent===p.POSTFIX||_.controlComponent===p.POSTTEXTFIX))break}break}}}else if(ge&&!J.controlId){const pe=F.controlId;let H=F.control;if(!H)for(let te=X;te>=0;te--){const _=g[te];if(_.controlId===pe&&_.control&&(H=_.control,_.controlComponent===p.PREFIX||_.controlComponent===p.PRETEXTFIX))break}J.controlId=pe,J.originControlId=F.originControlId,J.controlComponent=p.VALUE,H&&(J.control=H)}else if(F.controlId&&!F.originControlId){let pe=F.control;if(!pe)for(let H=X;H>=0;H--){const te=g[H];if(te.controlId===F.controlId&&!te.originControlId&&te.control){pe=te.control;break}}J.controlId||(J.controlId=F.controlId),pe&&!J.control&&(J.control=pe),J.controlComponent||(J.controlComponent=p.VALUE)}else if(!J.controlId&&!J.control&&y?.originControlId&&(y.controlComponent===p.PREFIX||y.controlComponent===p.PRETEXTFIX)){const pe=y.originControlId;let H=null;for(let te=x;te>=0;te--){const _=g[te];if(_.controlId===pe&&!_.originControlId&&_.control){H=_.control;break}}J.controlId=pe,J.controlComponent=p.VALUE,H&&(J.control=H)}}if(se&&se!==ee){const ie=Gd(se,P.defaultFont);J.font=ie}return J});let $;const le=i[l],Pe=i[l+1];if(d)$=X;else{const se=ie=>{if(z?.length)for(let Xe=0;Xe<z.length;Xe++)g.splice(ie+Xe,0,z[Xe]);return X+z.length},J=X+1;if(X!==x&&(t.removeSplitTdOtherRangeElements(),t.spliceElementList(g,J,x-X)),w)$=se(J);else if(le?.originControlId&&(le?.controlComponent==="postfix"||le?.controlComponent==="postTextFix"))$=se(J);else if((le?.control?.type===Y.NUMBER||Pe?.control?.type===Y.NUMBER)&&n.getActiveControl()?.getElement()?.control?.type===Y.NUMBER&&n.getIsRangeWithinControl()){const ie=n.getActiveControl();ie&&typeof ie.awake=="function"&&ie.awake(),$=X}else if((le?.control?.type===Y.SELECT||Pe?.control?.type===Y.SELECT)&&n.getActiveControl()?.getElement()?.control?.type===Y.SELECT&&n.getIsRangeWithinControl()){const ie=n.getActiveControl();ie&&typeof ie.awake=="function"&&ie.awake(),$=X}else le?.control?.type==="button"||Pe?.control?.type==="button"?(le?.control||Pe?.control)?.buttonText?$=X:n.getActiveControl()&&n.getIsRangeWithinControl()?(n.removePlaceholder(X,{elementList:g}),$=n.setValue(z),n.emitControlContentChange()):$=X:n.getActiveControl()&&n.getIsRangeWithinControl()?(n.removePlaceholder(X,{elementList:g}),$=n.setValue(z),n.emitControlContentChange()):(le?.type==="control"||Pe?.type==="control")&&!w?$=se(J):(ze(g,z,X,{editorOptions:P}),t.spliceElementList(g,J,0,z),$=X+z.length)}~$&&!d&&(u.setRange($,$),t.render({curIndex:$,isSubmitHistory:!d})),d&&(e.compositionInfo={value:M,startIndex:$,endIndex:x,defaultStyle:R})}function zd(o){o.compositionInfo&&(o.compositionInfo=null)}function $d(o,e){if(!o.compositionInfo||o.isComposing)return e;const{startIndex:t,endIndex:n}=o.compositionInfo;return t!==n&&(o.getDraw().removeSplitTdOtherRangeElements(),o.getDraw().spliceElementList(e,t+1,n-t),o.getDraw().getRange().setRange(t,t)),o.compositionInfo=null,e}async function qd(o){const e=o.getDraw(),t=e.getRange(),{startIndex:n,endIndex:i}=t.getRange();if(!~n&&!~n||e.isReadonly()||!t.getIsCanInput())return;const r=e.getElementList();let s=n,l=i;if(n===i){const h=e.getPosition().getPositionList(),R=h[n],g=R.rowNo,m=R.pageNo,f=[];for(let I=0;I<h.length;I++){const L=h[I];if(L.pageNo>m)break;L.pageNo===m&&L.rowNo===g&&f.push(I)}const T=f[0]-1;s=T<0?0:T,l=f[f.length-1]}const a=e.getOptions();await Dl(r.slice(s+1,l+1),a);const c=e.getControl();let d;c.getActiveControl()&&c.getIsRangeWithinControl()?(d=c.cut(),c.emitControlContentChange()):(e.spliceElementList(r,s+1,l-s),d=s),t.setRange(d,d),e.render({curIndex:d})}async function jd(o,e){const t=o.getDraw(),{copy:n}=t.getOverride();if(n&&n()?.preventDefault!==!1)return;const i=t.getRange();let r=null;if(i.getRange().isCrossRowCol){const l=i.getRangeTableElement();if(!l)return;const a=t.getTableParticle().getRangeRowCol();if(!a)return;const c={type:O.TABLE,value:"",colgroup:[],trList:[]},d=a[0],u=d[0].colIndex,h=d[d.length-1],R=h.colIndex+h.colspan-1;for(let g=u;g<=R;g++)c.colgroup.push(l.colgroup[g]);for(let g=0;g<a.length;g++){const m=a[g],f=l.trList[m[0].rowIndex],T={tdList:[],height:f.height,minHeight:f.minHeight};for(let I=0;I<m.length;I++)T.tdList.push(m[I]);c.trList.push(T)}r=Ge([c])}else r=i.getIsCollapsed()?i.getRangeRowElementList():i.getSelectionElementList();e?.isPlainText&&r?.length&&(r=[{value:Oo(r)}]),r?.length&&await Dl(r,t.getOptions())}function eu(o,e){const t=e.getDraw(),{drop:n}=t.getOverride();if(n&&n(o)?.preventDefault!==!1)return;o.preventDefault();const i=o.dataTransfer?.getData("text");if(i)e.input(i);else{const r=o.dataTransfer?.files;if(!r)return;for(let s=0;s<r.length;s++){const l=r[s];l.type.startsWith("image")&&Ws(e,l)}}}function Yl(o){if(!Intl.Segmenter)return null;const e=o.getDraw(),t=e.getPosition().getCursorPosition();if(!t)return null;const i=e.getRange().getRangeParagraphInfo();if(!i)return null;const r=i?.elementList?.map(h=>!h.type||h.type!==O.CONTROL&&wt.includes(h.type)?h.value:ee).join("")||"";if(!r)return null;const s=t.isFirstLetter||e.getCursor().getHitLineStartIndex()?t.index+1:t.index,l=i.startIndex,c=new Intl.Segmenter(void 0,{granularity:"word"}).segment(r);let d=-1,u=-1;for(const{segment:h,index:R,isWordLike:g}of c){const m=R+l;if(g&&s>=m&&s<m+h.length){d=m-1,u=d+h.length;break}}return~d&&~u?{startIndex:d,endIndex:u}:null}function tu(o){const e=o.getDraw(),t=e.getPosition().getCursorPosition();if(!t)return null;const{value:n,index:i}=t,r=e.getLetterReg();let s=0,l=0;const a=Qi.test(n);if(a||r.test(n)){const d=e.getElementList();let u=i-1;for(;u>0;){const R=d[u].value;if(a&&Qi.test(R)||!a&&r.test(R))s++,u--;else break}let h=i+1;for(;h<d.length;){const R=d[h].value;if(a&&Qi.test(R)||!a&&r.test(R))l++,h++;else break}}const c=i-s-1;return c<0?null:{startIndex:c,endIndex:i+l}}function nu(o,e){const t=o.getDraw(),n=t.getPosition(),i=n.getPositionByXY({x:e.offsetX,y:e.offsetY});if(i.isImage&&i.isDirectHit){const l=t.getElementList(),a=t.getEventBus(),c=l[i.index];if(a.isSubscribe("imageDblclick")&&a.emit("imageDblclick",{evt:e,element:c}),c.imgPreviewDisabled)return;t.getPreviewer().render();return}if(t.getIsPagingMode()&&!~i.index&&i.zone){t.getZone().setZone(i.zone),t.clearSideEffect(),n.setPositionContext({isTable:!1});return}if((i.isCheckbox||i.isRadio)&&i.isDirectHit)return;const r=t.getRange(),s=Yl(o)||tu(o);s&&(r.setRange(s.startIndex,s.endIndex),t.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),r.setRangeStyle())}function ou(o){const e=o.getDraw(),t=e.getControl();if(t.getActiveControl()&&t.selectValue())return;const i=e.getPosition().getCursorPosition();if(!i)return;const{index:r}=i,s=e.getElementList();let l=0,a=0,c=r-1;for(;c>0;){const g=s[c],m=s[c-1];if(g.value===ee&&!g.listWrap||g.listId!==m?.listId||g.titleId!==m?.titleId)break;l++,c--}let d=r+1;for(;d<s.length;){const g=s[d],m=s[d+1];if(g.value===ee&&!g.listWrap||g.listId!==m?.listId||g.titleId!==m?.titleId)break;a++,d++}const u=e.getRange();let h=r-l-1;if(s[h]?.value!==ee&&(h-=1),h<0)return;let R=r+a+1;(s[R]?.value===ee||R>s.length-1)&&(R-=1),u.setRange(h,R),e.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}const Zr={dblclick:nu,threeClick:ou};function iu(o){o.isComposing=!0}function su(o,e){o.isComposing=!1;const t=o.getDraw();if(e.data)Mc?setTimeout(()=>{o.compositionInfo&&Rs(e.data,o)},1):o.compositionInfo&&Rs(e.data,o);else{const i=o.compositionInfo?.cancel;if(zd(o),!i){const r=t.getRange(),{endIndex:s}=r.getRange();t.render({curIndex:s,isSubmitHistory:!1})}}t.getCursor().clearAgentDomValue()}function ru(o){o.compositionInfo&&(o.compositionInfo.cancel=!0)}const ki={compositionstart:iu,compositionend:su,compositionCancel:ru};function lu(o,e){const t=e.getDraw();if(t.isReadonly())return;o.preventDefault();const i=t.getPageContainer();if(!es(o.target,L=>L===i))return;const l=o.target.dataset.index;l&&t.setPageNo(Number(l));const a=t.getPosition(),c=a.adjustPositionContext({x:o.offsetX,y:o.offsetY});if(!c)return;const{isTable:d,tdValueIndex:u,index:h}=c,R=a.getPositionList(),g=d?u:h;~h&&(t.getRange().setRange(g,g),a.setCursorPosition(R[g]));const m=t.getCursor(),{cursor:{dragColor:f,dragWidth:T,dragFloatImageDisabled:I}}=t.getOptions();if(I){const L=e.cacheElementList?.[e.cacheRange.startIndex];if(L?.type===O.IMAGE&&(L.imgDisplay===Ne.FLOAT_TOP||L.imgDisplay===Ne.FLOAT_BOTTOM||L.imgDisplay===Ne.SURROUND))return}m.drawCursor({width:T,color:f,isBlink:!1,isFocus:!1})}const au={dragover:lu};class cu{isAllowSelection;isComposing;compositionInfo;isAllowDrag;isAllowDrop;cacheRange;cacheElementList;cachePositionList;cachePositionContext;mouseDownStartPosition;draw;pageContainer;pageList;range;position;constructor(e){this.draw=e,this.pageContainer=e.getPageContainer(),this.pageList=e.getPageList(),this.range=this.draw.getRange(),this.position=this.draw.getPosition(),this.isAllowSelection=!1,this.isComposing=!1,this.compositionInfo=null,this.isAllowDrag=!1,this.isAllowDrop=!1,this.cacheRange=null,this.cacheElementList=null,this.cachePositionList=null,this.cachePositionContext=null,this.mouseDownStartPosition=null}getDraw(){return this.draw}register(){this.pageContainer.addEventListener("click",this.click.bind(this)),this.pageContainer.addEventListener("mousedown",this.mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this.mouseup.bind(this)),this.pageContainer.addEventListener("mouseleave",this.mouseleave.bind(this)),this.pageContainer.addEventListener("mousemove",this.mousemove.bind(this)),this.pageContainer.addEventListener("dblclick",this.dblclick.bind(this)),this.pageContainer.addEventListener("dragover",this.dragover.bind(this)),this.pageContainer.addEventListener("drop",this.drop.bind(this)),hc(this.pageContainer,this.threeClick.bind(this))}setIsAllowSelection(e){this.isAllowSelection=e,e||this.applyPainterStyle()}setIsAllowDrag(e){this.isAllowDrag=e,this.isAllowDrop=e}clearPainterStyle(){this.pageList.forEach(e=>{e.style.cursor="text"}),this.draw.setPainterStyle(null)}applyPainterStyle(){const e=this.draw.getPainterStyle();if(!e||this.draw.isReadonly()||this.draw.isDisabled())return;let n=this.range.getSelection();if(!n){const s=Yl(this);s&&(n=this.draw.getElementList().slice(s.startIndex+1,s.endIndex+1))}if(!n)return;const i=Object.keys(e);n.forEach(s=>{i.forEach(l=>{const a=l;Reflect.set(s,a,e[a])})}),this.draw.render({isSetCursor:!1});const r=this.draw.getPainterOptions();(!r||!r.isDblclick)&&this.clearPainterStyle()}selectAll(){if(this.position.getPositionContext().isTable)this.draw.getTableOperate().tableSelectAll();else{const e=this.position.getPositionList();this.range.setRange(0,e.length-1),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1})}}mousemove(e){vd(e,this)}mousedown(e){bd(e,this)}click(){Oc&&!this.draw.isReadonly()&&this.draw.getCursor().getAgentDom().focus()}mouseup(e){yd(e,this)}mouseleave(e){xd(e,this)}keydown(e){_d(e,this)}dblclick(e){Zr.dblclick(this,e)}threeClick(){Zr.threeClick(this)}input(e){Rs(e,this)}async cut(){await qd(this)}async copy(e){await jd(this,e)}compositionstart(){ki.compositionstart(this)}compositionend(e){ki.compositionend(this,e)}compositionCancel(){ki.compositionCancel(this)}drop(e){eu(e,this)}dragover(e){au.dragover(e,this)}}const du={PAGE_SCALE:"pageScale"};class uu{draw;options;cursor;canvasEvent;range;previewer;tableTool;hyperlinkParticle;control;dateParticle;imageParticle;dprMediaQueryList;constructor(e,t){this.draw=e,this.options=e.getOptions(),this.canvasEvent=t,this.cursor=null,this.range=e.getRange(),this.previewer=e.getPreviewer(),this.tableTool=e.getTableTool(),this.hyperlinkParticle=e.getHyperlinkParticle(),this.dateParticle=e.getDateParticle(),this.imageParticle=e.getImageParticle(),this.control=e.getControl(),this.dprMediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`)}register(){this.cursor=this.draw.getCursor(),this.addEvent()}addEvent(){window.addEventListener("blur",this.clearSideEffect),document.addEventListener("mousedown",this.clearSideEffect),document.addEventListener("mouseup",this.setCanvasEventAbility),document.addEventListener("wheel",this.setPageScale,{passive:!1}),document.addEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.addEventListener("change",this._handleDprChange)}removeEvent(){window.removeEventListener("blur",this.clearSideEffect),document.removeEventListener("mousedown",this.clearSideEffect),document.removeEventListener("mouseup",this.setCanvasEventAbility),document.removeEventListener("wheel",this.setPageScale),document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.dprMediaQueryList.removeEventListener("change",this._handleDprChange)}clearSideEffect=e=>{if(!this.cursor)return;const t=e?.composedPath()[0]||e.target,n=this.draw.getPageList();if(es(t,s=>n.includes(s)))return;if(es(t,s=>!!s&&s.nodeType===1&&!!s.getAttribute(Rt))){this.watchCursorActive();return}this.cursor.recoveryCursor(),this.range.recoveryRangeStyle(),this.previewer.clearResizer(),this.tableTool.dispose(),this.hyperlinkParticle.clearHyperlinkPopup(),this.control.destroyControl(),this.dateParticle.clearDatePicker(),this.imageParticle.destroyFloatImage()};setCanvasEventAbility=()=>{this.canvasEvent.setIsAllowDrag(!1),this.canvasEvent.setIsAllowSelection(!1)};watchCursorActive(){this.range.getIsCollapsed()&&setTimeout(()=>{this.cursor?.getAgentIsActive()||this.cursor?.drawCursor({isFocus:!1,isBlink:!1})})}setPageScale=e=>{if(this.options.shortcutDisableKeys.includes(du.PAGE_SCALE)||!e.ctrlKey)return;e.preventDefault();const{scale:t}=this.options;if(e.deltaY<0){const n=t*10+1;n<=30&&this.draw.setPageScale(n/10)}else{const n=t*10-1;n>=5&&this.draw.setPageScale(n/10)}};_handleVisibilityChange=()=>{if(document.visibilityState==="visible"){const e=this.range.getRange(),t=!!~e.startIndex&&!!~e.endIndex&&e.startIndex===e.endIndex;this.range.replaceRange(e),this.draw.render({isSetCursor:t,isCompute:!1,isSubmitHistory:!1,curIndex:e.startIndex})}};_handleDprChange=()=>{this.draw.setPageDevicePixel()}}class hu{undoStack=[];redoStack=[];maxRecordCount;constructor(e){this.maxRecordCount=e.getOptions().historyMaxRecordCount+1}undo(){if(this.undoStack.length>1){const e=this.undoStack.pop();this.redoStack.push(e),this.undoStack.length&&this.undoStack[this.undoStack.length-1]()}}redo(){if(this.redoStack.length){const e=this.redoStack.pop();this.undoStack.push(e),e()}}execute(e){for(this.undoStack.push(e),this.redoStack.length&&(this.redoStack=[]);this.undoStack.length>this.maxRecordCount;)this.undoStack.shift()}isCanUndo(){return this.undoStack.length>1}isCanRedo(){return!!this.redoStack.length}isStackEmpty(){return!this.undoStack.length&&!this.redoStack.length}recovery(){this.undoStack=[],this.redoStack=[]}popUndo(){return this.undoStack.pop()}}class Ru{cursorPosition;positionContext;positionList;floatPositionList;draw;eventBus;options;constructor(e){this.positionList=[],this.floatPositionList=[],this.cursorPosition=null,this.positionContext={isTable:!1,isControl:!1},this.draw=e,this.eventBus=e.getEventBus(),this.options=e.getOptions()}getFloatPositionList(){return this.floatPositionList}getTablePositionList(e){const{index:t,trIndex:n,tdIndex:i}=this.positionContext;return e[t].trList[n].tdList[i].positionList||[]}getPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalElementList()):this.getOriginalPositionList()}getMainPositionList(){return this.positionContext.isTable?this.getTablePositionList(this.draw.getOriginalMainElementList()):this.positionList}getOriginalPositionList(){const e=this.draw.getZone();return e.isHeaderActive()?this.draw.getHeader().getPositionList():e.isFooterActive()?this.draw.getFooter().getPositionList():this.positionList}getOriginalMainPositionList(){return this.positionList}getSelectionPositionList(){const{startIndex:e,endIndex:t}=this.draw.getRange().getRange();return e===t?null:this.getPositionList().slice(e+1,t+1)}setPositionList(e){this.positionList=e}setFloatPositionList(e){this.floatPositionList=e}computePageRowPosition(e){const{positionList:t,rowList:n,pageNo:i,startX:r,startY:s,startRowIndex:l,startIndex:a,innerWidth:c,zone:d}=e,{scale:u,table:{tdPadding:h}}=this.options;let R=r,g=s,m=a;for(let f=0;f<n.length;f++){const T=n[f];if(!T.isSurround){const S=T.width+(T.offsetX||0);T.rowFlex===Qe.CENTER?R+=(c-S)/2:T.rowFlex===Qe.RIGHT&&(R+=c-S)}R+=T.offsetX||0,g+=T.offsetY||0;const I=R,L=g;for(let S=0;S<T.elementList.length;S++){const M=T.elementList[S],X=M.metrics,x=!M.hide&&(M.imgDisplay!==Ne.INLINE&&M.type===O.IMAGE||M.type===O.LATEX)?T.ascent-X.height:T.ascent;M.left&&(R+=M.left),M.translateX&&(R+=M.translateX*u);const F={pageNo:i,index:m,value:M.value,rowIndex:l+f,rowNo:f,metrics:X,left:M.left||0,ascent:x,lineHeight:T.height,isFirstLetter:S===0,isLastLetter:S===T.elementList.length-1,coordinate:{leftTop:[R,g],leftBottom:[R,g+T.height],rightTop:[R+X.width,g],rightBottom:[R+X.width,g+T.height]}};if(M.imgDisplay===Ne.SURROUND||M.imgDisplay===Ne.FLOAT_TOP||M.imgDisplay===Ne.FLOAT_BOTTOM){const D=t[t.length-1];D&&(F.metrics=D.metrics,F.coordinate=D.coordinate),M.imgFloatPosition||(M.imgFloatPosition={x:R,y:g,pageNo:i}),this.floatPositionList.push({pageNo:i,element:M,position:F,isTable:e.isTable,index:e.index,tdIndex:e.tdIndex,trIndex:e.trIndex,tdValueIndex:m,zone:d})}if(t.push(F),m++,R+=X.width,M.type===O.TABLE&&!M.hide){const D=M.tdPadding||h,V=D[1]+D[3],E=D[0]+D[2];for(let v=0;v<M.trList.length;v++){const b=M.trList[v];for(let P=0;P<b.tdList.length;P++){const y=b.tdList[P];y.positionList=[];const N=y.rowList,U=this.computePageRowPosition({positionList:y.positionList,rowList:N,pageNo:i,startRowIndex:0,startIndex:0,startX:(y.x+D[3])*u+I+(M.translateX||0)*u,startY:(y.y+D[0])*u+L,innerWidth:(y.width-V)*u,isTable:!0,index:m-1,tdIndex:P,trIndex:v,zone:d});if(y.verticalAlign===Tt.MIDDLE||y.verticalAlign===Tt.BOTTOM){const w=N.reduce((z,$)=>z+$.height,0),Q=(y.height-E)*u-w,K=y.verticalAlign===Tt.MIDDLE?Q/2:Q;Math.floor(K)>0&&y.positionList.forEach(z=>{const{coordinate:{leftTop:$,leftBottom:le,rightBottom:Pe,rightTop:se}}=z;$[1]+=K,le[1]+=K,Pe[1]+=K,se[1]+=K})}R=U.x,g=U.y}}R=I,g=L}}R=r,g+=T.height}return{x:R,y:g,index:m}}computePositionList(){this.positionList=[];const e=this.draw.getInnerWidth(),t=this.draw.getPageRowList(),n=this.draw.getMargins(),i=n[3],s=this.draw.getHeader().getExtraHeight(),l=n[0]+s;let a=0;for(let c=0;c<t.length;c++){const d=t[c];if(!d?.length)continue;const u=d[0].startIndex;this.computePageRowPosition({positionList:this.positionList,rowList:d,pageNo:c,startRowIndex:a,startIndex:u,startX:i,startY:l,innerWidth:e}),a+=d.length}}computeRowPosition(e){const{row:t,innerWidth:n}=e,i=[];return this.computePageRowPosition({positionList:i,innerWidth:n,rowList:[xe(t)],pageNo:0,startX:0,startY:0,startIndex:0,startRowIndex:0}),i}setCursorPosition(e){this.cursorPosition=e}getCursorPosition(){return this.cursorPosition}getPositionContext(){return this.positionContext}setPositionContext(e){this.eventBus.emit("positionContextChange",{value:e,oldValue:this.positionContext}),this.positionContext=e}getPositionByXY(e){const{x:t,y:n,isTable:i}=e;let{elementList:r,positionList:s}=e;r||(r=this.draw.getOriginalElementList()),s||(s=this.getOriginalPositionList());const l=this.draw.getZone(),a=e.pageNo??this.draw.getPageNo(),c=l.isMainActive(),d=c?a:0;if(!i){const m=this.getFloatPositionByXY({...e,imgDisplays:[Ne.FLOAT_TOP,Ne.SURROUND]});if(m)return m}for(let m=0;m<s.length;m++){const{index:f,pageNo:T,left:I,isFirstLetter:L,coordinate:{leftTop:S,rightTop:M,leftBottom:X}}=s[m];if(d===T){if(T>d)break;if(S[0]-I<=t&&M[0]>=t&&S[1]<=n&&X[1]>=n){let x=m;const F=r[m];if(F.type===O.TABLE)for(let V=0;V<F.trList.length;V++){const E=F.trList[V];for(let v=0;v<E.tdList.length;v++){const b=E.tdList[v],P=this.getPositionByXY({x:t,y:n,td:b,pageNo:a,tablePosition:s[m],isTable:!0,elementList:b.value,positionList:b.positionList});if(~P.index){const{index:y,hitLineStartIndex:N}=P,U=b.value[y];return{index:f,isCheckbox:P.isCheckbox||U.type===O.CHECKBOX||U.controlComponent===p.CHECKBOX,isRadio:U.type===O.RADIO||U.controlComponent===p.RADIO,isControl:!!U.controlId,isImage:P.isImage,isLabel:P.isLabel,isMacro:P.isMacro,isDirectHit:P.isDirectHit,isTable:!0,tdIndex:v,trIndex:V,tdValueIndex:y,tdId:b.id,trId:E.id,tableId:F.id,hitLineStartIndex:N}}}}if(F.type===O.IMAGE||F.type===O.LATEX)return{index:x,isDirectHit:!0,isImage:!0};if(F.type===O.MENSTRUAL_HISTORY)return{index:x,isDirectHit:!0};if(F.type===O.FETAL_HEART_POSITION)return{index:x,isDirectHit:!0};if(F.type===O.TOOTH_POSITION){const{scale:V}=this.options,E=F.width*V;return t>=S[0]&&t<=S[0]+E?{index:x,isDirectHit:!0}:{index:x}}if(F.type===O.CHECKBOX||F.controlComponent===p.CHECKBOX)return{index:x,isDirectHit:!0,isCheckbox:!0};if(F.type===O.LABEL)return{index:x,isDirectHit:!0,isLabel:!0};if(F.type===O.MACRO||F.type===O.CUSTOM_MACRO||F.type===O.REUSABLE_ITEM)return{index:x,isDirectHit:!0,isMacro:!0};if(F.type===O.TAB&&F.listStyle===Nt.CHECKBOX){let V=x-1;for(;V>0;){const E=r[V];if(E.value===ee&&E.listStyle===Nt.CHECKBOX)break;V--}return{index:V,isDirectHit:!0,isCheckbox:!0}}if(F.type===O.RADIO||F.controlComponent===p.RADIO)return{index:x,isDirectHit:!0,isRadio:!0};let D;if(r[f].value!==ee){const V=M[0]-S[0];t<S[0]+V/2&&(x=m-1,L&&(D=m))}return{isDirectHit:!0,hitLineStartIndex:D,index:x,isControl:!!F.controlId}}}}if(!i){const m=this.getFloatPositionByXY({...e,imgDisplays:[Ne.FLOAT_BOTTOM]});if(m)return m}let u=!1,h=-1,R;if(i){const{scale:m}=this.options,{td:f,tablePosition:T}=e;if(f&&T){const{leftTop:I}=T.coordinate,L=f.x*m+I[0],S=f.y*m+I[1],M=f.width*m,X=f.height*m;if(!(L<t&&t<L+M&&S<n&&n<S+X))return{index:h}}}const g=s.filter(m=>m.isLastLetter&&m.pageNo===d);for(let m=0;m<g.length;m++){const{index:f,rowNo:T,coordinate:{leftTop:I,leftBottom:L}}=g[m];if(n>I[1]&&n<=L[1]){const S=s.findIndex(F=>F.pageNo===d&&F.rowNo===T),M=r[S],X=s[S],x=M.listStyle===Nt.CHECKBOX?this.draw.getMargins()[3]:X.coordinate.leftTop[0];if(t<x)~S?X.value===ee?h=S:(h=S-1,R=S):h=f;else{if(M.listStyle===Nt.CHECKBOX&&t<I[0])return{index:S,isDirectHit:!0,isCheckbox:!0};h=f}u=!0;break}}if(!u){if(this.draw.getIsPagingMode()){const f=this.draw.getHeader(),T=f.getHeight(),I=f.getHeaderTop()+T,L=this.draw.getFooter(),M=this.draw.getHeight()-(L.getFooterBottom()+L.getHeight());if(c){if(n<I)return{index:-1,zone:De.HEADER};if(n>M)return{index:-1,zone:De.FOOTER}}else if(n<=M&&n>=I)return{index:-1,zone:De.MAIN}}const m=this.draw.getMargins();if(n<=m[0])for(let f=0;f<s.length;f++){const T=s[f];if(T.pageNo!==d||T.rowNo!==0)continue;const{leftTop:I,rightTop:L}=T.coordinate;if(t<=m[3]||t>=I[0]&&t<=L[0]||s[f+1]?.rowNo!==0)return{index:T.index}}else{const f=g[g.length-1];if(f){const T=f.rowNo;for(let I=0;I<s.length;I++){const L=s[I];if(L.pageNo!==d||L.rowNo!==T)continue;const{leftTop:S,rightTop:M}=L.coordinate;if(t<=m[3]||t>=S[0]&&t<=M[0]||s[I+1]?.rowNo!==T)return{index:L.index}}}}return{index:g[g.length-1]?.index||s.length-1}}return{hitLineStartIndex:R,index:h,isControl:!!r[h]?.controlId}}getFloatPositionByXY(e){const{x:t,y:n}=e,i=e.pageNo??this.draw.getPageNo(),r=this.draw.getZone().getZone(),{scale:s}=this.options;for(let l=0;l<this.floatPositionList.length;l++){const{position:a,element:c,isTable:d,index:u,trIndex:h,tdIndex:R,tdValueIndex:g,zone:m,pageNo:f}=this.floatPositionList[l];if(i===f&&c.type===O.IMAGE&&c.imgDisplay&&e.imgDisplays.includes(c.imgDisplay)&&(!m||m===r)){const T=c.imgFloatPosition,I=T.x*s,L=T.y*s,S=c.width*s,M=c.height*s;if(t>=I&&t<=I+S&&n>=L&&n<=L+M)return d?{index:u,isDirectHit:!0,isImage:!0,isTable:d,trIndex:h,tdIndex:R,tdValueIndex:g,tdId:c.tdId,trId:c.trId,tableId:c.tableId}:{index:a.index,isDirectHit:!0,isImage:!0}}}}adjustPositionContext(e){const t=this.getPositionByXY(e);if(!~t.index)return null;if(t.isControl&&this.draw.getMode()!==B.READONLY){const{index:f,isTable:T,trIndex:I,tdIndex:L,tdValueIndex:S}=t,M=this.draw.getControl(),{newIndex:X}=M.moveCursor({index:f,isTable:T,trIndex:I,tdIndex:L,tdValueIndex:S});T?t.tdValueIndex=X:t.index=X}const{index:n,isCheckbox:i,isRadio:r,isControl:s,isImage:l,isLabel:a,isDirectHit:c,isTable:d,trIndex:u,tdIndex:h,tdId:R,trId:g,tableId:m}=t;return this.setPositionContext({isTable:d||!1,isCheckbox:i||!1,isRadio:r||!1,isControl:s||!1,isImage:l||!1,isLabel:a||!1,isDirectHit:c||!1,index:n,trIndex:u,tdIndex:h,tdId:R,trId:g,tableId:m}),t}setSurroundPosition(e){const{scale:t}=this.options,{pageNo:n,row:i,rowElement:r,rowElementRect:s,surroundElementList:l,availableWidth:a}=e;let c=s.x,d=0;if(l.length&&!io(r)&&!r.control?.minWidth)for(let u=0;u<l.length;u++){const h=l[u],R=h.imgFloatPosition;if(R.pageNo!==n)continue;const g={...R,x:R.x*t,y:R.y*t,width:h.width*t,height:h.height*t};if(Lc(s,g)){i.isSurround=!0;const m=g.width+g.x-s.x;if(r.left=m,i.width+=m,d+=m,c=g.x+g.width,i.width+r.metrics.width>a){r.left=0,i.width-=d;break}}}return{x:c,rowIncreaseWidth:d}}}class gu{draw;options;range;listener;eventBus;position;historyManager;defaultStyle;constructor(e){this.draw=e,this.options=e.getOptions(),this.listener=e.getListener(),this.eventBus=e.getEventBus(),this.position=e.getPosition(),this.historyManager=e.getHistoryManager(),this.range={startIndex:-1,endIndex:-1},this.defaultStyle=null}getRange(){return this.range}clearRange(){this.setRange(-1,-1)}setDefaultStyle(e){e?this.defaultStyle={...this.defaultStyle,...e}:this.defaultStyle=null}getDefaultStyle(){return this.defaultStyle}getRangeAnchorStyle(e,t){const n=jn(e,t);return n?{...n,...this.defaultStyle}:null}getIsRangeChange(e,t,n,i,r,s,l){return this.range.startIndex!==e||this.range.endIndex!==t||this.range.tableId!==n||this.range.startTdIndex!==i||this.range.endTdIndex!==r||this.range.startTrIndex!==s||this.range.endTrIndex!==l}getIsCollapsed(){const{startIndex:e,endIndex:t}=this.range;return e===t}getIsSelection(){const{startIndex:e,endIndex:t}=this.range;return!~e&&!~t?!1:e!==t}getSelection(){const{startIndex:e,endIndex:t,splitTdRange:n}=this.range;if(e===t)return null;if(n)return this.draw.getSplitTdValues(n.originalId).slice(n.startIndex+1,n.endIndex+1);const i=this.draw.getElementList();return i.slice(i[e]?.value===ee?e:e+1,t+1)}getSelectionElementList(){if(this.range.isCrossRowCol){const e=this.draw.getTableParticle().getRangeRowCol();if(!e)return null;const t=[];for(let n=0;n<e.length;n++){const i=e[n];for(let r=0;r<i.length;r++){const s=i[r];t.push(...s.value)}}return t}return this.getSelection()}getTextLikeSelection(){const e=this.getSelection();return e?e.filter(t=>!t.type||wt.includes(t.type)):null}getTextLikeSelectionElementList(){const e=this.getSelectionElementList();return e?e.filter(t=>!t.type||wt.includes(t.type)):null}getRangeRow(){const{startIndex:e,endIndex:t}=this.range;if(!~e&&!~t)return null;const n=this.position.getPositionList(),i=new Map;for(let r=e;r<t+1;r++){const{pageNo:s,rowNo:l}=n[r],a=i.get(s);a?a.has(l)||a.add(l):i.set(s,new Set([l]))}return i}getRangeRowElementList(){const{startIndex:e,endIndex:t,isCrossRowCol:n}=this.range;if(!~e&&!~t)return null;if(n)return this.getSelectionElementList();const i=this.getRangeRow();if(!i)return null;const r=this.position.getPositionList(),s=this.draw.getElementList(),l=[];for(let a=0;a<r.length;a++){const c=r[a],d=i.get(c.pageNo);d&&d.has(c.rowNo)&&l.push(s[a])}return l}getRangeParagraph(){const{startIndex:e,endIndex:t}=this.range;if(!~e&&!~t)return null;const n=this.position.getPositionList(),i=this.draw.getElementList(),r=new Map;let s=e;for(;s>=0;){const{pageNo:c,rowNo:d}=n[s];let u=r.get(c);u||(u=[],r.set(c,u)),u.includes(d)||u.unshift(d);const h=i[s],R=i[s-1];if(h.value===ee&&!h.listWrap||h.listId!==R?.listId||h.titleId!==R?.titleId)break;s--}const l=e===t;if(!l){let c=e+1;for(;c<t;){const{pageNo:d,rowNo:u}=n[c];let h=r.get(d);h||(h=[],r.set(d,h)),h.includes(u)||h.push(u),c++}}let a=t;for(l&&i[e].value===ee&&(a+=1);a<n.length;){const c=i[a],d=i[a+1];if(c.value===ee&&!c.listWrap||c.listId!==d?.listId||c.titleId!==d?.titleId)break;const{pageNo:u,rowNo:h}=n[a];let R=r.get(u);R||(R=[],r.set(u,R)),R.includes(h)||R.push(h),a++}return r}getRangeParagraphInfo(){const{startIndex:e,endIndex:t}=this.range;if(!~e&&!~t)return null;let n=-1;const i=[],r=this.getRangeParagraph();if(!r)return null;const s=this.draw.getElementList(),l=this.position.getPositionList();for(let a=0;a<l.length;a++){const c=l[a],d=r.get(c.pageNo);d&&d.includes(c.rowNo)&&(~n||(n=c.index),i.push(s[a]))}return i.length?{elementList:i,startIndex:n}:null}getRangeParagraphElementList(){return this.getRangeParagraphInfo()?.elementList||null}getRangeTableElement(){const e=this.position.getPositionContext();return e.isTable?this.draw.getOriginalElementList()[e.index]:null}getIsSelectAll(){const e=this.draw.getElementList(),{startIndex:t,endIndex:n}=this.range;return t===0&&e.length-1===n&&!this.position.getPositionContext().isTable}getIsPointInRange(e,t,n){const{startIndex:i,endIndex:r}=this.range,s=this.position.getPositionList();for(let l=i+1;l<=r&&s[l];l++){const{coordinate:{leftTop:c,rightBottom:d},pageNo:u}=s[l];if(n===u&&e>=c[0]&&e<=d[0]&&t>=c[1]&&t<=d[1])return!0}return!1}getKeywordRangeList(e){const t=this.draw.getSearch().getMatchList(e,this.draw.getOriginalElementList()),n=new Map;for(const r of t){const s=n.get(r.groupId);if(s)s.endIndex+=1;else{const{type:l,groupId:a,tableId:c,index:d,tdIndex:u,trIndex:h}=r,R={startIndex:d,endIndex:d};l===Rn.TABLE&&(R.tableId=c,R.startTdIndex=u,R.endTdIndex=u,R.startTrIndex=h,R.endTrIndex=h),n.set(a,R)}}const i=[];return n.forEach(r=>{i.push(r)}),i}getIsCanInput(){const{range:{startIndex:e,endIndex:t},elementList:n}=this.getRangeElement(),i=n[e];if(e===t)return(i.controlComponent!==p.PRE_TEXT||n[e+1]?.controlComponent!==p.PRE_TEXT)&&i.controlComponent!==p.POST_TEXT;const r=n[t];return!i.controlId&&!r.controlId||(!i.controlId||i.controlComponent===p.POSTFIX)&&(!r.controlId||r.controlComponent===p.POSTFIX)||!!i.controlId&&r.controlId===i.controlId&&r.controlComponent!==p.PRE_TEXT&&r.controlComponent!==p.POST_TEXT&&r.controlComponent!==p.POSTFIX}setRange(e,t,n,i,r,s,l,a){this.getIsRangeChange(e,t,n,i,r,s,l)&&(this.range.startIndex=e,this.range.endIndex=t,this.range.tableId=n,this.range.startTdIndex=i,this.range.endTdIndex=r,this.range.startTrIndex=s,this.range.endTrIndex=l,this.range.isCrossRowCol=!!(i||r||s||l),this.range.splitTdRange=a,this.setDefaultStyle(null)),this.range.zone=this.draw.getZone().getZone();const d=this.draw.getControl();if(~e&&~t&&!!this.draw.getElementList()[e]?.controlId){d.initControl();return}d.destroyControl()}replaceRange(e){this.setRange(e.startIndex,e.endIndex,e.tableId,e.startTdIndex,e.endTdIndex,e.startTrIndex,e.endTrIndex)}shrinkRange(){const{startIndex:e,endIndex:t}=this.range;e===t||!~e&&!~t||this.replaceRange({...this.range,startIndex:t})}setRangeStyle(){const e=this.listener.rangeStyleChange,t=this.eventBus.isSubscribe("rangeStyleChange");if(!e&&!t)return;const{startIndex:n,endIndex:i,isCrossRowCol:r}=this.range;if(!~n&&!~i)return;let s;if(r){const N=this.draw.getOriginalElementList(),U=this.position.getPositionContext();s=N[U.index]}else{const N=~i?i:0,U=this.draw.getElementList();s=this.getRangeAnchorStyle(U,N)}if(!s)return;const l=this.getSelection()||[s],a=s.type||O.TEXT,c=s.font||this.options.defaultFont,d=s.size||this.options.defaultSize,u=!~l.findIndex(N=>!N.bold),h=!~l.findIndex(N=>!N.italic),R=!~l.findIndex(N=>!N.underline&&!N.control?.underline),g=!~l.findIndex(N=>!N.strikeout),m=s.color||null,f=s.highlight||null,T=s.rowFlex||null,I=s.vertical||null,L=s.rowMargin??this.options.defaultRowMargin,S=s.dashArray||[],M=s.level||null,X=s.listType||null,x=s.listStyle||null,F=R&&s.textDecoration||null,D=!!this.draw.getPainterStyle(),V=this.historyManager.isCanUndo(),E=this.historyManager.isCanRedo(),v=s.groupIds||null,b=s.extension??null,P=s.deletePerson??"",y={type:a,undo:V,redo:E,painter:D,font:c,size:d,bold:u,italic:h,underline:R,strikeout:g,deletePerson:P,color:m,highlight:f,rowFlex:T,vertical:I,rowMargin:L,dashArray:S,level:M,listType:X,listStyle:x,groupIds:v,textDecoration:F,extension:b};e&&e(y),t&&this.eventBus.emit("rangeStyleChange",y)}recoveryRangeStyle(){const e=this.listener.rangeStyleChange,t=this.eventBus.isSubscribe("rangeStyleChange");if(!e&&!t)return;const n=this.options.defaultFont,i=this.options.defaultSize,r=this.options.defaultRowMargin,s=!!this.draw.getPainterStyle(),l=this.historyManager.isCanUndo(),a=this.historyManager.isCanRedo(),d={type:null,undo:l,redo:a,painter:s,font:n,size:i,bold:!1,italic:!1,underline:!1,strikeout:!1,deletePerson:"123",color:null,highlight:null,rowFlex:null,rowMargin:r,dashArray:[],level:null,listType:null,listStyle:null,groupIds:null,textDecoration:null,extension:null,vertical:null};e&&e(d),t&&this.eventBus.emit("rangeStyleChange",d)}shrinkBoundary(e={}){const{elementList:t,range:n}=this.getRangeElement(e),{startIndex:i,endIndex:r}=n;if(!~i&&!~r)return;const s=t[i],l=t[r];if(i===r){if(s.controlComponent===p.PLACEHOLDER){let a=i-1;for(;a>0;){const c=t[a];if(c.controlId===s.controlId&&(c.controlComponent===p.PREFIX||c.controlComponent===p.PRE_TEXT||c.controlComponent===p.PRETEXTFIX||c.controlComponent===p.PRETEXTFIX_TEXT)){n.startIndex=a,n.endIndex=a;break}if(c.controlId!==s.controlId&&!c.originControlId)break;a--}}if(s.controlComponent===p.TEXTFIXLABEL){let a=i-1;for(;a>0;){const c=t[a];if(c.controlId!==s.controlId||c.controlComponent===p.VALUE||c.controlComponent===p.PRETEXTFIX||c.controlComponent===p.PRETEXTFIX_TEXT){n.startIndex=a,n.endIndex=a;break}a--}}}else{if(s.controlComponent===p.PLACEHOLDER||l.controlComponent===p.PLACEHOLDER||s.controlComponent===p.TEXTFIXLABEL||l.controlComponent===p.TEXTFIXLABEL){let a=r-1;for(;a>0;){const c=t[a];if(c.controlId!==l.controlId||c.controlComponent===p.PREFIX||c.controlComponent===p.PRE_TEXT||c.controlComponent===p.PRETEXTFIX||c.controlComponent===p.PRETEXTFIX_TEXT){n.startIndex=a,n.endIndex=a;return}a--}}if(s.controlComponent===p.PREFIX||s.controlComponent===p.PRE_TEXT||s.controlComponent===p.PRETEXTFIX||s.controlComponent===p.PRETEXTFIX_TEXT){let a=i+1;for(;a<t.length;){const c=t[a];if(c.controlId!==s.controlId||c.controlComponent===p.VALUE){n.startIndex=a-1;break}else if(c.controlComponent===p.PLACEHOLDER){n.startIndex=a-1,n.endIndex=a-1;return}a++}}if(l.controlComponent!==p.VALUE){let a=r-1;for(;a>0;){const c=t[a];if(c.controlId!==s.controlId||c.controlComponent===p.VALUE){n.endIndex=a;break}else if(c.controlComponent===p.PLACEHOLDER){n.startIndex=a,n.endIndex=a;return}a--}}}}render(e,t,n,i,r){e.save(),e.globalAlpha=this.options.rangeAlpha,e.fillStyle=this.options.rangeColor,e.fillRect(t,n,i,r),e.restore()}toString(){const e=this.getTextLikeSelection();return e?e.map(t=>t.value).join("").replace(new RegExp(ee,"g"),""):""}getRangeElement(e={}){const t=e.elementList||this.draw.getElementList(),n=e.range||this.getRange(),{splitTdRange:i}=n,r={elementList:t,range:n};return i&&(r.range=i,r.elementList=this.draw.getSplitTdValues(i.originalId)??[]),r}}class pu{draw;options;imageCache;constructor(e){this.draw=e,this.options=e.getOptions(),this.imageCache=new Map}_renderBackgroundColor(e,t,n,i){e.save(),e.fillStyle=t,e.fillRect(0,0,n,i),e.restore()}_drawImage(e,t,n,i){const{background:r,scale:s}=this.options;if(r.size===Cs.CONTAIN){const l=t.width*s,a=t.height*s;if(!r.repeat||r.repeat===Dn.NO_REPEAT)e.drawImage(t,0,0,l,a);else{let c=0,d=0;const u=r.repeat===Dn.REPEAT||r.repeat===Dn.REPEAT_X?Math.ceil(n*s/l):1,h=r.repeat===Dn.REPEAT||r.repeat===Dn.REPEAT_Y?Math.ceil(i*s/a):1;for(let R=0;R<u;R++){for(let g=0;g<h;g++)e.drawImage(t,c,d,l,a),d+=a;d=0,c+=l}}}else e.drawImage(t,0,0,n*s,i*s)}_renderBackgroundImage(e,t,n){const{background:i}=this.options,r=this.imageCache.get(i.image);if(r)this._drawImage(e,r,t,n);else{const s=new Image;s.setAttribute("crossOrigin","Anonymous"),s.src=i.image,s.onload=()=>{this.imageCache.set(i.image,s),this._drawImage(e,s,t,n),this.draw.render({isCompute:!1,isSubmitHistory:!1})}}}render(e,t){const{background:{image:n,color:i,applyPageNumbers:r}}=this.options;if(n&&(!r?.length||r.includes(t))){const{width:s,height:l}=this.options;this._renderBackgroundImage(e,s,l)}else{const s=this.draw.getCanvasWidth(t),l=this.draw.getCanvasHeight(t);this._renderBackgroundColor(e,i,s,l)}}}class Ds{fillRect;fillColor;fillDecorationStyle;constructor(){this.fillRect=this.clearFillInfo()}clearFillInfo(){return this.fillColor=void 0,this.fillDecorationStyle=void 0,this.fillRect={x:0,y:0,width:0,height:0},this.fillRect}recordFillInfo(e,t,n,i,r,s,l){const a=!this.fillRect.width;if(!a&&(this.fillColor!==s||this.fillDecorationStyle!==l)){this.render(e),this.clearFillInfo(),this.recordFillInfo(e,t,n,i,r,s,l);return}a&&(this.fillRect.x=t,this.fillRect.y=n),r&&this.fillRect.height<r&&(this.fillRect.height=r),this.fillRect.width+=i,this.fillColor=s,this.fillDecorationStyle=l}}class fu extends Ds{options;constructor(e){super(),this.options=e.getOptions()}render(e){if(!this.fillRect.width)return;const{highlightAlpha:t}=this.options,{x:n,y:i,width:r,height:s}=this.fillRect;e.save(),e.globalAlpha=t,e.fillStyle=this.fillColor,e.fillRect(n,i,r,s),e.restore(),this.clearFillInfo()}}class mu{draw;options;constructor(e){this.draw=e,this.options=e.getOptions()}render(e,t){const{marginIndicatorColor:n,pageMode:i}=this.options,r=this.draw.getWidth(),s=i===wn.CONTINUITY?this.draw.getCanvasHeight(t)/this.draw.getPagePixelRatio():this.draw.getHeight(),l=this.draw.getMargins(),a=this.draw.getMarginIndicatorSize();e.save(),e.translate(.5,.5),e.strokeStyle=n,e.beginPath();const c=[l[3],l[0]],d=[r-l[1],l[0]],u=[l[3],s-l[2]],h=[r-l[1],s-l[2]];e.moveTo(c[0]-a,c[1]),e.lineTo(...c),e.lineTo(c[0],c[1]-a),e.moveTo(d[0]+a,d[1]),e.lineTo(...d),e.lineTo(d[0],d[1]-a),e.moveTo(u[0]-a,u[1]),e.lineTo(...u),e.lineTo(u[0],u[1]+a),e.moveTo(h[0]+a,h[1]),e.lineTo(...h),e.lineTo(h[0],h[1]+a),e.stroke(),e.restore()}}class Tu{draw;options;position;range;searchKeyword;searchNavigateIndex;searchOptions;searchMatchList;constructor(e){this.draw=e,this.options=e.getOptions(),this.position=e.getPosition(),this.range=e.getRange(),this.searchNavigateIndex=null,this.searchOptions=null,this.searchKeyword=null,this.searchMatchList=[]}getSearchKeyword(){return this.searchKeyword}setSearchKeyword(e,t){this.searchKeyword=e,this.searchNavigateIndex=null,this.searchOptions=t||null}searchNavigatePre(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let e=this.searchNavigateIndex-1,t=!1;const n=this.searchMatchList[this.searchNavigateIndex].groupId;for(;e>=0;){const i=this.searchMatchList[e];if(n!==i.groupId){t=!0,this.searchNavigateIndex=e-(this.searchKeyword.length-1);break}e--}if(!t){if(this.searchMatchList[this.searchMatchList.length-1].groupId===n)return null;this.searchNavigateIndex=this.searchMatchList.length-1-(this.searchKeyword.length-1)}}return this.searchNavigateIndex}searchNavigateNext(){if(!this.searchMatchList.length||!this.searchKeyword)return null;if(this.searchNavigateIndex===null)this.searchNavigateIndex=0;else{let e=this.searchNavigateIndex+1,t=!1;const n=this.searchMatchList[this.searchNavigateIndex].groupId;for(;e<this.searchMatchList.length;){const i=this.searchMatchList[e];if(n!==i.groupId){t=!0,this.searchNavigateIndex=e;break}e++}if(!t){if(this.searchMatchList[0].groupId===n)return null;this.searchNavigateIndex=0}}return this.searchNavigateIndex}searchNavigateScrollIntoView(e){const{coordinate:{leftTop:t,leftBottom:n,rightTop:i},pageNo:r}=e,s=this.draw.getHeight(),l=this.draw.getPageGap(),a=r*(s+l),c=document.createElement("div");c.style.position="absolute";const d=50;c.style.width=`${i[0]-t[0]+d}px`,c.style.height=`${n[1]-t[1]+d}px`,c.style.left=`${t[0]}px`,c.style.top=`${t[1]+a}px`,this.draw.getContainer().append(c),c.scrollIntoView(!1),c.remove()}getSearchNavigateIndexList(){return this.searchNavigateIndex===null||!this.searchKeyword?[]:new Array(this.searchKeyword.length).fill(this.searchNavigateIndex).map((e,t)=>e+t)}getSearchMatchList(){return this.searchMatchList}getSearchNavigateInfo(){if(!this.searchKeyword||!this.searchMatchList.length)return null;const e=this.searchNavigateIndex!==null?this.searchNavigateIndex/this.searchKeyword.length+1:0;let t=0,n=null;for(let i=0;i<this.searchMatchList.length;i++){const r=this.searchMatchList[i];n!==r.groupId&&(n=r.groupId,t+=1)}return{index:e,count:t}}getMatchList(e,t){const{isRegEnable:n=!1,isIgnoreCase:i=!0}=this.searchOptions||{},r=i?e.toLocaleLowerCase():e,s=[],l=[],a=t.length,c=[];for(let R=0;R<a;R++)t[R].type===O.TABLE&&c.push(R);let d=0,u=0;for(;u<a-1;){const R=c.length?c[d]:a,g=t.slice(u,R);g.length&&l.push({index:u,type:Rn.PAGE,elementList:g});const m=t[R];m&&l.push({index:R,type:Rn.TABLE,elementList:[m]}),u=R+1,d++}function h(R,g,m,f){if(!R)return;let T=m.map(X=>!X.type||wt.includes(X.type)&&X.controlComponent!==p.CHECKBOX&&X.controlComponent!==p.RADIO&&!X.hide&&!X.control?.hide&&!X.area?.hide?X.value:ee).filter(Boolean).join("");i&&(T=T.toLocaleLowerCase());const I=[],L=n?new RegExp(R):R;let{index:S,length:M}=xr(T,L);for(;S!==-1&&M!==0;){I.push({index:S,length:M});const X=xr(T,L,S+M);S=X.index,M=X.length}for(let X=0;X<I.length;X++){const{index:x,length:F}=I[X],D=Ee();for(let V=0;V<F;V++){const E=x+V+(f?.startIndex||0);s.push({type:g,index:E,groupId:D,...f})}}}for(let R=0;R<l.length;R++){const g=l[R];if(g.type===Rn.TABLE){const m=g.elementList[0];for(let f=0;f<m.trList.length;f++){const T=m.trList[f];for(let I=0;I<T.tdList.length;I++){const L=T.tdList[I],S={tableId:m.id,tableIndex:g.index,trIndex:f,tdIndex:I,tdId:L.id};h(r,g.type,L.value,S)}}}else h(r,g.type,g.elementList,{startIndex:g.index})}return s}compute(e){const t=this.searchOptions?.isLimitSelection&&!this.range.getIsCollapsed(),n=t?this.range.getSelectionElementList():this.draw.getOriginalElementList();if(!n?.length||(this.searchMatchList=this.getMatchList(e,n),!t||!this.searchMatchList.length))return;const{startIndex:i}=this.range.getRange(),r=i+1;for(const s of this.searchMatchList)s.type===Rn.TABLE?s.tableIndex+=r:s.index+=r}render(e,t){if(!this.searchMatchList||!this.searchMatchList.length||!this.searchKeyword)return;const{searchMatchAlpha:n,searchMatchColor:i,searchNavigateMatchColor:r}=this.options,s=this.position.getOriginalPositionList(),l=this.draw.getOriginalElementList();e.save(),e.globalAlpha=n;for(let a=0;a<this.searchMatchList.length;a++){const c=this.searchMatchList[a];let d=null;if(c.type===Rn.TABLE){const{tableIndex:S,trIndex:M,tdIndex:X,index:x}=c;d=l[S]?.trList[M].tdList[X]?.positionList[x]}else d=s[c.index];if(!d)continue;const{coordinate:{leftTop:u,leftBottom:h,rightTop:R},pageNo:g}=d;if(g!==t)continue;if(this.getSearchNavigateIndexList().includes(a)){e.fillStyle=r;const S=this.searchMatchList[a-1];(!S||S.groupId!==c.groupId)&&this.searchNavigateScrollIntoView(d)}else e.fillStyle=i;const f=u[0],T=u[1],I=R[0]-u[0],L=h[1]-u[1];e.fillRect(f,T,I,L)}e.restore()}replace(e,t){if(this.draw.isReadonly()||e==null)return;let i=this.getSearchMatchList();const r=t?.index;if(ns(r)){const m=[];i.forEach(f=>{const T=m[m.length-1];!T||T[0].groupId!==f.groupId?m.push([f]):T.push(f)}),i=m[r]}if(!i?.length)return;const s=this.draw.isDesignMode();let l=0,a=0,c="",d="",u=-1;const h=this.draw.getOriginalElementList();for(let m=0;m<i.length;m++){const f=i[m];if(f.type===Rn.TABLE){const{tableIndex:T,trIndex:I,tdIndex:L,index:S,tdId:M}=f;d&&M!==d&&(a=0),d=M;const X=T+l,x=h[X].trList[I].tdList[L].value,F=S+a,D=x[F];if(!s&&(D?.control?.deletable===!1||D?.title?.deletable===!1))continue;if(e===""){this.draw.spliceElementList(x,F,1),a--,~u||(u=m);continue}if(c===f.groupId){this.draw.spliceElementList(x,F,1),a--;continue}~u||(u=m);for(let V=0;V<e.length;V++){const E=e[V];V===0?D.value=E:(this.draw.spliceElementList(x,F+V,0,[{...D,value:E}]),a++)}}else{const T=f.index+l,I=h[T];if(!s&&(I?.control?.deletable===!1||I?.title?.deletable===!1)||I.type===O.CONTROL&&I.controlComponent!==p.VALUE)continue;if(e===""){this.draw.spliceElementList(h,T,1),l--,~u||(u=m);continue}if(~u||(u=m),c===f.groupId){this.draw.spliceElementList(h,T,1),l--;continue}for(let L=0;L<e.length;L++){const S=e[L];L===0?I.value=S:(this.draw.spliceElementList(h,T+L,0,[{...I,value:S}]),l++)}}c=f.groupId}if(!~u)return;const R=i[u],g=R.index+(e.length-1);if(R.type===Rn.TABLE){const{tableIndex:m,trIndex:f,tdIndex:T,index:I}=R,L=h[m].trList[f].tdList[T].value[I];this.position.setPositionContext({isTable:!0,index:m,trIndex:f,tdIndex:T,tdId:L.tdId,trId:L.trId,tableId:L.tableId})}else this.position.setPositionContext({isTable:!1});this.draw.getRange().setRange(g,g),this.draw.render({curIndex:g})}}class Lu extends Ds{options;constructor(e){super(),this.options=e.getOptions()}render(e){if(!this.fillRect.width)return;const{scale:t,strikeoutColor:n}=this.options,{x:i,y:r,width:s}=this.fillRect;e.save(),e.lineWidth=t,e.strokeStyle=n;const l=r-3;e.beginPath(),e.moveTo(i,l),e.lineTo(i+s,l),e.stroke(),e.beginPath(),e.moveTo(i,r+3.5),e.lineTo(i+s,r+3.5),e.stroke(),e.restore(),this.clearFillInfo()}}var Xn=(o=>(o.SOLID="solid",o.DOUBLE="double",o.DASHED="dashed",o.DOTTED="dotted",o.WAVY="wavy",o))(Xn||{}),So=(o=>(o.SOLID="solid",o.DASHED="dashed",o.DOTTED="dotted",o))(So||{});class Iu extends Ds{options;constructor(e){super(),this.options=e.getOptions()}_drawLine(e,t,n,i,r){const s=t+i;switch(e.beginPath(),r){case So.DASHED:e.setLineDash([3,1]);break;case So.DOTTED:e.setLineDash([1,1]);break}e.moveTo(t,n),e.lineTo(s,n),e.stroke()}_drawDouble(e,t,n,i){const s=t+i,l=n+3*this.options.scale;this.options.mode===B.PRINT?e.strokeStyle="transparent":e.strokeStyle="red",e.beginPath(),e.moveTo(t,n),e.lineTo(s,n),e.stroke(),e.beginPath(),e.moveTo(t,l),e.lineTo(s,l),e.stroke()}_drawWave(e,t,n,i){const{scale:r}=this.options,s=1.2*r,l=1/r,a=n+2*s;e.beginPath();for(let c=0;c<i;c++){const d=s*Math.sin(l*c);e.lineTo(t+c,a+d)}e.stroke()}render(e){if(!this.fillRect.width)return;const{underlineColor:t,scale:n}=this.options,{x:i,y:r,width:s}=this.fillRect;e.save(),e.strokeStyle=this.fillColor||t,e.lineWidth=n;const l=Math.floor(r+2*e.lineWidth)+.5;switch(this.fillDecorationStyle){case Xn.WAVY:this._drawWave(e,i,l,s);break;case Xn.DOUBLE:this._drawDouble(e,i,l,s);break;case Xn.DASHED:this._drawLine(e,i,l,s,So.DASHED);break;case Xn.DOTTED:this._drawLine(e,i,l,s,So.DOTTED);break;default:this._drawLine(e,i,l,s);break}e.restore(),this.clearFillInfo()}}class Pu{draw;options;ctx;curX;curY;text;curStyle;curColor;cacheMeasureText;constructor(e){this.draw=e,this.options=e.getOptions(),this.ctx=e.getCtx(),this.curX=-1,this.curY=-1,this.text="",this.curStyle="",this.cacheMeasureText=new Map}measureBasisWord(e,t){e.save(),e.font=t;const n=this.measureText(e,{value:oc});return e.restore(),n}measureWord(e,t,n){const i=this.draw.getLetterReg();let r=0,s=null,l=n;for(;l<t.length;){const a=t[l];if(a.type&&a.type!==O.TEXT||!i.test(a.value)){s=a;break}r+=this.measureText(e,a).width,l++}return{width:r,endElement:s}}buttonMeasureWord(e,t,n){const i=this.draw.getLetterReg();let r=0,s=null,l=n;for(;l<t.length;){const a=t[l];if(a.type&&a.type!==O.TEXT||!i.test(a.value)){s=a;break}r+=this.measureText(e,a).width,l++}return{width:r,endElement:s}}measurePunctuationWidth(e,t){return!t||!nc.includes(t.value)?0:(e.font=this.draw.getElementFont(t),this.measureText(e,t).width)}measureText(e,t){if(t.width){const s=e.measureText(t.value);return{width:t.width,actualBoundingBoxAscent:s.actualBoundingBoxAscent,actualBoundingBoxDescent:s.actualBoundingBoxDescent,actualBoundingBoxLeft:s.actualBoundingBoxLeft,actualBoundingBoxRight:s.actualBoundingBoxRight,fontBoundingBoxAscent:s.fontBoundingBoxAscent,fontBoundingBoxDescent:s.fontBoundingBoxDescent}}const n=`${t.value}${e.font}`,i=this.cacheMeasureText.get(n);if(i)return i;const r=e.measureText(t.value);return this.cacheMeasureText.set(n,r),r}getBasisWordBoundingBoxAscent(e,t){return this.measureBasisWord(e,t).actualBoundingBoxAscent}complete(){this._render(),this.text=""}record(e,t,n,i){if(this.ctx=e,this.options.renderMode===Fs.COMPATIBILITY){this._setCurXY(n,i),this.text=t.value,this.curStyle=t.style,this.curColor=t.color,this.complete();return}this.text||this._setCurXY(n,i),(this.curStyle&&t.style!==this.curStyle||t.color!==this.curColor)&&(this.complete(),this._setCurXY(n,i)),this.text+=t.value,this.curStyle=t.style,this.curColor=t.color}_setCurXY(e,t){this.curX=e,this.curY=t}_render(){!this.text||!~this.curX||!~this.curX||(this.ctx.save(),this.ctx.font=this.curStyle,this.ctx.fillStyle=this.curColor||this.options.defaultColor,this.ctx.fillText(this.text,this.curX,this.curY),this.ctx.restore())}}class so{draw;options;constructor(e){this.draw=e,this.options=e.getOptions()}static formatNumberPlaceholder(e,t,n,i){const r=i===fi.CHINESE?pc(t):`${t}`;return e.replace(n,r)}render(e,t){const{scale:n,pageNumber:{size:i,font:r,color:s,rowFlex:l,numberType:a,format:c,startPageNo:d,fromPageNo:u}}=this.options;if(t<u)return;let h=c;const R=new RegExp(Co.PAGE_NO);R.test(h)&&(h=so.formatNumberPlaceholder(h,t+d-u,R,a));const g=new RegExp(Co.PAGE_COUNT);g.test(h)&&(h=so.formatNumberPlaceholder(h,this.draw.getPageCount()-u,g,a));const m=this.draw.getWidth(),f=this.draw.getHeight(),T=this.draw.getPageNumberBottom(),I=f-T;e.save(),e.fillStyle=s,e.font=`${i*n}px ${r}`;let L=0;const S=this.draw.getMargins(),{width:M}=e.measureText(h);l===Qe.CENTER?L=(m-M)/2:l===Qe.RIGHT?L=m-M-S[1]:L=S[3],e.fillText(h,L,I),e.restore()}}class Ou{draw;options;scrollContainer;constructor(e){this.draw=e,this.options=e.getOptions(),this.scrollContainer=this.getScrollContainer(),setTimeout(()=>{window.scrollY||this._observer()}),this._addEvent()}getScrollContainer(){return this.options.scrollContainerSelector&&document.querySelector(this.options.scrollContainerSelector)||document}_addEvent(){this.scrollContainer.addEventListener("scroll",this._observer)}removeEvent(){this.scrollContainer.removeEventListener("scroll",this._observer)}getElementVisibleInfo(e){const t=e.getBoundingClientRect(),n=this.scrollContainer===document?Math.max(document.documentElement.clientHeight,window.innerHeight):this.scrollContainer.clientHeight,i=Math.min(t.bottom,n)-Math.max(t.top,0);return{intersectionHeight:i>0?i:0}}getPageVisibleInfo(){const e=this.draw.getPageList(),t=[];let n=0,i=0;for(let r=0;r<e.length;r++){const s=e[r],{intersectionHeight:l}=this.getElementVisibleInfo(s);if(i&&!l)break;l&&t.push(r),l>i&&(i=l,n=r)}return{intersectionPageNo:n,visiblePageNoList:t}}_observer=dc(()=>{const{intersectionPageNo:e,visiblePageNoList:t}=this.getPageVisibleInfo();this.draw.setIntersectionPageNo(e),this.draw.setVisiblePageNoList(t)},150)}class Su{step=5;thresholdPoints=[70,40,10,20];selectionContainer;rangeManager;requestAnimationFrameId;isMousedown;isMoving;clientWidth;clientHeight;containerRect;constructor(e){this.rangeManager=e.getRange();const{scrollContainerSelector:t}=e.getOptions();this.selectionContainer=t&&document.querySelector(t)||document,this.requestAnimationFrameId=null,this.isMousedown=!1,this.isMoving=!1,this.clientWidth=0,this.clientHeight=0,this.containerRect=null,this._addEvent()}_addEvent(){const e=this.selectionContainer;e.addEventListener("mousedown",this._mousedown),e.addEventListener("mousemove",this._mousemove),e.addEventListener("mouseup",this._mouseup),document.addEventListener("mouseleave",this._mouseup)}removeEvent(){const e=this.selectionContainer;e.removeEventListener("mousedown",this._mousedown),e.removeEventListener("mousemove",this._mousemove),e.removeEventListener("mouseup",this._mouseup),document.removeEventListener("mouseleave",this._mouseup)}_mousedown=()=>{if(this.isMousedown=!0,this.clientWidth=this.selectionContainer instanceof Document?document.documentElement.clientWidth:this.selectionContainer.clientWidth,this.clientHeight=this.selectionContainer instanceof Document?document.documentElement.clientHeight:this.selectionContainer.clientHeight,!(this.selectionContainer instanceof Document)){const e=this.selectionContainer.getBoundingClientRect();this.containerRect=e}};_mouseup=()=>{this.isMousedown=!1,this._stopMove()};_mousemove=e=>{if(!this.isMousedown||this.rangeManager.getIsCollapsed())return;let{x:t,y:n}=e;this.containerRect&&(t=t-this.containerRect.x,n=n-this.containerRect.y),n<this.thresholdPoints[0]?this._startMove(mt.UP):this.clientHeight-n<=this.thresholdPoints[1]?this._startMove(mt.DOWN):t<this.thresholdPoints[2]?this._startMove(mt.LEFT):this.clientWidth-t<this.thresholdPoints[3]?this._startMove(mt.RIGHT):this._stopMove()};_move(e){const t=this.selectionContainer instanceof Document?window:this.selectionContainer,n=this.selectionContainer instanceof Document?window.scrollX:t.scrollLeft,i=this.selectionContainer instanceof Document?window.scrollY:t.scrollTop;e===mt.DOWN?t.scrollTo(n,i+this.step):e===mt.UP?t.scrollTo(n,i-this.step):e===mt.LEFT?t.scrollTo(n-this.step,i):t.scrollTo(n+this.step,i),this.requestAnimationFrameId=window.requestAnimationFrame(this._move.bind(this,e))}_startMove(e){this.isMoving||(this.isMoving=!0,this._move(e))}_stopMove(){this.requestAnimationFrameId&&(window.cancelAnimationFrame(this.requestAnimationFrameId),this.requestAnimationFrameId=null,this.isMoving=!1)}}class Mu{draw;range;options;constructor(e){this.draw=e,this.range=e.getRange(),this.options=e.getOptions()}getTrListGroupByCol(e){const t=xe(e);for(let n=0;n<e.length;n++){const i=t[n];for(let r=i.tdList.length-1;r>=0;r--){const s=i.tdList[r],{rowspan:l,rowIndex:a,colIndex:c}=s,d=a+l-1;if(d!==r){const u=i.tdList.splice(r,1)[0];t[d]?.tdList.splice(c,0,u)}}}return t}getRangeRowCol(){const{isTable:e,index:t,trIndex:n,tdIndex:i}=this.draw.getPosition().getPositionContext();if(!e)return null;const{isCrossRowCol:r,startTdIndex:s,endTdIndex:l,startTrIndex:a,endTrIndex:c}=this.range.getRange(),h=this.draw.getOriginalElementList()[t].trList;if(!r)return[[h[n].tdList[i]]];let R=h[a].tdList[s],g=h[c].tdList[l];(R.x>g.x||R.y>g.y)&&([R,g]=[g,R]);const m=R.colIndex,f=g.colIndex+(g.colspan-1),T=R.rowIndex,I=g.rowIndex+(g.rowspan-1),L=[];for(let S=0;S<h.length;S++){const M=h[S],X=[];for(let x=0;x<M.tdList.length;x++){const F=M.tdList[x],D=F.colIndex,V=F.rowIndex;D>=m&&D<=f&&V>=T&&V<=I&&X.push(F)}X.length&&L.push(X)}return L.length?L:null}_drawOuterBorder(e){const{ctx:t,startX:n,startY:i,width:r,height:s,isDrawFullBorder:l,borderExternalWidth:a}=e,{scale:c}=this.options,d=t.lineWidth;a&&(t.lineWidth=a*c),t.beginPath();const u=Math.round(n),h=Math.round(i);t.translate(.5,.5),l?t.rect(u,h,r,s):(t.moveTo(u,h+s),t.lineTo(u,h),t.lineTo(u+r,h)),t.stroke(),a&&(t.lineWidth=d),t.translate(-.5,-.5)}_drawSlash(e,t,n,i){const{scale:r}=this.options;e.save();const s=t.width*r,l=t.height*r,a=Math.round(t.x*r+n),c=Math.round(t.y*r+i);t.slashTypes?.includes(Fo.FORWARD)&&(e.moveTo(a+s,c),e.lineTo(a,c+l)),t.slashTypes?.includes(Fo.BACK)&&(e.moveTo(a,c),e.lineTo(a+s,c+l)),e.stroke(),e.restore()}_drawBorder(e,t,n,i){const{colgroup:r,trList:s,borderType:l,borderColor:a,borderWidth:c=1,borderExternalWidth:d}=t;if(!r||!s)return;const{scale:u,table:{defaultBorderColor:h}}=this.options,R=t.width*u,g=t.height*u,m=l===vt.EMPTY,f=l===vt.EXTERNAL,T=l===vt.INTERNAL;e.save(),l===vt.DASH&&e.setLineDash([3,3]),e.lineWidth=c*u,e.strokeStyle=a||h,!m&&!T&&this._drawOuterBorder({ctx:e,startX:n,startY:i,width:R,height:g,borderExternalWidth:d,isDrawFullBorder:f});for(let I=0;I<s.length;I++){const L=s[I];for(let S=0;S<L.tdList.length;S++){const M=L.tdList[S];if(M.slashTypes?.length&&this._drawSlash(e,M,n,i),!M.borderTypes?.length&&(m||f))continue;const X=M.width*u,x=M.height*u,F=Math.round(M.x*u+n+X),D=Math.round(M.y*u+i);if(e.translate(.5,.5),e.beginPath(),M.borderTypes?.includes(Yt.TOP)&&(e.moveTo(F-X,D),e.lineTo(F,D),e.stroke()),M.borderTypes?.includes(Yt.RIGHT)&&(e.moveTo(F,D),e.lineTo(F,D+x),e.stroke()),M.borderTypes?.includes(Yt.BOTTOM)&&(e.moveTo(F,D+x),e.lineTo(F-X,D+x),e.stroke()),M.borderTypes?.includes(Yt.LEFT)&&(e.moveTo(F-X,D),e.lineTo(F-X,D+x),e.stroke()),!m&&!f){if((!T||M.colIndex+M.colspan<r.length)&&(e.moveTo(F,D),e.lineTo(F,D+x),d&&d!==c&&M.colIndex+M.colspan===r.length)){const V=e.lineWidth;e.lineWidth=d*u,e.stroke(),e.beginPath(),e.lineWidth=V}if(!T||M.rowIndex+M.rowspan<s.length){const V=d&&d!==c&&M.rowIndex+M.rowspan===s.length;if(V&&(e.stroke(),e.beginPath()),e.moveTo(F,D+x),e.lineTo(F-X,D+x),V){const E=e.lineWidth;e.lineWidth=d*u,e.stroke(),e.beginPath(),e.lineWidth=E}}e.stroke()}e.translate(-.5,-.5)}}e.restore()}_drawBackgroundColor(e,t,n,i){const{trList:r}=t;if(!r)return;const{scale:s}=this.options;for(let l=0;l<r.length;l++){const a=r[l];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c];if(!d.backgroundColor)continue;e.save();const u=d.width*s,h=d.height*s,R=Math.round(d.x*s+n),g=Math.round(d.y*s+i);e.fillStyle=d.backgroundColor,e.fillRect(R,g,u,h),e.restore()}}}getTableWidth(e){return e.colgroup.reduce((t,n)=>t+n.width,0)}getTableHeight(e){const t=e.trList;return t?.length?this.getTdListByColIndex(t,0).reduce((n,i)=>n+i.height,0):0}getRowCountByColIndex(e,t){return this.getTdListByColIndex(e,t).reduce((n,i)=>n+i.rowspan,0)}getTdListByColIndex(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i].tdList;for(let s=0;s<r.length;s++){const l=r[s],a=l.colIndex,c=a+l.colspan-1;t>=a&&t<=c&&n.push(l)}}return n}getTdListByRowIndex(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i].tdList;for(let s=0;s<r.length;s++){const l=r[s],a=l.rowIndex,c=a+l.rowspan-1;t>=a&&t<=c&&n.push(l)}}return n}computeRowColInfo(e){const{colgroup:t,trList:n}=e;if(!t||!n)return;let i=0;for(let r=0;r<n.length;r++){const s=n[r],l=n.length-1===r;for(let a=0;a<s.tdList.length;a++){const c=s.tdList[a];let d=0;if(n.length>1&&r!==0){const T=s.tdList[a-1],I=T?T.colIndex+T.colspan:a;for(let L=I;L<t.length;L++)if(this.getRowCountByColIndex(n.slice(0,r),L)===r){d=L;let M=0;for(let X=0;X<L;X++)M+=t[X].width;i=M;break}}else{const T=s.tdList[a-1];T&&(d=T.colIndex+T.colspan)}let u=0;for(let T=0;T<c.colspan;T++)u+=t[T+d].width;let h=0;for(let T=0;T<c.rowspan;T++){const I=n[T+r]||n[r];h+=I.height}const R=s.tdList.length-1===a;let g=l;if(!g&&c.rowspan>1){const T=n.length-1-r;g=c.rowspan-1===T}const m=l&&R;c.isLastRowTd=R,c.isLastColTd=g,c.isLastTd=m,c.x=i;let f=0;for(let T=0;T<r;T++){const I=n[T].tdList;for(let L=0;L<I.length;L++){const S=I[L];if(d>=S.colIndex&&d<S.colIndex+S.colspan){f+=S.height;break}}}c.y=f,c.width=u,c.height=h,c.rowIndex=r,c.colIndex=d,c.trIndex=r,c.tdIndex=a,i+=u,R&&!m&&(i=0)}}}drawRange(e,t,n,i){const{scale:r,rangeAlpha:s,rangeColor:l}=this.options,{type:a,trList:c}=t;if(!c||a!==O.TABLE)return;const{isCrossRowCol:d,startTdIndex:u,endTdIndex:h,startTrIndex:R,endTrIndex:g}=this.range.getRange();if(!d)return;let m=c[R].tdList[u],f=c[g].tdList[h];(m.x>f.x||m.y>f.y)&&([m,f]=[f,m]);const T=m.colIndex,I=f.colIndex+(f.colspan-1),L=m.rowIndex,S=f.rowIndex+(f.rowspan-1);e.save();for(let M=0;M<c.length;M++){const X=c[M];for(let x=0;x<X.tdList.length;x++){const F=X.tdList[x],D=F.colIndex,V=F.rowIndex;if(D>=T&&D<=I&&V>=L&&V<=S){const E=F.x*r,v=F.y*r,b=F.width*r,P=F.height*r;e.globalAlpha=s,e.fillStyle=l,e.fillRect(E+n,v+i,b,P)}}}e.restore()}render(e,t,n,i){this._drawBackgroundColor(e,t,n,i),this._drawBorder(e,t,n,i)}findPreRowSpanTd(e,t,n){for(let i=t;i>=0;i--){const r=e[i].tdList.find(s=>s.colIndex===n);if(r)return r}}computeTrHeight(e,t){const{scale:n,table:{tdPadding:i,defaultTrMinHeight:r}}=this.options,s=e.tdPadding||i,l=s[0]+s[2],a=e.trList;for(let u=0;u<a.length;u++){const h=a[u];h.height=h.minHeight||r,h.minHeight=h.height}this.computeRowColInfo(e);const c={},d={};for(let u=0;u<a.length;u++){const h=a[u];if(!h.tdList.length){h.height=0;continue}const R=[],g=[];for(let f=0;f<e.colgroup.length;f++){const T=h.tdList.find(I=>I.colIndex===f);if(T){const I=t?t(T):T.rowList,L=I.reduce((M,X)=>M+X.height,0);T.rowList=I;const S=L/n+l;T.mainHeight=S,T.rowspan>1?(d[T.colIndex]=T.id,c[T.id]={td:T,rowSpan:[u,u+T.rowspan-1],preHeight:0,preMinHeight:0,extraHeight:S},g.push(S)):T.height<S?(T.height=S,T.realHeight=S,R.push(S)):R.push(T.height)}else{const I=c[d[f]];I?.rowSpan[1]==u&&R.push(I.extraHeight)}}const m=Math.max(...R.length?R:g);Object.values(c).forEach(f=>{f.rowSpan[0]<=u&&f.rowSpan[1]>=u&&(f.extraHeight-=m,f.preHeight+=m,f.preMinHeight+=h.minHeight)}),h.height=m;for(let f=0;f<e.colgroup.length;f++){const T=h.tdList.find(I=>I.colIndex===f)??this.findPreRowSpanTd(a,u,f);if(T){const I=c[T.id]?.preHeight??0,L=c[T.id]?.preMinHeight??h.minHeight;T.height=m+I,T.realHeight=m+I,T.realMinHeight=L}}}this.computeRowColInfo(e)}}var hn=(o=>(o.ROW="row",o.COL="col",o))(hn||{});class Xu{MIN_TD_WIDTH=20;ROW_COL_OFFSET=18;ROW_COL_QUICK_WIDTH=16;ROW_COL_QUICK_OFFSET=5;ROW_COL_QUICK_POSITION=this.ROW_COL_OFFSET+(this.ROW_COL_OFFSET-this.ROW_COL_QUICK_WIDTH)/2;BORDER_VALUE=4;TABLE_SELECT_OFFSET=20;draw;canvas;options;position;range;container;toolRowContainer;toolRowAddBtn;toolColAddBtn;toolTableSelectBtn;toolColContainer;toolBorderContainer;anchorLine;mousedownX;mousedownY;constructor(e){this.draw=e,this.canvas=e.getPage(),this.options=e.getOptions(),this.position=e.getPosition(),this.range=e.getRange(),this.container=e.getContainer(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null,this.anchorLine=null,this.mousedownX=0,this.mousedownY=0}dispose(){this.toolRowContainer?.remove(),this.toolRowAddBtn?.remove(),this.toolColAddBtn?.remove(),this.toolTableSelectBtn?.remove(),this.toolColContainer?.remove(),this.toolBorderContainer?.remove(),this.toolRowContainer=null,this.toolRowAddBtn=null,this.toolColAddBtn=null,this.toolTableSelectBtn=null,this.toolColContainer=null,this.toolBorderContainer=null}render(){const{isTable:e,index:t,trIndex:n,tdIndex:i}=this.position.getPositionContext();if(!e)return;this.dispose();const r=this.draw.getOriginalElementList(),s=this.position.getOriginalPositionList(),l=r[t];if(l.tableToolDisabled&&!this.draw.isDesignMode())return;const{scale:a,table:{overflow:c}}=this.options,d=s[t],{colgroup:u,trList:h}=l,{coordinate:{leftTop:R}}=d,g=this.draw.getHeight(),m=this.draw.getPageGap(),f=this.draw.getPageNo()*(g+m),T=R[0],I=R[1]+f,L=l.trList[n].tdList[i],S=L.rowIndex,M=L.colIndex,X=l.height*a,x=l.width*a,F=document.createElement("div");F.classList.add(`${re}-table-tool__select`),F.style.height=`${X*a}`,F.style.left=`${T}px`,F.style.top=`${I}px`,F.style.transform=`translate(-${this.TABLE_SELECT_OFFSET*a}px, ${-this.TABLE_SELECT_OFFSET*a}px)`,F.onclick=()=>{this.draw.getTableOperate().tableSelectAll()},this.container.append(F),this.toolTableSelectBtn=F;const D=h.map(N=>N.height),V=document.createElement("div");V.classList.add(`${re}-table-tool__row`),V.style.transform=`translateX(-${this.ROW_COL_OFFSET*a}px)`;for(let N=0;N<D.length;N++){const U=D[N]*a,w=document.createElement("div");w.classList.add(`${re}-table-tool__row__item`),N===S&&w.classList.add("active"),w.onclick=()=>{const K=this.draw.getTableParticle().getTdListByRowIndex(h,N),z=K[0],$=K[K.length-1];this.position.setPositionContext({index:t,isTable:!0,trIndex:z.trIndex,tdIndex:z.tdIndex,tableId:l.id}),this.range.setRange(0,0,l.id,z.tdIndex,$.tdIndex,z.trIndex,$.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(V,N)};const Q=document.createElement("div");Q.classList.add(`${re}-table-tool__anchor`),Q.onmousedown=K=>{this._mousedown({evt:K,element:l,index:N,order:hn.ROW})},w.append(Q),w.style.height=`${U}px`,V.append(w)}V.style.left=`${T}px`,V.style.top=`${I}px`,this.container.append(V),this.toolRowContainer=V;const E=document.createElement("div");E.classList.add(`${re}-table-tool__quick__add`),E.style.height=`${X*a}`,E.style.left=`${T}px`,E.style.top=`${I+X}px`,E.style.transform=`translate(-${this.ROW_COL_QUICK_POSITION*a}px, ${this.ROW_COL_QUICK_OFFSET*a}px)`,E.onclick=()=>{this.position.setPositionContext({index:t,isTable:!0,trIndex:h.length-1,tdIndex:0,tableId:l.id}),this.draw.getTableOperate().insertTableBottomRow()},this.container.append(E),this.toolRowAddBtn=E;const v=u.map(N=>N.width),b=document.createElement("div");b.classList.add(`${re}-table-tool__col`),b.style.transform=`translateY(-${this.ROW_COL_OFFSET*a}px)`;for(let N=0;N<v.length;N++){const U=v[N]*a,w=document.createElement("div");w.classList.add(`${re}-table-tool__col__item`),N===M&&w.classList.add("active"),w.onclick=()=>{const K=this.draw.getTableParticle().getTdListByColIndex(h,N),z=K[0],$=K[K.length-1];this.position.setPositionContext({index:t,isTable:!0,trIndex:z.trIndex,tdIndex:z.tdIndex,tableId:l.id}),this.range.setRange(0,0,l.id,z.tdIndex,$.tdIndex,z.trIndex,$.trIndex),this.draw.render({curIndex:0,isCompute:!1,isSubmitHistory:!1}),this._setAnchorActive(b,N)};const Q=document.createElement("div");Q.classList.add(`${re}-table-tool__anchor`),Q.onmousedown=K=>{this._mousedown({evt:K,element:l,index:N,order:hn.COL})},w.append(Q),w.style.width=`${U}px`,b.append(w)}b.style.left=`${T}px`,b.style.top=`${I}px`,this.container.append(b),this.toolColContainer=b;const P=document.createElement("div");P.classList.add(`${re}-table-tool__quick__add`),P.style.height=`${X*a}`,P.style.left=`${T+x}px`,P.style.top=`${I}px`,P.style.transform=`translate(${this.ROW_COL_QUICK_OFFSET*a}px, -${this.ROW_COL_QUICK_POSITION*a}px)`,P.onclick=()=>{this.position.setPositionContext({index:t,isTable:!0,trIndex:0,tdIndex:h[0].tdList.length-1||0,tableId:l.id}),this.draw.getTableOperate().insertTableRightCol()},this.container.append(P),this.toolColAddBtn=P;const y=document.createElement("div");y.classList.add(`${re}-table-tool__border`),y.style.height=`${X}px`,y.style.width=`${x}px`,y.style.left=`${T}px`,y.style.top=`${I}px`;for(let N=0;N<h.length;N++){const U=h[N];for(let w=0;w<U.tdList.length;w++){const Q=U.tdList[w],K=document.createElement("div");K.classList.add(`${re}-table-tool__border__row`),K.style.width=`${Q.width*a}px`,K.style.height=`${this.BORDER_VALUE}px`,K.style.top=`${(Q.y+Q.height)*a-this.BORDER_VALUE/2}px`,K.style.left=`${Q.x*a}px`,K.onmousedown=$=>{this._mousedown({evt:$,element:l,index:Q.rowIndex+Q.rowspan-1,order:hn.ROW})},y.appendChild(K);const z=document.createElement("div");if(z.classList.add(`${re}-table-tool__border__col`),z.style.width=`${this.BORDER_VALUE}px`,z.style.height=`${Q.height*a}px`,z.style.top=`${Q.y*a}px`,z.style.left=`${(Q.x+Q.width)*a-this.BORDER_VALUE/2}px`,z.onmousedown=$=>{this._mousedown({evt:$,element:l,index:Q.colIndex+Q.colspan-1,order:hn.COL})},y.appendChild(z),c&&Q.colIndex===0){const $=document.createElement("div");$.classList.add(`${re}-table-tool__border__col`),$.style.width=`${this.BORDER_VALUE}px`,$.style.height=`${Q.height*a}px`,$.style.top=`${Q.y*a}px`,$.style.left=`${Q.x*a-this.BORDER_VALUE/2}px`,$.onmousedown=le=>{this._mousedown({evt:le,element:l,index:0,isLeftStartBorder:!0,order:hn.COL})},y.appendChild($)}}}this.container.append(y),this.toolBorderContainer=y}_setAnchorActive(e,t){const n=e.children;for(let i=0;i<n.length;i++){const r=n[i];i===t?r.classList.add("active"):r.classList.remove("active")}}_mousedown(e){const{evt:t,index:n,order:i,element:r,isLeftStartBorder:s}=e;this.canvas=this.draw.getPage();const{scale:l,table:{overflow:a}}=this.options,c=this.draw.getWidth(),d=this.draw.getHeight(),u=this.draw.getPageGap(),h=this.draw.getPageNo()*(d+u),R=this.position.getPositionContext(),f=(this.position.getOriginalPositionList()[R.index]?.coordinate?.leftTop?.[0]||0)*l,T=this.draw.getMargins(),I=T[0],L=T[1],S=I,M=c-L;this.mousedownX=t.x,this.mousedownY=t.y;const X=t.target,x=this.canvas.getBoundingClientRect(),F=window.getComputedStyle(X).cursor;document.body.style.cursor=F,this.canvas.style.cursor=F;let D=0,V=0;const E=document.createElement("div");E.classList.add(`${re}-table-anchor__line`),i===hn.ROW?(E.classList.add(`${re}-table-anchor__line__row`),E.style.width=`${c}px`,D=0,V=h+this.mousedownY-x.top):(E.classList.add(`${re}-table-anchor__line__col`),E.style.height=`${d}px`,D=this.mousedownX-x.left,V=h),E.style.left=`${D}px`,E.style.top=`${V}px`,this.container.append(E),this.anchorLine=E;let v=0,b=0;const P=y=>{const N=this._mousemove(y,i,D,V);N&&(v=N.dx,b=N.dy)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",()=>{let y=!1;if(i===hn.ROW){const N=r.trList,U=N[n]||N[n-1],{defaultTrMinHeight:w}=this.options.table;b<0&&U.height+b<w&&(b=w-U.height),b&&(U.height+=b,U.minHeight=U.height,y=!0)}else{const{colgroup:N}=r;if(N&&v)if(a&&s){N[n].width-v/l<=this.MIN_TD_WIDTH&&(v=(N[n].width-this.MIN_TD_WIDTH)*l);const U=f+(r.translateX||0)*l;U+v<S&&(v=S-U),N[n].width-=v/l,r.width-=v/l,r.translateX=(r.translateX||0)+v/l,y=!0}else{const U=N[n].width;v<0&&U*l+v<this.MIN_TD_WIDTH*l&&(v=this.MIN_TD_WIDTH*l-U*l);const w=N[n+1]?.width;if(v>0&&w&&w*l-v<this.MIN_TD_WIDTH*l&&(v=w*l-this.MIN_TD_WIDTH*l),n===N.length-1){const K=f+(r.translateX||0)*l+r.width*l;K+v>M&&(v=M-K)}v&&(N.length-1!==n&&(N[n+1].width-=v/l),N[n].width+=v/l,y=!0)}}y&&this.draw.render({isSetCursor:!1}),E.remove(),document.removeEventListener("mousemove",P),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),t.preventDefault()}_mousemove(e,t,n,i){if(!this.anchorLine)return null;const r=e.x-this.mousedownX,s=e.y-this.mousedownY;return t===hn.ROW?this.anchorLine.style.top=`${i+s}px`:this.anchorLine.style.left=`${n+r}px`,e.preventDefault(),{dx:r,dy:s}}}class Eu{draw;options;container;hyperlinkPopupContainer;hyperlinkDom;constructor(e){this.draw=e,this.options=e.getOptions(),this.container=e.getContainer();const{hyperlinkPopupContainer:t,hyperlinkDom:n}=this._createHyperlinkPopupDom();this.hyperlinkDom=n,this.hyperlinkPopupContainer=t}_createHyperlinkPopupDom(){const e=document.createElement("div");e.classList.add(`${re}-hyperlink-popup`);const t=document.createElement("a");return t.target="_blank",t.rel="noopener",e.append(t),this.container.append(e),{hyperlinkPopupContainer:e,hyperlinkDom:t}}drawHyperlinkPopup(e,t){const{coordinate:{leftTop:[n,i]},lineHeight:r}=t,s=this.draw.getHeight(),l=this.draw.getPageGap(),a=this.draw.getPageNo()*(s+l);this.hyperlinkPopupContainer.style.display="block",this.hyperlinkPopupContainer.style.left=`${n}px`,this.hyperlinkPopupContainer.style.top=`${i+a+r}px`;const c=e.url||"#";this.hyperlinkDom.href=c,this.hyperlinkDom.title=c,this.hyperlinkDom.innerText=c}clearHyperlinkPopup(){this.hyperlinkPopupContainer.style.display="none"}openHyperlink(e){const t=window.open(e.url,"_blank");t&&(t.opener=null)}render(e,t,n,i){e.save(),e.font=t.style,t.color||(t.color=this.options.defaultHyperlinkColor),e.fillStyle=t.color,t.underline===void 0&&(t.underline=!0),e.fillText(t.value,n,i),e.restore()}}class Nu{options;constructor(e){this.options=e.getOptions()}render(e,t,n,i){const{scale:r,label:{defaultBackgroundColor:s,defaultColor:l,defaultBorderRadius:a,defaultPadding:c}}=this.options,d=t.label?.backgroundColor||s,u=t.label?.color||l,h=t.label?.borderRadius||a,R=t.label?.padding||c;e.save(),e.font=t.style;const{width:g,height:m,boundingBoxAscent:f}=t.metrics;e.fillStyle=d,this._drawRoundedRect(e,n,i-f,g,m+(R[0]+R[3])*r,h*r),e.fill(),e.fillStyle=u,e.fillText(t.value,n+R[3]*r,i),e.restore()}_drawRoundedRect(e,t,n,i,r,s){e.beginPath(),e.moveTo(t+s,n),e.lineTo(t+i-s,n),e.quadraticCurveTo(t+i,n,t+i,n+s),e.lineTo(t+i,n+r-s),e.quadraticCurveTo(t+i,n+r,t+i-s,n+r),e.lineTo(t+s,n+r),e.quadraticCurveTo(t,n+r,t,n+r-s),e.lineTo(t,n+s),e.quadraticCurveTo(t,n,t+s,n),e.closePath()}}class Fu{options;draw;constructor(e){this.draw=e,this.options=e.getOptions()}render(e,t,n,i){const r=this.draw.getMode(),s=t.macroConfig;if(r===B.EDIT){const a=t.label||t.value||"";this._renderEditMode(e,t,n,i,a);return}if(t.type==="macro"){const a=t.label||"",c=t.value||`获取 ${a}`;this._renderPlainText(e,t,n,i,c);return}if(t.type==="customMacro"){const a=s?.type||"text",c=s?.value||"",d=t.label||"";if(r===B.FORM)a==="select"?this._renderSelectControl(e,t,n,i,c):this._renderTextControl(e,t,n,i,c);else{const u=c||`获取 ${d}`;this._renderPlainText(e,t,n,i,u)}return}if(t.type==="reusableItem"){const c=t.reusableItemConfig?.value||"",d=t.label||"";if(r===B.FORM)this._renderTextControl(e,t,n,i,c);else{const u=c||`获取 ${d}`;this._renderPlainText(e,t,n,i,u)}return}const l=t.value||t.label||"";this._renderPlainText(e,t,n,i,l)}_renderPlainText(e,t,n,i,r){e.save(),e.font=t.style,e.fillStyle=t.color||"#000000",e.textBaseline="alphabetic",e.fillText(r,n,i),e.restore()}_renderEditMode(e,t,n,i,r){const{scale:s}=this.options,l=t.type==="customMacro",a=t.type==="reusableItem";let c,d;a?(c="#52c41a",d="#f6ffed"):l?(c="#fa8c16",d="#fff7e6"):(c="#1677ff",d="#e6f4ff"),e.save(),e.font=t.style;const u=e.measureText(r),h=u.actualBoundingBoxAscent+u.actualBoundingBoxDescent,R=8*s,g=4*s,m=4*s,f=u.width+R*2,T=h+g*2,I=t.metrics,L=n,S=i-I.boundingBoxAscent+(I.boundingBoxAscent+I.boundingBoxDescent-T)/2;e.fillStyle=d,this._drawRoundedRect(e,L,S,f,T,m),e.fill(),e.fillStyle=c,e.textBaseline="middle",e.fillText(r,n+R,S+T/2),e.restore()}_renderTextControl(e,t,n,i,r){const{scale:s,control:l,strikeoutColor:a}=this.options,{placeholderColor:c,bracketColor:d}=l;e.save(),e.font=t.style;const h=`请输入${t.label||""}`,R=r||h,m=e.measureText(R).width;e.fillStyle=d,e.textBaseline="alphabetic",e.fillText("[",n,i);const f=n+e.measureText("[").width;e.fillStyle=r?t.color||"#000000":c,e.fillText(R,f,i);const T=f+m;if(e.fillStyle=d,e.fillText("]",T,i),t.type==="reusableItem"){const I=e.measureText("[").width+m+e.measureText("]").width;if(e.lineWidth=s,this.draw.getMode()===B.PRINT?e.strokeStyle="transparent":e.strokeStyle=a||"red",t.strikeout){const L=i-3*s,S=i+3.5*s;e.beginPath(),e.moveTo(n,L),e.lineTo(n+I,L),e.stroke(),e.beginPath(),e.moveTo(n,S),e.lineTo(n+I,S),e.stroke()}else if(t.underline&&t.textDecoration?.style==="double"){const L=Math.floor(i+2*s)+.5,S=3*s;e.beginPath(),e.moveTo(n,L),e.lineTo(n+I,L),e.stroke(),e.beginPath(),e.moveTo(n,L+S),e.lineTo(n+I,L+S),e.stroke()}}e.restore()}_renderSelectControl(e,t,n,i,r){const{scale:s,control:l}=this.options,{placeholderColor:a,bracketColor:c}=l;e.save(),e.font=t.style;const u=`请选择${t.label||""}`,h=r||u,R=e.measureText(h),g=R.actualBoundingBoxAscent+R.actualBoundingBoxDescent;e.fillStyle=c,e.textBaseline="alphabetic",e.fillText("[",n,i);const m=n+e.measureText("[").width;e.fillStyle=r?t.color||"#000000":a,e.fillText(h,m,i);const f=m+R.width+2*s,T=i-g/2;e.beginPath(),e.moveTo(f,T-2*s),e.lineTo(f+5*s,T-2*s),e.lineTo(f+2.5*s,T+2*s),e.closePath(),e.fillStyle="#666666",e.fill();const I=f+6*s;e.fillStyle=c,e.fillText("]",I,i),e.restore()}_drawRoundedRect(e,t,n,i,r,s){e.beginPath(),e.moveTo(t+s,n),e.lineTo(t+i-s,n),e.quadraticCurveTo(t+i,n,t+i,n+s),e.lineTo(t+i,n+r-s),e.quadraticCurveTo(t+i,n+r,t+i-s,n+r),e.lineTo(t+s,n+r),e.quadraticCurveTo(t,n+r,t,n+r-s),e.lineTo(t,n+s),e.quadraticCurveTo(t,n,t+s,n),e.closePath()}}class Cu{draw;position;zone;options;elementList;rowList;positionList;constructor(e,t){this.draw=e,this.position=e.getPosition(),this.zone=e.getZone(),this.options=e.getOptions(),this.elementList=t||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(e){this.elementList=e}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const e=this.draw.getInnerWidth(),t=this.draw.getMargins(),n=xs(this.elementList);this.rowList=this.draw.computeRowList({startX:t[3],startY:this.getHeaderTop(),innerWidth:e,elementList:this.elementList,surroundElementList:n})}_computePositionList(){const e=this.getHeaderTop(),t=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],r=e;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:r,innerWidth:t,zone:De.HEADER})}getHeaderTop(){const{header:{top:e,disabled:t},scale:n}=this.options;return t?0:Math.floor(e*n)}getMaxHeight(){const{header:{maxHeightRadio:e}}=this.options,t=this.draw.getHeight();return Math.floor(t*gl[e])}getHeight(){if(this.options.header.disabled)return 0;const e=this.getMaxHeight(),t=this.getRowHeight();return t>e?e:t}getRowHeight(){return this.rowList.reduce((e,t)=>e+t.height,0)}getExtraHeight(){const e=this.draw.getMargins(),t=this.getHeight(),i=this.getHeaderTop()+t-e[0];return i<=0?0:i}render(e,t){e.save(),e.globalAlpha=this.zone.isHeaderActive()?1:this.options.header.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),r=[];let s=0;for(let l=0;l<this.rowList.length;l++){const a=this.rowList[l];if(s+a.height>i)break;r.push(a),s+=a.height}this.draw.drawRow(e,{elementList:this.elementList,positionList:this.positionList,rowList:r,pageNo:t,startIndex:0,innerWidth:n,zone:De.HEADER}),e.restore()}}class bu{getOffsetY(e){return-e.metrics.height/2}render(e,t,n,i){e.save(),e.font=t.style,t.color&&(e.fillStyle=t.color),e.fillText(t.value,n,i+this.getOffsetY(t)),e.restore()}}class yu{getOffsetY(e){return e.metrics.height/2}render(e,t,n,i){e.save(),e.font=t.style,t.color&&(e.fillStyle=t.color),e.fillText(t.value,n,i+this.getOffsetY(t)),e.restore()}}class xu{options;constructor(e){this.options=e.getOptions()}render(e,t,n,i){e.save();const{scale:r,separator:{lineWidth:s,strokeStyle:l}}=this.options;e.lineWidth=(t.lineWidth||s)*r,e.strokeStyle=t.color||l,t.dashArray?.length&&e.setLineDash(t.dashArray);const a=Math.round(i);e.translate(0,e.lineWidth/2),e.beginPath(),e.moveTo(n,a),e.lineTo(n+t.width*r,a),e.stroke(),e.restore()}}class vu{draw;options;i18n;constructor(e){this.draw=e,this.options=e.getOptions(),this.i18n=e.getI18n()}render(e,t,n,i){const{pageBreak:{font:r,fontSize:s,lineDash:l}}=this.options,a=this.i18n.t("pageBreak.displayName"),{scale:c,defaultRowMargin:d}=this.options,u=s*c,h=t.width*c,R=this.draw.getDefaultBasicRowMarginHeight()*d;e.save(),e.font=`${u}px ${r}`;const g=e.measureText(a),m=(h-g.width)/2;e.setLineDash(l),e.translate(0,.5+R),e.beginPath(),e.moveTo(n,i),e.lineTo(n+m,i),e.moveTo(n+m+g.width,i),e.lineTo(n+h,i),e.stroke(),e.fillText(a,n+m,i+g.actualBoundingBoxAscent-u/2),e.restore()}}class Wu{draw;options;imageCache;constructor(e){this.draw=e,this.options=e.getOptions(),this.imageCache=new Map}renderText(e,t){const{watermark:{data:n,opacity:i,font:r,size:s,color:l,repeat:a,gap:c,numberType:d},scale:u}=this.options,h=this.draw.getWidth(),R=this.draw.getHeight();e.save(),e.globalAlpha=i,e.font=`${s*u}px ${r}`;let g=n;const m=new RegExp(Co.PAGE_NO);m.test(g)&&(g=so.formatNumberPlaceholder(g,t+1,m,d));const f=new RegExp(Co.PAGE_COUNT);f.test(g)&&(g=so.formatNumberPlaceholder(g,this.draw.getPageCount(),f,d));const T=e.measureText(g);if(a){const I=this.draw.getPagePixelRatio(),L=document.createElement("canvas"),S=L.getContext("2d"),M=T.width,X=T.actualBoundingBoxAscent+T.actualBoundingBoxDescent,x=Math.sqrt(Math.pow(M,2)+Math.pow(X,2)),F=x+2*c[0]*u,D=x+2*c[1]*u;L.width=F,L.height=D,L.style.width=`${F*I}px`,L.style.height=`${D*I}px`,S.translate(F/2,D/2),S.rotate(-45*Math.PI/180),S.translate(-F/2,-D/2),S.font=`${s*u}px ${r}`,S.fillStyle=l,S.fillText(g,(F-M)/2,(D-X)/2+T.actualBoundingBoxAscent);const V=e.createPattern(L,"repeat");V&&(e.fillStyle=V,e.fillRect(0,0,h,R))}else{const I=h/2,L=R/2;e.fillStyle=l,e.translate(I,L),e.rotate(-45*Math.PI/180),e.fillText(g,-T.width/2,T.actualBoundingBoxAscent-s*u/2)}e.restore()}renderImage(e){const{watermark:{width:t,height:n,data:i,opacity:r,repeat:s,gap:l},scale:a}=this.options;if(!this.imageCache.has(i)){const R=new Image;R.setAttribute("crossOrigin","Anonymous"),R.src=i,R.onload=()=>{this.imageCache.set(i,R),this.draw.render({isCompute:!1,isSubmitHistory:!1})};return}const c=this.draw.getWidth(),d=this.draw.getHeight(),u=t*a,h=n*a;if(e.save(),e.globalAlpha=r,s){const R=this.draw.getPagePixelRatio(),g=document.createElement("canvas"),m=g.getContext("2d"),f=Math.sqrt(Math.pow(u,2)+Math.pow(h,2)),T=f+2*l[0]*a,I=f+2*l[1]*a;g.width=T,g.height=I,g.style.width=`${T*R}px`,g.style.height=`${I*R}px`,m.translate(T/2,I/2),m.rotate(-45*Math.PI/180),m.translate(-T/2,-I/2),m.drawImage(this.imageCache.get(i),(T-u)/2,(I-h)/2,u,h);const L=e.createPattern(g,"repeat");L&&(e.fillStyle=L,e.fillRect(0,0,c,d))}else{const R=c/2,g=d/2;e.translate(R,g),e.rotate(-45*Math.PI/180),e.drawImage(this.imageCache.get(i),-u/2,-h/2,u,h)}e.restore()}render(e,t){this.options.watermark.type===Ti.IMAGE?this.renderImage(e):this.renderText(e,t)}}class Du{draw;control;options;highlightList;highlightMatchResult;constructor(e){this.draw=e.getDraw(),this.control=e,this.options=this.draw.getOptions(),this.highlightList=[],this.highlightMatchResult=[]}getControlHighlight(e,t){const{control:{activeBackgroundColor:n,disabledBackgroundColor:i,existValueBackgroundColor:r,noValueBackgroundColor:s}}=this.options,l=e[t],a=this.draw.isPrintMode(),c=this.control.getActiveControl()?.getElement();let d=!1,u=!1,h=!1,R=!1;return l.highlight||(d=!a&&!!n&&!!c&&l.controlId===c.controlId&&!this.control.getIsRangeInPostfix()),d||(u=!a&&!!i&&!!l.control?.disabled),u||(h=!a&&!!r&&!!l.controlId&&this.control.getIsExistValueByElementListIndex(e,t)),h||(R=!a&&!!s&&!!l.controlId&&!this.control.getIsExistValueByElementListIndex(e,t)),(d?n:"")||(u?i:"")||(h?r:"")||(R?s:"")}getHighlightMatchResult(){return this.highlightMatchResult}getHighlightList(){return this.highlightList}setHighlightList(e){this.highlightList=e}computeHighlightList(){const e=this.draw.getSearch(),t=(n,i)=>{let r=0;for(;r<n.length;){const s=n[r];if(r++,s.type===O.TABLE){const g=s.trList;for(let m=0;m<g.length;m++){const f=g[m];for(let T=0;T<f.tdList.length;T++){const I=f.tdList[T],L={tableId:s.id,tableIndex:r-1,trIndex:m,tdIndex:T,tdId:I.id};t(I.value,L)}}}const l=s?.control;if(!l)continue;const a=this.highlightList.findIndex(g=>g.id===s.controlId||l.conceptId&&l.conceptId===g.conceptId);if(!~a)continue;const c=r;let d=r;for(;d<n.length&&n[d].controlId===s.controlId;)d++;r=d;const u=n.slice(c,d).map(g=>g.controlComponent===p.VALUE?g:{value:ee}),h=this.highlightList[a],{ruleList:R}=h;for(let g=0;g<R.length;g++){const m=R[g],f=e.getMatchList(m.keyword,u);this.highlightMatchResult.push(...f.map(T=>({...T,...m,...i,index:T.index+c})))}}};this.highlightMatchResult=[],t(this.draw.getOriginalMainElementList())}renderHighlightList(e,t){if(!this.highlightMatchResult?.length)return;const{searchMatchAlpha:n,searchMatchColor:i}=this.options,r=this.draw.getPosition().getOriginalPositionList(),s=this.draw.getOriginalElementList();e.save();for(let l=0;l<this.highlightMatchResult.length;l++){const a=this.highlightMatchResult[l];let c=null;if(a.tableId){const{tableIndex:I,trIndex:L,tdIndex:S,index:M}=a;c=s[I]?.trList[L].tdList[S]?.positionList[M]}else c=r[a.index];if(!c)continue;const{coordinate:{leftTop:d,leftBottom:u,rightTop:h},pageNo:R}=c;if(R!==t)continue;e.fillStyle=a.backgroundColor||i,e.globalAlpha=a.alpha||n;const g=d[0],m=d[1],f=h[0]-d[0],T=u[1]-d[1];e.fillRect(g,m,f,T)}e.restore()}}class Vu{borderRect;options;constructor(e){this.borderRect=this.clearBorderInfo(),this.options=e.getOptions()}clearBorderInfo(){return this.borderRect={x:0,y:0,width:0,height:0},this.borderRect}recordBorderInfo(e,t,n,i){!this.borderRect.width&&(this.borderRect.x=e,this.borderRect.y=t,this.borderRect.height=i),this.borderRect.width+=n}render(e){if(!this.borderRect.width)return;const{scale:t,control:{borderWidth:n,borderColor:i}}=this.options,{x:r,y:s,width:l,height:a}=this.borderRect;e.save(),e.translate(0,1*t),e.lineWidth=n*t,e.strokeStyle=i,e.beginPath(),e.rect(r,s,l,a),e.stroke(),e.restore(),this.clearBorderInfo()}}class mo{draw;element;control;isPopup;selectDom;options;VALUE_DELIMITER=",";DEFAULT_MULTI_SELECT_DELIMITER=",";constructor(e,t){const n=t.getDraw();this.draw=n,this.options=n.getOptions(),this.element=e,this.control=t,this.isPopup=!1,this.selectDom=null}setElement(e){this.element=e}getElement(){return this.element}getIsPopup(){return this.isPopup}getCodes(){return this.element?.control?.code?this.element.control.code.split(","):[]}getText(e){if(!this.element?.control)return null;const t=this.element.control;if(!t.valueSets?.length)return null;const n=t?.multiSelectDelimiter||this.DEFAULT_MULTI_SELECT_DELIMITER,i=t.valueSets,r=[];return e.forEach(s=>{const l=i.find(a=>a.code===s);l&&!Tl(l.value)&&r.push(l.value)}),r.join(n)||null}getValue(e={}){const{elementList:t,range:n}=this.control.mergeControl(e),{startIndex:i}=n,r=t[i],s=[];let l=i;for(;l>=0;){const c=t[l];if(!c||c.controlId!==r.controlId||c.controlComponent===p.PREFIX||c.controlComponent===p.PRE_TEXT)break;c.controlComponent===p.VALUE&&s.unshift(c),l--}let a=i+1;for(;a<t.length;){const c=t[a];if(c.controlId!==r.controlId||c.controlComponent===p.POSTFIX||c.controlComponent===p.POST_TEXT)break;c.controlComponent===p.VALUE&&s.push(c),a++}return s}setValue(e,t={},n={}){if(!this.element.control?.selectExclusiveOptions?.inputAble||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const{elementList:i,range:r}=this.control.mergeControl(t);this.control.shrinkBoundary(t);const{startIndex:s,endIndex:l}=r,a=this.control.getDraw();s!==l?a.spliceElementList(i,s+1,l-s):this.control.removePlaceholder(s,{elementList:i});const c=i[s],d=c.type&&!wt.includes(c.type)||c.controlComponent===p.PREFIX||c.controlComponent===p.PRE_TEXT?at(c,["control","controlId",...Ft]):$t(c,["type"]),u=r.startIndex+1;for(let h=0;h<e.length;h++){const R={...d,...e[h],controlComponent:p.VALUE};ze(i,[R],s,{editorOptions:this.options}),a.spliceElementList(i,u+h,0,[R])}return u+e.length-1}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=t[i],l=t[r],a=this.element.control?.selectExclusiveOptions?.inputAble;if(e.key===Te.Backspace)return i!==r?a?(this.draw.spliceElementList(t,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect():s.controlComponent===p.PREFIX||s.controlComponent===p.PRE_TEXT||l.controlComponent===p.POSTFIX||l.controlComponent===p.POST_TEXT||s.controlComponent===p.PLACEHOLDER?this.control.removeControl(i):a?(this.draw.spliceElementList(t,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1):this.clearSelect();if(e.key===Te.Delete){if(i!==r)return a?(this.draw.spliceElementList(t,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect();{const c=t[r+1];return(s.controlComponent===p.PREFIX||s.controlComponent===p.PRE_TEXT)&&c.controlComponent===p.PLACEHOLDER||c.controlComponent===p.POSTFIX||c.controlComponent===p.POST_TEXT||s.controlComponent===p.PLACEHOLDER?this.control.removeControl(i):a?(this.draw.spliceElementList(t,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i):this.clearSelect()}}return r}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:e,endIndex:t}=this.control.getRange();return e===t?e:this.clearSelect()}clearSelect(e={},t={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=t;if(!n&&this.control.getIsDisabledControl(e))return-1;const r=e.elementList||this.control.getElementList(),{startIndex:s}=e.range||this.control.getRange(),l=r[s];let a=-1,c=-1,d=s;for(;d>0;){const R=r[d];if(R.controlId!==l.controlId||R.controlComponent===p.PREFIX||R.controlComponent===p.PRE_TEXT){a=d;break}d--}let u=s+1;for(;u<r.length;){const R=r[u];if(R.controlId!==l.controlId||R.controlComponent===p.POSTFIX||R.controlComponent===p.POST_TEXT){c=u-1;break}u++}return!~a||!~c?-1:(this.control.getDraw().spliceElementList(r,a+1,c-a,[],{isIgnoreDeletedRule:t.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(d,e),this.control.setControlProperties({code:void 0},{elementList:r,range:{startIndex:d,endIndex:d}}),d)}setSelect(e,t={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return;const i=t.elementList||this.control.getElementList(),r=t.range||this.control.getRange(),s=this.element.control,l=e?.split(this.VALUE_DELIMITER)||[],a=s.code,c=s.code?.split(this.VALUE_DELIMITER)||[],d=s.isMultiSelect;if(!d&&e===a||d&&ml(c,l)){this.control.repaintControl({curIndex:r.startIndex,isCompute:!1,isSubmitHistory:!1}),this.destroy();return}const u=s.valueSets;if(!Array.isArray(u)||!u.length)return;const h=this.getText(l);if(!h){if(a){const S=this.clearSelect(t,{isIgnoreDeletedRule:n.isIgnoreDeletedRule});~S&&(this.control.repaintControl({curIndex:S}),this.control.emitControlContentChange({controlValue:[]}))}return}const R=this.getValue(t)[0],g=R?at(R,rn):at(i[r.startIndex],Ft),m=this.clearSelect(t,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~m)return;a||this.control.removePlaceholder(m,t);const f=$t(i[m],rn),T=m+1,I=be(h),L=this.control.getDraw();for(let S=0;S<I.length;S++){const M={...g,...f,type:O.TEXT,value:I[S],controlComponent:p.VALUE};(M.color===this.options.control.bracketColor||M.color===this.options.control.placeholderColor)&&(M.color=this.options.defaultColor),ze(i,[M],m,{editorOptions:this.options}),L.spliceElementList(i,T+S,0,[M])}if(this.control.setControlProperties({code:e},{elementList:i,range:{startIndex:m,endIndex:m}}),!t.range){const S=T+I.length-1;this.control.repaintControl({curIndex:S}),this.control.emitControlContentChange({context:t}),d||this.destroy()}}_createSelectPopupDom(){const e=this.element.control,t=e.valueSets;if(!Array.isArray(t)||!t.length)return;const n=this.control.getPosition();if(!n)return;const i=document.createElement("div");i.classList.add(`${re}-select-control-popup`),i.setAttribute(Rt,gt.POPUP);const r=document.createElement("ul");let s=null;for(let h=0;h<t.length;h++){const R=t[h],g=document.createElement("li");let m=this.getCodes();m.includes(R.code)&&(g.classList.add("active"),s=g),g.onclick=()=>{const f=m.findIndex(T=>T===R.code);e.isMultiSelect?~f?m.splice(f,1):m.push(R.code):~f?m=[]:m=[R.code],this.setSelect(m.join(this.VALUE_DELIMITER))},g.append(document.createTextNode(R.value)),r.append(g)}i.append(r);const{coordinate:{leftTop:[l,a]},lineHeight:c}=n,d=this.control.getPreY();i.style.left=`${l}px`,i.style.top=`${a+d+c}px`,this.control.getContainer().append(i),this.selectDom=i,s&&Ll(i,s)}awake(){if(this.isPopup||this.control.getIsDisabledControl())return;const{startIndex:e}=this.control.getRange(),n=this.control.getElementList()[e];if(!n||n.controlId!==this.element.controlId)return;const i=n.controlComponent===p.PREFIX||n.controlComponent===p.PRE_TEXT||n.controlComponent===p.POSTFIX||n.controlComponent===p.POST_TEXT||n.controlComponent===p.PLACEHOLDER;!this.control.getIsRangeWithinControl()&&!i||(this._createSelectPopupDom(),this.isPopup=!0)}destroy(){this.isPopup&&(this.selectDom?.remove(),this.isPopup=!1)}}var wl;function ce(){return wl.apply(null,arguments)}function Yu(o){wl=o}function qt(o){return o instanceof Array||Object.prototype.toString.call(o)==="[object Array]"}function Zn(o){return o!=null&&Object.prototype.toString.call(o)==="[object Object]"}function Je(o,e){return Object.prototype.hasOwnProperty.call(o,e)}function Vs(o){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(o).length===0;var e;for(e in o)if(Je(o,e))return!1;return!0}function yt(o){return o===void 0}function In(o){return typeof o=="number"||Object.prototype.toString.call(o)==="[object Number]"}function Vo(o){return o instanceof Date||Object.prototype.toString.call(o)==="[object Date]"}function Ul(o,e){var t=[],n,i=o.length;for(n=0;n<i;++n)t.push(e(o[n],n));return t}function En(o,e){for(var t in e)Je(e,t)&&(o[t]=e[t]);return Je(e,"toString")&&(o.toString=e.toString),Je(e,"valueOf")&&(o.valueOf=e.valueOf),o}function an(o,e,t,n){return aa(o,e,t,n,!0).utc()}function wu(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Ve(o){return o._pf==null&&(o._pf=wu()),o._pf}var gs;Array.prototype.some?gs=Array.prototype.some:gs=function(o){var e=Object(this),t=e.length>>>0,n;for(n=0;n<t;n++)if(n in e&&o.call(this,e[n],n,e))return!0;return!1};function Ys(o){var e=null,t=!1,n=o._d&&!isNaN(o._d.getTime());if(n&&(e=Ve(o),t=gs.call(e.parsedDateParts,function(i){return i!=null}),n=e.overflow<0&&!e.empty&&!e.invalidEra&&!e.invalidMonth&&!e.invalidWeekday&&!e.weekdayMismatch&&!e.nullInput&&!e.invalidFormat&&!e.userInvalidated&&(!e.meridiem||e.meridiem&&t),o._strict&&(n=n&&e.charsLeftOver===0&&e.unusedTokens.length===0&&e.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(o))o._isValid=n;else return n;return o._isValid}function Li(o){var e=an(NaN);return o!=null?En(Ve(e),o):Ve(e).userInvalidated=!0,e}var Qr=ce.momentProperties=[],Gi=!1;function ws(o,e){var t,n,i,r=Qr.length;if(yt(e._isAMomentObject)||(o._isAMomentObject=e._isAMomentObject),yt(e._i)||(o._i=e._i),yt(e._f)||(o._f=e._f),yt(e._l)||(o._l=e._l),yt(e._strict)||(o._strict=e._strict),yt(e._tzm)||(o._tzm=e._tzm),yt(e._isUTC)||(o._isUTC=e._isUTC),yt(e._offset)||(o._offset=e._offset),yt(e._pf)||(o._pf=Ve(e)),yt(e._locale)||(o._locale=e._locale),r>0)for(t=0;t<r;t++)n=Qr[t],i=e[n],yt(i)||(o[n]=i);return o}function Yo(o){ws(this,o),this._d=new Date(o._d!=null?o._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),Gi===!1&&(Gi=!0,ce.updateOffset(this),Gi=!1)}function jt(o){return o instanceof Yo||o!=null&&o._isAMomentObject!=null}function Zl(o){ce.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+o)}function Gt(o,e){var t=!0;return En(function(){if(ce.deprecationHandler!=null&&ce.deprecationHandler(null,o),t){var n=[],i,r,s,l=arguments.length;for(r=0;r<l;r++){if(i="",typeof arguments[r]=="object"){i+=`
101
+ [`+r+"] ";for(s in arguments[0])Je(arguments[0],s)&&(i+=s+": "+arguments[0][s]+", ");i=i.slice(0,-2)}else i=arguments[r];n.push(i)}Zl(o+`
102
+ Arguments: `+Array.prototype.slice.call(n).join("")+`
103
+ `+new Error().stack),t=!1}return e.apply(this,arguments)},e)}var Kr={};function Ql(o,e){ce.deprecationHandler!=null&&ce.deprecationHandler(o,e),Kr[o]||(Zl(e),Kr[o]=!0)}ce.suppressDeprecationWarnings=!1;ce.deprecationHandler=null;function cn(o){return typeof Function<"u"&&o instanceof Function||Object.prototype.toString.call(o)==="[object Function]"}function Uu(o){var e,t;for(t in o)Je(o,t)&&(e=o[t],cn(e)?this[t]=e:this["_"+t]=e);this._config=o,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function ps(o,e){var t=En({},o),n;for(n in e)Je(e,n)&&(Zn(o[n])&&Zn(e[n])?(t[n]={},En(t[n],o[n]),En(t[n],e[n])):e[n]!=null?t[n]=e[n]:delete t[n]);for(n in o)Je(o,n)&&!Je(e,n)&&Zn(o[n])&&(t[n]=En({},t[n]));return t}function Us(o){o!=null&&this.set(o)}var fs;Object.keys?fs=Object.keys:fs=function(o){var e,t=[];for(e in o)Je(o,e)&&t.push(e);return t};var Zu={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function Qu(o,e,t){var n=this._calendar[o]||this._calendar.sameElse;return cn(n)?n.call(e,t):n}function ln(o,e,t){var n=""+Math.abs(o),i=e-n.length,r=o>=0;return(r?t?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+n}var Zs=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,zo=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Ji={},eo={};function Me(o,e,t,n){var i=n;typeof n=="string"&&(i=function(){return this[n]()}),o&&(eo[o]=i),e&&(eo[e[0]]=function(){return ln(i.apply(this,arguments),e[1],e[2])}),t&&(eo[t]=function(){return this.localeData().ordinal(i.apply(this,arguments),o)})}function Ku(o){return o.match(/\[[\s\S]/)?o.replace(/^\[|\]$/g,""):o.replace(/\\/g,"")}function Hu(o){var e=o.match(Zs),t,n;for(t=0,n=e.length;t<n;t++)eo[e[t]]?e[t]=eo[e[t]]:e[t]=Ku(e[t]);return function(i){var r="",s;for(s=0;s<n;s++)r+=cn(e[s])?e[s].call(i,o):e[s];return r}}function ei(o,e){return o.isValid()?(e=Kl(e,o.localeData()),Ji[e]=Ji[e]||Hu(e),Ji[e](o)):o.localeData().invalidDate()}function Kl(o,e){var t=5;function n(i){return e.longDateFormat(i)||i}for(zo.lastIndex=0;t>=0&&zo.test(o);)o=o.replace(zo,n),zo.lastIndex=0,t-=1;return o}var _u={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Au(o){var e=this._longDateFormat[o],t=this._longDateFormat[o.toUpperCase()];return e||!t?e:(this._longDateFormat[o]=t.match(Zs).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[o])}var ku="Invalid date";function Gu(){return this._invalidDate}var Ju="%d",Bu=/\d{1,2}/;function zu(o){return this._ordinal.replace("%d",o)}var $u={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function qu(o,e,t,n){var i=this._relativeTime[t];return cn(i)?i(o,e,t,n):i.replace(/%d/i,o)}function ju(o,e){var t=this._relativeTime[o>0?"future":"past"];return cn(t)?t(e):t.replace(/%s/i,e)}var Hr={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Jt(o){return typeof o=="string"?Hr[o]||Hr[o.toLowerCase()]:void 0}function Qs(o){var e={},t,n;for(n in o)Je(o,n)&&(t=Jt(n),t&&(e[t]=o[n]));return e}var eh={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function th(o){var e=[],t;for(t in o)Je(o,t)&&e.push({unit:t,priority:eh[t]});return e.sort(function(n,i){return n.priority-i.priority}),e}var Hl=/\d/,Ut=/\d\d/,_l=/\d{3}/,Ks=/\d{4}/,Ii=/[+-]?\d{6}/,it=/\d\d?/,Al=/\d\d\d\d?/,kl=/\d\d\d\d\d\d?/,Pi=/\d{1,3}/,Hs=/\d{1,4}/,Oi=/[+-]?\d{1,6}/,ro=/\d+/,Si=/[+-]?\d+/,nh=/Z|[+-]\d\d:?\d\d/gi,Mi=/Z|[+-]\d\d(?::?\d\d)?/gi,oh=/[+-]?\d+(\.\d{1,3})?/,wo=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,lo=/^[1-9]\d?/,_s=/^([1-9]\d|\d)/,ui;ui={};function Re(o,e,t){ui[o]=cn(e)?e:function(n,i){return n&&t?t:e}}function ih(o,e){return Je(ui,o)?ui[o](e._strict,e._locale):new RegExp(sh(o))}function sh(o){return Tn(o.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,i,r){return t||n||i||r}))}function Tn(o){return o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function At(o){return o<0?Math.ceil(o)||0:Math.floor(o)}function He(o){var e=+o,t=0;return e!==0&&isFinite(e)&&(t=At(e)),t}var ms={};function $e(o,e){var t,n=e,i;for(typeof o=="string"&&(o=[o]),In(e)&&(n=function(r,s){s[e]=He(r)}),i=o.length,t=0;t<i;t++)ms[o[t]]=n}function Uo(o,e){$e(o,function(t,n,i,r){i._w=i._w||{},e(t,i._w,i,r)})}function rh(o,e,t){e!=null&&Je(ms,o)&&ms[o](e,t._a,t,o)}function Xi(o){return o%4===0&&o%100!==0||o%400===0}var Xt=0,fn=1,sn=2,Lt=3,zt=4,mn=5,Un=6,lh=7,ah=8;Me("Y",0,0,function(){var o=this.year();return o<=9999?ln(o,4):"+"+o});Me(0,["YY",2],0,function(){return this.year()%100});Me(0,["YYYY",4],0,"year");Me(0,["YYYYY",5],0,"year");Me(0,["YYYYYY",6,!0],0,"year");Re("Y",Si);Re("YY",it,Ut);Re("YYYY",Hs,Ks);Re("YYYYY",Oi,Ii);Re("YYYYYY",Oi,Ii);$e(["YYYYY","YYYYYY"],Xt);$e("YYYY",function(o,e){e[Xt]=o.length===2?ce.parseTwoDigitYear(o):He(o)});$e("YY",function(o,e){e[Xt]=ce.parseTwoDigitYear(o)});$e("Y",function(o,e){e[Xt]=parseInt(o,10)});function No(o){return Xi(o)?366:365}ce.parseTwoDigitYear=function(o){return He(o)+(He(o)>68?1900:2e3)};var Gl=ao("FullYear",!0);function ch(){return Xi(this.year())}function ao(o,e){return function(t){return t!=null?(Jl(this,o,t),ce.updateOffset(this,e),this):yo(this,o)}}function yo(o,e){if(!o.isValid())return NaN;var t=o._d,n=o._isUTC;switch(e){case"Milliseconds":return n?t.getUTCMilliseconds():t.getMilliseconds();case"Seconds":return n?t.getUTCSeconds():t.getSeconds();case"Minutes":return n?t.getUTCMinutes():t.getMinutes();case"Hours":return n?t.getUTCHours():t.getHours();case"Date":return n?t.getUTCDate():t.getDate();case"Day":return n?t.getUTCDay():t.getDay();case"Month":return n?t.getUTCMonth():t.getMonth();case"FullYear":return n?t.getUTCFullYear():t.getFullYear();default:return NaN}}function Jl(o,e,t){var n,i,r,s,l;if(!(!o.isValid()||isNaN(t))){switch(n=o._d,i=o._isUTC,e){case"Milliseconds":return void(i?n.setUTCMilliseconds(t):n.setMilliseconds(t));case"Seconds":return void(i?n.setUTCSeconds(t):n.setSeconds(t));case"Minutes":return void(i?n.setUTCMinutes(t):n.setMinutes(t));case"Hours":return void(i?n.setUTCHours(t):n.setHours(t));case"Date":return void(i?n.setUTCDate(t):n.setDate(t));case"FullYear":break;default:return}r=t,s=o.month(),l=o.date(),l=l===29&&s===1&&!Xi(r)?28:l,i?n.setUTCFullYear(r,s,l):n.setFullYear(r,s,l)}}function dh(o){return o=Jt(o),cn(this[o])?this[o]():this}function uh(o,e){if(typeof o=="object"){o=Qs(o);var t=th(o),n,i=t.length;for(n=0;n<i;n++)this[t[n].unit](o[t[n].unit])}else if(o=Jt(o),cn(this[o]))return this[o](e);return this}function hh(o,e){return(o%e+e)%e}var ut;Array.prototype.indexOf?ut=Array.prototype.indexOf:ut=function(o){var e;for(e=0;e<this.length;++e)if(this[e]===o)return e;return-1};function As(o,e){if(isNaN(o)||isNaN(e))return NaN;var t=hh(e,12);return o+=(e-t)/12,t===1?Xi(o)?29:28:31-t%7%2}Me("M",["MM",2],"Mo",function(){return this.month()+1});Me("MMM",0,0,function(o){return this.localeData().monthsShort(this,o)});Me("MMMM",0,0,function(o){return this.localeData().months(this,o)});Re("M",it,lo);Re("MM",it,Ut);Re("MMM",function(o,e){return e.monthsShortRegex(o)});Re("MMMM",function(o,e){return e.monthsRegex(o)});$e(["M","MM"],function(o,e){e[fn]=He(o)-1});$e(["MMM","MMMM"],function(o,e,t,n){var i=t._locale.monthsParse(o,n,t._strict);i!=null?e[fn]=i:Ve(t).invalidMonth=o});var Rh="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Bl="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),zl=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,gh=wo,ph=wo;function fh(o,e){return o?qt(this._months)?this._months[o.month()]:this._months[(this._months.isFormat||zl).test(e)?"format":"standalone"][o.month()]:qt(this._months)?this._months:this._months.standalone}function mh(o,e){return o?qt(this._monthsShort)?this._monthsShort[o.month()]:this._monthsShort[zl.test(e)?"format":"standalone"][o.month()]:qt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function Th(o,e,t){var n,i,r,s=o.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)r=an([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(r,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(r,"").toLocaleLowerCase();return t?e==="MMM"?(i=ut.call(this._shortMonthsParse,s),i!==-1?i:null):(i=ut.call(this._longMonthsParse,s),i!==-1?i:null):e==="MMM"?(i=ut.call(this._shortMonthsParse,s),i!==-1?i:(i=ut.call(this._longMonthsParse,s),i!==-1?i:null)):(i=ut.call(this._longMonthsParse,s),i!==-1?i:(i=ut.call(this._shortMonthsParse,s),i!==-1?i:null))}function Lh(o,e,t){var n,i,r;if(this._monthsParseExact)return Th.call(this,o,e,t);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(i=an([2e3,n]),t&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),!t&&!this._monthsParse[n]&&(r="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[n]=new RegExp(r.replace(".",""),"i")),t&&e==="MMMM"&&this._longMonthsParse[n].test(o))return n;if(t&&e==="MMM"&&this._shortMonthsParse[n].test(o))return n;if(!t&&this._monthsParse[n].test(o))return n}}function $l(o,e){if(!o.isValid())return o;if(typeof e=="string"){if(/^\d+$/.test(e))e=He(e);else if(e=o.localeData().monthsParse(e),!In(e))return o}var t=e,n=o.date();return n=n<29?n:Math.min(n,As(o.year(),t)),o._isUTC?o._d.setUTCMonth(t,n):o._d.setMonth(t,n),o}function ql(o){return o!=null?($l(this,o),ce.updateOffset(this,!0),this):yo(this,"Month")}function Ih(){return As(this.year(),this.month())}function Ph(o){return this._monthsParseExact?(Je(this,"_monthsRegex")||jl.call(this),o?this._monthsShortStrictRegex:this._monthsShortRegex):(Je(this,"_monthsShortRegex")||(this._monthsShortRegex=gh),this._monthsShortStrictRegex&&o?this._monthsShortStrictRegex:this._monthsShortRegex)}function Oh(o){return this._monthsParseExact?(Je(this,"_monthsRegex")||jl.call(this),o?this._monthsStrictRegex:this._monthsRegex):(Je(this,"_monthsRegex")||(this._monthsRegex=ph),this._monthsStrictRegex&&o?this._monthsStrictRegex:this._monthsRegex)}function jl(){function o(a,c){return c.length-a.length}var e=[],t=[],n=[],i,r,s,l;for(i=0;i<12;i++)r=an([2e3,i]),s=Tn(this.monthsShort(r,"")),l=Tn(this.months(r,"")),e.push(s),t.push(l),n.push(l),n.push(s);e.sort(o),t.sort(o),n.sort(o),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Sh(o,e,t,n,i,r,s){var l;return o<100&&o>=0?(l=new Date(o+400,e,t,n,i,r,s),isFinite(l.getFullYear())&&l.setFullYear(o)):l=new Date(o,e,t,n,i,r,s),l}function xo(o){var e,t;return o<100&&o>=0?(t=Array.prototype.slice.call(arguments),t[0]=o+400,e=new Date(Date.UTC.apply(null,t)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(o)):e=new Date(Date.UTC.apply(null,arguments)),e}function hi(o,e,t){var n=7+e-t,i=(7+xo(o,0,n).getUTCDay()-e)%7;return-i+n-1}function ea(o,e,t,n,i){var r=(7+t-n)%7,s=hi(o,n,i),l=1+7*(e-1)+r+s,a,c;return l<=0?(a=o-1,c=No(a)+l):l>No(o)?(a=o+1,c=l-No(o)):(a=o,c=l),{year:a,dayOfYear:c}}function vo(o,e,t){var n=hi(o.year(),e,t),i=Math.floor((o.dayOfYear()-n-1)/7)+1,r,s;return i<1?(s=o.year()-1,r=i+Ln(s,e,t)):i>Ln(o.year(),e,t)?(r=i-Ln(o.year(),e,t),s=o.year()+1):(s=o.year(),r=i),{week:r,year:s}}function Ln(o,e,t){var n=hi(o,e,t),i=hi(o+1,e,t);return(No(o)-n+i)/7}Me("w",["ww",2],"wo","week");Me("W",["WW",2],"Wo","isoWeek");Re("w",it,lo);Re("ww",it,Ut);Re("W",it,lo);Re("WW",it,Ut);Uo(["w","ww","W","WW"],function(o,e,t,n){e[n.substr(0,1)]=He(o)});function Mh(o){return vo(o,this._week.dow,this._week.doy).week}var Xh={dow:0,doy:6};function Eh(){return this._week.dow}function Nh(){return this._week.doy}function Fh(o){var e=this.localeData().week(this);return o==null?e:this.add((o-e)*7,"d")}function Ch(o){var e=vo(this,1,4).week;return o==null?e:this.add((o-e)*7,"d")}Me("d",0,"do","day");Me("dd",0,0,function(o){return this.localeData().weekdaysMin(this,o)});Me("ddd",0,0,function(o){return this.localeData().weekdaysShort(this,o)});Me("dddd",0,0,function(o){return this.localeData().weekdays(this,o)});Me("e",0,0,"weekday");Me("E",0,0,"isoWeekday");Re("d",it);Re("e",it);Re("E",it);Re("dd",function(o,e){return e.weekdaysMinRegex(o)});Re("ddd",function(o,e){return e.weekdaysShortRegex(o)});Re("dddd",function(o,e){return e.weekdaysRegex(o)});Uo(["dd","ddd","dddd"],function(o,e,t,n){var i=t._locale.weekdaysParse(o,n,t._strict);i!=null?e.d=i:Ve(t).invalidWeekday=o});Uo(["d","e","E"],function(o,e,t,n){e[n]=He(o)});function bh(o,e){return typeof o!="string"?o:isNaN(o)?(o=e.weekdaysParse(o),typeof o=="number"?o:null):parseInt(o,10)}function yh(o,e){return typeof o=="string"?e.weekdaysParse(o)%7||7:isNaN(o)?null:o}function ks(o,e){return o.slice(e,7).concat(o.slice(0,e))}var xh="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),ta="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),vh="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Wh=wo,Dh=wo,Vh=wo;function Yh(o,e){var t=qt(this._weekdays)?this._weekdays:this._weekdays[o&&o!==!0&&this._weekdays.isFormat.test(e)?"format":"standalone"];return o===!0?ks(t,this._week.dow):o?t[o.day()]:t}function wh(o){return o===!0?ks(this._weekdaysShort,this._week.dow):o?this._weekdaysShort[o.day()]:this._weekdaysShort}function Uh(o){return o===!0?ks(this._weekdaysMin,this._week.dow):o?this._weekdaysMin[o.day()]:this._weekdaysMin}function Zh(o,e,t){var n,i,r,s=o.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)r=an([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(r,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(r,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(r,"").toLocaleLowerCase();return t?e==="dddd"?(i=ut.call(this._weekdaysParse,s),i!==-1?i:null):e==="ddd"?(i=ut.call(this._shortWeekdaysParse,s),i!==-1?i:null):(i=ut.call(this._minWeekdaysParse,s),i!==-1?i:null):e==="dddd"?(i=ut.call(this._weekdaysParse,s),i!==-1||(i=ut.call(this._shortWeekdaysParse,s),i!==-1)?i:(i=ut.call(this._minWeekdaysParse,s),i!==-1?i:null)):e==="ddd"?(i=ut.call(this._shortWeekdaysParse,s),i!==-1||(i=ut.call(this._weekdaysParse,s),i!==-1)?i:(i=ut.call(this._minWeekdaysParse,s),i!==-1?i:null)):(i=ut.call(this._minWeekdaysParse,s),i!==-1||(i=ut.call(this._weekdaysParse,s),i!==-1)?i:(i=ut.call(this._shortWeekdaysParse,s),i!==-1?i:null))}function Qh(o,e,t){var n,i,r;if(this._weekdaysParseExact)return Zh.call(this,o,e,t);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(i=an([2e3,1]).day(n),t&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(r="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[n]=new RegExp(r.replace(".",""),"i")),t&&e==="dddd"&&this._fullWeekdaysParse[n].test(o))return n;if(t&&e==="ddd"&&this._shortWeekdaysParse[n].test(o))return n;if(t&&e==="dd"&&this._minWeekdaysParse[n].test(o))return n;if(!t&&this._weekdaysParse[n].test(o))return n}}function Kh(o){if(!this.isValid())return o!=null?this:NaN;var e=yo(this,"Day");return o!=null?(o=bh(o,this.localeData()),this.add(o-e,"d")):e}function Hh(o){if(!this.isValid())return o!=null?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return o==null?e:this.add(o-e,"d")}function _h(o){if(!this.isValid())return o!=null?this:NaN;if(o!=null){var e=yh(o,this.localeData());return this.day(this.day()%7?e:e-7)}else return this.day()||7}function Ah(o){return this._weekdaysParseExact?(Je(this,"_weekdaysRegex")||Gs.call(this),o?this._weekdaysStrictRegex:this._weekdaysRegex):(Je(this,"_weekdaysRegex")||(this._weekdaysRegex=Wh),this._weekdaysStrictRegex&&o?this._weekdaysStrictRegex:this._weekdaysRegex)}function kh(o){return this._weekdaysParseExact?(Je(this,"_weekdaysRegex")||Gs.call(this),o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Je(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Dh),this._weekdaysShortStrictRegex&&o?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Gh(o){return this._weekdaysParseExact?(Je(this,"_weekdaysRegex")||Gs.call(this),o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Je(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Vh),this._weekdaysMinStrictRegex&&o?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Gs(){function o(d,u){return u.length-d.length}var e=[],t=[],n=[],i=[],r,s,l,a,c;for(r=0;r<7;r++)s=an([2e3,1]).day(r),l=Tn(this.weekdaysMin(s,"")),a=Tn(this.weekdaysShort(s,"")),c=Tn(this.weekdays(s,"")),e.push(l),t.push(a),n.push(c),i.push(l),i.push(a),i.push(c);e.sort(o),t.sort(o),n.sort(o),i.sort(o),this._weekdaysRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+t.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+e.join("|")+")","i")}function Js(){return this.hours()%12||12}function Jh(){return this.hours()||24}Me("H",["HH",2],0,"hour");Me("h",["hh",2],0,Js);Me("k",["kk",2],0,Jh);Me("hmm",0,0,function(){return""+Js.apply(this)+ln(this.minutes(),2)});Me("hmmss",0,0,function(){return""+Js.apply(this)+ln(this.minutes(),2)+ln(this.seconds(),2)});Me("Hmm",0,0,function(){return""+this.hours()+ln(this.minutes(),2)});Me("Hmmss",0,0,function(){return""+this.hours()+ln(this.minutes(),2)+ln(this.seconds(),2)});function na(o,e){Me(o,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}na("a",!0);na("A",!1);function oa(o,e){return e._meridiemParse}Re("a",oa);Re("A",oa);Re("H",it,_s);Re("h",it,lo);Re("k",it,lo);Re("HH",it,Ut);Re("hh",it,Ut);Re("kk",it,Ut);Re("hmm",Al);Re("hmmss",kl);Re("Hmm",Al);Re("Hmmss",kl);$e(["H","HH"],Lt);$e(["k","kk"],function(o,e,t){var n=He(o);e[Lt]=n===24?0:n});$e(["a","A"],function(o,e,t){t._isPm=t._locale.isPM(o),t._meridiem=o});$e(["h","hh"],function(o,e,t){e[Lt]=He(o),Ve(t).bigHour=!0});$e("hmm",function(o,e,t){var n=o.length-2;e[Lt]=He(o.substr(0,n)),e[zt]=He(o.substr(n)),Ve(t).bigHour=!0});$e("hmmss",function(o,e,t){var n=o.length-4,i=o.length-2;e[Lt]=He(o.substr(0,n)),e[zt]=He(o.substr(n,2)),e[mn]=He(o.substr(i)),Ve(t).bigHour=!0});$e("Hmm",function(o,e,t){var n=o.length-2;e[Lt]=He(o.substr(0,n)),e[zt]=He(o.substr(n))});$e("Hmmss",function(o,e,t){var n=o.length-4,i=o.length-2;e[Lt]=He(o.substr(0,n)),e[zt]=He(o.substr(n,2)),e[mn]=He(o.substr(i))});function Bh(o){return(o+"").toLowerCase().charAt(0)==="p"}var zh=/[ap]\.?m?\.?/i,$h=ao("Hours",!0);function qh(o,e,t){return o>11?t?"pm":"PM":t?"am":"AM"}var ia={calendar:Zu,longDateFormat:_u,invalidDate:ku,ordinal:Ju,dayOfMonthOrdinalParse:Bu,relativeTime:$u,months:Rh,monthsShort:Bl,week:Xh,weekdays:xh,weekdaysMin:vh,weekdaysShort:ta,meridiemParse:zh},st={},To={},Wo;function jh(o,e){var t,n=Math.min(o.length,e.length);for(t=0;t<n;t+=1)if(o[t]!==e[t])return t;return n}function _r(o){return o&&o.toLowerCase().replace("_","-")}function eR(o){for(var e=0,t,n,i,r;e<o.length;){for(r=_r(o[e]).split("-"),t=r.length,n=_r(o[e+1]),n=n?n.split("-"):null;t>0;){if(i=Ei(r.slice(0,t).join("-")),i)return i;if(n&&n.length>=t&&jh(r,n)>=t-1)break;t--}e++}return Wo}function tR(o){return!!(o&&o.match("^[^/\\\\]*$"))}function Ei(o){var e=null,t;if(st[o]===void 0&&typeof si<"u"&&si&&si.exports&&tR(o))try{e=Wo._abbr,t=require,t("./locale/"+o),Cn(e)}catch{st[o]=null}return st[o]}function Cn(o,e){var t;return o&&(yt(e)?t=Pn(o):t=Bs(o,e),t?Wo=t:typeof console<"u"&&console.warn&&console.warn("Locale "+o+" not found. Did you forget to load it?")),Wo._abbr}function Bs(o,e){if(e!==null){var t,n=ia;if(e.abbr=o,st[o]!=null)Ql("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=st[o]._config;else if(e.parentLocale!=null)if(st[e.parentLocale]!=null)n=st[e.parentLocale]._config;else if(t=Ei(e.parentLocale),t!=null)n=t._config;else return To[e.parentLocale]||(To[e.parentLocale]=[]),To[e.parentLocale].push({name:o,config:e}),null;return st[o]=new Us(ps(n,e)),To[o]&&To[o].forEach(function(i){Bs(i.name,i.config)}),Cn(o),st[o]}else return delete st[o],null}function nR(o,e){if(e!=null){var t,n,i=ia;st[o]!=null&&st[o].parentLocale!=null?st[o].set(ps(st[o]._config,e)):(n=Ei(o),n!=null&&(i=n._config),e=ps(i,e),n==null&&(e.abbr=o),t=new Us(e),t.parentLocale=st[o],st[o]=t),Cn(o)}else st[o]!=null&&(st[o].parentLocale!=null?(st[o]=st[o].parentLocale,o===Cn()&&Cn(o)):st[o]!=null&&delete st[o]);return st[o]}function Pn(o){var e;if(o&&o._locale&&o._locale._abbr&&(o=o._locale._abbr),!o)return Wo;if(!qt(o)){if(e=Ei(o),e)return e;o=[o]}return eR(o)}function oR(){return fs(st)}function zs(o){var e,t=o._a;return t&&Ve(o).overflow===-2&&(e=t[fn]<0||t[fn]>11?fn:t[sn]<1||t[sn]>As(t[Xt],t[fn])?sn:t[Lt]<0||t[Lt]>24||t[Lt]===24&&(t[zt]!==0||t[mn]!==0||t[Un]!==0)?Lt:t[zt]<0||t[zt]>59?zt:t[mn]<0||t[mn]>59?mn:t[Un]<0||t[Un]>999?Un:-1,Ve(o)._overflowDayOfYear&&(e<Xt||e>sn)&&(e=sn),Ve(o)._overflowWeeks&&e===-1&&(e=lh),Ve(o)._overflowWeekday&&e===-1&&(e=ah),Ve(o).overflow=e),o}var iR=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,sR=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,rR=/Z|[+-]\d\d(?::?\d\d)?/,$o=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Bi=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],lR=/^\/?Date\((-?\d+)/i,aR=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,cR={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function sa(o){var e,t,n=o._i,i=iR.exec(n)||sR.exec(n),r,s,l,a,c=$o.length,d=Bi.length;if(i){for(Ve(o).iso=!0,e=0,t=c;e<t;e++)if($o[e][1].exec(i[1])){s=$o[e][0],r=$o[e][2]!==!1;break}if(s==null){o._isValid=!1;return}if(i[3]){for(e=0,t=d;e<t;e++)if(Bi[e][1].exec(i[3])){l=(i[2]||" ")+Bi[e][0];break}if(l==null){o._isValid=!1;return}}if(!r&&l!=null){o._isValid=!1;return}if(i[4])if(rR.exec(i[4]))a="Z";else{o._isValid=!1;return}o._f=s+(l||"")+(a||""),qs(o)}else o._isValid=!1}function dR(o,e,t,n,i,r){var s=[uR(o),Bl.indexOf(e),parseInt(t,10),parseInt(n,10),parseInt(i,10)];return r&&s.push(parseInt(r,10)),s}function uR(o){var e=parseInt(o,10);return e<=49?2e3+e:e<=999?1900+e:e}function hR(o){return o.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function RR(o,e,t){if(o){var n=ta.indexOf(o),i=new Date(e[0],e[1],e[2]).getDay();if(n!==i)return Ve(t).weekdayMismatch=!0,t._isValid=!1,!1}return!0}function gR(o,e,t){if(o)return cR[o];if(e)return 0;var n=parseInt(t,10),i=n%100,r=(n-i)/100;return r*60+i}function ra(o){var e=aR.exec(hR(o._i)),t;if(e){if(t=dR(e[4],e[3],e[2],e[5],e[6],e[7]),!RR(e[1],t,o))return;o._a=t,o._tzm=gR(e[8],e[9],e[10]),o._d=xo.apply(null,o._a),o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),Ve(o).rfc2822=!0}else o._isValid=!1}function pR(o){var e=lR.exec(o._i);if(e!==null){o._d=new Date(+e[1]);return}if(sa(o),o._isValid===!1)delete o._isValid;else return;if(ra(o),o._isValid===!1)delete o._isValid;else return;o._strict?o._isValid=!1:ce.createFromInputFallback(o)}ce.createFromInputFallback=Gt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(o){o._d=new Date(o._i+(o._useUTC?" UTC":""))});function kn(o,e,t){return o??e??t}function fR(o){var e=new Date(ce.now());return o._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function $s(o){var e,t,n=[],i,r,s;if(!o._d){for(i=fR(o),o._w&&o._a[sn]==null&&o._a[fn]==null&&mR(o),o._dayOfYear!=null&&(s=kn(o._a[Xt],i[Xt]),(o._dayOfYear>No(s)||o._dayOfYear===0)&&(Ve(o)._overflowDayOfYear=!0),t=xo(s,0,o._dayOfYear),o._a[fn]=t.getUTCMonth(),o._a[sn]=t.getUTCDate()),e=0;e<3&&o._a[e]==null;++e)o._a[e]=n[e]=i[e];for(;e<7;e++)o._a[e]=n[e]=o._a[e]==null?e===2?1:0:o._a[e];o._a[Lt]===24&&o._a[zt]===0&&o._a[mn]===0&&o._a[Un]===0&&(o._nextDay=!0,o._a[Lt]=0),o._d=(o._useUTC?xo:Sh).apply(null,n),r=o._useUTC?o._d.getUTCDay():o._d.getDay(),o._tzm!=null&&o._d.setUTCMinutes(o._d.getUTCMinutes()-o._tzm),o._nextDay&&(o._a[Lt]=24),o._w&&typeof o._w.d<"u"&&o._w.d!==r&&(Ve(o).weekdayMismatch=!0)}}function mR(o){var e,t,n,i,r,s,l,a,c;e=o._w,e.GG!=null||e.W!=null||e.E!=null?(r=1,s=4,t=kn(e.GG,o._a[Xt],vo(ot(),1,4).year),n=kn(e.W,1),i=kn(e.E,1),(i<1||i>7)&&(a=!0)):(r=o._locale._week.dow,s=o._locale._week.doy,c=vo(ot(),r,s),t=kn(e.gg,o._a[Xt],c.year),n=kn(e.w,c.week),e.d!=null?(i=e.d,(i<0||i>6)&&(a=!0)):e.e!=null?(i=e.e+r,(e.e<0||e.e>6)&&(a=!0)):i=r),n<1||n>Ln(t,r,s)?Ve(o)._overflowWeeks=!0:a!=null?Ve(o)._overflowWeekday=!0:(l=ea(t,n,i,r,s),o._a[Xt]=l.year,o._dayOfYear=l.dayOfYear)}ce.ISO_8601=function(){};ce.RFC_2822=function(){};function qs(o){if(o._f===ce.ISO_8601){sa(o);return}if(o._f===ce.RFC_2822){ra(o);return}o._a=[],Ve(o).empty=!0;var e=""+o._i,t,n,i,r,s,l=e.length,a=0,c,d;for(i=Kl(o._f,o._locale).match(Zs)||[],d=i.length,t=0;t<d;t++)r=i[t],n=(e.match(ih(r,o))||[])[0],n&&(s=e.substr(0,e.indexOf(n)),s.length>0&&Ve(o).unusedInput.push(s),e=e.slice(e.indexOf(n)+n.length),a+=n.length),eo[r]?(n?Ve(o).empty=!1:Ve(o).unusedTokens.push(r),rh(r,n,o)):o._strict&&!n&&Ve(o).unusedTokens.push(r);Ve(o).charsLeftOver=l-a,e.length>0&&Ve(o).unusedInput.push(e),o._a[Lt]<=12&&Ve(o).bigHour===!0&&o._a[Lt]>0&&(Ve(o).bigHour=void 0),Ve(o).parsedDateParts=o._a.slice(0),Ve(o).meridiem=o._meridiem,o._a[Lt]=TR(o._locale,o._a[Lt],o._meridiem),c=Ve(o).era,c!==null&&(o._a[Xt]=o._locale.erasConvertYear(c,o._a[Xt])),$s(o),zs(o)}function TR(o,e,t){var n;return t==null?e:o.meridiemHour!=null?o.meridiemHour(e,t):(o.isPM!=null&&(n=o.isPM(t),n&&e<12&&(e+=12),!n&&e===12&&(e=0)),e)}function LR(o){var e,t,n,i,r,s,l=!1,a=o._f.length;if(a===0){Ve(o).invalidFormat=!0,o._d=new Date(NaN);return}for(i=0;i<a;i++)r=0,s=!1,e=ws({},o),o._useUTC!=null&&(e._useUTC=o._useUTC),e._f=o._f[i],qs(e),Ys(e)&&(s=!0),r+=Ve(e).charsLeftOver,r+=Ve(e).unusedTokens.length*10,Ve(e).score=r,l?r<n&&(n=r,t=e):(n==null||r<n||s)&&(n=r,t=e,s&&(l=!0));En(o,t||e)}function IR(o){if(!o._d){var e=Qs(o._i),t=e.day===void 0?e.date:e.day;o._a=Ul([e.year,e.month,t,e.hour,e.minute,e.second,e.millisecond],function(n){return n&&parseInt(n,10)}),$s(o)}}function PR(o){var e=new Yo(zs(la(o)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function la(o){var e=o._i,t=o._f;return o._locale=o._locale||Pn(o._l),e===null||t===void 0&&e===""?Li({nullInput:!0}):(typeof e=="string"&&(o._i=e=o._locale.preparse(e)),jt(e)?new Yo(zs(e)):(Vo(e)?o._d=e:qt(t)?LR(o):t?qs(o):OR(o),Ys(o)||(o._d=null),o))}function OR(o){var e=o._i;yt(e)?o._d=new Date(ce.now()):Vo(e)?o._d=new Date(e.valueOf()):typeof e=="string"?pR(o):qt(e)?(o._a=Ul(e.slice(0),function(t){return parseInt(t,10)}),$s(o)):Zn(e)?IR(o):In(e)?o._d=new Date(e):ce.createFromInputFallback(o)}function aa(o,e,t,n,i){var r={};return(e===!0||e===!1)&&(n=e,e=void 0),(t===!0||t===!1)&&(n=t,t=void 0),(Zn(o)&&Vs(o)||qt(o)&&o.length===0)&&(o=void 0),r._isAMomentObject=!0,r._useUTC=r._isUTC=i,r._l=t,r._i=o,r._f=e,r._strict=n,PR(r)}function ot(o,e,t,n){return aa(o,e,t,n,!1)}var SR=Gt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=ot.apply(null,arguments);return this.isValid()&&o.isValid()?o<this?this:o:Li()}),MR=Gt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var o=ot.apply(null,arguments);return this.isValid()&&o.isValid()?o>this?this:o:Li()});function ca(o,e){var t,n;if(e.length===1&&qt(e[0])&&(e=e[0]),!e.length)return ot();for(t=e[0],n=1;n<e.length;++n)(!e[n].isValid()||e[n][o](t))&&(t=e[n]);return t}function XR(){var o=[].slice.call(arguments,0);return ca("isBefore",o)}function ER(){var o=[].slice.call(arguments,0);return ca("isAfter",o)}var NR=function(){return Date.now?Date.now():+new Date},Lo=["year","quarter","month","week","day","hour","minute","second","millisecond"];function FR(o){var e,t=!1,n,i=Lo.length;for(e in o)if(Je(o,e)&&!(ut.call(Lo,e)!==-1&&(o[e]==null||!isNaN(o[e]))))return!1;for(n=0;n<i;++n)if(o[Lo[n]]){if(t)return!1;parseFloat(o[Lo[n]])!==He(o[Lo[n]])&&(t=!0)}return!0}function CR(){return this._isValid}function bR(){return en(NaN)}function Ni(o){var e=Qs(o),t=e.year||0,n=e.quarter||0,i=e.month||0,r=e.week||e.isoWeek||0,s=e.day||0,l=e.hour||0,a=e.minute||0,c=e.second||0,d=e.millisecond||0;this._isValid=FR(e),this._milliseconds=+d+c*1e3+a*6e4+l*1e3*60*60,this._days=+s+r*7,this._months=+i+n*3+t*12,this._data={},this._locale=Pn(),this._bubble()}function ti(o){return o instanceof Ni}function Ts(o){return o<0?Math.round(-1*o)*-1:Math.round(o)}function yR(o,e,t){var n=Math.min(o.length,e.length),i=Math.abs(o.length-e.length),r=0,s;for(s=0;s<n;s++)He(o[s])!==He(e[s])&&r++;return r+i}function da(o,e){Me(o,0,0,function(){var t=this.utcOffset(),n="+";return t<0&&(t=-t,n="-"),n+ln(~~(t/60),2)+e+ln(~~t%60,2)})}da("Z",":");da("ZZ","");Re("Z",Mi);Re("ZZ",Mi);$e(["Z","ZZ"],function(o,e,t){t._useUTC=!0,t._tzm=js(Mi,o)});var xR=/([\+\-]|\d\d)/gi;function js(o,e){var t=(e||"").match(o),n,i,r;return t===null?null:(n=t[t.length-1]||[],i=(n+"").match(xR)||["-",0,0],r=+(i[1]*60)+He(i[2]),r===0?0:i[0]==="+"?r:-r)}function er(o,e){var t,n;return e._isUTC?(t=e.clone(),n=(jt(o)||Vo(o)?o.valueOf():ot(o).valueOf())-t.valueOf(),t._d.setTime(t._d.valueOf()+n),ce.updateOffset(t,!1),t):ot(o).local()}function Ls(o){return-Math.round(o._d.getTimezoneOffset())}ce.updateOffset=function(){};function vR(o,e,t){var n=this._offset||0,i;if(!this.isValid())return o!=null?this:NaN;if(o!=null){if(typeof o=="string"){if(o=js(Mi,o),o===null)return this}else Math.abs(o)<16&&!t&&(o=o*60);return!this._isUTC&&e&&(i=Ls(this)),this._offset=o,this._isUTC=!0,i!=null&&this.add(i,"m"),n!==o&&(!e||this._changeInProgress?Ra(this,en(o-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,ce.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:Ls(this)}function WR(o,e){return o!=null?(typeof o!="string"&&(o=-o),this.utcOffset(o,e),this):-this.utcOffset()}function DR(o){return this.utcOffset(0,o)}function VR(o){return this._isUTC&&(this.utcOffset(0,o),this._isUTC=!1,o&&this.subtract(Ls(this),"m")),this}function YR(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var o=js(nh,this._i);o!=null?this.utcOffset(o):this.utcOffset(0,!0)}return this}function wR(o){return this.isValid()?(o=o?ot(o).utcOffset():0,(this.utcOffset()-o)%60===0):!1}function UR(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ZR(){if(!yt(this._isDSTShifted))return this._isDSTShifted;var o={},e;return ws(o,this),o=la(o),o._a?(e=o._isUTC?an(o._a):ot(o._a),this._isDSTShifted=this.isValid()&&yR(o._a,e.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function QR(){return this.isValid()?!this._isUTC:!1}function KR(){return this.isValid()?this._isUTC:!1}function ua(){return this.isValid()?this._isUTC&&this._offset===0:!1}var HR=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,_R=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function en(o,e){var t=o,n=null,i,r,s;return ti(o)?t={ms:o._milliseconds,d:o._days,M:o._months}:In(o)||!isNaN(+o)?(t={},e?t[e]=+o:t.milliseconds=+o):(n=HR.exec(o))?(i=n[1]==="-"?-1:1,t={y:0,d:He(n[sn])*i,h:He(n[Lt])*i,m:He(n[zt])*i,s:He(n[mn])*i,ms:He(Ts(n[Un]*1e3))*i}):(n=_R.exec(o))?(i=n[1]==="-"?-1:1,t={y:vn(n[2],i),M:vn(n[3],i),w:vn(n[4],i),d:vn(n[5],i),h:vn(n[6],i),m:vn(n[7],i),s:vn(n[8],i)}):t==null?t={}:typeof t=="object"&&("from"in t||"to"in t)&&(s=AR(ot(t.from),ot(t.to)),t={},t.ms=s.milliseconds,t.M=s.months),r=new Ni(t),ti(o)&&Je(o,"_locale")&&(r._locale=o._locale),ti(o)&&Je(o,"_isValid")&&(r._isValid=o._isValid),r}en.fn=Ni.prototype;en.invalid=bR;function vn(o,e){var t=o&&parseFloat(o.replace(",","."));return(isNaN(t)?0:t)*e}function Ar(o,e){var t={};return t.months=e.month()-o.month()+(e.year()-o.year())*12,o.clone().add(t.months,"M").isAfter(e)&&--t.months,t.milliseconds=+e-+o.clone().add(t.months,"M"),t}function AR(o,e){var t;return o.isValid()&&e.isValid()?(e=er(e,o),o.isBefore(e)?t=Ar(o,e):(t=Ar(e,o),t.milliseconds=-t.milliseconds,t.months=-t.months),t):{milliseconds:0,months:0}}function ha(o,e){return function(t,n){var i,r;return n!==null&&!isNaN(+n)&&(Ql(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),r=t,t=n,n=r),i=en(t,n),Ra(this,i,o),this}}function Ra(o,e,t,n){var i=e._milliseconds,r=Ts(e._days),s=Ts(e._months);o.isValid()&&(n=n??!0,s&&$l(o,yo(o,"Month")+s*t),r&&Jl(o,"Date",yo(o,"Date")+r*t),i&&o._d.setTime(o._d.valueOf()+i*t),n&&ce.updateOffset(o,r||s))}var kR=ha(1,"add"),GR=ha(-1,"subtract");function ga(o){return typeof o=="string"||o instanceof String}function JR(o){return jt(o)||Vo(o)||ga(o)||In(o)||zR(o)||BR(o)||o===null||o===void 0}function BR(o){var e=Zn(o)&&!Vs(o),t=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],i,r,s=n.length;for(i=0;i<s;i+=1)r=n[i],t=t||Je(o,r);return e&&t}function zR(o){var e=qt(o),t=!1;return e&&(t=o.filter(function(n){return!In(n)&&ga(o)}).length===0),e&&t}function $R(o){var e=Zn(o)&&!Vs(o),t=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],i,r;for(i=0;i<n.length;i+=1)r=n[i],t=t||Je(o,r);return e&&t}function qR(o,e){var t=o.diff(e,"days",!0);return t<-6?"sameElse":t<-1?"lastWeek":t<0?"lastDay":t<1?"sameDay":t<2?"nextDay":t<7?"nextWeek":"sameElse"}function jR(o,e){arguments.length===1&&(arguments[0]?JR(arguments[0])?(o=arguments[0],e=void 0):$R(arguments[0])&&(e=arguments[0],o=void 0):(o=void 0,e=void 0));var t=o||ot(),n=er(t,this).startOf("day"),i=ce.calendarFormat(this,n)||"sameElse",r=e&&(cn(e[i])?e[i].call(this,t):e[i]);return this.format(r||this.localeData().calendar(i,this,ot(t)))}function eg(){return new Yo(this)}function tg(o,e){var t=jt(o)?o:ot(o);return this.isValid()&&t.isValid()?(e=Jt(e)||"millisecond",e==="millisecond"?this.valueOf()>t.valueOf():t.valueOf()<this.clone().startOf(e).valueOf()):!1}function ng(o,e){var t=jt(o)?o:ot(o);return this.isValid()&&t.isValid()?(e=Jt(e)||"millisecond",e==="millisecond"?this.valueOf()<t.valueOf():this.clone().endOf(e).valueOf()<t.valueOf()):!1}function og(o,e,t,n){var i=jt(o)?o:ot(o),r=jt(e)?e:ot(e);return this.isValid()&&i.isValid()&&r.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(i,t):!this.isBefore(i,t))&&(n[1]===")"?this.isBefore(r,t):!this.isAfter(r,t))):!1}function ig(o,e){var t=jt(o)?o:ot(o),n;return this.isValid()&&t.isValid()?(e=Jt(e)||"millisecond",e==="millisecond"?this.valueOf()===t.valueOf():(n=t.valueOf(),this.clone().startOf(e).valueOf()<=n&&n<=this.clone().endOf(e).valueOf())):!1}function sg(o,e){return this.isSame(o,e)||this.isAfter(o,e)}function rg(o,e){return this.isSame(o,e)||this.isBefore(o,e)}function lg(o,e,t){var n,i,r;if(!this.isValid())return NaN;if(n=er(o,this),!n.isValid())return NaN;switch(i=(n.utcOffset()-this.utcOffset())*6e4,e=Jt(e),e){case"year":r=ni(this,n)/12;break;case"month":r=ni(this,n);break;case"quarter":r=ni(this,n)/3;break;case"second":r=(this-n)/1e3;break;case"minute":r=(this-n)/6e4;break;case"hour":r=(this-n)/36e5;break;case"day":r=(this-n-i)/864e5;break;case"week":r=(this-n-i)/6048e5;break;default:r=this-n}return t?r:At(r)}function ni(o,e){if(o.date()<e.date())return-ni(e,o);var t=(e.year()-o.year())*12+(e.month()-o.month()),n=o.clone().add(t,"months"),i,r;return e-n<0?(i=o.clone().add(t-1,"months"),r=(e-n)/(n-i)):(i=o.clone().add(t+1,"months"),r=(e-n)/(i-n)),-(t+r)||0}ce.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";ce.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function ag(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function cg(o){if(!this.isValid())return null;var e=o!==!0,t=e?this.clone().utc():this;return t.year()<0||t.year()>9999?ei(t,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):cn(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",ei(t,"Z")):ei(t,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function dg(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var o="moment",e="",t,n,i,r;return this.isLocal()||(o=this.utcOffset()===0?"moment.utc":"moment.parseZone",e="Z"),t="["+o+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",r=e+'[")]',this.format(t+n+i+r)}function ug(o){o||(o=this.isUtc()?ce.defaultFormatUtc:ce.defaultFormat);var e=ei(this,o);return this.localeData().postformat(e)}function hg(o,e){return this.isValid()&&(jt(o)&&o.isValid()||ot(o).isValid())?en({to:this,from:o}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function Rg(o){return this.from(ot(),o)}function gg(o,e){return this.isValid()&&(jt(o)&&o.isValid()||ot(o).isValid())?en({from:this,to:o}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function pg(o){return this.to(ot(),o)}function pa(o){var e;return o===void 0?this._locale._abbr:(e=Pn(o),e!=null&&(this._locale=e),this)}var fa=Gt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(o){return o===void 0?this.localeData():this.locale(o)});function ma(){return this._locale}var Ri=1e3,to=60*Ri,gi=60*to,Ta=(365*400+97)*24*gi;function no(o,e){return(o%e+e)%e}function La(o,e,t){return o<100&&o>=0?new Date(o+400,e,t)-Ta:new Date(o,e,t).valueOf()}function Ia(o,e,t){return o<100&&o>=0?Date.UTC(o+400,e,t)-Ta:Date.UTC(o,e,t)}function fg(o){var e,t;if(o=Jt(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?Ia:La,o){case"year":e=t(this.year(),0,1);break;case"quarter":e=t(this.year(),this.month()-this.month()%3,1);break;case"month":e=t(this.year(),this.month(),1);break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=t(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=no(e+(this._isUTC?0:this.utcOffset()*to),gi);break;case"minute":e=this._d.valueOf(),e-=no(e,to);break;case"second":e=this._d.valueOf(),e-=no(e,Ri);break}return this._d.setTime(e),ce.updateOffset(this,!0),this}function mg(o){var e,t;if(o=Jt(o),o===void 0||o==="millisecond"||!this.isValid())return this;switch(t=this._isUTC?Ia:La,o){case"year":e=t(this.year()+1,0,1)-1;break;case"quarter":e=t(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=t(this.year(),this.month()+1,1)-1;break;case"week":e=t(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=t(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=t(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=gi-no(e+(this._isUTC?0:this.utcOffset()*to),gi)-1;break;case"minute":e=this._d.valueOf(),e+=to-no(e,to)-1;break;case"second":e=this._d.valueOf(),e+=Ri-no(e,Ri)-1;break}return this._d.setTime(e),ce.updateOffset(this,!0),this}function Tg(){return this._d.valueOf()-(this._offset||0)*6e4}function Lg(){return Math.floor(this.valueOf()/1e3)}function Ig(){return new Date(this.valueOf())}function Pg(){var o=this;return[o.year(),o.month(),o.date(),o.hour(),o.minute(),o.second(),o.millisecond()]}function Og(){var o=this;return{years:o.year(),months:o.month(),date:o.date(),hours:o.hours(),minutes:o.minutes(),seconds:o.seconds(),milliseconds:o.milliseconds()}}function Sg(){return this.isValid()?this.toISOString():null}function Mg(){return Ys(this)}function Xg(){return En({},Ve(this))}function Eg(){return Ve(this).overflow}function Ng(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Me("N",0,0,"eraAbbr");Me("NN",0,0,"eraAbbr");Me("NNN",0,0,"eraAbbr");Me("NNNN",0,0,"eraName");Me("NNNNN",0,0,"eraNarrow");Me("y",["y",1],"yo","eraYear");Me("y",["yy",2],0,"eraYear");Me("y",["yyy",3],0,"eraYear");Me("y",["yyyy",4],0,"eraYear");Re("N",tr);Re("NN",tr);Re("NNN",tr);Re("NNNN",wg);Re("NNNNN",Ug);$e(["N","NN","NNN","NNNN","NNNNN"],function(o,e,t,n){var i=t._locale.erasParse(o,n,t._strict);i?Ve(t).era=i:Ve(t).invalidEra=o});Re("y",ro);Re("yy",ro);Re("yyy",ro);Re("yyyy",ro);Re("yo",Zg);$e(["y","yy","yyy","yyyy"],Xt);$e(["yo"],function(o,e,t,n){var i;t._locale._eraYearOrdinalRegex&&(i=o.match(t._locale._eraYearOrdinalRegex)),t._locale.eraYearOrdinalParse?e[Xt]=t._locale.eraYearOrdinalParse(o,i):e[Xt]=parseInt(o,10)});function Fg(o,e){var t,n,i,r=this._eras||Pn("en")._eras;for(t=0,n=r.length;t<n;++t)switch(typeof r[t].since==="string"&&(i=ce(r[t].since).startOf("day"),r[t].since=i.valueOf()),typeof r[t].until){case"undefined":r[t].until=1/0;break;case"string":i=ce(r[t].until).startOf("day").valueOf(),r[t].until=i.valueOf();break}return r}function Cg(o,e,t){var n,i,r=this.eras(),s,l,a;for(o=o.toUpperCase(),n=0,i=r.length;n<i;++n)if(s=r[n].name.toUpperCase(),l=r[n].abbr.toUpperCase(),a=r[n].narrow.toUpperCase(),t)switch(e){case"N":case"NN":case"NNN":if(l===o)return r[n];break;case"NNNN":if(s===o)return r[n];break;case"NNNNN":if(a===o)return r[n];break}else if([s,l,a].indexOf(o)>=0)return r[n]}function bg(o,e){var t=o.since<=o.until?1:-1;return e===void 0?ce(o.since).year():ce(o.since).year()+(e-o.offset)*t}function yg(){var o,e,t,n=this.localeData().eras();for(o=0,e=n.length;o<e;++o)if(t=this.clone().startOf("day").valueOf(),n[o].since<=t&&t<=n[o].until||n[o].until<=t&&t<=n[o].since)return n[o].name;return""}function xg(){var o,e,t,n=this.localeData().eras();for(o=0,e=n.length;o<e;++o)if(t=this.clone().startOf("day").valueOf(),n[o].since<=t&&t<=n[o].until||n[o].until<=t&&t<=n[o].since)return n[o].narrow;return""}function vg(){var o,e,t,n=this.localeData().eras();for(o=0,e=n.length;o<e;++o)if(t=this.clone().startOf("day").valueOf(),n[o].since<=t&&t<=n[o].until||n[o].until<=t&&t<=n[o].since)return n[o].abbr;return""}function Wg(){var o,e,t,n,i=this.localeData().eras();for(o=0,e=i.length;o<e;++o)if(t=i[o].since<=i[o].until?1:-1,n=this.clone().startOf("day").valueOf(),i[o].since<=n&&n<=i[o].until||i[o].until<=n&&n<=i[o].since)return(this.year()-ce(i[o].since).year())*t+i[o].offset;return this.year()}function Dg(o){return Je(this,"_erasNameRegex")||nr.call(this),o?this._erasNameRegex:this._erasRegex}function Vg(o){return Je(this,"_erasAbbrRegex")||nr.call(this),o?this._erasAbbrRegex:this._erasRegex}function Yg(o){return Je(this,"_erasNarrowRegex")||nr.call(this),o?this._erasNarrowRegex:this._erasRegex}function tr(o,e){return e.erasAbbrRegex(o)}function wg(o,e){return e.erasNameRegex(o)}function Ug(o,e){return e.erasNarrowRegex(o)}function Zg(o,e){return e._eraYearOrdinalRegex||ro}function nr(){var o=[],e=[],t=[],n=[],i,r,s,l,a,c=this.eras();for(i=0,r=c.length;i<r;++i)s=Tn(c[i].name),l=Tn(c[i].abbr),a=Tn(c[i].narrow),e.push(s),o.push(l),t.push(a),n.push(s),n.push(l),n.push(a);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+e.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+o.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+t.join("|")+")","i")}Me(0,["gg",2],0,function(){return this.weekYear()%100});Me(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Fi(o,e){Me(0,[o,o.length],0,e)}Fi("gggg","weekYear");Fi("ggggg","weekYear");Fi("GGGG","isoWeekYear");Fi("GGGGG","isoWeekYear");Re("G",Si);Re("g",Si);Re("GG",it,Ut);Re("gg",it,Ut);Re("GGGG",Hs,Ks);Re("gggg",Hs,Ks);Re("GGGGG",Oi,Ii);Re("ggggg",Oi,Ii);Uo(["gggg","ggggg","GGGG","GGGGG"],function(o,e,t,n){e[n.substr(0,2)]=He(o)});Uo(["gg","GG"],function(o,e,t,n){e[n]=ce.parseTwoDigitYear(o)});function Qg(o){return Pa.call(this,o,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function Kg(o){return Pa.call(this,o,this.isoWeek(),this.isoWeekday(),1,4)}function Hg(){return Ln(this.year(),1,4)}function _g(){return Ln(this.isoWeekYear(),1,4)}function Ag(){var o=this.localeData()._week;return Ln(this.year(),o.dow,o.doy)}function kg(){var o=this.localeData()._week;return Ln(this.weekYear(),o.dow,o.doy)}function Pa(o,e,t,n,i){var r;return o==null?vo(this,n,i).year:(r=Ln(o,n,i),e>r&&(e=r),Gg.call(this,o,e,t,n,i))}function Gg(o,e,t,n,i){var r=ea(o,e,t,n,i),s=xo(r.year,0,r.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}Me("Q",0,"Qo","quarter");Re("Q",Hl);$e("Q",function(o,e){e[fn]=(He(o)-1)*3});function Jg(o){return o==null?Math.ceil((this.month()+1)/3):this.month((o-1)*3+this.month()%3)}Me("D",["DD",2],"Do","date");Re("D",it,lo);Re("DD",it,Ut);Re("Do",function(o,e){return o?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient});$e(["D","DD"],sn);$e("Do",function(o,e){e[sn]=He(o.match(it)[0])});var Oa=ao("Date",!0);Me("DDD",["DDDD",3],"DDDo","dayOfYear");Re("DDD",Pi);Re("DDDD",_l);$e(["DDD","DDDD"],function(o,e,t){t._dayOfYear=He(o)});function Bg(o){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return o==null?e:this.add(o-e,"d")}Me("m",["mm",2],0,"minute");Re("m",it,_s);Re("mm",it,Ut);$e(["m","mm"],zt);var zg=ao("Minutes",!1);Me("s",["ss",2],0,"second");Re("s",it,_s);Re("ss",it,Ut);$e(["s","ss"],mn);var $g=ao("Seconds",!1);Me("S",0,0,function(){return~~(this.millisecond()/100)});Me(0,["SS",2],0,function(){return~~(this.millisecond()/10)});Me(0,["SSS",3],0,"millisecond");Me(0,["SSSS",4],0,function(){return this.millisecond()*10});Me(0,["SSSSS",5],0,function(){return this.millisecond()*100});Me(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});Me(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});Me(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});Me(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});Re("S",Pi,Hl);Re("SS",Pi,Ut);Re("SSS",Pi,_l);var Nn,Sa;for(Nn="SSSS";Nn.length<=9;Nn+="S")Re(Nn,ro);function qg(o,e){e[Un]=He(("0."+o)*1e3)}for(Nn="S";Nn.length<=9;Nn+="S")$e(Nn,qg);Sa=ao("Milliseconds",!1);Me("z",0,0,"zoneAbbr");Me("zz",0,0,"zoneName");function jg(){return this._isUTC?"UTC":""}function ep(){return this._isUTC?"Coordinated Universal Time":""}var oe=Yo.prototype;oe.add=kR;oe.calendar=jR;oe.clone=eg;oe.diff=lg;oe.endOf=mg;oe.format=ug;oe.from=hg;oe.fromNow=Rg;oe.to=gg;oe.toNow=pg;oe.get=dh;oe.invalidAt=Eg;oe.isAfter=tg;oe.isBefore=ng;oe.isBetween=og;oe.isSame=ig;oe.isSameOrAfter=sg;oe.isSameOrBefore=rg;oe.isValid=Mg;oe.lang=fa;oe.locale=pa;oe.localeData=ma;oe.max=MR;oe.min=SR;oe.parsingFlags=Xg;oe.set=uh;oe.startOf=fg;oe.subtract=GR;oe.toArray=Pg;oe.toObject=Og;oe.toDate=Ig;oe.toISOString=cg;oe.inspect=dg;typeof Symbol<"u"&&Symbol.for!=null&&(oe[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});oe.toJSON=Sg;oe.toString=ag;oe.unix=Lg;oe.valueOf=Tg;oe.creationData=Ng;oe.eraName=yg;oe.eraNarrow=xg;oe.eraAbbr=vg;oe.eraYear=Wg;oe.year=Gl;oe.isLeapYear=ch;oe.weekYear=Qg;oe.isoWeekYear=Kg;oe.quarter=oe.quarters=Jg;oe.month=ql;oe.daysInMonth=Ih;oe.week=oe.weeks=Fh;oe.isoWeek=oe.isoWeeks=Ch;oe.weeksInYear=Ag;oe.weeksInWeekYear=kg;oe.isoWeeksInYear=Hg;oe.isoWeeksInISOWeekYear=_g;oe.date=Oa;oe.day=oe.days=Kh;oe.weekday=Hh;oe.isoWeekday=_h;oe.dayOfYear=Bg;oe.hour=oe.hours=$h;oe.minute=oe.minutes=zg;oe.second=oe.seconds=$g;oe.millisecond=oe.milliseconds=Sa;oe.utcOffset=vR;oe.utc=DR;oe.local=VR;oe.parseZone=YR;oe.hasAlignedHourOffset=wR;oe.isDST=UR;oe.isLocal=QR;oe.isUtcOffset=KR;oe.isUtc=ua;oe.isUTC=ua;oe.zoneAbbr=jg;oe.zoneName=ep;oe.dates=Gt("dates accessor is deprecated. Use date instead.",Oa);oe.months=Gt("months accessor is deprecated. Use month instead",ql);oe.years=Gt("years accessor is deprecated. Use year instead",Gl);oe.zone=Gt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",WR);oe.isDSTShifted=Gt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ZR);function tp(o){return ot(o*1e3)}function np(){return ot.apply(null,arguments).parseZone()}function Ma(o){return o}var Be=Us.prototype;Be.calendar=Qu;Be.longDateFormat=Au;Be.invalidDate=Gu;Be.ordinal=zu;Be.preparse=Ma;Be.postformat=Ma;Be.relativeTime=qu;Be.pastFuture=ju;Be.set=Uu;Be.eras=Fg;Be.erasParse=Cg;Be.erasConvertYear=bg;Be.erasAbbrRegex=Vg;Be.erasNameRegex=Dg;Be.erasNarrowRegex=Yg;Be.months=fh;Be.monthsShort=mh;Be.monthsParse=Lh;Be.monthsRegex=Oh;Be.monthsShortRegex=Ph;Be.week=Mh;Be.firstDayOfYear=Nh;Be.firstDayOfWeek=Eh;Be.weekdays=Yh;Be.weekdaysMin=Uh;Be.weekdaysShort=wh;Be.weekdaysParse=Qh;Be.weekdaysRegex=Ah;Be.weekdaysShortRegex=kh;Be.weekdaysMinRegex=Gh;Be.isPM=Bh;Be.meridiem=qh;function pi(o,e,t,n){var i=Pn(),r=an().set(n,e);return i[t](r,o)}function Xa(o,e,t){if(In(o)&&(e=o,o=void 0),o=o||"",e!=null)return pi(o,e,t,"month");var n,i=[];for(n=0;n<12;n++)i[n]=pi(o,n,t,"month");return i}function or(o,e,t,n){typeof o=="boolean"?(In(e)&&(t=e,e=void 0),e=e||""):(e=o,t=e,o=!1,In(e)&&(t=e,e=void 0),e=e||"");var i=Pn(),r=o?i._week.dow:0,s,l=[];if(t!=null)return pi(e,(t+r)%7,n,"day");for(s=0;s<7;s++)l[s]=pi(e,(s+r)%7,n,"day");return l}function op(o,e){return Xa(o,e,"months")}function ip(o,e){return Xa(o,e,"monthsShort")}function sp(o,e,t){return or(o,e,t,"weekdays")}function rp(o,e,t){return or(o,e,t,"weekdaysShort")}function lp(o,e,t){return or(o,e,t,"weekdaysMin")}Cn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(o){var e=o%10,t=He(o%100/10)===1?"th":e===1?"st":e===2?"nd":e===3?"rd":"th";return o+t}});ce.lang=Gt("moment.lang is deprecated. Use moment.locale instead.",Cn);ce.langData=Gt("moment.langData is deprecated. Use moment.localeData instead.",Pn);var dn=Math.abs;function ap(){var o=this._data;return this._milliseconds=dn(this._milliseconds),this._days=dn(this._days),this._months=dn(this._months),o.milliseconds=dn(o.milliseconds),o.seconds=dn(o.seconds),o.minutes=dn(o.minutes),o.hours=dn(o.hours),o.months=dn(o.months),o.years=dn(o.years),this}function Ea(o,e,t,n){var i=en(e,t);return o._milliseconds+=n*i._milliseconds,o._days+=n*i._days,o._months+=n*i._months,o._bubble()}function cp(o,e){return Ea(this,o,e,1)}function dp(o,e){return Ea(this,o,e,-1)}function kr(o){return o<0?Math.floor(o):Math.ceil(o)}function up(){var o=this._milliseconds,e=this._days,t=this._months,n=this._data,i,r,s,l,a;return o>=0&&e>=0&&t>=0||o<=0&&e<=0&&t<=0||(o+=kr(Is(t)+e)*864e5,e=0,t=0),n.milliseconds=o%1e3,i=At(o/1e3),n.seconds=i%60,r=At(i/60),n.minutes=r%60,s=At(r/60),n.hours=s%24,e+=At(s/24),a=At(Na(e)),t+=a,e-=kr(Is(a)),l=At(t/12),t%=12,n.days=e,n.months=t,n.years=l,this}function Na(o){return o*4800/146097}function Is(o){return o*146097/4800}function hp(o){if(!this.isValid())return NaN;var e,t,n=this._milliseconds;if(o=Jt(o),o==="month"||o==="quarter"||o==="year")switch(e=this._days+n/864e5,t=this._months+Na(e),o){case"month":return t;case"quarter":return t/3;case"year":return t/12}else switch(e=this._days+Math.round(Is(this._months)),o){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return e*24+n/36e5;case"minute":return e*1440+n/6e4;case"second":return e*86400+n/1e3;case"millisecond":return Math.floor(e*864e5)+n;default:throw new Error("Unknown unit "+o)}}function On(o){return function(){return this.as(o)}}var Fa=On("ms"),Rp=On("s"),gp=On("m"),pp=On("h"),fp=On("d"),mp=On("w"),Tp=On("M"),Lp=On("Q"),Ip=On("y"),Pp=Fa;function Op(){return en(this)}function Sp(o){return o=Jt(o),this.isValid()?this[o+"s"]():NaN}function Kn(o){return function(){return this.isValid()?this._data[o]:NaN}}var Mp=Kn("milliseconds"),Xp=Kn("seconds"),Ep=Kn("minutes"),Np=Kn("hours"),Fp=Kn("days"),Cp=Kn("months"),bp=Kn("years");function yp(){return At(this.days()/7)}var gn=Math.round,Bn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function xp(o,e,t,n,i){return i.relativeTime(e||1,!!t,o,n)}function vp(o,e,t,n){var i=en(o).abs(),r=gn(i.as("s")),s=gn(i.as("m")),l=gn(i.as("h")),a=gn(i.as("d")),c=gn(i.as("M")),d=gn(i.as("w")),u=gn(i.as("y")),h=r<=t.ss&&["s",r]||r<t.s&&["ss",r]||s<=1&&["m"]||s<t.m&&["mm",s]||l<=1&&["h"]||l<t.h&&["hh",l]||a<=1&&["d"]||a<t.d&&["dd",a];return t.w!=null&&(h=h||d<=1&&["w"]||d<t.w&&["ww",d]),h=h||c<=1&&["M"]||c<t.M&&["MM",c]||u<=1&&["y"]||["yy",u],h[2]=e,h[3]=+o>0,h[4]=n,xp.apply(null,h)}function Wp(o){return o===void 0?gn:typeof o=="function"?(gn=o,!0):!1}function Dp(o,e){return Bn[o]===void 0?!1:e===void 0?Bn[o]:(Bn[o]=e,o==="s"&&(Bn.ss=e-1),!0)}function Vp(o,e){if(!this.isValid())return this.localeData().invalidDate();var t=!1,n=Bn,i,r;return typeof o=="object"&&(e=o,o=!1),typeof o=="boolean"&&(t=o),typeof e=="object"&&(n=Object.assign({},Bn,e),e.s!=null&&e.ss==null&&(n.ss=e.s-1)),i=this.localeData(),r=vp(this,!t,n,i),t&&(r=i.pastFuture(+this,r)),i.postformat(r)}var zi=Math.abs;function An(o){return(o>0)-(o<0)||+o}function Ci(){if(!this.isValid())return this.localeData().invalidDate();var o=zi(this._milliseconds)/1e3,e=zi(this._days),t=zi(this._months),n,i,r,s,l=this.asSeconds(),a,c,d,u;return l?(n=At(o/60),i=At(n/60),o%=60,n%=60,r=At(t/12),t%=12,s=o?o.toFixed(3).replace(/\.?0+$/,""):"",a=l<0?"-":"",c=An(this._months)!==An(l)?"-":"",d=An(this._days)!==An(l)?"-":"",u=An(this._milliseconds)!==An(l)?"-":"",a+"P"+(r?c+r+"Y":"")+(t?c+t+"M":"")+(e?d+e+"D":"")+(i||n||o?"T":"")+(i?u+i+"H":"")+(n?u+n+"M":"")+(o?u+s+"S":"")):"P0D"}var ke=Ni.prototype;ke.isValid=CR;ke.abs=ap;ke.add=cp;ke.subtract=dp;ke.as=hp;ke.asMilliseconds=Fa;ke.asSeconds=Rp;ke.asMinutes=gp;ke.asHours=pp;ke.asDays=fp;ke.asWeeks=mp;ke.asMonths=Tp;ke.asQuarters=Lp;ke.asYears=Ip;ke.valueOf=Pp;ke._bubble=up;ke.clone=Op;ke.get=Sp;ke.milliseconds=Mp;ke.seconds=Xp;ke.minutes=Ep;ke.hours=Np;ke.days=Fp;ke.weeks=yp;ke.months=Cp;ke.years=bp;ke.humanize=Vp;ke.toISOString=Ci;ke.toString=Ci;ke.toJSON=Ci;ke.locale=pa;ke.localeData=ma;ke.toIsoString=Gt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ci);ke.lang=fa;Me("X",0,0,"unix");Me("x",0,0,"valueOf");Re("x",Si);Re("X",oh);$e("X",function(o,e,t){t._d=new Date(parseFloat(o)*1e3)});$e("x",function(o,e,t){t._d=new Date(He(o))});ce.version="2.30.1";Yu(ot);ce.fn=oe;ce.min=XR;ce.max=ER;ce.now=NR;ce.utc=an;ce.unix=tp;ce.months=op;ce.isDate=Vo;ce.locale=Cn;ce.invalid=Li;ce.duration=en;ce.isMoment=jt;ce.weekdays=sp;ce.parseZone=np;ce.localeData=Pn;ce.isDuration=ti;ce.monthsShort=ip;ce.weekdaysMin=lp;ce.defineLocale=Bs;ce.updateLocale=nR;ce.locales=oR;ce.weekdaysShort=rp;ce.normalizeUnits=Jt;ce.relativeTimeRounding=Wp;ce.relativeTimeThreshold=Dp;ce.calendarFormat=qR;ce.prototype=oe;ce.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};class Ps{draws;ranges;element;control;options;position;constructor(e,t){const n=t.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.getOptions(),this.element=e,this.control=t}setElement(e){this.element=e}getElement(){return this.element}getValue(e={}){const t=e.elementList||this.control.getElementList();let{startIndex:n}=e.range||this.control.getRange();const i=this.control.getDraw(),r=e?null:i.getTd();n>=t.length&&(n=t.length-1);const s=t[n],l=[];let a=r,c=t,d=n;for(;;){if(d<0&&a?.linkTdPrevId){const m=i.getTdById(a.linkTdPrevId);if(m){c=m.value,d=c.length-1,a=m;continue}}if(d<0)break;const g=c[d];if(g.controlId!==s.controlId||g.controlComponent===p.PREFIX||g.controlComponent===p.PRE_TEXT)break;g.controlComponent===p.VALUE&&l.unshift(g),d--}a=r;let u=t,h=n+1;for(;;){if(h>=u.length&&a?.linkTdNextId){const m=i.getTdById(a.linkTdNextId);if(m){u=m.value,h=0,a=m;continue}}const g=u[h];if(!g||g.controlId!==s.controlId||g.controlComponent===p.POSTFIX||g.controlComponent===p.POST_TEXT)break;g.controlComponent===p.VALUE&&l.push(g),h++}return l.filter(g=>g.type!==O.SPLIT_TAG)}removeNextControlElement(e,t){const n=this.control.getDraw();if(t=t??n.getTd()?.linkTdNextId,t){const i=n.getTdById(t);if(i){if(i.value.length){if(i.value[1].controlId===e)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(e,i.linkTdNextId)}}}setValue(e,t={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const{elementList:i,range:r}=this.control.mergeControl(t);this.control.shrinkBoundary(t);const{startIndex:s,endIndex:l}=r,a=this.control.getDraw();s!==l?a.spliceElementList(i,s+1,l-s,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):this.control.removePlaceholder(s,{elementList:i});const c=i[s],d=c.controlId;for(let f=0;f<i.length;){const T=i[f];if(T.controlId===c.controlId&&T.originControlId===c.originControlId&&T.controlComponent===p.PLACEHOLDER){i.splice(f,1);continue}f++}const u=c.type&&!wt.includes(c.type)||c.controlComponent===p.PREFIX||c.controlComponent===p.PRE_TEXT?at(c,["control","controlId",...Ft]):$t(c,["type"]),h=!!this.element.control?.underline,R=this.options.mode===B.FORM&&!h;let g=r.startIndex+1,m=0;for(let f=0;f<e.length;f++){const T=e[f];if(T.type===O.CONTROL&&T.control){const I=T,L=I.controlId||Ee(),S=I.control?.value||[],M=I.control?.type===Y.TEXTFIELD,X={...u,controlId:L,type:O.CONTROL,control:I.control,originControlId:d},x=M?p.PRETEXTFIX:p.PREFIX,F=M?p.POSTTEXTFIX:p.POSTFIX,D=M?I.control?.preTextFix||this.options.control.preTextFix:I.control?.prefix||this.options.control.prefix;for(let E=0;E<D.length;E++){const v={...X,value:D[E],controlComponent:x};ze(i,[v],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[v]),g++,m++}for(let E=0;E<S.length;E++){const v=S[E],b={...X,...v,controlComponent:p.VALUE};(b.color===this.options.control.bracketColor||b.color===this.options.control.placeholderColor)&&(b.color=this.options.defaultColor),ze(i,[b],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[b]),g++,m++}if(S.length===0){const E=I.control?.placeholder||"";for(let v=0;v<E.length;v++){const b={...X,value:E[v],controlComponent:p.PLACEHOLDER,color:this.options.control.placeholderColor};ze(i,[b],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[b]),g++,m++}}const V=M?I.control?.postTextFix||this.options.control.postTextFix:I.control?.postfix||this.options.control.postfix;for(let E=0;E<V.length;E++){const v={...X,value:V[E],controlComponent:F};ze(i,[v],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[v]),g++,m++}}else if(T.type||T.value){(c.controlComponent===p.PRE_TEXT||c.controlComponent===p.POST_TEXT||c.controlComponent===p.PREFIX||c.controlComponent===p.POSTFIX)&&(u.color=this.options.defaultColor);const L={...u,...T,controlComponent:p.VALUE};(L.color===this.options.control.bracketColor||L.color===this.options.control.placeholderColor||L.color===this.options.control.textFixColor)&&(L.color=this.options.defaultColor),L.strikeout&&delete L.strikeout,R&&(L.textDecoration={style:Xn.DOUBLE},L.underline=!0),ze(i,[L],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[L]),g++,m++}}return r.startIndex+m}clearValue(e={},t={}){if(!t.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const n=e.elementList||this.control.getElementList(),i=e.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(e);const{startIndex:r,endIndex:s}=i;return this.control.getDraw().spliceElementList(n,r+1,s-r,[],{isIgnoreDeletedRule:t.isIgnoreDeletedRule}),t.isAddPlaceholder!==!1&&(this.getValue(e).length||this.control.addPlaceholder(r,e)),r}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=t[i],l=t[r],a=this.control.getDraw(),c=!!s.originControlId;if(e.key===Te.Backspace)if(this.options.mode=="form"&&!c){if(s.controlComponent===p.PREFIX||s.controlComponent===p.PRE_TEXT||s.controlComponent===p.PLACEHOLDER)return i;this.strikeout()}else{if(s.controlComponent===p.PREFIX||s.controlComponent===p.PRE_TEXT||s.controlComponent===p.PLACEHOLDER)return i;if(i!==r){a.spliceElementList(t,i+1,r-i);const d=t[i+1];return(d?.controlComponent===p.POSTFIX||d?.controlComponent===p.POST_TEXT||d?.controlComponent===p.POSTTEXTFIX||d?.controlComponent===p.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(i),i===0&&t[0].type===O.SPLIT_TAG?a.fixPosition(!0)??i:i}else{const d=t[i+1];return d?.controlComponent===p.POSTFIX||d?.controlComponent===p.POST_TEXT||d?.controlComponent===p.POSTTEXTFIX||d?.controlComponent===p.POSTTEXTFIX_TEXT?(a.spliceElementList(t,i,1),this.control.addPlaceholder(i-1),i-1):(a.spliceElementList(t,i,1),i===1&&t[0].type===O.SPLIT_TAG||i===0?a.fixPosition(!0)??i-1:i-1)}}else if(e.key===Te.Delete){const d=t[r+1],u=!!s.originControlId;if(this.options.mode=="form"&&!u){if(l.controlComponent===p.POSTFIX||l.controlComponent===p.POST_TEXT||l.controlComponent===p.POSTTEXTFIX||l.controlComponent===p.POSTTEXTFIX_TEXT||s.controlComponent===p.PLACEHOLDER)return r;if(d?.controlComponent===p.POSTFIX||d?.controlComponent===p.POST_TEXT||d?.controlComponent===p.POSTTEXTFIX||d?.controlComponent===p.POSTTEXTFIX_TEXT)return a.spliceElementList(t,i+1,1),this.control.addPlaceholder(i),i;this.strikeout()}else{const h=t[r+1];return s.controlComponent===p.PLACEHOLDER?r:h?.controlComponent===p.POSTFIX||h?.controlComponent===p.POST_TEXT||h?.controlComponent===p.POSTTEXTFIX||h?.controlComponent===p.POSTTEXTFIX_TEXT?(a.spliceElementList(t,i+1,1),this.control.addPlaceholder(i),i):i!==r?(a.spliceElementList(t,i+1,r-i),i===0&&t[0].type===O.SPLIT_TAG?a.fixPosition(!0)??i:i):h?(a.spliceElementList(t,i+1,1),i===0&&t[0].type===O.SPLIT_TAG?a.fixPosition(!0)??i:i):(a.getTd()?.linkTdNextId&&s.controlId&&this.removeNextControlElement(s.controlId),r)}}return r}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:e,endIndex:t}=this.control.getRange();if(e===t)return e;const n=this.control.getDraw(),i=this.control.getElementList();n.spliceElementList(i,e+1,t-e);const r=i[e+1];return(r?.controlComponent===p.POSTFIX||r?.controlComponent===p.POST_TEXT||r?.controlComponent===p.POSTTEXTFIX||r?.controlComponent===p.POSTTEXTFIX_TEXT)&&this.control.addPlaceholder(e),e}strikeout(e){const t=this.control.getRange(),{endIndex:n}=t,{isIgnoreDisabledRule:i=!1}=e||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return;const s=this.ranges.getSelectionElementList(),l=this.position.getCursorPosition(),a=ce(new Date).format("YYYY-MM-DD HH:mm:ss");if(s?.length){if(!this.element.strikeout){const c=s.findIndex(d=>!d.strikeout);s.forEach(d=>{d.deletePerson="SWJ",d.deleteTime=a,d.strikeout=!!~c}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),setTimeout(()=>{this.strikeoute()},100)}}else{const c=this.control.getElementList()[l.index],d=this.control.getElementList();if(!this.control.getElementList()[l.index].strikeout&&c?.metrics.width>0){this.control.getElementList()[l.index].strikeout=!0,this.control.getElementList()[l.index].deletePerson="SWJ",this.control.getElementList()[l.index].deleteTime=a;const u=--l.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const R=u;this.draws.render({curIndex:R,isSetCursor:!0}),l.index=u,this.position.setCursorPosition(l),this.ranges.setRange(u,u)},100)}else n>=0&&n<d.length&&d[n]?.metrics?.width!==void 0&&d[n].metrics.width<=0&&!d[n]?.strikeout&&(setTimeout(()=>{d.splice(n,1)},100),setTimeout(()=>{const h=n-1;this.draws.render({curIndex:h,isSetCursor:!0}),l.index=h,delete l.value,this.position.setCursorPosition(l),this.ranges.setRange(h,h)},100))}}strikeoute(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:r}=this.ranges.getRange(),l=this.draws.getElementList()[r];this.ranges.setDefaultStyle({strikeout:l.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}class Ca{draw;options;now;dom;renderOptions;isDatePicker;pickDate;lang;constructor(e,t={}){this.draw=e,this.options=t,this.lang=this._getLang(),this.now=new Date,this.dom=this._createDom(),this.renderOptions=null,this.isDatePicker=!0,this.pickDate=null,this._bindEvent()}_createDom(){const e=document.createElement("div");e.classList.add(`${re}-date-container`),e.setAttribute(Rt,gt.POPUP);const t=document.createElement("div");t.classList.add(`${re}-date-wrap`);const n=document.createElement("div");n.classList.add(`${re}-date-title`);const i=document.createElement("span");i.classList.add(`${re}-date-title__pre-year`),i.innerText="<<";const r=document.createElement("span");r.classList.add(`${re}-date-title__pre-month`),r.innerText="<";const s=document.createElement("span");s.classList.add(`${re}-date-title__now`);const l=document.createElement("span");l.classList.add(`${re}-date-title__next-month`),l.innerText=">";const a=document.createElement("span");a.classList.add(`${re}-date-title__next-year`),a.innerText=">>",n.append(i),n.append(r),n.append(s),n.append(l),n.append(a);const c=document.createElement("div");c.classList.add(`${re}-date-week`);const{weeks:{sun:d,mon:u,tue:h,wed:R,thu:g,fri:m,sat:f}}=this.lang;[d,u,h,R,g,m,f].forEach(v=>{const b=document.createElement("span");b.innerText=`${v}`,c.append(b)});const I=document.createElement("div");I.classList.add(`${re}-date-day`),t.append(n),t.append(c),t.append(I);const L=document.createElement("ul");L.classList.add(`${re}-time-wrap`);let S,M,X;[this.lang.hour,this.lang.minute,this.lang.second].forEach((v,b)=>{const P=document.createElement("li"),y=document.createElement("span");y.innerText=v,P.append(y);const N=document.createElement("ol"),U=b===0,w=b===1,Q=U?24:60;for(let K=0;K<Q;K++){const z=document.createElement("li");z.innerText=`${String(K).padStart(2,"0")}`,z.setAttribute("data-id",`${K}`),N.append(z)}U?S=N:w?M=N:X=N,P.append(N),L.append(P)});const F=document.createElement("div");F.classList.add(`${re}-date-menu`);const D=document.createElement("button");D.classList.add(`${re}-date-menu__time`),D.innerText=this.lang.timeSelect;const V=document.createElement("button");V.classList.add(`${re}-date-menu__now`),V.innerText=this.lang.now;const E=document.createElement("button");return E.classList.add(`${re}-date-menu__submit`),E.innerText=this.lang.confirm,F.append(D),F.append(V),F.append(E),e.append(t),e.append(L),e.append(F),this.draw.getContainer().append(e),{container:e,dateWrap:t,datePickerWeek:c,timeWrap:L,title:{preYear:i,preMonth:r,now:s,nextMonth:l,nextYear:a},day:I,time:{hour:S,minute:M,second:X},menu:{time:D,now:V,submit:E}}}_bindEvent(){this.dom.title.preYear.onclick=()=>{this._preYear()},this.dom.title.preMonth.onclick=()=>{this._preMonth()},this.dom.title.nextMonth.onclick=()=>{this._nextMonth()},this.dom.title.nextYear.onclick=()=>{this._nextYear()},this.dom.menu.time.onclick=()=>{this.isDatePicker=!this.isDatePicker,this._toggleDateTimePicker()},this.dom.menu.now.onclick=()=>{this._now(),this._submit()},this.dom.menu.submit.onclick=()=>{this.dispose(),this._submit()},this.dom.time.hour.onclick=e=>{if(!this.pickDate)return;const n=e.target.dataset.id;n&&(this.pickDate.setHours(Number(n)),this._setTimePick(!1))},this.dom.time.minute.onclick=e=>{if(!this.pickDate)return;const n=e.target.dataset.id;n&&(this.pickDate.setMinutes(Number(n)),this._setTimePick(!1))},this.dom.time.second.onclick=e=>{if(!this.pickDate)return;const n=e.target.dataset.id;n&&(this.pickDate.setSeconds(Number(n)),this._setTimePick(!1))}}_setPosition(){if(!this.renderOptions)return;const{position:{coordinate:{leftTop:[e,t]},lineHeight:n,pageNo:i}}=this.renderOptions,r=this.draw.getHeight(),s=this.draw.getPageGap(),a=(i??this.draw.getPageNo())*(r+s);this.dom.container.style.left=`${e}px`,this.dom.container.style.top=`${t+a+n}px`}isInvalidDate(e){return e.toDateString()==="Invalid Date"}_setValue(){const e=this.renderOptions?.value;if(e){const t=new Date(e);this.now=this.isInvalidDate(t)?new Date:t}else this.now=new Date;this.pickDate=new Date(this.now)}_getLang(){const e=this.draw.getI18n(),t=e.t.bind(e);return{now:t("datePicker.now"),confirm:t("datePicker.confirm"),return:t("datePicker.return"),timeSelect:t("datePicker.timeSelect"),weeks:{sun:t("datePicker.weeks.sun"),mon:t("datePicker.weeks.mon"),tue:t("datePicker.weeks.tue"),wed:t("datePicker.weeks.wed"),thu:t("datePicker.weeks.thu"),fri:t("datePicker.weeks.fri"),sat:t("datePicker.weeks.sat")},year:t("datePicker.year"),month:t("datePicker.month"),hour:t("datePicker.hour"),minute:t("datePicker.minute"),second:t("datePicker.second")}}_setLangChange(){this.dom.menu.time.innerText=this.lang.timeSelect,this.dom.menu.now.innerText=this.lang.now,this.dom.menu.submit.innerText=this.lang.confirm;const{weeks:{sun:e,mon:t,tue:n,wed:i,thu:r,fri:s,sat:l}}=this.lang,a=[e,t,n,i,r,s,l];this.dom.datePickerWeek.childNodes.forEach((h,R)=>{const g=h;g.innerText=a[R]});const c=this.dom.time.hour.previousElementSibling;c.innerText=this.lang.hour;const d=this.dom.time.minute.previousElementSibling;d.innerText=this.lang.minute;const u=this.dom.time.second.previousElementSibling;u.innerText=this.lang.second}_update(){const e=new Date,t=e.getFullYear(),n=e.getMonth()+1,i=e.getDate();let r=null,s=null,l=null;this.pickDate&&(r=this.pickDate.getFullYear(),s=this.pickDate.getMonth()+1,l=this.pickDate.getDate());const a=this.now.getFullYear(),c=this.now.getMonth()+1;this.dom.title.now.innerText=`${a}${this.lang.year} ${String(c).padStart(2,"0")}${this.lang.month}`;const u=new Date(a,c,0).getDate();let h=new Date(a,c-1,1).getDay();h===0&&(h=7);const R=new Date(a,c-1,0).getDate();this.dom.day.innerHTML="";const g=R-h+1;for(let f=g;f<=R;f++){const T=document.createElement("div");T.classList.add("disable"),T.innerText=`${f}`,T.onclick=()=>{const I=c-2;this.now=new Date(a,I,f),this._setDatePick(a,I,f)},this.dom.day.append(T)}for(let f=1;f<=u;f++){const T=document.createElement("div");t===a&&n===c&&i===f&&T.classList.add("active"),this.pickDate&&r===a&&s===c&&l===f&&T.classList.add("select"),T.innerText=`${f}`,T.onclick=I=>{const L=c-1;this.now=new Date(a,L,f),this._setDatePick(a,L,f),I.stopPropagation()},this.dom.day.append(T)}const m=42-h-u;for(let f=1;f<=m;f++){const T=document.createElement("div");T.classList.add("disable"),T.innerText=`${f}`,T.onclick=()=>{this.now=new Date(a,c,f),this._setDatePick(a,c,f)},this.dom.day.append(T)}}_toggleDateTimePicker(){this.isDatePicker?(this.dom.dateWrap.classList.add("active"),this.dom.timeWrap.classList.remove("active"),this.dom.menu.time.innerText=this.lang.timeSelect):(this.dom.dateWrap.classList.remove("active"),this.dom.timeWrap.classList.add("active"),this.dom.menu.time.innerText=this.lang.return,this._setTimePick())}_setDatePick(e,t,n){this.now=new Date(e,t,n),this.pickDate?.setFullYear(e),this.pickDate?.setMonth(t),this.pickDate?.setDate(n),this._update()}_setTimePick(e=!0){const t=this.pickDate?.getHours()||0,n=this.pickDate?.getMinutes()||0,i=this.pickDate?.getSeconds()||0,{hour:r,minute:s,second:l}=this.dom.time;[r,s,l].forEach(d=>{d.querySelectorAll("li").forEach(u=>u.classList.remove("active"))}),[[r,t],[s,n],[l,i]].forEach(([d,u])=>{const h=d.querySelector(`[data-id='${u}']`);h.classList.add("active"),e&&Ll(d,h)})}_preMonth(){this.now.setMonth(this.now.getMonth()-1),this._update()}_nextMonth(){this.now.setMonth(this.now.getMonth()+1),this._update()}_preYear(){this.now.setFullYear(this.now.getFullYear()-1),this._update()}_nextYear(){this.now.setFullYear(this.now.getFullYear()+1),this._update()}_now(){this.pickDate=new Date,this.dispose()}_toggleVisible(e){e?this.dom.container.classList.add("active"):this.dom.container.classList.remove("active")}_submit(){if(this.options.onSubmit&&this.pickDate){const e=this.renderOptions?.dateFormat,t=this.formatDate(this.pickDate,e);this.options.onSubmit(t)}}formatDate(e,t="YYYY-MM-DD HH:mm:ss"){let n=t;const i=e.getFullYear().toString(),r=(e.getMonth()+1).toString(),s=e.getDate().toString(),l=e.getHours(),a=l%12===0?12:l%12,c=e.getMinutes().toString(),d=e.getSeconds().toString(),u=e.getMilliseconds().toString(),h={"y+":i,"Y+":i,"M+":r,"d+":s,"D+":s,"h+":a.toString(),"H+":l.toString(),"m+":c,"s+":d,"S+":u};for(const R in h){const g=new RegExp("("+R+")").exec(t),m=R;g&&(n=n.replace(g[1],g[1].length===1?h[m]:h[m].padStart(g[1].length,"0")))}return n}render(e){this.renderOptions=e,this.lang=this._getLang(),this._setLangChange(),this._setValue(),this._update(),this._setPosition(),this.isDatePicker=!0,this._toggleDateTimePicker(),this._toggleVisible(!0)}dispose(){this._toggleVisible(!1)}destroy(){this.dom.container.remove()}}class Io{draw;element;control;isPopup;datePicker;options;constructor(e,t){const n=t.getDraw();this.draw=n,this.options=n.getOptions(),this.element=e,this.control=t,this.isPopup=!1,this.datePicker=null}setElement(e){this.element=e}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(e={}){const t=e.elementList||this.control.getElementList(),n=this.control.getValueRange(e);if(!n)return[];const i=[],{startIndex:r,endIndex:s}=n;for(let l=r;l<=s;l++){const a=t[l];a.controlComponent===p.VALUE&&i.push(a)}return i}setValue(e,t={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const{elementList:i,range:r}=this.control.mergeControl(t);this.control.shrinkBoundary(t);const{startIndex:s,endIndex:l}=r,a=this.control.getDraw();s!==l?a.spliceElementList(i,s+1,l-s):this.control.removePlaceholder(s,{elementList:i});const c=i[s],d=c.type&&!wt.includes(c.type)||c.controlComponent===p.PREFIX||c.controlComponent===p.PRE_TEXT?at(c,["control","controlId",...Ft]):$t(c,["type"]),u=r.startIndex+1;for(let h=0;h<e.length;h++){const R={...d,...e[h],controlComponent:p.VALUE};ze(i,[R],s,{editorOptions:this.options}),a.spliceElementList(i,u+h,0,[R])}return u+e.length-1}clearSelect(e={},t={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=t;if(!n&&this.control.getIsDisabledControl(e))return-1;const r=this.control.getValueRange(e);if(!r)return-1;const{startIndex:s,endIndex:l}=r;if(!~s||!~l)return-1;const a=e.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(a,s+1,l-s,[],{isIgnoreDeletedRule:t.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(s,e),s}setSelect(e,t={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return;const i=t.elementList||this.control.getElementList(),r=t.range||this.control.getRange(),s=this.getValue(t)[0],l=s?at(s,rn):at(i[r.startIndex],Ft),a=this.clearSelect(t,{isAddPlaceholder:!1,isIgnoreDeletedRule:n.isIgnoreDeletedRule});if(!~a)return;const c=$t(i[a],rn),d=a+1,u=this.control.getDraw();for(let h=0;h<e.length;h++){const R={...l,...c,type:O.TEXT,value:e[h],controlComponent:p.VALUE};(R.color===this.options.control.bracketColor||R.color===this.options.control.placeholderColor)&&(R.color=this.options.defaultColor),ze(i,[R],a,{editorOptions:this.options}),u.spliceElementList(i,d+h,0,[R])}if(!t.range){const h=d+e.length-1;this.control.repaintControl({curIndex:h}),this.control.emitControlContentChange({context:t}),this.destroy()}}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=t[i],l=t[r],a=this.control.getDraw();if(e.key===Te.Backspace)return i!==r?(a.spliceElementList(t,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):s.controlComponent===p.PREFIX||s.controlComponent===p.PRE_TEXT||l.controlComponent===p.POSTFIX||l.controlComponent===p.POST_TEXT||s.controlComponent===p.PLACEHOLDER?this.control.removeControl(i):(a.spliceElementList(t,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(e.key===Te.Delete){if(i!==r)return a.spliceElementList(t,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i;{const c=t[r+1];return(s.controlComponent===p.PREFIX||s.controlComponent===p.PRE_TEXT)&&c.controlComponent===p.PLACEHOLDER||c.controlComponent===p.POSTFIX||c.controlComponent===p.POST_TEXT||s.controlComponent===p.PLACEHOLDER?this.control.removeControl(i):(a.spliceElementList(t,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}}return r}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:e,endIndex:t}=this.control.getRange();if(e===t)return e;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,e+1,t-e),this.getValue().length||this.control.addPlaceholder(e),e}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const e=this.control.getPosition();if(!e)return;const t=this.draw.getElementList(),{startIndex:n}=this.control.getRange();if(t[n+1]?.controlId!==this.element.controlId)return;this.datePicker=new Ca(this.draw,{onSubmit:this._setDate.bind(this)});const i=this.getValue().map(s=>s.value).join("")||"",r=this.element.control?.dateFormat;this.datePicker.render({value:i,position:e,dateFormat:r}),this.isPopup=!0}destroy(){this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}_setDate(e){e?this.setSelect(e):this.clearSelect(),this.destroy()}}class Po extends Ps{isPopup;inputPopup;constructor(e,t){super(e,t),this.isPopup=!1,this.inputPopup=null}getIsPopup(){return this.isPopup}setValue(e,t={},n={}){if(e.some(S=>!pd(S)||ac.test(S.value)))return-1;const i=t.elementList||this.control.getElementList(),r=t.range||this.control.getRange();this.control.shrinkBoundary(t);const s=xe(e),{startIndex:l,endIndex:a}=r,c=i[l];let d=null;for(let S=l;S>=0;S--)if(i[S].controlComponent===p.PREFIX){d=i[S];break}const u=d?.control||this.element.control;if(this.control.getIsExistValueByElementListIndex(i,l)){let S=l;for(;S>0;){const X=i[S];if(X.controlId!==c.controlId||X.controlComponent===p.PREFIX||X.controlComponent===p.PRE_TEXT)break;s.unshift(X),S--}let M=a+1;for(;M<i.length;){const X=i[M];if(X.controlId!==c.controlId||X.controlComponent===p.POSTFIX||X.controlComponent===p.POST_TEXT)break;s.push(X),M++}}const h=vr(s);if(Number.isNaN(Number(h))||!Number.isFinite(Number(h)))return-1;const R=u?.numberExclusiveOptions,g=R?.maxLength??null,m=R?.decimalPlaces??null,f=h.replace(/[.-]/g,"").length;if(g!=null&&f>g||m!=null&&(h.split(".")[1]||"").length>m)return-1;const T=Number(h),I=R?.minValue,L=R?.maxValue;return I!=null&&T<I||L!=null&&T>L?-1:super.setValue(e,t,n)}_setNumberValue(e){const t=this.control.getElementList(),n=this.control.getRange(),{startIndex:i}=n;let r=null;for(let M=i;M>=0;M--)if(t[M].controlComponent===p.PREFIX){r=t[M];break}const l=(r?.control||this.element.control)?.numberExclusiveOptions,a=l?.minValue,c=l?.maxValue,d=l?.decimalPlaces,u=l?.minLength,h=l?.maxLength;let R=e;d!=null&&(R=parseFloat(e.toFixed(d)));const g=R.toString(),m=g.replace(/[.-]/g,"").length;if(u!=null&&m<u||h!=null&&m>h||a!=null&&R<a||c!=null&&R>c)return!1;let f=i;for(let M=i;M>=0;M--)if(t[M].controlComponent===p.PREFIX){f=M;break}let T=f+1;for(let M=f+1;M<t.length;M++)if(t[M].controlComponent===p.POSTFIX){T=M;break}const I=this.options.mode===B.FORM,L=ce(new Date).format("YYYY-MM-DD HH:mm:ss");if(I)for(let M=f+1;M<T;M++){const X=t[M];X.controlComponent===p.VALUE&&!X.strikeout&&X.value&&(X.strikeout=!0,X.deletePerson="SYSTEM",X.deleteTime=L),X.controlComponent===p.PLACEHOLDER&&(this.control.getDraw().spliceElementList(t,M,1),T--,M--)}else{const M=f+1,X=T-M;X>0&&this.control.getDraw().spliceElementList(t,M,X),T=f+1}T=f+1;for(let M=f+1;M<t.length;M++)if(t[M].controlComponent===p.POSTFIX){T=M;break}const S=[];for(let M=0;M<g.length;M++){const X={type:O.TEXT,value:g[M],controlComponent:p.VALUE,controlId:t[f].controlId};I&&(X.textDecoration={style:Xn.DOUBLE},X.underline=!0),S.push(X)}for(let M=0;M<S.length;M++)this.control.getDraw().spliceElementList(t,T+M,0,[S[M]]);return this.control.repaintControl({curIndex:T+S.length-1}),this.control.emitControlContentChange(),!0}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl())return;const e=this.control.getElementList(),t=this.control.getRange(),{startIndex:n}=t,i=e[n];if(!i||i.controlId!==this.element.controlId)return;let r=null;for(let g=n;g>=0;g--)if(e[g].controlComponent===p.PREFIX){r=e[g];break}const s=r?.control||this.element.control,a=this.getValue().filter(g=>!g.strikeout),c=a.length>0?vr(a):"",d=s?.numberExclusiveOptions,u=d?.minValue,h=d?.maxValue,R=d?.decimalPlaces;this.inputPopup=new Yp({control:this.control,currentValue:c,minValue:u,maxValue:h,decimalPlaces:R,onConfirm:g=>{if(!g||g.trim()==="")return this._clearNumberValue(),!0;const m=parseFloat(g);return Number.isNaN(m)||!Number.isFinite(m)?!1:this._setNumberValue(m)},onClose:()=>{this.destroy()}}),this.inputPopup.create(),this.isPopup=!0}_clearNumberValue(){const e=this.control.getElementList(),t=this.control.getRange(),{startIndex:n}=t;let i=n;for(let a=n;a>=0;a--)if(e[a].controlComponent===p.PREFIX){i=a;break}let r=i+1;for(let a=i+1;a<e.length;a++)if(e[a].controlComponent===p.POSTFIX){r=a;break}const s=i+1,l=r-s;l>0&&this.control.getDraw().spliceElementList(e,s,l),this.control.addPlaceholder(i),this.control.repaintControl({curIndex:i}),this.control.emitControlContentChange()}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i,endIndex:r}=n,s=t[i],l=t[r],a=this.control.getDraw();if(e.key==="Backspace")return s.controlComponent===p.PREFIX||s.controlComponent===p.PRE_TEXT||s.controlComponent===p.PLACEHOLDER?this.control.removeControl(i):l.controlComponent===p.POSTFIX||l.controlComponent===p.POST_TEXT?i:i!==r?(a.spliceElementList(t,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):(a.spliceElementList(t,i,1),this.getValue().length||this.control.addPlaceholder(i-1),i-1);if(e.key==="Delete"){const d=t[r+1];return s.controlComponent===p.PLACEHOLDER||l.controlComponent===p.POSTFIX||l.controlComponent===p.POST_TEXT?this.control.removeControl(i):s.controlComponent===p.PREFIX||s.controlComponent===p.PRE_TEXT||d?.controlComponent===p.POSTFIX||d?.controlComponent===p.POST_TEXT?r:i!==r?(a.spliceElementList(t,i+1,r-i),this.getValue().length||this.control.addPlaceholder(i),i):(a.spliceElementList(t,i+1,1),this.getValue().length||this.control.addPlaceholder(i),i)}return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey?(e.preventDefault(),this.awake(),null):r}destroy(){this.inputPopup&&(this.inputPopup.destroy(),this.inputPopup=null),this.isPopup=!1}}class Yp{options;popupDom;constructor(e){this.options=e,this.popupDom=null}create(){const{currentValue:e,minValue:t,maxValue:n,decimalPlaces:i,onConfirm:r,onClose:s}=this.options,l=document.createElement("div");l.classList.add(`${re}-number-input-modal`),l.setAttribute(Rt,gt.POPUP);const a=document.createElement("div");a.classList.add(`${re}-number-input-modal__content`);const c=document.createElement("div");if(c.classList.add(`${re}-number-input-modal__title`),c.textContent="请输入数值",a.appendChild(c),t!==void 0||n!==void 0){const f=document.createElement("div");f.classList.add(`${re}-number-input-modal__hint`);let T="有效范围:";t!==void 0&&n!==void 0?T+=`${t} ~ ${n}`:t!==void 0?T+=`≥ ${t}`:T+=`≤ ${n}`,i!=null&&(T+=`,保留${i}位小数`),f.textContent=T,a.appendChild(f)}const d=document.createElement("input");d.classList.add(`${re}-number-input-modal__input`),d.type="number",d.value=e,d.placeholder="请输入数值",t!==void 0&&(d.min=String(t)),n!==void 0&&(d.max=String(n)),i!=null&&(d.step=(1/Math.pow(10,i)).toString()),setTimeout(()=>{d.focus(),d.select()},100),a.appendChild(d);const u=document.createElement("div");u.classList.add(`${re}-number-input-modal__error`),u.style.display="none",a.appendChild(u);const h=document.createElement("div");h.classList.add(`${re}-number-input-modal__buttons`);const R=document.createElement("button");R.classList.add(`${re}-number-input-modal__cancel`),R.textContent="取消",R.onclick=()=>{s()},h.appendChild(R);const g=document.createElement("button");g.classList.add(`${re}-number-input-modal__confirm`),g.textContent="确定",g.onclick=()=>{const f=d.value.trim();if(!f){r("")&&s();return}const T=parseFloat(f);if(Number.isNaN(T)||!Number.isFinite(T)){u.textContent="请输入有效的数值",u.style.display="block";return}if(i!=null&&(f.split(".")[1]||"").length>i){u.textContent=`小数位数不能超过${i}位`,u.style.display="block";return}if(t!==void 0&&T<t){u.textContent=`数值不能小于 ${t}`,u.style.display="block";return}if(n!==void 0&&T>n){u.textContent=`数值不能大于 ${n}`,u.style.display="block";return}r(f)&&s()},h.appendChild(g),a.appendChild(h),l.appendChild(a),d.onkeydown=f=>{f.key==="Enter"?g.click():f.key==="Escape"&&s()},this.options.control.getContainer().appendChild(l),this.popupDom=l}destroy(){this.popupDom&&(this.popupDom.remove(),this.popupDom=null)}}class et{options;mask;container;inputList;optionItemContainers;data;constructor(e){this.options=e,this.mask=null,this.container=null,this.inputList=[],this.optionItemContainers=[],this.data=e.data,this._render()}_getFieldValue(e){const t=this.inputList.filter(n=>n.name===e);if(t.length!==0){for(const n of t)if(n instanceof HTMLInputElement&&n.type==="radio"&&n.checked)return n.value;return t[0].value}}_updateFieldVisibility(){this.data.forEach((e,t)=>{if(e.visibleWhen){const{field:n,value:i}=e.visibleWhen,r=this._getFieldValue(n),s=this.optionItemContainers[t];if(s){const l=r===i;s.style.display=l?"":"none"}}})}_render(){const{title:e,onClose:t,onCancel:n,onConfirm:i}=this.options,r=document.createElement("div");r.classList.add("dialog-mask"),r.setAttribute(Rt,gt.COMPONENT),document.body.append(r);const s=document.createElement("div");s.classList.add("dialog-container"),s.setAttribute(Rt,gt.COMPONENT);const l=document.createElement("div");l.classList.add("dialog"),s.append(l);const a=document.createElement("div");a.classList.add("dialog-title");const c=document.createElement("span");c.append(document.createTextNode(e));const d=document.createElement("i");d.onclick=()=>{t&&t(),this._dispose()},a.append(c),a.append(d),l.append(a);const u=document.createElement("div");u.classList.add("dialog-option");for(let m=0;m<this.data.length;m++){const f=this.data[m],T=document.createElement("div");if(T.classList.add("dialog-option__item"),f.visible===!1&&(T.style.display="none"),f.label){const I=document.createElement("span");I.append(document.createTextNode(f.label)),T.append(I),f.required&&I.classList.add("dialog-option__item--require")}if(f.type==="radio"){const I=document.createElement("div");I.classList.add("dialog-radio-group"),f.horizontal&&I.classList.add("dialog-radio-group--horizontal"),f.options?.forEach(L=>{const S=document.createElement("label");S.classList.add("dialog-radio-item");const M=document.createElement("input");M.type="radio",M.name=f.name,M.value=L.value,L.value===(f.value||"")&&(M.checked=!0);const X=document.createElement("span");X.textContent=L.label,S.append(M),S.append(X),I.append(S),M.addEventListener("change",()=>{this._updateFieldVisibility()}),this.inputList.push(M)}),T.append(I)}else if(f.type==="select"){const I=document.createElement("select"),L=f.value||"";f.options?.forEach(S=>{const M=document.createElement("option");M.value=S.value,M.label=S.label,S.value===L&&(M.selected=!0),I.append(M)}),I.name=f.name,I.value=L,I.addEventListener("change",()=>{this._updateFieldVisibility()}),f.width&&(I.style.width=`${f.width}px`),T.append(I),this.inputList.push(I)}else if(f.type==="textarea"){const I=document.createElement("textarea");I.name=f.name,I.value=f.value||"",I.placeholder=f.placeholder||"",f.width&&(I.style.width=`${f.width}px`),f.height&&(I.style.height=`${f.height}px`),T.append(I),this.inputList.push(I)}else{const I=document.createElement("input");I.type=f.type,I.name=f.name,I.value=f.value||"",I.placeholder=f.placeholder||"",f.width&&(I.style.width=`${f.width}px`),f.height&&(I.style.height=`${f.height}px`),T.append(I),this.inputList.push(I)}u.append(T),this.optionItemContainers.push(T)}l.append(u);const h=document.createElement("div");h.classList.add("dialog-menu");const R=document.createElement("button");R.classList.add("dialog-menu__cancel"),R.append(document.createTextNode("取消")),R.type="button",R.onclick=()=>{n&&n(),this._dispose()},h.append(R);const g=document.createElement("button");g.append(document.createTextNode("确定")),g.type="submit",g.onclick=()=>{if(i){const m=new Set,f=[];for(const T of this.inputList)if(!m.has(T.name))if(T instanceof HTMLInputElement&&T.type==="radio"){const I=this.inputList.find(L=>L.name===T.name&&L instanceof HTMLInputElement&&L.checked);I&&(f.push({name:T.name,value:I.value}),m.add(T.name))}else f.push({name:T.name,value:T.value}),m.add(T.name);i(f)}this._dispose()},h.append(g),l.append(h),document.body.append(s),this.container=s,this.mask=r,this._updateFieldVisibility()}_dispose(){this.mask?.remove(),this.container?.remove()}}class Qn{draw;element;control;isPopup;datePicker;options;range;static isDeleting=!1;inputModal=null;constructor(e,t){const n=t.getDraw();this.draw=n,this.range=n.getRange(),this.options=n.getOptions(),this.element=e,this.control=t,this.isPopup=!1,this.datePicker=null}setElement(e){this.element=e}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(){return[]}setValue(e,t={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const{elementList:i,range:r}=this.control.mergeControl(t),s=this.control.getDraw(),{startIndex:l}=r,c=i[l].controlId;let d=l;for(let T=l;T>=0;T--){const I=i[T];if(I.controlId!==c)break;if(I.controlComponent===p.PREFIX){d=T;break}}let u=l;for(let T=l;T<i.length;T++){const I=i[T];if(I.controlId!==c){u=T;break}if(I.controlComponent===p.POSTFIX){u=T;break}}const h=d+1,R=u-1;R>=h&&s.spliceElementList(i,h,R-h+1);const g=i[d],m=at(g,["control","controlId",...Ft]),f=d+1;for(let T=0;T<e.length;T++){const I={...m,...e[T],controlComponent:p.VALUE};I.color="#fff",I.highlight="#1677FF",ze(i,[I],d,{editorOptions:this.options}),s.spliceElementList(i,f+T,0,[I])}return f+e.length-1}clearSelect(e={},t={}){const{isIgnoreDisabledRule:n=!1,isAddPlaceholder:i=!0}=t;if(!n&&this.control.getIsDisabledControl(e))return-1;const r=this.control.getValueRange(e);if(!r)return-1;const{startIndex:s,endIndex:l}=r;if(!~s||!~l)return-1;const a=e.elementList||this.control.getElementList();return this.control.getDraw().spliceElementList(a,s+1,l-s,[],{isIgnoreDeletedRule:t.isIgnoreDeletedRule}),i&&this.control.addPlaceholder(s,e),s}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{endIndex:i}=n,r=t[i];return r?.controlComponent==="value"&&r.control?.type==="button"&&r.control?.buttonText?e.key===Te.Backspace||e.key===Te.Delete?(r.controlId&&this.removeByValue(t,r.controlId),i):null:(e.key===Te.Backspace&&r?.controlComponent==="value"&&r.control?.type==="button"&&!r.control?.buttonText,null)}removeByValue(e,t){return Qn.isDeleting=!0,new Promise(n=>{for(let a=e.length-1;a>=0;a--)(e[a].type=="control"||e[a].type=="text")&&e[a].controlId===t&&e.splice(a,1);const{startIndex:i,endIndex:r}=this.range.getRange(),s=!0,l=r;this.draw.render({curIndex:l,isSetCursor:s}),setTimeout(()=>{Qn.isDeleting=!1},300),n(!0)})}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:e,endIndex:t}=this.control.getRange();if(e===t)return e;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,e+1,t-e),this.getValue().length||this.control.addPlaceholder(e),e}awake(){if(this.isPopup||this.control.getIsDisabledControl()||!this.control.getIsRangeWithinControl()||Qn.isDeleting||!this.control.getPosition())return;const t=this.draw.getElementList(),{startIndex:n}=this.control.getRange();if(t[n]?.controlId!==this.element?.controlId)return;const i=this.control.getDraw().getPosition().getPositionContext();if(!i.isDirectHit||i.index!==n||t[i.index]?.controlId!==this.element?.controlId)return;const r=t[n]?.controlId,s=t[n]?.control;if(!(r?.endsWith("_text")||s?.buttonText)){if(this.options.mode=="form"){const l=t[n].controlId;if(!l)return;const a=t.filter(c=>c.controlId==l);a[0].control.buttonText||this.showInputModal(a)}else if(this.options.mode=="edit"){const l=t[n].controlId,a=t.filter(c=>c.controlId==l);this.showEditModal(a)}}}showInputModal(e){if(this.inputModal){this.closeInputModal();return}this.isPopup=!0,this.inputModal=document.createElement("div"),this.inputModal.classList.add(`${re}-button-input-modal`),this.inputModal.setAttribute(Rt,gt.POPUP),this.inputModal.oncontextmenu=a=>{a.preventDefault(),a.stopPropagation()};const t=document.createElement("div");t.classList.add(`${re}-button-input-modal__content`),t.oncontextmenu=a=>{a.preventDefault(),a.stopPropagation()};const n=document.createElement("div");n.classList.add(`${re}-button-input-modal__title`),n.innerText="请输入按钮展开文字(用逗号分隔)";const i=document.createElement("textarea");i.classList.add(`${re}-button-input-modal__textarea`),i.placeholder="例如:选项1,选项2,选项3",i.rows=5;const r=document.createElement("div");r.classList.add(`${re}-button-input-modal__buttons`);const s=document.createElement("button");s.classList.add(`${re}-button-input-modal__cancel`),s.innerText="取消",s.onclick=()=>this.closeInputModal();const l=document.createElement("button");l.classList.add(`${re}-button-input-modal__confirm`),l.innerText="确认",l.onclick=()=>{const a=i.value.trim();if(a){const c=a.split(/[,,]/).map((d,u)=>({value:d.trim(),code:String(u+1)})).filter(d=>d.value);if(c.length>0&&e[0]?.controlId){const d={controlId:e[0].controlId,element:[{...e[0],newButtonValue:c}]};this.draw.getCommand().executeButton(d)}}this.closeInputModal()},r.appendChild(s),r.appendChild(l),t.appendChild(n),t.appendChild(i),t.appendChild(r),this.inputModal.appendChild(t),this.draw.getContainer().appendChild(this.inputModal),setTimeout(()=>i.focus(),100),this.inputModal.onclick=a=>{a.target===this.inputModal&&this.closeInputModal()}}closeInputModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}showEditModal(e){const t=e[0]?.control||{},n=t.buttonLabel||t.label||"按钮",i=t.code||"";this.isPopup=!0,new et({title:"修改按钮属性",data:[{type:"text",label:"按钮标签",name:"buttonLabel",required:!0,placeholder:"请输入按钮标签",value:n},{type:"text",label:"按钮代码",name:"code",placeholder:"请输入按钮代码",value:i}],onClose:()=>{this.isPopup=!1},onCancel:()=>{this.isPopup=!1},onConfirm:r=>{const s=r.find(h=>h.name==="buttonLabel")?.value?.trim()||"按钮",l=r.find(h=>h.name==="code")?.value?.trim()||"",a=this.control.getElementList(),c=e[0]?.controlId;if(c)for(let h=0;h<a.length;h++){const R=a[h];R.controlId===c&&R.control&&(R.control.buttonLabel=s,R.control.label=s,R.control.code=l)}const d=[];for(let h=0;h<s.length;h++)d.push({value:s[h],controlComponent:p.VALUE});const u=this.setValue(d);u!==-1&&this.control.repaintControl({curIndex:u}),this.isPopup=!1}})}destroy(){this.isPopup&&(this.datePicker?.destroy(),this.isPopup=!1)}}class Gr{draws;ranges;element;control;options;position;constructor(e,t){const n=t.getDraw();this.draws=n,this.position=n.getPosition(),this.ranges=n.getRange(),this.options=n.getOptions(),this.element=e,this.control=t}setElement(e){this.element=e}getElement(){return this.element}getValue(e={}){const t=e.elementList||this.control.getElementList();let{startIndex:n}=e.range||this.control.getRange();const i=this.control.getDraw(),r=e?null:i.getTd();n>=t.length&&(n=t.length-1);const s=t[n],l=[];let a=r;if(s.controlComponent===p.PRETEXTFIX||s.controlComponent===p.PRETEXTFIX_TEXT){let g=n+1;for(;g<t.length;){const m=t[g];if(m.controlId!==s.controlId||m.controlComponent!==p.PRETEXTFIX&&m.controlComponent!==p.PRETEXTFIX_TEXT){n=g-1;break}g++}}let c=t,d=n;for(;;){if(d<0&&a?.linkTdPrevId){const m=i.getTdById(a.linkTdPrevId);if(m){c=m.value,d=c.length-1,a=m;continue}}if(d<0)break;const g=c[d];if(g.controlId!==s.controlId||g.controlComponent===p.PRETEXTFIX||g.controlComponent===p.PRETEXTFIX_TEXT||g.controlComponent===p.TEXTFIXLABEL)break;g.controlComponent===p.VALUE&&l.unshift(g),d--}a=r;let u=t,h=n+1;for(;;){if(h>=u.length&&a?.linkTdNextId){const m=i.getTdById(a.linkTdNextId);if(m){u=m.value,h=0,a=m;continue}}const g=u[h];if(!g||g.controlId!==s.controlId||g.controlComponent===p.POSTTEXTFIX||g.controlComponent===p.POSTTEXTFIX_TEXT||g.controlComponent===p.TEXTFIXLABEL)break;g.controlComponent===p.VALUE&&l.push(g),h++}return l.filter(g=>g.type!==O.SPLIT_TAG)}removeNextControlElement(e,t){const n=this.control.getDraw();if(t=t??n.getTd()?.linkTdNextId,t){const i=n.getTdById(t);if(i){if(i.value.length){if(i.value[1].controlId===e)return n.spliceElementList(i.value,1,1),i.value[1]}else if(i.linkTdNextId)return this.removeNextControlElement(e,i.linkTdNextId)}}}setValue(e,t={},n={}){if(this.options.mode===B.FORM||!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const{elementList:i,range:r}=this.control.mergeControl(t);this.control.shrinkBoundary(t);const{startIndex:s,endIndex:l}=r,a=this.control.getDraw();s!==l?a.spliceElementList(i,s+1,l-s,[],{isIgnoreDeletedRule:n.isIgnoreDeletedRule}):this.control.removePlaceholder(s,{elementList:i});const c=i[s],d=i[s+1];let u=c.originControlId||c.controlId,h=c.originControlId&&(c.controlComponent===p.POSTFIX||c.controlComponent===p.POSTTEXTFIX||c.controlComponent===p.POSTTEXTFIX_TEXT||c.controlComponent===p.POST_TEXT);if(!h&&c.controlId&&(c.controlComponent===p.POSTFIX||c.controlComponent===p.POSTTEXTFIX||c.controlComponent===p.POSTTEXTFIX_TEXT||c.controlComponent===p.POST_TEXT)&&d?.controlId&&d.controlId!==c.controlId)if(d.controlComponent===p.PREFIX||d.controlComponent===p.PRETEXTFIX)for(let f=s;f>=0;f--){const T=i[f];if(T.controlId===c.controlId&&(T.controlComponent===p.PREFIX||T.controlComponent===p.PRETEXTFIX)){for(let I=f-1;I>=0;I--){const L=i[I];if(L.controlId&&L.controlId!==c.controlId&&(L.controlComponent===p.PRETEXTFIX||L.controlComponent===p.PRETEXTFIX_TEXT||L.controlComponent===p.PREFIX||L.controlComponent===p.PRE_TEXT)){u=L.controlId,h=!0;break}if(L.controlId&&L.controlId!==c.controlId&&(L.controlComponent===p.POSTFIX||L.controlComponent===p.POSTTEXTFIX))break}break}}else(d.controlComponent===p.POSTFIX||d.controlComponent===p.POSTTEXTFIX)&&(u=d.controlId,h=!0);if(!h&&c.controlId&&(c.controlComponent===p.POSTFIX||c.controlComponent===p.POSTTEXTFIX||c.controlComponent===p.POSTTEXTFIX_TEXT||c.controlComponent===p.POST_TEXT))for(let f=s;f>=0;f--){const T=i[f];if(T.controlId===c.controlId&&(T.controlComponent===p.PREFIX||T.controlComponent===p.PRETEXTFIX)){for(let I=f-1;I>=0;I--){const L=i[I];if(L.controlId&&L.controlId!==c.controlId&&(L.controlComponent===p.PRETEXTFIX||L.controlComponent===p.PRETEXTFIX_TEXT||L.controlComponent===p.PREFIX||L.controlComponent===p.PRE_TEXT)){u=L.controlId,h=!0;break}if(L.controlId&&L.controlId!==c.controlId&&(L.controlComponent===p.POSTFIX||L.controlComponent===p.POSTTEXTFIX))break}break}}const R=c.type&&!wt.includes(c.type)||c.controlComponent===p.PRETEXTFIX||c.controlComponent===p.PRETEXTFIX_TEXT?at(c,["control","controlId",...Ft]):$t(c,["type"]);h&&(R.controlId=u,delete R.originControlId);let g=r.startIndex+1,m=0;for(let f=0;f<e.length;f++){const T=e[f];if(T.type===O.CONTROL&&T.control){const I=T,L=I.controlId||Ee(),S=I.control?.value||[],M=I.control?.type===Y.TEXTFIELD,X={...R,controlId:L,type:O.CONTROL,control:I.control,originControlId:u},x=M?p.PRETEXTFIX:p.PREFIX,F=M?p.POSTTEXTFIX:p.POSTFIX,D=M?I.control?.preTextFix||this.options.control.preTextFix:I.control?.prefix||this.options.control.prefix;for(let E=0;E<D.length;E++){const v={...X,value:D[E],controlComponent:x};ze(i,[v],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[v]),g++,m++}for(let E=0;E<S.length;E++){const v=S[E],b={...X,...v,controlComponent:p.VALUE,type:v.type};(b.color===this.options.control.textFixColor||b.color===this.options.control.placeholderColor)&&(b.color=this.options.defaultColor),ze(i,[b],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[b]),g++,m++}if(S.length===0){const E=I.control?.placeholder||"";for(let v=0;v<E.length;v++){const b={...X,value:E[v],controlComponent:p.PLACEHOLDER,color:this.options.control.placeholderColor};ze(i,[b],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[b]),g++,m++}}const V=M?I.control?.postTextFix||this.options.control.postTextFix:I.control?.postfix||this.options.control.postfix;for(let E=0;E<V.length;E++){const v={...X,value:V[E],controlComponent:F};ze(i,[v],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[v]),g++,m++}}else if(T.type||T.value){R.color=this.options.defaultColor;const I={...R,...T,controlComponent:p.VALUE};(I.color===this.options.control.textFixColor||I.color===this.options.control.placeholderColor)&&(I.color=this.options.defaultColor),ze(i,[I],g-1,{editorOptions:this.options}),a.spliceElementList(i,g,0,[I]),g++,m++}}return r.startIndex+m}clearValue(e={},t={}){if(!t.isIgnoreDisabledRule&&this.control.getIsDisabledControl(e))return-1;const n=e.elementList||this.control.getElementList(),i=e.range||this.control.getValueRange()||this.control.getRange();this.control.shrinkBoundary(e);const{startIndex:r,endIndex:s}=i;return this.control.getDraw().spliceElementList(n,r+1,s-r,[],{isIgnoreDeletedRule:t.isIgnoreDeletedRule}),t.isAddPlaceholder!==!1&&(this.getValue(e).length||this.control.addPlaceholder(r,e)),r}keydown(e){if(this.control.getIsDisabledControl())return null;const t=this.control.getElementList(),n=this.control.getRange(),i=n.startIndex,r=n.endIndex;if(e.key===Te.Backspace&&i===r&&i>0){const g=t[i-1],m=g?.controlComponent===p.POSTFIX||g?.controlComponent===p.POSTTEXTFIX,f=g?.controlComponent===p.PLACEHOLDER,T=!!g?.controlId,L=this.draws.getPosition().getPositionList(),S=L[i],M=L[i-1],X=S&&M&&S.rowIndex===M.rowIndex;if((m||f)&&T&&X)return this.control.removeControl(i-1)}this.control.shrinkBoundary();const{startIndex:s,endIndex:l}=n,a=t[s],c=this.control.getDraw(),d=t[l+1],h=!!a?.originControlId&&!!a?.controlId&&a.originControlId!==a.controlId&&(a.controlComponent===p.PREFIX||a.controlComponent===p.PRE_TEXT||a.controlComponent===p.PRETEXTFIX||a.controlComponent===p.PRETEXTFIX_TEXT||a.controlComponent===p.POSTFIX||a.controlComponent===p.POST_TEXT||a.controlComponent===p.POSTTEXTFIX||a.controlComponent===p.POSTTEXTFIX_TEXT||a.controlComponent===p.PLACEHOLDER||a.controlComponent===p.TEXTFIXLABEL),R=!!d?.originControlId&&!!d?.controlId&&d.originControlId!==d.controlId&&(d.controlComponent===p.PREFIX||d.controlComponent===p.PRE_TEXT||d.controlComponent===p.PRETEXTFIX||d.controlComponent===p.PRETEXTFIX_TEXT||d.controlComponent===p.PLACEHOLDER||d.controlComponent===p.TEXTFIXLABEL);if(e.key===Te.Backspace){if(s===l&&h)return this.control.removeControl(s);if(this.options.mode===B.FORM)this.strikeout();else return s!==l?t.slice(s,l+1).some(f=>f.controlComponent===p.POSTTEXTFIX||f.controlComponent===p.POSTTEXTFIX_TEXT)?s:(c.spliceElementList(t,s+1,l-s),this.getValue().length||this.control.addPlaceholder(s),s===0&&t[0].type===O.SPLIT_TAG?c.fixPosition(!0)??s:s):a.controlComponent===p.PRETEXTFIX||a.controlComponent===p.PRETEXTFIX_TEXT||a.controlComponent===p.POSTTEXTFIX||a.controlComponent===p.POSTTEXTFIX_TEXT||a.controlComponent===p.TEXTFIXLABEL||a.controlComponent===p.PLACEHOLDER?s:(c.spliceElementList(t,s,1),this.getValue().length||this.control.addPlaceholder(s-1),s===1&&t[0].type===O.SPLIT_TAG||s===0?c.fixPosition(!0)??s-1:s-1)}else if(e.key===Te.Delete){if(s===l&&h)return this.control.removeControl(s);if(s===l&&R)return this.control.removeControl(l+1);if(this.options.mode===B.FORM)this.strikeout();else return s!==l?(c.spliceElementList(t,s+1,l-s),this.getValue().length||this.control.addPlaceholder(s),s===0&&t[0].type===O.SPLIT_TAG?c.fixPosition(!0)??s:s):(d||c.getTd()?.linkTdNextId&&a.controlId&&this.removeNextControlElement(a.controlId),d&&((a.controlComponent===p.PRETEXTFIX||a.controlComponent===p.PRETEXTFIX_TEXT)&&(d.controlComponent===p.PLACEHOLDER||d.controlComponent===p.TEXTFIXLABEL)||d.controlComponent===p.POSTTEXTFIX||d.controlComponent===p.POSTTEXTFIX_TEXT||a.controlComponent===p.PLACEHOLDER||a.controlComponent===p.TEXTFIXLABEL)?s:(c.spliceElementList(t,s+1,1),this.getValue().length||this.control.addPlaceholder(s),s===0&&t[0].type===O.SPLIT_TAG?c.fixPosition(!0)??s:s))}return l}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:e,endIndex:t}=this.control.getRange();if(e===t)return e;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,e+1,t-e),this.getValue().length||this.control.addPlaceholder(e),e}strikeout(e,t={},n={}){const{isIgnoreDisabledRule:i=!1}=e||{};if(!i&&(this.draws.isReadonly()||this.draws.isDisabled()))return;const s=this.ranges.getSelectionElementList(),l=this.position.getCursorPosition(),a=ce(new Date).format("YYYY-MM-DD HH:mm:ss");if(s?.length){if(!this.element.strikeout){const c=s.findIndex(d=>!d.strikeout);s.forEach(d=>{d.deletePerson="SWJ",d.deleteTime=a,d.strikeout=!!~c}),this.draws.render({isSetCursor:!0,isCompute:!1,isDel:!0,isSubmitHistory:!1}),setTimeout(()=>{this.strikeoute()},100)}}else{const c=this.control.getElementList()[l.index];if(!this.control.getElementList()[l.index].strikeout&&c?.metrics.width>0){this.control.getElementList()[l.index].strikeout=!0,this.control.getElementList()[l.index].deletePerson="SWJ",this.control.getElementList()[l.index].deleteTime=a;const d=--l.index;setTimeout(()=>{this.strikeoute()},100),setTimeout(()=>{const h=d;this.draws.render({curIndex:h,isSetCursor:!0}),l.index=d,this.position.setCursorPosition(l),this.ranges.setRange(d,d)},100)}else{const{elementList:d,range:u}=this.control.mergeControl(n),h=u.startIndex;if(h>=0&&h<d.length&&d[h]?.metrics?.width!==void 0&&d[h].metrics.width<=0&&!d[h]?.strikeout){this.draws.spliceElementList(d,u.startIndex,1,[],{isIgnoreDeletedRule:t.isIgnoreDeletedRule});const R=!0,g=u.startIndex-1;this.draws.render({curIndex:g,isSetCursor:R}),l.index=g,delete l.value,this.position.setCursorPosition(l),this.ranges.setRange(g,g)}}}}strikeoute(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draws.isReadonly()||this.draws.isDisabled()))return;if(!this.ranges.getSelectionElementList()?.length){const{endIndex:r}=this.ranges.getRange(),l=this.draws.getElementList()[r];this.ranges.setDefaultStyle({strikeout:l.strikeout?!1:!this.ranges.getDefaultStyle()?.strikeout})}}}const wp={indent:"        ",divider:"────────────────"};class Jr{draw;element;control;options;isPopup;inputModal=null;constructor(e,t){const n=t.getDraw();this.draw=n,this.options=n.getOptions(),this.element=e,this.control=t,this.isPopup=!1}setElement(e){this.element=e}getElement(){return this.element}getIsPopup(){return this.isPopup}getValue(e={}){const t=e.elementList||this.control.getElementList(),n=this.control.getValueRange(e);if(!n)return[];const i=[],{startIndex:r,endIndex:s}=n;for(let l=r;l<=s;l++){const a=t[l];a.controlComponent===p.VALUE&&i.push(a)}return i}setValue(e,t={},n={}){if(!n.isIgnoreDisabledRule&&this.control.getIsDisabledControl(t))return-1;const{elementList:i,range:r}=this.control.mergeControl(t),s=this.control.getDraw(),{startIndex:l}=r,c=i[l].controlId;let d=l;for(let T=l;T>=0;T--){const I=i[T];if(I.controlId!==c)break;if(I.controlComponent===p.PREFIX){d=T;break}}let u=l;for(let T=l;T<i.length;T++){const I=i[T];if(I.controlId!==c){u=T;break}if(I.controlComponent===p.POSTFIX){u=T;break}}const h=d+1,R=u-1;R>=h&&s.spliceElementList(i,h,R-h+1);const g=i[d],m=at(g,["control","controlId",...Ft]),f=d+1;for(let T=0;T<e.length;T++){const I={...m,...e[T],value:e[T].value===`
104
+ `?ee:e[T].value,controlComponent:p.VALUE};(I.color===this.options.control.bracketColor||I.color===this.options.control.placeholderColor)&&(I.color=this.options.defaultColor),ze(i,[I],d,{editorOptions:this.options}),s.spliceElementList(i,f+T,0,[I])}return f+e.length-1}keydown(e){if(this.control.getIsDisabledControl()||this.options.mode===B.FORM)return null;const t=this.control.getElementList(),n=this.control.getRange();this.control.shrinkBoundary();const{startIndex:i}=n,r=t[i];if(e.key===Te.Backspace||e.key===Te.Delete){const s=r.controlId;let l=i,a=i;for(;l>0&&t[l-1].controlId===s;)l--;for(;a<t.length-1&&t[a+1].controlId===s;)a++;return this.draw.spliceElementList(t,l,a-l+1),l>0?l-1:0}return null}cut(){if(this.control.getIsDisabledControl())return-1;this.control.shrinkBoundary();const{startIndex:e,endIndex:t}=this.control.getRange();if(e===t)return e;const n=this.control.getDraw(),i=this.control.getElementList();return n.spliceElementList(i,e+1,t-e),this.getValue().length||this.control.addPlaceholder(e),e}awake(){if(this.options.mode===B.PRINT||this.isPopup||this.control.getIsDisabledControl())return;let e=!1;const t=this.control.getElementList(),n=this.element.controlId;for(let i=0;i<t.length;i++){const r=t[i];r.controlId===n&&r.control&&r.control._justCreated&&(e=!0,delete r.control._justCreated)}e||this.showMenstrualHistoryDialog()}generateDisplayText(e){const{indent:t,divider:n}=wp,{isMenopause:i,periodMin:r,periodMax:s,menarcheAge:l,cycleMin:a,cycleMax:c}=e,d=`${t}月经持续${r}~${s}天`,u=`${t}生理周期持续${a}~${c}天${ee}`;let h;return i?h=`初潮年龄${l}岁${n}闭经年龄${e.menopauseAge||"_"}岁`:h=`初潮年龄${l}岁${n}末次日期${e.lastPeriod||"____-__-__"}`,`${ee} ${d}
105
+ ${h}
106
+ ${u} `}textToElements(e){const t=[],n=e.split(`
107
+ `);return n.forEach((i,r)=>{for(let s=0;s<i.length;s++)t.push({value:i[s],controlComponent:p.VALUE});r<n.length-1&&t.push({value:ee,controlComponent:p.VALUE})}),t}showMenstrualHistoryDialog(){this.inputModal&&this.closeModal(),this.isPopup=!0;const e=this.element.control?.menstrualData;this.inputModal=document.createElement("div"),this.inputModal.className="menstrual-history-edit-modal",this.inputModal.setAttribute("editor-component","menstrual-history-edit-modal"),this.inputModal.innerHTML=`
108
+ <div class="menstrual-history-modal__mask"></div>
109
+ <div class="menstrual-history-modal__container">
110
+ <div class="menstrual-history-modal__header">
111
+ <span>${e?"编辑月经史":"添加月经史"}</span>
112
+ <div class="menstrual-history-modal__close">×</div>
113
+ </div>
114
+ <div class="menstrual-history-modal__content">
115
+ <div class="menopause-options">
116
+ <span class="menopause-label">是否闭经:</span>
117
+ <label class="menopause-radio">
118
+ <input type="radio" name="mh-edit-isMenopause" value="false" ${e?.isMenopause?"":"checked"}>
119
+ <span>未闭经</span>
120
+ </label>
121
+ <label class="menopause-radio">
122
+ <input type="radio" name="mh-edit-isMenopause" value="true" ${e?.isMenopause?"checked":""}>
123
+ <span>已闭经</span>
124
+ </label>
125
+ </div>
126
+
127
+ <div class="menstrual-form" id="mh-edit-notMenopause" style="${e?.isMenopause?"display: none;":""}">
128
+ <div class="form-line">
129
+ <span class="text">月经持续</span>
130
+ <input type="number" id="mh-edit-periodMin" min="1" max="14" value="${e?.periodMin||""}">
131
+ <span class="text">~</span>
132
+ <input type="number" id="mh-edit-periodMax" min="1" max="14" value="${e?.periodMax||""}">
133
+ <span class="text">天</span>
134
+ </div>
135
+ <div class="form-line center-line">
136
+ <span class="label">初潮年龄</span>
137
+ <input type="number" id="mh-edit-menarcheAge1" min="8" max="20" value="${e?.menarcheAge||""}">
138
+ <span class="text">岁</span>
139
+ <span class="divider-long"></span>
140
+ <span class="label">末次日期</span>
141
+ <input type="date" id="mh-edit-lastPeriod" value="${e?.lastPeriod||""}">
142
+ </div>
143
+ <div class="form-line">
144
+ <span class="text">生理周期持续</span>
145
+ <input type="number" id="mh-edit-cycleMin" min="21" max="45" value="${e?.cycleMin||""}">
146
+ <span class="text">~</span>
147
+ <input type="number" id="mh-edit-cycleMax" min="21" max="45" value="${e?.cycleMax||""}">
148
+ <span class="text">天</span>
149
+ </div>
150
+ </div>
151
+
152
+ <div class="menstrual-form" id="mh-edit-isMenopauseForm" style="${e?.isMenopause?"":"display: none;"}">
153
+ <div class="form-line">
154
+ <span class="text">月经持续</span>
155
+ <input type="number" id="mh-edit-periodMin2" min="1" max="14" value="${e?.periodMin||""}">
156
+ <span class="text">~</span>
157
+ <input type="number" id="mh-edit-periodMax2" min="1" max="14" value="${e?.periodMax||""}">
158
+ <span class="text">天</span>
159
+ </div>
160
+ <div class="form-line center-line">
161
+ <span class="label">初潮年龄</span>
162
+ <input type="number" id="mh-edit-menarcheAge2" min="8" max="20" value="${e?.menarcheAge||""}">
163
+ <span class="text">岁</span>
164
+ <span class="divider-long"></span>
165
+ <span class="label">闭经年龄</span>
166
+ <input type="number" id="mh-edit-menopauseAge" min="40" max="60" value="${e?.menopauseAge||""}">
167
+ <span class="text">岁</span>
168
+ </div>
169
+ <div class="form-line">
170
+ <span class="text">生理周期持续</span>
171
+ <input type="number" id="mh-edit-cycleMin2" min="21" max="45" value="${e?.cycleMin||""}">
172
+ <span class="text">~</span>
173
+ <input type="number" id="mh-edit-cycleMax2" min="21" max="45" value="${e?.cycleMax||""}">
174
+ <span class="text">天</span>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ <div class="menstrual-history-modal__footer">
179
+ <button class="btn-cancel">取消</button>
180
+ <button class="btn-confirm">确认</button>
181
+ </div>
182
+ </div>
183
+ `,document.body.appendChild(this.inputModal);const t=this.inputModal.querySelector(".menstrual-history-modal__mask"),n=this.inputModal.querySelector(".menstrual-history-modal__container"),i=this.inputModal.querySelector(".menstrual-history-modal__close"),r=this.inputModal.querySelector(".btn-cancel"),s=this.inputModal.querySelector(".btn-confirm"),l=this.inputModal.querySelector("#mh-edit-notMenopause"),a=this.inputModal.querySelector("#mh-edit-isMenopauseForm"),c=this.inputModal.querySelectorAll('input[name="mh-edit-isMenopause"]'),d=()=>{this.closeModal()};n.addEventListener("click",u=>{u.stopPropagation()}),t.addEventListener("click",d),i.addEventListener("click",d),r.addEventListener("click",d),c.forEach(u=>{u.addEventListener("change",()=>{const h=u.value==="true";l.style.display=h?"none":"block",a.style.display=h?"block":"none"})}),s.addEventListener("click",u=>{u.preventDefault(),u.stopPropagation();const h=this.inputModal;if(!h)return;const R=h.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let g;R?g={isMenopause:!0,periodMin:h.querySelector("#mh-edit-periodMin2")?.value||"_",periodMax:h.querySelector("#mh-edit-periodMax2")?.value||"_",menarcheAge:h.querySelector("#mh-edit-menarcheAge2")?.value||"_",menopauseAge:h.querySelector("#mh-edit-menopauseAge")?.value||"_",cycleMin:h.querySelector("#mh-edit-cycleMin2")?.value||"_",cycleMax:h.querySelector("#mh-edit-cycleMax2")?.value||"_"}:g={isMenopause:!1,periodMin:h.querySelector("#mh-edit-periodMin")?.value||"_",periodMax:h.querySelector("#mh-edit-periodMax")?.value||"_",menarcheAge:h.querySelector("#mh-edit-menarcheAge1")?.value||"_",lastPeriod:h.querySelector("#mh-edit-lastPeriod")?.value||"____-__-__",cycleMin:h.querySelector("#mh-edit-cycleMin")?.value||"_",cycleMax:h.querySelector("#mh-edit-cycleMax")?.value||"_"};const m=this.control.getElementList(),f=this.element.controlId;for(let S=0;S<m.length;S++){const M=m[S];M.controlId===f&&M.control&&(M.control.menstrualData=g)}const T=this.generateDisplayText(g),I=this.textToElements(T);this.closeModal();const L=this.setValue(I);L!==-1&&(this.control.repaintControl({curIndex:L}),this.control.emitControlContentChange({}))})}closeModal(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}destroy(){this.closeModal()}}class Up{controlBorder;textFieldUnderline;draw;range;listener;eventBus;controlSearch;options;controlOptions;activeControl;activeControlValue;preElement;constructor(e){this.controlBorder=new Vu(e),this.textFieldUnderline=new Zp(e),this.draw=e,this.range=e.getRange(),this.listener=e.getListener(),this.eventBus=e.getEventBus(),this.controlSearch=new Du(this),this.options=e.getOptions(),this.controlOptions=this.options.control,this.activeControl=null,this.activeControlValue=[],this.preElement=null}setHighlightList(e){this.controlSearch.setHighlightList(e)}computeHighlightList(){this.controlSearch.getHighlightList().length&&this.controlSearch.computeHighlightList()}renderHighlightList(e,t){this.controlSearch.getHighlightMatchResult().length&&this.controlSearch.renderHighlightList(e,t)}getDraw(){return this.draw}filterAssistElement(e){return e.filter((t,n)=>{if(t.type===O.TABLE){const i=t.trList;for(let r=0;r<i.length;r++){const s=i[r];for(let l=0;l<s.tdList.length;l++){const a=s.tdList[l];a.value=this.filterAssistElement(a.value)}}}if(!t.controlId)return!0;if(t.control?.type===Y.MENSTRUAL_HISTORY&&this.options.mode===B.PRINT&&(t.controlComponent===p.PREFIX||t.controlComponent===p.POSTFIX)||t.control?.type===Y.SELECT&&this.options.mode===B.PRINT&&(t.controlComponent===p.PREFIX||t.controlComponent===p.POSTFIX)||t.control?.type===Y.NUMBER&&this.options.mode===B.PRINT&&(t.controlComponent===p.PREFIX||t.controlComponent===p.POSTFIX)||t.control?.type===Y.TEXT&&this.options.mode===B.PRINT&&t.strikeout&&t.deletePerson)return!1;if(t.control?.minWidth){if(t.controlComponent===p.PREFIX||t.controlComponent===p.POSTFIX)return t.value="",!0}else{const i=this.options.mode===B.FORM;if(t.control?.preText&&t.controlComponent===p.PRE_TEXT){if(i)return!0;let r=!1,s=n+1;for(;s<e.length;){const l=e[s];if(t.controlId!==l.controlId)break;if(l.controlComponent===p.VALUE){r=!0;break}s++}return r}if(t.control?.postText&&t.controlComponent===p.POST_TEXT){if(i)return!0;let r=!1,s=n-1;for(;s<e.length;){const l=e[s];if(t.controlId!==l.controlId)break;if(l.controlComponent===p.VALUE){r=!0;break}s--}return r}}if(t.control?.preTextFix&&t.controlComponent===p.POSTTEXTFIX_TEXT){let i=!1,r=n+1;for(;r<e.length;){const s=e[r];if(t.controlId!==s.controlId)break;if(s.controlComponent===p.VALUE){i=!0;break}r++}return i}if(t.control?.postTextFix&&t.controlComponent===p.POSTTEXTFIX_TEXT){let i=!1,r=n-1;for(;r<e.length;){const s=e[r];if(t.controlId!==s.controlId)break;if(s.controlComponent===p.VALUE){i=!0;break}r--}return i}return t.controlComponent!==p.PREFIX&&t.controlComponent!==p.POSTFIX&&t.controlComponent!==p.PLACEHOLDER&&t.controlComponent!==p.PRETEXTFIX&&t.controlComponent!==p.POSTTEXTFIX&&t.controlComponent!==p.TEXTFIXLABEL})}getIsRangeCanCaptureEvent(){if(!this.activeControl)return!1;const{startIndex:e,endIndex:t}=this.getRange();if(!~e&&!~t)return!1;const n=this.getElementList(),i=n[e];if(i.controlComponent===p.PLACEHOLDER)return!1;if(e===t&&e>0){const s=n[e-1],l=s?.controlComponent===p.POSTFIX||s?.controlComponent===p.POSTTEXTFIX,a=s?.controlComponent===p.PLACEHOLDER,c=!!s?.controlId,d=!!s?.originControlId;let u=!1;if(d){const T=s.originControlId;for(let I=e;I<n.length;I++){const L=n[I];if(L.controlId===T&&!L.originControlId){u=!0;break}if(L.controlId&&L.controlId!==T&&L.originControlId!==T)break}}const R=this.draw.getPosition().getPositionList(),g=R[e],m=R[e-1],f=g&&m&&g.rowIndex===m.rowIndex;if((l||a)&&c&&f&&!u)return!1}if(e===t&&(i.controlComponent===p.POSTFIX||i.controlComponent===p.POSTTEXTFIX))return!0;const r=n[t];return!!(i.controlId&&i.controlId===r.controlId&&r.controlComponent!==p.POSTFIX&&r.controlComponent!==p.POSTTEXTFIX)}getIsRangeInPostfix(){if(!this.activeControl)return!1;const{startIndex:e,endIndex:t}=this.getRange();if(e!==t)return!1;const i=this.getElementList()[e];return i.controlComponent===p.POSTFIX||i.controlComponent===p.POSTTEXTFIX}getIsRangeWithinControl(){const{range:{startIndex:e,endIndex:t},elementList:n}=this.range.getRangeElement();if(!~e&&!~t)return!1;const i=n[e],r=n[t];if(i?.controlId&&i.controlId===r.controlId&&r.controlComponent!==p.POSTFIX&&r.controlComponent!==p.POSTTEXTFIX&&r.controlComponent!==p.POSTTEXTFIX_TEXT&&r.controlComponent!==p.POST_TEXT)return!0;if(r?.originControlId&&(r.controlComponent===p.POSTFIX||r.controlComponent===p.POSTTEXTFIX)){const s=r.originControlId;for(let l=t+1;l<n.length;l++){const a=n[l];if(a.controlId===s)return!0;if(a.controlId&&a.controlId!==s&&a.originControlId!==s)break}}if(!r?.originControlId&&r?.controlId&&(r.controlComponent===p.POSTFIX||r.controlComponent===p.POSTTEXTFIX)){const s=n[t+1];if(s?.controlId&&s.controlId!==r.controlId&&(s.controlComponent===p.PREFIX||s.controlComponent===p.PRETEXTFIX))return!0;if(s?.controlId&&s.controlId!==r.controlId&&(s.controlComponent===p.POSTFIX||s.controlComponent===p.POSTTEXTFIX))return s.originControlId,!0;for(let l=t;l>=0;l--){const a=n[l];if(a.controlId===r.controlId&&(a.controlComponent===p.PREFIX||a.controlComponent===p.PRETEXTFIX)){for(let c=l-1;c>=0;c--){const d=n[c];if(d.controlId&&d.controlId!==r.controlId&&(d.controlComponent===p.PRETEXTFIX||d.controlComponent===p.PRETEXTFIX_TEXT||d.controlComponent===p.PREFIX||d.controlComponent===p.PRE_TEXT))return!0;if(d.controlId&&d.controlId!==r.controlId&&(d.controlComponent===p.POSTFIX||d.controlComponent===p.POSTTEXTFIX))break}break}}}if(r?.originControlId){const s=r.originControlId;for(let l=t+1;l<n.length;l++){const a=n[l];if(a.controlId===s)return!0;if(a.controlId&&a.controlId!==s&&a.originControlId!==s)break}}if(!i?.controlId&&this.activeControl){const l=this.activeControl.getElement()?.controlId;if(l)for(let a=e;a>=0;a--){const c=n[a];if(c.controlId===l&&!c.originControlId){if(c.controlComponent===p.PRETEXTFIX||c.controlComponent===p.PRETEXTFIX_TEXT||c.controlComponent===p.PREFIX||c.controlComponent===p.PRE_TEXT)for(let d=t;d<n.length;d++){const u=n[d];if(u.controlId===l&&!u.originControlId){if(u.controlComponent===p.POSTTEXTFIX||u.controlComponent===p.POSTTEXTFIX_TEXT||u.controlComponent===p.POSTFIX||u.controlComponent===p.POST_TEXT)return!0;break}}break}}}return!1}getIsElementListContainFullControl(e){if(!e.some(i=>i.controlId))return!1;let t=0,n=0;for(let i=0;i<e.length;i++){const r=e[i];r.controlComponent===p.PREFIX||r.controlComponent===p.PRETEXTFIX?t++:(r.controlComponent===p.POSTFIX||r.controlComponent===p.POSTTEXTFIX)&&n++}return!t||!n?!1:t===n}getIsDisabledControl(e={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:t,endIndex:n}=e.range||this.range.getRange();if(t===n&&~t&&~n){const r=(e.elementList||this.getElementList())[t];if(r.controlComponent===p.POSTFIX||r.controlComponent===p.POSTTEXTFIX)return!1}return!!this.activeControl.getElement()?.control?.disabled}getIsDisabledPasteControl(e={}){if(this.draw.isDesignMode()||!this.activeControl)return!1;const{startIndex:t,endIndex:n}=e.range||this.range.getRange();return t===n&&~t&&~n&&(e.elementList||this.getElementList())[t].controlComponent===p.POSTFIX?!1:!!this.activeControl.getElement()?.control?.pasteDisabled}getIsExistValueByElementListIndex(e,t){const n=e[t];if(!n.controlId)return!1;if(n.control?.type===Y.CHECKBOX||n.control?.type===Y.RADIO)return!!n.control?.code;if(n.controlComponent===p.VALUE)return!0;if(n.controlComponent===p.PLACEHOLDER)return!1;if(n.controlComponent===p.PREFIX||n.controlComponent===p.PRE_TEXT){let i=t+1;for(;i<e.length;){const r=e[i];if(r.controlId!==n.controlId)return!1;if(r.controlComponent===p.VALUE)return!0;if(r.controlComponent===p.PLACEHOLDER)return!1;i++}}if(n.controlComponent===p.PRETEXTFIX||n.controlComponent===p.PRETEXTFIX_TEXT){let i=t+1;for(;i<e.length;){const r=e[i];if(r.controlId!==n.controlId)return!1;if(r.controlComponent===p.VALUE)return!0;if(r.controlComponent===p.PLACEHOLDER||r.controlComponent===p.TEXTFIXLABEL)return!1;i++}}if(n.controlComponent===p.POSTFIX||n.controlComponent===p.POSTTEXTFIX){let i=t-1;for(;i>=0;){const r=e[i];if(r.controlId!==n.controlId)return!1;if(r.controlComponent===p.VALUE)return!0;if(r.controlComponent===p.PLACEHOLDER)return!1;i--}}return!1}getControlHighlight(e,t){return this.controlSearch.getControlHighlight(e,t)}getContainer(){return this.draw.getContainer()}getElementList(){return this.draw.getElementList()}getPosition(){const e=this.draw.getPosition().getPositionList(),{endIndex:t}=this.range.getRange();return e[t]||null}getPreY(){const e=this.draw.getHeight(),t=this.draw.getPageGap();return(this.getPosition()?.pageNo??this.draw.getPageNo())*(e+t)}getRange(){return this.range.getRange()}getValueRange(e={}){const t=e.elementList||this.getElementList(),{startIndex:n}=e.range||this.getRange(),i=t[n];let r=n;for(;r>0;){const l=t[r];if(l.controlId!==i.controlId||l.controlComponent===p.PREFIX||l.controlComponent===p.PRE_TEXT||l.controlComponent===p.PRETEXTFIX||l.controlComponent===p.PRETEXTFIX_TEXT)break;r--}let s=n+1;for(;s<t.length;){const l=t[s];if(l.controlId!==i.controlId||l.controlComponent===p.POSTFIX||l.controlComponent===p.POST_TEXT||l.controlComponent===p.POSTTEXTFIX||l.controlComponent===p.POSTTEXTFIX_TEXT)break;s++}return r===s?null:{startIndex:r,endIndex:s-1}}shrinkBoundary(e={}){this.range.shrinkBoundary(e)}getActiveControl(){return this.activeControl}getActiveTextControlLimit(){if(!this.activeControl)return null;const e=this.activeControl.getElement(),t=e?.controlId,n=e?.originControlId||null;if(!t||e.control?.type!==Y.TEXT)return null;const i=this.getElementList(),r=n||null;let s=-1,l=-1,a=-1,c=-1;for(let h=0;h<i.length;h++){const R=i[h];R.controlId!==t||(n?R.originControlId!==n:R.originControlId)||(s===-1&&(s=h),l=h,(R.controlComponent===p.PREFIX||R.controlComponent===p.PRE_TEXT||R.controlComponent===p.PRETEXTFIX||R.controlComponent===p.PRETEXTFIX_TEXT)&&(a=h),c===-1&&(R.controlComponent===p.POSTFIX||R.controlComponent===p.POST_TEXT||R.controlComponent===p.POSTTEXTFIX||R.controlComponent===p.POSTTEXTFIX_TEXT)&&(c=h))}if(s===-1)return null;const d=a!==-1?a:s,u=c!==-1?c-1:l;return{controlId:t,originControlId:n,parentControlId:r,startIndex:d,endIndex:u<d?d:u}}getActiveNestedTextLimit(){const e=this.getActiveTextControlLimit();return!e?.parentControlId||!this.getElementList().some(n=>n.controlId===e.parentControlId&&!n.originControlId&&n.control?.type===Y.TEXTFIELD)?null:{controlId:e.controlId,parentControlId:e.parentControlId,startIndex:e.startIndex,endIndex:e.endIndex}}getControlElementList(e={}){const t=e.elementList||this.getElementList(),{startIndex:n}=e.range||this.getRange(),i=t[n];if(!i?.controlId)return[];const r=[];let s=n;for(;s>0;){const a=t[s];if(a.controlId!==i.controlId)break;r.unshift(a),s--}let l=n+1;for(;l<t.length;){const a=t[l];if(a.controlId!==i.controlId)break;r.push(a),l++}return r}updateActiveControlValue(){this.activeControl&&(this.activeControlValue=this.getControlElementList())}emitControlChange(e){if(!this.activeControl)return;const t=this.eventBus.isSubscribe("controlChange");if(!this.listener.controlChange&&!t)return;let n;const i=this.activeControlValue,r=this.activeControl.getElement();i?.length?n=i[0].control:(n=Sn(xe(r)).control,n.value=[]);const s={state:e,control:n,controlId:r.controlId};this.listener.controlChange?.(s),t&&this.eventBus.emit("controlChange",s)}initControl(){const e=this.getElementList(),t=this.getRange(),n=e[t.startIndex];if(this.activeControl){if(this.activeControl instanceof mo||this.activeControl instanceof Io||this.activeControl instanceof Po||this.activeControl instanceof Qn){const R=this.activeControl.getElement();n?.controlId!==R?.controlId?this.destroyControl():n.controlComponent===p.POSTFIX?this.activeControl.destroy():this.activeControl.awake()}const d=this.activeControl.getElement(),u=n.controlId,h=d.controlId;if(u&&u===h){this.updateActiveControlValue(),this.preElement=n;return}if(n.originControlId&&n.originControlId===h&&!(this.activeControl.getElement()?.control?.type===Y.TEXTFIELD&&n.controlId!==h)){this.updateActiveControlValue(),this.preElement=n;return}if(n.originControlId&&n.controlId&&n.controlId,!n.originControlId&&n.controlId&&n.controlId!==h&&(this.activeControl.getElement()?.originControlId,n.controlId),n.controlId&&n.controlId===h&&n.originControlId){this.updateActiveControlValue(),this.preElement=n;return}if(!u){const R=this.getElementList(),g=this.getRange(),{startIndex:m}=g;let f=null;for(let T=m;T>=0;T--){const I=R[T];if(I.controlComponent===p.PRETEXTFIX||I.controlComponent===p.PRETEXTFIX_TEXT||I.controlComponent===p.PREFIX||I.controlComponent===p.PRE_TEXT){f=I.controlId||null;break}if(I.controlId&&I.controlId!==h||I.controlComponent===p.POSTTEXTFIX||I.controlComponent===p.POSTTEXTFIX_TEXT||I.controlComponent===p.POSTFIX||I.controlComponent===p.POST_TEXT)break}if(f===h){this.updateActiveControlValue(),this.preElement=n;return}}}if(this.destroyControl(),this.draw.isReadonly())return;let r=n.control,s=n;if(n.originControlId&&!r){const d=n.originControlId;for(let u=this.range.getRange().startIndex;u>=0;u--){const h=e[u];if(h.controlId===d&&!h.originControlId&&h.control){r=h.control,s=h;break}if(h.controlId===d&&!h.originControlId&&(h.controlComponent===p.PRETEXTFIX||h.controlComponent===p.PRETEXTFIX_TEXT||h.controlComponent===p.PREFIX||h.controlComponent===p.PRE_TEXT)){h.control&&(r=h.control,s=h);break}}}else if(!r&&n.controlId){const d=this.getElementList();for(let u=this.range.getRange().startIndex;u>=0;u--){const h=d[u];if(h.controlId!==n.controlId)break;if(h.control){r=h.control,s=h;break}if(h.controlComponent===p.PRETEXTFIX||h.controlComponent===p.PRETEXTFIX_TEXT||h.controlComponent===p.PREFIX||h.controlComponent===p.PRE_TEXT)break}}if(!r)return;if(r?.type===Y.TEXTFIELD&&this.draw.getMode()!==B.EDIT)if(n.originControlId){const d=n.controlId;for(let u=this.range.getRange().startIndex;u>=0;u--){const h=e[u];if(h.controlId===d&&h.originControlId===n.originControlId&&h.control&&h.control.type!==Y.TEXTFIELD){r=h.control,s=h;break}if(h.controlComponent===p.PREFIX||h.controlComponent===p.PRETEXTFIX)break}if(r?.type===Y.TEXTFIELD)return}else return;const l=this.draw.getPosition().getPositionContext(),a=this.range.getRange().startIndex,c=!!(l.isDirectHit&&l.index===a&&e[l.index]?.controlId===s.controlId);if(r?.type===Y.TEXTFIELD)this.activeControl=new Gr(s,this);else if(r.type===Y.TEXT)this.activeControl=new Ps(s,this);else if(r.type===Y.SELECT){const d=new mo(s,this);this.activeControl=d,(c||this.draw.getMode()===B.FORM)&&d.awake()}else if(r.type===Y.CHECKBOX)this.activeControl=new di(s,this);else if(r.type===Y.RADIO)this.activeControl=new hs(s,this);else if(r.type===Y.DATE){const d=new Io(s,this);this.activeControl=d,d.awake()}else if(r.type===Y.NUMBER){const d=new Po(s,this);this.activeControl=d,c&&d.awake()}else if(r.type===Y.BUTTON){const d=new Qn(s,this);if(this.activeControl=d,c){d.awake();return}}else if(r.type===Y.MENSTRUAL_HISTORY){const d=new Jr(s,this);this.activeControl=d,d.awake()}this.updateActiveControlValue(),this.preElement=s,s.controlComponent!==p.POSTFIX&&s.controlComponent!==p.POSTTEXTFIX&&this.emitControlChange(ai.ACTIVE)}destroyControl(e={}){if(!this.activeControl)return;const{isEmitEvent:t=!0}=e;(this.activeControl instanceof mo||this.activeControl instanceof Io||this.activeControl instanceof Po||this.activeControl instanceof Jr)&&this.activeControl.destroy(),t&&this.preElement?.controlComponent!==p.POSTFIX&&this.preElement?.controlComponent!==p.POSTTEXTFIX&&this.emitControlChange(ai.INACTIVE),this.preElement=null,this.activeControl=null,this.activeControlValue=[]}repaintControl(e={}){const{curIndex:t,isCompute:n=!0,isSubmitHistory:i=!0,isSetCursor:r=!0}=e;t===void 0?(this.range.clearRange(),this.draw.render({isCompute:n,isSubmitHistory:i,isSetCursor:!1})):(this.range.setRange(t,t),this.draw.render({curIndex:t,isCompute:n,isSetCursor:r,isSubmitHistory:i}))}emitControlContentChange(e){const t=this.eventBus.isSubscribe("controlContentChange");if(!t&&!this.listener.controlContentChange)return;const n=e?.controlElement||this.activeControl?.getElement();if(!n)return;const i=e?.context?.elementList||this.getElementList(),{startIndex:r}=e?.context?.range||this.getRange();if(!i[r]?.controlId)return;const s=e?.controlValue||this.getControlElementList(e?.context);let l;if(s?.length?l=Ge(s)[0].control:(l=n.control,l.value=[]),!l)return;const a={control:l,controlId:n.controlId};this.listener.controlContentChange?.(a),t&&this.eventBus.emit("controlContentChange",a)}reAwakeControl(){if(!this.activeControl)return;const e=this.getElementList(),t=this.getRange(),n=e[t.startIndex];this.activeControl.setElement(n),(this.activeControl instanceof Io||this.activeControl instanceof mo)&&this.activeControl.getIsPopup()&&(this.activeControl.destroy(),this.activeControl.awake())}selectValue(){const e=this.getElementList(),{startIndex:t}=this.getRange(),n=e[t];if(!n?.controlId||n.controlComponent!==p.VALUE&&e[t+1]?.controlComponent===p.VALUE)return!1;let i=t;for(;i>0&&e[i].controlComponent===p.VALUE;)i--;let r=t+1;for(;r<e.length;){if(e[r].controlComponent!==p.VALUE){r--;break}r++}if(i!==r){const s=this.range.getRange();return this.range.replaceRange({...s,startIndex:i,endIndex:r}),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),!0}return!1}moveCursor(e){const{index:t,trIndex:n,tdIndex:i,tdValueIndex:r}=e;let s=this.draw.getOriginalElementList(),l;const a=e.isTable?r:t;if(e.isTable?(s=s[t].trList[n].tdList[i].value,l=s[r]):l=s[t],l.control?.hide||l.area?.hide){const c=bo(s,a);return{newIndex:c,newElement:s[c]}}if(l.controlComponent===p.VALUE)return{newIndex:a,newElement:l};if(l.controlComponent===p.POSTFIX){let c=a+1;for(;c<s.length;){if(s[c].controlId!==l.controlId)return{newIndex:c-1,newElement:s[c-1]};if(c===s.length-1)return{newIndex:c,newElement:s[c]};c++}}else if(l.controlComponent===p.PREFIX||l.controlComponent===p.PRE_TEXT){let c=a+1;for(;c<s.length;){const d=s[c];if(d.controlId!==l.controlId||d.controlComponent!==p.PREFIX&&d.controlComponent!==p.PRE_TEXT)return{newIndex:c-1,newElement:s[c-1]};c++}}else if(l.controlComponent===p.PLACEHOLDER){let c=a-1;for(;c>0;){const d=s[c];if(d.controlId!==l.controlId||d.controlComponent===p.VALUE||d.controlComponent===p.PREFIX||d.controlComponent===p.PRE_TEXT||d.controlComponent===p.PRETEXTFIX||d.controlComponent===p.PRETEXTFIX_TEXT)return{newIndex:c,newElement:s[c]};c--}}else if(l.controlComponent===p.POST_TEXT||l.controlComponent===p.TEXTFIXLABEL||l.controlComponent===p.POSTTEXTFIX_TEXT){let c=a-1;for(;c>0;){const d=s[c];if(d.controlId!==l.controlId||d.controlComponent===p.VALUE||d.controlComponent===p.PREFIX||d.controlComponent===p.PRE_TEXT||d.controlComponent===p.PRETEXTFIX||d.controlComponent===p.PRETEXTFIX_TEXT)return{newIndex:c,newElement:s[c]};c--}}else if(l.controlComponent===p.POSTTEXTFIX){let c=a+1;for(;c<s.length;){if(s[c].controlId!==l.controlId)return{newIndex:c-1,newElement:s[c-1]};if(c===s.length-1)return{newIndex:c,newElement:s[c]};c++}}else if(l.controlComponent===p.PRETEXTFIX||l.controlComponent===p.PRETEXTFIX_TEXT){let c=a+1;for(;c<s.length;){const d=s[c];if(d.controlId!==l.controlId||d.controlComponent!==p.PRETEXTFIX&&d.controlComponent!==p.PRETEXTFIX_TEXT)return{newIndex:c-1,newElement:s[c-1]};c++}}return{newIndex:a,newElement:l}}removeControl(e,t={}){const n=t.elementList||this.getElementList(),i=n[e];if(!this.draw.isDesignMode()&&!i?.control?.hide&&!i?.area?.hide){const{deletable:f=!0}=i.control;if(!f)return null;const T=this.draw.getMode();if(T===B.FORM&&this.options.modeRule[T].controlDeletableDisabled)return null}let r=-1,s=-1;const l=!!i.originControlId,a=i.controlId,c=i.originControlId;let d=e;for(;d>=0;){const f=n[d];let T=!1;if(l?T=f.controlId===a&&f.originControlId===c:T=f.controlId===a&&!f.originControlId,!T){r=d;break}d--}let u=e;for(;u<n.length;){const f=n[u];let T=!1;if(l?T=f.controlId===a&&f.originControlId===c:T=f.controlId===a&&!f.originControlId,!T){s=u-1;break}u++}if(u===n.length&&(s=u-1),!~r&&!~s)return e;r=~r?r:0;const h=n[r+1],R=h.control,g=R?.type&&[Y.TEXT,Y.TEXTFIELD,Y.DATE,Y.NUMBER,Y.SELECT,Y.BUTTON].includes(R.type);let m=n[0]?.type===O.SPLIT_TAG;if(!t.removeNext&&g&&!l&&h.controlComponent!==p.PREFIX&&h.type!==O.SPLIT_TAG)if(t.removePrev)t.removePrev();else{const f=this.draw.getTd();f&&this.createRemoveControlHandler(f,i.controlId,!0)}if(!t.removeNext&&g&&!l&&h.controlComponent!==p.PRETEXTFIX&&h.type!==O.SPLIT_TAG)if(t.removePrev)t.removePrev();else{const f=this.draw.getTd();f&&this.createRemoveControlHandler(f,i.controlId,!0)}if(!t.removePrev&&g&&!l&&n[s].controlComponent!==p.POSTFIX)if(t.removeNext)t.removeNext();else{const f=this.draw.getTd();m=!!f?.linkTdNextId,f&&this.createRemoveControlHandler(f,i.controlId,!1)}if(!t.removePrev&&g&&!l&&n[s].controlComponent!==p.POSTTEXTFIX)if(t.removeNext)t.removeNext();else{const f=this.draw.getTd();m=!!f?.linkTdNextId,f&&this.createRemoveControlHandler(f,i.controlId,!1)}return this.draw.spliceElementList(n,r+1,s-r),!t.elementList&&m&&r===0?this.draw.fixPosition(!0)??r:r}createRemoveControlHandler(e,t,n){if(n){const i=this.draw.getTdById(e.linkTdPrevId);i&&i.value.splice(-1)[0]?.controlId===t&&this.removeControl(i.value.length-1,{elementList:i.value,removePrev:()=>{this.createRemoveControlHandler(i,t,n)}})}else{const i=this.draw.getTdById(e.linkTdNextId);i&&i.value[1]?.controlId===t&&this.removeControl(1,{elementList:i.value,removeNext:()=>{this.createRemoveControlHandler(i,t,n)}})}}removePlaceholder(e,t={}){const n=t.elementList||this.getElementList(),i=n[e],r=n[e+1];if(i.controlComponent===p.PLACEHOLDER||i.controlComponent===p.TEXTFIXLABEL||r?.controlComponent===p.PLACEHOLDER||r?.controlComponent===p.TEXTFIXLABEL){let s=!1,l=e;for(;l<n.length;){const a=n[l];if(a.controlId!==i.controlId)break;a.controlComponent===p.PLACEHOLDER||a.controlComponent===p.TEXTFIXLABEL?(s||(s=!0,this.draw.getHistoryManager().popUndo(),this.draw.submitHistory(e)),n.splice(l,1)):l++}}}addPlaceholder(e,t={}){const n=t.elementList||this.getElementList(),i=n[e],r=i.control;if(!r.placeholder)return;let s=e;for(;s>=0;){const R=n[s];if(R.controlId!==i.controlId){s++;break}if(R.controlComponent===p.PREFIX||R.controlComponent===p.PRE_TEXT||R.controlComponent===p.PRETEXTFIX||R.controlComponent===p.PRETEXTFIX_TEXT)break;s--}s<0&&(s=0);const l=s+1;if(l<n.length){const R=n[l];if(R.controlId===i.controlId&&(R.controlComponent===p.PLACEHOLDER||R.controlComponent===p.VALUE))return}let a=!1,c=s+1;for(;c<n.length;){const R=n[c];if(R.controlId===i.controlId){if(R.controlComponent===p.POSTFIX||R.controlComponent===p.POST_TEXT||R.controlComponent===p.POSTTEXTFIX||R.controlComponent===p.POSTTEXTFIX_TEXT)break}else if(R.controlId!==i.controlId&&(R.controlComponent===p.VALUE||R.controlComponent===p.PREFIX||R.controlComponent===p.PRE_TEXT)){a=!0;break}c++}if(a)return;const d=be(r.placeholder),u=at(i,Ft),h=s+1;for(let R=0;R<d.length;R++){const g=d[R],m={...u,value:g===`
184
+ `?ee:g,controlId:i.controlId,type:O.CONTROL,control:i.control,controlComponent:p.PLACEHOLDER,color:this.controlOptions.placeholderColor};ze(n,[m],s,{editorOptions:this.options}),this.draw.spliceElementList(n,h+R,0,[m])}}setValue(e){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.setValue(e)}setControlProperties(e,t={}){const n=t.elementList||this.getElementList(),{startIndex:i}=t.range||this.getRange(),r=n[i];let s=i;for(;s>0;){const a=n[s];if(a.controlId!==r.controlId)break;a.control={...a.control,...e},s--}let l=i+1;for(;l<n.length;){const a=n[l];if(a.controlId!==r.controlId)break;a.control={...a.control,...e},l++}}keydown(e){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.keydown(e)}cut(){if(!this.activeControl)throw new Error("active control is null");return this.activeControl.cut()}getValueById(e){const{id:t,groupId:n,conceptId:i,areaId:r}=e,s=[];if(!t&&!i&&!n)return s;const l=new Set,a=(d,u)=>{let h=0;for(;h<d.length;){const R=d[h];if(h++,R.type===O.TABLE){const S=R.trList;for(let M=0;M<S.length;M++){const X=S[M];for(let x=0;x<X.tdList.length;x++){const F=X.tdList[x],D=F.originalId??F.id;l.has(D)||(l.add(D),F.linkTdNextId?a(this.draw.getSplitTdValues(D),u):a(F.value,u))}}}if(!R.control||n&&R.control.groupId!==n||t&&R.controlId!==t||i&&R.control.conceptId!==i||r&&R.areaId!==r)continue;const{type:g,code:m,valueSets:f}=R.control;let T=h,I="";const L=[];for(;T<d.length;){const S=d[T];if(S.controlId!==R.controlId)break;(g===Y.TEXT||g===Y.TEXTFIELD||g===Y.DATE||g===Y.NUMBER)&&S.controlComponent===p.VALUE&&(I+=S.value,L.push($t(S,os))),T++}if(g===Y.TEXT||g===Y.TEXTFIELD||g===Y.DATE||g===Y.NUMBER)s.push({...R.control,zone:u,value:I||null,innerText:I||null,elementList:Ge(L)});else if(g===Y.SELECT||g===Y.CHECKBOX||g===Y.RADIO){const S=m?.split(",").map(M=>f?.find(X=>X.code===M)?.value).filter(Boolean).join("");s.push({...R.control,zone:u,value:m||null,innerText:S||null})}h=T}},c=[{zone:De.HEADER,elementList:this.draw.getHeaderElementList()},{zone:De.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:De.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:d,elementList:u}of c)a(u,d);return s}setValueListById(e){if(!e.length)return;let t=!1,n=!1;const i=(s,l)=>{let a=0;for(;a<s.length;){const c=s[a];if(a++,c.type===O.TABLE){const L=c.trList;for(let S=0;S<L.length;S++){const M=L[S];for(let X=0;X<M.tdList.length;X++){const x=M.tdList[X];i(x.value,x.id)}}}if(!c.control||c.type===O.SPLIT_TAG)continue;const d=e.find(L=>(!L.groupId||L.groupId===c.control?.groupId)&&(L.id&&c.controlId===L.id||L.conceptId&&c.control.conceptId===L.conceptId||L.areaId&&c.areaId===L.areaId));if(!d)continue;const{value:u,isSubmitHistory:h=!0}=d;t=!0,h&&(n=!0);const{type:R}=c.control,{range:g,fullRange:m}=this.mergeControl({elementList:s,range:{startIndex:a,endIndex:a},tdId:l}),f={range:m??g,elementList:s,tdId:l},T={isIgnoreDisabledRule:!0,isIgnoreDeletedRule:!0};if(R===Y.TEXTFIELD){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&ct(L,{isHandleFirstElement:!1,editorOptions:this.options});const S=new Gr(c,this);this.activeControl=S,L.length?S.setValue(L,f,T):S.clearValue(f,T)}else if(R===Y.TEXT){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&ct(L,{isHandleFirstElement:!1,editorOptions:this.options});const S=new Ps(c,this);this.activeControl=S,L.length?S.setValue(L,f,T):S.clearValue(f,T)}else if(R===Y.SELECT){if(Array.isArray(u))continue;const L=new mo(c,this);this.activeControl=L,u?L.setSelect(u,f,T):L.clearSelect(f,T)}else if(R===Y.CHECKBOX){if(Array.isArray(u))continue;const L=new di(c,this);this.activeControl=L;const S=u?u.split(","):[];L.setSelect(S,f,T)}else if(R===Y.RADIO){if(Array.isArray(u))continue;const L=new hs(c,this);this.activeControl=L;const S=u?[u]:[];L.setSelect(S,f,T)}else if(R===Y.DATE){const L=new Io(c,this);this.activeControl=L,ts(u)?(u.length&&ct(u,{isHandleFirstElement:!1,editorOptions:this.options}),L.setValue(u,f,T)):gc(u)?L.setSelect(u,f,T):L.clearSelect(f,T)}else if(R===Y.NUMBER){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&ct(L,{isHandleFirstElement:!1,editorOptions:this.options});const S=new Po(c,this);this.activeControl=S,L.length?S.setValue(L,f,T):S.clearValue(f,T)}else if(R===Y.BUTTON){const L=Array.isArray(u)?u:u?[{value:u}]:[];L.length&&ct(L,{isHandleFirstElement:!1,editorOptions:this.options});const S=new Qn(c,this);this.activeControl=S,L.length?S.setValue(L,f,T):S.clearSelect(f,T)}this.emitControlContentChange({context:f}),this.activeControl=null;let I=a;for(;I<s.length&&s[I].controlId===c.controlId;)I++;a=I}};this.destroyControl({isEmitEvent:!1});const r=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const s of r)i(s);t&&(n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1}))}setExtensionListById(e){if(!e.length)return;const t=i=>{let r=0;for(;r<i.length;){const s=i[r];if(r++,s.type===O.TABLE){const d=s.trList;for(let u=0;u<d.length;u++){const h=d[u];for(let R=0;R<h.tdList.length;R++){const g=h.tdList[R];t(g.value)}}}if(!s.control)continue;const l=e.find(d=>d.id&&s.controlId===d.id||d.conceptId&&s.control.conceptId===d.conceptId||d.areaId&&s.areaId===d.areaId);if(!l)continue;const{extension:a}=l;this.setControlProperties({extension:a},{elementList:i,range:{startIndex:r,endIndex:r}});let c=r;for(;c<i.length&&i[c].controlId===s.controlId;)c++;r=c}},n=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const i of n)t(i)}setPropertiesListById(e){if(!e.length)return;let t=!1,n=!1;const i=s=>{let l=0;for(;l<s.length;){const a=s[l];if(l++,a.type===O.TABLE){const R=a.trList;for(let g=0;g<R.length;g++){const m=R[g];for(let f=0;f<m.tdList.length;f++){const T=m.tdList[f];i(T.value)}}}if(!a.control)continue;const c=e.find(R=>R.id&&a.controlId===R.id||R.conceptId&&a.control.conceptId===R.conceptId||R.areaId&&a.areaId===R.areaId);if(!c)continue;const{properties:d,isSubmitHistory:u=!0}=c;if(t=!0,u&&(n=!0),this.setControlProperties({...a.control,...d,value:a.control.value},{elementList:s,range:{startIndex:l,endIndex:l}}),Ft.forEach(R=>{const g=d[R];g&&Reflect.set(a,R,g)}),a.control?.type===Y.NUMBER&&d.numberExclusiveOptions){const R={...a.control.numberExclusiveOptions,...d.numberExclusiveOptions},g=R?.minValue,m=R?.maxValue,f=new Po(a,this),T=f.getValue({elementList:s,range:{startIndex:l,endIndex:l}});if(T.length>0){const I=T.map(S=>S.value).join(""),L=Number(I);!Number.isNaN(L)&&Number.isFinite(L)&&(g!=null&&L<g||m!=null&&L>m)&&f.clearValue({elementList:s,range:{startIndex:l,endIndex:l}},{isAddPlaceholder:!0})}}let h=l;for(;h<s.length&&s[h].controlId===a.controlId;)h++;l=h}},r={header:this.draw.getHeaderElementList(),main:this.draw.getOriginalMainElementList(),footer:this.draw.getFooterElementList()};for(const s in r){const l=r[s];i(l)}if(t){for(const s in r){const l=s,a=Ge(r[l],{isClassifyArea:!0,extraPickAttrs:["id","controlId"]});r[l]=a,ct(a,{editorOptions:this.options,isForceCompensation:!0})}this.draw.setEditorData(r),n||this.draw.getHistoryManager().recovery(),this.draw.render({isSubmitHistory:n,isSetCursor:!1})}}getList(){const e=[];function t(i){for(let r=0;r<i.length;r++){const s=i[r];if(s.type===O.TABLE){const l=s.trList;for(let a=0;a<l.length;a++){const c=l[a];for(let d=0;d<c.tdList.length;d++){const h=c.tdList[d].value;t(h)}}}if(s.controlId){const l=$t(s,[...Es,...Mo]);e.push(l)}}}const n=[this.draw.getHeader().getElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooter().getElementList()];for(const i of n)t(i);return Ge(e,{extraPickAttrs:["controlId"]})}recordBorderInfo(e,t,n,i){this.controlBorder.recordBorderInfo(e,t,n,i)}drawBorder(e){this.controlBorder.render(e)}startTextFieldUnderline(e,t,n){this.textFieldUnderline.startTextFieldValue(e,t,n)}recordTextFieldUnderlineWidth(e){this.textFieldUnderline.recordValueWidth(e)}drawTextFieldUnderline(e){this.textFieldUnderline.endTextFieldValue(e)}getPreControlContext(){if(!this.activeControl)return null;const t=this.draw.getPosition().getPositionContext();if(!t)return null;const n=this.activeControl.getElement();function i(a,c){for(let d=c;d>0;d--){const u=a[d];if(u.type===O.TABLE){const R=u.trList||[];for(let g=R.length-1;g>=0;g--){const m=R[g],f=m.tdList;for(let T=f.length-1;T>=0;T--){const I=f[T],L=i(I.value,I.value.length-1);if(L)return{positionContext:{isTable:!0,index:d,trIndex:g,tdIndex:T,tdId:I.id,trId:m.id,tableId:u.id},nextIndex:L.nextIndex}}}}if(!u.controlId||u.controlId===n.controlId)continue;let h=d;for(;h>0;){const R=a[h];if(R.controlComponent===p.VALUE||R.controlComponent===p.PREFIX||R.controlComponent===p.PRE_TEXT||R.controlComponent===p.PRETEXTFIX||R.controlComponent===p.PRETEXTFIX_TEXT)break;h--}return{positionContext:{isTable:!1},nextIndex:h}}return null}const{startIndex:r}=this.range.getRange(),s=this.getElementList(),l=i(s,r);if(l)return{positionContext:t.isTable?t:l.positionContext,nextIndex:l.nextIndex};if(n.tableId){const a=this.draw.getOriginalElementList(),{index:c,trIndex:d,tdIndex:u}=t,h=a[c].trList;for(let g=d;g>=0;g--){const m=h[g],f=m.tdList;for(let T=f.length-1;T>=0;T--){if(d===g&&T>=u)continue;const I=f[T],L=i(I.value,I.value.length-1);if(L)return{positionContext:{isTable:!0,index:t.index,trIndex:g,tdIndex:T,tdId:I.id,trId:m.id,tableId:n.tableId},nextIndex:L.nextIndex}}}const R=i(a,c-1);if(R)return{positionContext:{isTable:!1},nextIndex:R.nextIndex}}return null}getNextControlContext(){if(!this.activeControl)return null;const t=this.draw.getPosition().getPositionContext();if(!t)return null;const n=this.activeControl.getElement();function i(a,c){for(let d=c;d<a.length;d++){const u=a[d];if(u.type===O.TABLE){const h=u.trList||[];for(let R=0;R<h.length;R++){const g=h[R],m=g.tdList;for(let f=0;f<m.length;f++){const T=m[f],I=i(T.value,0);if(I)return{positionContext:{isTable:!0,index:d,trIndex:R,tdIndex:f,tdId:T.id,trId:g.id,tableId:u.id},nextIndex:I.nextIndex}}}}if(!(!u.controlId||u.controlId===n.controlId||a[d+1]?.controlComponent===p.PREFIX||a[d+1]?.controlComponent===p.PRE_TEXT||a[d+1]?.controlComponent===p.PRETEXTFIX||a[d+1]?.controlComponent===p.PRETEXTFIX_TEXT))return{positionContext:{isTable:!1},nextIndex:d}}return null}const{endIndex:r}=this.range.getRange(),s=this.getElementList(),l=i(s,r);if(l)return{positionContext:t.isTable?t:l.positionContext,nextIndex:l.nextIndex};if(n.tableId){const a=this.draw.getOriginalElementList(),{index:c,trIndex:d,tdIndex:u}=t,h=a[c].trList;for(let g=d;g<h.length;g++){const m=h[g],f=m.tdList;for(let T=0;T<f.length;T++){if(d===g&&T<=u)continue;const I=f[T],L=i(I.value,0);if(L)return{positionContext:{isTable:!0,index:t.index,trIndex:g,tdIndex:T,tdId:I.id,trId:m.id,tableId:n.tableId},nextIndex:L.nextIndex}}}const R=i(a,c+1);if(R)return{positionContext:{isTable:!1},nextIndex:R.nextIndex}}return null}initNextControl(e={}){const{direction:t=mt.DOWN}=e;let n=null;if(t===mt.UP?n=this.getPreControlContext():n=this.getNextControlContext(),!n)return;const{nextIndex:i,positionContext:r}=n,s=this.draw.getPosition();s.setPositionContext(r),this.draw.getRange().replaceRange({startIndex:i,endIndex:i}),this.draw.render({curIndex:i,isCompute:!1,isSetCursor:!0,isSubmitHistory:!1});const l=s.getPositionList();this.draw.getCursor().moveCursorToVisible({cursorPosition:l[i],direction:t})}setMinWidthControlInfo(e){const{row:t,rowElement:n,controlRealWidth:i,availableWidth:r}=e;if(!n.control?.minWidth)return;const{scale:s}=this.options,l=n.control.minWidth*s;let a=null;if(n.control?.minWidth&&(n.control?.rowFlex===Qe.CENTER||n.control?.rowFlex===Qe.RIGHT)){let d=n.metrics.width,u=t.elementList.length-1;for(;u>=0;){const h=t.elementList[u];if(d+=h.metrics.width,t.elementList[u-1]?.controlComponent===p.PREFIX){a=h;break}u--}a&&d<l&&(n.control.rowFlex===Qe.CENTER?a.left=(l-d)/2:n.control.rowFlex===Qe.RIGHT&&(a.left=l-d-n.metrics.width))}const c=l-i;if(c>0){const d=a?.left||0,u=r-t.width-n.metrics.width,h=Math.min(u,c);n.left=h-d,t.width+=h-d}}mergeControl(e={}){const t=e.elementList||this.getElementList(),n=e.range||this.getRange(),{startIndex:i}=n,r=e.tdId??this.draw.getPosition().getPositionContext().tdId,s=r?this.draw.getTdById(r):void 0,l=t[i];if(!l?.controlId)return{range:n,elementList:[],tdId:r};const a={startIndex:i,endIndex:i},c=[];let d=!1,u=i,h=s,R=t;for(;u>=0;){const T=R[u];if(T.controlId!==l.controlId)break;if(T.type!==O.SPLIT_TAG&&(c.unshift(T),d&&(R.splice(u,1),t[0].type===O.SPLIT_TAG?t.splice(0,1):(n.startIndex++,n.endIndex++),t.unshift(T)),a.startIndex=u),u===0&&T.controlComponent!==p.PREFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){R=h.value,u=h.value.length-1,d=!0;continue}if(u===0&&T.controlComponent!==p.PRETEXTFIX&&h?.linkTdPrevId&&(h=this.draw.getTdById(h.linkTdPrevId),h)){R=h.value,u=h.value.length-1,d=!0;continue}u--}d=!1;let g=i+1,m=s,f=t;for(;g<f.length;){const T=f[g];if(T.controlId!==l.controlId)break;if(T.type!==O.SPLIT_TAG&&(c.push(T),d&&(f.splice(g,1),t.push(T),g--)),g===f.length-1&&T.controlComponent!==p.POSTFIX&&m?.linkTdNextId&&(m=this.draw.getTdById(m.linkTdNextId),m)){f=m.value,g=0,d=!0;continue}if(g===f.length-1&&T.controlComponent!==p.POSTTEXTFIX&&m?.linkTdNextId&&(m=this.draw.getTdById(m.linkTdNextId),m)){f=m.value,g=0,d=!0;continue}g++}return a.endIndex=a.startIndex+c.length,{range:n,elementList:t,tdId:r,fullRange:{startIndex:a.startIndex,endIndex:a.endIndex-2}}}}class Zp{options;currentTextFieldId=null;valueStartX=0;valueWidth=0;valueY=0;constructor(e){this.options=e.getOptions()}startTextFieldValue(e,t,n){this.currentTextFieldId=e,this.valueStartX=t,this.valueY=n,this.valueWidth=0}recordValueWidth(e){this.valueWidth+=e}endTextFieldValue(e){if(!this.currentTextFieldId||this.valueWidth<=0){this.reset();return}const{scale:t}=this.options;e.save(),e.strokeStyle=this.options.defaultColor,e.lineWidth=t,e.beginPath();const n=this.valueY-.5*t;e.moveTo(this.valueStartX,n),e.lineTo(this.valueStartX+this.valueWidth,n),e.stroke(),e.restore(),this.reset()}reset(){this.currentTextFieldId=null,this.valueStartX=0,this.valueWidth=0,this.valueY=0}}class Qp{draw;options;constructor(e){this.draw=e,this.options=e.getOptions()}setSelect(e){const{checkbox:t}=e;t?t.value=!t.value:e.checkbox={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(e){const{ctx:t,x:n,index:i,row:r}=e;let{y:s}=e;const{checkbox:{gap:l,lineWidth:a,fillStyle:c,strokeStyle:d,verticalAlign:u},scale:h}=this.options,{metrics:R,checkbox:g}=r.elementList[i];if(u===Tt.TOP||u===Tt.MIDDLE){let L=i+1,S=null;for(;L<r.elementList.length&&(S=r.elementList[L],!(S.value!==ee&&S.value!==Ss));)L++;if(S){const{metrics:{boundingBoxAscent:M,boundingBoxDescent:X}}=S,x=M+X;x>R.height&&(u===Tt.TOP?s-=M-R.height:u===Tt.MIDDLE&&(s-=(x-R.height)/2))}}const m=Math.round(n+l*h),f=Math.round(s-R.height+a),T=R.width-l*2*h,I=R.height;t.save(),t.beginPath(),t.translate(.5,.5),g?.value?(t.lineWidth=a,t.strokeStyle=c,t.rect(m,f,T,I),t.stroke(),t.beginPath(),t.fillStyle=c,t.fillRect(m,f,T,I),t.beginPath(),t.strokeStyle=d,t.lineWidth=a*2*h,t.moveTo(m+2*h,f+I/2),t.lineTo(m+T/2,f+I-3*h),t.lineTo(m+T-2*h,f+3*h),t.stroke()):(t.lineWidth=a,t.rect(m,f,T,I),t.stroke()),t.closePath(),t.restore()}}class Kp{draw;options;constructor(e){this.draw=e,this.options=e.getOptions()}setSelect(e){const{radio:t}=e;t?t.value=!t.value:e.radio={value:!0},this.draw.render({isCompute:!1,isSetCursor:!1})}render(e){const{ctx:t,x:n,index:i,row:r}=e;let{y:s}=e;const{radio:{gap:l,lineWidth:a,fillStyle:c,strokeStyle:d,verticalAlign:u},scale:h}=this.options,{metrics:R,radio:g}=r.elementList[i];if(u===Tt.TOP||u===Tt.MIDDLE){let L=i+1,S=null;for(;L<r.elementList.length&&(S=r.elementList[L],!(S.value!==ee&&S.value!==Ss));)L++;if(S){const{metrics:{boundingBoxAscent:M,boundingBoxDescent:X}}=S,x=M+X;x>R.height&&(u===Tt.TOP?s-=M-R.height:u===Tt.MIDDLE&&(s-=(x-R.height)/2))}}const m=Math.round(n+l*h),f=Math.round(s-R.height+a),T=R.width-l*2*h,I=R.height;t.save(),t.beginPath(),t.translate(.5,.5),t.strokeStyle=g?.value?c:d,t.lineWidth=a,t.arc(m+T/2,f+I/2,T/2,0,Math.PI*2),t.stroke(),g?.value&&(t.beginPath(),t.fillStyle=c,t.arc(m+T/2,f+I/2,T/3,0,Math.PI*2),t.fill()),t.closePath(),t.restore()}}const qo={fontSize:11,smallFontSize:9,lineHeight:12,dividerWidth:40,gap:4,totalHeight:36};class Hp{draw;options;inputModal=null;isPopup=!1;constructor(e){this.draw=e,this.options=e.getOptions()}computeSize(e){const t=qo,n=this.options.scale,i=t.fontSize*n,r=t.smallFontSize*n,s=t.gap*n,l=t.dividerWidth*n,c=document.createElement("canvas").getContext("2d"),d=e.menstrualData;c.font=`${i}px "Microsoft YaHei", sans-serif`;let u=l;c.font=`${r}px "Microsoft YaHei", sans-serif`;let h=0;if(d){const g=this.getValue(d.menarcheAge);c.font=`${i}px "Microsoft YaHei", sans-serif`,g&&(u+=c.measureText(`${g}岁`).width+s);let m="";if(d.isMenopause){const S=this.getValue(d.menopauseAge);S&&(m=`${S}岁`)}else{const S=this.getValue(d.lastPeriod);S&&(m=S)}m&&(u+=c.measureText(m).width+s),c.font=`${r}px "Microsoft YaHei", sans-serif`;const f=this.getValue(d.periodMin),T=this.getValue(d.periodMax);if(f||T){const S=`${f||""}~${T||""}`;h=Math.max(h,c.measureText(S).width)}const I=this.getValue(d.cycleMin),L=this.getValue(d.cycleMax);if(I||L){const S=`${I||""}~${L||""}`;h=Math.max(h,c.measureText(S).width)}}else c.font=`${i}px "Microsoft YaHei", sans-serif`,h=c.measureText("~").width;return{width:Math.max(u,h),height:t.totalHeight*n}}getValue(e){return!e||e===""||e==="_"||e==="____-__-__"?"":e}render(e){const{ctx:t,x:n,y:i,element:r}=e,s=r.menstrualData,l=this.options.scale;t.save(),t.font=`${qo.fontSize*l}px "Microsoft YaHei", sans-serif`,t.fillStyle=this.options.defaultColor,t.textBaseline="bottom",s?this.renderWithData(t,n,i,s,l):this.renderEmpty(t,n,i,l),t.restore()}renderEmpty(e,t,n,i){const r=qo,s=r.fontSize*i,l=r.lineHeight*i,a=r.dividerWidth*i,c=n-l*1.5,d=t+a/2;e.font=`${s}px "Microsoft YaHei", sans-serif`;const u=e.measureText("~").width,h=d-u/2;e.fillText("~",h,c+l);const R=c+l*2;this.drawDivider(e,t,R-s/2,a,i),e.fillText("~",h,R+l)}renderWithData(e,t,n,i,r){const s=qo,l=s.fontSize*r,a=s.smallFontSize*r,c=s.lineHeight*r,d=s.gap*r,u=s.dividerWidth*r,h=n-c*2,R=h+c*2;e.font=`${l}px "Microsoft YaHei", sans-serif`;const g=this.getValue(i.menarcheAge);let m=t;if(g){const P=`${g}岁`;e.fillText(P,t,R),m=t+e.measureText(P).width+d}const f=m+u/2,T=h+c;e.font=`${a}px "Microsoft YaHei", sans-serif`;const I=this.getValue(i.periodMin),L=this.getValue(i.periodMax);let S="";I||L?S=`${I||""}~${L||""}`:(e.font=`${l}px "Microsoft YaHei", sans-serif`,S="~");const M=e.measureText(S).width,X=f-M/2;e.fillText(S,X,T),this.drawDivider(e,m,R-l/2,u,r),e.font=`${l}px "Microsoft YaHei", sans-serif`;let x="";if(i.isMenopause){const P=this.getValue(i.menopauseAge);P&&(x=`${P}岁`)}else{const P=this.getValue(i.lastPeriod);P&&(x=P)}x&&e.fillText(x,m+u+d,R);const F=R+c;e.font=`${a}px "Microsoft YaHei", sans-serif`;const D=this.getValue(i.cycleMin),V=this.getValue(i.cycleMax);let E="";D||V?E=`${D||""}~${V||""}`:(e.font=`${l}px "Microsoft YaHei", sans-serif`,E="~");const v=e.measureText(E).width,b=f-v/2;e.fillText(E,b,F)}drawDivider(e,t,n,i,r){e.save(),e.beginPath(),e.strokeStyle=this.options.defaultColor,e.lineWidth=.5*r,e.moveTo(t,n),e.lineTo(t+i,n),e.stroke(),e.restore()}clearMenstrualHistoryEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderMenstrualHistoryEditor(e,t){if(this.options.mode===B.PRINT)return;(this.isPopup||this.inputModal)&&this.clearMenstrualHistoryEditor(),this.isPopup=!0;const n=e.menstrualData;this.inputModal=document.createElement("div"),this.inputModal.className="menstrual-history-edit-modal",this.inputModal.setAttribute("editor-component","menstrual-history-edit-modal"),this.inputModal.innerHTML=`
185
+ <div class="menstrual-history-modal__mask"></div>
186
+ <div class="menstrual-history-modal__container">
187
+ <div class="menstrual-history-modal__header">
188
+ <span>${n?"编辑月经史":"添加月经史"}</span>
189
+ <div class="menstrual-history-modal__close">×</div>
190
+ </div>
191
+ <div class="menstrual-history-modal__content">
192
+ <div class="menopause-options">
193
+ <span class="menopause-label">是否闭经:</span>
194
+ <label class="menopause-radio">
195
+ <input type="radio" name="mh-edit-isMenopause" value="false" ${n?.isMenopause?"":"checked"}>
196
+ <span>未闭经</span>
197
+ </label>
198
+ <label class="menopause-radio">
199
+ <input type="radio" name="mh-edit-isMenopause" value="true" ${n?.isMenopause?"checked":""}>
200
+ <span>已闭经</span>
201
+ </label>
202
+ </div>
203
+
204
+ <div class="menstrual-form" id="mh-edit-notMenopause" style="${n?.isMenopause?"display: none;":""}">
205
+ <div class="form-line">
206
+ <span class="text">月经持续</span>
207
+ <input type="number" id="mh-edit-periodMin" min="1" max="14" value="${n?.periodMin||""}">
208
+ <span class="text">~</span>
209
+ <input type="number" id="mh-edit-periodMax" min="1" max="14" value="${n?.periodMax||""}">
210
+ <span class="text">天</span>
211
+ </div>
212
+ <div class="form-line center-line">
213
+ <span class="label">初潮年龄</span>
214
+ <input type="number" id="mh-edit-menarcheAge1" min="8" max="20" value="${n?.menarcheAge||""}">
215
+ <span class="text">岁</span>
216
+ <span class="divider-long"></span>
217
+ <span class="label">末次日期</span>
218
+ <input type="date" id="mh-edit-lastPeriod" value="${n?.lastPeriod||""}">
219
+ </div>
220
+ <div class="form-line">
221
+ <span class="text">生理周期持续</span>
222
+ <input type="number" id="mh-edit-cycleMin" min="21" max="45" value="${n?.cycleMin||""}">
223
+ <span class="text">~</span>
224
+ <input type="number" id="mh-edit-cycleMax" min="21" max="45" value="${n?.cycleMax||""}">
225
+ <span class="text">天</span>
226
+ </div>
227
+ </div>
228
+
229
+ <div class="menstrual-form" id="mh-edit-isMenopauseForm" style="${n?.isMenopause?"":"display: none;"}">
230
+ <div class="form-line">
231
+ <span class="text">月经持续</span>
232
+ <input type="number" id="mh-edit-periodMin2" min="1" max="14" value="${n?.periodMin||""}">
233
+ <span class="text">~</span>
234
+ <input type="number" id="mh-edit-periodMax2" min="1" max="14" value="${n?.periodMax||""}">
235
+ <span class="text">天</span>
236
+ </div>
237
+ <div class="form-line center-line">
238
+ <span class="label">初潮年龄</span>
239
+ <input type="number" id="mh-edit-menarcheAge2" min="8" max="20" value="${n?.menarcheAge||""}">
240
+ <span class="text">岁</span>
241
+ <span class="divider-long"></span>
242
+ <span class="label">闭经年龄</span>
243
+ <input type="number" id="mh-edit-menopauseAge" min="40" max="60" value="${n?.menopauseAge||""}">
244
+ <span class="text">岁</span>
245
+ </div>
246
+ <div class="form-line">
247
+ <span class="text">生理周期持续</span>
248
+ <input type="number" id="mh-edit-cycleMin2" min="21" max="45" value="${n?.cycleMin||""}">
249
+ <span class="text">~</span>
250
+ <input type="number" id="mh-edit-cycleMax2" min="21" max="45" value="${n?.cycleMax||""}">
251
+ <span class="text">天</span>
252
+ </div>
253
+ </div>
254
+ </div>
255
+ <div class="menstrual-history-modal__footer">
256
+ <button class="btn-cancel">取消</button>
257
+ <button class="btn-confirm">确认</button>
258
+ </div>
259
+ </div>
260
+ `,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".menstrual-history-modal__mask"),r=this.inputModal.querySelector(".menstrual-history-modal__container"),s=this.inputModal.querySelector(".menstrual-history-modal__close"),l=this.inputModal.querySelector(".btn-cancel"),a=this.inputModal.querySelector(".btn-confirm"),c=this.inputModal.querySelector("#mh-edit-notMenopause"),d=this.inputModal.querySelector("#mh-edit-isMenopauseForm"),u=this.inputModal.querySelectorAll('input[name="mh-edit-isMenopause"]'),h=()=>{this.clearMenstrualHistoryEditor()};r.addEventListener("click",R=>{R.stopPropagation()}),i.addEventListener("click",h),s.addEventListener("click",h),l.addEventListener("click",h),u.forEach(R=>{R.addEventListener("change",()=>{const g=R.value==="true";c.style.display=g?"none":"block",d.style.display=g?"block":"none"})}),a.addEventListener("click",R=>{R.preventDefault(),R.stopPropagation();const g=this.inputModal;if(!g)return;const m=g.querySelector('input[name="mh-edit-isMenopause"]:checked')?.value==="true";let f;m?f={isMenopause:!0,periodMin:g.querySelector("#mh-edit-periodMin2")?.value||"",periodMax:g.querySelector("#mh-edit-periodMax2")?.value||"",menarcheAge:g.querySelector("#mh-edit-menarcheAge2")?.value||"",menopauseAge:g.querySelector("#mh-edit-menopauseAge")?.value||"",cycleMin:g.querySelector("#mh-edit-cycleMin2")?.value||"",cycleMax:g.querySelector("#mh-edit-cycleMax2")?.value||""}:f={isMenopause:!1,periodMin:g.querySelector("#mh-edit-periodMin")?.value||"",periodMax:g.querySelector("#mh-edit-periodMax")?.value||"",menarcheAge:g.querySelector("#mh-edit-menarcheAge1")?.value||"",lastPeriod:g.querySelector("#mh-edit-lastPeriod")?.value||"",cycleMin:g.querySelector("#mh-edit-cycleMin")?.value||"",cycleMax:g.querySelector("#mh-edit-cycleMax")?.value||""},this.clearMenstrualHistoryEditor();const T=this.draw.getElementList(),I=t.index;this.draw.spliceElementList(T,I,1);const L={type:"menstrualHistory",value:"",menstrualData:f};this.draw.spliceElementList(T,I,0,[L]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}}const Br={fontSize:16,totalWidth:85,totalHeight:75,symbolGap:12,lineGap:20};class _p{draw;options;inputModal=null;isPopup=!1;constructor(e){this.draw=e,this.options=e.getOptions()}computeSize(e){const t=Br,n=this.options.scale;return{width:t.totalWidth*n,height:t.totalHeight*n}}render(e){const{ctx:t,x:n,y:i,element:r}=e,s=r.fetalHeartData,l=this.options.scale;t.save();const a=Br,c=a.fontSize*l,d=a.symbolGap*l,u=a.lineGap*l,h=a.totalHeight*l,R=n+a.totalWidth*l/2,m=i-h/2;t.font=`${c}px "Microsoft YaHei", sans-serif`,t.fillStyle=this.options.defaultColor,t.textBaseline="middle",t.textAlign="center";const f=h/4,T=m+f*.7,I=m+f*1.7,L=m+f*2.7,S=m+h-f*.3;this.drawVerticalLine(t,R,m,S-m,l);const M=R-d,X=R+d;this.drawSymbol(t,M,T,s?.a,c),this.drawSymbol(t,X,T,s?.b,c);const x=M-u,F=X+u;t.fillText("-",x,I),this.drawSymbol(t,M,I,s?.c,c),this.drawSymbol(t,X,I,s?.d,c),t.fillText("-",F,I),this.drawSymbol(t,M,L,s?.e,c),this.drawSymbol(t,X,L,s?.f,c),t.restore()}drawSymbol(e,t,n,i,r){const s=i?"+":"-";e.fillText(s,t,n)}drawVerticalLine(e,t,n,i,r){e.save(),e.beginPath(),e.strokeStyle=this.options.defaultColor,e.lineWidth=.5*r,e.moveTo(t,n),e.lineTo(t,n+i),e.stroke(),e.restore()}clearFetalHeartPositionEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderFetalHeartPositionEditor(e,t){if(this.options.mode===B.PRINT)return;(this.isPopup||this.inputModal)&&this.clearFetalHeartPositionEditor(),this.isPopup=!0;const n=e.fetalHeartData;this.inputModal=document.createElement("div"),this.inputModal.className="fetal-heart-position-edit-modal",this.inputModal.setAttribute("editor-component","fetal-heart-position-edit-modal"),this.inputModal.innerHTML=`
261
+ <div class="fetal-heart-position-modal__mask"></div>
262
+ <div class="fetal-heart-position-modal__container">
263
+ <div class="fetal-heart-position-modal__header">
264
+ <span>${n?"编辑胎心位置":"添加胎心位置"}</span>
265
+ <div class="fetal-heart-position-modal__close">×</div>
266
+ </div>
267
+ <div class="fetal-heart-position-modal__content">
268
+ <div class="fetal-heart-grid">
269
+ <div class="fetal-heart-row">
270
+ <label class="fetal-heart-checkbox">
271
+ <input type="checkbox" id="fh-a" ${n?.a?"checked":""}>
272
+ <span>肚脐左上方(a)</span>
273
+ </label>
274
+ <label class="fetal-heart-checkbox">
275
+ <input type="checkbox" id="fh-b" ${n?.b?"checked":""}>
276
+ <span>肚脐右上方(b)</span>
277
+ </label>
278
+ </div>
279
+ <div class="fetal-heart-row">
280
+ <label class="fetal-heart-checkbox">
281
+ <input type="checkbox" id="fh-c" ${n?.c?"checked":""}>
282
+ <span>腹壁左方(c)</span>
283
+ </label>
284
+ <label class="fetal-heart-checkbox">
285
+ <input type="checkbox" id="fh-d" ${n?.d?"checked":""}>
286
+ <span>腹壁右方(d)</span>
287
+ </label>
288
+ </div>
289
+ <div class="fetal-heart-row">
290
+ <label class="fetal-heart-checkbox">
291
+ <input type="checkbox" id="fh-e" ${n?.e?"checked":""}>
292
+ <span>肚脐左下方(e)</span>
293
+ </label>
294
+ <label class="fetal-heart-checkbox">
295
+ <input type="checkbox" id="fh-f" ${n?.f?"checked":""}>
296
+ <span>肚脐右下方(f)</span>
297
+ </label>
298
+ </div>
299
+ </div>
300
+ </div>
301
+ <div class="fetal-heart-position-modal__footer">
302
+ <button class="btn-cancel">取消</button>
303
+ <button class="btn-confirm">确认</button>
304
+ </div>
305
+ </div>
306
+ `,document.body.appendChild(this.inputModal);const i=this.inputModal.querySelector(".fetal-heart-position-modal__mask"),r=this.inputModal.querySelector(".fetal-heart-position-modal__container"),s=this.inputModal.querySelector(".fetal-heart-position-modal__close"),l=this.inputModal.querySelector(".btn-cancel"),a=this.inputModal.querySelector(".btn-confirm"),c=()=>{this.clearFetalHeartPositionEditor()};r.addEventListener("click",d=>{d.stopPropagation()}),i.addEventListener("click",c),s.addEventListener("click",c),l.addEventListener("click",c),a.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation();const u=this.inputModal;if(!u)return;const h={a:u.querySelector("#fh-a")?.checked||!1,b:u.querySelector("#fh-b")?.checked||!1,c:u.querySelector("#fh-c")?.checked||!1,d:u.querySelector("#fh-d")?.checked||!1,e:u.querySelector("#fh-e")?.checked||!1,f:u.querySelector("#fh-f")?.checked||!1};this.clearFetalHeartPositionEditor();const R=this.draw.getElementList(),g=t.index;this.draw.spliceElementList(R,g,1);const m={type:"fetalHeartPosition",value:"",fetalHeartData:h};this.draw.spliceElementList(R,g,0,[m]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}}const un={fontSize:12,deciduousFontSize:10,smallFontSize:9,totalHeight:60,toothGap:2,halfGap:8,minLineHalfWidth:50,maxLineHalfWidth:85},zr=["La","B","F","M","I","D","L","P"];class Ap{draw;options;inputModal=null;isPopup=!1;finallyAdd=null;toothSurfaceMap={};supernumeraryToothMap={};constructor(e){this.draw=e,this.options=e.getOptions()}computeSize(e){const t=un,n=this.options.scale,i=e.toothPositionData,s=this.calculateLineHalfWidth(i,n)*2;return{width:Math.min(s,this.draw.getInnerWidth()),height:t.totalHeight*n}}calculateLineHalfWidth(e,t){const{minLineHalfWidth:n,maxLineHalfWidth:i,fontSize:r,deciduousFontSize:s,smallFontSize:l,toothGap:a}=un,c=(m,f,T)=>{let I=0;const L=(S,M)=>`${S}-${M}`;return f.forEach(S=>{const M=L(T,S),X=e?.toothSurfaceMap?.[M]||[],x=e?.supernumeraryToothMap?.[M];I+=s*t*.6,X.length>0&&(I+=l*t*X.length*.5),x&&(I+=s*t*.4),I+=a*t}),m.forEach(S=>{const M=L(T,S),X=e?.toothSurfaceMap?.[M]||[],x=e?.supernumeraryToothMap?.[M];I+=r*t*.6,X.length>0&&(I+=l*t*X.length*.5),x&&(I+=r*t*.4),I+=a*t}),I},d=Math.max(c(e?.upperLeft||[],e?.upperLeftLetter||[],"upperLeft"),c(e?.lowerLeft||[],e?.lowerLeftLetter||[],"lowerLeft")),u=Math.max(c(e?.upperRight||[],e?.upperRightLetter||[],"upperRight"),c(e?.lowerRight||[],e?.lowerRightLetter||[],"lowerRight")),R=Math.max(d,u)/t+un.halfGap;return Math.max(n,Math.min(i,R))*t}render(e){const{ctx:t,x:n,y:i,element:r}=e,s=r.toothPositionData,l=this.options.scale;t.save();const a=un.fontSize*l,c=un.deciduousFontSize*l,d=un.smallFontSize*l,u=un.toothGap*l,h=un.totalHeight*l,R=un.halfGap*l,g=2*l,m=(X,x)=>`${X}-${x}`,f=this.calculateLineHalfWidth(s,l),T=f*2,I=n+f,L=i;t.beginPath(),t.rect(I-f,L-h/2,T,h),t.clip(),t.beginPath(),t.strokeStyle=this.options.defaultColor,t.lineWidth=1*l,t.moveTo(I,L-h/2+10*l),t.lineTo(I,L+h/2-10*l),t.stroke(),t.beginPath(),t.moveTo(I-f,L),t.lineTo(I+f,L),t.stroke();const S=(X,x,F,D,V)=>{const E=m(X,x),v=s?.toothSurfaceMap?.[E]||[],b=zr.filter(Q=>v.includes(Q)),P=s?.supernumeraryToothMap?.[E],y=x.toString(),U=typeof x=="string"?c:a;t.font=`${U}px "Microsoft YaHei", sans-serif`,t.textBaseline="middle";let w=F;if(P){t.font=`${U}px "Microsoft YaHei", sans-serif`;const $=t.measureText("(").width,le=t.measureText(y).width;t.font=`${d}px "Microsoft YaHei", sans-serif`;const Pe=t.measureText("S").width;let se=$+le+$;se+=Pe+g;let J=0,ie="";return b.length>0&&(t.font=`${d}px "Microsoft YaHei", sans-serif`,ie=b.join(","),J=t.measureText(ie).width+g/2),V==="right"?(w=F-se,b.length>0&&(t.font=`${d}px "Microsoft YaHei", sans-serif`,t.fillText(ie,w-J-g/2,D-U*.4)),t.font=`${U}px "Microsoft YaHei", sans-serif`,t.textAlign="left",t.fillStyle=this.options.defaultColor,t.fillText("(",w,D),w+=$,t.font=`${d}px "Microsoft YaHei", sans-serif`,P==="Si"&&(t.fillText("S",w,D-U*.4),w+=Pe+g),t.font=`${U}px "Microsoft YaHei", sans-serif`,t.fillText(y,w,D),w+=le,P==="iS"&&(t.font=`${d}px "Microsoft YaHei", sans-serif`,t.fillText("S",w,D-U*.4),w+=Pe),t.font=`${U}px "Microsoft YaHei", sans-serif`,t.fillText(")",w,D),F-se-J-u):(t.font=`${U}px "Microsoft YaHei", sans-serif`,t.textAlign="left",t.fillStyle=this.options.defaultColor,t.fillText("(",w,D),w+=$,t.font=`${d}px "Microsoft YaHei", sans-serif`,P==="Si"&&(t.fillText("S",w,D-U*.4),w+=Pe+g),t.font=`${U}px "Microsoft YaHei", sans-serif`,t.fillText(y,w,D),w+=le,P==="iS"&&(t.font=`${d}px "Microsoft YaHei", sans-serif`,t.fillText("S",w,D-U*.4),w+=Pe),t.font=`${U}px "Microsoft YaHei", sans-serif`,t.fillText(")",w,D),w+=$,b.length>0&&(t.font=`${d}px "Microsoft YaHei", sans-serif`,t.fillText(ie,w+g/2,D-U*.4),w+=J),w+u)}else{t.font=`${U}px "Microsoft YaHei", sans-serif`;const Q=t.measureText(y).width;let K=0,z="";return b.length>0&&(t.font=`${d}px "Microsoft YaHei", sans-serif`,z=b.join(","),K=t.measureText(z).width+g/2,t.font=`${U}px "Microsoft YaHei", sans-serif`),V==="right"?(w=F-Q,b.length>0&&(t.font=`${d}px "Microsoft YaHei", sans-serif`,t.fillText(z,w-K-g/2,D-U*.4),t.font=`${U}px "Microsoft YaHei", sans-serif`),t.textAlign="left",t.fillStyle=this.options.defaultColor,t.fillText(y,w,D),F-Q-K-u):(t.textAlign="left",t.fillStyle=this.options.defaultColor,t.fillText(y,w,D),w+=Q,b.length>0&&(t.font=`${d}px "Microsoft YaHei", sans-serif`,t.fillText(z,w+g/2,D-U*.4),w+=K),w+u)}},M=(X,x,F,D,V,E)=>{let v=D;E==="right"?([...x].reverse().forEach(y=>{v=S(F,y,v,V,E)}),[...X].reverse().forEach(y=>{v=S(F,y,v,V,E)})):(x.forEach(b=>{v=S(F,b,v,V,E)}),X.forEach(b=>{v=S(F,b,v,V,E)}))};M(s?.upperLeft||[],s?.upperLeftLetter||[],"upperLeft",I-R,L-h/4,"right"),M(s?.upperRight||[],s?.upperRightLetter||[],"upperRight",I+R,L-h/4,"left"),M(s?.lowerLeft||[],s?.lowerLeftLetter||[],"lowerLeft",I-R,L+h/4,"right"),M(s?.lowerRight||[],s?.lowerRightLetter||[],"lowerRight",I+R,L+h/4,"left"),t.restore()}clearToothPositionEditor(){this.inputModal&&(this.inputModal.remove(),this.inputModal=null),this.isPopup=!1}renderToothPositionEditor(e,t){if(this.options.mode===B.PRINT)return;(this.isPopup||this.inputModal)&&this.clearToothPositionEditor(),this.isPopup=!0,this.finallyAdd=null,this.toothSurfaceMap={},this.supernumeraryToothMap={};const n=e.toothPositionData;this.inputModal=document.createElement("div"),this.inputModal.className="tooth-position-edit-modal",this.inputModal.setAttribute("editor-component","tooth-position-edit-modal"),this.inputModal.innerHTML=`
307
+ <div class="tooth-position-modal__mask"></div>
308
+ <div class="tooth-position-modal__container">
309
+ <div class="tooth-position-modal__header">
310
+ <span>${n?"编辑牙位图":"添加牙位图"}</span>
311
+ <div class="tooth-position-modal__close">×</div>
312
+ </div>
313
+ <div class="tooth-position-modal__content">
314
+ <!-- 快捷选择按钮 -->
315
+ <div class="tooth-quick-buttons">
316
+ <div class="tooth-quick-buttons-left">
317
+ <div class="tooth-quick-buttons-row">
318
+ <button class="tooth-quick-btn" data-action="allPermanent">全口恒牙</button>
319
+ <button class="tooth-quick-btn" data-action="upperPermanent">上半口恒牙</button>
320
+ <button class="tooth-quick-btn" data-action="lowerPermanent">下半口恒牙</button>
321
+ <button class="tooth-quick-btn" data-action="upperLeftPermanent">左上-恒牙</button>
322
+ <button class="tooth-quick-btn" data-action="lowerLeftPermanent">左下-恒牙</button>
323
+ <button class="tooth-quick-btn" data-action="upperRightPermanent">右上-恒牙</button>
324
+ <button class="tooth-quick-btn" data-action="lowerRightPermanent">右下-恒牙</button>
325
+ <button class="tooth-quick-btn tooth-quick-btn--clear" data-action="clear">清除</button>
326
+ </div>
327
+ <div class="tooth-quick-buttons-row">
328
+ <button class="tooth-quick-btn" data-action="allDeciduous">全口乳牙</button>
329
+ <button class="tooth-quick-btn" data-action="upperDeciduous">上半口乳牙</button>
330
+ <button class="tooth-quick-btn" data-action="lowerDeciduous">下半口乳牙</button>
331
+ <button class="tooth-quick-btn" data-action="upperLeftDeciduous">左上-乳牙</button>
332
+ <button class="tooth-quick-btn" data-action="lowerLeftDeciduous">左下-乳牙</button>
333
+ <button class="tooth-quick-btn" data-action="upperRightDeciduous">右上-乳牙</button>
334
+ <button class="tooth-quick-btn" data-action="lowerRightDeciduous">右下-乳牙</button>
335
+ </div>
336
+ </div>
337
+ </div>
338
+
339
+ <div class="tooth-grid-container">
340
+ <!-- 字母行 - 上 -->
341
+ <div class="tooth-grid-letter-row upper-letter-row">
342
+ <div class="tooth-grid-half left">
343
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="E">E</div>
344
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="D">D</div>
345
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="C">C</div>
346
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="B">B</div>
347
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="A">A</div>
348
+ </div>
349
+ <div class="tooth-grid-divider-v"></div>
350
+ <div class="tooth-grid-half right">
351
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="A">A</div>
352
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="B">B</div>
353
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="C">C</div>
354
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="D">D</div>
355
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="E">E</div>
356
+ </div>
357
+ </div>
358
+
359
+ <!-- 数字行 - 上颌 -->
360
+ <div class="tooth-grid-number-row upper-number-row">
361
+ <div class="tooth-grid-half left">
362
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="8">8</div>
363
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="7">7</div>
364
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="6">6</div>
365
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="5">5</div>
366
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="4">4</div>
367
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="3">3</div>
368
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="2">2</div>
369
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="1">1</div>
370
+ </div>
371
+ <div class="tooth-grid-divider-v"></div>
372
+ <div class="tooth-grid-half right">
373
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="1">1</div>
374
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="2">2</div>
375
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="3">3</div>
376
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="4">4</div>
377
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="5">5</div>
378
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="6">6</div>
379
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="7">7</div>
380
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="8">8</div>
381
+ </div>
382
+ </div>
383
+
384
+ <!-- 横向分隔线 -->
385
+ <div class="tooth-grid-divider-h">
386
+ <canvas class="tooth-divider-canvas-h" width="900" height="2"></canvas>
387
+ </div>
388
+
389
+ <!-- 数字行 - 下颌 -->
390
+ <div class="tooth-grid-number-row lower-number-row">
391
+ <div class="tooth-grid-half left">
392
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="8">8</div>
393
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="7">7</div>
394
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="6">6</div>
395
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="5">5</div>
396
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="4">4</div>
397
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="3">3</div>
398
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="2">2</div>
399
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="1">1</div>
400
+ </div>
401
+ <div class="tooth-grid-divider-v">
402
+ <canvas class="tooth-divider-canvas-v" width="2" height="110"></canvas>
403
+ </div>
404
+ <div class="tooth-grid-half right">
405
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="1">1</div>
406
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="2">2</div>
407
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="3">3</div>
408
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="4">4</div>
409
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="5">5</div>
410
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="6">6</div>
411
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="7">7</div>
412
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="8">8</div>
413
+ </div>
414
+ </div>
415
+
416
+ <!-- 字母行 - 下 -->
417
+ <div class="tooth-grid-letter-row lower-letter-row">
418
+ <div class="tooth-grid-half left">
419
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="E">E</div>
420
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="D">D</div>
421
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="C">C</div>
422
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="B">B</div>
423
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="A">A</div>
424
+ </div>
425
+ <div class="tooth-grid-divider-v"></div>
426
+ <div class="tooth-grid-half right">
427
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="A">A</div>
428
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="B">B</div>
429
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="C">C</div>
430
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="D">D</div>
431
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="E">E</div>
432
+ </div>
433
+ </div>
434
+ </div>
435
+
436
+ <!-- 预览区域 -->
437
+ <div class="tooth-preview-section">
438
+ <div class="tooth-preview-title">预览</div>
439
+ <div class="tooth-preview-wrapper">
440
+ <div class="tooth-preview-container">
441
+ <div class="tooth-preview-grid">
442
+ <!-- 左上 -->
443
+ <div class="tooth-preview-quadrant tooth-preview-upper-left"></div>
444
+ <!-- 右上 -->
445
+ <div class="tooth-preview-quadrant tooth-preview-upper-right"></div>
446
+ <!-- 左下 -->
447
+ <div class="tooth-preview-quadrant tooth-preview-lower-left"></div>
448
+ <!-- 右下 -->
449
+ <div class="tooth-preview-quadrant tooth-preview-lower-right"></div>
450
+ </div>
451
+ </div>
452
+ <div class="tooth-extra-panel">
453
+ <!-- 牙面 -->
454
+ <div class="tooth-surface-panel">
455
+ <div class="tooth-surface-title">牙面</div>
456
+ <div class="tooth-surface-grid">
457
+ <div class="tooth-surface-row">
458
+ <div class="tooth-surface-item" data-surface="La">La</div>
459
+ <div class="tooth-surface-item" data-surface="B">B</div>
460
+ <div class="tooth-surface-item" data-surface="F">F</div>
461
+ </div>
462
+ <div class="tooth-surface-row">
463
+ <div class="tooth-surface-item" data-surface="M">M</div>
464
+ <div class="tooth-surface-item" data-surface="I">I</div>
465
+ <div class="tooth-surface-item" data-surface="D">D</div>
466
+ </div>
467
+ <div class="tooth-surface-row">
468
+ <div class="tooth-surface-item tooth-surface-item--indent" data-surface="L">L</div>
469
+ <div class="tooth-surface-item" data-surface="P">P</div>
470
+ </div>
471
+ </div>
472
+ </div>
473
+ <!-- 多生牙 -->
474
+ <div class="tooth-supernumerary-panel">
475
+ <div class="tooth-supernumerary-title">多生牙 <span class="tooth-supernumerary-hint">(S为数字上标)</span></div>
476
+ <div class="tooth-supernumerary-grid">
477
+ <div class="tooth-supernumerary-item" data-supernumerary="Si">Si</div>
478
+ <div class="tooth-supernumerary-item" data-supernumerary="iS">iS</div>
479
+ </div>
480
+ </div>
481
+ </div>
482
+ </div>
483
+ </div>
484
+ </div>
485
+ <div class="tooth-position-modal__footer">
486
+ <button class="btn-cancel">取消</button>
487
+ <button class="btn-confirm">确认</button>
488
+ </div>
489
+ </div>
490
+ `,document.body.appendChild(this.inputModal),this.drawDividerLines(),this.initSelectedState(n),this.drawPreview(n),this.bindQuickButtons(),this.bindClickEvents(),this.bindExtraPanelEvents();const i=this.inputModal.querySelector(".tooth-position-modal__mask"),r=this.inputModal.querySelector(".tooth-position-modal__container"),s=this.inputModal.querySelector(".tooth-position-modal__close"),l=this.inputModal.querySelector(".btn-cancel"),a=this.inputModal.querySelector(".btn-confirm"),c=()=>{this.clearToothPositionEditor()};r.addEventListener("click",d=>{d.stopPropagation()}),i.addEventListener("click",c),s.addEventListener("click",c),l.addEventListener("click",c),a.addEventListener("click",d=>{d.preventDefault(),d.stopPropagation();const u=this.inputModal;if(!u)return;const h=this.collectData(u);this.clearToothPositionEditor();const R=this.draw.getElementList(),g=t.index;this.draw.spliceElementList(R,g,1);const m={type:"toothPosition",value:"",toothPositionData:h};this.draw.spliceElementList(R,g,0,[m]),this.draw.getControl().destroyControl(),this.draw.getRange().clearRange(),this.draw.render({isSetCursor:!1,isCompute:!0})})}drawDividerLines(){const e=this.inputModal?.querySelector(".tooth-divider-canvas-h");if(e){const n=e.getContext("2d");n&&(n.strokeStyle="#000",n.lineWidth=2,n.beginPath(),n.moveTo(0,1),n.lineTo(900,1),n.stroke())}const t=this.inputModal?.querySelector(".tooth-divider-canvas-v");if(t){const n=t.getContext("2d");n&&(n.strokeStyle="#000",n.lineWidth=2,n.beginPath(),n.moveTo(1,0),n.lineTo(1,110),n.stroke())}}initSelectedState(e){if(!e)return;const t=this.inputModal;if(!t)return;if(["upperLeft","upperRight","lowerLeft","lowerRight"].forEach(r=>{const s=e[r];s&&s.length>0&&s.forEach(l=>{const a=t.querySelector(`.tooth-grid-number-item[data-position="${r}"][data-value="${l}"]`);a&&a.classList.add("selected")})}),["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"].forEach(r=>{const s=e[r];s&&s.length>0&&s.forEach(l=>{const a=t.querySelector(`.tooth-grid-letter-item[data-position="${r}"][data-value="${l}"]`);a&&a.classList.add("selected")})}),e.toothSurfaceMap&&(this.toothSurfaceMap={...e.toothSurfaceMap}),e.supernumeraryToothMap&&(this.supernumeraryToothMap={...e.supernumeraryToothMap}),e.finallyAdd)this.finallyAdd=e.finallyAdd;else{const r=t.querySelectorAll(".tooth-grid-number-item.selected"),s=t.querySelectorAll(".tooth-grid-letter-item.selected");if(r.length>0){const l=r[r.length-1];this.finallyAdd={position:l.dataset.position||"",value:l.dataset.value||""}}else if(s.length>0){const l=s[s.length-1];this.finallyAdd={position:l.dataset.position||"",value:l.dataset.value||""}}}this.updateExtraPanelSelection()}bindQuickButtons(){const e=this.inputModal;if(!e)return;e.querySelectorAll(".tooth-quick-btn").forEach(n=>{n.addEventListener("click",()=>{const i=n.dataset.action;if(i==="clear"){e.querySelectorAll(".tooth-grid-number-item.selected").forEach(l=>{l.classList.remove("selected")}),e.querySelectorAll(".tooth-grid-letter-item.selected").forEach(l=>{l.classList.remove("selected")}),e.querySelectorAll(".tooth-quick-btn.selected").forEach(l=>{l.classList.remove("selected")}),e.querySelectorAll(".tooth-grid-letter-row").forEach(l=>{l.classList.remove("hidden")}),e.querySelectorAll(".tooth-grid-number-row").forEach(l=>{l.classList.remove("hidden")}),this.finallyAdd=null,this.toothSurfaceMap={},this.supernumeraryToothMap={},e.querySelectorAll(".tooth-surface-item.selected").forEach(l=>{l.classList.remove("selected")}),e.querySelectorAll(".tooth-supernumerary-item.selected").forEach(l=>{l.classList.remove("selected")}),this.updatePreview();return}e.querySelectorAll(".tooth-quick-btn.selected").forEach(l=>{l.dataset.action!=="clear"&&l.classList.remove("selected")}),n.classList.add("selected"),e.querySelectorAll(".tooth-grid-number-item.selected").forEach(l=>{l.classList.remove("selected")}),e.querySelectorAll(".tooth-grid-letter-item.selected").forEach(l=>{l.classList.remove("selected")}),this.selectByAction(i||""),this.updateVisibilityAfterQuickSelect();const r=e.querySelectorAll(".tooth-grid-number-item.selected"),s=e.querySelectorAll(".tooth-grid-letter-item.selected");if(r.length>0){const l=r[r.length-1];this.finallyAdd={position:l.dataset.position||"",value:l.dataset.value||""}}else if(s.length>0){const l=s[s.length-1];this.finallyAdd={position:l.dataset.position||"",value:l.dataset.value||""}}this.updateExtraPanelSelection(),this.updatePreview()})})}selectByAction(e){const t=this.inputModal;if(!t)return;const n=r=>{r.forEach(s=>{for(let l=1;l<=8;l++){const a=t.querySelector(`.tooth-grid-number-item[data-position="${s}"][data-value="${l}"]`);a&&a.classList.add("selected")}})},i=r=>{const s=["A","B","C","D","E"];r.forEach(l=>{s.forEach(a=>{const c=t.querySelector(`.tooth-grid-letter-item[data-position="${l}"][data-value="${a}"]`);c&&c.classList.add("selected")})})};switch(e){case"allPermanent":n(["upperLeft","upperRight","lowerLeft","lowerRight"]);break;case"upperPermanent":n(["upperLeft","upperRight"]);break;case"lowerPermanent":n(["lowerLeft","lowerRight"]);break;case"upperLeftPermanent":n(["upperLeft"]);break;case"lowerLeftPermanent":n(["lowerLeft"]);break;case"upperRightPermanent":n(["upperRight"]);break;case"lowerRightPermanent":n(["lowerRight"]);break;case"allDeciduous":i(["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"]);break;case"upperDeciduous":i(["upperLeftLetter","upperRightLetter"]);break;case"lowerDeciduous":i(["lowerLeftLetter","lowerRightLetter"]);break;case"upperLeftDeciduous":i(["upperLeftLetter"]);break;case"lowerLeftDeciduous":i(["lowerLeftLetter"]);break;case"upperRightDeciduous":i(["upperRightLetter"]);break;case"lowerRightDeciduous":i(["lowerRightLetter"]);break}}updateVisibilityAfterQuickSelect(){const e=this.inputModal;if(!e)return;const t=e.querySelectorAll(".tooth-grid-number-item.selected"),n=e.querySelectorAll(".tooth-grid-letter-item.selected"),i=e.querySelectorAll(".tooth-grid-letter-row"),r=e.querySelectorAll(".tooth-grid-number-row");t.length>0&&n.length===0?(i.forEach(s=>s.classList.add("hidden")),r.forEach(s=>s.classList.remove("hidden"))):n.length>0&&t.length===0?(r.forEach(s=>s.classList.add("hidden")),i.forEach(s=>s.classList.remove("hidden"))):(i.forEach(s=>s.classList.remove("hidden")),r.forEach(s=>s.classList.remove("hidden")))}bindClickEvents(){const e=this.inputModal;if(!e)return;let t=null;const n=()=>{const l=e.querySelectorAll(".tooth-grid-number-item.selected"),a=e.querySelectorAll(".tooth-grid-letter-item.selected");return l.length>0&&a.length===0?"number":a.length>0&&l.length===0?"letter":l.length>0&&a.length>0?t:null},i=()=>{const l=e.querySelectorAll(".tooth-grid-letter-row"),a=e.querySelectorAll(".tooth-grid-number-row");t==="number"?(l.forEach(c=>c.classList.add("hidden")),a.forEach(c=>c.classList.remove("hidden"))):t==="letter"?(a.forEach(c=>c.classList.add("hidden")),l.forEach(c=>c.classList.remove("hidden"))):(l.forEach(c=>c.classList.remove("hidden")),a.forEach(c=>c.classList.remove("hidden")))};e.querySelectorAll(".tooth-grid-number-item").forEach(l=>{l.addEventListener("click",()=>{const a=l.dataset.position||"",c=l.dataset.value||"";if(l.classList.toggle("selected"),l.classList.contains("selected"))this.finallyAdd={position:a,value:c};else if(this.finallyAdd&&this.finallyAdd.position===a&&this.finallyAdd.value===c){const u=e.querySelectorAll(".tooth-grid-number-item.selected");if(u.length>0){const h=u[u.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const d=n();d!==null?t=d:t=null,t==="number"&&e.querySelectorAll(".tooth-grid-letter-item.selected").forEach(h=>h.classList.remove("selected")),i(),this.updateExtraPanelSelection(),this.updatePreview()})}),e.querySelectorAll(".tooth-grid-letter-item").forEach(l=>{l.addEventListener("click",()=>{const a=l.dataset.position||"",c=l.dataset.value||"";if(l.classList.toggle("selected"),l.classList.contains("selected"))this.finallyAdd={position:a,value:c};else if(this.finallyAdd&&this.finallyAdd.position===a&&this.finallyAdd.value===c){const u=e.querySelectorAll(".tooth-grid-letter-item.selected");if(u.length>0){const h=u[u.length-1];this.finallyAdd={position:h.dataset.position||"",value:h.dataset.value||""}}else this.finallyAdd=null}const d=n();d!==null?t=d:t=null,t==="letter"&&e.querySelectorAll(".tooth-grid-number-item.selected").forEach(h=>h.classList.remove("selected")),i(),this.updateExtraPanelSelection(),this.updatePreview()})})}updatePreview(){const e=this.inputModal;if(!e)return;const t=this.collectData(e);this.drawPreview(t)}collectData(e){const t={upperLeft:[],upperRight:[],lowerLeft:[],lowerRight:[],upperLeftLetter:[],upperRightLetter:[],lowerLeftLetter:[],lowerRightLetter:[]};return["upperLeft","upperRight","lowerLeft","lowerRight"].forEach(r=>{e.querySelectorAll(`.tooth-grid-number-item[data-position="${r}"].selected`).forEach(l=>{const a=parseInt(l.dataset.value||"0");a>0&&t[r].push(a)})}),["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"].forEach(r=>{e.querySelectorAll(`.tooth-grid-letter-item[data-position="${r}"].selected`).forEach(l=>{const a=l.dataset.value;a&&t[r].push(a)})}),this.finallyAdd&&(t.finallyAdd=this.finallyAdd),Object.keys(this.toothSurfaceMap).length>0&&(t.toothSurfaceMap={...this.toothSurfaceMap}),Object.keys(this.supernumeraryToothMap).length>0&&(t.supernumeraryToothMap={...this.supernumeraryToothMap}),t}drawPreview(e){const t=this.inputModal?.querySelector(".tooth-preview-grid");if(!t)return;const n=(d,u)=>`${d}-${u}`,i=(d,u)=>{const h=n(d,u),R=this.toothSurfaceMap[h]||[],g=zr.filter(S=>R.includes(S)),m=this.supernumeraryToothMap[h],f=u.toString(),I=typeof u=="string"?"tooth-preview-tooth-value tooth-preview-tooth-value--deciduous":"tooth-preview-tooth-value",L=g.length>0?`<sup class="tooth-preview-surface">${g.join(",")}</sup>`:"";if(m){const S='<sup class="tooth-preview-supernumerary">S</sup>';return m==="Si"?`<span class="tooth-preview-tooth">
491
+ <span class="tooth-preview-tooth-bracket">(</span>
492
+ ${S}
493
+ <span class="${I}">${f}</span>
494
+ <span class="tooth-preview-tooth-bracket">)</span>
495
+ ${L}
496
+ </span>`:`<span class="tooth-preview-tooth">
497
+ <span class="tooth-preview-tooth-bracket">(</span>
498
+ <span class="${I}">${f}</span>
499
+ ${S}
500
+ <span class="tooth-preview-tooth-bracket">)</span>
501
+ ${L}
502
+ </span>`}else return`<span class="tooth-preview-tooth">
503
+ <span class="${I}">${f}</span>
504
+ ${L}
505
+ </span>`},r=(d,u,h)=>{const R=[];return u.forEach(g=>{R.push(i(h,g))}),d.forEach(g=>{R.push(i(h,g))}),R.join(" ")},s=t.querySelector(".tooth-preview-upper-left"),l=t.querySelector(".tooth-preview-upper-right"),a=t.querySelector(".tooth-preview-lower-left"),c=t.querySelector(".tooth-preview-lower-right");s&&(s.innerHTML=r(e?.upperLeft||[],e?.upperLeftLetter||[],"upperLeft")),l&&(l.innerHTML=r(e?.upperRight||[],e?.upperRightLetter||[],"upperRight")),a&&(a.innerHTML=r(e?.lowerLeft||[],e?.lowerLeftLetter||[],"lowerLeft")),c&&(c.innerHTML=r(e?.lowerRight||[],e?.lowerRightLetter||[],"lowerRight"))}bindExtraPanelEvents(){const e=this.inputModal;if(!e)return;e.querySelectorAll(".tooth-surface-item").forEach(i=>{i.addEventListener("click",()=>{if(!this.finallyAdd)return;const r=i.dataset.surface;if(!r)return;const s=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.toothSurfaceMap[s]||(this.toothSurfaceMap[s]=[]);const l=this.toothSurfaceMap[s],a=l.indexOf(r);a>-1?(l.splice(a,1),i.classList.remove("selected")):(l.push(r),i.classList.add("selected")),this.updatePreview()})}),e.querySelectorAll(".tooth-supernumerary-item").forEach(i=>{i.addEventListener("click",()=>{if(!this.finallyAdd)return;const r=i.dataset.supernumerary;if(!r)return;const s=`${this.finallyAdd.position}-${this.finallyAdd.value}`;this.supernumeraryToothMap[s]===r?(delete this.supernumeraryToothMap[s],i.classList.remove("selected")):(e.querySelectorAll(".tooth-supernumerary-item").forEach(l=>l.classList.remove("selected")),this.supernumeraryToothMap[s]=r,i.classList.add("selected")),this.updatePreview()})}),this.updateExtraPanelSelection()}updateExtraPanelSelection(){const e=this.inputModal;if(!e||!this.finallyAdd)return;const t=`${this.finallyAdd.position}-${this.finallyAdd.value}`,n=this.toothSurfaceMap[t]||[];e.querySelectorAll(".tooth-surface-item").forEach(r=>{const s=r.dataset.surface;n.includes(s||"")?r.classList.add("selected"):r.classList.remove("selected")});const i=this.supernumeraryToothMap[t];e.querySelectorAll(".tooth-supernumerary-item").forEach(r=>{r.dataset.supernumerary===i?r.classList.add("selected"):r.classList.remove("selected")})}}const ba='(function(){"use strict";function f(i){let s="",n=0;for(;n<i.length;){const t=i[n];if(t.type==="table"){if(t.trList)for(let l=0;l<t.trList.length;l++){const o=t.trList[l];for(let e=0;e<o.tdList.length;e++){const r=o.tdList[e];s+=f(r.value)}}}else if(t.type==="hyperlink"){const l=t.hyperlinkId,o=[];for(;n<i.length;){const e=i[n];if(l!==e.hyperlinkId){n--;break}delete e.type,o.push(e),n++}s+=f(o)}else if(t.controlId){if(!t.control?.hide){const l=t.controlId,o=[];for(;n<i.length;){const e=i[n];if(l!==e.controlId){n--;break}e.controlComponent==="value"&&(delete e.controlId,o.push(e)),n++}s+=f(o)}}else(!t.type||t.type==="text")&&!t.area?.hide&&(s+=t.value);n++}return s}function p(i){const s=[],n=/[0-9]/,t=/[A-Za-z]/,l=/\\s/;let o=!1,e=!1,r="";function a(){r&&(s.push(r),r="")}for(const c of i)t.test(c)?(o||a(),r+=c,o=!0,e=!1):n.test(c)?(e||a(),r+=c,o=!1,e=!0):(a(),o=!1,e=!1,l.test(c)||s.push(c));return a(),s}onmessage=i=>{const s=i.data,t=f(s).replace(new RegExp("^​"),"").replace(new RegExp("​","g"),`\n`),l=p(t);postMessage(l.length)}})();\n',$r=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",ba],{type:"text/javascript;charset=utf-8"});function kp(o){let e;try{if(e=$r&&(self.URL||self.webkitURL).createObjectURL($r),!e)throw"";const t=new Worker(e,{name:o?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(ba),{name:o?.name})}}const ya=`(function(){"use strict";const v={first:1,second:2,third:3,fourth:4,fifth:5,sixth:6},E=["text","hyperlink","subscript","superscript","control","date","label"],L="​";function m(c){return!c.type||E.includes(c.type)}function I(c){const{elementList:r,positionList:d}=c,p=[];let u=0;for(;u<r.length;){const t=r[u],l=(e,n,s)=>{const g=e.titleId,a={type:"title",value:"",level:e.level,titleId:g,pageNo:d[u].pageNo},o=[];for(;s<n.length;){const i=n[s];if(g!==i.titleId){s--;break}o.push(i),s++}return a.value=o.filter(i=>m(i)).map(i=>i.value).join("").replace(new RegExp(L,"g"),""),{position:s,titleElement:a}};if(t.titleId){const{position:e,titleElement:n}=l(t,r,u);u=e,p.push(n)}if(t.type==="table"){const e=t.trList;for(let n=0;n<e.length;n++){const s=e[n];for(let g=0;g<s.tdList.length;g++){const a=s.tdList[g].value;if(a.length>1){let o=1;for(;o<a.length;){if(a[o]?.titleId){const{titleElement:i,position:N}=l(a[o],a,o);p.push(i),o=N}o++}}}}}u++}if(!p.length)return null;const f=(t,l)=>{const e=l.subCatalog[l.subCatalog.length-1],n=v[e?.level],s=v[t.level];e&&s>n?f(t,e):l.subCatalog.push({id:t.titleId,name:t.value,level:t.level,pageNo:t.pageNo,subCatalog:[]})},h=[];for(let t=0;t<p.length;t++){const l=p[t],e=h[h.length-1],n=v[e?.level],s=v[l.level];e&&s>n?f(l,e):h.push({id:l.titleId,name:l.value,level:l.level,pageNo:l.pageNo,subCatalog:[]})}return h}onmessage=c=>{const r=c.data,d=I(r);postMessage(d)}})();
506
+ `,qr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",ya],{type:"text/javascript;charset=utf-8"});function Gp(o){let e;try{if(e=qr&&(self.URL||self.webkitURL).createObjectURL(qr),!e)throw"";const t=new Worker(e,{name:o?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(ya),{name:o?.name})}}const xa=`(function(){"use strict";function u(e){const t=[];for(const s of e){if(s.type==="table"){const o=s.trList;for(let n=0;n<o.length;n++){const c=o[n];for(let r=0;r<c.tdList.length;r++){const i=c.tdList[r];t.push(...u(i.value))}}}if(s.groupIds)for(const o of s.groupIds)t.includes(o)||t.push(o)}return t}onmessage=e=>{const t=e.data,s=u(t);postMessage(s)}})();
507
+ `,jr=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",xa],{type:"text/javascript;charset=utf-8"});function Jp(o){let e;try{if(e=jr&&(self.URL||self.webkitURL).createObjectURL(jr),!e)throw"";const t=new Worker(e,{name:o?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(xa),{name:o?.name})}}const va='(function(){"use strict";var m=(e=>(e.HALF="half",e.ONE_THIRD="one-third",e.QUARTER="quarter",e))(m||{}),M=(e=>(e.ARABIC="arabic",e.CHINESE="chinese",e))(M||{});const K="​";m.HALF+"",1/2,m.ONE_THIRD+"",1/3,m.QUARTER+"",1/4;function F(e){if(typeof structuredClone=="function")return structuredClone(e);if(!e||typeof e!="object")return e;let I={};return Array.isArray(e)?I=e.map(f=>F(f)):Object.keys(e).forEach(f=>{I[f]=F(e[f])}),I}function D(e,I){const f={};for(const L in e)I.includes(L)&&(f[L]=e[L]);return f}function ee(e,I){return e.length!==I.length?!1:!e.some(f=>!I.includes(f))}var o=(e=>(e.TEXT="text",e.TEXTFIELD="TextField",e.BUTTON="button",e.IMAGE="image",e.TABLE="table",e.HYPERLINK="hyperlink",e.SUPERSCRIPT="superscript",e.SUBSCRIPT="subscript",e.SEPARATOR="separator",e.PAGE_BREAK="pageBreak",e.CONTROL="control",e.AREA="area",e.CHECKBOX="checkbox",e.RADIO="radio",e.LATEX="latex",e.TAB="tab",e.DATE="date",e.BLOCK="block",e.TITLE="title",e.LIST="list",e.SPLIT_TAG="splitTag",e.LABEL="label",e.MENSTRUAL_HISTORY="menstrualHistory",e.FETAL_HEART_POSITION="fetalHeartPosition",e.TOOTH_POSITION="toothPosition",e.SPECIAL_SYMBOLS="specialSymbols",e.MACRO="macro",e.CUSTOM_MACRO="customMacro",e.REUSABLE_ITEM="reusableItem",e))(o||{});const y=["rowFlex","rowMargin"],te=["type","font","size","bold","color","italic","highlight","underline","strikeout","rowFlex","rowMargin","dashArray","trList","tdPadding","tableToolDisabled","borderType","borderColor","borderWidth","borderExternalWidth","translateX","width","height","url","colgroup","valueList","control","checkbox","radio","dateFormat","block","level","title","listType","listStyle","listWrap","groupIds","conceptId","imgDisplay","imgFloatPosition","imgToolDisabled","imgPreviewDisabled","imgCrop","imgCaption","textDecoration","extension","externalId","areaId","area","hide","label","labelId","lineWidth","deletePerson","newElEditPerson","deleteTime","newElEditTime","dictCode","macroConfig","menstrualData","menstrualHistoryId","fetalHeartData","fetalHeartPositionId","toothPositionData","toothPositionId","reusableItemConfig"],oe=["conceptId","extension","externalId","verticalAlign","backgroundColor","borderTypes","slashTypes","disabled","deletable"],w=["font","size","bold","highlight","italic","strikeout","deletePerson","newElEditPerson","deleteTime","color","newElEditTime"];o.TEXT,o.HYPERLINK,o.SUBSCRIPT,o.SUPERSCRIPT,o.CONTROL,o.DATE,o.IMAGE,o.LATEX,o.BLOCK,o.PAGE_BREAK,o.SEPARATOR,o.TABLE,o.TITLE,o.LIST;var Y=(e=>(e.UL="ul",e.OL="ol",e))(Y||{}),k=(e=>(e.DISC="disc",e.CIRCLE="circle",e.SQUARE="square",e.CHECKBOX="checkbox",e))(k||{}),_=(e=>(e.DISC="disc",e.CIRCLE="circle",e.SQUARE="square",e.DECIMAL="decimal",e.CHECKBOX="checkbox",e))(_||{});k.DISC+"",k.CIRCLE+"",k.SQUARE+"",k.CHECKBOX+"",Y.OL+"",Y.UL+"",_.DISC+"",_.CIRCLE+"",_.SQUARE+"",_.DECIMAL+"",_.CHECKBOX+"";var R=(e=>(e.FIRST="first",e.SECOND="second",e.THIRD="third",e.FOURTH="fourth",e.FIFTH="fifth",e.SIXTH="sixth",e))(R||{});R.FIRST+"",R.SECOND+"",R.THIRD+"",R.FOURTH+"",R.FIFTH+"",R.SIXTH+"",R.FIRST+"",R.SECOND+"",R.THIRD+"",R.FOURTH+"",R.FIFTH+"",R.SIXTH+"",R.FIRST,R.SECOND,R.THIRD,R.FOURTH,R.FIFTH,R.SIXTH;var v=(e=>(e.TEXT="text",e.SELECT="select",e.CHECKBOX="checkbox",e.RADIO="radio",e.DATE="date",e.NUMBER="number",e.TEXTFIELD="TextField",e.BUTTON="button",e.MENSTRUAL_HISTORY="menstrualHistory",e))(v||{}),c=(e=>(e.PREFIX="prefix",e.POSTFIX="postfix",e.PRE_TEXT="preText",e.PRETEXTFIX="preTextFix",e.PRETEXTFIX_TEXT="preTextFixText",e.POSTTEXTFIX="postTextFix",e.POSTTEXTFIX_TEXT="postTextFixText",e.POST_TEXT="postText",e.PLACEHOLDER="placeholder",e.TEXTFIXLABEL="textFixLabel",e.VALUE="value",e.DELETEPERSON="deletePerson",e.CHECKBOX="checkbox",e.RADIO="radio",e.UNDERLINE="underline",e))(c||{}),Q=(e=>(e.LEFT="left",e.CENTER="center",e.RIGHT="right",e.ALIGNMENT="alignment",e.JUSTIFY="justify",e))(Q||{}),q=(e=>(e.CONTAIN="contain",e.COVER="cover",e))(q||{}),W=(e=>(e.REPEAT="repeat",e.NO_REPEAT="no-repeat",e.REPEAT_X="repeat-x",e.REPEAT_Y="repeat-y",e))(W||{});q.COVER,W.NO_REPEAT;var z=(e=>(e.TOP="top",e.MIDDLE="middle",e.BOTTOM="bottom",e))(z||{});z.BOTTOM,m.HALF,m.HALF,Q.CENTER,M.ARABIC,z.BOTTOM;var Z=(e=>(e.TEXT="text",e.IMAGE="image",e))(Z||{});Z.TEXT,M.ARABIC;var j=(e=>(e.PAGE="page",e.CONTINUITY="continuity",e))(j||{});j.CONTINUITY;function ne(e,I){const f=Object.keys(e),L=Object.keys(I);if(f.length!==L.length)return!1;for(let S=0;S<f.length;S++){const p=f[S];if(p!=="value"&&!(p==="groupIds"&&Array.isArray(e[p])&&Array.isArray(I[p])&&ee(e[p],I[p]))&&e[p]!==I[p])return!1}return!0}function N(e,I={}){const{extraPickAttrs:f}=I,L=[...te];f&&L.push(...f);const S={value:e?.value===K?`\n`:e?.value};return e&&L.forEach(p=>{const T=e[p];T!==void 0&&(S[p]=T)}),S}function P(e,I={}){const{extraPickAttrs:f,isClassifyArea:L=!1,isClone:S=!0,editorOptions:p}=I,T=(S?F(e):e).filter(t=>t.type!==o.SPLIT_TAG),B=[];let l=0;for(;l<T.length;){let t=T[l];if(l===0&&t.value===K&&!t.listId&&(!t.type||t.type===o.TEXT)){l++;continue}if(t.areaId){const r=t.areaId,O=t.area,E=[];for(;l<T.length;){const i=T[l];if(r!==i.areaId){l--;break}delete i.area,delete i.areaId,E.push(i),l++}const a=P(E,I);if(L){const i={type:o.AREA,value:"",areaId:r,area:O};i.valueList=a,t=i}else{B.splice(l,0,...a);continue}}else if(t.titleId&&t.level){const r=t.titleId;if(r){const O=t.level,E={type:o.TITLE,title:t.title,titleId:r,value:"",level:O},a=[];for(;l<T.length;){const i=T[l];if(r!==i.titleId){l--;break}delete i.level,delete i.title,a.push(i),l++}E.valueList=P(a,I),t=E}}else if(t.listId&&t.listType){const r=t.listId;if(r){const O=t.listType,E=t.listStyle,a=t?.label,i={type:o.LIST,value:"",label:a||"",listId:r,listType:O,listStyle:E},d=[];for(;l<T.length;){const s=T[l];if(r!==s.listId){l--;break}delete s.listType,delete s.listStyle,d.push(s),l++}i.valueList=P(d,I),t=i}}else if(t.type===o.TABLE){if(t.pagingId){let r=l+1,O=0;for(;r<T.length;){const E=T[r];if(E.pagingId===t.pagingId){t.height+=E.height;const a=E.trList.filter(i=>!i.pagingRepeat).filter(i=>(i.tdList=i.tdList.filter(d=>{if(d.originalId){for(let s=0;s<t.trList.length;s++){const u=t.trList[s].tdList.find(({id:n})=>n===d.originalId);if(u){d.value[0]?.type===o.SPLIT_TAG&&d.value.splice(0,1),u.value.push(...d.value),u.rowspan=u.originalRowspan??u.rowspan;break}}return!1}return!0}),!i.originalId));t.trList.push(...a),t.trList?.forEach(i=>i.minHeight=i.originalMinHeight??i.minHeight),r++,O++}else break}l+=O}if(t.trList)for(let r=0;r<t.trList.length;r++){const O=t.trList[r];delete O.id;for(let E=0;E<O.tdList.length;E++){const a=O.tdList[E],i={colspan:a.colspan,rowspan:a.rowspan,value:P(a.value,{...I,isClassifyArea:!1})};oe.forEach(d=>{const s=a[d];s!==void 0&&(i[d]=s)}),O.tdList[E]=i}}}else if(t.type===o.HYPERLINK){const r=t.hyperlinkId;if(r){const O={type:o.HYPERLINK,value:"",url:t.url},E=[];for(;l<T.length;){const a=T[l];if(r!==a.hyperlinkId){l--;break}delete a.type,delete a.url,E.push(a),l++}O.valueList=P(E,I),t=O}}else if(t.type===o.DATE){const r=t.dateId;if(r){const O={type:o.DATE,value:"",dateFormat:t.dateFormat},E=[];for(;l<T.length;){const a=T[l];if(r!==a.dateId){l--;break}delete a.type,delete a.dateFormat,E.push(a),l++}O.valueList=P(E,I),t=O}}else if(t.type!==o.BUTTON){if(t.controlId){const r=t.controlId;if(!(t.controlComponent===c.PREFIX||t.controlComponent===c.PRETEXTFIX||t.controlComponent===c.PRETEXTFIX_TEXT)&&t.controlComponent===c.VALUE){if(t.type===o.MENSTRUAL_HISTORY||t.type===o.FETAL_HEART_POSITION||t.type===o.TOOTH_POSITION||t.type===o.MACRO||t.type===o.CUSTOM_MACRO||t.type===o.REUSABLE_ITEM||t.type===o.LIST||t.type===o.SPECIAL_SYMBOLS){let d=!1;for(let s=l-1;s>=0;s--){const C=T[s],u=C.controlComponent===c.PREFIX||C.controlComponent===c.PRETEXTFIX||C.controlComponent===c.PRETEXTFIX_TEXT;if(C.controlId===r&&u){d=!0;break}if(C.controlId!==r)break}if(!d){const s=F(t);delete s.controlId,delete s.control,delete s.controlComponent,delete s.originControlId,B.push(s),l++;continue}}l++;continue}if(t.controlComponent===c.PLACEHOLDER||t.controlComponent===c.POSTFIX||t.controlComponent===c.POSTTEXTFIX||t.controlComponent===c.POSTTEXTFIX_TEXT||t.controlComponent===c.POST_TEXT||t.controlComponent===c.PRE_TEXT||t.controlComponent===c.CHECKBOX||t.controlComponent===c.RADIO){l++;continue}const E=(i,d,s,C)=>{if(C===v.CHECKBOX||C===v.RADIO){let n=-1;for(let g=i;g<T.length&&T[g].controlId===d;g++)n=g;return n}const u=s?[c.POSTTEXTFIX,c.POSTTEXTFIX_TEXT]:[c.POSTFIX];for(let n=i;n<T.length;n++){const g=T[n];if(g.controlId===d&&u.includes(g.controlComponent))return n}return-1},a=(i,d,s)=>{const C=[];let u=i;for(;u<=d;){const n=T[u];if(n.controlId&&n.controlId!==s&&n.control){const A=n.control?.type,x=A===v.TEXTFIELD,h=x?c.PRETEXTFIX:c.PREFIX,H=n.controlComponent===h,b=A===v.CHECKBOX||A===v.RADIO;if(H||b&&(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO)){const X=E(u+1,n.controlId,x,A);if(X!==-1){const V=T.slice(u,X+1).map(le=>{const $=F(le);return delete $.originControlId,$}),U=P(V,I);U.length>0&&C.push(U[0]),u=X+1;continue}}}if(!(n.controlId===s&&(n.controlComponent===c.VALUE||!n.controlComponent)&&(!n.originControlId||n.originControlId===s)||n.originControlId===s&&n.controlComponent===c.VALUE||n.controlId===s&&(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO)&&!n.originControlId)){u++;continue}if(n.type===o.MENSTRUAL_HISTORY||n.type===o.FETAL_HEART_POSITION||n.type===o.TOOTH_POSITION||n.type===o.MACRO||n.type===o.CUSTOM_MACRO||n.type===o.REUSABLE_ITEM||n.type===o.LIST||n.type===o.SPECIAL_SYMBOLS){const A=F(n);delete A.controlId,delete A.control,delete A.controlComponent,delete A.originControlId,C.push(A),u++;continue}if(n.controlComponent===c.CHECKBOX||n.controlComponent===c.RADIO){C.push(F(n)),u++;continue}const J=t.control?.type;if(J===v.CHECKBOX||J===v.RADIO){let A=u-1,x=!1;for(;A>=i-1;){const h=T[A];if(h.controlId===s&&!h.originControlId)if(h.controlComponent===c.CHECKBOX){x=h.checkbox?.value===!0;break}else if(h.controlComponent===c.RADIO){x=h.radio?.value===!0;break}else if(h.controlComponent===c.VALUE){A--;continue}else break;A--}if(x){const h={value:n.value||""},H=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const b of H){const X=n[b];if(X!==void 0){if(b==="color"&&p){const V=p.control?.bracketColor,U=p.control?.placeholderColor;if(X===V||X===U)continue}h[b]=X}}C.push(h)}}else{const A={value:n.value||""},x=[...y,"color","bold","italic","underline","strikeout","size","font","highlight","textDecoration"];for(const h of x){const H=n[h];if(H!==void 0){if(h==="color"&&p){const b=p.control?.bracketColor,X=p.control?.placeholderColor;if(H===b||H===X)continue}A[h]=H}}C.push(A)}u++}return C};if(t.controlComponent===c.PREFIX){const i=t.control?.type===v.TEXTFIELD,d=E(l+1,r,i);if(d!==-1){const s=a(l+1,d-1,r),C=D(t,w),u={...t.control,...C,value:s},n={...D(t,y),type:o.CONTROL,value:"",control:u,controlId:r};t=N(n,{extraPickAttrs:f}),l=d}}if(t.controlComponent===c.PRETEXTFIX){const i=E(l+1,r,!0);if(i!==-1){const d=a(l+1,i-1,r),s=D(t,w),C={...t.control,...s,value:d},u={...D(t,y),type:o.CONTROL,value:"",control:C,controlId:r};t=N(u,{extraPickAttrs:f}),l=i}}if(t.controlComponent===c.PRETEXTFIX_TEXT){const i=E(l+1,r,!0);if(i!==-1){const d=a(l+1,i-1,r),s=D(t,w),C={...t.control,...s,value:d},u={...D(t,y),type:o.CONTROL,value:"",control:C,controlId:r};t=N(u,{extraPickAttrs:f}),l=i}}}}const G=N(t,{extraPickAttrs:f});if(!t.type||t.type===o.TEXT||t.type===o.SUBSCRIPT||t.type===o.SUPERSCRIPT)for(;l<T.length;){const r=T[l+1];if(l++,r&&ne(G,N(r,{extraPickAttrs:f}))){const O=r.value===K?`\n`:r.value;G.value+=O}else break}else l++;B.push(G)}return B}onmessage=e=>{const I=e.data,{options:f,data:L}=I,{extraPickAttrs:S=[]}=f||{},p={header:P(L.header,{extraPickAttrs:S,isClone:!1}),main:P(L.main,{extraPickAttrs:S,isClassifyArea:!0,isClone:!1}),footer:P(L.footer,{extraPickAttrs:S,isClone:!1})};postMessage(p)}})();\n',el=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",va],{type:"text/javascript;charset=utf-8"});function Bp(o){let e;try{if(e=el&&(self.URL||self.webkitURL).createObjectURL(el),!e)throw"";const t=new Worker(e,{name:o?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(va),{name:o?.name})}}class zp{draw;wordCountWorker;catalogWorker;groupWorker;valueWorker;constructor(e){this.draw=e,this.wordCountWorker=new kp,this.catalogWorker=new Gp,this.groupWorker=new Jp,this.valueWorker=new Bp}getWordCount(){return new Promise((e,t)=>{this.wordCountWorker.onmessage=i=>{e(i.data)},this.wordCountWorker.onerror=i=>{t(i)};const n=this.draw.getOriginalMainElementList();this.wordCountWorker.postMessage(n)})}getCatalog(){return new Promise((e,t)=>{this.catalogWorker.onmessage=r=>{e(r.data)},this.catalogWorker.onerror=r=>{t(r)};const n=this.draw.getOriginalMainElementList(),i=this.draw.getPosition().getOriginalMainPositionList();this.catalogWorker.postMessage({elementList:n,positionList:i})})}getGroupIds(){return new Promise((e,t)=>{this.groupWorker.onmessage=i=>{e(i.data)},this.groupWorker.onerror=i=>{t(i)};const n=this.draw.getOriginalMainElementList();this.groupWorker.postMessage(n)})}getValue(e){return new Promise((t,n)=>{this.valueWorker.onmessage=i=>{t({version:Os,data:i.data,options:xe(this.draw.getOptions())})},this.valueWorker.onerror=i=>{n(i)},this.valueWorker.postMessage({data:this.draw.getOriginValue(e),options:e})})}}class $p{container;canvas;draw;options;curElement;curElementSrc;previewerDrawOption;curPosition;eventBus;imageList;curShowElement;imageCount;imagePre;imageNext;resizerSelection;resizerHandleList;resizerImageContainer;resizerImage;resizerSize;width;height;mousedownX;mousedownY;curHandleIndex;previewerContainer;previewerImage;constructor(e){this.container=e.getContainer(),this.canvas=e.getPage(),this.draw=e,this.options=e.getOptions(),this.curElement=null,this.curElementSrc="",this.previewerDrawOption={},this.curPosition=null,this.eventBus=e.getEventBus(),this.imageList=[],this.curShowElement=null,this.imageCount=null,this.imagePre=null,this.imageNext=null;const{resizerSelection:t,resizerHandleList:n,resizerImageContainer:i,resizerImage:r,resizerSize:s}=this._createResizerDom();this.resizerSelection=t,this.resizerHandleList=n,this.resizerImageContainer=i,this.resizerImage=r,this.resizerSize=s,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.previewerContainer=null,this.previewerImage=null}_getElementPosition(e,t=null){const{scale:n}=this.options;let i=0,r=0;const s=this.draw.getHeight(),l=this.draw.getPageGap(),c=(t?.pageNo??this.draw.getPageNo())*(s+l);if(e.imgFloatPosition)i=e.imgFloatPosition.x*n,r=e.imgFloatPosition.y*n+c;else if(t){const{coordinate:{leftTop:[d,u]},ascent:h}=t;i=d,r=u+c+h}return{x:i,y:r}}_createResizerDom(){const{scale:e}=this.options,t=document.createElement("div");t.classList.add(`${re}-resizer-selection`),t.style.display="none",t.style.borderColor=this.options.resizerColor,t.style.borderWidth=`${e}px`;const n=[];for(let a=0;a<8;a++){const c=document.createElement("div");c.style.background=this.options.resizerColor,c.classList.add("resizer-handle"),c.classList.add(`handle-${a}`),c.setAttribute("data-index",String(a)),c.onmousedown=this._mousedown.bind(this),t.append(c),n.push(c)}this.container.append(t);const i=document.createElement("div");i.classList.add(`${re}-resizer-size-view`);const r=document.createElement("span");i.append(r),t.append(i);const s=document.createElement("div");s.classList.add(`${re}-resizer-image`),s.style.display="none";const l=document.createElement("img");return s.append(l),this.container.append(s),{resizerSelection:t,resizerHandleList:n,resizerImageContainer:s,resizerImage:l,resizerSize:r}}_keydown=()=>{this.resizerSelection.style.display==="block"&&(this.clearResizer(),document.removeEventListener("keydown",this._keydown))};_mousedown(e){if(this.canvas=this.draw.getPage(),!this.curElement)return;const{scale:t}=this.options;this.mousedownX=e.x,this.mousedownY=e.y;const n=e.target;this.curHandleIndex=Number(n.dataset.index);const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,this.canvas.style.cursor=i,this.resizerImage.src=this.curElementSrc,this.resizerImageContainer.style.display="block";const{x:r,y:s}=this._getElementPosition(this.curElement,this.curPosition);this.resizerImageContainer.style.left=`${r}px`,this.resizerImageContainer.style.top=`${s}px`,this.resizerImage.style.width=`${this.curElement.width*t}px`,this.resizerImage.style.height=`${this.curElement.height*t}px`;const l=this._mousemove.bind(this);document.addEventListener("mousemove",l),document.addEventListener("mouseup",()=>{this.curElement&&!this.previewerDrawOption.dragDisable&&(this.curElement.width=this.width,this.curElement.height=this.height,this.draw.render({isSetCursor:!0,curIndex:this.curPosition?.index})),this.resizerImageContainer.style.display="none",document.removeEventListener("mousemove",l),document.body.style.cursor="",this.canvas.style.cursor="text"},{once:!0}),e.preventDefault()}_mousemove(e){if(!this.curElement||this.previewerDrawOption.dragDisable)return;const{scale:t}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const c=this.mousedownX-e.x,d=this.mousedownY-e.y;n=Math.cbrt(c**3+d**3),i=this.curElement.height*n/this.curElement.width}break;case 1:i=this.mousedownY-e.y;break;case 2:{const c=e.x-this.mousedownX,d=this.mousedownY-e.y;n=Math.cbrt(c**3+d**3),i=this.curElement.height*n/this.curElement.width}break;case 4:{const c=e.x-this.mousedownX,d=e.y-this.mousedownY;n=Math.cbrt(c**3+d**3),i=this.curElement.height*n/this.curElement.width}break;case 3:n=e.x-this.mousedownX;break;case 5:i=e.y-this.mousedownY;break;case 6:{const c=this.mousedownX-e.x,d=e.y-this.mousedownY;n=Math.cbrt(c**3+d**3),i=this.curElement.height*n/this.curElement.width}break;case 7:n=this.mousedownX-e.x;break}const r=this.curElement.width+n/t,s=this.curElement.height+i/t;if(r<=0||s<=0)return;this.width=r,this.height=s;const l=r*t,a=s*t;this.resizerImage.style.width=`${l}px`,this.resizerImage.style.height=`${a}px`,this._updateResizerRect(l,a),this._updateResizerSizeView(l,a),e.preventDefault(),this.eventBus.isSubscribe("imageSizeChange")&&this.eventBus.emit("imageSizeChange",{element:this.curElement})}_drawPreviewer(){const e=document.createElement("div");e.classList.add(`${re}-image-previewer`);const t=document.createElement("i");t.classList.add("image-close"),t.onclick=()=>{this._clearPreviewer()},e.append(t);const n=document.createElement("div");n.classList.add(`${re}-image-container`);const i=document.createElement("img");i.src=this.curElementSrc,i.draggable=!1,n.append(i),this.previewerImage=i,e.append(n);let r=0,s=0,l=1,a=0;const c=document.createElement("div");c.classList.add(`${re}-image-menu`);const d=document.createElement("div");d.classList.add("image-navigate");const u=document.createElement("i");u.classList.add("image-pre"),u.onclick=()=>{const X=this.imageList.findIndex(x=>x.id===this.curShowElement?.id);X<=0||(this.curShowElement=this.imageList[X-1],i.src=this.curShowElement.value,this._updateImageNavigate())},d.append(u),this.imagePre=u;const h=document.createElement("span");h.classList.add("image-count"),this.imageCount=h,d.append(h);const R=document.createElement("i");R.classList.add("image-next"),R.onclick=()=>{const X=this.imageList.findIndex(x=>x.id===this.curShowElement?.id);X>=this.imageList.length-1||(this.curShowElement=this.imageList[X+1],i.src=this.curShowElement.value,this._updateImageNavigate())},this.imageNext=R,d.append(R),c.append(d);const g=document.createElement("i");g.classList.add("zoom-in"),g.onclick=()=>{l+=.1,this._setPreviewerTransform(l,a,r,s)},c.append(g);const m=document.createElement("i");m.onclick=()=>{l-.1<=.1||(l-=.1,this._setPreviewerTransform(l,a,r,s))},m.classList.add("zoom-out"),c.append(m);const f=document.createElement("i");f.classList.add("rotate"),f.onclick=()=>{a+=1,this._setPreviewerTransform(l,a,r,s)},c.append(f);const T=document.createElement("i");T.classList.add("original-size"),T.onclick=()=>{r=0,s=0,l=1,a=0,this._setPreviewerTransform(l,a,r,s)},c.append(T);const I=document.createElement("i");I.classList.add("image-download"),I.onclick=()=>{const{mime:X}=this.previewerDrawOption;pl(i.src,`${this.curElement?.id}.${X||"png"}`)},c.append(I),e.append(c),this.previewerContainer=e,document.body.append(e);let L=0,S=0,M=!1;i.onmousedown=X=>{M=!0,L=X.x,S=X.y,e.style.cursor="move"},e.onmousemove=X=>{M&&(r+=X.x-L,s+=X.y-S,L=X.x,S=X.y,this._setPreviewerTransform(l,a,r,s))},e.onmouseup=()=>{M=!1,e.style.cursor="auto"},e.onwheel=X=>{if(X.preventDefault(),X.stopPropagation(),X.deltaY<0)l+=.1;else{if(l-.1<=.1)return;l-=.1}this._setPreviewerTransform(l,a,r,s)},this._updateImageNavigate()}_updateImageNavigate(){const e=this.imageList.findIndex(t=>t.id===this.curShowElement?.id);this.imageCount.innerText=`${e+1} / ${this.imageList.length}`,e<=0?this.imagePre.classList.add("disabled"):this.imagePre.classList.remove("disabled"),e>=this.imageList.length-1?this.imageNext.classList.add("disabled"):this.imageNext.classList.remove("disabled")}_setPreviewerTransform(e,t,n,i){this.previewerImage&&(this.previewerImage.style.left=`${n}px`,this.previewerImage.style.top=`${i}px`,this.previewerImage.style.transform=`scale(${e}) rotate(${t*90}deg)`)}_clearPreviewer(){this.previewerContainer?.remove(),this.previewerContainer=null,document.body.style.overflow="auto"}_updateResizerRect(e,t){const{resizerSize:n,scale:i}=this.options,r=this.draw.isReadonly();this.resizerSelection.style.width=`${e}px`,this.resizerSelection.style.height=`${t}px`;for(let s=0;s<8;s++){const l=s===0||s===6||s===7?-n:s===1||s===5?e/2:e-n,a=s===0||s===1||s===2?-n:s===3||s===7?t/2-n:t-n;this.resizerHandleList[s].style.transform=`scale(${i})`,this.resizerHandleList[s].style.left=`${l}px`,this.resizerHandleList[s].style.top=`${a}px`,this.resizerHandleList[s].style.display=r?"none":"block"}}_updateResizerSizeView(e,t){this.resizerSize.innerText=`${Math.round(e)} × ${Math.round(t)}`}render(){const e=this.draw.getMode();!this.curElement||this.curElement.imgToolDisabled&&!this.draw.isDesignMode()||e===B.PRINT&&this.options.modeRule[B.PRINT]?.imagePreviewerDisabled||e===B.READONLY&&this.options.modeRule[B.READONLY]?.imagePreviewerDisabled||(this.imageList=this.draw.getImageParticle().getOriginalMainImageList(),this.curShowElement=this.curElement,this._drawPreviewer(),document.body.style.overflow="hidden")}drawResizer(e,t=null,n={}){const i=this.draw.getMode();e.imgToolDisabled&&!this.draw.isDesignMode()||i===B.PRINT&&this.options.modeRule[B.PRINT]?.imagePreviewerDisabled||i===B.READONLY&&this.options.modeRule[B.READONLY]?.imagePreviewerDisabled||(this.previewerDrawOption=n,this.curElementSrc=e[n.srcKey||"value"]||"",this.updateResizer(e,t),document.addEventListener("keydown",this._keydown))}updateResizer(e,t=null){const{scale:n}=this.options,i=e.width*n,r=e.height*n;this._updateResizerSizeView(i,r);const{x:s,y:l}=this._getElementPosition(e,t);this.resizerSelection.style.left=`${s}px`,this.resizerSelection.style.top=`${l}px`,this.resizerSelection.style.borderWidth=`${n}px`,this._updateResizerRect(i,r),this.resizerSelection.style.display="block",this.curElement=e,this.curPosition=t,this.width=i,this.height=r}clearResizer(){this.resizerSelection.style.display="none",document.removeEventListener("keydown",this._keydown)}}class qp{draw;range;datePicker;options;constructor(e){this.draw=e,this.options=e.getOptions(),this.range=e.getRange(),this.datePicker=new Ca(e,{onSubmit:this._setValue.bind(this)})}_setValue(e){if(!e)return;const t=this.getDateElementRange();if(!t)return;const[n,i]=t,r=this.draw.getElementList(),s=r[n+1];this.draw.spliceElementList(r,n+1,i-n),this.range.setRange(n,n);const l={type:O.DATE,value:"",dateFormat:s.dateFormat,valueList:[{value:e}]};ze(r,[l],n,{editorOptions:this.options}),this.draw.insertElementList([l])}getDateElementRange(){let e=-1,t=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList(),s=r[n];if(s.type!==O.DATE)return null;let l=n;for(;l>=0;){if(r[l].dateId!==s.dateId){e=l;break}l--}let a=n+1;for(;a<r.length;){if(r[a].dateId!==s.dateId){t=a-1;break}a++}return a===r.length&&(t=a-1),!~e||!~t?null:[e,t]}clearDatePicker(){this.datePicker.dispose()}renderDatePicker(e,t){const n=this.draw.getElementList(),i=this.getDateElementRange(),r=i?n.slice(i[0]+1,i[1]+1).map(s=>s.value).join(""):"";this.datePicker.render({value:r,position:t,dateFormat:e.dateFormat})}}class tl{element;videoCache;constructor(e){this.element=e,this.videoCache=new Map}snapshot(e,t,n){return new Promise((i,r)=>{const s=this.element.block?.videoBlock?.src||"";if(this.videoCache.has(s)){const l=this.videoCache.get(s);e.drawImage(l,t,n,this.element.metrics.width,this.element.metrics.height),i(this.element)}else{const l=document.createElement("video");l.src=s,l.muted=!0,l.crossOrigin="anonymous",l.onloadeddata=()=>{e.drawImage(l,t,n,this.element.metrics.width,this.element.metrics.height),this.videoCache.set(s,l),i(this.element)},l.onerror=a=>{r(a)},l.play().then(()=>{l.pause()})}})}render(e){const t=this.element.block,n=document.createElement("video");n.style.width="100%",n.style.height="100%",n.style.objectFit="contain",n.src=t.videoBlock?.src||"",n.controls=!0,e.append(n)}}class jp{draw;options;element;block;blockContainer;blockItem;blockCache;resizerMask;resizerSelection;resizerHandleList;width;height;mousedownX;mousedownY;curHandleIndex;isAllowResize;constructor(e,t){this.draw=e.getDraw(),this.options=this.draw.getOptions(),this.blockContainer=e.getBlockContainer(),this.element=t,this.block=null;const{blockItem:n,resizerMask:i,resizerSelection:r,resizerHandleList:s}=this._createBlockItem();this.blockItem=n,this.blockContainer.append(this.blockItem),this.blockCache=new Map,this.resizerMask=i,this.resizerSelection=r,this.resizerHandleList=s,this.width=0,this.height=0,this.mousedownX=0,this.mousedownY=0,this.curHandleIndex=0,this.isAllowResize=!1}getBlockElement(){return this.element}getBlockWidth(){return this.element.width||this.element.metrics.width}_createBlockItem(){const{scale:e,resizerColor:t}=this.options,n=document.createElement("div");n.classList.add(`${re}-block-item`);const i=document.createElement("div");i.style.display="none",i.classList.add(`${re}-resizer-selection`),i.style.borderColor=t,i.style.borderWidth=`${e}px`;const r=[];for(let l=0;l<8;l++){const a=document.createElement("div");a.style.background=t,a.classList.add("resizer-handle"),a.classList.add(`handle-${l}`),a.setAttribute("data-index",String(l)),a.onmousedown=this._mousedown.bind(this),i.append(a),r.push(a)}const s=document.createElement("div");return s.classList.add(`${re}-resizer-mask`),s.style.display="none",n.append(s),n.onmouseenter=()=>{if(this.draw.isReadonly())return;const{width:a,height:c}=this.element.metrics;this._updateResizerRect(a,c),i.style.display="block"},n.onmouseleave=()=>{this.isAllowResize||(i.style.display="none")},n.append(i),{blockItem:n,resizerMask:s,resizerSelection:i,resizerHandleList:r}}_updateResizerRect(e,t){const{resizerSize:n,scale:i}=this.options;this.resizerSelection.style.width=`${e}px`,this.resizerSelection.style.height=`${t}px`;for(let r=0;r<8;r++){const s=r===0||r===6||r===7?-n:r===1||r===5?e/2:e-n,l=r===0||r===1||r===2?-n:r===3||r===7?t/2-n:t-n;this.resizerHandleList[r].style.transform=`scale(${i})`,this.resizerHandleList[r].style.left=`${s}px`,this.resizerHandleList[r].style.top=`${l}px`}}_mousedown(e){const t=this.draw.getPage();this.mousedownX=e.x,this.mousedownY=e.y,this.isAllowResize=!0;const n=e.target;this.curHandleIndex=Number(n.dataset.index),this.resizerMask.style.display="block";const i=window.getComputedStyle(n).cursor;document.body.style.cursor=i,t.style.cursor=i;const r=this._mousemove.bind(this);document.addEventListener("mousemove",r),document.addEventListener("mouseup",()=>{this.element.width=Math.min(this.width,this.draw.getInnerWidth()),this.element.height=this.height,this.isAllowResize=!1,this.resizerSelection.style.display="none",this.resizerMask.style.display="none",document.removeEventListener("mousemove",r),document.body.style.cursor="",t.style.cursor="text",this.draw.render()},{once:!0}),e.preventDefault()}_mousemove(e){if(!this.isAllowResize)return;const{scale:t}=this.options;let n=0,i=0;switch(this.curHandleIndex){case 0:{const c=this.mousedownX-e.x,d=this.mousedownY-e.y;n=Math.cbrt(c**3+d**3),i=this.element.height*n/this.getBlockWidth()}break;case 1:i=this.mousedownY-e.y;break;case 2:{const c=e.x-this.mousedownX,d=this.mousedownY-e.y;n=Math.cbrt(c**3+d**3),i=this.element.height*n/this.getBlockWidth()}break;case 4:{const c=e.x-this.mousedownX,d=e.y-this.mousedownY;n=Math.cbrt(c**3+d**3),i=this.element.height*n/this.getBlockWidth()}break;case 3:n=e.x-this.mousedownX;break;case 5:i=e.y-this.mousedownY;break;case 6:{const c=this.mousedownX-e.x,d=e.y-this.mousedownY;n=Math.cbrt(c**3+d**3),i=this.element.height*n/this.getBlockWidth()}break;case 7:n=this.mousedownX-e.x;break}const r=this.getBlockWidth()+n/t,s=this.element.height+i/t;if(r<=0||s<=0)return;this.width=r,this.height=s;const l=r*t,a=s*t;this._updateResizerRect(l,a),this.blockItem.style.width=`${l}px`,this.blockItem.style.height=`${a}px`,e.preventDefault()}snapshot(e,t,n){if(this.element.block.type===Fn.VIDEO)if(this.blockItem.style.display="none",this.blockCache.has(this.element.id))this.blockCache.get(this.element.id).snapshot(e,t,n);else{this.block=new tl(this.element);const r=this.block.snapshot(e,t,n);this.draw.getImageObserver().add(r),this.blockCache.set(this.element.id,this.block)}}render(){const e=this.element.block;e.type===Fn.IFRAME?(this.block=new oo(this.element),this.block.render(this.blockItem)):e.type===Fn.VIDEO&&(this.block=new tl(this.element),this.block.render(this.blockItem))}setClientRects(e,t,n){const i=this.draw.getHeight(),r=this.draw.getPageGap(),s=e*(i+r),{metrics:l}=this.element;this.blockItem.style.display="block",this.blockItem.style.width=`${l.width}px`,this.blockItem.style.height=`${l.height}px`,this.blockItem.style.left=`${t}px`,this.blockItem.style.top=`${s+n}px`}remove(){this.blockItem.remove()}}class ef{draw;container;blockContainer;blockMap;constructor(e){this.draw=e,this.container=e.getContainer(),this.blockMap=new Map,this.blockContainer=this._createBlockContainer(),this.container.append(this.blockContainer)}_createBlockContainer(){const e=document.createElement("div");return e.classList.add(`${re}-block-container`),e}getDraw(){return this.draw}getBlockContainer(){return this.blockContainer}render(e,t,n,i,r){const s=n.id;let l=this.blockMap.get(s);l||(l=new jp(this,n),l.render(),this.blockMap.set(s,l)),this.draw.isPrintMode()?l.snapshot(e,i,r):l.setClientRects(t,i,r)}clear(){if(!this.blockMap.size)return;const e=this.draw.getOriginalMainElementList(),t=[];for(let n=0;n<e.length;n++){const i=e[n];i.type===O.BLOCK&&t.push(i.id)}this.blockMap.forEach(n=>{const i=n.getBlockElement().id;t.includes(i)||(n.remove(),this.blockMap.delete(i))})}}const tf={global:{cut:"剪切",copy:"复制",paste:"粘贴",selectAll:"全选",print:"打印",cancel:"取消"},control:{delete:"删除控件",editAttribute:"修改元素配置",addExpression:"添加表达式",addMenstrualHistory:"月经史",addFetalHeartPosition:"胎心位置"},hyperlink:{delete:"删除链接",cancel:"取消链接",edit:"编辑链接"},image:{change:"更改图片",saveAs:"另存为图片",textWrap:"文字环绕",textWrapType:{embed:"嵌入型",upDown:"上下型环绕",surround:"四周型环绕",floatTop:"浮于文字上方",floatBottom:"衬于文字下方"}},table:{insertRowCol:"插入行列",insertTopRow:"上方插入1行",insertBottomRow:"下方插入1行",insertLeftCol:"左侧插入1列",insertRightCol:"右侧插入1列",deleteRowCol:"删除行列",deleteRow:"删除1行",deleteCol:"删除1列",deleteTable:"删除整个表格",mergeCell:"合并单元格",mergeCancelCell:"取消合并",verticalAlign:"垂直对齐",verticalAlignTop:"顶端对齐",verticalAlignMiddle:"垂直居中",verticalAlignBottom:"底端对齐",border:"表格边框",borderAll:"所有框线",borderEmpty:"无框线",borderDash:"虚框线",borderExternal:"外侧框线",borderInternal:"内侧框线",borderTd:"单元格边框",borderTdTop:"上边框",borderTdRight:"右边框",borderTdBottom:"下边框",borderTdLeft:"左边框",borderTdForward:"正斜线",borderTdBack:"反斜线",tableProperties:"表格属性"}},nf={now:"此刻",confirm:"确定",return:"返回日期",timeSelect:"时间选择",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},year:"年",month:"月",hour:"时",minute:"分",second:"秒"},of={header:"页眉",footer:"页脚"},sf={displayName:"分页符"},rf={headerTip:"双击编辑页眉",footerTip:"双击编辑页脚"},$i={contextmenu:tf,datePicker:nf,frame:of,pageBreak:sf,zone:rf},lf={global:{cut:"Cut",copy:"Copy",paste:"Paste",selectAll:"Select all",print:"Print",cancel:"Cancel"},control:{delete:"Delete control",editAttribute:"Edit control config",addExpression:"Add expression",addMenstrualHistory:"Menstrual History",addFetalHeartPosition:"Fetal Heart Position"},hyperlink:{delete:"Delete hyperlink",cancel:"Cancel hyperlink",edit:"Edit hyperlink"},image:{change:"Change image",saveAs:"Save as image",textWrap:"Text wrap",textWrapType:{embed:"Embed",upDown:"Up down",surround:"Surround",floatTop:"Float above text",floatBottom:"Float below text"}},table:{insertRowCol:"Insert row col",insertTopRow:"Insert top 1 row",insertBottomRow:"Insert bottom 1 row",insertLeftCol:"Insert left 1 col",insertRightCol:"Insert right 1 col",deleteRowCol:"Delete row col",deleteRow:"Delete 1 row",deleteCol:"Delete 1 col",deleteTable:"Delete table",mergeCell:"Merge cell",mergeCancelCell:"Cancel merge cell",verticalAlign:"Vertical align",verticalAlignTop:"Top",verticalAlignMiddle:"Middle",verticalAlignBottom:"Bottom",border:"Table border",borderAll:"All",borderEmpty:"Empty",borderDash:"Dash",borderExternal:"External",borderInternal:"Internal",borderTd:"Table cell border",borderTdTop:"Top",borderTdRight:"Right",borderTdBottom:"Bottom",borderTdLeft:"Left",borderTdForward:"Forward",borderTdBack:"Back",tableProperties:"Table Properties"}},af={now:"Now",confirm:"Confirm",return:"Return",timeSelect:"Time select",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},year:" ",month:" ",hour:"Hour",minute:"Minute",second:"Second"},cf={header:"Header",footer:"Footer"},df={displayName:"Page Break"},uf={headerTip:"Double click to edit header",footerTip:"Double click to edit footer"},hf={contextmenu:lf,datePicker:af,frame:cf,pageBreak:df,zone:uf};class Rf{currentLocale;langMap=new Map([["zhCN",$i],["en",hf]]);constructor(e){this.currentLocale=e}registerLangMap(e,t){const n=this.langMap.get(e);this.langMap.set(e,fl(n||$i,t))}getLocale(){return this.currentLocale}setLocale(e){this.currentLocale=e}getLang(){return this.langMap.get(this.currentLocale)||$i}t(e){const t=e.split(".");let n="",i=this.getLang();for(let r=0;r<t.length;r++){const s=t[r],l=Reflect.get(i,s);if(l)n=i=l;else return""}return n}}class gf{promiseList;constructor(){this.promiseList=[]}add(e){this.promiseList.push(e)}clearAll(){this.promiseList=[]}allSettled(){return Promise.allSettled(this.promiseList)}}class pf{draw;zone;i18n;container;pageContainer;isDisableMouseMove;tipContainer;tipContent;currentMoveZone;constructor(e,t){this.draw=e,this.zone=t,this.i18n=e.getI18n(),this.container=e.getContainer(),this.pageContainer=e.getPageContainer();const{tipContainer:n,tipContent:i}=this._drawZoneTip();this.tipContainer=n,this.tipContent=i,this.isDisableMouseMove=!0,this.currentMoveZone=De.MAIN;const r=[],{header:s,footer:l}=e.getOptions();s.disabled||r.push(De.HEADER),l.disabled||r.push(De.FOOTER),r.length&&this._watchMouseMoveZoneChange(r)}_watchMouseMoveZoneChange(e){this.pageContainer.addEventListener("mousemove",uc(t=>{if(!(this.isDisableMouseMove||!this.draw.getIsPagingMode())&&t.offsetY)if(t.target instanceof HTMLCanvasElement){const n=this.zone.getZoneByY(t.offsetY);if(!e.includes(n)){this._updateZoneTip(!1);return}this.currentMoveZone=n,this._updateZoneTip(this.zone.getZone()===De.MAIN&&(n===De.HEADER||n===De.FOOTER),t.x,t.y)}else this._updateZoneTip(!1)},250)),this.pageContainer.addEventListener("mouseenter",()=>{this.isDisableMouseMove=!1}),this.pageContainer.addEventListener("mouseleave",()=>{this.isDisableMouseMove=!0,this._updateZoneTip(!1)})}_drawZoneTip(){const e=document.createElement("div");e.classList.add(`${re}-zone-tip`);const t=document.createElement("span");return e.append(t),this.container.append(e),{tipContainer:e,tipContent:t}}_updateZoneTip(e,t,n){e?(this.tipContainer.classList.add("show"),this.tipContainer.style.left=`${t}px`,this.tipContainer.style.top=`${n}px`,this.tipContent.innerText=this.i18n.t(`zone.${this.currentMoveZone===De.HEADER?"headerTip":"footerTip"}`)):this.tipContainer.classList.remove("show")}}class ff{INDICATOR_PADDING=2;INDICATOR_TITLE_TRANSLATE=[20,5];draw;options;i18n;container;currentZone;indicatorContainer;constructor(e){this.draw=e,this.i18n=e.getI18n(),this.options=e.getOptions(),this.container=e.getContainer(),this.currentZone=De.MAIN,this.indicatorContainer=null,this.options.zone.tipDisabled||new pf(e,this)}isHeaderActive(){return this.getZone()===De.HEADER}isMainActive(){return this.getZone()===De.MAIN}isFooterActive(){return this.getZone()===De.FOOTER}getZone(){return this.currentZone}setZone(e){const{header:t,footer:n}=this.options;!t.editable&&e===De.HEADER||!n.editable&&e===De.FOOTER||this.currentZone!==e&&(this.currentZone=e,this.draw.getRange().clearRange(),this.draw.render({isSubmitHistory:!1,isSetCursor:!1,isCompute:!1}),this.drawZoneIndicator(),Xs(()=>{const i=this.draw.getListener();i.zoneChange&&i.zoneChange(e);const r=this.draw.getEventBus();r.isSubscribe("zoneChange")&&r.emit("zoneChange",e)}))}getZoneByY(e){const t=this.draw.getHeader(),n=t.getHeaderTop()+t.getHeight(),i=this.draw.getFooter(),s=this.draw.getHeight()-(i.getFooterBottom()+i.getHeight());return e<n?De.HEADER:e>s?De.FOOTER:De.MAIN}drawZoneIndicator(){if(this._clearZoneIndicator(),!this.isHeaderActive()&&!this.isFooterActive())return;const{scale:e}=this.options,t=this.isHeaderActive(),[n,i]=this.INDICATOR_TITLE_TRANSLATE,r=this.draw.getPageList(),s=this.draw.getMargins(),l=this.draw.getInnerWidth(),a=this.draw.getHeight(),c=this.draw.getPageGap(),d=a+c;this.indicatorContainer=document.createElement("div"),this.indicatorContainer.classList.add(`${re}-zone-indicator`);const u=this.draw.getHeader(),h=this.draw.getFooter(),R=t?u.getHeight():h.getHeight(),g=t?u.getHeaderTop():a-h.getFooterBottom()-R;for(let m=0;m<r.length;m++){const f=d*m+g,T=s[3]-this.INDICATOR_PADDING,I=s[3]+l+this.INDICATOR_PADDING,L=t?f-this.INDICATOR_PADDING:f+R+this.INDICATOR_PADDING,S=t?f+R+this.INDICATOR_PADDING:f-this.INDICATOR_PADDING,M=document.createElement("div");M.innerText=this.i18n.t(`frame.${t?"header":"footer"}`),M.style.top=`${S}px`,M.style.transform=`translate(${n*e}px, ${i*e}px) scale(${e})`,this.indicatorContainer.append(M);const X=document.createElement("span");X.classList.add(`${re}-zone-indicator-border__top`),X.style.top=`${L}px`,X.style.width=`${l}px`,X.style.marginLeft=`${s[3]}px`,this.indicatorContainer.append(X);const x=document.createElement("span");x.classList.add(`${re}-zone-indicator-border__left`),x.style.top=`${f}px`,x.style.height=`${R}px`,x.style.left=`${T}px`,this.indicatorContainer.append(x);const F=document.createElement("span");F.classList.add(`${re}-zone-indicator-border__bottom`),F.style.top=`${S}px`,this.indicatorContainer.append(F);const D=document.createElement("span");D.classList.add(`${re}-zone-indicator-border__right`),D.style.top=`${f}px`,D.style.height=`${R}px`,D.style.left=`${I}px`,this.indicatorContainer.append(D)}this.container.append(this.indicatorContainer)}_clearZoneIndicator(){this.indicatorContainer?.remove(),this.indicatorContainer=null}}class mf{draw;position;zone;options;elementList;rowList;positionList;constructor(e,t){this.draw=e,this.position=e.getPosition(),this.zone=e.getZone(),this.options=e.getOptions(),this.elementList=t||[],this.rowList=[],this.positionList=[]}getRowList(){return this.rowList}setElementList(e){this.elementList=e}getElementList(){return this.elementList}getPositionList(){return this.positionList}compute(){this.recovery(),this._computeRowList(),this._computePositionList()}recovery(){this.rowList=[],this.positionList=[]}_computeRowList(){const e=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:e,elementList:this.elementList})}_computePositionList(){const e=this.getFooterBottom(),t=this.draw.getInnerWidth(),i=this.draw.getMargins()[3],r=this.draw.getHeight(),s=this.getHeight(),l=r-e-s;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:i,startY:l,innerWidth:t,zone:De.FOOTER})}getFooterBottom(){const{footer:{bottom:e,disabled:t},scale:n}=this.options;return t?0:Math.floor(e*n)}getMaxHeight(){const{footer:{maxHeightRadio:e}}=this.options,t=this.draw.getHeight();return Math.floor(t*gl[e])}getHeight(){if(this.options.footer.disabled)return 0;const e=this.getMaxHeight(),t=this.getRowHeight();return t>e?e:t}getRowHeight(){return this.rowList.reduce((e,t)=>e+t.height,0)}getExtraHeight(){const e=this.draw.getMargins(),t=this.getHeight(),i=this.getFooterBottom()+t-e[2];return i<=0?0:i}render(e,t){e.save(),e.globalAlpha=this.zone.isFooterActive()?1:this.options.footer.inactiveAlpha;const n=this.draw.getInnerWidth(),i=this.getMaxHeight(),r=[];let s=0;for(let l=0;l<this.rowList.length;l++){const a=this.rowList[l];if(s+a.height>i)break;r.push(a),s+=a.height}this.draw.drawRow(e,{elementList:this.elementList,positionList:this.positionList,rowList:r,pageNo:t,startIndex:0,innerWidth:n,zone:De.FOOTER}),e.restore()}}class Tf{draw;range;options;UN_COUNT_STYLE_WIDTH=20;MEASURE_BASE_TEXT="0";LIST_GAP=10;constructor(e){this.draw=e,this.range=e.getRange(),this.options=e.getOptions()}setList(e,t){if(this.draw.isReadonly())return;const{startIndex:i,endIndex:r}=this.range.getRange();if(!~i&&!~r)return;const s=this.range.getRangeParagraphElementList();if(!s||!s.length)return;if(s.find(u=>u.listType===e&&u.listStyle===t)||!e){this.unsetList();return}const a=Ee();s.forEach(u=>{u.listId=a,u.listType=e,u.listStyle=t});const c=i===r,d=c?r:i;this.draw.render({curIndex:d,isSetCursor:c})}unsetList(){if(this.draw.isReadonly())return;const{startIndex:t,endIndex:n}=this.range.getRange();if(!~t&&!~n)return;const i=this.range.getRangeParagraphElementList()?.filter(c=>c.listId);if(!i||!i.length)return;const r=this.draw.getElementList(),s=r[n];if(s.listId){let c=n+1;for(;c<r.length;){const d=r[c];if(d.value===ee&&!d.listWrap)break;if(d.listId!==s.listId){this.draw.spliceElementList(r,c,0,[{value:ee}]);break}c++}}i.forEach(c=>{delete c.listId,delete c.listType,delete c.listStyle,delete c.listWrap});const l=t===n,a=l?n:t;this.draw.render({curIndex:a,isSetCursor:l})}computeListStyle(e,t){const n=new Map;let i=0,r=t[i]?.listId,s=[];const l=t.length;for(;i<l;){const a=t[i];if(r&&r===a.listId)s.push(a);else if(a.listId&&a.listId!==r){if(s.length){const c=this.getListStyleWidth(e,s);n.set(r,c)}r=a.listId,s=r?[a]:[]}i++}if(s.length){const a=this.getListStyleWidth(e,s);n.set(r,a)}return n}findStyledElement(e){let t=e[0];for(let n=1;n<e.length;n++){const i=e[n];if(i.font||i.size||i.bold||i.italic){t=i;break}}return t}getListFontStyle(e,t){if(this.options.list.inheritStyle){const n=this.findStyledElement(e);return this.draw.getElementFont(n,t)}else{const{defaultFont:n,defaultSize:i}=this.options;return`${i*t}px ${n}`}}getListStyleWidth(e,t){const{scale:n,checkbox:i}=this.options,r=t[0];if(r.listStyle&&r.listStyle!==Nt.DECIMAL)return r.listStyle===Nt.CHECKBOX?(i.width+this.LIST_GAP)*n:this.UN_COUNT_STYLE_WIDTH*n;const s=t.reduce((c,d)=>(d.value===ee&&(c+=1),c),0);if(!s)return 0;e.save(),e.font=this.getListFontStyle(t,n);const l=`${this.MEASURE_BASE_TEXT.repeat(String(s).length)}${Te.PERIOD}`,a=e.measureText(l);return e.restore(),Math.ceil((a.width+this.LIST_GAP)*n)}drawListStyle(e,t,n){const{elementList:i,offsetX:r,listIndex:s,ascent:l}=t,a=i[0];if(a.value!==ee||a.listWrap)return;let c=0;const{defaultTabWidth:d,scale:u}=this.options;for(let f=1;f<i.length&&i[f]?.type===O.TAB;f++)c+=d*u;const{coordinate:{leftTop:[h,R]}}=n,g=h-r+c,m=R+l;if(a.listStyle===Nt.CHECKBOX){const{width:f,height:T,gap:I}=this.options.checkbox,L={...a,checkbox:{value:!!a.checkbox?.value},metrics:{...a.metrics,width:(f+I*2)*u,height:T*u}};this.draw.getCheckboxParticle().render({ctx:e,x:g-I*u,y:m,index:0,row:{...t,elementList:[L,...t.elementList]}})}else{let f="";if(a.listType===kt.UL?f=ls[a.listStyle]||ls[Jn.DISC]:f=`${s+1}${Te.PERIOD}`,!f)return;e.save(),e.font=this.getListFontStyle(i,u),e.fillText(f,g,m),e.restore()}}}class Do{options;static WIDTH=12;static HEIGHT=9;static GAP=3;constructor(e){this.options=e.getOptions()}render(e,t,n,i){const{scale:r,lineBreak:{color:s,lineWidth:l}}=this.options;e.save(),e.beginPath();const a=i-Do.HEIGHT*r/2,c=n+t.metrics.width;e.translate(c,a),e.scale(r,r),e.strokeStyle=s,e.lineWidth=l,e.lineCap="round",e.lineJoin="round",e.beginPath(),e.moveTo(8,0),e.lineTo(12,0),e.lineTo(12,6),e.lineTo(3,6),e.moveTo(3,6),e.lineTo(6,3),e.moveTo(3,6),e.lineTo(6,9),e.stroke(),e.closePath(),e.restore()}}class Wa{draw;position;options;elementList;rowList;positionList;constructor(e){this.draw=e,this.position=e.getPosition(),this.options=e.getOptions(),this.elementList=[],this.rowList=[],this.positionList=[]}_recovery(){this.elementList=[],this.rowList=[],this.positionList=[]}_compute(e){this._computeRowList(),this._computePositionList(e)}_computeRowList(){const e=this.draw.getInnerWidth();this.rowList=this.draw.computeRowList({innerWidth:e,elementList:this.elementList})}_computePositionList(e){const{lineBreak:t,scale:n}=this.options,i=this.draw.getHeader().getExtraHeight(),r=this.draw.getInnerWidth(),s=this.draw.getMargins();let l=s[3];t.disabled||(l+=(Do.WIDTH+Do.GAP)*n);const a=e?.startY||s[0]+i;this.position.computePageRowPosition({positionList:this.positionList,rowList:this.rowList,pageNo:0,startRowIndex:0,startIndex:0,startX:l,startY:a,innerWidth:r})}render(e,t){const{placeholder:n=this.options.placeholder}=t||{},{data:i,font:r,size:s,color:l,opacity:a}=n;this._recovery(),this.elementList=[{value:i,font:r,size:s,color:l}],ct(this.elementList,{editorOptions:this.options,isForceCompensation:!0}),this._compute(t);const c=this.draw.getInnerWidth();e.save(),e.globalAlpha=a,this.draw.drawRow(e,{elementList:this.elementList,positionList:this.positionList,rowList:this.rowList,pageNo:0,startIndex:0,innerWidth:c,isDrawLineBreak:!1}),e.restore()}}class Lf{draw;options;range;fillRectMap;constructor(e){this.draw=e,this.options=e.getOptions(),this.range=e.getRange(),this.fillRectMap=new Map}setGroup(){if(this.draw.isReadonly()||this.draw.getZone().getZone()!==De.MAIN)return null;const e=this.range.getSelection();if(!e)return null;const t=Ee();return e.forEach(n=>{Array.isArray(n.groupIds)||(n.groupIds=[]),n.groupIds.push(t)}),this.draw.render({isSetCursor:!1,isCompute:!1}),t}getElementListByGroupId(e,t){const n=[];for(let i=0;i<e.length;i++){const r=e[i];if(r.type===O.TABLE){const s=r.trList;for(let l=0;l<s.length;l++){const a=s[l];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c],u=this.getElementListByGroupId(d.value,t);if(u.length)return n.push(...u),n}}}if(r?.groupIds?.includes(t)&&(n.push(r),!e[i+1]?.groupIds?.includes(t)))break}return n}deleteGroup(e){if(this.draw.isReadonly())return;const t=this.draw.getOriginalMainElementList(),n=this.getElementListByGroupId(t,e);if(n.length){for(let i=0;i<n.length;i++){const r=n[i],s=r.groupIds,l=s.findIndex(a=>a===e);s.splice(l,1),s.length||delete r.groupIds}this.draw.render({isSetCursor:!1,isCompute:!1})}}getContextByGroupId(e,t){for(let n=0;n<e.length;n++){const i=e[n];if(i.type===O.TABLE){const s=i.trList;for(let l=0;l<s.length;l++){const a=s[l];for(let c=0;c<a.tdList.length;c++){const d=a.tdList[c],u=this.getContextByGroupId(d.value,t);if(u)return{...u,isTable:!0,index:n,trIndex:l,tdIndex:c,tdId:d.id,trId:a.id,tableId:i.tableId}}}}const r=e[n+1];if(i.groupIds?.includes(t)&&!r?.groupIds?.includes(t))return{isTable:!1,startIndex:n,endIndex:n}}return null}clearFillInfo(){this.fillRectMap.clear()}recordFillInfo(e,t,n,i,r){const s=e.groupIds;if(s)for(const l of s){const a=this.fillRectMap.get(l);a?a.width+=i:this.fillRectMap.set(l,{x:t,y:n,width:i,height:r})}}render(e){if(!this.fillRectMap.size)return;const t=this.range.getRange(),i=this.draw.getElementList()[t.endIndex]?.groupIds,{group:{backgroundColor:r,opacity:s,activeOpacity:l,activeBackgroundColor:a}}=this.options;e.save(),this.fillRectMap.forEach((c,d)=>{const{x:u,y:h,width:R,height:g}=c;i?.includes(d)?(e.globalAlpha=l,e.fillStyle=a):(e.globalAlpha=s,e.fillStyle=r),e.fillRect(u,h,R,g)}),e.restore(),this.clearFillInfo()}}class If{options;constructor(e){this.options=e.getOptions()}render(e,t,n,i){const{scale:r,whiteSpace:{color:s,radius:l}}=this.options,a=t.metrics;e.save(),e.fillStyle=s,e.beginPath(),e.arc(n+a.width/2,i,l*r,0,Math.PI*2),e.fill(),e.closePath(),e.restore()}}class Pf{draw;eventBus;pageContainer;constructor(e){this.draw=e,this.eventBus=this.draw.getEventBus(),this.pageContainer=this.draw.getPageContainer(),this.pageContainer.addEventListener("mousemove",this._mousemove.bind(this)),this.pageContainer.addEventListener("mouseenter",this._mouseenter.bind(this)),this.pageContainer.addEventListener("mouseleave",this._mouseleave.bind(this)),this.pageContainer.addEventListener("mousedown",this._mousedown.bind(this)),this.pageContainer.addEventListener("mouseup",this._mouseup.bind(this)),this.pageContainer.addEventListener("click",this._click.bind(this))}_mousemove(e){this.eventBus.isSubscribe("mousemove")&&this.eventBus.emit("mousemove",e)}_mouseenter(e){this.eventBus.isSubscribe("mouseenter")&&this.eventBus.emit("mouseenter",e)}_mouseleave(e){this.eventBus.isSubscribe("mouseleave")&&this.eventBus.emit("mouseleave",e)}_mousedown(e){this.eventBus.isSubscribe("mousedown")&&this.eventBus.emit("mousedown",e)}_mouseup(e){this.eventBus.isSubscribe("mouseup")&&this.eventBus.emit("mouseup",e)}_click(e){this.eventBus.isSubscribe("click")&&this.eventBus.emit("click",e)}}class Of{draw;options;constructor(e){this.draw=e,this.options=e.getOptions()}render(e,t){const{scale:n,lineNumber:{color:i,size:r,font:s,right:l,type:a}}=this.options,c=this.draw.getTextParticle(),d=this.draw.getMargins(),u=this.draw.getPosition().getOriginalMainPositionList(),R=this.draw.getPageRowList()[t];e.save(),e.fillStyle=i,e.font=`${r*n}px ${s}`;for(let g=0;g<R.length;g++){const m=R[g],{coordinate:{leftBottom:f}}=u[m.startIndex],T=a===bs.PAGE?g+1:m.rowIndex+1,I=c.measureText(e,{value:`${T}`}),L=d[3]-(I.width+l)*n,S=f[1]-I.actualBoundingBoxAscent*n;e.fillText(`${T}`,L,S)}e.restore()}}class Sf{draw;header;footer;options;constructor(e){this.draw=e,this.header=e.getHeader(),this.footer=e.getFooter(),this.options=e.getOptions()}render(e){const{scale:t,pageBorder:{color:n,lineWidth:i,padding:r}}=this.options;e.save(),e.translate(.5,.5),e.strokeStyle=n,e.lineWidth=i*t;const s=this.draw.getMargins(),l=s[3]-r[3]*t,a=s[0]+this.header.getExtraHeight()-r[0]*t,c=this.draw.getInnerWidth()+(r[1]+r[3])*t,d=this.draw.getHeight()-a-this.footer.getExtraHeight()-s[2]+r[2]*t;e.rect(l,a,c,d),e.stroke(),e.restore()}}function Mf(o,e){const{value:t,oldValue:n}=e;n.isTable&&!t.isTable&&o.getTableTool().dispose()}class Xf{draw;eventBus;constructor(e){this.draw=e,this.eventBus=e.getEventBus(),this.execute()}execute(){this.eventBus.on("positionContextChange",e=>{Mf(this.draw,e)})}}class Ef{draw;range;position;tableTool;tableParticle;options;constructor(e){this.draw=e,this.range=e.getRange(),this.position=e.getPosition(),this.tableTool=e.getTableTool(),this.tableParticle=e.getTableParticle(),this.options=e.getOptions()}insertTable(e,t){const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const{defaultTrMinHeight:r}=this.options.table,s=this.draw.getElementList();let l=0;if(s[n]?.listId){const g=this.position.getPositionList(),{rowIndex:m}=g[n];l=this.draw.getRowList()[m]?.offsetX||0}const a=this.draw.getContextInnerWidth()-l,c=[],d=a/t;for(let g=0;g<t;g++)c.push({width:d});const u=[];for(let g=0;g<e;g++){const m=[],f={height:r,tdList:m};for(let T=0;T<t;T++)m.push({colspan:1,rowspan:1,value:[]});u.push(f)}const h={type:O.TABLE,value:"",colgroup:c,trList:u};ct([h],{editorOptions:this.options}),ze(s,[h],n,{editorOptions:this.options});const R=n+1;this.draw.spliceElementList(s,R,n===i?0:i-n,[h]),this.range.setRange(R,R),this.draw.render({curIndex:R,isSetCursor:!1})}insertTableTopRow(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,trIndex:n,tableId:i}=e,s=this.draw.getOriginalElementList()[t],l=s.trList,a=l[n];if(a.tdList.length<s.colgroup.length){const u=a.tdList[0].rowIndex;for(let h=0;h<n;h++){const R=l[h];for(let g=0;g<R.tdList.length;g++){const m=R.tdList[g];m.rowspan>1&&m.rowIndex+m.rowspan>=u+1&&(m.rowspan+=1)}}}const c=Ee(),d={height:a.height,id:c,tdList:[]};for(let u=0;u<a.tdList.length;u++){const h=a.tdList[u],R=Ee();d.tdList.push({id:R,rowspan:1,colspan:h.colspan,value:[{value:ee,size:16,tableId:i,trId:c,tdId:R}]})}l.splice(n,0,d),this.position.setPositionContext({isTable:!0,index:t,trIndex:n,tdIndex:0,tdId:d.tdList[0].id,trId:d.id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableBottomRow(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,trIndex:n,tableId:i}=e,s=this.draw.getOriginalElementList()[t],l=s.trList,a=l[n],c=l.length-1===n?a:l[n+1];if(c.tdList.length<s.colgroup.length){const h=c.tdList[0].rowIndex;for(let R=0;R<n+1;R++){const g=l[R];for(let m=0;m<g.tdList.length;m++){const f=g.tdList[m];f.rowspan>1&&f.rowIndex+f.rowspan>=h+1&&(f.rowspan+=1)}}}const d=Ee(),u={height:c.height,id:d,tdList:[]};for(let h=0;h<c.tdList.length;h++){const R=c.tdList[h],g=Ee();u.tdList.push({id:g,rowspan:1,colspan:R.colspan,value:[{value:ee,size:16,tableId:i,trId:d,tdId:g}]})}l.splice(n+1,0,u),this.position.setPositionContext({isTable:!0,index:t,trIndex:n+1,tdIndex:0,tdId:u.tdList[0].id,trId:u.id,tableId:s.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}adjustColWidth(e){if(e.type!==O.TABLE)return;const{defaultColMinWidth:t}=this.options.table,n=e.colgroup,i=n.reduce((s,l)=>s+l.width,0),r=this.draw.getOriginalInnerWidth();if(i>r){const s=n.filter(a=>a.width>t),l=(i-r)/s.length;for(let a=0;a<n.length;a++){const c=n[a];c.width-l>=t&&(c.width-=l)}}}insertTableLeftCol(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,tdIndex:n,tableId:i}=e,s=this.draw.getOriginalElementList()[t],l=s.trList,a=n;for(let u=0;u<l.length;u++){const h=l[u],R=Ee();h.tdList.splice(a,0,{id:R,rowspan:1,colspan:1,value:[{value:ee,size:16,tableId:i,trId:h.id,tdId:R}]})}const{defaultColMinWidth:c}=this.options.table;s.colgroup.splice(a,0,{width:c}),this.adjustColWidth(s),this.position.setPositionContext({isTable:!0,index:t,trIndex:0,tdIndex:a,tdId:l[0].tdList[a].id,trId:l[0].id,tableId:i}),this.range.setRange(0,0),this.draw.render({curIndex:0}),this.tableTool.render()}insertTableRightCol(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,tdIndex:n,tableId:i}=e,s=this.draw.getOriginalElementList()[t],l=s.trList,a=n+1;for(let u=0;u<l.length;u++){const h=l[u],R=Ee();h.tdList.splice(a,0,{id:R,rowspan:1,colspan:1,value:[{value:ee,size:16,tableId:i,trId:h.id,tdId:R}]})}const{defaultColMinWidth:c}=this.options.table;s.colgroup.splice(a,0,{width:c}),this.adjustColWidth(s),this.position.setPositionContext({isTable:!0,index:t,trIndex:0,tdIndex:a,tdId:l[0].tdList[a].id,trId:l[0].id,tableId:s.id}),this.range.setRange(0,0),this.draw.render({curIndex:0})}deleteTableRow(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,trIndex:n,tdIndex:i}=e,s=this.draw.getOriginalElementList()[t],l=s.trList,a=l[n],c=a.tdList[i].rowIndex;if(l.length<=1&&s.pagingIndex===0){this.deleteTable();return}for(let d=0;d<c;d++){const h=l[d].tdList;for(let R=0;R<h.length;R++){const g=h[R];g.rowIndex+g.rowspan>c&&g.rowspan--}}for(let d=0;d<a.tdList.length;d++){const u=a.tdList[d];if(u.rowspan>1){const h=Ee(),R=l[n+1];R.tdList.splice(d,0,{id:h,rowspan:u.rowspan-1,colspan:u.colspan,value:[{value:ee,size:16,tableId:s.id,trId:R.id,tdId:h}]})}}l.splice(n,1),this.position.setPositionContext({isTable:!1}),this.range.clearRange(),this.draw.render({curIndex:e.index}),this.tableTool.dispose()}deleteTableCol(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,tdIndex:n,trIndex:i}=e,s=this.draw.getOriginalElementList()[t],l=s.trList,c=l[i].tdList[n].colIndex;if(!l.find(u=>u.tdList.length>1)){this.deleteTable();return}for(let u=0;u<l.length;u++){const h=l[u];for(let R=0;R<h.tdList.length;R++){const g=h.tdList[R];g.colIndex<=c&&g.colIndex+g.colspan>c&&(g.colspan>1?g.colspan--:h.tdList.splice(R,1))}}s.colgroup?.splice(c,1),this.position.setPositionContext({isTable:!1}),this.range.setRange(0,0),this.draw.render({curIndex:e.index}),this.tableTool.dispose()}deleteTable(){const e=this.position.getPositionContext();if(!e.isTable)return;const t=this.draw.getOriginalElementList(),n=t[e.index];let i=1,r=e.index;if(n.pagingId){r=e.index-n.pagingIndex;for(let l=r+1;l<t.length&&t[l].pagingId===n.pagingId;l++)i++}t.splice(r,i);const s=r-1;this.position.setPositionContext({isTable:!1,index:s}),this.range.setRange(s,s),this.draw.render({curIndex:s}),this.tableTool.dispose()}mergeTableCell(){const e=this.position.getPositionContext();if(!e.isTable)return;const{isCrossRowCol:t,startTdIndex:n,endTdIndex:i,startTrIndex:r,endTrIndex:s}=this.range.getRange();if(!t)return;const{index:l}=e,d=this.draw.getOriginalElementList()[l].trList;let u=d[r].tdList[n],h=d[s].tdList[i];(u.x>h.x||u.y>h.y)&&([u,h]=[h,u]);const R=u.colIndex,g=h.colIndex+(h.colspan-1),m=u.rowIndex,f=h.rowIndex+(h.rowspan-1),T=[];for(let b=0;b<d.length;b++){const P=d[b],y=[];for(let N=0;N<P.tdList.length;N++){const U=P.tdList[N],w=U.colIndex,Q=U.rowIndex;w>=R&&w<=g&&Q>=m&&Q<=f&&y.push(U)}y.length&&T.push(y)}if(!T.length)return;const I=T[T.length-1],L=T[0][0],S=I[I.length-1],M=L.x,X=L.y,x=S.x+S.width,F=S.y+S.height;for(let b=0;b<T.length;b++){const P=T[b];for(let y=0;y<P.length;y++){const N=P[y],U=N.x,w=N.y,Q=U+N.width,K=w+N.height;if(M>U||X>w||x<Q||F<K)return}}const D=[],V=T[0][0],E=V.value[0];for(let b=0;b<T.length;b++){const P=T[b];for(let y=0;y<P.length;y++){const N=P[y];if(!(b===0&&y===0)){D.push(N.id);const w=N.value.length>1?0:1;for(let Q=w;Q<N.value.length;Q++){const K=N.value[Q];Mn(qn,E,K),V.value.push(K)}}b===0&&y!==0&&(V.colspan+=N.colspan),b!==0&&V.colIndex===N.colIndex&&(V.rowspan+=N.rowspan)}}for(let b=0;b<d.length;b++){const P=d[b];let y=0;for(;y<P.tdList.length;){const N=P.tdList[y];D.includes(N.id)&&(P.tdList.splice(y,1),y--),y++}}this.position.setPositionContext({...e,trIndex:V.trIndex,tdIndex:V.tdIndex});const v=V.value.length-1;this.range.setRange(v,v),this.draw.render(),this.tableTool.render()}cancelMergeTableCell(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t,tdIndex:n,trIndex:i}=e,s=this.draw.getOriginalElementList()[t],l=s.trList,a=l[i],c=a.tdList[n];if(c.rowspan===1&&c.colspan===1)return;const d=c.colspan;if(c.colspan>1){for(let h=1;h<c.colspan;h++){const R=Ee();a.tdList.splice(n+h,0,{id:R,rowspan:1,colspan:1,value:[{value:ee,size:16,tableId:s.id,trId:a.id,tdId:R}]})}c.colspan=1}if(c.rowspan>1){for(let h=1;h<c.rowspan;h++){const R=l[i+h];for(let g=0;g<d;g++){const m=Ee();R.tdList.splice(c.colIndex,0,{id:m,rowspan:1,colspan:1,value:[{value:ee,size:16,tableId:s.id,trId:R.id,tdId:m}]})}}c.rowspan=1}const u=c.value.length-1;this.range.setRange(u,u),this.draw.render(),this.tableTool.render()}splitVerticalTableCell(){const e=this.position.getPositionContext();if(!e.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:r}=e,l=this.draw.getOriginalElementList()[n],a=l.trList,c=a[r],d=c.tdList[i];l.colgroup.splice(i+1,0,{width:this.options.table.defaultColMinWidth});for(let u=0;u<a.length;u++){const h=a[u];let R=0;for(;R<h.tdList.length;){const g=h.tdList[R];if(g.rowIndex!==d.rowIndex)g.colIndex<=d.colIndex&&g.colIndex+g.colspan>d.colIndex&&g.colspan++;else if(g.id===d.id){const m=Ee();c.tdList.splice(R+d.colspan,0,{id:m,rowspan:d.rowspan,colspan:1,value:[{value:ee,size:16,tableId:l.id,trId:h.id,tdId:m}]}),R++}R++}}this.draw.render(),this.tableTool.render()}splitHorizontalTableCell(){const e=this.position.getPositionContext();if(!e.isTable||this.range.getRange().isCrossRowCol)return;const{index:n,tdIndex:i,trIndex:r}=e,l=this.draw.getOriginalElementList()[n],a=l.trList,d=a[r].tdList[i];let u=-1,h=0;for(;h<a.length;){if(h===u){h++;continue}const R=a[h];let g=0;for(;g<R.tdList.length;){const m=R.tdList[g];if(m.id===d.id){const f=Ee(),T=Ee();a.splice(h+d.rowspan,0,{id:f,height:this.options.table.defaultTrMinHeight,tdList:[{id:T,rowspan:1,colspan:d.colspan,value:[{value:ee,size:16,tableId:l.id,trId:f,tdId:T}]}]}),u=h+d.rowspan}else m.rowIndex>=d.rowIndex&&m.rowIndex<d.rowIndex+d.rowspan&&m.rowIndex+m.rowspan>=d.rowIndex+d.rowspan&&m.rowspan++;g++}h++}this.draw.render(),this.tableTool.render()}tableTdVerticalAlign(e){const t=this.tableParticle.getRangeRowCol();if(!t)return;for(let i=0;i<t.length;i++){const r=t[i];for(let s=0;s<r.length;s++){const l=r[s];!l||l.verticalAlign===e||!l.verticalAlign&&e===Tt.TOP||(l.verticalAlign=e)}}const{endIndex:n}=this.range.getRange();this.draw.render({curIndex:n})}tableBorderType(e){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:n}=t,r=this.draw.getOriginalElementList()[n];if(!r.borderType&&e===vt.ALL||r.borderType===e)return;r.borderType=e;const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s})}tableBorderColor(e){const t=this.position.getPositionContext();if(!t.isTable)return;const{index:n}=t,r=this.draw.getOriginalElementList()[n];if(!r.borderColor&&e===this.options.table.defaultBorderColor||r.borderColor===e)return;r.borderColor=e;const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s,isCompute:!1})}tableTdBorderType(e){const t=this.tableParticle.getRangeRowCol();if(!t)return;const n=t.flat(),i=n.some(s=>!s.borderTypes?.includes(e));n.forEach(s=>{s.borderTypes||(s.borderTypes=[]);const l=s.borderTypes.findIndex(a=>a===e);i?~l||s.borderTypes.push(e):~l&&s.borderTypes.splice(l,1),s.borderTypes.length||delete s.borderTypes});const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableTdSlashType(e){const t=this.tableParticle.getRangeRowCol();if(!t)return;const n=t.flat(),i=n.some(s=>!s.slashTypes?.includes(e));n.forEach(s=>{s.slashTypes||(s.slashTypes=[]);const l=s.slashTypes.findIndex(a=>a===e);i?~l||s.slashTypes.push(e):~l&&s.slashTypes.splice(l,1),s.slashTypes.length||delete s.slashTypes});const{endIndex:r}=this.range.getRange();this.draw.render({curIndex:r})}tableTdBackgroundColor(e){const t=this.tableParticle.getRangeRowCol();if(!t)return;for(let i=0;i<t.length;i++){const r=t[i];for(let s=0;s<r.length;s++){const l=r[s];l.backgroundColor=e}}const{endIndex:n}=this.range.getRange();this.range.setRange(n,n),this.draw.render({isCompute:!1})}tableSelectAll(){const e=this.position.getPositionContext(),{index:t,tableId:n,isTable:i}=e;if(!i||!n)return;const{startIndex:r,endIndex:s}=this.range.getRange(),a=this.draw.getOriginalElementList()[t].trList,c=a.length-1,d=a[c].tdList.length-1;this.range.replaceRange({startIndex:r,endIndex:s,tableId:n,startTdIndex:0,endTdIndex:d,startTrIndex:0,endTrIndex:c}),this.draw.render({isSetCursor:!1,isCompute:!1,isSubmitHistory:!1})}tableProperties(){const e=this.position.getPositionContext();if(!e.isTable)return;const{index:t}=e,i=this.draw.getOriginalElementList()[t],r=this.draw.getOptions().table.tdPadding,s=i.tdPadding||r,l=document.createElement("div");l.className="table-properties-modal",l.setAttribute("editor-component","table-properties-modal"),l.innerHTML=`
508
+ <div class="table-properties-modal__mask"></div>
509
+ <div class="table-properties-modal__container">
510
+ <div class="table-properties-modal__header">
511
+ <span>表格属性</span>
512
+ <div class="table-properties-modal__close">×</div>
513
+ </div>
514
+ <div class="table-properties-modal__content">
515
+ <div class="form-row">
516
+ <label>上边距:</label>
517
+ <input type="number" id="tdPaddingTop" value="${s[0]}" min="0">
518
+ </div>
519
+ <div class="form-row">
520
+ <label>右边距:</label>
521
+ <input type="number" id="tdPaddingRight" value="${s[1]}" min="0">
522
+ </div>
523
+ <div class="form-row">
524
+ <label>下边距:</label>
525
+ <input type="number" id="tdPaddingBottom" value="${s[2]}" min="0">
526
+ </div>
527
+ <div class="form-row">
528
+ <label>左边距:</label>
529
+ <input type="number" id="tdPaddingLeft" value="${s[3]}" min="0">
530
+ </div>
531
+ </div>
532
+ <div class="table-properties-modal__footer">
533
+ <button class="btn-cancel">取消</button>
534
+ <button class="btn-confirm">确定</button>
535
+ </div>
536
+ </div>
537
+ `,document.body.appendChild(l);const a=l.querySelector(".table-properties-modal__mask"),c=l.querySelector(".table-properties-modal__close"),d=l.querySelector(".btn-cancel"),u=l.querySelector(".btn-confirm"),h=()=>{l.remove()};a.addEventListener("click",h),c.addEventListener("click",h),d.addEventListener("click",h),u.addEventListener("click",()=>{const R=parseInt(l.querySelector("#tdPaddingTop").value)||0,g=parseInt(l.querySelector("#tdPaddingRight").value)||0,m=parseInt(l.querySelector("#tdPaddingBottom").value)||0,f=parseInt(l.querySelector("#tdPaddingLeft").value)||0;i.tdPadding=[R,g,m,f],h();const{endIndex:T}=this.range.getRange();this.draw.render({curIndex:T,isCompute:!0})})}}var oi=(o=>(o.EDIT="edit",o.READONLY="readonly",o.FORM="form",o))(oi||{});class Nf{draw;zone;range;position;options;areaInfoMap=new Map;constructor(e){this.draw=e,this.options=e.getOptions(),this.zone=e.getZone(),this.range=e.getRange(),this.position=e.getPosition()}getAreaInfo(){return this.areaInfoMap}getActiveAreaId(){if(!this.areaInfoMap.size)return null;const{startIndex:e}=this.range.getRange();return this.draw.getElementList()[e]?.areaId||null}getActiveAreaInfo(){const e=this.getActiveAreaId();return e&&this.areaInfoMap.get(e)||null}isReadonly(){const e=this.getActiveAreaInfo();if(!e?.area)return!1;switch(e.area.mode){case oi.EDIT:return!1;case oi.READONLY:return!0;case oi.FORM:return!this.draw.getControl().getIsRangeWithinControl();default:return!1}}insertArea(e){const{id:t,value:n,area:i,position:r,range:s}=e;if(this.zone.getZone()!==De.MAIN&&this.zone.setZone(De.MAIN),this.draw.getPosition().setPositionContext({isTable:!1}),s&&!this.getActiveAreaId()){const{startIndex:a,endIndex:c}=s,d=this.draw.getOriginalMainElementList();if(!d[a]||!d[c])return null;this.range.setRange(s.startIndex,s.endIndex)}else if(r===St.BEFORE)this.range.setRange(0,0);else{const c=this.draw.getOriginalMainElementList().length-1;this.range.setRange(c,c)}const l=t||Ee();return this.draw.insertElementList([{type:O.AREA,value:"",areaId:l,valueList:n,area:xe(i)}]),l}render(e,t){if(!this.areaInfoMap.size)return;e.save();const n=this.draw.getMargins(),i=this.draw.getInnerWidth();for(const r of this.areaInfoMap){const{area:s,positionList:l}=r[1];if(s?.hide||!s?.backgroundColor&&!s?.borderColor&&!s?.placeholder)continue;const a=l.filter(g=>g.pageNo===t);if(!a.length)continue;e.translate(.5,.5);const c=a[0],d=a[a.length-1],u=n[3],h=Math.ceil(c.coordinate.leftTop[1]),R=Math.ceil(d.coordinate.rightBottom[1]-h);e.textBaseline="middle",s.backgroundColor&&(e.fillStyle=s.backgroundColor,e.fillRect(u,h,i,R)),s.borderColor&&(e.strokeStyle=s.borderColor,e.strokeRect(u,h,i,R)),s.placeholder&&l.length<=1&&new Wa(this.draw).render(e,{placeholder:{...El,...s.placeholder},startY:c.coordinate.leftTop[1]}),e.translate(-.5,-.5)}e.restore()}compute(){this.areaInfoMap.clear();const e=this.draw.getOriginalMainElementList(),t=this.position.getOriginalMainPositionList();for(let n=0;n<e.length;n++){const i=e[n],r=i.areaId;if(r){const s=this.areaInfoMap.get(r);s?(s.elementList.push(i),s.positionList.push(t[n])):this.areaInfoMap.set(r,{id:r,area:i.area,elementList:[i],positionList:[t[n]]})}}}getAreaValue(e={}){const t=e.id||this.getActiveAreaId();if(!t)return null;const n=this.areaInfoMap.get(t);return n?{area:n.area,id:n.id,startPageNo:n.positionList[0].pageNo,endPageNo:n.positionList[n.positionList.length-1].pageNo,value:Ge(n.elementList)}:null}getContextByAreaId(e,t){const n=this.draw.getOriginalMainElementList();for(let i=0;i<n.length;i++){const r=n[i];if(t?.position===St.OUTER_BEFORE){if(n[i+1]?.areaId!==e)continue}else if(t?.position===St.AFTER){if(!(r.areaId===e&&n[i+1]?.areaId!==e))continue}else if(t?.position===St.OUTER_AFTER){if(!(r.areaId!==e&&n[i-1]?.areaId===e))continue}else if(r.areaId!==e)continue;const s=this.position.getOriginalMainPositionList();return{range:{startIndex:i,endIndex:i},elementPosition:s[i]}}return null}setAreaProperties(e){const t=e.id||this.getActiveAreaId();if(!t)return;const n=this.areaInfoMap.get(t);if(!n)return;n.area||(n.area={});let i=!1;const r=["top","hide"];Object.entries(e.properties).forEach(([s,l])=>{if(Tl(l))return;const a=s;n.area[a]=l,r.includes(a)&&(i=!0)}),this.draw.render({isCompute:i,isSetCursor:!1})}setAreaValue(e){const t=e.id||this.getActiveAreaId();if(!t)return;const n=this.areaInfoMap.get(t);if(!n)return;const{positionList:i}=n,r=this.draw.getOriginalMainElementList(),s=e.value;ct([{type:O.AREA,value:"",valueList:s,areaId:n.id,area:n.area}],{editorOptions:this.options}),this.draw.spliceElementList(r,i[0].index,i.length,s,{isIgnoreDeletedRule:!0}),this.draw.render({isSetCursor:!1})}}class Ff{draw;options;imageCache;mainBadge;areaBadgeMap;constructor(e){this.draw=e,this.options=e.getOptions(),this.imageCache=new Map,this.mainBadge=null,this.areaBadgeMap=new Map}setMainBadge(e){this.mainBadge=e}setAreaBadgeMap(e){this.areaBadgeMap.clear(),e.forEach(t=>{this.areaBadgeMap.set(t.areaId,t.badge)})}_drawImage(e,t,n,i,r,s){if(this.imageCache.has(s)){const l=this.imageCache.get(s);e.drawImage(l,t,n,i,r)}else{const l=new Image;l.setAttribute("crossOrigin","Anonymous"),l.src=s,l.onload=()=>{this.imageCache.set(s,l),e.drawImage(l,t,n,i,r)}}}render(e,t){if(t===0&&this.mainBadge){const{scale:n,badge:i}=this.options,{left:r,top:s,width:l,height:a,value:c}=this.mainBadge,d=this.draw.getMargins()[0]+this.draw.getHeader().getExtraHeight(),u=(r||i.left)*n,h=(s||i.top)*n+d;this._drawImage(e,u,h,l*n,a*n,c)}if(this.areaBadgeMap.size){const n=this.draw.getArea().getAreaInfo();if(n.size){const{scale:i,badge:r}=this.options;for(const s of n){const{positionList:l}=s[1],a=l[0];if(a.pageNo!==t)continue;const c=this.areaBadgeMap.get(s[0]);if(!c)continue;const{left:d,top:u,width:h,height:R,value:g}=c,m=(d||r.left)*i,f=(u||r.top)*i+a.coordinate.leftTop[1];this._drawImage(e,m,f,h*i,R*i,g)}}}}}class Cf{draw;options;data;pageContainer;isDrawing=!1;startStroke=null;constructor(e,t){this.draw=e,this.options=e.getOptions(),this.data=t||[],this.pageContainer=e.getPageContainer(),this.register()}register(){this.pageContainer.addEventListener("mousedown",this.start.bind(this)),this.pageContainer.addEventListener("mouseup",this.stop.bind(this)),this.pageContainer.addEventListener("mouseleave",this.stop.bind(this)),this.pageContainer.addEventListener("mousemove",this.drawing.bind(this))}start(e){if(!this.draw.isGraffitiMode())return;this.isDrawing=!0;const{scale:t}=this.options;this.startStroke={lineColor:this.options.graffiti.defaultLineColor,lineWidth:this.options.graffiti.defaultLineWidth,points:[e.offsetX/t,e.offsetY/t]}}stop(){this.isDrawing=!1}drawing(e){if(!this.isDrawing||!this.draw.isGraffitiMode())return;const{offsetX:t,offsetY:n}=e,i=2;if(this.startStroke&&Math.abs(this.startStroke.points[0]-t)<i&&Math.abs(this.startStroke.points[1]-n)<i)return;const r=this.draw.getPageNo();let s=this.data.find(c=>c.pageNo===r);if(this.startStroke&&(s||(s={pageNo:r,strokes:[]},this.data.push(s)),s.strokes.push(this.startStroke),this.startStroke=null),!s?.strokes?.length)return;const{scale:l}=this.options;s.strokes[s.strokes.length-1].points.push(t/l,n/l),this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}getValue(){return this.data}compute(){const e=this.draw.getPageRowList().length;for(let t=this.data.length-1;t>=0;t--)this.data[t].pageNo>e-1&&this.data.splice(t,1)}clear(){this.data=[]}render(e,t){const n=this.data.find(l=>l.pageNo===t)?.strokes;if(!n?.length)return;const{graffiti:{defaultLineColor:i,defaultLineWidth:r},scale:s}=this.options;e.save();for(let l=0;l<n.length;l++){const a=n[l];e.beginPath(),e.strokeStyle=a.lineColor||i,e.lineWidth=(a.lineWidth||r)*s,e.moveTo(a.points[0]*s,a.points[1]*s);for(let c=2;c<a.points.length;c+=2)e.lineTo(a.points[c]*s,a.points[c+1]*s);e.stroke()}e.restore()}}class bf{container;pageContainer;pageList;ctxList;pageNo;renderCount;pagePixelRatio;mode;options;position;zone;elementList;listener;eventBus;override;i18n;canvasEvent;globalEvent;cursor;range;margin;background;badge;search;group;area;underline;strikeout;highlight;historyManager;previewer;imageParticle;laTexParticle;textParticle;tableParticle;tableTool;tableOperate;pageNumber;lineNumber;waterMark;placeholder;header;footer;hyperlinkParticle;labelParticle;macroParticle;dateParticle;separatorParticle;pageBreakParticle;superscriptParticle;subscriptParticle;checkboxParticle;radioParticle;menstrualHistoryParticle;fetalHeartPositionParticle;toothPositionParticle;blockParticle;listParticle;lineBreakParticle;whiteSpaceParticle;control;pageBorder;workerManager;scrollObserver;selectionObserver;imageObserver;graffiti;command;LETTER_REG;WORD_LIKE_REG;rowList;pageRowList;painterStyle;painterOptions;visiblePageNoList;intersectionPageNo;lazyRenderIntersectionObserver;printModeData;splitTdValueMap=new Map;tdMap=new Map;constructor(e,t,n,i,r,s){this.container=this._wrapContainer(e),this.pageList=[],this.ctxList=[],this.pageNo=0,this.renderCount=0,this.pagePixelRatio=null,this.mode=t.mode,this.options=t,this.elementList=n.main,this.listener=i,this.eventBus=r,this.override=s,this._formatContainer(),this.pageContainer=this._createPageContainer(),this._createPage(0),this.i18n=new Rf(t.locale),this.historyManager=new hu(this),this.position=new Ru(this),this.zone=new ff(this),this.range=new gu(this),this.margin=new mu(this),this.background=new pu(this),this.badge=new Ff(this),this.search=new Tu(this),this.group=new Lf(this),this.area=new Nf(this),this.underline=new Iu(this),this.strikeout=new Lu(this),this.highlight=new fu(this),this.previewer=new $p(this),this.imageParticle=new Il(this),this.laTexParticle=new Sl(this),this.textParticle=new Pu(this),this.tableParticle=new Mu(this),this.tableTool=new Xu(this),this.tableOperate=new Ef(this),this.pageNumber=new so(this),this.lineNumber=new Of(this),this.waterMark=new Wu(this),this.placeholder=new Wa(this),this.header=new Cu(this,n.header),this.footer=new mf(this,n.footer),this.hyperlinkParticle=new Eu(this),this.labelParticle=new Nu(this),this.macroParticle=new Fu(this),this.dateParticle=new qp(this),this.separatorParticle=new xu(this),this.pageBreakParticle=new vu(this),this.superscriptParticle=new bu,this.subscriptParticle=new yu,this.checkboxParticle=new Qp(this),this.radioParticle=new Kp(this),this.menstrualHistoryParticle=new Hp(this),this.fetalHeartPositionParticle=new _p(this),this.toothPositionParticle=new Ap(this),this.blockParticle=new ef(this),this.listParticle=new Tf(this),this.lineBreakParticle=new Do(this),this.whiteSpaceParticle=new If(this),this.control=new Up(this),this.pageBorder=new Sf(this),this.graffiti=new Cf(this,n.graffiti),this.scrollObserver=new Ou(this),this.selectionObserver=new Su(this),this.imageObserver=new gf,new Pf(this),this.canvasEvent=new cu(this),this.cursor=new Cd(this,this.canvasEvent),this.canvasEvent.register(),this.globalEvent=new uu(this,this.canvasEvent),this.globalEvent.register(),this.workerManager=new zp(this),new Xf(this);const{letterClass:l}=t;this.LETTER_REG=new RegExp(`[${l.join("")}]`),this.WORD_LIKE_REG=new RegExp(`${l.map(a=>`[^${a}][${a}]`).join("|")}`),this.rowList=[],this.pageRowList=[],this.painterStyle=null,this.painterOptions=null,this.visiblePageNoList=[],this.intersectionPageNo=0,this.lazyRenderIntersectionObserver=null,this.printModeData=null,this.mode===B.PRINT&&this.setPrintData(),this.mode,B.FORM,this.render({isInit:!0,isSetCursor:!1,isFirstRender:!0})}setPrintData(){this.printModeData={header:this.header.getElementList(),main:this.elementList,footer:this.footer.getElementList()};const e=xe(this.printModeData);["header","main","footer"].forEach(r=>{e[r]=this.control.filterAssistElement(e[r])});const n=e,i=this.removeStrikeout(n);e.main=i.main.filter(r=>!r.strikeout),this.setEditorData(i)}removeStrikeout(e){if(Array.isArray(e))return e.map(t=>this.removeStrikeout(t)).filter(t=>!(t&&typeof t=="object"&&"strikeout"in t&&t.strikeout===!0));if(e&&typeof e=="object"){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=this.removeStrikeout(e[n]));return t}return e}clearPrintData(){this.printModeData&&(this.setEditorData(this.printModeData),this.printModeData=null)}getLetterReg(){return this.LETTER_REG}getMode(){return this.mode}setMode(e){if(this.mode===e)return;this.mode=e,this.options.mode=e;const t=new Map,n=r=>{r.forEach(s=>{s.controlId&&(s.controlComponent==="value"&&t.set(s.controlId,!0),s.checked&&t.set(s.controlId,!0))})};n(this.elementList),this.elementList.forEach(r=>{r.type==="table"&&r.trList?.forEach(s=>{s.tdList?.forEach(l=>{n(l.value)})})});const i=r=>{r.forEach(s=>{if(!(!s.control&&!s.controlId)&&(s.controlComponent==="value"&&s.strikeout&&(e===B.PRINT?s.hide=!0:s.hide=!1),!!s.control&&!(s.type!=="control"&&s.control.type!=="button"))){if(s.control.type==="TextField"&&(s.controlComponent==="placeholder"||s.controlComponent==="preTextFix"||s.controlComponent==="preTextFixText"||s.controlComponent==="postTextFix"||s.controlComponent==="postTextFixText"||s.controlComponent==="textFixLabel")&&(e===B.EDIT?s.hide=!1:s.hide=!0),s.control.type==="text"&&(s.controlComponent==="placeholder"||s.controlComponent==="prefix"||s.controlComponent==="postfix")&&(e===B.EDIT||e===B.FORM?s.hide=!1:s.hide=!0),s.control.type==="number"||s.control.type==="select"||s.control.type==="date"||s.control.type==="checkbox"||s.control.type==="radio"){if(s.controlComponent==="placeholder"||s.controlComponent==="prefix"||s.controlComponent==="postfix"){const a=t.get(s.controlId);s.control.type==="select"&&e===B.PRINT||e===B.PRINT&&!a?s.hide=!0:s.hide=!1}s.control.type==="number"&&s.controlComponent==="value"&&(e===B.PRINT&&s.strikeout?s.hide=!0:e!==B.PRINT&&s.strikeout&&(s.hide=!1))}s.control.type==="button"&&(s.hide=!1,s.control.hide=!1),s.control.type==="menstrualHistory"&&(s.controlComponent==="prefix"||s.controlComponent==="postfix")&&(e===B.PRINT?s.hide=!0:s.hide=!1)}})};i(this.elementList),this.elementList.forEach(r=>{r.type==="table"&&r.trList.forEach(s=>{s.tdList.forEach(l=>{i(l.value)})})}),e===B.FORM?(this.elementList.filter(r=>r.type==="control").map(r=>{r.control?.type==="button"&&r.control.buttonText&&(r.color="#1677FF",r.highlight="transparent")}),this.hideTextFieldWhitespace(this.elementList,!0),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):e===B.EDIT?(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!0,!1)):(this.hideTextFieldWhitespace(this.elementList,!1),this.updateTextFieldPlaceholderVisibility(this.elementList,!1,!0)),e===B.PRINT?(this.elementList.filter(r=>r?.control?.type==="button").map(r=>{(r?.controlComponent==="prefix"||r?.controlComponent==="postfix")&&(r.color="transparent",r.highlight="transparent"),r?.controlComponent==="value"&&!r.control.buttonText&&(r.color="transparent",r.highlight="transparent")}),this.setPrintData()):(this.clearPrintData(),this.elementList.filter(r=>r?.control?.type==="button").map(r=>{(r?.controlComponent==="prefix"||r?.controlComponent==="postfix")&&!r.control.buttonText&&r.type==="control"&&(r.color="transparent",r.highlight="#1677FF"),r?.controlComponent==="value"&&!r.control.buttonText&&(r.color="#fff",r.highlight="#1677FF"),r?.type==="text"&&r.control.buttonText&&(r.color="#000"),r?.type==="control"&&r?.controlComponent==="value"&&r.control.buttonText&&(r.color="#000",r.highlight="transparent")})),this.mode===B.PRINT&&this.clearPrintData(),this.clearSideEffect(),this.control.destroyControl(),this.range.clearRange(),this.render({isSetCursor:!1,isSubmitHistory:!1})}hideTextFieldWhitespace(e,t){const n=r=>r?/^[\s\u00A0\u2000-\u200B\u3000\n\r\t]+$/.test(r):!1;(r=>{for(let s=0;s<r.length;s++){const l=r[s];if(l.type===O.TABLE&&l.trList)for(const a of l.trList)for(const c of a.tdList)this.hideTextFieldWhitespace(c.value,t);l.control?.type===Y.TEXTFIELD&&l.controlComponent===p.VALUE&&n(l.value)&&(l.hide=t)}})(e)}updateTextFieldPlaceholderVisibility(e,t,n){const i=[Y.TEXT,Y.TEXTFIELD,Y.SELECT,Y.DATE,Y.CHECKBOX,Y.RADIO,Y.NUMBER];(s=>{let l=0;for(;l<s.length;){const a=s[l];if(a.type===O.TABLE&&a.trList)for(const c of a.trList)for(const d of c.tdList)this.updateTextFieldPlaceholderVisibility(d.value,t,n);if(a.control?.type&&i.includes(a.control.type)&&(a.controlComponent===p.PREFIX||a.controlComponent===p.PRETEXTFIX||a.controlComponent===p.PRETEXTFIX_TEXT||a.controlComponent===p.PRE_TEXT)){const c=a.controlId,d=a.control.type;let u=!1,h=!1,R=!1;const g=[],m=[],f=[];let T=-1,I=l;for(;I<s.length;){const L=s[I];if(L.controlId!==c)break;if((L.controlComponent===p.PREFIX||L.controlComponent===p.PRETEXTFIX||L.controlComponent===p.PRETEXTFIX_TEXT)&&m.push(I),L.controlComponent===p.VALUE&&L.value&&L.value.trim()&&(u=!0),L.controlComponent===p.VALUE&&(L.type===O.MENSTRUAL_HISTORY||L.type===O.FETAL_HEART_POSITION||L.type===O.TOOTH_POSITION||L.type===O.MACRO||L.type===O.CUSTOM_MACRO)&&(u=!0),L.controlComponent===p.VALUE&&L.control&&L.control.type!==d&&(h=!0),L.controlComponent===p.PLACEHOLDER&&(R=!0,g.push(I)),L.controlComponent===p.POSTFIX||L.controlComponent===p.POSTTEXTFIX||L.controlComponent===p.POSTTEXTFIX_TEXT){f.push(I),T=I;break}I++}if(!u&&!h)if(R&&g.length>0)for(const L of g)s[L].hide=!t;else t&&a.control?.placeholder&&(T>0?this.control.addPlaceholder(T-1):this.control.addPlaceholder(l));if(n)if(t&&u){for(const L of m)s[L].hide=!0;for(const L of f)s[L].hide=!0}else if(t){for(const L of m)s[L].hide=!1;for(const L of f)s[L].hide=!1}else{for(const L of m)s[L].hide=!0;for(const L of f)s[L].hide=!0}else{for(const L of m)s[L].hide=!1;for(const L of f)s[L].hide=!1}l=I}l++}})(e)}isReadonly(){if(this.area.getActiveAreaInfo()?.area?.mode)return this.area.isReadonly();switch(this.mode){case B.DESIGN:return!1;case B.READONLY:case B.PRINT:case B.GRAFFITI:return!0;case B.FORM:if(this.control.getIsRangeWithinControl()){const e=this.getElementList(),{startIndex:t}=this.range.getRange();if(e[t]?.control?.type===Y.TEXTFIELD)return!0}return!this.control.getIsRangeWithinControl();default:return!1}}isDisabled(){if(this.mode===B.DESIGN)return!1;const{startIndex:e,endIndex:t}=this.range.getRange(),n=this.getElementList();if(this.getTd()?.disabled)return!0;if(e===t){const r=n[e],s=n[e+1];return!!(r?.title?.disabled&&s?.title?.disabled&&r.titleId===s.titleId||r?.control?.disabled&&s?.control?.disabled&&r.controlId===s.controlId)}return n.slice(e+1,t+1).some(r=>r.title?.disabled||r.control?.disabled)}isDesignMode(){return this.mode===B.DESIGN}isPrintMode(){return this.mode===B.PRINT}isGraffitiMode(){return this.mode===B.GRAFFITI}getOriginalWidth(){const{paperDirection:e,width:t,height:n}=this.options;return e===pn.VERTICAL?t:n}getOriginalHeight(){const{paperDirection:e,width:t,height:n}=this.options;return e===pn.VERTICAL?n:t}getWidth(){return Math.floor(this.getOriginalWidth()*this.options.scale)}getHeight(){return Math.floor(this.getOriginalHeight()*this.options.scale)}getMainHeight(){return this.getHeight()-this.getMainOuterHeight()}getMainOuterHeight(){const e=this.getMargins(),t=this.header.getExtraHeight(),n=this.footer.getExtraHeight();return e[0]+e[2]+t+n}getCanvasWidth(e=-1){return this.getPage(e).width}getCanvasHeight(e=-1){return this.getPage(e).height}getInnerWidth(){const e=this.getWidth(),t=this.getMargins();return e-t[1]-t[3]}getOriginalInnerWidth(){const e=this.getOriginalWidth(),t=this.getOriginalMargins();return e-t[1]-t[3]}getContextInnerWidth(){const e=this.position.getPositionContext();if(e.isTable){const{index:t,trIndex:n,tdIndex:i}=e,s=this.getOriginalElementList()[t],l=s.trList[n].tdList[i],a=this.getTdPadding(s);return l.width-a[1]-a[3]}return this.getOriginalInnerWidth()}getMargins(){return this.getOriginalMargins().map(e=>e*this.options.scale)}getOriginalMargins(){const{margins:e,paperDirection:t}=this.options;return t===pn.VERTICAL?e:[e[1],e[2],e[3],e[0]]}getPageGap(){return this.options.pageGap*this.options.scale}getOriginalPageGap(){return this.options.pageGap}getPageNumberBottom(){const{pageNumber:{bottom:e},scale:t}=this.options;return e*t}getMarginIndicatorSize(){return this.options.marginIndicatorSize*this.options.scale}getDefaultBasicRowMarginHeight(){return this.options.defaultBasicRowMarginHeight*this.options.scale}getHighlightMarginHeight(){return this.options.highlightMarginHeight*this.options.scale}getTdPadding(e){const{table:{tdPadding:t},scale:n}=this.options;return(e?.tdPadding||t).map(r=>r*n)}getContainer(){return this.container}getPageContainer(){return this.pageContainer}getVisiblePageNoList(){return this.visiblePageNoList}setVisiblePageNoList(e){this.visiblePageNoList=e,this.listener.visiblePageNoListChange&&this.listener.visiblePageNoListChange(this.visiblePageNoList),this.eventBus.isSubscribe("visiblePageNoListChange")&&this.eventBus.emit("visiblePageNoListChange",this.visiblePageNoList)}getIntersectionPageNo(){return this.intersectionPageNo}setIntersectionPageNo(e){this.intersectionPageNo=e,this.listener.intersectionPageNoChange&&this.listener.intersectionPageNoChange(this.intersectionPageNo),this.eventBus.isSubscribe("intersectionPageNoChange")&&this.eventBus.emit("intersectionPageNoChange",this.intersectionPageNo)}getPageNo(){return this.pageNo}setPageNo(e){this.pageNo=e}getRenderCount(){return this.renderCount}getPage(e=-1){return this.pageList[~e?e:this.pageNo]}getPageList(){return this.pageList}getPageCount(){return this.pageList.length}getTableRowList(e){const t=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:r}=t;return e[n].trList[i].tdList[r].rowList}getOriginalRowList(){const e=this.getZone();return e.isHeaderActive()?this.header.getRowList():e.isFooterActive()?this.footer.getRowList():this.rowList}getRowList(){return this.position.getPositionContext().isTable?this.getTableRowList(this.getOriginalElementList()):this.getOriginalRowList()}getPageRowList(){return this.pageRowList}getCtx(){return this.ctxList[this.pageNo]}getOptions(){return this.options}getSearch(){return this.search}getGroup(){return this.group}getArea(){return this.area}getBadge(){return this.badge}getHistoryManager(){return this.historyManager}getPosition(){return this.position}getZone(){return this.zone}getRange(){return this.range}getLineBreakParticle(){return this.lineBreakParticle}getTextParticle(){return this.textParticle}getHeaderElementList(){return this.header.getElementList()}getTableElementList(e){const t=this.position.getPositionContext(),{index:n,trIndex:i,tdIndex:r}=t;return e[n]?.trList?.[i].tdList[r].value||[]}getElementList(){const e=this.position.getPositionContext(),t=this.getOriginalElementList();return e.isTable?this.getTableElementList(t):t}getMainElementList(){return this.position.getPositionContext().isTable?this.getTableElementList(this.elementList):this.elementList}getOriginalElementList(){const e=this.getZone();return e.isHeaderActive()?this.getHeaderElementList():e.isFooterActive()?this.getFooterElementList():this.elementList}getOriginalMainElementList(){return this.elementList}getFooterElementList(){return this.footer.getElementList()}getTd(){const e=this.position.getPositionContext(),{index:t,trIndex:n,tdIndex:i,isTable:r}=e;return r?this.getOriginalElementList()[t].trList[n].tdList[i]:null}getTdByPosition(e){const{index:t,trIndex:n,tdIndex:i,isTable:r}=e;return r?this.getOriginalElementList()[t].trList[n].tdList[i]:null}insertElementTextField(e,t={}){if(!e.length||!this.range.getIsCanInput())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.getElementList(),{isSubmitHistory:s=!0}=t;ct(e,{isHandleFirstElement:!1,editorOptions:this.options});let l=-1,a=this.control.getActiveControl();if(!a&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),a=this.control.getActiveControl()),a&&this.control.getIsRangeWithinControl()){const c=n===i,d=n+1;c||this.newSpliceElementList(r,d,i-n),this.newSpliceElementList(r,d,0,e),l=n+e.length}else{const c=n===i,d=n+1;c||this.newSpliceElementList(r,d,i-n),this.newSpliceElementList(r,d,0,e),l=n+e.length;const u=r[d-1];e[0].listId&&u&&!u.listId&&u?.value===ee&&(!u.type||u.type===O.TEXTFIELD)&&(r.splice(n,1),l-=1)}this.control.destroyControl(),~l&&(this.range.setRange(l,l),this.render({curIndex:l,isSubmitHistory:s}))}insertElementList(e,t={}){if(!e.length||!this.range.getIsCanInput())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const{isSubmitHistory:r=!0}=t;ct(e,{isHandleFirstElement:!1,editorOptions:this.options});let s=-1,l=this.control.getActiveControl();if(!l&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),l=this.control.getActiveControl()),l&&this.control.getIsRangeWithinControl()){const a=this.getElementList(),c=n===i,d=n+1,u=a[n];if(u?.controlComponent===p.PRE_TEXT||u?.controlComponent===p.POST_TEXT||u?.controlComponent===p.PREFIX||u?.controlComponent===p.POSTFIX)for(let g=0;g<e.length;g++)e[g].control||(e[g].color=this.options.defaultColor);c&&(a[n]?.control?.type===Y.TEXTFIELD||a[n]?.control?.type===Y.TEXT)&&this.control.removePlaceholder(n),c||this.newSpliceElementList(a,d,i-n);const R=a[n]?.controlId||a[n-1]?.controlId||a[n+1]?.controlId;for(let g=0;g<e.length;g++){if(e[g]?.control?.type=="button"&&!e[g]?.control?.buttonText&&(e[g]?.controlComponent==="prefix"||e[g]?.controlComponent==="postfix"?(e[g].color="transparent",e[g].highlight="#1677FF"):(e[g].color="#fff",e[g].highlight="#1677FF")),e[g]?.type===O.MENSTRUAL_HISTORY||e[g]?.type===O.FETAL_HEART_POSITION||e[g]?.type===O.TOOTH_POSITION||e[g]?.type===O.MACRO||e[g]?.type===O.CUSTOM_MACRO||e[g]?.type===O.REUSABLE_ITEM||e[g]?.type===O.SPECIAL_SYMBOLS){e[g].controlComponent=p.VALUE;let m=a[n]?.controlId;m||(m=a[n-1]?.controlId),m||(m=a[n+1]?.controlId),!e[g].controlId&&m&&(e[g].controlId=m)}R&&e[g]?.control&&e[g].controlId&&e[g].controlId!==R&&(e[g].originControlId=R)}this.newSpliceElementList(a,d,0,e),s=n+e.length}else{const a=this.getElementList(),c=n===i,d=n+1;if(a[d]?.control?.type=="TextField"||a[n]?.control?.type=="TextField"){c||this.newSpliceElementList(a,d,i-n);for(let u=0;u<e.length;u++)if(e[u]?.type===O.MENSTRUAL_HISTORY||e[u]?.type===O.FETAL_HEART_POSITION||e[u]?.type===O.TOOTH_POSITION||e[u]?.type===O.MACRO||e[u]?.type===O.CUSTOM_MACRO||e[u]?.type===O.REUSABLE_ITEM||e[u]?.type===O.SPECIAL_SYMBOLS){e[u].controlComponent=p.VALUE;const h=a[n]?.controlId||a[d]?.controlId;!e[u].controlId&&h&&(e[u].controlId=h)}this.newSpliceElementList(a,d,0,e),s=n+e.length}else{c||this.spliceElementList(a,d,i-n);for(let h=0;h<e.length;h++)e[h]?.control?.type=="button"&&!e[h]?.control?.buttonText&&(e[h]?.controlComponent==="prefix"||e[h]?.controlComponent==="postfix"?(e[h].color="transparent",e[h].highlight="#1677FF"):(e[h].color="#fff",e[h].highlight="#1677FF"));this.spliceElementList(a,d,0,e),s=n+e.length;const u=a[d-1];e[0].listId&&u&&!u.listId&&u?.value===ee&&(!u.type||u.type===O.TEXT)&&(a.splice(n,1),s-=1)}}~s&&(this.range.setRange(s,s),this.render({curIndex:s,isSubmitHistory:r}))}appendElementList(e,t={}){if(!e.length)return;ct(e,{isHandleFirstElement:!1,editorOptions:this.options});let n;const{isPrepend:i,isSubmitHistory:r=!0}=t;i?(this.elementList.splice(1,0,...e),n=e.length):(this.elementList.push(...e),n=this.elementList.length-1),this.range.setRange(n,n),this.render({curIndex:n,isSubmitHistory:r})}spliceElementList(e,t,n,i,r){const{isIgnoreDeletedRule:s=!1}=r||{},{group:l,modeRule:a}=this.options;if(n>0){const c=t+n,u=e[c]?.listId;if(u&&e[t-1]?.listId!==u){let h=c;for(;h<e.length;){const R=e[h];if(R.listId!==u||R.value===ee)break;delete R.listId,delete R.listType,delete R.listStyle,h++}}if(!s&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const h=this.getTd()?.deletable;let R=c-1;for(;R>=t;){const g=e[R];(g?.hide||g?.control?.hide||g?.area?.hide||h!==!1&&g?.control?.deletable!==!1&&(!g.controlId||this.mode!==B.FORM||!a[this.mode].controlDeletableDisabled)&&g?.title?.deletable!==!1&&(l.deletable!==!1||!g.groupIds?.length)&&(g?.area?.deletable!==!1||g?.areaIndex!==0))&&e.splice(R,1),R--}}else e.splice(t,n)}if(i?.length)for(let c=0;c<i.length;c++)!i[c].controlComponent&&e[t]?.controlComponent&&(i[c].controlId=e[t].controlId,i[c].control=e[t].control,i[c].controlComponent=e[t].controlComponent),e.splice(t+c,0,i[c])}newSpliceElementList(e,t,n,i,r){const{isIgnoreDeletedRule:s=!1}=r||{},{group:l,modeRule:a}=this.options;if(n>0){const d=t+n,h=e[d]?.listId;if(h&&e[t-1]?.listId!==h){let R=d;for(;R<e.length;){const g=e[R];if(g.listId!==h||g.value===ee)break;delete g.listId,delete g.listType,delete g.listStyle,R++}}if(!s&&!this.isDesignMode()&&!this.control.getIsRangeWithinControl()){const R=this.getTd()?.deletable;let g=d-1;for(;g>=t;){const m=e[g];(m?.hide||m?.control?.hide||m?.area?.hide||R!==!1&&m?.control?.deletable!==!1&&(!m.controlId||this.mode!==B.FORM||!a[this.mode].controlDeletableDisabled)&&m?.title?.deletable!==!1&&(l.deletable!==!1||!m.groupIds?.length)&&(m?.area?.deletable!==!1||m?.areaIndex!==0))&&e.splice(g,1),g--}}else e.splice(t,n)}const c=e[t]?.controlId;if(i?.length)for(let d=0;d<i.length;d++)c&&(i[d].originControlId=c),e.splice(t+d,0,i[d])}getCanvasEvent(){return this.canvasEvent}getGlobalEvent(){return this.globalEvent}getListener(){return this.listener}getEventBus(){return this.eventBus}getOverride(){return this.override}getCursor(){return this.cursor}getPreviewer(){return this.previewer}getImageParticle(){return this.imageParticle}getTableTool(){return this.tableTool}getTableOperate(){return this.tableOperate}getTableParticle(){return this.tableParticle}getHeader(){return this.header}getFooter(){return this.footer}getHyperlinkParticle(){return this.hyperlinkParticle}getMacroParticle(){return this.macroParticle}getDateParticle(){return this.dateParticle}getListParticle(){return this.listParticle}getCheckboxParticle(){return this.checkboxParticle}getRadioParticle(){return this.radioParticle}getMenstrualHistoryParticle(){return this.menstrualHistoryParticle}getFetalHeartPositionParticle(){return this.fetalHeartPositionParticle}getToothPositionParticle(){return this.toothPositionParticle}getControl(){return this.control}getWorkerManager(){return this.workerManager}getImageObserver(){return this.imageObserver}getI18n(){return this.i18n}getGraffiti(){return this.graffiti}setCommand(e){this.command=e}getCommand(){return this.command}getRowCount(){return this.getRowList().length}async getDataURL(e={}){const{pixelRatio:t,mode:n}=e;t&&this.setPagePixelRatio(t);const i=this.mode,r=!!n&&i!==n;r&&this.setMode(n),this.render({isLazy:!1,isCompute:!1,isSetCursor:!1,isSubmitHistory:!1}),await this.imageObserver.allSettled();const s=this.pageList.map(l=>l.toDataURL());return t&&this.setPagePixelRatio(null),r&&this.setMode(i),s}getPainterStyle(){return this.painterStyle&&Object.keys(this.painterStyle).length?this.painterStyle:null}getPainterOptions(){return this.painterOptions}setPainterStyle(e,t){this.painterStyle=e,this.painterOptions=t||null,this.getPainterStyle()&&this.pageList.forEach(n=>n.style.cursor="copy")}setDefaultRange(){this.elementList.length&&setTimeout(()=>{const e=this.elementList.length-1;this.range.setRange(e,e),this.range.setRangeStyle()})}getIsPagingMode(){return this.options.pageMode===wn.PAGING}setPageMode(e){if(!e||this.options.pageMode===e)return;if(this.options.pageMode=e,e===wn.PAGING){const{height:i}=this.options,r=this.getPagePixelRatio(),s=this.pageList[0];s.style.height=`${i}px`,s.height=i*r,this._initPageContext(this.ctxList[0])}else this._disconnectLazyRender(),this.header.recovery(),this.footer.recovery(),this.zone.setZone(De.MAIN);const{startIndex:t}=this.range.getRange(),n=this.range.getIsCollapsed();this.render({isSetCursor:!0,curIndex:t,isSubmitHistory:!1}),n||this.cursor.drawCursor({isShow:!1}),setTimeout(()=>{this.listener.pageModeChange&&this.listener.pageModeChange(e),this.eventBus.isSubscribe("pageModeChange")&&this.eventBus.emit("pageModeChange",e)})}setPageScale(e){const t=this.getPagePixelRatio();this.options.scale=e;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((s,l)=>{s.width=n*t,s.height=i*t,s.style.width=`${n}px`,s.style.height=`${i}px`,s.style.marginBottom=`${this.getPageGap()}px`,this._initPageContext(this.ctxList[l])});const r=this.position.getCursorPosition();this.render({isSubmitHistory:!1,isSetCursor:!!r,curIndex:r?.index}),this.listener.pageScaleChange&&this.listener.pageScaleChange(e),this.eventBus.isSubscribe("pageScaleChange")&&this.eventBus.emit("pageScaleChange",e)}getPagePixelRatio(){return this.pagePixelRatio||window.devicePixelRatio}setPagePixelRatio(e){!this.pagePixelRatio&&e===window.devicePixelRatio||e===this.pagePixelRatio||(this.pagePixelRatio=e,this.setPageDevicePixel())}setPageDevicePixel(){const e=this.getPagePixelRatio(),t=this.getWidth(),n=this.getHeight();this.pageList.forEach((i,r)=>{i.width=t*e,i.height=n*e,this._initPageContext(this.ctxList[r])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperSize(e,t){this.options.width=e,this.options.height=t;const n=this.getPagePixelRatio(),i=this.getWidth(),r=this.getHeight();this.container.style.width=`${i}px`,this.pageList.forEach((s,l)=>{s.width=i*n,s.height=r*n,s.style.width=`${i}px`,s.style.height=`${r}px`,this._initPageContext(this.ctxList[l])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperDirection(e){const t=this.getPagePixelRatio();this.options.paperDirection=e;const n=this.getWidth(),i=this.getHeight();this.container.style.width=`${n}px`,this.pageList.forEach((r,s)=>{r.width=n*t,r.height=i*t,r.style.width=`${n}px`,r.style.height=`${i}px`,this._initPageContext(this.ctxList[s])}),this.render({isSubmitHistory:!1,isSetCursor:!1})}setPaperMargin(e){this.options.margins=e,this.render({isSubmitHistory:!1,isSetCursor:!1})}getOriginValue(e={}){const{pageNo:t}=e;let n=this.elementList;return Number.isInteger(t)&&t>=0&&t<this.pageRowList.length&&(n=this.pageRowList[t].flatMap(r=>r.elementList)),{header:this.getHeaderElementList(),main:n,footer:this.getFooterElementList(),graffiti:this.graffiti.getValue()}}getValue(e={}){const t=this.getOriginValue(e);console.log(this.elementList,"所有元素");const{extraPickAttrs:n}=e,i={header:Ge(t.header,{extraPickAttrs:n,editorOptions:this.options}),main:Ge(t.main,{extraPickAttrs:n,isClassifyArea:!0,editorOptions:this.options}),footer:Ge(t.footer,{extraPickAttrs:n,editorOptions:this.options}),graffiti:t.graffiti};return{version:Os,data:i,options:xe(this.options)}}setValue(e,t){const{header:n,main:i,footer:r}=xe(e);if(!n&&!i&&!r)return;const{isSetCursor:s=!1}=t||{};[n,i,r].forEach(c=>{c&&ct(c,{editorOptions:this.options,isForceCompensation:!0})}),this.setEditorData({header:n,main:i,footer:r}),this.historyManager.recovery();const a=s?i?.length?i.length-1:0:void 0;a!==void 0&&this.range.setRange(a,a),this.render({curIndex:a,isSetCursor:s,isFirstRender:!0})}setEditorData(e){const{header:t,main:n,footer:i}=e;t&&this.header.setElementList(t),n&&(this.elementList=n),i&&this.footer.setElementList(i)}_wrapContainer(e){const t=document.createElement("div");return e.append(t),t}_formatContainer(){this.container.style.position="relative",this.container.style.width=`${this.getWidth()}px`,this.container.setAttribute(Rt,gt.MAIN)}_createPageContainer(){const e=document.createElement("div");return e.classList.add(`${re}-page-container`),this.container.append(e),e}_createPage(e){const t=this.getWidth(),n=this.getHeight(),i=document.createElement("canvas");i.style.width=`${t}px`,i.style.height=`${n}px`,i.style.display="block",i.style.backgroundColor="#ffffff",i.style.marginBottom=`${this.getPageGap()}px`,i.setAttribute("data-index",String(e)),this.pageContainer.append(i);const r=this.getPagePixelRatio();i.width=t*r,i.height=n*r,i.style.cursor="text";const s=i.getContext("2d");this._initPageContext(s),this.pageList.push(i),this.ctxList.push(s)}_initPageContext(e){const t=this.getPagePixelRatio();e.scale(t,t),e.letterSpacing="0px",e.wordSpacing="0px",e.direction="ltr"}getElementFont(e,t=1){const{defaultSize:n,defaultFont:i}=this.options,r=e.font||i,s=e.actualSize||e.size||n;return`${e.italic?"italic ":""}${e.bold?"bold ":""}${s*t}px ${r}`}getElementSize(e){return e.actualSize||e.size||this.options.defaultSize}getElementRowMargin(e){const{defaultSize:t,defaultBasicRowMarginHeight:n,defaultRowMargin:i,scale:r}=this.options,s=e.size||t;let l=1;return s<12?l=s/12:s>30&&(l=1+(s-30)/30),n*l*(e.rowMargin??i)*r}computeRowList(e){const{innerWidth:t,elementList:n,isPagingMode:i=!1,isFromTable:r=!1,startX:s=0,startY:l=0,pageHeight:a=0,mainOuterHeight:c=0,surroundElementList:d=[]}=e,{defaultSize:u,scale:h,imgCaption:R,table:{tdPadding:g,defaultTrMinHeight:m},defaultTabWidth:f}=this.options,T=this.getDefaultBasicRowMarginHeight(),L=document.createElement("canvas").getContext("2d"),S=this.listParticle.computeListStyle(L,n),M=[];n.length&&M.push({width:0,height:0,ascent:0,elementList:[],startIndex:0,rowIndex:0,rowFlex:n?.[0]?.rowFlex||n?.[1]?.rowFlex});let X=s,x=l,F=0,D,V=0,E=0;for(let v=0;v<n.length;v++){const b=M[M.length-1],P=n[v];this.clearElementEffect(P);const y=this.getElementRowMargin(P),N={width:0,height:0,boundingBoxAscent:0,boundingBoxDescent:0},U=b.offsetX||P.listId&&S.get(P.listId)||0,w=t-U,Q=b.elementList.length===1;if(X+=Q?U:0,x+=Q&&b.offsetY||0,(P.control?.type===Y.TEXTFIELD||P.control?.type===Y.TEXT)&&!this.isDesignMode()&&(P.controlComponent===p.PRETEXTFIX||P.controlComponent===p.PRETEXTFIX_TEXT||P.controlComponent===p.POSTTEXTFIX||P.controlComponent===p.POSTTEXTFIX_TEXT||P.controlComponent===p.TEXTFIXLABEL||P.controlComponent===p.PLACEHOLDER||P.controlComponent===p.PREFIX||P.controlComponent===p.POSTFIX)){const H=P.control?.type===Y.TEXTFIELD,te=P.controlId;let _=!1,j=v;for(;j<n.length;){const G=n[j];if(G.controlId!==te)break;if(G.controlComponent===p.VALUE){_=!0;break}if(G.controlComponent===p.POSTTEXTFIX||G.controlComponent===p.POSTFIX)break;j++}if(!_)for(j=v;j>=0;){const G=n[j];if(G.controlId!==te)break;if(G.controlComponent===p.VALUE){_=!0;break}if(G.controlComponent===p.PRETEXTFIX||G.controlComponent===p.PREFIX)break;j--}H?this.mode===B.EDIT?P.hide=!1:P.hide=!0:this.mode===B.EDIT?P.hide=!1:this.mode===B.FORM?P.controlComponent===p.PLACEHOLDER||P.controlComponent===p.TEXTFIXLABEL?P.hide=_:P.hide=!1:P.hide=!0}if((P.hide||P.control?.hide||P.area?.hide)&&!this.isDesignMode()){const H=b.elementList[b.elementList.length-1];N.height=H?.metrics.height||this.options.defaultSize*h,N.boundingBoxAscent=H?.metrics.boundingBoxAscent||0,N.boundingBoxDescent=H?.metrics.boundingBoxDescent||0}else if(P.type===O.IMAGE||P.type===O.LATEX)if(P.imgDisplay===Ne.SURROUND||P.imgDisplay===Ne.FLOAT_TOP||P.imgDisplay===Ne.FLOAT_BOTTOM)N.width=0,N.height=0,N.boundingBoxDescent=0;else{const H=P.width*h,te=P.height*h;if(H>w){const _=te*w/H;P.width=w/h,P.height=_/h,N.width=w,N.height=_,N.boundingBoxDescent=_}else N.width=H,N.height=te,N.boundingBoxDescent=te;if(P.imgCaption?.value){const _=P.imgCaption.size||R.size,j=P.imgCaption.top??R.top,G=(_+j)*h;N.boundingBoxAscent+=G}}else if(P.type===O.TABLE){const H=P.tdPadding||g;if(P.pagingId){let ae=v+1,Ie=0;for(;ae<n.length;){const me=n[ae];if(me.pagingId===P.pagingId){const Oe=me.trList.filter(Ue=>!Ue.pagingRepeat).filter(Ue=>(Ue.tdList=Ue.tdList.filter(Ye=>{if(Ye.originalId){for(let ve=0;ve<P.trList.length;ve++){const qe=P.trList[ve],je=qe.tdList.find(({id:pt})=>pt===Ye.originalId);if(je){Ye.value[0]?.type===O.SPLIT_TAG&&Ye.value.splice(0,1),je.value.push(...Ye.value.map(pt=>this.updateElementTableInfo(pt,P,qe,je))),je.rowspan=je.originalRowspan??je.rowspan;break}}return!1}return!0}),!Ue.originalId));P.trList.push(...Oe),P.height+=me.height,ae++,Ie++}else break}Ie&&n.splice(v+1,Ie)}P.pagingIndex=P.pagingIndex??0,this.tableParticle.computeTrHeight(P,ae=>this.computeRowList({innerWidth:(ae.width-(H[1]+H[3]))*h,elementList:ae.value,isFromTable:!0,isPagingMode:i})),P.trList?.forEach(ae=>{ae.tdList.forEach(Ie=>{this.tdMap.set(Ie.id,Ie)})});const te=this.tableParticle.getTableHeight(P),_=this.tableParticle.getTableWidth(P);P.width=_,P.height=te;const j=_*h,G=te*h;if(N.width=j,N.height=G,N.boundingBoxDescent=G,N.boundingBoxAscent=-y,n[v+1]?.type===O.TABLE&&(N.boundingBoxAscent-=y),i){const ae=this.getHeight(),Ie=this.getMainOuterHeight();let me=Ie;for(let ve=0;ve<M.length;ve++){const qe=M[ve],je=qe.offsetY||0;qe.height+me+je>ae||M[ve-1]?.isPageBreak?me=Ie+qe.height+je:me+=qe.height+je}const Oe=y*2,Ue=P.trList[0].height*h;(me+Ue+Oe>ae||P.pagingIndex!==0&&P.trList[0].pagingRepeat||n[v-1]?.type===O.PAGE_BREAK)&&(me=Ie);let Ye=ae-(me+Oe);if(G>Ye){const ve=P.trList;let qe=0,je=0,pt=0;for(let _e=0;_e<ve.length;_e++){const Ae=ve[_e],We=Ae.height*h;if(me+Oe+pt+We>ae){const lt=Ae;let Ct=0;const rt={...xe(lt),id:Ee(),originalId:lt.originalId??lt.id,minHeight:void 0,tdList:P.colgroup.map((Ze,Et)=>{if(Ct--,Ct>0)return;const dt=lt.tdList.find(Qt=>Qt.colIndex===Et),Ot=dt??this.tableParticle.findPreRowSpanTd(ve,_e,Et);dt&&(Ct=dt.colspan);const Zt=Ee();return Ot.originalRowspan=Ot.rowspan,dt?{...dt,id:Zt,originalId:dt.originalId??dt.id,linkTdPrevId:dt.id,tdIndex:Et,original:Ot}:{id:Zt,originalId:Ot.originalId??Ot.id,linkTdPrevId:Ot.id,tdIndex:Et,colIndex:Et,colspan:1,rowspan:1,value:[],rowList:[],original:Ot}}).filter(Ze=>!!Ze)},Pt=rt.tdList,ft=Pt.map(Ze=>Ze.original);ft.forEach((Ze,Et)=>{const dt=[];let Ot=Ye;if(Ze.rowspan>1){const Qt=ve.slice(Ze.trIndex,Ze.trIndex+_e-Ze.trIndex);Ot+=Qt.reduce((bn,yn)=>yn.height*h+bn,0)}for(;Ze.mainHeight*h>Ot&&Ze.rowList?.length;){const Qt=Ze.rowList.pop();Ze.value.splice(Ze.value.length-Qt.elementList.length),dt.unshift(Qt),Ze.mainHeight-=Qt.height}const Zt=Pt[Et];Zt.rowList=dt,Zt.value=dt.map(Qt=>Qt.elementList).flat()});let Wt=!0;const co=lt.tdList.some(Ze=>Ze.rowList?.length),bt=rt.tdList.some(Ze=>Ze.rowList?.length),Bt=lt.minHeight>Ye;if(bt||Bt){(co||!bt&&Bt)&&(Bt&&(lt.originalMinHeight=lt.minHeight,lt.minHeight=Ye,rt.minHeight=Math.max(lt.originalMinHeight-Ye,m)),rt.tdList.forEach(Ze=>{Ze.original.linkTdNextId=Ze.id,Ze.value.length&&Ze.value[0].value!==ee&&Ze.value.unshift({...Ze.original.value.slice(-1).pop(),value:ee,type:O.SPLIT_TAG})}),ve.splice(qe+1,0,rt),qe+=1,je=ve.length-qe,Wt=!1),ft.forEach(Ze=>{if(Ze.rowspan>1){const Et=Ze.rowspan-(_e-Ze.trIndex);Ze.rowspan=_e-Ze.trIndex+(co?1:0);const dt=rt.tdList.find(Ot=>Ot.colIndex===Ze.colIndex);co?dt.rowspan=Et:(dt.original.linkTdNextId=dt.id,lt.tdList.push({...Ze,...dt,rowspan:Et}),lt.tdList.sort((Ot,Zt)=>Ot.colIndex-Zt.colIndex),dt.value=[])}}),Wt&&ft.forEach((Ze,Et)=>{Ze.value.push(...Pt[Et].value)});break}}qe=_e+1,je=ve.length-qe,pt+=We,Ye-=We}if(je){const _e=ve.splice(qe,je),Ae=P.pagingId||Ee();P.pagingId=Ae;const We=xe(P);We.originalId=P.originalId??P.id,We.pagingId=Ae,We.pagingIndex=P.pagingIndex+1;const lt=ve.filter(Pt=>Pt.pagingRepeat);if(lt.length){const Pt=xe(lt);Pt.forEach(ft=>ft.id=Ee()),_e.unshift(...Pt)}We.trList=_e,We.id=Ee(),We.trList?.forEach(Pt=>{Pt.tdList.forEach(ft=>{if(delete ft.valueStartIndex,ft.linkTdPrevId){const Wt=this.getTdById(ft.linkTdPrevId);ft.valueStartIndex=Wt?(Wt.valueStartIndex??0)+Wt.value.length:0,this.splitTdValueMap.has(ft.originalId)?this.splitTdValueMap.get(ft.originalId).push(...ft.value):Wt&&this.splitTdValueMap.set(ft.originalId,[...Wt.value,...ft.value])}ft.value.forEach(Wt=>this.updateElementTableInfo(Wt,We,Pt,ft))})}),this.spliceElementList(n,v+1,0,[We]),this.tableParticle.computeTrHeight(P);const Ct=this.tableParticle.getTableHeight(P),rt=Ct*h;P.height=Ct,N.height=rt,N.boundingBoxDescent=rt}}if(P.pagingId){const ve=this.position.getPositionContext();if(ve.isTable){let qe=-1,je=-1,pt=v;for(;pt<n.length;){const _e=n[pt];if(_e.pagingId!==P.pagingId)break;const Ae=_e.trList.findIndex(We=>We.id===ve.trId);if(~Ae){qe=pt,je=Ae;break}pt++}~qe&&(ve.index=qe,ve.trIndex=je,this.position.setPositionContext(ve))}}}this.initTableElementIndex(P,v)}else if(P.type===O.SEPARATOR){const{separator:{lineWidth:H}}=this.options,te=P.lineWidth||H;P.width=w/h,N.width=w,N.height=te*h,N.boundingBoxAscent=-y,N.boundingBoxDescent=-y+N.height}else if(P.type===O.PAGE_BREAK)P.width=w/h,N.width=w,N.height=u;else if(P.type===O.RADIO||P.controlComponent===p.RADIO){const{width:H,height:te,gap:_}=this.options.radio,j=H+_*2;P.width=j,N.width=j*h,N.height=te*h}else if(P.type===O.CHECKBOX||P.controlComponent===p.CHECKBOX){const{width:H,height:te,gap:_}=this.options.checkbox,j=H+_*2;P.width=j,N.width=j*h,N.height=te*h}else if(P.type===O.MENSTRUAL_HISTORY){const H=this.menstrualHistoryParticle.computeSize(P);P.width=H.width/h,N.width=H.width,N.height=H.height,N.boundingBoxAscent=H.height,N.boundingBoxDescent=0}else if(P.type===O.FETAL_HEART_POSITION){const H=this.fetalHeartPositionParticle.computeSize(P);P.width=H.width/h,N.width=H.width,N.height=H.height,N.boundingBoxAscent=H.height/2,N.boundingBoxDescent=H.height/2}else if(P.type===O.TOOTH_POSITION){const H=this.toothPositionParticle.computeSize(P);P.width=H.width/h,N.width=H.width,N.height=H.height,N.boundingBoxAscent=H.height/2,N.boundingBoxDescent=H.height/2}else if(P.type===O.TAB)N.width=f*h,N.height=u*h,N.boundingBoxDescent=0,N.boundingBoxAscent=this.textParticle.getBasisWordBoundingBoxAscent(L,L.font);else if(P.type===O.BLOCK){if(!P.width)N.width=w;else{const H=P.width*h;N.width=Math.min(H,w)}N.height=P.height*h,N.boundingBoxDescent=N.height,N.boundingBoxAscent=0}else if(P.type===O.LABEL){const{defaultSize:H,label:{defaultPadding:te}}=this.options;L.font=this.getElementFont(P);const _=this.textParticle.measureText(L,P);N.width=(_.width+te[1]+te[3])*h,N.height=(P.size||H)*h,N.boundingBoxDescent=0,N.boundingBoxAscent=(te[0]+_.actualBoundingBoxAscent)*h}else if(P.type===O.MACRO||P.type===O.CUSTOM_MACRO||P.type===O.REUSABLE_ITEM){const{defaultSize:H}=this.options;L.font=this.getElementFont(P);const te=this.getMode(),_=te==="edit",j=te==="form";if(_){const G=P.label||P.value||"";L.font=this.getElementFont(P);const ae=L.measureText(G),Ie=8*h,me=4*h;N.width=ae.width+Ie*2;const Oe=ae.actualBoundingBoxAscent+ae.actualBoundingBoxDescent;N.height=Oe+me*2;const Ue=this.textParticle.measureBasisWord(L,this.getElementFont(P));N.boundingBoxAscent=Ue.actualBoundingBoxAscent*h,N.boundingBoxDescent=Ue.actualBoundingBoxDescent*h}else if(P.type===O.CUSTOM_MACRO){const G=P.macroConfig,ae=G?.value||"";if(j){const Ie=G?.type||"text",me=this.textParticle.measureText(L,P),Oe=P.label||"";if(Ie==="select"){const Ue=ae||`请选择${Oe}`,Ye=L.measureText(Ue),ve=L.measureText("[").width,qe=6*h+2*h;N.width=ve+Ye.width+qe+ve}else{const Ue=ae||`请输入${Oe}`,Ye=L.measureText(Ue),ve=L.measureText("[").width;N.width=ve+Ye.width+ve}N.height=(P.size||H)*h,N.boundingBoxDescent=me.actualBoundingBoxDescent*h,N.boundingBoxAscent=me.actualBoundingBoxAscent*h}else{const Ie=P.label||"",me=ae||`请输入${Ie}`,Oe=L.measureText(me);N.width=Oe.width,N.height=(P.size||H)*h,N.boundingBoxDescent=Oe.actualBoundingBoxDescent,N.boundingBoxAscent=Oe.actualBoundingBoxAscent}}else if(P.type===O.REUSABLE_ITEM){const ae=P.reusableItemConfig?.value||"",Ie=P.label||"";if(j){const me=this.textParticle.measureText(L,P),Oe=ae||`获取 ${Ie}`,Ue=L.measureText(Oe),Ye=L.measureText("[").width;N.width=Ye+Ue.width+Ye,N.height=(P.size||H)*h,N.boundingBoxDescent=me.actualBoundingBoxDescent*h,N.boundingBoxAscent=me.actualBoundingBoxAscent*h}else{const me=ae||`获取 ${Ie}`,Oe=L.measureText(me);N.width=Oe.width,N.height=(P.size||H)*h,N.boundingBoxDescent=Oe.actualBoundingBoxDescent,N.boundingBoxAscent=Oe.actualBoundingBoxAscent}}else{const G=P.label||"",ae=P.value||`获取 ${G}`,Ie=L.measureText(ae);N.width=Ie.width,N.height=(P.size||H)*h,N.boundingBoxDescent=Ie.actualBoundingBoxDescent,N.boundingBoxAscent=Ie.actualBoundingBoxAscent}}else{const H=P.size||u;(P.type===O.SUPERSCRIPT||P.type===O.SUBSCRIPT)&&(P.actualSize=Math.ceil(H*.6)),N.height=(P.actualSize||H)*h,L.font=this.getElementFont(P);const te=this.textParticle.measureText(L,P);N.width=te.width*h,P.letterSpacing&&(N.width+=P.letterSpacing*h);const _=this.textParticle.measureBasisWord(L,P.font);N.boundingBoxAscent=_.actualBoundingBoxAscent*h,N.boundingBoxDescent=_.actualBoundingBoxDescent*h,P.type===O.SUPERSCRIPT?N.boundingBoxAscent+=N.height/2:P.type===O.SUBSCRIPT&&(N.boundingBoxDescent+=N.height/2)}const K=!P.hide&&(P.imgDisplay!==Ne.INLINE&&P.type===O.IMAGE||P.type===O.LATEX)?N.height+y:N.boundingBoxAscent+y,z=y+N.boundingBoxAscent+N.boundingBoxDescent+y,$=Object.assign(P,{metrics:N,left:0,style:this.getElementFont(P,h)});$.control?.minWidth&&($.controlComponent&&(E+=N.width),$.controlComponent===p.POSTFIX&&(this.control.setMinWidthControlInfo({row:b,rowElement:$,availableWidth:w,controlRealWidth:E}),E=0));const le=n[v-1];let Pe=n[v+1],se=b.width+N.width;if(this.options.wordBreak===Ns.BREAK_WORD&&(!le?.type||le?.type===O.TEXT)&&(!P.type||P.type===O.TEXT)){const H=`${le?.value||""}${P.value}`;if(this.WORD_LIKE_REG.test(H)){const{width:_,endElement:j}=this.textParticle.measureWord(L,n,v),G=_*h;j&&G<=w?(se+=G,Pe=j):le&&(se+=G)}const te=this.textParticle.measurePunctuationWidth(L,Pe);se+=te*h}P.listId&&(P.listId!==D?V=0:P.value===ee&&!P.listWrap&&V++),D=P.listId;const J=this.position.setSurroundPosition({pageNo:F,rowElement:$,row:b,rowElementRect:{x:X,y:x,height:z,width:N.width},availableWidth:w,surroundElementList:d});X=J.x,se+=J.rowIncreaseWidth,X+=N.width;let ie=!1;if(this.mode===B.FORM&&P.control?.type===Y.BUTTON&&P.controlComponent===p.PREFIX&&b.elementList.filter(H=>H.controlId!==P.controlId).length>0){const H=P.controlId;if(n.some(_=>_.controlId===`${H}_text`&&_.control?.type===Y.BUTTON)){let _=0;for(let j=v;j<n.length;j++){const G=n[j];if(G.controlId!==H)break;L.font=this.getElementFont(G);const ae=this.textParticle.measureText(L,G);if(_+=ae.width*h,G.controlComponent===p.POSTFIX)break}for(let j=0;j<n.length;j++){const G=n[j];if(G.controlId===`${H}_text`){L.font=this.getElementFont(G);const ae=this.textParticle.measureText(L,G);_+=ae.width*h}}ie=b.width+_>w}}const Xe=P.type===O.SEPARATOR||P.type===O.TABLE||le?.type===O.TABLE||le?.type===O.BLOCK||P.type===O.BLOCK||le?.imgDisplay===Ne.INLINE||P.imgDisplay===Ne.INLINE||le?.listId!==P.listId||le?.areaId!==P.areaId&&!P.area?.hide||P.control?.flexDirection===Rl.COLUMN&&(P.controlComponent===p.CHECKBOX||P.controlComponent===p.RADIO)&&le?.controlComponent===p.VALUE||v!==0&&P.value===ee&&!P.area?.hide||ie,ge=se>w,pe=Xe||ge;if(pe){const H={width:N.width,height:z,startIndex:v,elementList:[$],ascent:K,rowIndex:b.rowIndex+1,rowFlex:n[v]?.rowFlex||n[v+1]?.rowFlex,isPageBreak:P.type===O.PAGE_BREAK};if($.controlComponent!==p.PREFIX&&$.control?.indentation===Xl.VALUE_START){const te=b.elementList.findIndex(_=>_.controlId===$.controlId&&_.controlComponent!==p.PREFIX);if(~te){const j=this.position.computeRowPosition({row:b,innerWidth:this.getInnerWidth()})[te];j&&(H.offsetX=j.coordinate.leftTop[0])}}P.listId&&(H.isList=!0,H.offsetX=S.get(P.listId),H.listIndex=V),H.offsetY=!r&&P.area?.top&&P.areaId!==n[v-1]?.areaId?P.area.top*h:0,M.push(H)}else b.width+=N.width,v===0&&(io(n[1])||n[1]?.areaId)?(b.height=T,b.ascent=T):b.height<z&&(b.height=z,b.ascent=K),b.elementList.push($);if((pe||v===n.length-1)&&(b.isWidthNotEnough=ge&&!Xe,!b.isSurround&&(le?.rowFlex===Qe.JUSTIFY||le?.rowFlex===Qe.ALIGNMENT&&b.isWidthNotEnough))){const H=b.elementList[0]?.value===ee?b.elementList.slice(1):b.elementList,te=(w-b.width)/(H.length-1);for(let _=0;_<H.length-1;_++){const j=H[_];j.metrics.width+=te}b.width=w}if(pe){X=s,x+=b.height,i&&!r&&a&&(x-l+c+z>a||P.type===O.PAGE_BREAK)&&(x=l,Id(d,F),F+=1),$.left=0;const H=M[M.length-1];X=this.position.setSurroundPosition({pageNo:F,rowElement:$,row:H,rowElementRect:{x:X,y:x,height:z,width:N.width},availableWidth:w,surroundElementList:d}).x,X+=N.width}}return M}_computePageList(){const e=[[]],{pageMode:t,pageNumber:{maxPageNo:n}}=this.options,i=this.getHeight(),r=this.getMainOuterHeight();let s=r,l=0;if(t===wn.CONTINUITY){e[0]=this.rowList,s+=this.rowList.reduce((u,h)=>u+h.height+(h.offsetY||0),0);const a=this.getPagePixelRatio(),c=this.pageList[0],d=Number(c.style.height.replace("px",""));if(s>d)c.style.height=`${s}px`,c.height=s*a;else{const u=s<i?i:s;c.style.height=`${u}px`,c.height=u*a}this._initPageContext(this.ctxList[0])}else for(let a=0;a<this.rowList.length;a++){const c=this.rowList[a],d=c.offsetY||0;if(c.height+d+s>i||this.rowList[a-1]?.isPageBreak){if(Number.isInteger(n)&&l>=n){this.elementList=this.elementList.slice(0,c.startIndex);break}s=r+c.height+d,e.push([c]),l++}else s+=c.height+d,e[l].push(c)}return e}_drawHighlight(e,t){const{rowList:n,positionList:i,elementList:r}=t,s=this.getDefaultBasicRowMarginHeight(),l=this.getHighlightMarginHeight();for(let a=0;a<n.length;a++){const c=n[a];for(let d=0;d<c.elementList.length;d++){const u=c.elementList[d],h=c.elementList[d-1],R=u.highlight||this.control.getControlHighlight(r,c.startIndex+d);if(R){h&&h.highlight&&h.highlight!==u.highlight&&this.highlight.render(e);const{coordinate:{leftTop:[g,m]}}=i[c.startIndex+d],f=u.left||0;this.highlight.recordFillInfo(e,g-f,m+s-l,u.metrics.width+f,c.height-2*s+2*l,R)}else h?.highlight&&this.highlight.render(e)}this.highlight.render(e)}}validateNumber(e){return/^\d+$/.test(e)}drawRow(e,t){this._drawHighlight(e,t);const{scale:n,table:{tdPadding:i},group:r,lineBreak:s,whiteSpace:l}=this.options,{rowList:a,pageNo:c,elementList:d,positionList:u,startIndex:h,zone:R,isDrawLineBreak:g=!s.disabled,td:m,isDrawWhiteSpace:f=!l.disabled}=t,T=this.isPrintMode(),I=this.isGraffitiMode(),{isCrossRowCol:L,tableId:S}=this.range.getRange();let M=h;for(let X=0;X<a.length;X++){const x=a[X],F={x:0,y:0,width:0,height:0};let D=null;for(let V=0;V<x.elementList.length;V++){const E=x.elementList[V],v=E.metrics,{ascent:b,coordinate:{leftTop:[P,y]}}=u[x.startIndex+V],N=x.elementList[V-1];if((E.hide||E.control?.hide||E.area?.hide)&&!this.isDesignMode())this.textParticle.complete();else if(E.type===O.IMAGE)this.textParticle.complete(),E.imgDisplay!==Ne.SURROUND&&E.imgDisplay!==Ne.FLOAT_TOP&&E.imgDisplay!==Ne.FLOAT_BOTTOM&&this.imageParticle.render(e,E,P,y+b);else if(E.type===O.LATEX)this.textParticle.complete(),this.laTexParticle.render(e,E,P,y+b);else if(E.type===O.TABLE)L&&(F.x=P,F.y=y,D=E),this.tableParticle.render(e,E,P,y);else if(E.type===O.HYPERLINK)this.textParticle.complete(),this.hyperlinkParticle.render(e,E,P,y+b);else if(E.type===O.LABEL)this.textParticle.complete(),this.labelParticle.render(e,E,P,y+b);else if(E.type===O.MACRO||E.type===O.CUSTOM_MACRO||E.type===O.REUSABLE_ITEM)this.textParticle.complete(),this.macroParticle.render(e,E,P,y+b);else if(E.type===O.DATE){const $=x.elementList[V+1];(!N||N.dateId!==E.dateId)&&this.textParticle.complete(),this.textParticle.record(e,E,P,y+b),(!$||$.dateId!==E.dateId)&&this.textParticle.complete()}else E.type===O.SUPERSCRIPT?(this.textParticle.complete(),this.superscriptParticle.render(e,E,P,y+b)):E.type===O.SUBSCRIPT?(this.underline.render(e),this.textParticle.complete(),this.subscriptParticle.render(e,E,P,y+b)):E.type===O.SEPARATOR?this.separatorParticle.render(e,E,P,y):E.type===O.PAGE_BREAK?this.mode!==B.CLEAN&&!T&&this.pageBreakParticle.render(e,E,P,y):E.type===O.CHECKBOX||E.controlComponent===p.CHECKBOX?(this.textParticle.complete(),this.checkboxParticle.render({ctx:e,x:P,y:y+b,index:V,row:x})):E.type===O.RADIO||E.controlComponent===p.RADIO?(this.textParticle.complete(),this.radioParticle.render({ctx:e,x:P,y:y+b,index:V,row:x})):E.type===O.MENSTRUAL_HISTORY?(this.textParticle.complete(),this.menstrualHistoryParticle.render({ctx:e,x:P,y:y+b,index:V,row:x,element:E})):E.type===O.FETAL_HEART_POSITION?(this.textParticle.complete(),this.fetalHeartPositionParticle.render({ctx:e,x:P,y:y+b,index:V,row:x,element:E})):E.type===O.TOOTH_POSITION?(this.textParticle.complete(),this.toothPositionParticle.render({ctx:e,x:P,y:y+b,index:V,row:x,element:E})):E.type===O.TAB?this.textParticle.complete():E.rowFlex===Qe.ALIGNMENT||E.rowFlex===Qe.JUSTIFY?(this.textParticle.record(e,E,P,y+b),this.textParticle.complete()):E.type===O.BLOCK?(this.textParticle.complete(),this.blockParticle.render(e,c,E,P,y+b)):(E.left&&this.textParticle.complete(),this.textParticle.record(e,E,P,y+b),(E.width||E.letterSpacing||lc.test(E.value))&&this.textParticle.complete());if(g&&!T&&this.mode!==B.CLEAN&&!x.isWidthNotEnough&&V===x.elementList.length-1&&this.lineBreakParticle.render(e,E,P,y+x.height/2),f&&cc.test(E.value)&&this.whiteSpaceParticle.render(e,E,P,y+x.height/2),E.control?.border){N?.control?.border&&N.controlId!==E.controlId&&this.control.drawBorder(e);const $=this.getElementRowMargin(E);this.control.recordBorderInfo(P,y+$,E.metrics.width,x.height-2*$)}else N?.control?.border&&this.control.drawBorder(e);if(E.control?.type===Y.TEXT){const $=E.controlComponent===p.VALUE,le=E.controlComponent===p.POSTFIX||E.controlComponent===p.POST_TEXT;$&&E.control?.underline&&((!N||N.controlId!==E.controlId||N.controlComponent!==p.VALUE&&N.controlComponent!==p.PLACEHOLDER)&&this.control.startTextFieldUnderline(E.controlId,P,y+x.height),this.control.recordTextFieldUnderlineWidth(E.metrics.width)),le&&this.control.drawTextFieldUnderline(e)}else N?.control?.type===Y.TEXT&&this.control.drawTextFieldUnderline(e);if((E.underline||E.control?.underline)&&E.controlComponent!==p.PLACEHOLDER&&!(E.control?.type===Y.TEXT&&E.control?.underline)){N?.type===O.SUBSCRIPT&&E.type!==O.SUBSCRIPT&&this.underline.render(e);const $=this.getElementRowMargin(E),le=E.left||0;let Pe=0;E.type===O.SUBSCRIPT&&(Pe=this.subscriptParticle.getOffsetY(E));const se=E.control?.underline?this.options.underlineColor:E.color;this.underline.recordFillInfo(e,P-le,y+x.height-$+Pe,v.width+le,0,se,E.textDecoration?.style)}else(N?.underline||N?.control?.underline)&&(N?.control?.type===Y.TEXT&&N?.control?.underline||this.underline.render(e));if(E.strikeout){if(!E.type||wt.includes(E.type)){N&&(N.type===O.SUBSCRIPT&&E.type!==O.SUBSCRIPT||N.type===O.SUPERSCRIPT&&E.type!==O.SUPERSCRIPT||this.getElementSize(N)!==this.getElementSize(E))&&this.strikeout.render(e);const $=this.textParticle.measureBasisWord(e,this.getElementFont(E));let le=y+b+$.actualBoundingBoxDescent*n-v.height/2;E.type===O.SUBSCRIPT?le+=this.subscriptParticle.getOffsetY(E):E.type===O.SUPERSCRIPT&&(le+=this.superscriptParticle.getOffsetY(E)),this.strikeout.recordFillInfo(e,P,le,v.width)}}else N?.strikeout&&this.strikeout.render(e);const{zone:U,splitTdRange:w}=this.range.getRange();let{startIndex:Q,endIndex:K}=this.range.getRange(),z=!1;if(m&&w&&[m.originalId,m.id].includes(w.originalId)&&(z=!0,Q=w.startIndex-(m.valueStartIndex??0),K=w.endIndex-(m.valueStartIndex??0)),U===R&&Q!==K&&Q<=M&&M<=K){const $=this.position.getPositionContext();if(!$.isTable&&!E.tdId||$.tdId===E.tdId||z)if(Q===M){const le=d[Q+1];le&&le.value===ee&&(F.x=P+v.width,F.y=y,F.height=x.height,F.width+=this.options.rangeMinWidth)}else{let le=v.width;le===0&&x.elementList.length===1&&(le=this.options.rangeMinWidth),F.width||(F.x=P,F.y=y,F.height=x.height),F.width+=le}}if(!r.disabled&&E.groupIds&&this.group.recordFillInfo(E,P,y,v.width,x.height),M++,E.type===O.TABLE&&!E.hide){const $=E.tdPadding||i,le=$[1]+$[3];for(let Pe=0;Pe<E.trList.length;Pe++){const se=E.trList[Pe];for(let J=0;J<se.tdList.length;J++){const ie=se.tdList[J];this.drawRow(e,{elementList:ie.value,positionList:ie.positionList,rowList:ie.rowList,pageNo:c,startIndex:0,innerWidth:(ie.width-le)*n,zone:R,isDrawLineBreak:g,td:ie})}}}}if(x.isList&&this.listParticle.drawListStyle(e,x,u[x.startIndex]),this.textParticle.complete(),this.control.drawBorder(e),this.underline.render(e),this.strikeout.render(e),this.group.render(e),!T&&!I){if(F.width&&F.height){const{x:V,y:E,width:v,height:b}=F;this.range.render(e,V,E,v,b)}if(L&&D&&D.id===S){const{coordinate:{leftTop:[V,E]}}=u[x.startIndex];this.tableParticle.drawRange(e,D,V,E)}}}}_drawFloat(e,t){const{scale:n}=this.options,i=this.position.getFloatPositionList(),{imgDisplays:r,pageNo:s}=t;for(let l=0;l<i.length;l++){const a=i[l],c=a.element;if((s===a.pageNo||a.zone===De.HEADER||a.zone==De.FOOTER)&&c.imgDisplay&&r.includes(c.imgDisplay)&&c.type===O.IMAGE){const d=c.imgFloatPosition;this.imageParticle.render(e,c,d.x*n,d.y*n)}}}_clearPage(e){const t=this.ctxList[e],n=this.pageList[e];t.clearRect(0,0,Math.max(n.width,this.getWidth()),Math.max(n.height,this.getHeight())),this.blockParticle.clear()}_drawPage(e){const{elementList:t,positionList:n,rowList:i,pageNo:r}=e,{inactiveAlpha:s,pageMode:l,header:a,footer:c,pageNumber:d,lineNumber:u,pageBorder:h}=this.options,R=this.mode===B.PRINT,g=this.getInnerWidth(),m=this.ctxList[r];m.globalAlpha=this.zone.isMainActive()?1:s,this._clearPage(r),(!R||!this.options.modeRule[B.PRINT]?.backgroundDisabled)&&this.background.render(m,r),R||this.area.render(m,r),l!==wn.CONTINUITY&&this.options.watermark.data&&this.waterMark.render(m,r),R||this.margin.render(m,r),this._drawFloat(m,{pageNo:r,imgDisplays:[Ne.FLOAT_BOTTOM]}),R||this.control.renderHighlightList(m,r);const f=i[0]?.startIndex;this.drawRow(m,{elementList:t,positionList:n,rowList:i,pageNo:r,startIndex:f,innerWidth:g,zone:De.MAIN}),this.getIsPagingMode()&&(a.disabled||this.header.render(m,r),d.disabled||this.pageNumber.render(m,r),c.disabled||this.footer.render(m,r)),this._drawFloat(m,{pageNo:r,imgDisplays:[Ne.FLOAT_TOP,Ne.SURROUND]}),!R&&this.search.getSearchKeyword()&&this.search.render(m,r),this.elementList.length<=1&&!this.elementList[0]?.listId&&this.placeholder.render(m),u.disabled||this.lineNumber.render(m,r),h.disabled||this.pageBorder.render(m),this.badge.render(m,r),this.isGraffitiMode()&&this.graffiti.render(m,r)}_disconnectLazyRender(){this.lazyRenderIntersectionObserver?.disconnect()}_lazyRender(){const e=this.position.getOriginalMainPositionList(),t=this.getOriginalMainElementList();this._disconnectLazyRender(),this.lazyRenderIntersectionObserver=new IntersectionObserver(n=>{n.forEach(i=>{if(i.isIntersecting){const r=Number(i.target.dataset.index);this._drawPage({elementList:t,positionList:e,rowList:this.pageRowList[r],pageNo:r})}})}),this.pageList.forEach(n=>{this.lazyRenderIntersectionObserver.observe(n)})}_immediateRender(){const e=this.position.getOriginalMainPositionList(),t=this.getOriginalMainElementList();for(let n=0;n<this.pageRowList.length;n++)this._drawPage({elementList:t,positionList:e,rowList:this.pageRowList[n],pageNo:n})}render(e){this.renderCount++;let t;const{endIndex:n,isCrossRowCol:i}=this.range.getRange(),r=this.position.getPositionContext();if(i)t=this.getOriginalElementList()[r.index];else{const X=~n?n:0,x=this.getElementList();t=jn(x,X)}const{header:s,footer:l}=this.options,{isSubmitHistory:a=!0,isSetCursor:c=!0,isCompute:d=!0,isLazy:u=!0,isInit:h=!1,isSourceHistory:R=!1,isFirstRender:g=!1,isDel:m=!1}=e||{};let{curIndex:f}=e||{};const T=this.getInnerWidth(),I=this.getIsPagingMode(),L=this.pageRowList.length;if(d){this.splitTdValueMap.clear(),this.tdMap.clear(),this.position.setFloatPositionList([]),I&&(s.disabled||this.header.compute(),l.disabled||this.footer.compute());const X=this.getMargins(),x=this.getHeight(),F=this.header.getExtraHeight(),D=this.getMainOuterHeight(),V=X[3],E=X[0]+F,v=xs(this.elementList);if(this.rowList=this.computeRowList({startX:V,startY:E,pageHeight:x,mainOuterHeight:D,isPagingMode:I,innerWidth:T,surroundElementList:v,elementList:this.elementList}),this.pageRowList=this._computePageList(),this.position.computePositionList(),this.area.compute(),!this.isPrintMode()){const b=this.search.getSearchKeyword();b&&this.search.compute(b),this.control.computeHighlightList()}this.isGraffitiMode()&&this.graffiti.compute()}this.imageObserver.clearAll(),this.cursor.recoveryCursor();for(let X=0;X<this.pageRowList.length;X++)this.pageList[X]||this._createPage(X);const S=this.pageRowList.length,M=this.pageList.length;if(M>S){const X=M-S;this.ctxList.splice(S,X),this.pageList.splice(S,X).forEach(x=>x.remove())}if(u&&I?this._lazyRender():this._immediateRender(),c){if(d&&t?.tableId){const{index:X}=r,F=this.getOriginalElementList()[X];if(t.tableId!==F?.id){const V=this.findTableChildrenElement(!0,t.tableId,t);V&&r.index!==V.originalIndex&&(r.index=V.originalIndex,r.tableId=V.table.id,r.trIndex=V.trIndex,r.trId=V.tr.id,r.tdIndex=V.tdIndex,r.tdId=V.td.id,f=V.elementIndex,this.position.setPositionContext(r),this.range.setRange(f,f),this.updateTableTool())}const D=this.getElementList();D[n]!==t&&(f=D.findIndex(V=>V===t))}f=this.setCursor(f)}else this.range.getIsSelection()&&this.cursor.focus();if(m){let X;const x=this.position.getPositionContext();X=this.range.getRange().startIndex-1,x.index=X}(a&&!g||f!==void 0&&this.historyManager.isStackEmpty())&&this.submitHistory(f),Xs(()=>{this.range.setRangeStyle(),d&&this.control.getActiveControl()&&this.control.reAwakeControl(),d&&!this.isReadonly()&&r.isTable&&this.getOriginalElementList()[r.index].type===O.TABLE&&this.tableTool.render(),d&&!this.zone.isMainActive()&&this.zone.drawZoneIndicator(),L!==this.pageRowList.length&&(this.listener.pageSizeChange&&this.listener.pageSizeChange(this.pageRowList.length),this.eventBus.isSubscribe("pageSizeChange")&&this.eventBus.emit("pageSizeChange",this.pageRowList.length)),(a||R)&&!h&&(this.listener.contentChange&&this.listener.contentChange(),this.eventBus.isSubscribe("contentChange")&&this.eventBus.emit("contentChange"))}),c&&this.fixPosition()}fixPosition(e=!1){let t;const n=this.position.getPositionContext();if(n.isTable){const i=this.getElementList(),r=this.range.getRange().startIndex;if(e||r>=i.length){const s=this.getTd(),l=n.index+(e?-1:1),c=this.getOriginalElementList()[l];if(!c?.trList)return;t=r-i.length;for(let d=0;d<c.trList.length;d++){const u=c.trList[d],h=u.tdList.find(R=>e?s?.linkTdPrevId===R.id:s?.id===R.linkTdPrevId);if(h){n.index=l,n.trIndex=d,n.tableId=c.id,n.trId=u.id,n.tdId=h?.id,t=e?h.value.length-1:t+(h.value[0]?.type===O.SPLIT_TAG?1:0);break}}if(this.position.setPositionContext(n),this.range.setRange(t,t),this.setCursor(t),t===0)return this.fixPosition(e);this.updateTableTool()}}return t}setCursor(e){const t=this.position.getPositionContext(),n=this.position.getPositionList(),i=this.getElementList();if(t.isTable){const{index:s,trIndex:l,tdIndex:a}=t,d=this.getOriginalElementList()[s].trList?.[l].tdList[a].positionList;e===void 0&&d&&(e=d.length-1);const u=d?.[e];this.position.setCursorPosition(u||null)}else e!==void 0&&e>=n.length&&(e=n.length-1),this.position.setCursorPosition(e!==void 0&&e>=0?n[e]:null);let r=!0;if(e!==void 0&&t.isImage&&t.isDirectHit){const s=i[e];if(s&&Fc.includes(s.type)){r=!1;const l=this.position.getCursorPosition();this.previewer.updateResizer(s,l)}}return this.cursor.drawCursor({isShow:r}),e}submitHistory(e){const t=this.position.getPositionContext(),n=_i(this.elementList),i=_i(this.header.getElementList()),r=_i(this.footer.getElementList()),s=xe(this.range.getRange()),l=this.pageNo,a=xe(t),c=this.zone.getZone();this.historyManager.execute(()=>{this.zone.setZone(c),this.setPageNo(l),this.position.setPositionContext(xe(a)),this.header.setElementList(xe(i)),this.footer.setElementList(xe(r)),this.elementList=xe(n),this.range.replaceRange(xe(s)),this.render({curIndex:e,isSubmitHistory:!1,isSourceHistory:!0})})}destroy(){this.container.remove(),this.globalEvent.removeEvent(),this.scrollObserver.removeEvent(),this.selectionObserver.removeEvent()}clearSideEffect(){this.getPreviewer().clearResizer(),this.getTableTool().dispose(),this.getHyperlinkParticle().clearHyperlinkPopup(),this.getDateParticle().clearDatePicker()}updateTableTool(){if(this.position.getPositionContext().isTable){const e=this.position.getPositionList();e.length&&(this.setPageNo(e[0].pageNo),this.getTableTool().render())}}initTableElementIndex(e,t){e.trList?.forEach((n,i)=>{n.tdList.forEach((r,s)=>{r.tableIndex=t,r.tableId=e.id,r.trIndex=i,r.trId=n.id,r.tdIndex=s,this.tdMap.set(r.id,r)})})}clearElementEffect(e){e.trList?.forEach(t=>{t.minHeight=t.originalMinHeight??t.minHeight,delete t.originalMinHeight,t.tdList.forEach(n=>{delete n.linkTdNextId})})}updateElementTableInfo(e,t,n,i){return e.tableId=t.id,e.trId=n.id,e.tdId=i.id,e}findTableChildrenElement(e,t,n){const i=this.position.getPositionContext(),{index:r}=i,s=this.getOriginalElementList();let l=r;e&&(l=r>s.length?s.length-1:r);for(let a=l;e?a>=0:a<s.length;e?a--:a++){const c=s[a];if(c&&[c.originalId,c.id].includes(t))for(const[d,u]of c.trList.entries())for(const[h,R]of u.tdList.entries()){const g=R.value.findIndex(typeof n=="function"?n:m=>m===n);if(g>=0)return{originalIndex:a,table:c,tr:u,trIndex:d,td:R,tdIndex:h,elementIndex:g}}}}getTdById(e){return this.tdMap.get(e)}getLinkTdPrevHasValue(e){const t=this.getTdById(e);if(t)return t.value.length?t:this.getLinkTdPrevHasValue(t.linkTdPrevId)}getFirstLinkTd(e){const t=this.getTdById(e);return t?.linkTdPrevId?this.getLastLinkTd(t.linkTdPrevId):t}getLastLinkTd(e){const t=this.getTdById(e);return t?.linkTdNextId?this.getLastLinkTd(t.linkTdNextId):t}removeLinkTd(e,t){const n=this.getTdById(t);if(n){if(n.linkTdPrevId){const i=this.getTdById(n.linkTdPrevId);i&&(delete i.linkTdNextId,this.removeLinkTd(e,n.linkTdPrevId))}if(n.linkTdNextId){const i=this.getTdById(n.linkTdNextId);i&&(delete i.linkTdPrevId,this.removeLinkTd(e,n.linkTdNextId))}e[n.tableIndex].trList[n.trIndex].tdList.splice(n.tdIndex,1),this.initTableElementIndex(e[n.tableIndex],n.tableIndex)}}removeLinkTdControl(e,t){const n=this.getTdById(e);if(n){for(let i=0;i<n.value.length;i++)n.value[i].control===t&&(n.value.splice(i,1),i--);n.linkTdNextId&&this.removeLinkTdControl(n.linkTdNextId,t)}}isSplitTd(e,t){return(!!e?.originalId||!!t?.originalId)&&(e?.originalId===t?.originalId||e?.id===t?.originalId||e?.originalId===t?.id)}getSplitTdValues(e){return this.splitTdValueMap.get(e)}removeSplitTdOtherRangeElements(){const{splitTdRange:e}=this.range.getRange();if(!e)return;const{startIndex:t,endIndex:n}=e;let i=this.getTd();if(i)if((i.valueStartIndex??0)>=t){let r=-1;for(;r<0;){const s=this.getTdById(i.linkTdPrevId);if(s){r=t-(s.valueStartIndex??0);const l=Math.max(0,r);this.spliceElementList(s.value,l+1,s.value.length-l-1),i=s}else r=0}}else{let r=1;for(;r>0;){const s=this.getTdById(i.linkTdNextId);if(s){const l=s.valueStartIndex??0;r=n-(l+s.value.length);const a=Math.min(s.value.length,n-l+1);this.spliceElementList(s.value,0,a),i=s}else r=0}}}getTablesByPagingId(e,t,n){const i=[],r=[];if(e[n].pagingId===t){i.push(n),r.push(e[n]);for(let s=n-1;s>=0&&e[s].pagingId===t;s--)r.unshift(e[s]),i.push(s);for(let s=n+1;s<e.length&&e[s].pagingId===t;s++)r.push(e[s]),i.push(s)}return{list:r,startIndex:i.sort()[0]}}}class yf{executeMode;executeCut;executeCopy;executePaste;executeSelectAll;executeBackspace;executeSetRange;executeReplaceRange;executeSetPositionContext;executeForceUpdate;executeBlur;executeHideCursor;executeUndo;executeRedo;executePainter;executeApplyPainterStyle;executeFormat;executeFont;executeButton;executeEditElementAttribute;executeTriggerControlEditAttribute;executeCopyControl;executePasteControl;executeSize;executeSizeAdd;executeSizeMinus;executeBold;executeItalic;executeUnderline;executeStrikeout;executeSuperscript;executeSubscript;executeColor;executeHighlight;executeTitle;executeList;executeRowFlex;executeVertical;executeRowMargin;executeInsertTable;executeInsertTableTopRow;executeInsertTableBottomRow;executeInsertTableLeftCol;executeInsertTableRightCol;executeDeleteTableRow;executeDeleteTableCol;executeDeleteTable;executeMergeTableCell;executeCancelMergeTableCell;executeSplitVerticalTableCell;executeSplitHorizontalTableCell;executeTableTdVerticalAlign;executeTableBorderType;executeTableBorderColor;executeTableTdBorderType;executeTableTdSlashType;executeTableTdBackgroundColor;executeTableSelectAll;executeTableProperties;executeImage;executeHyperlink;executeDeleteHyperlink;executeCancelHyperlink;executeEditHyperlink;executeSeparator;executePageBreak;executeAddWatermark;executeDeleteWatermark;executeSearch;executeSearchNavigatePre;executeSearchNavigateNext;executeReplace;executePrint;executeReplaceImageElement;executeSaveAsImageElement;executeSetImageCrop;executeSetImageCaption;executeChangeImageDisplay;executePageMode;executePageScale;executePageScaleRecovery;executePageScaleMinus;executePageScaleAdd;executePaperSize;executePaperDirection;executeSetPaperMargin;executeSetMainBadge;executeSetAreaBadge;executeInsertElementList;executeInsertArea;executeSetAreaValue;executeSetAreaProperties;executeLocationArea;executeClearGraffiti;executeAppendElementList;executeUpdateElementById;executeDeleteElementById;executeSetValue;executeRemoveControl;executeTranslate;executeSetLocale;executeLocationCatalog;executeWordTool;executeSetHTML;executeSetGroup;executeDeleteGroup;executeLocationGroup;executeSetZone;executeSetControlValue;executeSetControlValueList;executeSetControlExtension;executeSetControlExtensionList;executeSetControlProperties;executeSetControlPropertiesList;executeSetControlHighlight;executeLocationControl;executeInsertControl;executeInsertTextField;executeJumpControl;executeUpdateOptions;executeInsertTitle;executeFocus;executeComputeElementListHeight;getCatalog;getImage;getPageMode;getOptions;getValue;getValueAsync;getAreaValue;getHTML;getText;getWordCount;getCursorPosition;getRemainingContentHeight;getRange;getRangeText;getRangeContext;getRangeRow;getRangeParagraph;getKeywordRangeList;getKeywordContext;getPaperMargin;getSearchNavigateInfo;getLocale;getGroupIds;getControlValue;getControlList;getContainer;getTitleValue;getPositionContextByEvent;getElementById;constructor(e){this.executeMode=e.mode.bind(e),this.executeCut=e.cut.bind(e),this.executeCopy=e.copy.bind(e),this.executePaste=e.paste.bind(e),this.executeSelectAll=e.selectAll.bind(e),this.executeBackspace=e.backspace.bind(e),this.executeSetRange=e.setRange.bind(e),this.executeReplaceRange=e.replaceRange.bind(e),this.executeSetPositionContext=e.setPositionContext.bind(e),this.executeForceUpdate=e.forceUpdate.bind(e),this.executeBlur=e.blur.bind(e),this.executeHideCursor=e.hideCursor.bind(e),this.executeUndo=e.undo.bind(e),this.executeRedo=e.redo.bind(e),this.executePainter=e.painter.bind(e),this.executeApplyPainterStyle=e.applyPainterStyle.bind(e),this.executeFormat=e.format.bind(e),this.executeFont=e.font.bind(e),this.executeButton=e.buttonText.bind(e),this.executeEditElementAttribute=e.editElementAttribute.bind(e),this.executeTriggerControlEditAttribute=e.triggerControlEditAttribute.bind(e),this.executeCopyControl=e.copyControl.bind(e),this.executePasteControl=e.pasteControl.bind(e),this.executeSize=e.size.bind(e),this.executeSizeAdd=e.sizeAdd.bind(e),this.executeSizeMinus=e.sizeMinus.bind(e),this.executeBold=e.bold.bind(e),this.executeItalic=e.italic.bind(e),this.executeUnderline=e.underline.bind(e),this.executeStrikeout=e.strikeout.bind(e),this.executeSuperscript=e.superscript.bind(e),this.executeSubscript=e.subscript.bind(e),this.executeColor=e.color.bind(e),this.executeHighlight=e.highlight.bind(e),this.executeTitle=e.title.bind(e),this.executeList=e.list.bind(e),this.executeRowFlex=e.rowFlex.bind(e),this.executeVertical=e.vertical.bind(e),this.executeRowMargin=e.rowMargin.bind(e),this.executeInsertTable=e.insertTable.bind(e),this.executeInsertTableTopRow=e.insertTableTopRow.bind(e),this.executeInsertTableBottomRow=e.insertTableBottomRow.bind(e),this.executeInsertTableLeftCol=e.insertTableLeftCol.bind(e),this.executeInsertTableRightCol=e.insertTableRightCol.bind(e),this.executeDeleteTableRow=e.deleteTableRow.bind(e),this.executeDeleteTableCol=e.deleteTableCol.bind(e),this.executeDeleteTable=e.deleteTable.bind(e),this.executeMergeTableCell=e.mergeTableCell.bind(e),this.executeCancelMergeTableCell=e.cancelMergeTableCell.bind(e),this.executeSplitVerticalTableCell=e.splitVerticalTableCell.bind(e),this.executeSplitHorizontalTableCell=e.splitHorizontalTableCell.bind(e),this.executeTableTdVerticalAlign=e.tableTdVerticalAlign.bind(e),this.executeTableBorderType=e.tableBorderType.bind(e),this.executeTableBorderColor=e.tableBorderColor.bind(e),this.executeTableTdBorderType=e.tableTdBorderType.bind(e),this.executeTableTdSlashType=e.tableTdSlashType.bind(e),this.executeTableTdBackgroundColor=e.tableTdBackgroundColor.bind(e),this.executeTableSelectAll=e.tableSelectAll.bind(e),this.executeTableProperties=e.tableProperties.bind(e),this.executeImage=e.image.bind(e),this.executeHyperlink=e.hyperlink.bind(e),this.executeDeleteHyperlink=e.deleteHyperlink.bind(e),this.executeCancelHyperlink=e.cancelHyperlink.bind(e),this.executeEditHyperlink=e.editHyperlink.bind(e),this.executeSeparator=e.separator.bind(e),this.executePageBreak=e.pageBreak.bind(e),this.executeAddWatermark=e.addWatermark.bind(e),this.executeDeleteWatermark=e.deleteWatermark.bind(e),this.executeSearch=e.search.bind(e),this.executeSearchNavigatePre=e.searchNavigatePre.bind(e),this.executeSearchNavigateNext=e.searchNavigateNext.bind(e),this.executeReplace=e.replace.bind(e),this.executePrint=e.print.bind(e),this.executeReplaceImageElement=e.replaceImageElement.bind(e),this.executeSaveAsImageElement=e.saveAsImageElement.bind(e),this.executeSetImageCrop=e.setImageCrop.bind(e),this.executeSetImageCaption=e.setImageCaption.bind(e),this.executeChangeImageDisplay=e.changeImageDisplay.bind(e),this.executePageMode=e.pageMode.bind(e),this.executePageScale=e.pageScale.bind(e),this.executePageScaleRecovery=e.pageScaleRecovery.bind(e),this.executePageScaleMinus=e.pageScaleMinus.bind(e),this.executePageScaleAdd=e.pageScaleAdd.bind(e),this.executePaperSize=e.paperSize.bind(e),this.executePaperDirection=e.paperDirection.bind(e),this.executeSetPaperMargin=e.setPaperMargin.bind(e),this.executeSetMainBadge=e.setMainBadge.bind(e),this.executeSetAreaBadge=e.setAreaBadge.bind(e),this.getAreaValue=e.getAreaValue.bind(e),this.executeInsertArea=e.insertArea.bind(e),this.executeSetAreaValue=e.setAreaValue.bind(e),this.executeSetAreaProperties=e.setAreaProperties.bind(e),this.executeLocationArea=e.locationArea.bind(e),this.executeClearGraffiti=e.clearGraffiti.bind(e),this.executeInsertElementList=e.insertElementList.bind(e),this.executeAppendElementList=e.appendElementList.bind(e),this.executeUpdateElementById=e.updateElementById.bind(e),this.executeDeleteElementById=e.deleteElementById.bind(e),this.executeSetValue=e.setValue.bind(e),this.executeRemoveControl=e.removeControl.bind(e),this.executeTranslate=e.translate.bind(e),this.executeSetLocale=e.setLocale.bind(e),this.executeLocationCatalog=e.locationCatalog.bind(e),this.executeWordTool=e.wordTool.bind(e),this.executeSetHTML=e.setHTML.bind(e),this.executeSetGroup=e.setGroup.bind(e),this.executeDeleteGroup=e.deleteGroup.bind(e),this.executeLocationGroup=e.locationGroup.bind(e),this.executeSetZone=e.setZone.bind(e),this.executeUpdateOptions=e.updateOptions.bind(e),this.executeInsertTitle=e.insertTitle.bind(e),this.executeFocus=e.focus.bind(e),this.executeComputeElementListHeight=e.computeElementListHeight.bind(e),this.getImage=e.getImage.bind(e),this.getPageMode=e.getPageMode.bind(e),this.getOptions=e.getOptions.bind(e),this.getValue=e.getValue.bind(e),this.getValueAsync=e.getValueAsync.bind(e),this.getHTML=e.getHTML.bind(e),this.getText=e.getText.bind(e),this.getWordCount=e.getWordCount.bind(e),this.getCursorPosition=e.getCursorPosition.bind(e),this.getRemainingContentHeight=e.getRemainingContentHeight.bind(e),this.getRange=e.getRange.bind(e),this.getRangeText=e.getRangeText.bind(e),this.getRangeContext=e.getRangeContext.bind(e),this.getRangeRow=e.getRangeRow.bind(e),this.getRangeParagraph=e.getRangeParagraph.bind(e),this.getKeywordRangeList=e.getKeywordRangeList.bind(e),this.getKeywordContext=e.getKeywordContext.bind(e),this.getCatalog=e.getCatalog.bind(e),this.getPaperMargin=e.getPaperMargin.bind(e),this.getSearchNavigateInfo=e.getSearchNavigateInfo.bind(e),this.getLocale=e.getLocale.bind(e),this.getGroupIds=e.getGroupIds.bind(e),this.getContainer=e.getContainer.bind(e),this.getTitleValue=e.getTitleValue.bind(e),this.getPositionContextByEvent=e.getPositionContextByEvent.bind(e),this.getElementById=e.getElementById.bind(e),this.executeSetControlValue=e.setControlValue.bind(e),this.executeSetControlValueList=e.setControlValueList.bind(e),this.executeSetControlExtension=e.setControlExtension.bind(e),this.executeSetControlExtensionList=e.setControlExtensionList.bind(e),this.executeSetControlProperties=e.setControlProperties.bind(e),this.executeSetControlPropertiesList=e.setControlPropertiesList.bind(e),this.executeSetControlHighlight=e.setControlHighlight.bind(e),this.getControlValue=e.getControlValue.bind(e),this.getControlList=e.getControlList.bind(e),this.executeLocationControl=e.locationControl.bind(e),this.executeInsertControl=e.insertControl.bind(e),this.executeInsertTextField=e.insertTextField.bind(e),this.executeJumpControl=e.jumpControl.bind(e)}}function xf(o,e){return o===1125&&e===1593?{size:"a3",width:"297mm",height:"420mm"}:o===794&&e===1123?{size:"a4",width:"210mm",height:"297mm"}:o===565&&e===796?{size:"a5",width:"148mm",height:"210mm"}:{size:"",width:`${o}px`,height:`${e}px`}}function vf(o,e){const{width:t,height:n,direction:i=pn.VERTICAL}=e,r=document.createElement("iframe");r.style.visibility="hidden",r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.width="0",r.style.height="0",r.style.border="none",document.body.append(r);const s=r.contentWindow,l=s.document;l.open();const a=document.createElement("div"),c=xf(t,n);o.forEach(h=>{const R=document.createElement("img");R.style.width=i===pn.HORIZONTAL?c.height:c.width,R.style.height=i===pn.HORIZONTAL?c.width:c.height,R.src=h,a.append(R)});const d=document.createElement("style"),u=`
538
+ * {
539
+ margin: 0;
540
+ padding: 0;
541
+ }
542
+ @page {
543
+ margin: 0;
544
+ size: ${c.size} ${i===pn.HORIZONTAL?"landscape":"portrait"};
545
+ }`;d.append(document.createTextNode(u)),setTimeout(()=>{l.write(`${d.outerHTML}${a.innerHTML}`),s.print(),l.close(),window.addEventListener("mouseover",()=>{r?.remove()},{once:!0})})}const Wf=[Y.TEXT,Y.TEXTFIELD],nl=["id","titleId","listId","areaId","hyperlinkId","dateId","labelId","tableId","trId","tdId","pagingId","menstrualHistoryId","fetalHeartPositionId","toothPositionId"];function ii(o,e){for(let t=0;t<o.length;t++){const n=o[t];if(n.type===O.CONTROL&&n.controlId===e&&n.control)return xe(n);if(n.control?.value?.length){const i=ii(n.control.value,e);if(i)return i}if(n.valueList?.length){const i=ii(n.valueList,e);if(i)return i}if(n.type===O.TABLE&&n.trList?.length)for(let i=0;i<n.trList.length;i++){const r=n.trList[i];for(let s=0;s<r.tdList.length;s++){const l=r.tdList[s],a=ii(l.value,e);if(a)return a}}}return null}function Df(o){const e=new Map,t=new Map,n=l=>l&&(e.has(l)||e.set(l,Ee()),e.get(l)),i=l=>l&&(t.has(l)||t.set(l,Ee()),t.get(l)),r=l=>{l.controlId&&(l.controlId=n(l.controlId)),l.originControlId&&(l.originControlId=n(l.originControlId));for(let a=0;a<nl.length;a++){const c=nl[a],d=l[c];if(typeof d=="string"){const u=l;u[c]=i(d)}}l.groupIds?.length&&(l.groupIds=l.groupIds.map(a=>i(a))),l.valueList?.length&&l.valueList.forEach(r),l.control?.value?.length&&l.control.value.forEach(r),l.trList?.length&&l.trList.forEach(a=>{const c=a;typeof c.id=="string"&&(c.id=i(c.id)),a.tdList.forEach(d=>{const u=d;typeof u.id=="string"&&(u.id=i(u.id)),d.value.forEach(r)})})},s=xe(o);return r(s),s}function Vf(o,e,t){let n=-1;const i=!!t;for(let r=0;r<o.length;r++){const s=o[r];if(i?s.controlId===e&&s.originControlId===t:s.controlId===e&&!s.originControlId)n=r;else if(~n)break}return n}class Yf{draw;range;position;historyManager;canvasEvent;options;control;workerManager;searchManager;i18n;zone;tableOperate;constructor(e){this.draw=e,this.range=e.getRange(),this.position=e.getPosition(),this.historyManager=e.getHistoryManager(),this.canvasEvent=e.getCanvasEvent(),this.options=e.getOptions(),this.control=e.getControl(),this.workerManager=e.getWorkerManager(),this.searchManager=e.getSearch(),this.i18n=e.getI18n(),this.zone=e.getZone(),this.tableOperate=e.getTableOperate()}mode(e){this.draw.setMode(e)}async cut(){this.draw.isReadonly()||this.draw.isDisabled()||await this.canvasEvent.cut()}async copy(e){await this.canvasEvent.copy(e)}paste(e){this.draw.isReadonly()||this.draw.isDisabled()||Nd(this.canvasEvent,e)}copyControl(e){if(!e)return;const t=Ge(this.draw.getElementList(),{editorOptions:this.options}),n=ii(t,e);n&&Od({element:n})}pasteControl(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const t=Wl();if(!t?.element)return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.draw.getElementList(),s=Df(t.element),l=s.controlId;if(!l)return;const a=ds([s]);if(!a.length)return;ct(a,{isHandleFirstElement:!1,editorOptions:this.options});let c=n,d=n,u=i,h=!1,R;const g=n===i;let m=this.control.getActiveControl();!m&&this.control.getIsRangeWithinControl()&&(this.control.initControl(),m=this.control.getActiveControl());const f=m?.getElement();if(f?.control?.type&&Wf.includes(f.control.type)&&this.control.getIsRangeWithinControl()){h=!0,R=f.controlId;const L=r[n];g&&(L?.control?.type===Y.TEXTFIELD||L?.control?.type===Y.TEXT)&&this.control.removePlaceholder(n)}else if(f?.controlId){const L=Vf(r,f.controlId,f.originControlId);~L&&(c=L,d=L,u=L)}ze(r,a,c,{isBreakWhenWrap:!0,editorOptions:this.options}),R&&a.forEach(L=>{L.controlId===l&&!L.originControlId&&(L.originControlId=R)});const T=c+1;d!==u&&this.draw.spliceElementList(r,d+1,u-d),this.draw.spliceElementList(r,T,0,a);const I=c+a.length;this.range.setRange(I,I),this.draw.render({curIndex:I}),h&&this.control.emitControlContentChange()}selectAll(){this.canvasEvent.selectAll()}backspace(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const t=this.draw.getElementList(),{startIndex:n,endIndex:i}=this.range.getRange(),r=n===i;if(r&&t[n].value===ee&&n===0)return;r?this.draw.spliceElementList(t,n,1):this.draw.spliceElementList(t,n+1,i-n);const s=r?n-1:n;this.range.setRange(s,s),this.draw.render({curIndex:s})}setRange(e,t,n,i,r,s,l){if(e<0||t<0||t<e)return;this.range.setRange(e,t,n,i,r,s,l);const a=e===t;this.draw.render({curIndex:a?e:void 0,isCompute:!1,isSubmitHistory:!1,isSetCursor:a})}replaceRange(e){this.setRange(e.startIndex,e.endIndex,e.tableId,e.startTdIndex,e.endTdIndex,e.startTrIndex,e.endTrIndex)}setPositionContext(e){const{tableId:t,startTrIndex:n,startTdIndex:i}=e,r=this.draw.getOriginalElementList();if(t){const s=r.findIndex(d=>d.id===t);if(!~s)return;const a=r[s].trList[n],c=a.tdList[i];this.position.setPositionContext({isTable:!0,index:s,trIndex:n,tdIndex:i,tdId:c.id,trId:a.id,tableId:t})}else this.position.setPositionContext({isTable:!1})}forceUpdate(e){const{isSubmitHistory:t=!1}=e||{};this.range.clearRange(),this.draw.render({isSubmitHistory:t,isSetCursor:!1})}blur(){this.range.clearRange(),this.draw.getCursor().recoveryCursor()}hideCursor(){this.draw.getCursor().recoveryCursor()}undo(){this.draw.isReadonly()||this.historyManager.undo()}redo(){this.draw.isReadonly()||this.historyManager.redo()}painter(e){if(!e.isDblclick&&this.draw.getPainterStyle()){this.canvasEvent.clearPainterStyle();return}const t=this.range.getSelection();if(!t)return;const n={};t.forEach(i=>{rn.forEach(s=>{const l=s;n[l]===void 0&&Reflect.set(n,l,i[l])})}),this.draw.setPainterStyle(n,e)}applyPainterStyle(){this.draw.isReadonly()||this.draw.isDisabled()||this.canvasEvent.applyPainterStyle()}format(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();let r={},s=[];if(i?.length)s=i,r={isSetCursor:!1};else{const{endIndex:l}=this.range.getRange(),c=this.draw.getElementList()[l];c?.value===ee&&(s.push(c),r={curIndex:l})}s.length&&(s.forEach(l=>{rn.forEach(a=>{delete l[a]})}),this.draw.render(r))}buttonText(e){if(e)if([...e.element].filter(i=>i.newButtonValue&&i.newButtonValue.length>0).length){const i=e.controlId;this.removeButtonElementsByControlId(i+"_text").then(()=>{setTimeout(()=>{this.insertButtonValue(e)},500)})}else{const i=e.controlId;i&&this.removeButtonElementsByControlId(i+"_text")}}triggerControlEditAttribute(e){const n=this.draw.getElementList().filter(r=>r.controlId===e);this.draw.getEventBus().emit("controlEditAttribute",{controlId:e,element:n})}editElementAttribute(e){const t=this.draw.getElementList();if(e.controlId&&e.type==="button"){const n=[];t.forEach((h,R)=>{h.controlId===e.controlId&&h.control?.type==="button"&&n.push(R)});const i=[];let r=null;n.forEach(h=>{const R=t[h];R.controlComponent===p.VALUE&&(i.push(h),r||(r=R))}),i.sort((h,R)=>R-h).forEach(h=>{t.splice(h,1)});let s=-1;for(let h=0;h<t.length;h++){const R=t[h];if(R.controlId===e.controlId&&R.control?.type==="button"){if(R.controlComponent===p.PREFIX||R.controlComponent===p.PRE_TEXT){s=h+1;break}s===-1&&(s=h+1)}}if(s===-1&&n.length>0){const h=[];t.forEach((R,g)=>{R.controlId===e.controlId&&R.control?.type==="button"&&h.push(g)}),h.length>0&&(s=h[0]+1)}const l=e.label||"";for(let h=0;h<l.length;h++){const R={value:l[h],controlId:e.controlId,type:O.CONTROL,control:{type:"button",buttonLabel:l,code:e.code,value:[{value:l}],label:l,hide:!1},controlComponent:p.VALUE,color:r?.color||"#fff",highlight:r?.highlight||"#1677FF",style:r?.style||"16px Microsoft YaHei",hide:!1};t.splice(s+h,0,R)}t.filter(h=>h.controlId===e.controlId&&h.control?.type==="button").forEach(h=>{h.control&&(h.control.buttonLabel=e.label,h.control.label=e.label,h.control.code=e.code,h.control.hide=!1,h.control.value=[{value:e.label}]),h.hide=!1});const{startIndex:a,endIndex:c}=this.range.getRange(),d=!0,u=c;this.draw.render({curIndex:u,isSetCursor:d})}else if(e.controlId){const n=e.controlId;if(t.forEach(r=>{r.controlId===n&&r.control&&(e.label!==void 0&&(r.control.label=e.label),e.placeholder!==void 0&&(r.control.placeholder=e.placeholder),e.code!==void 0&&(r.control.code=e.code),e.value!==void 0&&(r.control.value=e.value?[{value:e.value}]:null),e.valueSets!==void 0&&(r.control.valueSets=e.valueSets),e.dateFormat!==void 0&&(r.control.dateFormat=e.dateFormat),e.numberExclusiveOptions!==void 0&&(r.control.numberExclusiveOptions=e.numberExclusiveOptions),e.underline!==void 0&&(r.control.underline=e.underline))}),e.placeholder!==void 0){const r=e.placeholder,s=[];if(t.forEach((l,a)=>{l.controlId===n&&l.controlComponent==="placeholder"&&s.push({element:l,index:a})}),s.length===r.length)s.forEach((l,a)=>{l.element.value=r[a]===`
546
+ `?ee:r[a]});else if(s.length>0){const l={...s[0].element};s.sort((c,d)=>d.index-c.index).forEach(c=>{t.splice(c.index,1)});const a=Math.min(...s.map(c=>c.index));for(let c=0;c<r.length;c++){const d=r[c]===`
547
+ `?ee:r[c];t.splice(a+c,0,{...l,value:d})}}}const{endIndex:i}=this.range.getRange();this.draw.render({curIndex:i,isSetCursor:!0})}}delButton(e,t){return new Promise(n=>{for(let i=e.length-1;i>=0;i--)t.some(s=>s.controlId===e[i].controlId&&s.type===e[i].type)&&e.splice(i,1);n(!0)})}editButton(e,t,n){const i=this.draw.getElementList();n=n+1;for(let c=0;c<t.label.length;c++){const d={value:t.label[c],controlId:t.controlId,type:O.CONTROL,control:{type:"button",buttonLabel:t.label,code:t.code,value:[{value:t.label}],label:t.label,hide:!1},controlComponent:"value",color:"#fff",highlight:"#1677FF",style:"16px Microsoft YaHei",hide:!1};i.splice(n+c,0,d)}const{startIndex:r,endIndex:s}=this.range.getRange(),l=!0,a=s;this.draw.render({curIndex:a,isSetCursor:l})}removeButtonElementsByControlId(e){return new Promise(t=>{const n=this.draw.getElementList();for(let a=n.length-1;a>=0;a--)n[a].controlId===e&&n.splice(a,1);const{startIndex:i,endIndex:r}=this.range.getRange(),s=!0,l=r;this.draw.render({curIndex:l,isSetCursor:s}),t(!0)})}removeByValue(e,t){return new Promise(n=>{for(let a=e.length-1;a>=0;a--)(e[a].type=="control"||e[a].type=="text"||e[a].type=="buttonText")&&e[a].control?.buttonLabel===t&&e[a].control?.buttonText&&e.splice(a,1);const{startIndex:i,endIndex:r}=this.range.getRange(),s=!0,l=r;this.draw.render({curIndex:l,isSetCursor:s}),n(!0)})}insertButtonValue(e){const t=this.draw.getElementList(),n=e.controlId,i=e.element[0].newButtonValue,r=e.element[0].control.buttonLabel,s=e.element[0].control.code;if(!i||!i.length)return;let l=-1;for(let f=0;f<t.length;f++)if(t[f].controlId===n&&t[f].control?.type==="button"){l=f;break}if(l===-1)return;const a=n+"_text",c=[];for(let f=0;f<i.length;f++){const T=i[f];c.push({value:T.value,code:T.code})}const d={type:"button",buttonLabel:r,buttonText:!0,label:r,code:s,value:c,hide:!1},u=[];u.push({value:"[",controlId:a,type:O.CONTROL,control:d,controlComponent:p.PREFIX,color:"#1677FF",hide:!1});for(let f=0;f<i.length;f++){const T=i[f],I=i.length>1?`${f+1}.${T.value}`:T.value,L=be(I);for(let S=0;S<L.length;S++)u.push({value:L[S],controlId:a,type:O.CONTROL,control:d,controlComponent:p.VALUE,color:"#000",hide:!1});i.length>1&&f<i.length-1&&u.push({value:ee,controlId:a,type:O.CONTROL,control:d,controlComponent:p.VALUE,color:"#000",hide:!1})}u.push({value:"]",controlId:a,type:O.CONTROL,control:d,controlComponent:p.POSTFIX,color:"#1677FF",hide:!1});for(let f=0;f<u.length;f++)t.splice(l+f,0,u[f]);const{startIndex:h,endIndex:R}=this.range.getRange(),g=!0,m=R;this.draw.render({curIndex:m,isSetCursor:g})}font(e,t){const{isIgnoreDisabledRule:n=!1}=t||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length)r.forEach(s=>{s.font=e}),this.draw.render({isSetCursor:!1});else{let s=!0;const{endIndex:l}=this.range.getRange(),c=this.draw.getElementList()[l];this.range.setDefaultStyle({font:e}),c?.value===ee?c.font=e:s=!1,this.draw.render({isSubmitHistory:s,curIndex:l,isCompute:!1})}}size(e,t){const{isIgnoreDisabledRule:n=!1}=t||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{minSize:r,maxSize:s,defaultSize:l}=this.options;if(e<r||e>s)return;let a={},c=[];const d=this.range.getTextLikeSelectionElementList();if(d?.length)c=d,a={isSetCursor:!1};else{const{endIndex:h}=this.range.getRange(),g=this.draw.getElementList()[h];this.range.setDefaultStyle({size:e}),g?.value===ee?(c.push(g),a={curIndex:h}):this.draw.render({curIndex:h,isCompute:!1,isSubmitHistory:!1})}if(!c.length)return;let u=!1;c.forEach(h=>{!h.size&&e===l||h.size&&h.size===e||(h.size=e,u=!0)}),u&&this.draw.render(a)}sizeAdd(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,maxSize:r}=this.options,s=this.range.getTextLikeSelectionElementList();let l={},a=[];if(s?.length)a=s,l={isSetCursor:!1};else{const{endIndex:d}=this.range.getRange(),h=this.draw.getElementList()[d],g=this.range.getDefaultStyle()?.size||h.size||i;this.range.setDefaultStyle({size:g+2>r?r:g+2}),h?.value===ee?(a.push(h),l={curIndex:d}):this.draw.render({curIndex:d,isCompute:!1,isSubmitHistory:!1})}if(!a.length)return;let c=!1;a.forEach(d=>{d.size||(d.size=i),!(d.size>=r)&&(d.size+2>r?d.size=r:d.size+=2,c=!0)}),c&&this.draw.render(l)}sizeMinus(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const{defaultSize:i,minSize:r}=this.options,s=this.range.getTextLikeSelectionElementList();let l={},a=[];if(s?.length)a=s,l={isSetCursor:!1};else{const{endIndex:d}=this.range.getRange(),h=this.draw.getElementList()[d],g=this.range.getDefaultStyle()?.size||h.size||i;this.range.setDefaultStyle({size:g-2<r?r:g-2}),h?.value===ee?(a.push(h),l={curIndex:d}):this.draw.render({curIndex:d,isCompute:!1,isSubmitHistory:!1})}if(!a.length)return;let c=!1;a.forEach(d=>{d.size||(d.size=i),!(d.size<=r)&&(d.size-2<r?d.size=r:d.size-=2,c=!0)}),c&&this.draw.render(l)}bold(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const r=i.findIndex(s=>!s.bold);i.forEach(s=>{s.bold=!!~r}),this.draw.render({isSetCursor:!1})}else{let r=!0;const{endIndex:s}=this.range.getRange(),a=this.draw.getElementList()[s];this.range.setDefaultStyle({bold:a.bold?!1:!this.range.getDefaultStyle()?.bold}),a?.value===ee?a.bold=!a.bold:r=!1,this.draw.render({isSubmitHistory:r,curIndex:s,isCompute:!1})}}italic(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const r=i.findIndex(s=>!s.italic);i.forEach(s=>{s.italic=!!~r}),this.draw.render({isSetCursor:!1})}else{let r=!0;const{endIndex:s}=this.range.getRange(),a=this.draw.getElementList()[s];this.range.setDefaultStyle({italic:a.italic?!1:!this.range.getDefaultStyle()?.italic}),a?.value===ee?a.italic=!a.italic:r=!1,this.draw.render({isSubmitHistory:r,curIndex:s,isCompute:!1})}}underline(e,t){const{isIgnoreDisabledRule:n=!1}=t||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length){const s=r.some(l=>!l.underline||!e&&l.textDecoration||e&&!l.textDecoration||e&&l.textDecoration&&!Tc(l.textDecoration,e));r.forEach(l=>{l.underline=s,s&&e?l.textDecoration=e:delete l.textDecoration}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let s=!0;const{endIndex:l}=this.range.getRange(),c=this.draw.getElementList()[l];this.range.setDefaultStyle({underline:c?.underline?!1:!this.range.getDefaultStyle()?.underline}),c?.value===ee?c.underline=!c.underline:s=!1,this.draw.render({isSubmitHistory:s,curIndex:l,isCompute:!1})}}strikeout(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(i?.length){const r=i.findIndex(s=>!s.strikeout);i.forEach(s=>{s.strikeout=!!~r}),this.draw.render({isSetCursor:!1,isCompute:!1})}else{let r=!0;const{endIndex:s}=this.range.getRange(),a=this.draw.getElementList()[s];this.range.setDefaultStyle({strikeout:a.strikeout?!1:!this.range.getDefaultStyle()?.strikeout}),a?.value===ee?a.strikeout=!a.strikeout:r=!1,this.draw.render({isSubmitHistory:r,curIndex:s,isCompute:!1})}}superscript(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const r=i.findIndex(s=>s.type===O.SUPERSCRIPT);i.forEach(s=>{~r?s.type===O.SUPERSCRIPT&&(s.type=O.TEXT,delete s.actualSize):(!s.type||s.type===O.TEXT||s.type===O.SUBSCRIPT)&&(s.type=O.SUPERSCRIPT)}),this.draw.render({isSetCursor:!1})}subscript(e){const{isIgnoreDisabledRule:t=!1}=e||{};if(!t&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const i=this.range.getSelectionElementList();if(!i)return;const r=i.findIndex(s=>s.type===O.SUBSCRIPT);i.forEach(s=>{~r?s.type===O.SUBSCRIPT&&(s.type=O.TEXT,delete s.actualSize):(!s.type||s.type===O.TEXT||s.type===O.SUPERSCRIPT)&&(s.type=O.SUBSCRIPT)}),this.draw.render({isSetCursor:!1})}color(e,t){const{isIgnoreDisabledRule:n=!1}=t||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length)r.forEach(s=>{e?s.color=e:delete s.color}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let s=!0;const{endIndex:l}=this.range.getRange(),c=this.draw.getElementList()[l];this.range.setDefaultStyle({color:e||void 0}),c?.value===ee?e?c.color=e:delete c.color:s=!1,this.draw.render({isSubmitHistory:s,curIndex:l,isCompute:!1})}}highlight(e,t){const{isIgnoreDisabledRule:n=!1}=t||{};if(!n&&(this.draw.isReadonly()||this.draw.isDisabled()))return;const r=this.range.getSelectionElementList();if(r?.length)r.forEach(s=>{e?s.highlight=e:delete s.highlight}),this.draw.render({isSetCursor:!1,isCompute:!1});else{let s=!0;const{endIndex:l}=this.range.getRange(),c=this.draw.getElementList()[l];this.range.setDefaultStyle({highlight:e||void 0}),c?.value===ee?e?c.highlight=e:delete c.highlight:s=!1,this.draw.render({isSubmitHistory:s,curIndex:l,isCompute:!1})}}title(e){if(this.draw.isReadonly()||this.draw.isDisabled())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.draw.getElementList(),s=n===i?this.range.getRangeParagraphElementList():r.slice(n+1,i+1);if(!s||!s.length)return;const l=Ee(),a=this.draw.getOptions().title;s.forEach(u=>{!u.type&&u.value===ee||(e?(u.level=e,u.titleId=l,ci(u)&&(u.size=a[Ml[e]],u.bold=!0)):u.titleId&&(delete u.titleId,delete u.title,delete u.level,delete u.size,delete u.bold))});const c=n===i,d=c?i:n;this.draw.render({curIndex:d,isSetCursor:c})}list(e,t){this.draw.isReadonly()||this.draw.getListParticle().setList(e,t)}rowFlex(e){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(a=>{a.rowFlex=e});const s=n===i,l=s?i:n;this.draw.render({curIndex:l,isSetCursor:s})}vertical(e){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(a=>{a.vertical=e});const s=n===i,l=s?i:n;this.draw.render({curIndex:l,isSetCursor:s})}rowMargin(e){if(this.draw.isReadonly())return;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return;const r=this.range.getRangeRowElementList();if(!r)return;r.forEach(a=>{a.rowMargin=e});const s=n===i,l=s?i:n;this.draw.render({curIndex:l,isSetCursor:s})}insertTable(e,t){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.tableOperate.insertTable(e,t)}insertTableTopRow(){this.draw.isReadonly()||this.tableOperate.insertTableTopRow()}insertTableBottomRow(){this.draw.isReadonly()||this.tableOperate.insertTableBottomRow()}insertTableLeftCol(){this.draw.isReadonly()||this.tableOperate.insertTableLeftCol()}insertTableRightCol(){this.draw.isReadonly()||this.tableOperate.insertTableRightCol()}deleteTableRow(){this.draw.isReadonly()||this.tableOperate.deleteTableRow()}deleteTableCol(){this.draw.isReadonly()||this.tableOperate.deleteTableCol()}deleteTable(){this.draw.isReadonly()||this.tableOperate.deleteTable()}mergeTableCell(){this.draw.isReadonly()||this.tableOperate.mergeTableCell()}cancelMergeTableCell(){this.draw.isReadonly()||this.tableOperate.cancelMergeTableCell()}splitVerticalTableCell(){this.draw.isReadonly()||this.tableOperate.splitVerticalTableCell()}splitHorizontalTableCell(){this.draw.isReadonly()||this.tableOperate.splitHorizontalTableCell()}tableTdVerticalAlign(e){this.draw.isReadonly()||this.tableOperate.tableTdVerticalAlign(e)}tableBorderType(e){this.draw.isReadonly()||this.tableOperate.tableBorderType(e)}tableBorderColor(e){this.draw.isReadonly()||this.tableOperate.tableBorderColor(e)}tableTdBorderType(e){this.draw.isReadonly()||this.tableOperate.tableTdBorderType(e)}tableTdSlashType(e){this.draw.isReadonly()||this.tableOperate.tableTdSlashType(e)}tableTdBackgroundColor(e){this.draw.isReadonly()||this.tableOperate.tableTdBackgroundColor(e)}tableSelectAll(){this.tableOperate.tableSelectAll()}tableProperties(){this.draw.isReadonly()||this.tableOperate.tableProperties()}hyperlink(e){const{valueList:t,url:n,hyperlinkId:i}=e;if(!n||!t?.length||this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl())return;const{startIndex:l,endIndex:a}=this.range.getRange();!~l&&!~a||this.insertElementList([{type:O.HYPERLINK,value:"",valueList:t,url:n,hyperlinkId:i||Ee()}])}getHyperlinkRange(){let e=-1,t=-1;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=this.draw.getElementList(),s=r[n];if(s.type!==O.HYPERLINK)return null;let l=n;for(;l>0;){if(r[l].hyperlinkId!==s.hyperlinkId){e=l+1;break}l--}let a=n+1;for(;a<r.length;){if(r[a].hyperlinkId!==s.hyperlinkId){t=a-1;break}a++}return a===r.length&&(t=a-1),!~e||!~t?null:[e,t]}deleteHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const t=this.getHyperlinkRange();if(!t)return;const n=this.draw.getElementList(),[i,r]=t;this.draw.spliceElementList(n,i,r-i+1),this.draw.getHyperlinkParticle().clearHyperlinkPopup();const s=i-1;this.range.setRange(s,s),this.draw.render({curIndex:s})}cancelHyperlink(){if(this.draw.isReadonly()||this.draw.isDisabled())return;const t=this.getHyperlinkRange();if(!t)return;const n=this.draw.getElementList(),[i,r]=t;for(let l=i;l<=r;l++){const a=n[l];delete a.type,delete a.url,delete a.hyperlinkId,delete a.underline}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:s}=this.range.getRange();this.draw.render({curIndex:s,isCompute:!1})}editHyperlink(e){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=this.getHyperlinkRange();if(!n)return;const i=this.draw.getElementList(),[r,s]=n;for(let a=r;a<=s;a++){const c=i[a];c.url=e}this.draw.getHyperlinkParticle().clearHyperlinkPopup();const{endIndex:l}=this.range.getRange();this.draw.render({curIndex:l,isCompute:!1})}separator(e,t){if(this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl())return;const{startIndex:r,endIndex:s}=this.range.getRange();if(!~r&&!~s)return;const l=this.draw.getElementList();let a=-1;const c=l[s+1];if(c&&c.type===O.SEPARATOR){if(c.dashArray&&c.dashArray.join()===e.join())return;a=s,Object.assign(c,{dashArray:e,...t})}else{const d={value:Fr,type:O.SEPARATOR,dashArray:e,...t};ze(l,[d],r,{editorOptions:this.options}),r!==0&&l[r].value===ee?(this.draw.spliceElementList(l,r,1,[d]),a=r-1):(this.draw.spliceElementList(l,r+1,0,[d]),a=r)}this.range.setRange(a,a),this.draw.render({curIndex:a})}pageBreak(){this.draw.isReadonly()||this.draw.isDisabled()||this.control.getActiveControl()||this.insertElementList([{type:O.PAGE_BREAK,value:Fr}])}addWatermark(e){if(this.draw.isReadonly())return;const n=this.draw.getOptions(),{color:i,size:r,opacity:s,font:l,gap:a}=cs;n.watermark.data=e.data,n.watermark.type=e.type||Ti.TEXT,e.width&&(n.watermark.width=e.width),e.height&&(n.watermark.height=e.height),n.watermark.color=e.color||i,n.watermark.opacity=e.opacity||s,n.watermark.size=e.size||r,n.watermark.font=e.font||l,n.watermark.repeat=!!e.repeat,e.numberType&&(n.watermark.numberType=e.numberType),n.watermark.gap=e.gap||a,this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1})}deleteWatermark(){if(this.draw.isReadonly())return;const t=this.draw.getOptions();t.watermark&&t.watermark.data&&(t.watermark={...cs},this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1}))}image(e){if(this.draw.isReadonly()||this.draw.isDisabled())return null;const{startIndex:n,endIndex:i}=this.range.getRange();if(!~n&&!~i)return null;const r=e.id||Ee();return this.insertElementList([{...e,id:r,type:O.IMAGE}]),r}search(e,t){this.searchManager.setSearchKeyword(e,t),this.draw.render({isSubmitHistory:!1})}searchNavigatePre(){this.searchManager.searchNavigatePre()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}searchNavigateNext(){this.searchManager.searchNavigateNext()!==null&&this.draw.render({isSetCursor:!1,isSubmitHistory:!1,isCompute:!1,isLazy:!1})}getSearchNavigateInfo(){return this.searchManager.getSearchNavigateInfo()}replace(e,t){this.draw.getSearch().replace(e,t)}async print(){const{scale:e,printPixelRatio:t,paperDirection:n,width:i,height:r}=this.options;e!==1&&this.draw.setPageScale(1);const s=await this.draw.getDataURL({pixelRatio:t,mode:B.PRINT});vf(s,{width:i,height:r,direction:n}),e!==1&&this.draw.setPageScale(e)}replaceImageElement(e){const{startIndex:t}=this.range.getRange(),i=this.draw.getElementList()[t];!i||i.type!==O.IMAGE||(i.value=e,this.draw.render({isSetCursor:!1}))}saveAsImageElement(){const{startIndex:e}=this.range.getRange(),n=this.draw.getElementList()[e];!n||n.type!==O.IMAGE||pl(n.value,`${n.id}.png`)}setImageCrop(e){const{startIndex:t}=this.range.getRange(),i=this.draw.getElementList()[t];!i||i.type!==O.IMAGE||(i.imgCrop=e,this.draw.render({isSetCursor:!1,isCompute:!1}))}setImageCaption(e){const{startIndex:t}=this.range.getRange(),i=this.draw.getElementList()[t];i?.type===O.IMAGE&&(i.imgCaption=e,this.draw.render({isSetCursor:!1}))}changeImageDisplay(e,t){if(e.imgDisplay===t)return;e.imgDisplay=t;const{startIndex:n,endIndex:i}=this.range.getRange();if(t===Ne.SURROUND||t===Ne.FLOAT_TOP||t===Ne.FLOAT_BOTTOM){const r=this.position.getPositionList(),{pageNo:s,coordinate:{leftTop:l}}=r[n];e.imgFloatPosition={pageNo:s,x:l[0],y:l[1]}}else delete e.imgFloatPosition;this.draw.getPreviewer().clearResizer(),this.draw.render({isSetCursor:!0,curIndex:i})}getImage(e){return this.draw.getDataURL(e)}getPageMode(){return this.options}getOptions(){return this.options}getValue(e){return this.draw.getValue(e)}getValueAsync(e){return this.draw.getWorkerManager().getValue(e)}getAreaValue(e){return this.draw.getArea().getAreaValue(e)}getHTML(){const e=this.options,t=this.draw.getHeaderElementList(),n=this.draw.getOriginalMainElementList(),i=this.draw.getFooterElementList();return{header:Xo(t,e).innerHTML,main:Xo(n,e).innerHTML,footer:Xo(i,e).innerHTML}}getText(){const e=this.draw.getHeaderElementList(),t=this.draw.getOriginalMainElementList(),n=this.draw.getFooterElementList();return{header:Oo(e),main:Oo(t),footer:Oo(n)}}getWordCount(){return this.workerManager.getWordCount()}getCursorPosition(){return this.position.getCursorPosition()}getRemainingContentHeight(){if(!this.draw.getIsPagingMode())return 0;const e=this.draw.getPageRowList(),t=e.length-1,i=(e[t]||[]).reduce((a,c)=>a+c.height+(c.offsetY||0),0),r=this.draw.getHeight(),s=this.draw.getMainOuterHeight(),l=r-(s+i);return l>0?l:0}computeElementListHeight(e){if(!e.length)return 0;const t=this.draw.getInnerWidth();if(t<=0)return 0;const n=xe(e);ct(n,{isHandleFirstElement:!1,editorOptions:this.options});const i=xs(n);return this.draw.computeRowList({innerWidth:t,elementList:n,surroundElementList:i}).reduce((s,l)=>s+l.height+(l.offsetY||0),0)}getRange(){return xe(this.range.getRange())}getRangeText(){return this.range.toString()}getRangeContext(){const e=this.range.getRange(),{startIndex:t,endIndex:n}=e;if(!~t&&!~n)return null;const i=t===n,r=this.range.toString(),s=Ge(this.range.getSelectionElementList()||[]),l=this.draw.getElementList(),a=Sn(l[i?t:t+1],{extraPickAttrs:["id","controlComponent"]}),c=Sn(l[n],{extraPickAttrs:["id","controlComponent"]}),d=this.draw.getRowList(),u=this.position.getPositionList(),h=u[t],R=u[n],g=h?.pageNo,m=R?.pageNo,f=h?.rowIndex,T=R?.rowIndex,I=d[f],L=d[T];let S=0,M=0;this.draw.getCursor().getHitLineStartIndex()||(S=I?.elementList[0]?.value===ee?h?.index-I?.startIndex:h?.index-I?.startIndex+1),h===R?M=S:M=L.elementList[0]?.value===ee?R.index-L.startIndex:R.index-L.startIndex+1;const X=[],x=this.draw.getOriginalHeight(),F=this.draw.getOriginalPageGap(),D=this.position.getSelectionPositionList();if(D){let Q=null,K=0,z=null;for(let $=0;$<D.length;$++){const{rowNo:le,pageNo:Pe,coordinate:{leftTop:se,rightTop:J},lineHeight:ie}=D[$];Q===null||Q!==le?(z&&X.push(z),z={x:se[0],y:se[1]+Pe*(x+F),width:J[0]-se[0],height:ie},Q=le,K=se[0]):z.width=J[0]-K,$===D.length-1&&z&&X.push(z)}}else{const K=this.position.getPositionList()[n],{coordinate:{rightTop:z},pageNo:$,lineHeight:le}=K;X.push({x:z[0],y:z[1]+$*(x+F),width:0,height:le})}const V=this.draw.getZone().getZone(),{isTable:E,trIndex:v,tdIndex:b,index:P}=this.position.getPositionContext();let y=null;if(E){const K=this.draw.getOriginalElementList()[P]||null;K&&(y=Ge([K])[0])}let N=null,U=null,w=t-1;for(;w>0;){const Q=l[w],K=l[w-1];if(Q.titleId&&Q.titleId!==K?.titleId){N=Q.titleId,U=u[w].pageNo;break}w--}return xe({isCollapsed:i,startElement:a,endElement:c,startPageNo:g,endPageNo:m,startRowNo:f,endRowNo:T,startColNo:S,endColNo:M,rangeRects:X,zone:V,isTable:E,trIndex:v??null,tdIndex:b??null,tableElement:y,selectionText:r,selectionElementList:s,titleId:N,titleStartPageNo:U})}getRangeRow(){const e=this.range.getRangeRowElementList();return e?Ge(e):null}getRangeParagraph(){const e=this.range.getRangeParagraphElementList();return e?Ge(e):null}getKeywordRangeList(e){return this.range.getKeywordRangeList(e)}getKeywordContext(e){const t=this.getKeywordRangeList(e);if(!t.length)return null;const n=[],i=this.position.getOriginalMainPositionList(),r=this.draw.getOriginalMainElementList();for(let s=0;s<t.length;s++){const l=t[s],{startIndex:a,endIndex:c,tableId:d,startTrIndex:u,startTdIndex:h}=l;let R=i;if(l.tableId){const f=r.find(T=>T.id===d);f&&(R=f.trList?.[u]?.tdList?.[h]?.positionList||[])}const g=xe(R[a]),m=xe(R[c]);n.push({range:l,startPosition:g,endPosition:m})}return n}pageMode(e){this.draw.setPageMode(e)}pageScale(e){e!==this.options.scale&&this.draw.setPageScale(e)}pageScaleRecovery(){const{scale:e}=this.options;e!==1&&this.draw.setPageScale(1)}pageScaleMinus(){const{scale:e}=this.options,t=e*10-1;t>=5&&this.draw.setPageScale(t/10)}pageScaleAdd(){const{scale:e}=this.options,t=e*10+1;t<=30&&this.draw.setPageScale(t/10)}paperSize(e,t){this.draw.setPaperSize(e,t)}paperDirection(e){this.draw.setPaperDirection(e)}getPaperMargin(){return this.options.margins}setPaperMargin(e){return this.draw.setPaperMargin(e)}setMainBadge(e){this.draw.getBadge().setMainBadge(e),this.draw.render({isCompute:!1,isSubmitHistory:!1})}setAreaBadge(e){this.draw.getBadge().setAreaBadgeMap(e),this.draw.render({isCompute:!1,isSubmitHistory:!1})}insertElementList(e,t={}){if(!e.length||this.draw.isReadonly()||this.draw.isDisabled())return;const{isReplace:i=!0,ignoreContextKeys:r}=t;i||this.range.shrinkRange(),console.log(e,"payload");const s=xe(e),{startIndex:l}=this.range.getRange(),a=this.draw.getElementList();ze(a,s,l,{ignoreContextKeys:r,isBreakWhenWrap:!0,editorOptions:this.options}),console.log(s,"cloneElementList"),this.draw.insertElementList(s,t),setTimeout(()=>{console.log(a,"elementList")},500)}appendElementList(e,t){!e.length||this.draw.isReadonly()||this.draw.appendElementList(xe(e),t)}updateElementById(e){const{id:t,conceptId:n}=e;if(!t&&!n)return;const i=[];function r(l,a=!1){let c=0;for(;c<l.length;){const d=l[c];if(c++,d.type===O.TABLE){const u=d.trList;for(let h=0;h<u.length;h++){const R=u[h];for(let g=0;g<R.tdList.length;g++){const m=R.tdList[g];r(m.value,a)}}}d.type===O.CONTROL&&d.control?.value&&r(d.control.value,!0),(t&&d.id===t||n&&d.conceptId===n)&&i.push({elementList:l,index:c-1,isInsideControl:a})}}const s=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const l of s)r(l);if(i.length){for(let l=0;l<i.length;l++){const{elementList:a,index:c,isInsideControl:d}=i[l],u=a[c],h=u.controlId&&u.controlComponent===p.VALUE;if(d||h){if(Object.assign(u,e.properties),u.id){const R=hd(u.id);R&&Object.assign(R,e.properties)}}else{const R=Ge([{...u,...e.properties}],{extraPickAttrs:["id"]});R.length>0&&R[0]?(Mn(Yn,u,R[0]),ct(R,{isHandleFirstElement:!1,editorOptions:this.options}),a[c]=R[0]):Object.assign(u,e.properties)}}this.draw.render({isSetCursor:!1})}}deleteElementById(e){const{id:t,conceptId:n}=e;if(!t&&!n)return;let i=!1;function r(l){let a=0;for(;a<l.length;){const c=l[a];if(c.type===O.TABLE){const d=c.trList;for(let u=0;u<d.length;u++){const h=d[u];for(let R=0;R<h.tdList.length;R++){const g=h.tdList[R];r(g.value)}}}c.type===O.CONTROL&&c.control?.value&&r(c.control.value),(t&&c.id===t||n&&c.conceptId===n)&&(i=!0,l.splice(a,1),a--),a++}}const s=[this.draw.getOriginalMainElementList(),this.draw.getHeaderElementList(),this.draw.getFooterElementList()];for(const l of s)r(l);i&&this.draw.render({isSetCursor:!1})}getElementById(e){const{id:t,conceptId:n}=e,i=[];if(!t&&!n)return i;const r=l=>{let a=0;for(;a<l.length;){const c=l[a];if(a++,c.type===O.TABLE){const d=c.trList;for(let u=0;u<d.length;u++){const h=d[u];for(let R=0;R<h.tdList.length;R++){const g=h.tdList[R];r(g.value)}}}t&&c.id!==t||n&&c.conceptId!==n||i.push(c)}},s=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const l of s)r(l);return Ge(i,{extraPickAttrs:["id"]})}setValue(e,t){this.draw.setValue(e,t)}removeControl(e){if(e?.id||e?.conceptId){const{id:t,conceptId:n}=e;let i=!1;const r=l=>{let a=l.length-1;for(;a>=0;){const c=l[a];if(c.type===O.TABLE){const d=c.trList;for(let u=0;u<d.length;u++){const h=d[u];for(let R=0;R<h.tdList.length;R++){const g=h.tdList[R];r(g.value)}}}a--,!(!c.control||t&&c.controlId!==t||n&&c.control.conceptId!==n)&&(i=!0,l.splice(a+1,1))}},s=[this.draw.getHeaderElementList(),this.draw.getOriginalMainElementList(),this.draw.getFooterElementList()];for(const l of s)r(l);i&&this.draw.render({isSetCursor:!1})}else{const{startIndex:t,endIndex:n}=this.range.getRange();if(t!==n||!this.draw.getElementList()[t].controlId)return;const l=this.draw.getControl().removeControl(t);if(l===null)return;this.range.setRange(l,l),this.draw.render({curIndex:l})}}translate(e){return this.i18n.t(e)}setLocale(e){this.i18n.setLocale(e)}getLocale(){return this.i18n.getLocale()}getCatalog(){return this.workerManager.getCatalog()}locationCatalog(e){const t=this.draw.getOriginalElementList();function n(T,I){for(let L=0;L<T.length;L++){const S=T[L];if(S.type===O.TABLE){const M=S.trList;for(let X=0;X<M.length;X++){const x=M[X];for(let F=0;F<x.tdList.length;F++){const D=x.tdList[F],V=n(D.value,I);if(V)return{...V,isTable:!0,index:L,trIndex:X,tdIndex:F,tdId:D.id,trId:x.id,tableId:S.id}}}}if(S.titleId===I){let M=L;for(;M<T.length;){if(T[M+1]?.titleId!==I)return{isTable:!1,startIndex:M,endIndex:M};M++}}}return null}const i=n(t,e);if(!i)return;const{isTable:r,index:s,startTdIndex:l,endTdIndex:a,startTrIndex:c,endTrIndex:d,trIndex:u,tdIndex:h,tdId:R,trId:g,tableId:m,endIndex:f}=i;this.position.setPositionContext({isTable:r,index:s,trIndex:u,tdIndex:h,tdId:R,trId:g,tableId:m}),this.range.setRange(f,f,m,l,a,c,d),this.draw.render({curIndex:f,isCompute:!1,isSubmitHistory:!1})}wordTool(){const e=this.draw.getMainElementList();let t=!1;for(let n=0;n<e.length;n++)if(e[n].value===ee)for(;n+1<e.length;){const r=e[n+1];if(r.value!==ee&&r.value!==Ss)break;e.splice(n+1,1),t=!0}if(t)this.draw.render({isSetCursor:!1});else{const n=this.range.getIsCollapsed();this.draw.getCursor().drawCursor({isShow:n})}}setHTML(e){const{header:t,main:n,footer:i}=e,r=this.draw.getOriginalInnerWidth(),s=l=>l!==void 0?Eo(l,{innerWidth:r}):void 0;this.setValue({header:s(t),main:s(n),footer:s(i)})}setGroup(){return this.draw.isReadonly()?null:this.draw.getGroup().setGroup()}deleteGroup(e){this.draw.isReadonly()||this.draw.getGroup().deleteGroup(e)}getGroupIds(){return this.draw.getWorkerManager().getGroupIds()}locationGroup(e){const t=this.draw.getOriginalMainElementList(),n=this.draw.getGroup().getContextByGroupId(t,e);if(!n)return;const{isTable:i,index:r,trIndex:s,tdIndex:l,tdId:a,trId:c,tableId:d,endIndex:u}=n;this.position.setPositionContext({isTable:i,index:r,trIndex:s,tdIndex:l,tdId:a,trId:c,tableId:d}),this.range.setRange(u,u),this.draw.render({curIndex:u,isCompute:!1,isSubmitHistory:!1})}setZone(e){this.draw.getZone().setZone(e)}getControlValue(e){return this.draw.getControl().getValueById(e)}setControlValue(e){this.draw.getControl().setValueListById([e])}setControlValueList(e){this.draw.getControl().setValueListById(e)}setControlExtension(e){this.draw.getControl().setExtensionListById([e])}setControlExtensionList(e){this.draw.getControl().setExtensionListById(e)}setControlProperties(e){this.draw.getControl().setPropertiesListById([e])}setControlPropertiesList(e){this.draw.getControl().setPropertiesListById(e)}setControlHighlight(e){this.draw.getControl().setHighlightList(e),this.draw.render({isSubmitHistory:!1})}updateOptions(e){const t=ys(e);Object.entries(t).forEach(([n,i])=>{Reflect.set(this.options,n,i)}),this.forceUpdate()}getControlList(){return this.draw.getControl().getList()}locationControl(e,t){function n(r,s){let l=0;for(;l<r.length;){const a=r[l];if(l++,a.type===O.TABLE){const d=a.trList;for(let u=0;u<d.length;u++){const h=d[u];for(let R=0;R<h.tdList.length;R++){const g=h.tdList[R],m=n(g.value,s);if(m)return{...m,positionContext:{isTable:!0,index:l-1,trIndex:u,tdIndex:R,tdId:a.tdId,trId:a.trId,tableId:a.tableId}}}}}if(a?.controlId!==e)continue;let c=l-1;if(t?.position===St.OUTER_AFTER){if(!(a.controlComponent===p.POSTFIX&&r[l+1]?.controlComponent!==p.POST_TEXT))continue}else if(t?.position===St.OUTER_BEFORE)c-=1;else if(t?.position===St.AFTER){if(c-=1,a.controlComponent!==p.PLACEHOLDER&&a.controlComponent!==p.POSTFIX&&a.controlComponent!==p.POST_TEXT)continue}else if(a.controlComponent!==p.PREFIX&&a.controlComponent!==p.PRE_TEXT||r[l]?.controlComponent===p.PREFIX||r[l]?.controlComponent===p.PRE_TEXT)continue;return{zone:s,range:{startIndex:c,endIndex:c},positionContext:{isTable:!1}}}return null}const i=[{zone:De.HEADER,elementList:this.draw.getHeaderElementList()},{zone:De.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:De.FOOTER,elementList:this.draw.getFooterElementList()}];for(const r of i){const s=n(r.elementList,r.zone);if(s){this.setZone(s.zone),this.position.setPositionContext(s.positionContext),this.range.replaceRange(s.range),this.draw.render({curIndex:s.range.startIndex,isCompute:!1,isSubmitHistory:!1});break}}}insertTextField(e){if(this.draw.isReadonly()||this.draw.isDisabled()||!e)return;const n=xe(e),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList(),s=jn(r,i);if(!s)return;const l=[...qn,...Vt,...Mo,...Yn];Mn(l,s,n),this.draw.insertElementTextField([n])}insertControl(e){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=xe(e),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList(),s=jn(r,i);if(!s)return;const l=r[i],a=l?.controlComponent===p.POSTFIX||l?.controlComponent===p.POSTTEXTFIX;let c=!1;if(l?.controlId&&!a)for(let u=i;u>=0;u--){const h=r[u];if(h.controlId!==l.controlId)break;if(h.controlComponent===p.PRETEXTFIX||h.controlComponent===p.PRETEXTFIX_TEXT){h.control?.type===Y.TEXTFIELD&&(c=!0);break}}if(!c&&!a){const u=r[i-1];if(u?.controlId)for(let h=i-1;h>=0;h--){const R=r[h];if(R.controlId!==u.controlId)break;if(R.controlComponent===p.PRETEXTFIX||R.controlComponent===p.PRETEXTFIX_TEXT){R.control?.type===Y.TEXTFIELD&&(c=!0);break}}}if(c&&e.control?.type===Y.TEXTFIELD)return;const d=[...qn,...Vt,...Mo,...Yn];Mn(d,s,n),this.draw.insertElementList([n])}jumpControl(e){this.draw.getControl().initNextControl({direction:e?.direction})}getContainer(){return this.draw.getContainer()}getTitleValue(e){const{conceptId:t}=e,n=[],i=(s,l)=>{let a=0;for(;a<s.length;){const c=s[a];if(a++,c.type===O.TABLE){const h=c.trList;for(let R=0;R<h.length;R++){const g=h[R];for(let m=0;m<g.tdList.length;m++){const f=g.tdList[m];i(f.value,l)}}}if(c?.title?.conceptId!==t)continue;const d=[];let u=a;for(;u<s.length;){const h=s[u];if(u++,c.titleId!==h.titleId){if(h.level&&as[h.level]<=as[c.level])break;d.push(h)}}n.push({...c.title,value:Oo(d),elementList:Ge(d),zone:l}),a=u}},r=[{zone:De.HEADER,elementList:this.draw.getHeaderElementList()},{zone:De.MAIN,elementList:this.draw.getOriginalMainElementList()},{zone:De.FOOTER,elementList:this.draw.getFooterElementList()}];for(const{zone:s,elementList:l}of r)i(l,s);return n}getPositionContextByEvent(e,t={}){const n=e.target?.dataset.index;if(!n)return null;const{isMustDirectHit:i=!0}=t,r=Number(n),s=this.position.getPositionByXY({x:e.offsetX,y:e.offsetY,pageNo:r}),{isDirectHit:l,isTable:a,index:c,trIndex:d,tdIndex:u,tdValueIndex:h,zone:R}=s;if(i&&!l||R&&R!==this.zone.getZone())return null;let g=null,m=null;const f=this.draw.getOriginalElementList();let T=null;const I=this.position.getOriginalPositionList();if(a){const S=f[c].trList?.[d].tdList[u];m=S?.value[h]||null,T=S?.positionList?.[h]||null,g={element:f[c],trIndex:d,tdIndex:u}}else m=f[c]||null,T=I[c]||null;let L=null;if(T){const{pageNo:S,coordinate:{leftTop:M,rightTop:X},lineHeight:x}=T,F=this.draw.getOriginalHeight(),D=this.draw.getOriginalPageGap();L={x:M[0],y:M[1]+S*(F+D),width:X[0]-M[0],height:x}}return{pageNo:r,element:m,rangeRect:L,tableInfo:g}}insertTitle(e){if(this.draw.isReadonly()||this.draw.isDisabled())return;const n=xe(e),{startIndex:i}=this.range.getRange(),r=this.draw.getElementList(),s=jn(r,i);if(!s)return;const l=[...qn,...Vt,...Mo,...Yn];n.valueList?.forEach(a=>{Mn(l,s,a)}),this.draw.insertElementList([n])}focus(e){const{position:t=St.AFTER,isMoveCursorToVisible:n=!0,rowNo:i,range:r}=e||{};let s=-1;if(r)this.range.replaceRange(r),s=t===St.BEFORE?r.startIndex:r.endIndex;else if(ns(i)){const a=this.draw.getOriginalRowList();if(s=t===St.BEFORE?a[i]?.startIndex:a[i+1]?.startIndex-1,!ns(s))return;this.range.setRange(s,s)}else s=t===St.BEFORE?0:this.draw.getOriginalMainElementList().length-1,this.range.setRange(s,s);const l={isCompute:!1,isSetCursor:!1,isSubmitHistory:!1};n&&~s&&this.range.getIsCollapsed()&&(l.curIndex=s,l.isSetCursor=!0),this.draw.render(l)}insertArea(e){return this.draw.getArea().insertArea(e)}setAreaValue(e){return this.draw.getArea().setAreaValue(e)}setAreaProperties(e){this.draw.getArea().setAreaProperties(e)}locationArea(e,t){if(t?.isAppendLastLineBreak&&t?.position===St.OUTER_AFTER){const r=this.draw.getOriginalMainElementList();r[r.length-1].areaId===e&&this.draw.appendElementList([{value:ee}],{isSubmitHistory:!1})}const n=this.draw.getArea().getContextByAreaId(e,t);if(!n)return;const{range:{endIndex:i}}=n;this.position.setPositionContext({isTable:!1}),this.range.setRange(i,i),this.draw.render({curIndex:i,isSetCursor:!0,isCompute:!1,isSubmitHistory:!1})}clearGraffiti(){this.draw.getGraffiti().clear(),this.draw.isGraffitiMode()&&this.draw.render({isCompute:!1,isSetCursor:!1,isSubmitHistory:!1})}}class wf{rangeStyleChange;visiblePageNoListChange;intersectionPageNoChange;pageSizeChange;pageScaleChange;saved;contentChange;controlChange;controlContentChange;pageModeChange;zoneChange;constructor(){this.rangeStyleChange=null,this.visiblePageNoListChange=null,this.intersectionPageNoChange=null,this.pageSizeChange=null,this.pageScaleChange=null,this.saved=null,this.contentChange=null,this.controlChange=null,this.controlContentChange=null,this.pageModeChange=null,this.zoneChange=null}}class Uf{contextMenu;contextMenuList;getContextMenuList;shortcutList;langMap;constructor(e){const{contextMenu:t,shortcut:n,i18n:i}=e;this.contextMenu=t,this.contextMenuList=t.registerContextMenuList.bind(t),this.getContextMenuList=t.getContextMenuList.bind(t),this.shortcutList=n.registerShortcutList.bind(n),this.langMap=i.registerLangMap.bind(i)}disposeContextMenu(){this.contextMenu.dispose()}}const ol={SELECTED_TEXT:"%s"},Zo={GLOBAL:{CUT:"globalCut",COPY:"globalCopy",PASTE:"globalPaste",SELECT_ALL:"globalSelectAll",PRINT:"globalPrint"},CONTROL:{DELETE:"controlDelete",EDIT_ATTRIBUTE:"controlEditAttribute",COPY:"controlCopy",PASTE:"controlPaste"},HYPERLINK:{DELETE:"hyperlinkDelete",CANCEL:"hyperlinkCancel",EDIT:"hyperlinkEdit"},IMAGE:{CHANGE:"imageChange",SAVE_AS:"imageSaveAs",TEXT_WRAP:"imageTextWrap",TEXT_WRAP_EMBED:"imageTextWrapEmbed",TEXT_WRAP_UP_DOWN:"imageTextWrapUpDown",TEXT_WRAP_SURROUND:"imageTextWrapSurround",TEXT_WRAP_FLOAT_TOP:"imageTextWrapFloatTop",TEXT_WRAP_FLOAT_BOTTOM:"imageTextWrapFloatBottom"},TABLE:{BORDER:"border",BORDER_ALL:"tableBorderAll",BORDER_EMPTY:"tableBorderEmpty",BORDER_DASH:"tableBorderDash",BORDER_EXTERNAL:"tableBorderExternal",BORDER_INTERNAL:"tableBorderInternal",BORDER_TD:"tableBorderTd",BORDER_TD_TOP:"tableBorderTdTop",BORDER_TD_RIGHT:"tableBorderTdRight",BORDER_TD_BOTTOM:"tableBorderTdBottom",BORDER_TD_LEFT:"tableBorderTdLeft",BORDER_TD_FORWARD:"tableBorderTdForward",BORDER_TD_BACK:"tableBorderTdBack",VERTICAL_ALIGN:"tableVerticalAlign",VERTICAL_ALIGN_TOP:"tableVerticalAlignTop",VERTICAL_ALIGN_MIDDLE:"tableVerticalAlignMiddle",VERTICAL_ALIGN_BOTTOM:"tableVerticalAlignBottom",INSERT_ROW_COL:"tableInsertRowCol",INSERT_TOP_ROW:"tableInsertTopRow",INSERT_BOTTOM_ROW:"tableInsertBottomRow",INSERT_LEFT_COL:"tableInsertLeftCol",INSERT_RIGHT_COL:"tableInsertRightCol",DELETE_ROW_COL:"tableDeleteRowCol",DELETE_ROW:"tableDeleteRow",DELETE_COL:"tableDeleteCol",DELETE_TABLE:"tableDeleteTable",MERGE_CELL:"tableMergeCell",CANCEL_MERGE_CELL:"tableCancelMergeCell",TABLE_PROPERTIES:"tableProperties"}},{CONTROL:{DELETE:Zf,EDIT_ATTRIBUTE:Qf,COPY:Kf,PASTE:Hf}}=Zo;function il(o,e){if(e!==B.EDIT)return!1;const n=o?.control?.type,i=o?.controlComponent,r=n===Y.TEXT||n===Y.TEXTFIELD||n===Y.NUMBER||n===Y.SELECT||n===Y.DATE||n===Y.CHECKBOX||n===Y.RADIO||n===Y.BUTTON,s=i==="prefix"||i==="preText"||i==="preTextFix"||i==="textFixLabel"||n===Y.BUTTON&&i==="value";return r&&s}const _f=[{key:Kf,name:"复制控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&il(o.startElement,o.options.mode),callback:(o,e)=>{const t=e.startElement?.controlId;t&&o.executeCopyControl(t)}},{key:Hf,name:"粘贴控件",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.editorTextFocus&&o.options.mode===B.EDIT&&Sd(),callback:o=>{o.executePasteControl()}},{key:Zf,i18nPath:"contextmenu.control.delete",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&o.options.mode!==B.FORM,callback:o=>{o.executeRemoveControl()}},{key:Qf,i18nPath:"contextmenu.control.editAttribute",when:o=>!o.isReadonly&&!o.editorHasSelection&&!!o.startElement?.controlId&&il(o.startElement,o.options.mode),callback:(o,e)=>{const t=e.startElement?.controlId;t&&o.executeTriggerControlEditAttribute(t)}}],{GLOBAL:{CUT:Af,COPY:kf,PASTE:Gf,SELECT_ALL:Jf,PRINT:Bf}}=Zo,zf=[{key:Af,i18nPath:"contextmenu.global.cut",shortCut:`${Vn?"⌘":"Ctrl"} + X`,when:o=>!o.isReadonly,callback:o=>{o.executeCut()}},{key:kf,i18nPath:"contextmenu.global.copy",shortCut:`${Vn?"⌘":"Ctrl"} + C`,when:o=>o.editorHasSelection||o.isCrossRowCol,callback:o=>{o.executeCopy()}},{key:Gf,i18nPath:"contextmenu.global.paste",shortCut:`${Vn?"⌘":"Ctrl"} + V`,when:o=>!o.isReadonly&&o.editorTextFocus,callback:o=>{o.executePaste()}},{key:Jf,i18nPath:"contextmenu.global.selectAll",shortCut:`${Vn?"⌘":"Ctrl"} + A`,when:o=>o.editorTextFocus,callback:o=>{o.executeSelectAll()}},{isDivider:!0},{key:Bf,i18nPath:"contextmenu.global.print",icon:"print",when:()=>!0,callback:o=>{o.executePrint()}}],{HYPERLINK:{DELETE:$f,CANCEL:qf,EDIT:jf}}=Zo,em=[{key:$f,i18nPath:"contextmenu.hyperlink.delete",when:o=>!o.isReadonly&&o.startElement?.type===O.HYPERLINK,callback:o=>{o.executeDeleteHyperlink()}},{key:qf,i18nPath:"contextmenu.hyperlink.cancel",when:o=>!o.isReadonly&&o.startElement?.type===O.HYPERLINK,callback:o=>{o.executeCancelHyperlink()}},{key:jf,i18nPath:"contextmenu.hyperlink.edit",when:o=>!o.isReadonly&&o.startElement?.type===O.HYPERLINK,callback:(o,e)=>{const t=window.prompt(o.executeTranslate("contextmenu.hyperlink.edit"),e.startElement?.url);t&&o.executeEditHyperlink(t)}}],{IMAGE:{CHANGE:tm,SAVE_AS:nm,TEXT_WRAP:om,TEXT_WRAP_EMBED:im,TEXT_WRAP_UP_DOWN:sm,TEXT_WRAP_SURROUND:rm,TEXT_WRAP_FLOAT_TOP:lm,TEXT_WRAP_FLOAT_BOTTOM:am}}=Zo,cm=[{key:tm,i18nPath:"contextmenu.image.change",icon:"image-change",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===O.IMAGE,callback:o=>{const e=document.createElement("input");e.type="file",e.accept=".png, .jpg, .jpeg",e.onchange=()=>{const t=e.files[0],n=new FileReader;n.readAsDataURL(t),n.onload=()=>{const i=n.result;o.executeReplaceImageElement(i)}},e.click()}},{key:nm,i18nPath:"contextmenu.image.saveAs",icon:"image",when:o=>!o.editorHasSelection&&o.startElement?.type===O.IMAGE,callback:o=>{o.executeSaveAsImageElement()}},{key:om,i18nPath:"contextmenu.image.textWrap",when:o=>!o.isReadonly&&!o.editorHasSelection&&o.startElement?.type===O.IMAGE,childMenus:[{key:im,i18nPath:"contextmenu.image.textWrapType.embed",when:()=>!0,callback:(o,e)=>{o.executeChangeImageDisplay(e.startElement,Ne.BLOCK)}},{key:sm,i18nPath:"contextmenu.image.textWrapType.upDown",when:()=>!0,callback:(o,e)=>{o.executeChangeImageDisplay(e.startElement,Ne.INLINE)}},{key:rm,i18nPath:"contextmenu.image.textWrapType.surround",when:()=>!0,callback:(o,e)=>{o.executeChangeImageDisplay(e.startElement,Ne.SURROUND)}},{key:lm,i18nPath:"contextmenu.image.textWrapType.floatTop",when:()=>!0,callback:(o,e)=>{o.executeChangeImageDisplay(e.startElement,Ne.FLOAT_TOP)}},{key:am,i18nPath:"contextmenu.image.textWrapType.floatBottom",when:()=>!0,callback:(o,e)=>{o.executeChangeImageDisplay(e.startElement,Ne.FLOAT_BOTTOM)}}]}],{TABLE:{BORDER:dm,BORDER_ALL:um,BORDER_EMPTY:hm,BORDER_DASH:Rm,BORDER_EXTERNAL:gm,BORDER_INTERNAL:pm,BORDER_TD:fm,BORDER_TD_TOP:mm,BORDER_TD_LEFT:Tm,BORDER_TD_BOTTOM:Lm,BORDER_TD_RIGHT:Im,BORDER_TD_BACK:Pm,BORDER_TD_FORWARD:Om,VERTICAL_ALIGN:Sm,VERTICAL_ALIGN_TOP:Mm,VERTICAL_ALIGN_MIDDLE:Xm,VERTICAL_ALIGN_BOTTOM:Em,INSERT_ROW_COL:Nm,INSERT_TOP_ROW:Fm,INSERT_BOTTOM_ROW:Cm,INSERT_LEFT_COL:bm,INSERT_RIGHT_COL:ym,DELETE_ROW_COL:xm,DELETE_ROW:vm,DELETE_COL:Wm,DELETE_TABLE:Dm,MERGE_CELL:Vm,CANCEL_MERGE_CELL:Ym,TABLE_PROPERTIES:wm}}=Zo,Um=[{isDivider:!0},{key:dm,i18nPath:"contextmenu.table.border",icon:"border-all",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==B.FORM,childMenus:[{key:um,i18nPath:"contextmenu.table.borderAll",icon:"border-all",when:()=>!0,callback:o=>{o.executeTableBorderType(vt.ALL)}},{key:hm,i18nPath:"contextmenu.table.borderEmpty",icon:"border-empty",when:()=>!0,callback:o=>{o.executeTableBorderType(vt.EMPTY)}},{key:Rm,i18nPath:"contextmenu.table.borderDash",icon:"border-dash",when:()=>!0,callback:o=>{o.executeTableBorderType(vt.DASH)}},{key:gm,i18nPath:"contextmenu.table.borderExternal",icon:"border-external",when:()=>!0,callback:o=>{o.executeTableBorderType(vt.EXTERNAL)}},{key:pm,i18nPath:"contextmenu.table.borderInternal",icon:"border-internal",when:()=>!0,callback:o=>{o.executeTableBorderType(vt.INTERNAL)}},{key:fm,i18nPath:"contextmenu.table.borderTd",icon:"border-td",when:()=>!0,childMenus:[{key:mm,i18nPath:"contextmenu.table.borderTdTop",icon:"border-td-top",when:()=>!0,callback:o=>{o.executeTableTdBorderType(Yt.TOP)}},{key:Im,i18nPath:"contextmenu.table.borderTdRight",icon:"border-td-right",when:()=>!0,callback:o=>{o.executeTableTdBorderType(Yt.RIGHT)}},{key:Lm,i18nPath:"contextmenu.table.borderTdBottom",icon:"border-td-bottom",when:()=>!0,callback:o=>{o.executeTableTdBorderType(Yt.BOTTOM)}},{key:Tm,i18nPath:"contextmenu.table.borderTdLeft",icon:"border-td-left",when:()=>!0,callback:o=>{o.executeTableTdBorderType(Yt.LEFT)}},{key:Om,i18nPath:"contextmenu.table.borderTdForward",icon:"border-td-forward",when:()=>!0,callback:o=>{o.executeTableTdSlashType(Fo.FORWARD)}},{key:Pm,i18nPath:"contextmenu.table.borderTdBack",icon:"border-td-back",when:()=>!0,callback:o=>{o.executeTableTdSlashType(Fo.BACK)}}]}]},{key:Sm,i18nPath:"contextmenu.table.verticalAlign",icon:"vertical-align",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==B.FORM,childMenus:[{key:Mm,i18nPath:"contextmenu.table.verticalAlignTop",icon:"vertical-align-top",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(Tt.TOP)}},{key:Xm,i18nPath:"contextmenu.table.verticalAlignMiddle",icon:"vertical-align-middle",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(Tt.MIDDLE)}},{key:Em,i18nPath:"contextmenu.table.verticalAlignBottom",icon:"vertical-align-bottom",when:()=>!0,callback:o=>{o.executeTableTdVerticalAlign(Tt.BOTTOM)}}]},{key:Nm,i18nPath:"contextmenu.table.insertRowCol",icon:"insert-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==B.FORM,childMenus:[{key:Fm,i18nPath:"contextmenu.table.insertTopRow",icon:"insert-top-row",when:()=>!0,callback:o=>{o.executeInsertTableTopRow()}},{key:Cm,i18nPath:"contextmenu.table.insertBottomRow",icon:"insert-bottom-row",when:()=>!0,callback:o=>{o.executeInsertTableBottomRow()}},{key:bm,i18nPath:"contextmenu.table.insertLeftCol",icon:"insert-left-col",when:()=>!0,callback:o=>{o.executeInsertTableLeftCol()}},{key:ym,i18nPath:"contextmenu.table.insertRightCol",icon:"insert-right-col",when:()=>!0,callback:o=>{o.executeInsertTableRightCol()}}]},{key:xm,i18nPath:"contextmenu.table.deleteRowCol",icon:"delete-row-col",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==B.FORM,childMenus:[{key:vm,i18nPath:"contextmenu.table.deleteRow",icon:"delete-row",when:()=>!0,callback:o=>{o.executeDeleteTableRow()}},{key:Wm,i18nPath:"contextmenu.table.deleteCol",icon:"delete-col",when:()=>!0,callback:o=>{o.executeDeleteTableCol()}},{key:Dm,i18nPath:"contextmenu.table.deleteTable",icon:"delete-table",when:()=>!0,callback:o=>{o.executeDeleteTable()}}]},{key:Vm,i18nPath:"contextmenu.table.mergeCell",icon:"merge-cell",when:o=>!o.isReadonly&&o.isCrossRowCol&&o.options.mode!==B.FORM,callback:o=>{o.executeMergeTableCell()}},{key:Ym,i18nPath:"contextmenu.table.mergeCancelCell",icon:"merge-cancel-cell",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==B.FORM,callback:o=>{o.executeCancelMergeTableCell()}},{key:wm,i18nPath:"contextmenu.table.tableProperties",icon:"table-properties",when:o=>!o.isReadonly&&o.isInTable&&o.options.mode!==B.FORM,callback:o=>{o.executeTableProperties()}}];class Zm{options;draw;command;range;position;i18n;container;contextMenuList;contextMenuContainerList;contextMenuRelationShip;context;constructor(e,t){this.options=e.getOptions(),this.draw=e,this.command=t,this.range=e.getRange(),this.position=e.getPosition(),this.i18n=e.getI18n(),this.container=e.getContainer(),this.context=null,this.contextMenuList=[...zf,...Um,...cm,..._f,...em],this.contextMenuContainerList=[],this.contextMenuRelationShip=new Map,this._addEvent()}getContextMenuList(){return this.contextMenuList}_addEvent(){this.container.addEventListener("contextmenu",this._proxyContextMenuEvent),document.addEventListener("mousedown",this._handleSideEffect)}removeEvent(){this.container.removeEventListener("contextmenu",this._proxyContextMenuEvent),document.removeEventListener("mousedown",this._handleSideEffect)}_filterMenuList(e){const{contextMenuDisableKeys:t}=this.options,n=[];for(let i=0;i<e.length;i++){const r=e[i];r.disable||r.key&&t.includes(r.key)||(r.isDivider||r.when?.(this.context))&&n.push(r)}return n}_proxyContextMenuEvent=e=>{this.context=this._getContext();const t=this._filterMenuList(this.contextMenuList);t.some(i=>!i.isDivider)&&(this.dispose(),this._render({contextMenuList:t,left:e.x,top:e.y})),e.preventDefault()};_handleSideEffect=e=>{const t=e.target;this.contextMenuContainerList.some(i=>i.contains(t))||this.dispose()};_getContext(){const e=this.draw.isReadonly(),{isCrossRowCol:t,startIndex:n,endIndex:i}=this.range.getRange(),r=!!(~n||~i),s=r&&n!==i,{isTable:l,trIndex:a,tdIndex:c,index:d}=this.position.getPositionContext();let u=null;if(l){const I=this.draw.getOriginalElementList()[d]||null;I&&(u=Ge([I],{extraPickAttrs:["id"]})[0])}const h=l&&!!t,R=this.draw.getElementList(),g=R[n]||null,m=R[i]||null,f=this.draw.getZone().getZone();return{startElement:g,endElement:m,isReadonly:e,editorHasSelection:s,editorTextFocus:r,isCrossRowCol:h,zone:f,isInTable:l,trIndex:a??null,tdIndex:c??null,tableElement:u,options:this.options}}_createContextMenuContainer(){const e=document.createElement("div");return e.classList.add(`${re}-contextmenu-container`),e.setAttribute(Rt,gt.CONTEXTMENU),this.container.append(e),e}_render(e){const{contextMenuList:t,left:n,top:i,parentMenuContainer:r}=e,s=this._createContextMenuContainer(),l=document.createElement("div");l.classList.add(`${re}-contextmenu-content`);let a=null;r&&this.contextMenuRelationShip.set(r,s);for(let S=0;S<t.length;S++){const M=t[S];if(M.isDivider){if(S!==0&&S!==t.length-1&&!t[S-1]?.isDivider){const X=document.createElement("div");X.classList.add(`${re}-contextmenu-divider`),l.append(X)}}else{const X=document.createElement("div");if(X.classList.add(`${re}-contextmenu-item`),M.childMenus){const V=this._filterMenuList(M.childMenus);V.some(v=>!v.isDivider)&&(X.classList.add(`${re}-contextmenu-sub-item`),X.onmouseenter=()=>{this._setHoverStatus(X,!0),this._removeSubMenu(s);const v=X.getBoundingClientRect(),b=v.left+v.width,P=v.top;a=this._render({contextMenuList:V,left:b,top:P,parentMenuContainer:s})},X.onmouseleave=v=>{(!a||!a.contains(v.relatedTarget))&&this._setHoverStatus(X,!1)})}else X.onmouseenter=()=>{this._setHoverStatus(X,!0),this._removeSubMenu(s)},X.onmouseleave=()=>{this._setHoverStatus(X,!1)},X.onclick=()=>{M.callback&&this.context&&M.callback(this.command,this.context),this.dispose()};const x=document.createElement("i");X.append(x),M.icon&&x.classList.add(`${re}-contextmenu-${M.icon}`);const F=document.createElement("span"),D=M.i18nPath?this._formatName(this.i18n.t(M.i18nPath)):this._formatName(M.name||"");if(F.append(document.createTextNode(D)),X.append(F),M.shortCut){const V=document.createElement("span");V.classList.add(`${re}-shortcut`),V.append(document.createTextNode(M.shortCut)),X.append(V)}l.append(X)}}const c=document.createElement("div");c.classList.add(`${re}-contextmenu-divider`),l.append(c);const d=document.createElement("div");d.classList.add(`${re}-contextmenu-item`),d.onmouseenter=()=>{this._setHoverStatus(d,!0),this._removeSubMenu(s)},d.onmouseleave=()=>{this._setHoverStatus(d,!1)},d.onclick=()=>{this.dispose()};const u=document.createElement("i");d.append(u);const h=document.createElement("span");h.append(document.createTextNode(this.i18n.t("contextmenu.global.cancel"))),d.append(h),l.append(d),s.append(l),s.style.display="block";const R=window.innerWidth,g=s.getBoundingClientRect(),m=g.width,f=n+m>R?n-m:n;s.style.left=`${f}px`;const T=window.innerHeight,I=g.height,L=i+I>T?i-I:i;return s.style.top=`${L}px`,this.contextMenuContainerList.push(s),s}_removeSubMenu(e){const t=this.contextMenuRelationShip.get(e);t&&(this._removeSubMenu(t),t.remove(),this.contextMenuRelationShip.delete(e))}_setHoverStatus(e,t){t?(e.parentNode?.querySelectorAll(`${re}-contextmenu-item`).forEach(n=>n.classList.remove("hover")),e.classList.add("hover")):e.classList.remove("hover")}_formatName(e){const t=Object.values(ol),n=new RegExp(`${t.join("|")}`);let i=e;if(n.test(i)){const r=new RegExp(ol.SELECTED_TEXT,"g");if(r.test(i)){const s=this.range.toString();i=i.replace(r,s)}}return i}registerContextMenuList(e){this.contextMenuList.push(...e)}dispose(){this.contextMenuContainerList.forEach(e=>e.remove()),this.contextMenuContainerList=[],this.contextMenuRelationShip.clear()}}const Qm=[{key:Te.X,ctrl:!0,shift:!0,callback:o=>{o.executeStrikeout()}},{key:Te.LEFT_BRACKET,mod:!0,callback:o=>{o.executeSizeAdd()}},{key:Te.RIGHT_BRACKET,mod:!0,callback:o=>{o.executeSizeMinus()}},{key:Te.B,mod:!0,callback:o=>{o.executeBold()}},{key:Te.I,mod:!0,callback:o=>{o.executeItalic()}},{key:Te.U,mod:!0,callback:o=>{o.executeUnderline()}},{key:Vn?Te.COMMA:Te.RIGHT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSuperscript()}},{key:Vn?Te.PERIOD:Te.LEFT_ANGLE_BRACKET,mod:!0,shift:!0,callback:o=>{o.executeSubscript()}},{key:Te.L,mod:!0,callback:o=>{o.executeRowFlex(Qe.LEFT)}},{key:Te.E,mod:!0,callback:o=>{o.executeRowFlex(Qe.CENTER)}},{key:Te.R,mod:!0,callback:o=>{o.executeRowFlex(Qe.RIGHT)}},{key:Te.J,mod:!0,callback:o=>{o.executeRowFlex(Qe.ALIGNMENT)}},{key:Te.J,mod:!0,shift:!0,callback:o=>{o.executeRowFlex(Qe.JUSTIFY)}}],Km=[{key:Te.ZERO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(null)}},{key:Te.ONE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(tt.FIRST)}},{key:Te.TWO,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(tt.SECOND)}},{key:Te.THREE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(tt.THIRD)}},{key:Te.FOUR,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(tt.FOURTH)}},{key:Te.FIVE,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(tt.FIFTH)}},{key:Te.SIX,alt:!0,ctrl:!0,callback:o=>{o.executeTitle(tt.SIXTH)}}],Hm=[{key:Te.I,shift:!0,mod:!0,callback:o=>{o.executeList(kt.UL,Nt.DISC)}},{key:Te.U,shift:!0,mod:!0,callback:o=>{o.executeList(kt.OL)}}];class _m{command;globalShortcutList;agentShortcutList;constructor(e,t){this.command=t,this.globalShortcutList=[],this.agentShortcutList=[],this._addShortcutList([...Qm,...Km,...Hm]),this._addEvent(),e.getCursor().getAgentDom().addEventListener("keydown",this._agentKeydown.bind(this))}_addEvent(){document.addEventListener("keydown",this._globalKeydown)}removeEvent(){document.removeEventListener("keydown",this._globalKeydown)}_addShortcutList(e){for(let t=e.length-1;t>=0;t--){const n=e[t];n.isGlobal?this.globalShortcutList.unshift(n):this.agentShortcutList.unshift(n)}}registerShortcutList(e){this._addShortcutList(e)}_globalKeydown=e=>{this.globalShortcutList.length&&this._execute(e,this.globalShortcutList)};_agentKeydown(e){this.agentShortcutList.length&&this._execute(e,this.agentShortcutList)}_execute(e,t){for(let n=0;n<t.length;n++){const i=t[n];if((i.mod?on(e)===!!i.mod:e.ctrlKey===!!i.ctrl&&e.metaKey===!!i.meta)&&e.shiftKey===!!i.shift&&e.altKey===!!i.alt&&e.key.toLowerCase()===i.key.toLowerCase()){i.disable||(i?.callback?.(this.command),e.preventDefault());break}}}}class Am{editor;constructor(e){this.editor=e}use(e,t){e(this.editor,t)}}class km{eventHub;constructor(){this.eventHub=new Map}on(e,t){if(!e||typeof t!="function")return;const n=this.eventHub.get(e)||new Set;n.add(t),this.eventHub.set(e,n)}emit(e,t){if(!e)return;const n=this.eventHub.get(e);if(n){if(n.size===1)return[...n][0](t);n.forEach(i=>i(t))}}off(e,t){if(!e||typeof t!="function")return;const n=this.eventHub.get(e);n&&n.delete(t)}isSubscribe(e){const t=this.eventHub.get(e);return!!t&&t.size>0}dangerouslyClearAll(){this.eventHub.clear()}}class Gm{paste;copy;drop}class Jm{command;version;listener;eventBus;override;register;destroy;use;constructor(e,t,n={}){const i=ys(n);t=xe(t);let r=[],s=[],l=[],a=[];Array.isArray(t)?s=t:(r=t.header||[],s=t.main,l=t.footer||[],a=t.graffiti||[]),[r,s,l].forEach(g=>{ct(g,{editorOptions:i,isForceCompensation:!0})}),this.version=Os,this.listener=new wf,this.eventBus=new km,this.override=new Gm;const d=new bf(e,i,{header:r,main:s,footer:l,graffiti:a},this.listener,this.eventBus,this.override);this.command=new yf(new Yf(d)),d.setCommand(this.command);const u=new Zm(d,this.command),h=new _m(d,this.command);this.register=new Uf({contextMenu:u,shortcut:h,i18n:d.getI18n()}),this.destroy=()=>{d.destroy(),h.removeEvent(),u.removeEvent(),this.eventBus.dangerouslyClearAll()};const R=new Am(this);this.use=R.use.bind(R)}}const bi=`主诉:
548
+ 发热三天,咳嗽五天。
549
+ 现病史:
550
+ 患者于三天前无明显诱因,感冒后发现面部水肿,无皮疹,尿量减少,出现乏力,在外治疗无好转,现来我院就诊。
551
+ 既往史:
552
+ 有糖尿病10年,有高血压2年,有传染性疾病1年。报告其他既往疾病。
553
+ 流行病史:
554
+ 否认14天内接触过确诊患者、疑似患者、无症状感染者及其密切接触者;否认14天内去过以下场所:水产、肉类批发市场,农贸市场,集市,大型超市,夜市;否认14天内与以下场所工作人员密切接触:水产、肉类批发市场,农贸市场,集市,大型超市;否认14天内周围(如家庭、办公室)有2例以上聚集性发病;否认14天内接触过有发热或呼吸道症状的人员;否认14天内自身有发热或呼吸道症状;否认14天内接触过纳入隔离观察的人员及其他可能与新冠肺炎关联的情形;陪同家属无以上情况。
555
+ 体格检查:
556
+ T:39.5℃,P:80bpm,R:20次/分,BP:120/80mmHg;
557
+ 辅助检查:
558
+ 2020年6月10日,普放:血细胞比容36.50%(偏低)40~50;单核细胞绝对值0.75*10/L(偏高)参考值:0.1~0.6;
559
+ 门诊诊断:处置治疗:电子签名:【】
560
+ 其他记录:`,sl=["主诉:","现病史:","既往史:","流行病史:","体格检查:","辅助检查:","门诊诊断:","处置治疗:","电子签名:","其他记录:"],Da=new Map;for(let o=0;o<sl.length;o++){const e=sl[o],t=bi.indexOf(e);~t&&Da.set(t,e)}const Bm=["传染性疾病"],zm=Bm.map(o=>{const e=bi.indexOf(o);return~e?Array(o.length).fill(e).map((t,n)=>e+n):[]}).flat(),$m=["血细胞比容"],qm=$m.map(o=>{const e=bi.indexOf(o);return~e?Array(o.length).fill(e).map((t,n)=>e+n):[]}).flat(),ht=[],rl=bi.split("");let Wn=0;for(;Wn<rl.length;){const o=rl[Wn],e=Da.get(Wn);e?(ht.push({value:"",type:O.TITLE,level:tt.FIRST,valueList:[{value:e,size:18}]}),Wn+=e.length-1):zm.includes(Wn)?ht.push({value:o,color:"#FF0000",size:16}):qm.includes(Wn)?ht.push({value:o,highlight:"#F2F27F",groupIds:["1"]}):ht.push({value:o,size:16}),Wn++}ht.splice(12,0,{type:O.CONTROL,value:"",control:{conceptId:"1",type:Y.TEXTFIELD,textFixLabel:"现病史",value:[{value:"孙万锦",type:O.CONTROL,control:{type:Y.TEXT,value:[{value:"孙万锦"}],label:"孙万锦",placeholder:"孙万锦"}},{value:`
561
+ `}]}});ht.splice(94,0,{type:O.CONTROL,value:"",control:{conceptId:"2",type:Y.SELECT,value:null,code:void 0,placeholder:"有无",prefix:"[",postfix:"]",valueSets:[{value:"有",code:"98175"},{value:"无",code:"98176"},{value:"不详",code:"98177"}]}});ht.splice(116,0,{type:O.HYPERLINK,value:"",valueList:[{value:"新",size:16},{value:"冠",size:16},{value:"肺",size:16},{value:"炎",size:16}],url:"https://hufe.club/canvas-editor"});ht.splice(335,0,{type:O.CONTROL,value:"",control:{conceptId:"6",type:Y.TEXT,value:null,placeholder:"内容",preText:"其他:",postText:"。"}});ht.splice(346,0,{value:"∆",color:"#FF0000",type:O.SUBSCRIPT});ht.splice(430,0,{value:"9",type:O.SUPERSCRIPT});ht.splice(451,0,{value:"",type:O.LIST,listType:kt.OL,valueList:[{value:`高血压
562
+ 糖尿病
563
+ 病毒性感冒
564
+ 过敏性鼻炎
565
+ 过敏性鼻息肉`}]});ht.splice(453,0,{value:"",type:O.LIST,listType:kt.OL,valueList:[{value:`超声引导下甲状腺细针穿刺术;
566
+ 乙型肝炎表面抗体测定;
567
+ 膜式病变细胞采集术、后颈皮下肤层;`}]});ht.splice(456,0,{value:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALAAAAA+CAYAAACLDZH2AAAMPmlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnltSIbTQpYTeBJEaQEoILYD0ItgISYBQYgwEFTuyqODaxQI2dFVEsQNiR+wsir0viKgo62LBrrxJAV33le/N982d//5z5j9nzp259w4A6ie5YnEuqgFAnqhAEhcayBiTksogPQUEYAr0ABloc3n5YlZMTCSAZbD9e3l3EyCy9pqjTOuf/f+1aPIF+TwAkBiI0/n5vDyIDwKAV/HEkgIAiDLeYkqBWIZhBdoSGCDEC2Q4U4GrZDhdgffKbRLi2BC3AEBW5XIlmQCoXYE8o5CXCTXU+iB2FvGFIgDUGRD75eVN4kOcBrEttBFDLNNnpv+gk/k3zfQhTS43cwgr5iIv5CBhvjiXO+3/TMf/Lnm50kEf1rCqZknC4mRzhnm7nTMpQoZVIe4VpUdFQ6wF8QchX24PMUrNkoYlKuxRI14+G+YM6ELszOcGRUBsBHGIKDcqUsmnZwhDOBDDFYJOFRZwEiDWh3iBID84XmmzSTIpTukLrc+QsFlK/jxXIvcr8/VQmpPIUuq/zhJwlPqYWlFWQjLEVIgtC4VJURCrQeyUnxMfobQZVZTFjhq0kUjjZPFbQhwnEIUGKvSxwgxJSJzSviwvf3C+2KYsISdKifcXZCW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D9Hg5TuwD4YI5FLBNhJDo86qpJhYTjI0wQp1SDnFGyqes/EnUTD1iAxCMD/2wMmdq23G5MdtECJ5MAcgZQ6ijBN5HQJjN8DeyoYKlS5eqQHj+AVnSberUqUW7kydP9mkJsaTTuNCoU369c+fO9ViJoeDxHg+Wo4dN93RlEn+aaBVERzyyCodIa9d2EUInKP8xt3qV8+IhGBqWBbYVi1w4va4ZZXY5GzCvyb448N2MZt02QkgBRzEwxg2m0k1akrnMtp2yiCKSK2X7UCatMp+FcD7jXFeO/ZstZE8gt4031CCUsb8BOy6Y32IP8N7Vq1ePeIM90RjcyLzhCeXOnTv2jbsthJQCjmVgK6mAvcBkcDz+ngB/jCiVLCv7dds2nwJxkoFBRhmWiQ1JXAhfCsRZBg7fKXMx1ylgux1YR8YtuxSILgVcBo4uxdz6jqKAy8COmg4XmehS4H9f7COrHME8MAAAAABJRU5ErkJggg==",width:89,height:32,id:"signature",type:O.IMAGE});ht.push({type:O.TABLE,value:"",colgroup:[{width:180},{width:80},{width:130},{width:130}],trList:[{height:40,tdList:[{colspan:1,rowspan:2,value:[{value:"1",size:16},{value:".",size:16}]},{colspan:1,rowspan:1,value:[{value:"2",size:16},{value:".",size:16}]},{colspan:2,rowspan:1,value:[{value:"3",size:16},{value:".",size:16}]}]},{height:40,tdList:[{colspan:1,rowspan:1,value:[{value:"4",size:16},{value:".",size:16}]},{colspan:1,rowspan:1,value:[{value:"5",size:16},{value:".",size:16}]},{colspan:1,rowspan:1,value:[{value:"6",size:16},{value:".",size:16}]}]},{height:40,tdList:[{colspan:1,rowspan:1,value:[{value:"7",size:16},{value:".",size:16}]},{colspan:1,rowspan:1,value:[{value:"8",size:16},{value:".",size:16}]},{colspan:1,rowspan:1,value:[{value:"9",size:16},{value:".",size:16}]},{colspan:1,rowspan:1,value:[{value:"1",size:16},{value:"0",size:16},{value:".",size:16}]}]}]});ht.push({value:"是否同意以上内容:"},{type:O.CONTROL,control:{conceptId:"3",type:Y.CHECKBOX,code:"98175",value:"",valueSets:[{value:"同意",code:"98175"},{value:"否定",code:"98176"}]},value:""},{value:`
568
+ `});ht.push({value:"医学公式:"},{value:"{E_k} = hv - {W_0}",type:O.LATEX},{value:`
569
+ `});ht.push({value:"签署日期:"},{type:O.CONTROL,value:"",control:{conceptId:"5",type:Y.DATE,value:[{value:"2022-08-10 17:30:01"}],placeholder:"签署日期"}},{value:`
570
+ `});ht.push({value:"诊断标签:"},{type:O.LABEL,value:"高血压",labelId:"l1",size:14},{value:`
571
+ `});ht.push({value:"患者签名:"},{type:O.CONTROL,value:"",control:{conceptId:"4",type:Y.TEXT,value:null,placeholder:"",prefix:"‌",postfix:"‌",minWidth:160,underline:!0}});ht.push({value:`
572
+ 就诊次数:`},{type:O.CONTROL,value:"",control:{conceptId:"7",type:Y.NUMBER,value:null,placeholder:"就诊次数",prefix:"[",postfix:"]",numberExclusiveOptions:{calculatorDisabled:!1}}});ht.push({value:`
573
+ `},{value:"",type:O.TAB},{value:"E",size:16},{value:"O",size:16},{value:"F",size:16});const jm=[{id:"1",content:"红细胞比容(HCT)是指每单位容积中红细胞所占全血容积的比值,用于反映红细胞和血浆的比例。",userName:"Hufe",rangeText:"血细胞比容",createdDate:"2023-08-20 23:10:55"}],ll={margins:[75.591,56.693,56.693,56.693],watermark:{data:"DLHT",size:120},pageNumber:{format:"第{pageNo}页/共{pageCount}页"},placeholder:{data:"请输入正文"},zone:{tipDisabled:!1},maskMargin:[60,0,30,0]};class eT{MAX_RECORD_COUNT=1e3;DEFAULT_WIDTH=390;DEFAULT_HEIGHT=180;undoStack=[];x=0;y=0;isDrawing=!1;isDrawn=!1;linePoints=[];canvasWidth;canvasHeight;options;mask;container;trashContainer;undoContainer;canvas;ctx;preTimeStamp;dpr;constructor(e){this.options=e,this.preTimeStamp=0,this.dpr=window.devicePixelRatio,this.canvasWidth=(e.width||this.DEFAULT_WIDTH)*this.dpr,this.canvasHeight=(e.height||this.DEFAULT_HEIGHT)*this.dpr;const{mask:t,container:n,trashContainer:i,undoContainer:r,canvas:s}=this._render();this.mask=t,this.container=n,this.trashContainer=i,this.undoContainer=r,this.canvas=s,this.ctx=s.getContext("2d"),this.ctx.scale(this.dpr,this.dpr),this.ctx.lineCap="round",this._bindEvent(),this._clearUndoFn(),document.documentElement.classList.add("overflow-hidden"),document.body.classList.add("overflow-hidden"),this.container.classList.add("overflow-hidden")}_render(){const{onClose:e,onCancel:t,onConfirm:n}=this.options,i=document.createElement("div");i.classList.add("signature-mask"),i.setAttribute(Rt,gt.COMPONENT),document.body.append(i);const r=document.createElement("div");r.classList.add("signature-container"),r.setAttribute(Rt,gt.COMPONENT);const s=document.createElement("div");s.classList.add("signature"),r.append(s);const l=document.createElement("div");l.classList.add("signature-title");const a=document.createElement("span");a.append(document.createTextNode("插入签名"));const c=document.createElement("i");c.onclick=()=>{e&&e(),this._dispose()},l.append(a),l.append(c),s.append(l);const d=document.createElement("div");d.classList.add("signature-operation");const u=document.createElement("div");u.classList.add("signature-operation__undo");const h=document.createElement("i"),R=document.createElement("span");R.innerText="撤销",u.append(h),u.append(R),d.append(u);const g=document.createElement("div");g.classList.add("signature-operation__trash");const m=document.createElement("i"),f=document.createElement("span");f.innerText="清空",g.append(m),g.append(f),d.append(g),s.append(d);const T=document.createElement("div");T.classList.add("signature-canvas");const I=document.createElement("canvas");I.width=this.canvasWidth,I.height=this.canvasHeight,I.style.width=`${this.canvasWidth/this.dpr}px`,I.style.height=`${this.canvasHeight/this.dpr}px`,T.append(I),s.append(T);const L=document.createElement("div");L.classList.add("signature-menu");const S=document.createElement("button");S.classList.add("signature-menu__cancel"),S.append(document.createTextNode("取消")),S.type="button",S.onclick=()=>{t&&t(),this._dispose()},L.append(S);const M=document.createElement("button");return M.append(document.createTextNode("确定")),M.type="submit",M.onclick=()=>{n&&n(this._toData()),this._dispose()},L.append(M),s.append(L),document.body.append(r),this.container=r,this.mask=i,{mask:i,canvas:I,container:r,trashContainer:g,undoContainer:u}}_bindEvent(){this.trashContainer.onclick=this._clearCanvas.bind(this),this.undoContainer.onclick=this._undo.bind(this),this.canvas.onmousedown=this._startDraw.bind(this),this.canvas.onmousemove=this._draw.bind(this),this.container.onmouseup=this._stopDraw.bind(this),this.container.ontouchmove=this.registerTouchmove.bind(this),this.container.ontouchstart=this.registerTouchstart.bind(this),this.container.ontouchend=this.registerTouchend.bind(this)}_undo(){this.undoStack.length>1&&(this.undoStack.pop(),this.undoStack.length&&this.undoStack[this.undoStack.length-1]())}_saveUndoFn(e){for(this.undoStack.push(e);this.undoStack.length>this.MAX_RECORD_COUNT;)this.undoStack.shift()}_clearUndoFn(){const e=()=>{this.ctx.clearRect(0,0,this.canvasWidth,this.canvasHeight)};this.undoStack=[e]}_clearCanvas(){this._clearUndoFn(),this.ctx.clearRect(0,0,this.canvasWidth,this.canvasHeight)}_startDraw(e){this.isDrawing=!0,this.x=e.offsetX,this.y=e.offsetY,this.ctx.lineWidth=1}_draw(e){if(!this.isDrawing)return;const t=performance.now(),i=Math.sqrt(e.movementX**2+e.movementY**2)/(t-this.preTimeStamp),s=Math.min(5,Math.max(1,5-i*3)),l=.2;this.ctx.lineWidth=this.ctx.lineWidth*(1-l)+s*l;const{offsetX:a,offsetY:c}=e;this.ctx.beginPath(),this.ctx.moveTo(this.x,this.y),this.ctx.lineTo(a,c),this.ctx.stroke(),this.x=a,this.y=c,this.linePoints.push([a,c]),this.isDrawn=!0,this.preTimeStamp=t}_stopDraw(){if(this.isDrawing=!1,this.isDrawn){const e=this.ctx.getImageData(0,0,this.canvasWidth,this.canvasHeight),t=this;this._saveUndoFn(function(){t.ctx.clearRect(0,0,t.canvasWidth,t.canvasHeight),t.ctx.putImageData(e,0,0)}),this.isDrawn=!1}}_toData(){if(!this.linePoints.length)return null;const e=this.linePoints[0][0],t=this.linePoints[0][1];let n=e,i=t,r=e,s=t;for(let g=0;g<this.linePoints.length;g++){const m=this.linePoints[g];n>m[0]&&(n=m[0]),r<m[0]&&(r=m[0]),i>m[1]&&(i=m[1]),s<m[1]&&(s=m[1])}const l=this.ctx.lineWidth;n=n<l?0:n-l,i=i<l?0:i-l,r=r+l,s=s+l;const a=r-n,c=s-i,d=this.ctx.getImageData(n*this.dpr,i*this.dpr,a*this.dpr,c*this.dpr),u=document.createElement("canvas");return u.style.width=`${a}px`,u.style.height=`${c}px`,u.width=a*this.dpr,u.height=c*this.dpr,u.getContext("2d").putImageData(d,0,0),{value:u.toDataURL(),width:a,height:c}}registerTouchmove(e){this.registerTouchEvent(e,"mousemove")}registerTouchstart(e){this.registerTouchEvent(e,"mousedown")}registerTouchend(){const e=new MouseEvent("mouseup",{});this.canvas.dispatchEvent(e)}registerTouchEvent(e,t){const n=e.touches[0],i=new MouseEvent(t,{clientX:n.clientX,clientY:n.clientY});this.canvas.dispatchEvent(i)}_dispose(){this.mask.remove(),this.container.remove(),document.documentElement.classList.remove("overflow-hidden"),document.body.classList.remove("overflow-hidden")}}const tT=[{groupName:"数学符号",symbols:[{symbol:"±",name:"正负号"},{symbol:"×",name:"乘号"},{symbol:"÷",name:"除号"},{symbol:"≠",name:"不等号"},{symbol:"≈",name:"约等于"},{symbol:"≤",name:"小于等于"},{symbol:"≥",name:"大于等于"},{symbol:"∞",name:"无穷"},{symbol:"∑",name:"求和"},{symbol:"∏",name:"求积"},{symbol:"√",name:"根号"},{symbol:"∫",name:"积分"},{symbol:"∂",name:"偏导"},{symbol:"∇",name:"梯度"},{symbol:"π",name:"圆周率"},{symbol:"Ω",name:"欧姆"}]},{groupName:"标点符号",symbols:[{symbol:",",name:"中文逗号"},{symbol:"。",name:"中文句号"},{symbol:"、",name:"顿号"},{symbol:";",name:"中文分号"},{symbol:":",name:"中文冒号"},{symbol:"?",name:"中文问号"},{symbol:"!",name:"中文感叹号"},{symbol:"“",name:"左双引号"},{symbol:"”",name:"右双引号"},{symbol:"‘",name:"左单引号"},{symbol:"’",name:"右单引号"},{symbol:"【",name:"左方括号"},{symbol:"】",name:"右方括号"},{symbol:"《",name:"左书名号"},{symbol:"》",name:"右书名号"},{symbol:"……",name:"省略号"}]},{groupName:"特殊字符",symbols:[{symbol:"©",name:"版权符号"},{symbol:"®",name:"注册商标"},{symbol:"™",name:"商标符号"},{symbol:"§",name:"章节符号"},{symbol:"¶",name:"段落符号"},{symbol:"†",name:"剑标"},{symbol:"‡",name:"双剑标"},{symbol:"°",name:"度"},{symbol:"℃",name:"摄氏度"},{symbol:"′",name:"角分"},{symbol:"″",name:"角秒"},{symbol:"‰",name:"千分号"},{symbol:"‱",name:"万分号"},{symbol:"※",name:"参照标记"},{symbol:"☆",name:"空心星"},{symbol:"★",name:"实心星"},{symbol:"○",name:"空心圆"}]},{groupName:"箭头符号",symbols:[{symbol:"←",name:"左箭头"},{symbol:"→",name:"右箭头"},{symbol:"↑",name:"上箭头"},{symbol:"↓",name:"下箭头"},{symbol:"↔",name:"左右箭头"},{symbol:"↕",name:"上下箭头"},{symbol:"⇐",name:"双线左箭头"},{symbol:"⇒",name:"双线右箭头"},{symbol:"⇑",name:"双线上箭头"},{symbol:"⇓",name:"双线下箭头"},{symbol:"⇔",name:"双线左右箭头"},{symbol:"⇕",name:"双线上下箭头"}]},{groupName:"货币符号",symbols:[{symbol:"¥",name:"人民币/日元"},{symbol:"$",name:"美元"},{symbol:"€",name:"欧元"},{symbol:"£",name:"英镑"},{symbol:"₩",name:"韩元"},{symbol:"₽",name:"卢布"},{symbol:"₹",name:"卢比"},{symbol:"¢",name:"美分"}]},{groupName:"希腊字母",symbols:[{symbol:"α",name:"阿尔法"},{symbol:"β",name:"贝塔"},{symbol:"γ",name:"伽马"},{symbol:"δ",name:"德尔塔"},{symbol:"ε",name:"艾普西龙"},{symbol:"ζ",name:"捷塔"},{symbol:"η",name:"依塔"},{symbol:"θ",name:"西塔"},{symbol:"ι",name:"艾欧塔"},{symbol:"κ",name:"喀帕"},{symbol:"λ",name:"兰姆达"},{symbol:"μ",name:"缪"},{symbol:"ν",name:"纽"},{symbol:"ξ",name:"克西"},{symbol:"ο",name:"欧米克隆"},{symbol:"ρ",name:"柔"},{symbol:"σ",name:"西格玛"},{symbol:"τ",name:"陶"},{symbol:"υ",name:"宇普西龙"},{symbol:"φ",name:"斐"},{symbol:"χ",name:"喜"},{symbol:"ψ",name:"普西"},{symbol:"ω",name:"欧米伽"}]}];class nT{options;mask=null;container=null;constructor(e){this.options=e,this._render()}_render(){const{onClose:e,onConfirm:t}=this.options,n=document.createElement("div");n.classList.add("special-symbols-mask"),n.setAttribute(Rt,gt.COMPONENT),document.body.append(n);const i=document.createElement("div");i.classList.add("special-symbols-container"),i.setAttribute(Rt,gt.COMPONENT);const r=document.createElement("div");r.classList.add("special-symbols-dialog");const s=document.createElement("div");s.classList.add("special-symbols-title");const l=document.createElement("span");l.textContent="特殊符号";const a=document.createElement("i");a.classList.add("special-symbols-close"),a.onclick=()=>{e?.(),this._dispose()},s.append(l,a),r.append(s);const c=document.createElement("div");c.classList.add("special-symbols-content"),tT.forEach(d=>{const u=document.createElement("div");u.classList.add("special-symbols-group");const h=document.createElement("div");h.classList.add("special-symbols-group-title"),h.textContent=d.groupName,u.append(h);const R=document.createElement("div");R.classList.add("special-symbols-grid"),d.symbols.forEach(g=>{const m=document.createElement("div");m.classList.add("special-symbols-item"),m.textContent=g.symbol,m.title=`${g.name} (${g.symbol})`,m.onclick=()=>{t(g.symbol),this._dispose()},m.onmouseenter=()=>{m.classList.add("special-symbols-item--hover")},m.onmouseleave=()=>{m.classList.remove("special-symbols-item--hover")},R.append(m)}),u.append(R),c.append(u)}),r.append(c),i.append(r),document.body.append(i),this.container=i,this.mask=n,n.onclick=()=>{e?.(),this._dispose()}}_dispose(){this.mask?.remove(),this.container?.remove()}}const oT=[{label:"姓名",value:"孙万锦",type:"macro"},{label:"性别",type:"macro"},{label:"年龄",type:"macro"},{label:"地址",type:"macro"},{label:"电话",type:"macro"},{label:"出生日期",type:"macro"},{label:"学历",type:"macro"},{label:"家庭住址",type:"macro"},{label:"民族",type:"macro"},{label:"住院号",type:"macro"},{label:"血型",type:"macro"},{label:"当前日期",type:"macro"},{label:"科室",type:"macro"}],al=[{name:"性别",code:"gender",items:[{code:"1",value:"男"},{code:"2",value:"女"}]},{name:"学历",code:"education",items:[{code:"1",value:"小学"},{code:"2",value:"初中"},{code:"3",value:"高中"},{code:"4",value:"大专"},{code:"5",value:"本科"},{code:"6",value:"硕士"},{code:"7",value:"博士"}]},{name:"婚姻状况",code:"marriage",items:[{code:"1",value:"未婚"},{code:"2",value:"已婚"},{code:"3",value:"离异"},{code:"4",value:"丧偶"}]},{name:"血型",code:"bloodType",items:[{code:"1",value:"A型"},{code:"2",value:"B型"},{code:"3",value:"AB型"},{code:"4",value:"O型"}]},{name:"民族",code:"nation",items:[{code:"01",value:"汉族"},{code:"02",value:"蒙古族"},{code:"03",value:"回族"},{code:"04",value:"藏族"},{code:"05",value:"维吾尔族"},{code:"06",value:"苗族"},{code:"07",value:"彝族"},{code:"08",value:"壮族"},{code:"09",value:"布依族"},{code:"10",value:"朝鲜族"}]},{name:"职业",code:"occupation",items:[{code:"1",value:"学生"},{code:"2",value:"教师"},{code:"3",value:"医生"},{code:"4",value:"工程师"},{code:"5",value:"公务员"},{code:"6",value:"企业家"},{code:"7",value:"自由职业"},{code:"8",value:"其他"}]}];class iT{options;mask=null;container=null;constructor(e){this.options=e,this._render()}_render(){const{onClose:e,onConfirm:t}=this.options,n=document.createElement("div");n.classList.add("macro-dialog-mask"),n.setAttribute(Rt,gt.COMPONENT),document.body.append(n);const i=document.createElement("div");i.classList.add("macro-dialog-container"),i.setAttribute(Rt,gt.COMPONENT);const r=document.createElement("div");r.classList.add("macro-dialog");const s=document.createElement("div");s.classList.add("macro-dialog-title");const l=document.createElement("span");l.textContent="宏元素";const a=document.createElement("i");a.classList.add("macro-dialog-close"),a.onclick=()=>{e?.(),this._dispose()},s.append(l,a),r.append(s);const c=document.createElement("div");c.classList.add("macro-dialog-content");const d=document.createElement("div");d.classList.add("macro-dialog-section-title"),d.textContent="预定义宏",c.append(d);const u=document.createElement("div");u.classList.add("macro-dialog-list"),oT.forEach(m=>{console.log(m,"macro----macro---macr不知道啊"),m.value="孙万锦";const f=this._createMacroItem(m,t);console.log(f,"macroItem-----macroItem"),u.append(f)}),c.append(u);const h=document.createElement("div");h.classList.add("macro-dialog-section-title"),h.textContent="自定义宏",c.append(h);const R={label:"自定义宏",type:"customMacro"},g=this._createMacroItem(R,t,!0);c.append(g),r.append(c),i.append(r),document.body.append(i),this.container=i,this.mask=n,n.onclick=()=>{e?.(),this._dispose()}}_createMacroItem(e,t,n=!1){const i=document.createElement("div");return i.classList.add("macro-dialog-item"),n&&i.classList.add("macro-dialog-item--custom"),i.textContent=e.label,i.title=`点击插入: ${e.label}`,i.onclick=()=>{console.log(e,"macro----macro------macro------macro"),t(e),this._dispose()},i}_dispose(){this.mask?.remove(),this.container?.remove()}}class cl{options;mask=null;container=null;constructor(e){this.options=e,this._render()}_render(){const{initialData:e,onClose:t,onConfirm:n}=this.options,i=document.createElement("div");i.classList.add("macro-dialog-mask"),i.setAttribute(Rt,gt.COMPONENT),document.body.append(i);const r=document.createElement("div");r.classList.add("macro-dialog-container"),r.setAttribute(Rt,gt.COMPONENT);const s=document.createElement("div");s.classList.add("macro-dialog","macro-dialog--edit");const l=document.createElement("div");l.classList.add("macro-dialog-title");const a=document.createElement("span");a.textContent=e?"编辑自定义宏":"添加自定义宏";const c=document.createElement("i");c.classList.add("macro-dialog-close"),c.onclick=()=>{t?.(),this._dispose()},l.append(a,c),s.append(l);const d=document.createElement("div");d.classList.add("macro-dialog-form");const u=document.createElement("div");u.classList.add("macro-dialog-form-group");const h=document.createElement("label");h.textContent="名称",h.classList.add("macro-dialog-form-label");const R=document.createElement("input");R.type="text",R.classList.add("macro-dialog-form-input"),R.placeholder="请输入宏名称",R.value=e?.label||"",u.append(h,R),d.append(u);const g=document.createElement("div");g.classList.add("macro-dialog-form-group");const m=document.createElement("label");m.textContent="字典",m.classList.add("macro-dialog-form-label");const f=document.createElement("select");f.classList.add("macro-dialog-form-select");const T=document.createElement("option");T.value="",T.textContent="请选择字典",f.append(T),al.forEach(M=>{const X=document.createElement("option");X.value=M.code,X.textContent=M.name,e?.dictCode===M.code&&(X.selected=!0),f.append(X)}),g.append(m,f),d.append(g),s.append(d);const I=document.createElement("div");I.classList.add("macro-dialog-buttons");const L=document.createElement("button");L.type="button",L.classList.add("macro-dialog-btn","macro-dialog-btn--cancel"),L.textContent="取消",L.onclick=()=>{t?.(),this._dispose()},I.append(L);const S=document.createElement("button");S.type="button",S.classList.add("macro-dialog-btn","macro-dialog-btn--confirm"),S.textContent="确定",S.onclick=()=>{const M=R.value.trim(),X=f.value;if(!M){alert("请输入宏名称");return}let x;X&&(x=al.find(D=>D.code===X)?.items),n({label:M,type:"customMacro",dictCode:X||void 0,items:x}),this._dispose()},I.append(S),s.append(I),r.append(s),document.body.append(r),this.container=r,this.mask=i,i.onclick=()=>{t?.(),this._dispose()}}_dispose(){this.mask?.remove(),this.container?.remove()}}class sT{options;mask=null;container=null;constructor(e){this.options=e,this._render()}_render(){const{items:e,currentCode:t,onClose:n,onConfirm:i}=this.options,r=document.createElement("div");r.classList.add("macro-dialog-mask"),r.setAttribute(Rt,gt.COMPONENT),document.body.append(r);const s=document.createElement("div");s.classList.add("macro-dialog-container"),s.setAttribute(Rt,gt.COMPONENT);const l=document.createElement("div");l.classList.add("macro-dialog","macro-dialog--select");const a=document.createElement("div");a.classList.add("macro-dialog-title");const c=document.createElement("span");c.textContent="选择值";const d=document.createElement("i");d.classList.add("macro-dialog-close"),d.onclick=()=>{n?.(),this._dispose()},a.append(c,d),l.append(a);const u=document.createElement("div");u.classList.add("macro-dialog-select-list"),e.forEach(h=>{const R=document.createElement("div");R.classList.add("macro-dialog-select-item"),h.code===t&&R.classList.add("macro-dialog-select-item--active"),R.textContent=h.value,R.onclick=()=>{i(h.code,h.value),this._dispose()},u.append(R)}),l.append(u),s.append(l),document.body.append(s),this.container=s,this.mask=r,r.onclick=()=>{n?.(),this._dispose()}}_dispose(){this.mask?.remove(),this.container?.remove()}}class qi{options;mask=null;container=null;constructor(e){this.options=e,this._render()}_render(){const{currentValue:e,label:t,onClose:n,onConfirm:i}=this.options,r=document.createElement("div");r.classList.add("macro-dialog-mask"),r.setAttribute(Rt,gt.COMPONENT),document.body.append(r);const s=document.createElement("div");s.classList.add("macro-dialog-container"),s.setAttribute(Rt,gt.COMPONENT);const l=document.createElement("div");l.classList.add("macro-dialog","macro-dialog--text");const a=document.createElement("div");a.classList.add("macro-dialog-title");const c=document.createElement("span");c.textContent=t||"输入值";const d=document.createElement("i");d.classList.add("macro-dialog-close"),d.onclick=()=>{n?.(),this._dispose()},a.append(c,d),l.append(a);const u=document.createElement("div");u.classList.add("macro-dialog-form");const h=document.createElement("div");h.classList.add("macro-dialog-form-group");const R=document.createElement("input");R.type="text",R.classList.add("macro-dialog-form-input"),R.placeholder=`请输入${t||"值"}`,R.value=e||"",h.append(R),u.append(h),l.append(u);const g=document.createElement("div");g.classList.add("macro-dialog-buttons");const m=document.createElement("button");m.type="button",m.classList.add("macro-dialog-btn","macro-dialog-btn--cancel"),m.textContent="取消",m.onclick=()=>{n?.(),this._dispose()},g.append(m);const f=document.createElement("button");f.type="button",f.classList.add("macro-dialog-btn","macro-dialog-btn--confirm"),f.textContent="确定",f.onclick=()=>{const T=R.value.trim();i(T),this._dispose()},g.append(f),l.append(g),s.append(l),document.body.append(s),this.container=s,this.mask=r,setTimeout(()=>R.focus(),100),r.onclick=()=>{n?.(),this._dispose()}}_dispose(){this.mask?.remove(),this.container?.remove()}}class rT{container;options;constructor(e){this.options=e,this.container=this.createDialog(),document.body.appendChild(this.container)}createDialog(){const e=document.createElement("div");return e.className="save-template-dialog-overlay",e.innerHTML=`
574
+ <div class="save-template-dialog">
575
+ <div class="save-template-dialog__header">
576
+ <span>保存模板</span>
577
+ <div class="save-template-dialog__close">×</div>
578
+ </div>
579
+ <div class="save-template-dialog__body">
580
+ <div class="save-template-dialog__form-group">
581
+ <label for="templateName">模板名称</label>
582
+ <input
583
+ type="text"
584
+ id="templateName"
585
+ class="save-template-dialog__input"
586
+ placeholder="请输入模板名称"
587
+ value="${this.options.defaultName||""}"
588
+ autocomplete="off"
589
+ />
590
+ </div>
591
+ </div>
592
+ <div class="save-template-dialog__footer">
593
+ <button class="save-template-dialog__btn save-template-dialog__btn--cancel">取消</button>
594
+ <button class="save-template-dialog__btn save-template-dialog__btn--confirm">保存</button>
595
+ </div>
596
+ </div>
597
+ `,this.bindEvents(e),e}bindEvents(e){const t=e.querySelector(".save-template-dialog__close"),n=e.querySelector(".save-template-dialog__btn--cancel"),i=e.querySelector(".save-template-dialog__btn--confirm"),r=e.querySelector("#templateName"),s=()=>{this.destroy(),this.options.onCancel?.()},l=()=>{const a=r.value.trim();if(!a){r.focus(),r.classList.add("error"),setTimeout(()=>r.classList.remove("error"),1e3);return}this.destroy(),this.options.onConfirm(a)};t?.addEventListener("click",s),n?.addEventListener("click",s),i?.addEventListener("click",l),e.addEventListener("click",a=>{a.target===e&&s()}),r?.addEventListener("keydown",a=>{a.key==="Enter"?l():a.key==="Escape"&&s()}),setTimeout(()=>{r?.focus(),r?.select()},100)}destroy(){this.container.remove()}}const lT="CanvasEditorDB",aT=1,Ht="templates";function cT(){return Date.now().toString(36)+Math.random().toString(36).substr(2,9)}class dT{db=null;isInitialized=!1;async init(){if(!this.isInitialized)return new Promise((e,t)=>{const n=indexedDB.open(lT,aT);n.onerror=()=>{console.error("IndexedDB 打开失败:",n.error),t(n.error)},n.onsuccess=()=>{this.db=n.result,this.isInitialized=!0,e()},n.onupgradeneeded=i=>{const r=i.target.result;if(!r.objectStoreNames.contains(Ht)){const s=r.createObjectStore(Ht,{keyPath:"id"});s.createIndex("name","name",{unique:!1}),s.createIndex("createdAt","createdAt",{unique:!1}),s.createIndex("updatedAt","updatedAt",{unique:!1})}}})}async ensureInit(){this.isInitialized||await this.init()}async saveTemplate(e){return await this.ensureInit(),new Promise((t,n)=>{const s=this.db.transaction([Ht],"readwrite").objectStore(Ht).put(e);s.onsuccess=()=>{t()},s.onerror=()=>{console.error("保存模板失败:",s.error),n(s.error)}})}async getAllTemplates(){return await this.ensureInit(),new Promise((e,t)=>{const r=this.db.transaction([Ht],"readonly").objectStore(Ht).getAll();r.onsuccess=()=>{const s=r.result;s.sort((l,a)=>a.updatedAt-l.updatedAt),e(s)},r.onerror=()=>{console.error("获取模板列表失败:",r.error),t(r.error)}})}async getTemplateById(e){return await this.ensureInit(),new Promise((t,n)=>{const s=this.db.transaction([Ht],"readonly").objectStore(Ht).get(e);s.onsuccess=()=>{t(s.result)},s.onerror=()=>{console.error("获取模板失败:",s.error),n(s.error)}})}async deleteTemplate(e){return await this.ensureInit(),new Promise((t,n)=>{const s=this.db.transaction([Ht],"readwrite").objectStore(Ht).delete(e);s.onsuccess=()=>{t()},s.onerror=()=>{console.error("删除模板失败:",s.error),n(s.error)}})}async updateTemplate(e,t){const n=await this.getTemplateById(e);if(!n)throw new Error("模板不存在");const i={...n,...t,updatedAt:Date.now()};return this.saveTemplate(i)}async clearAllTemplates(){return await this.ensureInit(),new Promise((e,t)=>{const r=this.db.transaction([Ht],"readwrite").objectStore(Ht).clear();r.onsuccess=()=>{e()},r.onerror=()=>{console.error("清空模板失败:",r.error),t(r.error)}})}async hasTemplates(){return(await this.getAllTemplates()).length>0}}const zn=new dT;class uT{container;options;templates=[];listElement=null;constructor(e,t){this.container=e,this.options=t,this.init()}async init(){this.container.innerHTML=`
598
+ <div class="template-list">
599
+ <div class="template-list__header">
600
+ <span>模板列表</span>
601
+ <div class="template-list__refresh" title="刷新">
602
+ <i></i>
603
+ </div>
604
+ </div>
605
+ <div class="template-list__content">
606
+ <div class="template-list__loading">加载中...</div>
607
+ </div>
608
+ </div>
609
+ `,this.listElement=this.container.querySelector(".template-list__content"),this.container.querySelector(".template-list__refresh")?.addEventListener("click",()=>this.loadTemplates()),await this.loadTemplates()}async loadTemplates(){try{this.templates=await zn.getAllTemplates(),this.renderList()}catch(e){console.error("加载模板列表失败:",e),this.showError("加载失败")}}renderList(){if(!this.listElement)return;if(this.templates.length===0){this.listElement.innerHTML=`
610
+ <div class="template-list__empty">
611
+ <span>暂无保存的模板</span>
612
+ </div>
613
+ `;return}const e=this.templates.map(t=>`
614
+ <div class="template-list__item" data-id="${t.id}">
615
+ <div class="template-list__item-info">
616
+ <span class="template-list__item-name">${this.escapeHtml(t.name)}</span>
617
+ <span class="template-list__item-date">${this.formatDate(t.updatedAt)}</span>
618
+ </div>
619
+ <div class="template-list__item-actions">
620
+ <button class="template-list__item-btn template-list__item-btn--load" title="加载模板">
621
+ <i></i>
622
+ </button>
623
+ <button class="template-list__item-btn template-list__item-btn--delete" title="删除模板">
624
+ <i></i>
625
+ </button>
626
+ </div>
627
+ </div>
628
+ `).join("");this.listElement.innerHTML=e,this.bindItemEvents()}bindItemEvents(){if(!this.listElement)return;this.listElement.querySelectorAll(".template-list__item").forEach(t=>{const n=t.getAttribute("data-id"),i=this.templates.find(l=>l.id===n);if(!i)return;t.querySelector(".template-list__item-btn--load")?.addEventListener("click",l=>{l.stopPropagation(),this.options.onSelect(i)}),t.querySelector(".template-list__item-btn--delete")?.addEventListener("click",async l=>{if(l.stopPropagation(),confirm(`确定删除模板 "${i.name}" 吗?`))try{await zn.deleteTemplate(i.id),this.options.onDelete?.(i),await this.loadTemplates()}catch(a){console.error("删除模板失败:",a),alert("删除失败")}}),t.addEventListener("click",()=>{this.options.onSelect(i)})})}showError(e){this.listElement&&(this.listElement.innerHTML=`
629
+ <div class="template-list__error">
630
+ <span>${e}</span>
631
+ </div>
632
+ `)}escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}formatDate(e){const t=new Date(e),n=t.getFullYear(),i=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),s=String(t.getHours()).padStart(2,"0"),l=String(t.getMinutes()).padStart(2,"0");return`${n}-${i}-${r} ${s}:${l}`}async refresh(){await this.loadTemplates()}destroy(){this.container.innerHTML=""}}function hT(o,e){let t;return function(...n){t&&window.clearTimeout(t),t=window.setTimeout(()=>{o.apply(this,n)},e)}}function dl(o){(window.requestIdleCallback||window.setTimeout)(()=>{o()})}const Va=[{label:"性别",value:"gender",valueSets:[{value:"男",code:"1"},{value:"女",code:"2"},{value:"未知",code:"0"}]},{label:"血型",value:"bloodType",valueSets:[{value:"A型",code:"A"},{value:"B型",code:"B"},{value:"AB型",code:"AB"},{value:"O型",code:"O"}]},{label:"学历",value:"education",valueSets:[{value:"小学",code:"1"},{value:"初中",code:"2"},{value:"高中",code:"3"},{value:"大专",code:"4"},{value:"本科",code:"5"},{value:"硕士",code:"6"},{value:"博士",code:"7"}]},{label:"婚姻状况",value:"maritalStatus",valueSets:[{value:"未婚",code:"1"},{value:"已婚",code:"2"},{value:"离异",code:"3"},{value:"丧偶",code:"4"}]},{label:"民族",value:"ethnicity",valueSets:[{value:"汉族",code:"01"},{value:"蒙古族",code:"02"},{value:"回族",code:"03"},{value:"藏族",code:"04"},{value:"维吾尔族",code:"05"},{value:"苗族",code:"06"},{value:"彝族",code:"07"},{value:"壮族",code:"08"},{value:"布依族",code:"09"},{value:"朝鲜族",code:"10"}]}];function ul(o){const e=Va.find(t=>t.value===o);return e?e.valueSets:null}function hl(){return Va.map(o=>({label:o.label,value:o.value}))}window.onload=function(){const o=typeof navigator<"u"&&/Mac OS X/.test(navigator.userAgent);let e="edit";const t=document.querySelector(".editor"),n=new Jm(t,{header:[],main:[],footer:[]},ll);Reflect.set(window,"editor",n),window.addEventListener("click",C=>{const W=document.querySelector(".visible");!W||W.contains(C.target)||W.classList.remove("visible")},{capture:!0});const i=document.querySelector(".menu-item__undo");i.title=`撤销(${o?"⌘":"Ctrl"}+Z)`,i.onclick=function(){n.command.executeUndo()};const r=document.querySelector(".menu-item__redo");r.title=`重做(${o?"⌘":"Ctrl"}+Y)`,r.onclick=function(){n.command.executeRedo()};const s=document.querySelector(".menu-item__painter");let l=!0,a;s.onclick=function(){l?(l=!1,a=window.setTimeout(()=>{l=!0,n.command.executePainter({isDblclick:!1})},200)):window.clearTimeout(a)},s.ondblclick=function(){l=!0,window.clearTimeout(a),n.command.executePainter({isDblclick:!0})},document.querySelector(".menu-item__format").onclick=function(){n.command.executeFormat()};const c=document.querySelector(".menu-item__font"),d=c.querySelector(".select"),u=c.querySelector(".options");c.onclick=function(){u.classList.toggle("visible")},u.onclick=function(C){const W=C.target;n.command.executeFont(W.dataset.family)};const h=document.querySelector(".menu-item__size"),R=h.querySelector(".select"),g=h.querySelector(".options");h.title="设置字号",h.onclick=function(){g.classList.toggle("visible")},g.onclick=function(C){const W=C.target;n.command.executeSize(Number(W.dataset.size))};const m=document.querySelector(".menu-item__size-add");m.title=`增大字号(${o?"⌘":"Ctrl"}+[)`,m.onclick=function(){n.command.executeSizeAdd()};const f=document.querySelector(".menu-item__size-minus");f.title=`减小字号(${o?"⌘":"Ctrl"}+])`,f.onclick=function(){n.command.executeSizeMinus()};const T=document.querySelector(".menu-item__bold");T.title=`加粗(${o?"⌘":"Ctrl"}+B)`,T.onclick=function(){n.command.executeBold()};const I=document.querySelector(".menu-item__italic");I.title=`斜体(${o?"⌘":"Ctrl"}+I)`,I.onclick=function(){n.command.executeItalic()};const L=document.querySelector(".menu-item__underline");L.title=`下划线(${o?"⌘":"Ctrl"}+U)`;const S=L.querySelector(".options");L.querySelector(".select").onclick=function(){S.classList.toggle("visible")},L.querySelector("i").onclick=function(){n.command.executeUnderline(),S.classList.remove("visible")},L.querySelector("ul").onmousedown=function(C){const Z=C.target.dataset.decorationStyle;n.command.executeUnderline({style:Z}),S.classList.remove("visible")};const M=document.querySelector(".menu-item__strikeout");M.onclick=function(){n.command.executeStrikeout()};const X=document.querySelector(".menu-item__superscript");X.title=`上标(${o?"⌘":"Ctrl"}+Shift+,)`,X.onclick=function(){n.command.executeSuperscript()};const x=document.querySelector(".menu-item__subscript");x.title=`下标(${o?"⌘":"Ctrl"}+Shift+.)`,x.onclick=function(){n.command.executeSubscript()};const F=document.querySelector("#color");F.oninput=function(){n.command.executeColor(F.value)};const D=document.querySelector(".menu-item__color"),V=D.querySelector("span");D.onclick=function(){F.click()};const E=document.querySelector("#highlight");E.oninput=function(){n.command.executeHighlight(E.value)};const v=document.querySelector(".menu-item__highlight"),b=v.querySelector("span");v.onclick=function(){E?.click()};const P=document.querySelector(".menu-item__title"),y=P.querySelector(".select"),N=P.querySelector(".options");N.querySelectorAll("li").forEach((C,W)=>{C.title=`Ctrl+${o?"Option":"Alt"}+${W}`}),P.onclick=function(){N.classList.toggle("visible")},N.onclick=function(C){const Z=C.target.dataset.level;n.command.executeTitle(Z||null)};const U=document.querySelector(".menu-item__left");U.title=`左对齐(${o?"⌘":"Ctrl"}+L)`,U.onclick=function(){n.command.executeRowFlex(Qe.LEFT)};const w=document.querySelector(".menu-item__center");w.title=`居中对齐(${o?"⌘":"Ctrl"}+E)`,w.onclick=function(){n.command.executeRowFlex(Qe.CENTER)};const Q=document.querySelector(".menu-item__right");Q.title=`右对齐(${o?"⌘":"Ctrl"}+R)`,Q.onclick=function(){n.command.executeRowFlex(Qe.RIGHT)};const K=document.querySelector(".menu-item__alignment");K.title=`两端对齐(${o?"⌘":"Ctrl"}+J)`,K.onclick=function(){n.command.executeRowFlex(Qe.ALIGNMENT)};const z=document.querySelector(".menu-item__justify");z.title=`分散对齐(${o?"⌘":"Ctrl"}+Shift+J)`,z.onclick=function(){n.command.executeRowFlex(Qe.JUSTIFY)};const $=document.querySelector(".menu-item__verticalCenter");$.onclick=function(){n.command.executeVertical(Tt.MIDDLE)};const le=document.querySelector(".menu-item__row-margin"),Pe=le.querySelector(".options");le.onclick=function(){Pe.classList.toggle("visible")},Pe.onclick=function(C){const W=C.target;n.command.executeRowMargin(Number(W.dataset.rowmargin))};const se=document.querySelector(".menu-item__list");se.title=`列表(${o?"⌘":"Ctrl"}+Shift+U)`;const J=se.querySelector(".options");se.onclick=function(){J.classList.toggle("visible")},J.onclick=function(C){const W=C.target,Z=W.dataset.listType||null,A=W.dataset.listStyle;n.command.executeList(Z,A)};const ie=document.querySelector(".menu-item__table"),Xe=document.querySelector(".menu-item__table__collapse"),ge=document.querySelector(".table-close"),pe=document.querySelector(".table-select"),H=document.querySelector(".table-panel"),te=[];for(let C=0;C<10;C++){const W=document.createElement("tr");W.classList.add("table-row");const Z=[];for(let A=0;A<10;A++){const q=document.createElement("td");q.classList.add("table-cel"),W.append(q),Z.push(q)}H.append(W),te.push(Z)}let _=0,j=0;function G(){te.forEach(C=>{C.forEach(W=>W.classList.remove("active"))})}function ae(C){pe.innerText=C}function Ie(){G(),ae("插入"),_=0,j=0,Xe.style.display="none"}ie.onclick=function(){Xe.style.display="block"},H.onmousemove=function(C){const{offsetX:q,offsetY:k}=C;G(),_=Math.ceil(q/22)||1,j=Math.ceil(k/26)||1,te.forEach((ne,ue)=>{ne.forEach((Le,Se)=>{Se<_&&ue<j&&Le.classList.add("active")})}),ae(`${j}×${_}`)},ge.onclick=function(){Ie()},H.onclick=function(){n.command.executeInsertTable(j,_),Ie()};const me=document.querySelector(".menu-item__image"),Oe=document.querySelector("#image");me.onclick=function(){Oe.click()},Oe.onchange=function(){const C=Oe.files[0],W=new FileReader;W.readAsDataURL(C),W.onload=function(){const Z=new Image,A=W.result;Z.src=A,Z.onload=function(){n.command.executeImage({value:A,width:Z.width,height:Z.height}),Oe.value=""}}};const Ue=document.querySelector(".menu-item__hyperlink");Ue.onclick=function(){new et({title:"超链接",data:[{type:"text",label:"文本",name:"name",required:!0,placeholder:"请输入文本",value:n.command.getRangeText()},{type:"text",label:"链接",name:"url",required:!0,placeholder:"请输入链接"}],onConfirm:C=>{const W=C.find(A=>A.name==="name")?.value;if(!W)return;const Z=C.find(A=>A.name==="url")?.value;Z&&n.command.executeHyperlink({url:Z,valueList:be(W).map(A=>({value:A,size:16}))})}})};const Ye=document.querySelector(".menu-item__separator"),ve=Ye.querySelector(".options");Ye.onclick=function(){ve.classList.toggle("visible")},ve.onmousedown=function(C){let W=[];const A=C.target.dataset.separator?.split(",").map(Number);A&&(A.every(k=>k===0)||(W=A)),n.command.executeSeparator(W)};const qe=document.querySelector(".menu-item__page-break");qe.onclick=function(){n.command.executePageBreak()};const je=document.querySelector(".menu-item__watermark"),pt=je.querySelector(".options");je.onclick=function(){pt.classList.toggle("visible")},pt.onmousedown=function(C){const Z=C.target.dataset.menu;pt.classList.toggle("visible"),Z==="add"?new et({title:"水印",data:[{type:"text",label:"内容",name:"data",required:!0,placeholder:"请输入内容"},{type:"color",label:"颜色",name:"color",required:!0,value:"#AEB5C0"},{type:"number",label:"字体大小",name:"size",required:!0,value:"120"},{type:"number",label:"透明度",name:"opacity",required:!0,value:"0.3"},{type:"select",label:"重复",name:"repeat",value:"0",required:!1,options:[{label:"不重复",value:"0"},{label:"重复",value:"1"}]},{type:"number",label:"水平间隔",name:"horizontalGap",required:!1,value:"10"},{type:"number",label:"垂直间隔",name:"verticalGap",required:!1,value:"10"}],onConfirm:A=>{if(~A.findIndex(ue=>!ue.value))return;const k=A.reduce((ue,Le)=>(ue[Le.name]=Le.value,ue),{}),ne=k.repeat==="1";n.command.executeAddWatermark({data:k.data,color:k.color,size:Number(k.size),opacity:Number(k.opacity),repeat:ne,gap:ne&&k.horizontalGap&&k.verticalGap?[Number(k.horizontalGap),Number(k.verticalGap)]:void 0})}}):n.command.executeDeleteWatermark()};const _e=document.querySelector(".menu-item__control"),Ae=_e.querySelector(".options");_e.onclick=function(){Ae.classList.toggle("visible")},Ae.onmousedown=function(C){Ae.classList.toggle("visible");const Z=C.target.dataset.control;switch(Z){case Y.TEXT:Ir(Y.TEXT);break;case Y.SELECT:Pr(Y.SELECT);break;case Y.CHECKBOX:Sr(Y.CHECKBOX);break;case Y.RADIO:Mr(Y.RADIO);break;case Y.DATE:Or(Y.DATE);break;case Y.NUMBER:Lr(Z);break}};const We=document.querySelector(".menu-text-field");We.onclick=function(){new et({title:"插入文本域",data:[{type:"text",label:"名称",name:"label",required:!0,placeholder:"请输入名称"},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词"}],onConfirm:C=>{const W=C.find(k=>k.name==="label")?.value;if(!W)return;const Z=C.find(k=>k.name==="placeholder")?.value||W,A=C.find(k=>k.name==="label")?.value||"",q={type:O.CONTROL,value:"",control:{type:Y.TEXTFIELD,textFixLabel:A,value:A?[{value:A}]:null,label:W,placeholder:Z}};n.command.executeInsertTextField(q)}})};const lt=document.querySelector(".menu-item__latex");lt.onclick=function(){new et({title:"LaTeX",data:[{type:"textarea",height:100,name:"value",placeholder:"请输入LaTeX文本"}],onConfirm:C=>{const W=C.find(Z=>Z.name==="value")?.value;W&&n.command.executeInsertElementList([{type:O.LATEX,value:W}])}})};const Ct=document.querySelector(".menu-item__date"),rt=Ct.querySelector(".options");Ct.onclick=function(){rt.classList.toggle("visible");const C=document.body.getBoundingClientRect(),W=rt.getBoundingClientRect();W.left+W.width>C.width?(rt.style.right="0px",rt.style.left="unset"):(rt.style.right="unset",rt.style.left="0px");const Z=new Date,A=Z.getFullYear().toString(),q=(Z.getMonth()+1).toString().padStart(2,"0"),k=Z.getDate().toString().padStart(2,"0"),ne=Z.getHours().toString().padStart(2,"0"),ue=Z.getMinutes().toString().padStart(2,"0"),Le=Z.getSeconds().toString().padStart(2,"0"),Se=`${A}-${q}-${k}`,Ce=`${Se} ${ne}:${ue}:${Le}`;rt.querySelector("li:first-child").innerText=Se,rt.querySelector("li:last-child").innerText=Ce},rt.onmousedown=function(C){const W=C.target,Z=W.dataset.format;rt.classList.toggle("visible"),n.command.executeInsertElementList([{type:O.DATE,value:"",dateFormat:Z,valueList:[{value:W.innerText.trim()}]}])};const Pt=document.querySelector(".menu-item__special-symbols");Pt.onclick=function(){new nT({onConfirm:C=>{const W=be(C).map(Z=>({value:Z}));n.command.executeInsertElementList([{type:O.SPECIAL_SYMBOLS,value:C,valueList:W}])}})};const ft=document.querySelector(".menu-item__macro");ft.onclick=function(){new iT({onConfirm:C=>{C.type==="customMacro"?new cl({onConfirm:W=>{Wt(W)}}):Wt(C)}})};function Wt(C){const W={type:C.type==="customMacro"?O.CUSTOM_MACRO:O.MACRO,value:C.type==="customMacro"?C.label:"获取"+C.label,label:C.label};C.type==="customMacro"&&(W.dictCode=C.dictCode,W.macroConfig=C.items?{type:"select",items:C.items}:{type:"text"}),n.command.executeInsertElementList([W])}n.eventBus.on("macroClick",C=>{const W=C.element;W.type===O.CUSTOM_MACRO&&new cl({initialData:{label:W.label||"",type:"customMacro",dictCode:W.dictCode},onConfirm:Z=>{n.command.executeUpdateElementById({id:W.id,properties:{label:Z.label,value:Z.label,dictCode:Z.dictCode,macroConfig:Z.items?{type:"select",items:Z.items}:{type:"text"}},isSetCursor:!0})}})}),n.eventBus.on("macroValueChange",C=>{const W=C.element;if(W.type===O.CUSTOM_MACRO){const Z=W.macroConfig||{type:"text"};(Z.type||"text")==="select"?new sT({items:Z.items||[],currentCode:Z.code,onConfirm:(q,k)=>{n.command.executeUpdateElementById({id:W.id,properties:{macroConfig:{...Z,code:q,value:k}},isSetCursor:!0})}}):new qi({currentValue:Z.value||"",label:W.label||"",onConfirm:q=>{n.command.executeUpdateElementById({id:W.id,properties:{macroConfig:{...Z,value:q}},isSetCursor:!0})}})}else if(W.type===O.REUSABLE_ITEM){const Z=W.reusableItemConfig||{},A=ll.mode;new qi({currentValue:Z.value||"",label:W.label||"",onConfirm:q=>{const k={reusableItemConfig:{value:q}};A===B.FORM&&(q?(k.underline=!0,k.textDecoration={style:Xn.DOUBLE},k.strikeout=!1):(k.strikeout=!0,k.underline=!1,k.textDecoration=void 0)),n.command.executeUpdateElementById({id:W.id,properties:k,isSetCursor:!0})}})}});const co=document.querySelector(".menu-item__reusable-item");co.onclick=function(){new qi({label:"复用项目名称",currentValue:"",onConfirm:C=>{if(!C.trim()){alert("请输入复用项目名称");return}const W={type:O.REUSABLE_ITEM,label:C.trim(),value:C.trim()};n.command.executeInsertElementList([W])}})};const bt=document.querySelector(".menu-item__search__collapse"),Bt=document.querySelector(".menu-item__search__collapse__search input"),Ze=document.querySelector(".menu-item__search__collapse__replace input"),Et=document.querySelector("#option-reg"),dt=document.querySelector("#option-case"),Ot=document.querySelector("#option-selection"),Zt=document.querySelector(".menu-item__search");Zt.title=`搜索与替换(${o?"⌘":"Ctrl"}+F)`;const Qt=bt.querySelector(".search-result");function bn(){const C=n.command.getSearchNavigateInfo();if(C){const{index:W,count:Z}=C;Qt.innerText=`${W}/${Z}`}else Qt.innerText=""}Zt.onclick=function(){bt.style.display="block";const C=document.body.getBoundingClientRect(),W=Zt.getBoundingClientRect(),Z=bt.getBoundingClientRect();W.left+Z.width>C.width?(bt.style.right="0px",bt.style.left="unset"):bt.style.right="unset",Bt.focus()},bt.querySelector("span").onclick=function(){bt.style.display="none",Bt.value="",Ze.value="",n.command.executeSearch(null),bn()};function yn(){n.command.executeSearch(Bt.value||null,{isRegEnable:Et.checked,isIgnoreCase:dt.checked,isLimitSelection:Ot.checked}),bn()}Bt.oninput=yn,Et.onchange=yn,dt.onchange=yn,Ot.onchange=yn,Bt.onkeydown=function(C){C.key==="Enter"&&yn()},bt.querySelector("button").onclick=function(){const C=Bt.value,W=Ze.value;C&&C!==W&&n.command.executeReplace(W)},bt.querySelector(".arrow-left").onclick=function(){n.command.executeSearchNavigatePre(),bn()},bt.querySelector(".arrow-right").onclick=function(){n.command.executeSearchNavigateNext(),bn()};const ir=document.querySelector(".menu-item__print");ir.title=`打印(${o?"⌘":"Ctrl"}+P)`,ir.onclick=function(){n.command.executePrint()};const sr=document.querySelector(".menu-item__uploadJson");sr.title="导出",sr.onclick=function(){const C=n.command.getOptions().mode;(C===B.FORM||C===B.PRINT)&&n.command.executeMode(B.EDIT);const W=n.command.getValue();console.log(W,"data"),(C===B.FORM||C===B.PRINT)&&n.command.executeMode(C);const Z=JSON.stringify(W,null,2),A=new Blob([Z],{type:"application/json"}),q=URL.createObjectURL(A),k=document.createElement("a");k.href=q,k.download=`canvas-editor-${Date.now()}.json`,k.click(),URL.revokeObjectURL(q)};const rr=document.querySelector(".menu-item__importJson"),yi=document.querySelector("#importJsonInput");rr.title="导入",rr.onclick=function(){yi.click()},yi.onchange=function(C){const W=C.target.files?.[0];if(!W)return;const Z=new FileReader;Z.onload=function(A){try{const q=A.target?.result,k=JSON.parse(q);console.log(k,"解析"),k.options.mode="edit",console.log(k.options,"data.options"),n.command.executeUpdateOptions(k.options),n.command.executeSelectAll(),n.command.executeBackspace(),n.command.executeSetValue(k.data)}catch(q){console.error("JSON 解析失败:",q)}},Z.readAsText(W),yi.value=""};const Ya=document.querySelector(".menu-item__saveTemplate");Ya.onclick=function(){const C=n.command.getOptions().mode;(C===B.FORM||C===B.PRINT)&&n.command.executeMode(B.EDIT);const W=n.command.getValue();(C===B.FORM||C===B.PRINT)&&n.command.executeMode(C);const Z=`模板_${new Date().toLocaleDateString("zh-CN").replace(/\//g,"-")}`;new rT({defaultName:Z,onConfirm:async A=>{try{const q={id:cT(),name:A,data:W,createdAt:Date.now(),updatedAt:Date.now()};await zn.saveTemplate(q),console.log("模板保存成功:",A),xi&&await xi.refresh(),Wi(),alert("模板保存成功!")}catch(q){console.error("保存模板失败:",q),alert("保存模板失败!")}}})};let xi=null;const uo=document.querySelector("#templateListPanel"),vi=document.querySelector("#templateToggleBtn");let ho=!1;async function Wi(){await zn.hasTemplates()?vi.classList.remove("hidden"):vi.classList.add("hidden")}function wa(){ho=!ho,ho?uo.classList.add("visible"):uo.classList.remove("visible")}function Ua(C){try{const W=C.data;console.log("加载模板:",C.name,W),W.options&&(W.options.mode="edit",n.command.executeUpdateOptions(W.options)),n.command.executeSelectAll(),n.command.executeBackspace(),W.data&&n.command.executeSetValue(W.data),ho=!1,uo.classList.remove("visible"),console.log("模板加载成功:",C.name)}catch(W){console.error("加载模板失败:",W),alert("加载模板失败!")}}async function Za(){await zn.init(),await Wi(),xi=new uT(uo,{onSelect:C=>{Ua(C)},onDelete:async C=>{console.log("模板已删除:",C.name),await Wi(),await zn.hasTemplates()||(ho=!1,uo.classList.remove("visible"))}}),vi.onclick=wa}Za().catch(console.error);const Qa=document.querySelector(".editor-option");Qa.onclick=function(){const C=n.command.getOptions();new et({title:"编辑器配置",data:[{type:"textarea",name:"option",width:350,height:300,required:!0,value:JSON.stringify(C,null,2),placeholder:"请输入编辑器配置"}],onConfirm:W=>{const Z=W.find(q=>q.name==="option")?.value;if(!Z)return;const A=JSON.parse(Z);n.command.executeUpdateOptions(A)}})};async function lr(){const C=await n.command.getCatalog(),W=document.querySelector(".catalog__main");if(W.innerHTML="",C){const Z=(A,q)=>{for(let k=0;k<q.length;k++){const ne=q[k],ue=document.createElement("div");ue.classList.add("catalog-item");const Le=document.createElement("div");Le.classList.add("catalog-item__content");const Se=document.createElement("span");Se.innerText=ne.name,Le.append(Se),Le.onclick=()=>{n.command.executeLocationCatalog(ne.id)},ue.append(Le),ne.subCatalog&&ne.subCatalog.length&&Z(ue,ne.subCatalog),A.append(ue)}};Z(W,C)}}let Qo=!0;const ar=document.querySelector(".catalog"),Ka=document.querySelector(".catalog-mode"),Ha=document.querySelector(".catalog__header__close"),cr=()=>{Qo=!Qo,Qo?(ar.style.display="block",lr()):ar.style.display="none"};Ka.onclick=cr,Ha.onclick=cr;let Di=!0;const dr=document.querySelector(".element-attribute"),_a=document.querySelector(".element-attribute__header__close"),Aa=()=>{Di=!Di,Di?dr.style.display="block":dr.style.display="none"};_a.onclick=Aa;const ur=document.querySelector(".page-mode"),Ko=ur.querySelector(".options");ur.onclick=function(){Ko.classList.toggle("visible")},Ko.onclick=function(C){const W=C.target;n.command.executePageMode(W.dataset.pageMode)},document.querySelector(".page-scale-percentage").onclick=function(){n.command.executePageScaleRecovery()},document.querySelector(".page-scale-minus").onclick=function(){n.command.executePageScaleMinus()},document.querySelector(".page-scale-add").onclick=function(){n.command.executePageScaleAdd()};const hr=document.querySelector(".paper-size"),Vi=hr.querySelector(".options");hr.onclick=function(){Vi.classList.toggle("visible")},Vi.onclick=function(C){const W=C.target,Z=W.dataset.paperSize,[A,q]=Z.split("*").map(Number);n.command.executePaperSize(A,q),Vi.querySelectorAll("li").forEach(k=>k.classList.remove("active")),W.classList.add("active")};const Rr=document.querySelector(".paper-direction"),Yi=Rr.querySelector(".options");Rr.onclick=function(){Yi.classList.toggle("visible")},Yi.onclick=function(C){const W=C.target,Z=W.dataset.paperDirection;n.command.executePaperDirection(Z),Yi.querySelectorAll("li").forEach(A=>A.classList.remove("active")),W.classList.add("active")};const ka=document.querySelector(".paper-margin");ka.onclick=function(){const[C,W,Z,A]=n.command.getPaperMargin();new et({title:"页边距",data:[{type:"text",label:"上边距",name:"top",required:!0,value:`${C}`,placeholder:"请输入上边距"},{type:"text",label:"下边距",name:"bottom",required:!0,value:`${Z}`,placeholder:"请输入下边距"},{type:"text",label:"左边距",name:"left",required:!0,value:`${A}`,placeholder:"请输入左边距"},{type:"text",label:"右边距",name:"right",required:!0,value:`${W}`,placeholder:"请输入右边距"}],onConfirm:q=>{const k=q.find(Se=>Se.name==="top")?.value;if(!k)return;const ne=q.find(Se=>Se.name==="bottom")?.value;if(!ne)return;const ue=q.find(Se=>Se.name==="left")?.value;if(!ue)return;const Le=q.find(Se=>Se.name==="right")?.value;Le&&n.command.executeSetPaperMargin([Number(k),Number(Le),Number(ne),Number(ue)])}})};const gr=document.querySelector(".fullscreen");gr.onclick=pr,window.addEventListener("keydown",C=>{C.key==="F11"&&(pr(),C.preventDefault())}),document.addEventListener("fullscreenchange",()=>{gr.classList.toggle("exist")});function pr(){document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()}let Ho=0;const fr=[{mode:B.EDIT,name:"编辑模式"},{mode:B.FORM,name:"表单模式"},{mode:B.PRINT,name:"预览模式"}],mr=document.querySelector(".editor-mode");mr.onclick=function(){Ho===fr.length-1?Ho=0:Ho++;const{name:C,mode:W}=fr[Ho];mr.innerText=C,e=W,n.command.executeMode(W);const Z=W===B.READONLY,A=["search","print","uploadJson","saveTemplate","importJson"];document.querySelectorAll(".menu-item>div").forEach(q=>{const k=q.dataset.menu;Z&&(!k||!A.includes(k))?q.classList.add("disable"):q.classList.remove("disable")})},n.listener.rangeStyleChange=function(C){if(C.type===O.SUBSCRIPT?x.classList.add("active"):x.classList.remove("active"),C.type===O.SUPERSCRIPT?X.classList.add("active"):X.classList.remove("active"),C.type===O.SEPARATOR?Ye.classList.add("active"):Ye.classList.remove("active"),ve.querySelectorAll("li").forEach(k=>k.classList.remove("active")),C.type===O.SEPARATOR){const k=C.dashArray.join(",")||"0,0",ne=ve.querySelector(`[data-separator='${k}']`);ne&&ne.classList.add("active")}u.querySelectorAll("li").forEach(k=>k.classList.remove("active"));const W=u.querySelector(`[data-family='${C.font}']`);W&&(d.innerText=W.innerText,d.style.fontFamily=C.font,W.classList.add("active")),g.querySelectorAll("li").forEach(k=>k.classList.remove("active"));const Z=g.querySelector(`[data-size='${C.size}']`);if(Z?(R.innerText=Z.innerText,Z.classList.add("active")):R.innerText=`${C.size}`,C.bold?T.classList.add("active"):T.classList.remove("active"),C.italic?I.classList.add("active"):I.classList.remove("active"),C.underline?L.classList.add("active"):L.classList.remove("active"),C.strikeout?M.classList.add("active"):M.classList.remove("active"),C.color?(D.classList.add("active"),F.value=C.color,V.style.backgroundColor=C.color):(D.classList.remove("active"),F.value="#000000",V.style.backgroundColor="#000000"),C.highlight?(v.classList.add("active"),E.value=C.highlight,b.style.backgroundColor=C.highlight):(v.classList.remove("active"),E.value="#ffff00",b.style.backgroundColor="#ffff00"),U.classList.remove("active"),w.classList.remove("active"),Q.classList.remove("active"),K.classList.remove("active"),z.classList.remove("active"),C.rowFlex&&C.rowFlex==="right"?Q.classList.add("active"):C.rowFlex&&C.rowFlex==="center"?w.classList.add("active"):C.rowFlex&&C.rowFlex==="alignment"?K.classList.add("active"):C.rowFlex&&C.rowFlex==="justify"?z.classList.add("active"):U.classList.add("active"),Pe.querySelectorAll("li").forEach(k=>k.classList.remove("active")),Pe.querySelector(`[data-rowmargin='${C.rowMargin}']`).classList.add("active"),C.undo?i.classList.remove("no-allow"):i.classList.add("no-allow"),C.redo?r.classList.remove("no-allow"):r.classList.add("no-allow"),C.painter?s.classList.add("active"):s.classList.remove("active"),N.querySelectorAll("li").forEach(k=>k.classList.remove("active")),C.level){const k=N.querySelector(`[data-level='${C.level}']`);y.innerText=k.innerText,k.classList.add("active")}else y.innerText="正文",N.querySelector("li:first-child").classList.add("active");if(J.querySelectorAll("li").forEach(k=>k.classList.remove("active")),C.listType){se.classList.add("active");const k=C.listType,ne=C.listType===kt.OL?Nt.DECIMAL:C.listType,ue=J.querySelector(`[data-list-type='${k}'][data-list-style='${ne}']`);ue&&ue.classList.add("active")}else se.classList.remove("active");const q=n.command.getRangeContext();q&&(document.querySelector(".row-no").innerText=`${q.startRowNo+1}`,document.querySelector(".col-no").innerText=`${q.startColNo+1}`)},n.listener.visiblePageNoListChange=function(C){const W=C.map(Z=>Z+1).join("、");document.querySelector(".page-no-list").innerText=W},n.listener.pageSizeChange=function(C){document.querySelector(".page-size").innerText=`${C}`},n.listener.intersectionPageNoChange=function(C){document.querySelector(".page-no").innerText=`${C+1}`},n.listener.pageScaleChange=function(C){document.querySelector(".page-scale-percentage").innerText=`${Math.floor(C*10*10)}%`},n.listener.controlChange=function(C){["table","hyperlink","separator","page-break","control"].forEach(Z=>{const A=document.querySelector(`.menu-item__${Z}`);C.state===ai.ACTIVE?A.classList.add("disable"):A.classList.remove("disable")})},n.listener.pageModeChange=function(C){const W=Ko.querySelector(`[data-page-mode='${C}']`);Ko.querySelectorAll("li").forEach(Z=>Z.classList.remove("active")),W.classList.add("active")},n.eventBus.on("buttonChange",C=>{C.element[0].newButtonValue=[{value:"按钮展开文字",code:"1"}],n.command.executeButton(C)}),n.eventBus.on("controlEditAttribute",C=>{const A=C.element?.[0]?.control,q=A?.type;if(q==="text")new et({title:"修改文本控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签",value:A?.label||""},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词",value:A?.placeholder||""},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值",value:A?.value?.[0]?.value||""},{type:"select",label:"开启下划线",name:"underline",options:[{label:"不开启",value:"false"},{label:"开启",value:"true"}],value:A?.underline===!0?"true":"false"}],onConfirm:k=>{const ne=k.find(ye=>ye.name==="label")?.value;if(!ne)return;const ue=k.find(ye=>ye.name==="placeholder")?.value||ne,Le=k.find(ye=>ye.name==="value")?.value||"",Se=k.find(ye=>ye.name==="underline")?.value==="true",Ce={controlId:C.controlId,type:q,label:ne,placeholder:ue,value:Le,underline:Se};n.command.executeEditElementAttribute(Ce)}});else if(q==="TextField")new et({title:"修改文本域控件",data:[{type:"text",label:"名称",name:"label",required:!0,placeholder:"请输入名称",value:A?.label||""},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词",value:A?.placeholder||""}],onConfirm:k=>{const ne=k.find(Se=>Se.name==="label")?.value;if(!ne)return;const ue=k.find(Se=>Se.name==="placeholder")?.value||ne,Le={controlId:C.controlId,type:q,label:ne,placeholder:ue};n.command.executeEditElementAttribute(Le)}});else if(q==="number"){const k=A?.numberExclusiveOptions||{};new et({title:"修改数值控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签",value:A?.label||""},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词",value:A?.placeholder||""},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值",value:A?.value?.[0]?.value||""},{type:"number",label:"最小长度",name:"minLength",placeholder:"默认为1,非必填",value:k.minLength||""},{type:"number",label:"最大长度",name:"maxLength",placeholder:"不限制则留空,非必填",value:k.maxLength||""},{type:"number",label:"保留小数位数",name:"decimalPlaces",placeholder:"不填则不校验小数位,非必填",value:k.decimalPlaces||""},{type:"number",label:"最小值",name:"minValue",placeholder:"不设置则不校验,非必填",value:k.minValue??""},{type:"number",label:"最大值",name:"maxValue",placeholder:"不设置则不校验,非必填",value:k.maxValue??""}],onConfirm:ne=>{const ue=ne.find(Mt=>Mt.name==="label")?.value;if(!ue)return;const Le=ne.find(Mt=>Mt.name==="placeholder")?.value||ue,Se=ne.find(Mt=>Mt.name==="value")?.value||"",Ce=ne.find(Mt=>Mt.name==="minLength")?.value,ye=ne.find(Mt=>Mt.name==="maxLength")?.value,nt=ne.find(Mt=>Mt.name==="decimalPlaces")?.value,Kt=ne.find(Mt=>Mt.name==="minValue")?.value,Hn=ne.find(Mt=>Mt.name==="maxValue")?.value,Xr={controlId:C.controlId,type:q,label:ue,placeholder:Le,value:Se,numberExclusiveOptions:{minLength:Ce?parseInt(Ce):1,maxLength:ye?parseInt(ye):null,decimalPlaces:nt?parseInt(nt):null,minValue:Kt?parseFloat(Kt):void 0,maxValue:Hn?parseFloat(Hn):void 0}};n.command.executeEditElementAttribute(Xr)}})}else q==="select"?new et({title:"修改列举控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签",value:A?.label||""},{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值",value:A?.code||""},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词",value:A?.placeholder||""},{type:"radio",label:"值集类型",name:"valueSetType",value:A?.valueSetType||"custom",horizontal:!0,options:[{label:"自定义",value:"custom"},{label:"字典",value:"dictionary"}]},{type:"select",label:"字典类型",name:"dictionaryType",placeholder:"请选择字典类型",value:A?.dictionaryType||"",visible:A?.valueSetType==="dictionary",visibleWhen:{field:"valueSetType",value:"dictionary"},options:[{label:"请选择字典类型",value:""},...hl()]},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
633
+ [{
634
+ "value":"有",
635
+ "code":"98175"
636
+ }]`,value:A?.valueSets?JSON.stringify(A.valueSets,null,2):"",visible:A?.valueSetType!=="dictionary",visibleWhen:{field:"valueSetType",value:"custom"}}],onConfirm:k=>{const ne=k.find(nt=>nt.name==="label")?.value;if(!ne)return;const ue=k.find(nt=>nt.name==="code")?.value,Le=k.find(nt=>nt.name==="placeholder")?.value||ne,Se=k.find(nt=>nt.name==="valueSetType")?.value||"custom";let Ce=[];if(Se==="dictionary"){const nt=k.find(Hn=>Hn.name==="dictionaryType")?.value;if(!nt)return;const Kt=ul(nt);if(!Kt)return;Ce=Kt}else{const nt=k.find(Kt=>Kt.name==="valueSets")?.value;if(!nt)return;Ce=JSON.parse(nt)}const ye={controlId:C.controlId,type:q,label:ne,code:ue,placeholder:Le,valueSets:Ce,valueSetType:Se,dictionaryType:Se==="dictionary"?k.find(nt=>nt.name==="dictionaryType")?.value:void 0};n.command.executeEditElementAttribute(ye)}}):q==="date"?new et({title:"修改日期控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签",value:A?.label||""},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词",value:A?.placeholder||""},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值",value:A?.value?.[0]?.value||""},{type:"select",label:"日期格式",name:"dateFormat",value:A?.dateFormat||"yyyy-MM-dd hh:mm:ss",required:!0,options:[{label:"yyyy-MM-dd hh:mm:ss",value:"yyyy-MM-dd hh:mm:ss"},{label:"yyyy-MM-dd",value:"yyyy-MM-dd"}]}],onConfirm:k=>{const ne=k.find(ye=>ye.name==="label")?.value;if(!ne)return;const ue=k.find(ye=>ye.name==="placeholder")?.value||ne,Le=k.find(ye=>ye.name==="value")?.value||"",Se=k.find(ye=>ye.name==="dateFormat")?.value||"",Ce={controlId:C.controlId,type:q,label:ne,placeholder:ue,value:Le,dateFormat:Se};n.command.executeEditElementAttribute(Ce)}}):q==="checkbox"?new et({title:"修改多选框控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签",value:A?.label||""},{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值,多个值以英文逗号分割",value:A?.code||""},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
637
+ [{
638
+ "value":"有",
639
+ "code":"98175"
640
+ }]`,value:A?.valueSets?JSON.stringify(A.valueSets,null,2):""}],onConfirm:k=>{const ne=k.find(Ce=>Ce.name==="label")?.value;if(!ne)return;const ue=k.find(Ce=>Ce.name==="code")?.value,Le=k.find(Ce=>Ce.name==="valueSets")?.value;if(!Le)return;const Se={controlId:C.controlId,type:q,label:ne,code:ue,valueSets:JSON.parse(Le)};n.command.executeEditElementAttribute(Se)}}):q==="radio"?new et({title:"修改单选框控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签",value:A?.label||""},{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值",value:A?.code||""},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
641
+ [{
642
+ "value":"有",
643
+ "code":"98175"
644
+ }]`,value:A?.valueSets?JSON.stringify(A.valueSets,null,2):""}],onConfirm:k=>{const ne=k.find(Ce=>Ce.name==="label")?.value;if(!ne)return;const ue=k.find(Ce=>Ce.name==="code")?.value,Le=k.find(Ce=>Ce.name==="valueSets")?.value;if(!Le)return;const Se={controlId:C.controlId,type:q,label:ne,code:ue,valueSets:JSON.parse(Le)};n.command.executeEditElementAttribute(Se)}}):q==="button"&&new et({title:"修改按钮控件",data:[{type:"text",label:"按钮名称",required:!0,name:"label",placeholder:"请输入按钮名称",value:A?.label||""},{type:"text",label:"事件代码",name:"code",placeholder:"请输入事件代码",value:A?.code||""}],onConfirm:k=>{const ne=k.find(Se=>Se.name==="label")?.value;if(!ne)return;const ue=k.find(Se=>Se.name==="code")?.value||"",Le={controlId:C.controlId,type:q,label:ne,code:ue};n.command.executeEditElementAttribute(Le)}})});const Tr=async function(){const C=await n.command.getWordCount();document.querySelector(".word-count").innerText=`${C||0}`,Qo&&dl(()=>{lr()}),dl(()=>{})};n.listener.contentChange=hT(Tr,200),Tr(),n.register.contextMenuList([{name:"常用控件",icon:"item__control",isDivider:e!="edit",when:C=>!C.isReadonly,childMenus:[{name:"插入文本域",icon:"text-field",when:C=>{if(C.startElement?.controlId){const W=C.startElement?.controlComponent,Z=C.startElement?.control,A=Z?.type;return W==="postfix"||W==="postTextFix"||A==="TextField"&&(W==="value"||W==="placeholder")||!Z&&W==="placeholder"}return!C.isReadonly},callback:C=>{new et({title:"插入文本域",data:[{type:"text",label:"名称",name:"label",required:!0,placeholder:"请输入名称"},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词"}],onConfirm:W=>{const Z=W.find(ne=>ne.name==="label")?.value;if(!Z)return;const A=W.find(ne=>ne.name==="placeholder")?.value||Z,q=W.find(ne=>ne.name==="label")?.value||"",k={type:O.CONTROL,value:"",control:{type:Y.TEXTFIELD,textFixLabel:q,value:null,label:Z,placeholder:A}};C.executeInsertTextField(k)}})}},{name:"文本控件",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{Ir(Y.TEXT)}},{name:"插入按钮",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{new et({title:"插入按钮",data:[{type:"text",label:"按钮标签",name:"buttonLabel",required:!0,placeholder:"请输入按钮标签",value:"按钮"},{type:"text",label:"按钮代码",name:"code",placeholder:"请输入按钮代码"}],onConfirm:C=>{const W=C.find(q=>q.name==="buttonLabel")?.value||"按钮",Z=C.find(q=>q.name==="code")?.value||"",A={type:O.CONTROL,value:"",control:{type:Y.BUTTON,buttonLabel:W,code:Z,value:null,label:W}};n.command.executeInsertControl(A)}})}},{name:"数值控件",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{Lr(Y.NUMBER)}},{name:"列举控件",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{Pr(Y.SELECT)}},{name:"日期控件",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{Or(Y.DATE)}},{name:"多选框控件",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{Sr(Y.CHECKBOX)}},{name:"单选框控件",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{Mr(Y.RADIO)}}]},{name:"添加表达式",icon:"text-field",when:C=>!C.isReadonly&&C.options.mode==="edit",childMenus:[{name:"月经史",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{Ga()}},{name:"胎心位置",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{Ja()}},{name:"牙位图",icon:"text-field",when:C=>!C.isReadonly,callback:()=>{Ba()}}]},{name:"批注",when:C=>!C.isReadonly&&C.editorHasSelection&&C.zone===De.MAIN,callback:C=>{new et({title:"批注",data:[{type:"textarea",label:"批注",height:100,name:"value",required:!0,placeholder:"请输入批注"}],onConfirm:W=>{const Z=W.find(q=>q.name==="value")?.value;if(!Z)return;const A=C.executeSetGroup();A&&jm.push({id:A,content:Z,userName:"Hufe",rangeText:C.getRangeText(),createdDate:new Date().toLocaleString()})}})}},{name:"新增题注",icon:"caption",when:C=>!C.isReadonly&&C.startElement?.type===O.IMAGE&&!C.startElement?.imgCaption,callback:C=>{new et({title:"新增题注",data:[{type:"text",label:"题注内容",name:"value",required:!0,placeholder:"请输入题注内容,使用{imageNo}表示图片序号"}],onConfirm:W=>{const Z=W.find(A=>A.name==="value")?.value;Z&&C.executeSetImageCaption({value:Z})}})}},{name:"修改题注",icon:"caption",when:C=>!C.isReadonly&&C.startElement?.type===O.IMAGE&&!!C.startElement?.imgCaption,callback:(C,W)=>{const Z=W.startElement?.imgCaption;new et({title:"修改题注",data:[{type:"text",label:"题注内容",name:"value",required:!0,value:Z?.value,placeholder:"请输入题注内容,使用{imageNo}表示图片序号"}],onConfirm:A=>{const q=A.find(k=>k.name==="value")?.value;C.executeSetImageCaption({...Z,value:q||""})}})}},{name:"签名",icon:"signature",when:C=>!C.isReadonly&&C.editorTextFocus,callback:C=>{new eT({onConfirm(W){if(!W)return;const{value:Z,width:A,height:q}=W;!Z||!A||!q||C.executeInsertElementList([{value:Z,width:A,height:q,type:O.IMAGE}])}})}},{name:"格式整理",icon:"word-tool",when:C=>!C.isReadonly,callback:C=>{C.executeWordTool()}}]);const Lr=C=>{new et({title:"数值控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签"},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词"},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值"},{type:"number",label:"最小长度",name:"minLength",placeholder:"默认为1,非必填"},{type:"number",label:"最大长度",name:"maxLength",placeholder:"不限制则留空,非必填"},{type:"number",label:"保留小数位数",name:"decimalPlaces",placeholder:"不填则不校验小数位,非必填"},{type:"number",label:"最小值",name:"minValue",placeholder:"不设置则不校验,非必填"},{type:"number",label:"最大值",name:"maxValue",placeholder:"不设置则不校验,非必填"}],onConfirm:W=>{const Z=W.find(ye=>ye.name==="label")?.value;if(!Z)return;const A=W.find(ye=>ye.name==="placeholder")?.value||Z,q=W.find(ye=>ye.name==="value")?.value||null,k=W.find(ye=>ye.name==="minLength")?.value,ne=W.find(ye=>ye.name==="maxLength")?.value,ue=W.find(ye=>ye.name==="decimalPlaces")?.value,Le=W.find(ye=>ye.name==="minValue")?.value,Se=W.find(ye=>ye.name==="maxValue")?.value,Ce={type:O.CONTROL,value:"",control:{type:C,value:q?[{value:q}]:null,label:Z,placeholder:A,numberExclusiveOptions:{minLength:k?parseInt(k):1,maxLength:ne?parseInt(ne):null,decimalPlaces:ue?parseInt(ue):null,minValue:Le?parseFloat(Le):void 0,maxValue:Se?parseFloat(Se):void 0}}};n.command.executeInsertControl(Ce)}})},Ir=C=>{new et({title:"文本控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签"},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词"},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值"},{type:"select",label:"开启下划线",name:"underline",options:[{label:"不开启",value:"false"},{label:"开启",value:"true"}]}],onConfirm:W=>{const Z=W.find(ue=>ue.name==="label")?.value;if(!Z)return;const A=W.find(ue=>ue.name==="placeholder")?.value||Z,q=W.find(ue=>ue.name==="value")?.value||"",k=W.find(ue=>ue.name==="underline")?.value==="true",ne={type:O.CONTROL,value:"",control:{type:C,value:q?[{value:q}]:null,label:Z,placeholder:A,underline:k}};n.command.executeInsertControl(ne)}})},Pr=C=>{new et({title:"列举控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签"},{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值"},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词"},{type:"radio",label:"值集类型",name:"valueSetType",value:"custom",horizontal:!0,options:[{label:"自定义",value:"custom"},{label:"字典",value:"dictionary"}]},{type:"select",label:"字典类型",name:"dictionaryType",placeholder:"请选择字典类型",visible:!1,visibleWhen:{field:"valueSetType",value:"dictionary"},options:[{label:"请选择字典类型",value:""},...hl()]},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
645
+ [{
646
+ "value":"有",
647
+ "code":"98175"
648
+ }]`,visibleWhen:{field:"valueSetType",value:"custom"}}],onConfirm:W=>{const Z=W.find(Le=>Le.name==="label")?.value;if(!Z)return;const A=W.find(Le=>Le.name==="valueSetType")?.value||"custom",q=W.find(Le=>Le.name==="code")?.value,k=W.find(Le=>Le.name==="placeholder")?.value||Z;let ne=[];if(A==="dictionary"){const Le=W.find(Ce=>Ce.name==="dictionaryType")?.value;if(!Le)return;const Se=ul(Le);if(!Se)return;ne=Se}else{const Le=W.find(Se=>Se.name==="valueSets")?.value;if(!Le)return;ne=JSON.parse(Le)}const ue={type:O.CONTROL,value:"",control:{type:C,code:q,value:null,label:Z,placeholder:k,valueSets:ne,valueSetType:A,dictionaryType:A==="dictionary"?W.find(Le=>Le.name==="dictionaryType")?.value:void 0}};n.command.executeInsertControl(ue)}})},Or=C=>{new et({title:"日期控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签"},{type:"text",label:"提示词",name:"placeholder",placeholder:"请输入提示词"},{type:"text",label:"默认值",name:"value",placeholder:"请输入默认值"},{type:"select",label:"日期格式",name:"dateFormat",value:"yyyy-MM-dd hh:mm:ss",required:!0,options:[{label:"yyyy-MM-dd hh:mm:ss",value:"yyyy-MM-dd hh:mm:ss"},{label:"yyyy-MM-dd",value:"yyyy-MM-dd"}]}],onConfirm:W=>{const Z=W.find(ue=>ue.name==="label")?.value;if(!Z)return;const A=W.find(ue=>ue.name==="placeholder")?.value||Z,q=W.find(ue=>ue.name==="value")?.value||"",k=W.find(ue=>ue.name==="dateFormat")?.value||"",ne={type:O.CONTROL,value:"",control:{type:C,dateFormat:k,value:q?[{value:q}]:null,placeholder:A,label:Z}};n.command.executeInsertControl(ne)}})},Sr=C=>{new et({title:"复选框控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签"},{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值,多个值以英文逗号分割"},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
649
+ [{
650
+ "value":"有",
651
+ "code":"98175"
652
+ }]`}],onConfirm:W=>{const Z=W.find(ne=>ne.name==="label")?.value,A=W.find(ne=>ne.name==="valueSets")?.value;if(!Z||!A)return;const q=W.find(ne=>ne.name==="code")?.value,k={type:O.CONTROL,value:"",control:{type:C,code:q,value:null,label:Z,valueSets:JSON.parse(A)}};n.command.executeInsertControl(k)}})},Ga=()=>{const C=document.createElement("div");C.className="menstrual-history-create-modal",C.setAttribute("editor-component","menstrual-history-create-modal"),C.innerHTML=`
653
+ <div class="menstrual-history-modal__mask"></div>
654
+ <div class="menstrual-history-modal__container">
655
+ <div class="menstrual-history-modal__header">
656
+ <span>添加月经史</span>
657
+ <div class="menstrual-history-modal__close">×</div>
658
+ </div>
659
+ <div class="menstrual-history-modal__content">
660
+ <div class="menopause-options">
661
+ <span class="menopause-label">是否闭经:</span>
662
+ <label class="menopause-radio">
663
+ <input type="radio" name="mh-create-isMenopause" value="false" checked>
664
+ <span>未闭经</span>
665
+ </label>
666
+ <label class="menopause-radio">
667
+ <input type="radio" name="mh-create-isMenopause" value="true">
668
+ <span>已闭经</span>
669
+ </label>
670
+ </div>
671
+
672
+ <div class="menstrual-form" id="mh-create-notMenopause">
673
+ <div class="form-line">
674
+ <span class="text">月经持续</span>
675
+ <input type="number" id="mh-create-periodMin" min="1" max="14">
676
+ <span class="text">~</span>
677
+ <input type="number" id="mh-create-periodMax" min="1" max="14">
678
+ <span class="text">天</span>
679
+ </div>
680
+ <div class="form-line center-line">
681
+ <span class="label">初潮年龄</span>
682
+ <input type="number" id="mh-create-menarcheAge1" min="8" max="20">
683
+ <span class="text">岁</span>
684
+ <span class="divider-long"></span>
685
+ <span class="label">末次日期</span>
686
+ <input type="date" id="mh-create-lastPeriod">
687
+ </div>
688
+ <div class="form-line">
689
+ <span class="text">生理周期持续</span>
690
+ <input type="number" id="mh-create-cycleMin" min="21" max="45">
691
+ <span class="text">~</span>
692
+ <input type="number" id="mh-create-cycleMax" min="21" max="45">
693
+ <span class="text">天</span>
694
+ </div>
695
+ </div>
696
+
697
+ <div class="menstrual-form" id="mh-create-isMenopauseForm" style="display: none;">
698
+ <div class="form-line">
699
+ <span class="text">月经持续</span>
700
+ <input type="number" id="mh-create-periodMin2" min="1" max="14">
701
+ <span class="text">~</span>
702
+ <input type="number" id="mh-create-periodMax2" min="1" max="14">
703
+ <span class="text">天</span>
704
+ </div>
705
+ <div class="form-line center-line">
706
+ <span class="label">初潮年龄</span>
707
+ <input type="number" id="mh-create-menarcheAge2" min="8" max="20">
708
+ <span class="text">岁</span>
709
+ <span class="divider-long"></span>
710
+ <span class="label">闭经年龄</span>
711
+ <input type="number" id="mh-create-menopauseAge" min="40" max="60">
712
+ <span class="text">岁</span>
713
+ </div>
714
+ <div class="form-line">
715
+ <span class="text">生理周期持续</span>
716
+ <input type="number" id="mh-create-cycleMin2" min="21" max="45">
717
+ <span class="text">~</span>
718
+ <input type="number" id="mh-create-cycleMax2" min="21" max="45">
719
+ <span class="text">天</span>
720
+ </div>
721
+ </div>
722
+ </div>
723
+ <div class="menstrual-history-modal__footer">
724
+ <button class="btn-cancel">取消</button>
725
+ <button class="btn-confirm">确认</button>
726
+ </div>
727
+ </div>
728
+ `,document.body.appendChild(C);const W=C.querySelector(".menstrual-history-modal__mask"),Z=C.querySelector(".menstrual-history-modal__container"),A=C.querySelector(".menstrual-history-modal__close"),q=C.querySelector(".btn-cancel"),k=C.querySelector(".btn-confirm"),ne=C.querySelector("#mh-create-notMenopause"),ue=C.querySelector("#mh-create-isMenopauseForm"),Le=C.querySelectorAll('input[name="mh-create-isMenopause"]'),Se=()=>{C.remove()};Z.addEventListener("click",Ce=>{Ce.stopPropagation()}),W.addEventListener("click",Se),A.addEventListener("click",Se),q.addEventListener("click",Se),Le.forEach(Ce=>{Ce.addEventListener("change",()=>{const ye=Ce.value==="true";ne.style.display=ye?"none":"block",ue.style.display=ye?"block":"none"})}),k.addEventListener("click",Ce=>{Ce.preventDefault(),Ce.stopPropagation();const ye=C.querySelector('input[name="mh-create-isMenopause"]:checked')?.value==="true";let nt={};ye?nt={isMenopause:!0,periodMin:C.querySelector("#mh-create-periodMin2")?.value||"",periodMax:C.querySelector("#mh-create-periodMax2")?.value||"",menarcheAge:C.querySelector("#mh-create-menarcheAge2")?.value||"",menopauseAge:C.querySelector("#mh-create-menopauseAge")?.value||"",cycleMin:C.querySelector("#mh-create-cycleMin2")?.value||"",cycleMax:C.querySelector("#mh-create-cycleMax2")?.value||""}:nt={isMenopause:!1,periodMin:C.querySelector("#mh-create-periodMin")?.value||"",periodMax:C.querySelector("#mh-create-periodMax")?.value||"",menarcheAge:C.querySelector("#mh-create-menarcheAge1")?.value||"",lastPeriod:C.querySelector("#mh-create-lastPeriod")?.value||"",cycleMin:C.querySelector("#mh-create-cycleMin")?.value||"",cycleMax:C.querySelector("#mh-create-cycleMax")?.value||""},Se();const Kt={type:O.MENSTRUAL_HISTORY,value:"",menstrualData:nt};console.log(Kt,"创建月经史元素"),n.command.executeInsertElementList([Kt])})},Ja=()=>{const C=document.createElement("div");C.className="fetal-heart-position-edit-modal",C.setAttribute("editor-component","fetal-heart-position-edit-modal"),C.innerHTML=`
729
+ <div class="fetal-heart-position-modal__mask"></div>
730
+ <div class="fetal-heart-position-modal__container">
731
+ <div class="fetal-heart-position-modal__header">
732
+ <span>添加胎心位置</span>
733
+ <div class="fetal-heart-position-modal__close">×</div>
734
+ </div>
735
+ <div class="fetal-heart-position-modal__content">
736
+ <div class="fetal-heart-grid">
737
+ <div class="fetal-heart-row">
738
+ <label class="fetal-heart-checkbox">
739
+ <input type="checkbox" id="fh-create-a">
740
+ <span>肚脐左上方(a)</span>
741
+ </label>
742
+ <label class="fetal-heart-checkbox">
743
+ <input type="checkbox" id="fh-create-b">
744
+ <span>肚脐右上方(b)</span>
745
+ </label>
746
+ </div>
747
+ <div class="fetal-heart-row">
748
+ <label class="fetal-heart-checkbox">
749
+ <input type="checkbox" id="fh-create-c">
750
+ <span>腹壁左方(c)</span>
751
+ </label>
752
+ <label class="fetal-heart-checkbox">
753
+ <input type="checkbox" id="fh-create-d">
754
+ <span>腹壁右方(d)</span>
755
+ </label>
756
+ </div>
757
+ <div class="fetal-heart-row">
758
+ <label class="fetal-heart-checkbox">
759
+ <input type="checkbox" id="fh-create-e">
760
+ <span>肚脐左下方(e)</span>
761
+ </label>
762
+ <label class="fetal-heart-checkbox">
763
+ <input type="checkbox" id="fh-create-f">
764
+ <span>肚脐右下方(f)</span>
765
+ </label>
766
+ </div>
767
+ </div>
768
+ </div>
769
+ <div class="fetal-heart-position-modal__footer">
770
+ <button class="btn-cancel">取消</button>
771
+ <button class="btn-confirm">确认</button>
772
+ </div>
773
+ </div>
774
+ `,document.body.appendChild(C);const W=C.querySelector(".fetal-heart-position-modal__mask"),Z=C.querySelector(".fetal-heart-position-modal__container"),A=C.querySelector(".fetal-heart-position-modal__close"),q=C.querySelector(".btn-cancel"),k=C.querySelector(".btn-confirm"),ne=()=>{C.remove()};Z.addEventListener("click",ue=>{ue.stopPropagation()}),W.addEventListener("click",ne),A.addEventListener("click",ne),q.addEventListener("click",ne),k.addEventListener("click",ue=>{ue.preventDefault(),ue.stopPropagation();const Le={a:C.querySelector("#fh-create-a")?.checked||!1,b:C.querySelector("#fh-create-b")?.checked||!1,c:C.querySelector("#fh-create-c")?.checked||!1,d:C.querySelector("#fh-create-d")?.checked||!1,e:C.querySelector("#fh-create-e")?.checked||!1,f:C.querySelector("#fh-create-f")?.checked||!1};ne();const Se={type:O.FETAL_HEART_POSITION,value:"",fetalHeartData:Le};console.log(Se,"创建胎心位置元素"),n.command.executeInsertElementList([Se])})},Ba=()=>{const C=["La","B","F","M","I","D","L","P"],W=document.createElement("div");W.className="tooth-position-create-modal",W.setAttribute("editor-component","tooth-position-create-modal"),W.innerHTML=`
775
+ <div class="tooth-position-modal__mask"></div>
776
+ <div class="tooth-position-modal__container">
777
+ <div class="tooth-position-modal__header">
778
+ <span>添加牙位图</span>
779
+ <div class="tooth-position-modal__close">×</div>
780
+ </div>
781
+ <div class="tooth-position-modal__content">
782
+ <!-- 快捷选择按钮 -->
783
+ <div class="tooth-quick-buttons">
784
+ <div class="tooth-quick-buttons-left">
785
+ <div class="tooth-quick-buttons-row">
786
+ <button class="tooth-quick-btn" data-action="allPermanent">全口恒牙</button>
787
+ <button class="tooth-quick-btn" data-action="upperPermanent">上半口恒牙</button>
788
+ <button class="tooth-quick-btn" data-action="lowerPermanent">下半口恒牙</button>
789
+ <button class="tooth-quick-btn" data-action="upperLeftPermanent">左上-恒牙</button>
790
+ <button class="tooth-quick-btn" data-action="lowerLeftPermanent">左下-恒牙</button>
791
+ <button class="tooth-quick-btn" data-action="upperRightPermanent">右上-恒牙</button>
792
+ <button class="tooth-quick-btn" data-action="lowerRightPermanent">右下-恒牙</button>
793
+ <button class="tooth-quick-btn tooth-quick-btn--clear" data-action="clear">清除</button>
794
+ </div>
795
+ <div class="tooth-quick-buttons-row">
796
+ <button class="tooth-quick-btn" data-action="allDeciduous">全口乳牙</button>
797
+ <button class="tooth-quick-btn" data-action="upperDeciduous">上半口乳牙</button>
798
+ <button class="tooth-quick-btn" data-action="lowerDeciduous">下半口乳牙</button>
799
+ <button class="tooth-quick-btn" data-action="upperLeftDeciduous">左上-乳牙</button>
800
+ <button class="tooth-quick-btn" data-action="lowerLeftDeciduous">左下-乳牙</button>
801
+ <button class="tooth-quick-btn" data-action="upperRightDeciduous">右上-乳牙</button>
802
+ <button class="tooth-quick-btn" data-action="lowerRightDeciduous">右下-乳牙</button>
803
+ </div>
804
+ </div>
805
+ </div>
806
+
807
+ <div class="tooth-grid-container">
808
+ <!-- 字母行 - 上 -->
809
+ <div class="tooth-grid-letter-row upper-letter-row">
810
+ <div class="tooth-grid-half left">
811
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="E">E</div>
812
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="D">D</div>
813
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="C">C</div>
814
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="B">B</div>
815
+ <div class="tooth-grid-letter-item" data-position="upperLeftLetter" data-value="A">A</div>
816
+ </div>
817
+ <div class="tooth-grid-divider-v"></div>
818
+ <div class="tooth-grid-half right">
819
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="A">A</div>
820
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="B">B</div>
821
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="C">C</div>
822
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="D">D</div>
823
+ <div class="tooth-grid-letter-item" data-position="upperRightLetter" data-value="E">E</div>
824
+ </div>
825
+ </div>
826
+
827
+ <!-- 数字行 - 上颌 -->
828
+ <div class="tooth-grid-number-row upper-number-row">
829
+ <div class="tooth-grid-half left">
830
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="8">8</div>
831
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="7">7</div>
832
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="6">6</div>
833
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="5">5</div>
834
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="4">4</div>
835
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="3">3</div>
836
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="2">2</div>
837
+ <div class="tooth-grid-number-item" data-position="upperLeft" data-value="1">1</div>
838
+ </div>
839
+ <div class="tooth-grid-divider-v"></div>
840
+ <div class="tooth-grid-half right">
841
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="1">1</div>
842
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="2">2</div>
843
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="3">3</div>
844
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="4">4</div>
845
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="5">5</div>
846
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="6">6</div>
847
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="7">7</div>
848
+ <div class="tooth-grid-number-item" data-position="upperRight" data-value="8">8</div>
849
+ </div>
850
+ </div>
851
+
852
+ <!-- 横向分隔线 -->
853
+ <div class="tooth-grid-divider-h">
854
+ <canvas class="tooth-divider-canvas-h" width="900" height="2"></canvas>
855
+ </div>
856
+
857
+ <!-- 数字行 - 下颌 -->
858
+ <div class="tooth-grid-number-row lower-number-row">
859
+ <div class="tooth-grid-half left">
860
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="8">8</div>
861
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="7">7</div>
862
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="6">6</div>
863
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="5">5</div>
864
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="4">4</div>
865
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="3">3</div>
866
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="2">2</div>
867
+ <div class="tooth-grid-number-item" data-position="lowerLeft" data-value="1">1</div>
868
+ </div>
869
+ <div class="tooth-grid-divider-v">
870
+ <canvas class="tooth-divider-canvas-v" width="2" height="110"></canvas>
871
+ </div>
872
+ <div class="tooth-grid-half right">
873
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="1">1</div>
874
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="2">2</div>
875
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="3">3</div>
876
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="4">4</div>
877
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="5">5</div>
878
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="6">6</div>
879
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="7">7</div>
880
+ <div class="tooth-grid-number-item" data-position="lowerRight" data-value="8">8</div>
881
+ </div>
882
+ </div>
883
+
884
+ <!-- 字母行 - 下 -->
885
+ <div class="tooth-grid-letter-row lower-letter-row">
886
+ <div class="tooth-grid-half left">
887
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="E">E</div>
888
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="D">D</div>
889
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="C">C</div>
890
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="B">B</div>
891
+ <div class="tooth-grid-letter-item" data-position="lowerLeftLetter" data-value="A">A</div>
892
+ </div>
893
+ <div class="tooth-grid-divider-v"></div>
894
+ <div class="tooth-grid-half right">
895
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="A">A</div>
896
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="B">B</div>
897
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="C">C</div>
898
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="D">D</div>
899
+ <div class="tooth-grid-letter-item" data-position="lowerRightLetter" data-value="E">E</div>
900
+ </div>
901
+ </div>
902
+ </div>
903
+
904
+ <!-- 预览区域 -->
905
+ <div class="tooth-preview-section">
906
+ <div class="tooth-preview-title">预览</div>
907
+ <div class="tooth-preview-wrapper">
908
+ <div class="tooth-preview-container">
909
+ <div class="tooth-preview-grid">
910
+ <!-- 左上 -->
911
+ <div class="tooth-preview-quadrant tooth-preview-upper-left"></div>
912
+ <!-- 右上 -->
913
+ <div class="tooth-preview-quadrant tooth-preview-upper-right"></div>
914
+ <!-- 左下 -->
915
+ <div class="tooth-preview-quadrant tooth-preview-lower-left"></div>
916
+ <!-- 右下 -->
917
+ <div class="tooth-preview-quadrant tooth-preview-lower-right"></div>
918
+ </div>
919
+ </div>
920
+ <div class="tooth-extra-panel">
921
+ <!-- 牙面 -->
922
+ <div class="tooth-surface-panel">
923
+ <div class="tooth-surface-title">牙面</div>
924
+ <div class="tooth-surface-grid">
925
+ <div class="tooth-surface-row">
926
+ <div class="tooth-surface-item" data-surface="La">La</div>
927
+ <div class="tooth-surface-item" data-surface="B">B</div>
928
+ <div class="tooth-surface-item" data-surface="F">F</div>
929
+ </div>
930
+ <div class="tooth-surface-row">
931
+ <div class="tooth-surface-item" data-surface="M">M</div>
932
+ <div class="tooth-surface-item" data-surface="I">I</div>
933
+ <div class="tooth-surface-item" data-surface="D">D</div>
934
+ </div>
935
+ <div class="tooth-surface-row">
936
+ <div class="tooth-surface-item tooth-surface-item--indent" data-surface="L">L</div>
937
+ <div class="tooth-surface-item" data-surface="P">P</div>
938
+ </div>
939
+ </div>
940
+ </div>
941
+ <!-- 多生牙 -->
942
+ <div class="tooth-supernumerary-panel">
943
+ <div class="tooth-supernumerary-title">多生牙 <span class="tooth-supernumerary-hint">(S为数字上标)</span></div>
944
+ <div class="tooth-supernumerary-grid">
945
+ <div class="tooth-supernumerary-item" data-supernumerary="Si">Si</div>
946
+ <div class="tooth-supernumerary-item" data-supernumerary="iS">iS</div>
947
+ </div>
948
+ </div>
949
+ </div>
950
+ </div>
951
+ </div>
952
+ </div>
953
+ <div class="tooth-position-modal__footer">
954
+ <button class="btn-cancel">取消</button>
955
+ <button class="btn-confirm">确认</button>
956
+ </div>
957
+ </div>
958
+ `,document.body.appendChild(W);let Z=null;const A={},q={},k=()=>{const he=W.querySelector(".tooth-divider-canvas-h");if(he){const fe=he.getContext("2d");fe&&(fe.strokeStyle="#000",fe.lineWidth=2,fe.beginPath(),fe.moveTo(0,1),fe.lineTo(900,1),fe.stroke())}const Fe=W.querySelector(".tooth-divider-canvas-v");if(Fe){const fe=Fe.getContext("2d");fe&&(fe.strokeStyle="#000",fe.lineWidth=2,fe.beginPath(),fe.moveTo(1,0),fe.lineTo(1,110),fe.stroke())}},ne=he=>{const Fe=W.querySelector(".tooth-preview-grid");if(!Fe)return;const fe=(go,xn)=>`${go}-${xn}`,we=(go,xn)=>{const po=fe(go,xn),fo=A[po]||[],_n=C.filter(Ao=>fo.includes(Ao)),Nr=q[po],wi=xn.toString(),Ui=typeof xn=="string"?"tooth-preview-tooth-value tooth-preview-tooth-value--deciduous":"tooth-preview-tooth-value",Zi=_n.length>0?`<sup class="tooth-preview-surface">${_n.join(",")}</sup>`:"";if(Nr){const Ao='<sup class="tooth-preview-supernumerary">S</sup>';return Nr==="Si"?`<span class="tooth-preview-tooth">
959
+ <span class="tooth-preview-tooth-bracket">(</span>
960
+ ${Ao}
961
+ <span class="${Ui}">${wi}</span>
962
+ <span class="tooth-preview-tooth-bracket">)</span>
963
+ ${Zi}
964
+ </span>`:`<span class="tooth-preview-tooth">
965
+ <span class="tooth-preview-tooth-bracket">(</span>
966
+ <span class="${Ui}">${wi}</span>
967
+ ${Ao}
968
+ <span class="tooth-preview-tooth-bracket">)</span>
969
+ ${Zi}
970
+ </span>`}else return`<span class="tooth-preview-tooth">
971
+ <span class="${Ui}">${wi}</span>
972
+ ${Zi}
973
+ </span>`},de=(go,xn,po)=>{const fo=[];return xn.forEach(_n=>fo.push(we(po,_n))),go.forEach(_n=>fo.push(we(po,_n))),fo.join(" ")},It=Fe.querySelector(".tooth-preview-upper-left"),Dt=Fe.querySelector(".tooth-preview-upper-right"),Ro=Fe.querySelector(".tooth-preview-lower-left"),Er=Fe.querySelector(".tooth-preview-lower-right");It&&(It.innerHTML=de(he?.upperLeft||[],he?.upperLeftLetter||[],"upperLeft")),Dt&&(Dt.innerHTML=de(he?.upperRight||[],he?.upperRightLetter||[],"upperRight")),Ro&&(Ro.innerHTML=de(he?.lowerLeft||[],he?.lowerLeftLetter||[],"lowerLeft")),Er&&(Er.innerHTML=de(he?.lowerRight||[],he?.lowerRightLetter||[],"lowerRight"))},ue=()=>{const he={upperLeft:[],upperRight:[],lowerLeft:[],lowerRight:[],upperLeftLetter:[],upperRightLetter:[],lowerLeftLetter:[],lowerRightLetter:[]};return["upperLeft","upperRight","lowerLeft","lowerRight"].forEach(we=>{W.querySelectorAll(`.tooth-grid-number-item[data-position="${we}"].selected`).forEach(It=>{const Dt=parseInt(It.dataset.value||"0");Dt>0&&he[we].push(Dt)})}),["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"].forEach(we=>{W.querySelectorAll(`.tooth-grid-letter-item[data-position="${we}"].selected`).forEach(It=>{const Dt=It.dataset.value;Dt&&he[we].push(Dt)})}),Z&&(he.finallyAdd=Z),Object.keys(A).length>0&&(he.toothSurfaceMap={...A}),Object.keys(q).length>0&&(he.supernumeraryToothMap={...q}),he},Le=()=>{const he=ue();ne(he)},Se=()=>{if(!Z)return;const he=`${Z.position}-${Z.value}`,Fe=A[he]||[];W.querySelectorAll(".tooth-surface-item").forEach(we=>{const de=we.dataset.surface;Fe.includes(de||"")?we.classList.add("selected"):we.classList.remove("selected")});const fe=q[he];W.querySelectorAll(".tooth-supernumerary-item").forEach(we=>{we.dataset.supernumerary===fe?we.classList.add("selected"):we.classList.remove("selected")})};let Ce=null;const ye=()=>{const he=W.querySelectorAll(".tooth-grid-number-item.selected"),Fe=W.querySelectorAll(".tooth-grid-letter-item.selected");return he.length>0&&Fe.length===0?"number":Fe.length>0&&he.length===0?"letter":he.length>0&&Fe.length>0?Ce:null},nt=()=>{const he=W.querySelectorAll(".tooth-grid-letter-row"),Fe=W.querySelectorAll(".tooth-grid-number-row");Ce==="number"?(he.forEach(fe=>fe.classList.add("hidden")),Fe.forEach(fe=>fe.classList.remove("hidden"))):Ce==="letter"?(Fe.forEach(fe=>fe.classList.add("hidden")),he.forEach(fe=>fe.classList.remove("hidden"))):(he.forEach(fe=>fe.classList.remove("hidden")),Fe.forEach(fe=>fe.classList.remove("hidden")))},Kt=he=>{const Fe=we=>{we.forEach(de=>{for(let It=1;It<=8;It++){const Dt=W.querySelector(`.tooth-grid-number-item[data-position="${de}"][data-value="${It}"]`);Dt&&Dt.classList.add("selected")}})},fe=we=>{const de=["A","B","C","D","E"];we.forEach(It=>{de.forEach(Dt=>{const Ro=W.querySelector(`.tooth-grid-letter-item[data-position="${It}"][data-value="${Dt}"]`);Ro&&Ro.classList.add("selected")})})};switch(he){case"allPermanent":Fe(["upperLeft","upperRight","lowerLeft","lowerRight"]);break;case"upperPermanent":Fe(["upperLeft","upperRight"]);break;case"lowerPermanent":Fe(["lowerLeft","lowerRight"]);break;case"upperLeftPermanent":Fe(["upperLeft"]);break;case"lowerLeftPermanent":Fe(["lowerLeft"]);break;case"upperRightPermanent":Fe(["upperRight"]);break;case"lowerRightPermanent":Fe(["lowerRight"]);break;case"allDeciduous":fe(["upperLeftLetter","upperRightLetter","lowerLeftLetter","lowerRightLetter"]);break;case"upperDeciduous":fe(["upperLeftLetter","upperRightLetter"]);break;case"lowerDeciduous":fe(["lowerLeftLetter","lowerRightLetter"]);break;case"upperLeftDeciduous":fe(["upperLeftLetter"]);break;case"lowerLeftDeciduous":fe(["lowerLeftLetter"]);break;case"upperRightDeciduous":fe(["upperRightLetter"]);break;case"lowerRightDeciduous":fe(["lowerRightLetter"]);break}},Hn=()=>{const he=W.querySelectorAll(".tooth-grid-number-item.selected"),Fe=W.querySelectorAll(".tooth-grid-letter-item.selected"),fe=W.querySelectorAll(".tooth-grid-letter-row"),we=W.querySelectorAll(".tooth-grid-number-row");he.length>0&&Fe.length===0?(fe.forEach(de=>de.classList.add("hidden")),we.forEach(de=>de.classList.remove("hidden")),Ce="number"):Fe.length>0&&he.length===0?(we.forEach(de=>de.classList.add("hidden")),fe.forEach(de=>de.classList.remove("hidden")),Ce="letter"):(fe.forEach(de=>de.classList.remove("hidden")),we.forEach(de=>de.classList.remove("hidden")),Ce=null)};W.querySelectorAll(".tooth-quick-btn").forEach(he=>{he.addEventListener("click",()=>{const Fe=he.dataset.action;if(Fe==="clear"){W.querySelectorAll(".tooth-grid-number-item.selected").forEach(de=>de.classList.remove("selected")),W.querySelectorAll(".tooth-grid-letter-item.selected").forEach(de=>de.classList.remove("selected")),W.querySelectorAll(".tooth-quick-btn.selected").forEach(de=>de.classList.remove("selected")),W.querySelectorAll(".tooth-grid-letter-row").forEach(de=>de.classList.remove("hidden")),W.querySelectorAll(".tooth-grid-number-row").forEach(de=>de.classList.remove("hidden")),W.querySelectorAll(".tooth-surface-item.selected").forEach(de=>de.classList.remove("selected")),W.querySelectorAll(".tooth-supernumerary-item.selected").forEach(de=>de.classList.remove("selected")),Z=null,Object.keys(A).forEach(de=>delete A[de]),Object.keys(q).forEach(de=>delete q[de]),Ce=null,Le();return}W.querySelectorAll(".tooth-quick-btn.selected").forEach(de=>{de.dataset.action!=="clear"&&de.classList.remove("selected")}),he.classList.add("selected"),W.querySelectorAll(".tooth-grid-number-item.selected").forEach(de=>de.classList.remove("selected")),W.querySelectorAll(".tooth-grid-letter-item.selected").forEach(de=>de.classList.remove("selected")),Kt(Fe||""),Hn();const fe=W.querySelectorAll(".tooth-grid-number-item.selected"),we=W.querySelectorAll(".tooth-grid-letter-item.selected");if(fe.length>0){const de=fe[fe.length-1];Z={position:de.dataset.position||"",value:de.dataset.value||""}}else if(we.length>0){const de=we[we.length-1];Z={position:de.dataset.position||"",value:de.dataset.value||""}}Se(),Le()})}),W.querySelectorAll(".tooth-grid-number-item").forEach(he=>{he.addEventListener("click",()=>{const Fe=he.dataset.position||"",fe=he.dataset.value||"";if(he.classList.toggle("selected"),he.classList.contains("selected"))Z={position:Fe,value:fe};else if(Z&&Z.position===Fe&&Z.value===fe){const de=W.querySelectorAll(".tooth-grid-number-item.selected");if(de.length>0){const It=de[de.length-1];Z={position:It.dataset.position||"",value:It.dataset.value||""}}else Z=null}const we=ye();Ce=we!==null?we:null,Ce==="number"&&W.querySelectorAll(".tooth-grid-letter-item.selected").forEach(de=>de.classList.remove("selected")),nt(),Se(),Le()})}),W.querySelectorAll(".tooth-grid-letter-item").forEach(he=>{he.addEventListener("click",()=>{const Fe=he.dataset.position||"",fe=he.dataset.value||"";if(he.classList.toggle("selected"),he.classList.contains("selected"))Z={position:Fe,value:fe};else if(Z&&Z.position===Fe&&Z.value===fe){const de=W.querySelectorAll(".tooth-grid-letter-item.selected");if(de.length>0){const It=de[de.length-1];Z={position:It.dataset.position||"",value:It.dataset.value||""}}else Z=null}const we=ye();Ce=we!==null?we:null,Ce==="letter"&&W.querySelectorAll(".tooth-grid-number-item.selected").forEach(de=>de.classList.remove("selected")),nt(),Se(),Le()})}),W.querySelectorAll(".tooth-surface-item").forEach(he=>{he.addEventListener("click",()=>{if(!Z)return;const Fe=he.dataset.surface;if(!Fe)return;const fe=`${Z.position}-${Z.value}`;A[fe]||(A[fe]=[]);const we=A[fe],de=we.indexOf(Fe);de>-1?(we.splice(de,1),he.classList.remove("selected")):(we.push(Fe),he.classList.add("selected")),Le()})}),W.querySelectorAll(".tooth-supernumerary-item").forEach(he=>{he.addEventListener("click",()=>{if(!Z)return;const Fe=he.dataset.supernumerary;if(!Fe)return;const fe=`${Z.position}-${Z.value}`;q[fe]===Fe?(delete q[fe],he.classList.remove("selected")):(W.querySelectorAll(".tooth-supernumerary-item").forEach(we=>we.classList.remove("selected")),q[fe]=Fe,he.classList.add("selected")),Le()})}),k(),ne({});const za=W.querySelector(".tooth-position-modal__mask"),$a=W.querySelector(".tooth-position-modal__container"),qa=W.querySelector(".tooth-position-modal__close"),ja=W.querySelector(".btn-cancel"),ec=W.querySelector(".btn-confirm"),_o=()=>W.remove();$a.addEventListener("click",he=>he.stopPropagation()),za.addEventListener("click",_o),qa.addEventListener("click",_o),ja.addEventListener("click",_o),ec.addEventListener("click",he=>{he.preventDefault(),he.stopPropagation();const Fe=ue();_o();const fe={type:O.TOOTH_POSITION,value:"",toothPositionData:Fe};console.log(fe,"element"),n.command.executeInsertElementList([fe])})},Mr=C=>{new et({title:"单选框控件",data:[{type:"text",label:"标签",required:!0,name:"label",placeholder:"请输入标签"},{type:"text",label:"默认值",name:"code",placeholder:"请输入默认值"},{type:"textarea",label:"值集",name:"valueSets",required:!0,height:100,placeholder:`请输入值集JSON,例:
974
+ [{
975
+ "value":"有",
976
+ "code":"98175"
977
+ }]`}],onConfirm:W=>{const Z=W.find(ne=>ne.name==="valueSets")?.value,A=W.find(ne=>ne.name==="label")?.value;if(!A||!Z)return;const q=W.find(ne=>ne.name==="code")?.value,k={type:O.CONTROL,value:"",control:{type:C,code:q,value:null,label:A,valueSets:JSON.parse(Z)}};n.command.executeInsertControl(k)}})};n.register.shortcutList([{key:Te.P,mod:!0,isGlobal:!0,callback:C=>{C.executePrint()}},{key:Te.F,mod:!0,isGlobal:!0,callback:C=>{const W=C.getRangeText();Zt.click(),W&&(Bt.value=W,n.command.executeSearch(W),bn())}},{key:Te.MINUS,ctrl:!0,isGlobal:!0,callback:C=>{C.executePageScaleMinus()}},{key:Te.EQUAL,ctrl:!0,isGlobal:!0,callback:C=>{C.executePageScaleAdd()}},{key:Te.ZERO,ctrl:!0,isGlobal:!0,callback:C=>{C.executePageScaleRecovery()}}])}});export default RT();