@worm-print-platform/canvas 1.6.1 → 1.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/browser-bundle.d.ts +1 -1
- package/dist/canvas.js +71 -29
- package/dist/core/default-template.d.ts +1 -1
- package/dist/core/element-definitions.d.ts +1 -1
- package/dist/core/format.d.ts +1 -1
- package/dist/core/h.d.ts +1 -1
- package/dist/core/icons.d.ts +1 -1
- package/dist/core/plugin.d.ts +1 -1
- package/dist/core/store.d.ts +1 -1
- package/dist/host-contract.d.ts +1 -1
- package/dist/index.cjs +43 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +44 -2
- package/dist/print-designer.d.ts +1 -1
- package/dist/shell/binding.d.ts +1 -1
- package/dist/shell/canvas.d.ts +1 -1
- package/dist/shell/code.d.ts +1 -1
- package/dist/shell/color-picker.d.ts +1 -1
- package/dist/shell/controls.d.ts +1 -1
- package/dist/shell/crop-anchor.d.ts +1 -1
- package/dist/shell/elements.d.ts +1 -1
- package/dist/shell/expression-editor.d.ts +1 -1
- package/dist/shell/flow-list.d.ts +1 -1
- package/dist/shell/font-select.d.ts +1 -1
- package/dist/shell/format-bar.d.ts +1 -1
- package/dist/shell/help-content/en-US/advanced-settings.d.ts +1 -1
- package/dist/shell/help-content/en-US/changelog.d.ts +1 -1
- package/dist/shell/help-content/en-US/faq.d.ts +1 -1
- package/dist/shell/help-content/en-US/features.d.ts +1 -1
- package/dist/shell/help-content/en-US/getting-started.d.ts +1 -1
- package/dist/shell/help-content/en-US/shortcuts.d.ts +1 -1
- package/dist/shell/help-content/index.d.ts +1 -1
- package/dist/shell/help-content/th-TH/advanced-settings.d.ts +1 -1
- package/dist/shell/help-content/th-TH/changelog.d.ts +1 -1
- package/dist/shell/help-content/th-TH/faq.d.ts +1 -1
- package/dist/shell/help-content/th-TH/features.d.ts +1 -1
- package/dist/shell/help-content/th-TH/getting-started.d.ts +1 -1
- package/dist/shell/help-content/th-TH/shortcuts.d.ts +1 -1
- package/dist/shell/help-content/zh-CN/advanced-settings.d.ts +1 -1
- package/dist/shell/help-content/zh-CN/changelog.d.ts +1 -1
- package/dist/shell/help-content/zh-CN/faq.d.ts +1 -1
- package/dist/shell/help-content/zh-CN/features.d.ts +1 -1
- package/dist/shell/help-content/zh-CN/getting-started.d.ts +1 -1
- package/dist/shell/help-content/zh-CN/shortcuts.d.ts +1 -1
- package/dist/shell/help-modal.d.ts +1 -1
- package/dist/shell/page-extras.d.ts +1 -1
- package/dist/shell/panels.d.ts +1 -1
- package/dist/shell/plugin-ui.d.ts +1 -1
- package/dist/shell/prop-group.d.ts +1 -1
- package/dist/shell/property-panel.d.ts +1 -1
- package/dist/shell/property-search.d.ts +1 -1
- package/dist/shell/ruler.d.ts +1 -1
- package/dist/shell/table-props.d.ts +1 -1
- package/dist/shell/table.d.ts +1 -1
- package/dist/shell/toolbar-overflow.d.ts +1 -1
- package/dist/shell/toolbar.d.ts +1 -1
- package/dist/shell/watermark.d.ts +1 -1
- package/dist/test-setup.d.ts +1 -1
- package/dist/theme-tokens.d.ts +1 -1
- package/dist/version.d.ts +2 -2
- package/dist/vue3/PrintDesigner.d.ts +1 -1
- package/dist/vue3/PrintHtmlPreview.d.ts +1 -1
- package/dist/vue3/index.d.ts +1 -1
- package/dist/vue3/previewStyle.d.ts +1 -1
- package/dist/vue3/toolbarOverflow.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("@worm-print-platform/core/designer"),R=require("@worm-print-platform/core"),Dr=require("@worm-print-platform/core/browser"),gr=require("@worm-print-platform/plugin-kit"),we=require("@worm-print-platform/core/i18n"),pn=require("jsbarcode");function l(e,t={},o=[]){return{tag:e,props:t,children:o}}var Pr="http://www.w3.org/2000/svg",Pa=new Set(["draggable","contenteditable","spellcheck"]),Aa=new Set(["indeterminate"]);function Ma(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="g"}function _a(e){return e instanceof Element&&e.namespaceURI===Pr}function Se(e,t){if(typeof e=="string"){const s=document.createTextNode(e);return t.appendChild(s),s}if(e instanceof Node)return t.appendChild(e),e;const{tag:o,props:r,children:i}=e,n=Ma(o)||_a(t)?document.createElementNS(Pr,o):document.createElement(o);for(const[s,d]of Object.entries(r))if(!(d==null||d===!1))if(s==="class")n.setAttribute("class",String(d));else if(s==="style")typeof d=="string"?n.style.cssText=d:Object.assign(n.style,d);else if(s==="html")n.innerHTML=String(d);else if(s==="text")n.textContent=String(d);else if(s.startsWith("on")&&typeof d=="function")n.addEventListener(s.slice(2).toLowerCase(),d);else if(s==="dataset")for(const[c,u]of Object.entries(d))n.dataset[c]=u;else Aa.has(s)?n[s]=!0:typeof d=="boolean"?d&&n.setAttribute(s,Pa.has(s)?"true":""):n.setAttribute(s,String(d));for(const s of i)Se(s,n);return t.appendChild(n),n}function cn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}var Ra=Pr;function Vt(){return{paperSize:"A4",orientation:"portrait",unit:"mm",margins:{top:10,right:10,bottom:10,left:10},header:{height:10,elements:[]},footer:{height:10,elements:[]},elements:[],watermark:{}}}const Fa="开启拼版后只能有一个设计页面",fi=()=>we.t("store.tilingSinglePage");function Ar(e){const t=(o,r)=>(o??[]).map(i=>{const n={...i.options};return(i.printElementType?.type??i.type)==="table"&&h.syncTableElementSize(n),{id:i.id||h.generateId(),zone:r,options:n,printElementType:{...i.printElementType}}});return{...e,margins:{...e.margins},header:{height:e.header?.height??10,elements:[]},footer:{height:e.footer?.height??10,elements:[]},guides:[...e.guides??[]],elements:[...t(e.elements??[],"content"),...t(e.header?.elements??[],"header"),...t(e.footer?.elements??[],"footer")]}}function hn(e){const t=e.elements,o=r=>t.filter(i=>(i.zone||"content")===r).map(i=>({id:i.id,type:i.printElementType.type,options:{...i.options},printElementType:{...i.printElementType}}));return{unit:"mm",...e,header:{...e.header,elements:o("header")},footer:{...e.footer,elements:o("footer")},elements:o("content"),guides:[...e.guides??[]]}}function gi(e){const t=(r,i)=>{const n=Ar(h.normalizeTemplateUnits(r));return n.name||(n.name=`页面 ${i+1}`),n};if(!e)return[t(Vt(),0)];const o=Array.isArray(e.pages)?e.pages:[e];return o.length?o.map(t):[t(Vt(),0)]}const At=e=>JSON.parse(JSON.stringify(e));class un{scale=100;showRuler=!0;showGrid=!0;snapToGrid=!1;showTableGhostBorder=!0;dirty=!1;pages;activePageIndex=0;fields;selectedIds=new Set;previewIds=new Set;tableSelection=null;draggingIds=new Set;adsorbGuides=[];live=new Map;clipboard=[];moveSessionActive=!1;moveTimer=null;dragBefore=null;undoStack=[];redoStack=[];listeners=new Set;align=h.useAlign();group=h.useGroup();constructor(t={}){if(this.pages=gi(t.initialTemplate),this.fields=t.initialFields??[],t.initialElements?.length){const o=this.pages[0];o.elements=[...o.elements,...t.initialElements]}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(t=!0){t&&(this.dirty=!0);for(const o of[...this.listeners])o()}get templateData(){return this.pages[this.activePageIndex]}set templateData(t){this.pages[this.activePageIndex]=t}get elements(){return this.templateData.elements.map(t=>this.live.get(t.id)??t)}get tilingEnabled(){return this.pages.some(t=>t.tiling?.enabled===!0)}switchPage(t){t<0||t>=this.pages.length||(this.activePageIndex=t,this.resetSelection(),this.emit(!1))}addPage(){if(this.tilingEnabled){window.alert(fi());return}this.recordHistory();const t=this.pages[this.activePageIndex]??Vt();this.pages.push(Ar({...Vt(),paperSize:t.paperSize,orientation:t.orientation,outputRotation:t.outputRotation,customWidth:t.customWidth,customHeight:t.customHeight,name:this.nextDefaultPageName()})),this.switchPage(this.pages.length-1),this.emit()}nextDefaultPageName(){const t=new Set(this.pages.map(r=>r.name));let o=this.pages.length+1;for(;t.has(`页面 ${o}`);)o++;return`页面 ${o}`}duplicatePage(t){if(this.tilingEnabled){window.alert(fi());return}this.recordHistory();const o=At(this.pages[t]);o.name=`${o.name??`页面 ${t+1}`} 副本`,o.elements=o.elements.map(r=>({...r,id:h.generateId()})),this.pages.splice(t+1,0,o),this.switchPage(t+1),this.emit()}deletePage(t){this.pages.length<=1||(this.recordHistory(),this.pages.splice(t,1),this.activePageIndex=Math.max(0,Math.min(this.activePageIndex,this.pages.length-1)),this.resetSelection(),this.emit())}renamePage(t,o){this.recordHistory(),this.pages[t].name=o,this.emit()}movePage(t,o){if(o<0||o>=this.pages.length||t===o)return;this.recordHistory();const[r]=this.pages.splice(t,1);this.pages.splice(o,0,r),this.activePageIndex=o,this.emit()}onSelectionChanged;setSelection(t){this.selectedIds=t,this.onSelectionChanged?.(),this.emit(!1)}select(t){this.setSelection(new Set(t))}selectOne(t,o=!1){if(o){const r=new Set(this.selectedIds);r.has(t)?r.delete(t):r.add(t),this.setSelection(r)}else this.setSelection(new Set([t]))}clearSelection(){this.setSelection(new Set)}selectElement(t,o=!1){if(o){this.selectOne(t,!0);return}this.setSelection(new Set(this.group.getGroupedIds(this.elements,t)))}selectAll(){this.setSelection(new Set(this.elements.map(t=>t.id)))}get selectedElements(){return this.elements.filter(t=>this.selectedIds.has(t.id))}get selectedElement(){const t=this.selectedIds.values().next().value;return t?this.elements.find(o=>o.id===t)??null:null}resetSelection(){this.selectedIds=new Set,this.tableSelection=null,this.onSelectionChanged?.()}setTableSelection(t){this.tableSelection=t,this.emit(!1)}setPreview(t){this.previewIds=t,this.emit(!1)}commitPreview(){this.previewIds=new Set,this.emit(!1)}addGuide(t,o){const r=this.templateData.guides??[];this.templateData.guides=[...r,{id:h.generateId(),type:t,position:Math.round(o*10)/10}],this.emit()}moveGuide(t,o){const r=this.templateData.guides??[];this.templateData.guides=r.map(i=>i.id===t?{...i,position:Math.round(o*10)/10}:i),this.emit(!1)}removeGuide(t){this.templateData.guides=(this.templateData.guides??[]).filter(o=>o.id!==t),this.emit()}addElement(t,o={},r){const i=h.createRuntimeElement(t,o);return r&&!this.placeAtDropPoint(i,r)||(this.recordHistory(),this.templateData.elements.push(i),this.select(new Set([i.id])),this.emit()),i}addFieldElement(t,o={},r,i=!1){const n=i?h.createFieldLabelElement(t):h.createFieldElement(t);return Object.assign(n.options,o),r&&!this.placeAtDropPoint(n,r)||(this.recordHistory(),this.templateData.elements.push(n),this.select(new Set([n.id])),this.emit()),n}placeAtDropPoint(t,o){const r=this.templateData,i=h.zoneFromPaperPoint(r,o.x,o.y);if(i!=="content"&&!h.isZoneAllowedType(t.printElementType.type))return alert("该元素类型不能放入页眉/页脚"),!1;const n=h.getZoneRects(r)[i];return t.zone=i,t.options.left=o.x-n.left,t.options.top=o.y-n.top,i!=="content"&&h.clampToZone(t,n),!0}deleteSelected(){this.selectedIds.size&&(this.recordHistory(),this.templateData.elements=this.templateData.elements.filter(t=>!this.selectedIds.has(t.id)),this.selectedIds=new Set,this.emit())}livePatch(t,o){const r=this.templateData.elements.find(n=>n.id===t);if(!r)return;const i=this.live.get(t)??r;this.live.set(t,{...i,options:{...i.options,...o}})}commitLive(){if(!this.live.size)return;this.recordHistory();const t=this.templateData.elements;for(const[o,r]of this.live){const i=t.find(n=>n.id===o);i&&Object.assign(i.options,r.options)}this.live.clear(),this.emit()}dragIds(t){const o=this.templateData.elements.find(r=>r.id===t);return!o||o.options.locked?[]:Array.from(this.group.getGroupedIds(this.elements,t))}discardLive(){this.live.clear()}dragStart(){this.dragBefore=new Map(this.elements.map(t=>[t.id,this.geoSig(t)]))}dragStop(){const t=this.dragBefore;if(!t)return;this.dragBefore=null;let o=!1;for(const r of this.elements){const i=t.get(r.id);!i||i===this.geoSig(r)||h.finalizeElementZone(r,this.templateData).rejected&&(o=!0)}o&&alert("该元素类型不能放入页眉/页脚"),this.emit()}geoSig(t){return`${t.zone||"content"}:${t.options.left},${t.options.top},${t.options.width},${t.options.height}`}updateElement(t,o,r=!0){r&&this.recordHistory();const i=this.templateData.elements.find(n=>n.id===t);i&&(Object.assign(i.options,o),i.printElementType.type==="table"&&h.syncTableElementSize(i.options),this.emit())}updateTemplateData(t){this.recordHistory(),Object.assign(this.templateData,t);for(const o of["paperSize","customWidth","customHeight"])if(o in t)for(const r of this.pages)Object.assign(r,{[o]:t[o]});this.emit()}moveLayer(t){if(!this.selectedIds.size)return;this.recordHistory();const o=this.templateData.elements,r=o.filter(n=>this.selectedIds.has(n.id)),i=o.filter(n=>!this.selectedIds.has(n.id));if(t==="top")this.templateData.elements=[...i,...r];else if(t==="bottom")this.templateData.elements=[...r,...i];else{const n=o.findIndex(c=>this.selectedIds.has(c.id)),s=t==="up"?n+1:n-1;if(s<0||s>=o.length)return;const d=[...o];[d[n],d[s]]=[d[s],d[n]],this.templateData.elements=d}this.emit()}alignSelected(t){this.selectedIds.size<2||(this.recordHistory(),this.align.align(this.elements.filter(o=>this.selectedIds.has(o.id)),t),this.emit())}groupSelected(){this.selectedIds.size<2||(this.recordHistory(),this.templateData.elements=this.group.group(this.elements,this.selectedIds),this.emit())}ungroupSelected(){this.selectedIds.size&&(this.recordHistory(),this.templateData.elements=this.group.ungroup(this.elements,this.selectedIds),this.emit())}copy(){this.clipboard=At(this.selectedElements),this.emit(!1)}cutSelected(){this.copy(),this.deleteSelected()}paste(t=10){if(!this.clipboard.length)return;this.recordHistory();const o=new Map;for(const n of this.clipboard){const s=n.options.groupId;s&&o.set(s,(o.get(s)??0)+1)}const r=new Map;for(const[n,s]of o)r.set(n,s>=2?h.generateGroupId():void 0);const i=this.templateData.elements;for(const n of this.clipboard){const s=At(n);s.id=h.generateId(),s.options.left+=t,s.options.top+=t,s.options.groupId=s.options.groupId?r.get(s.options.groupId):void 0,i.push(s)}this.emit()}duplicateSelected(){if(this.copy(),!this.clipboard.length)return;this.paste(15);const t=this.templateData.elements;this.selectOne(t[t.length-this.clipboard.length].id)}get hasClipboard(){return this.clipboard.length>0}moveSelected(t,o){const r=this.selectedElements.filter(i=>!i.options.locked);if(r.length){this.moveSessionActive||(this.moveSessionActive=!0,this.recordHistory());for(const i of r)i.options.left+=t,i.options.top+=o;this.moveTimer&&clearTimeout(this.moveTimer),this.moveTimer=setTimeout(()=>{this.moveSessionActive=!1,this.moveTimer=null},300),this.emit()}}cloneElement(t){this.recordHistory(),this.templateData.elements.push(t),this.selectedIds=new Set([t.id]),this.emit()}recordHistory(){this.undoStack.push({pages:At(this.pages),activePageIndex:this.activePageIndex}),this.undoStack.length>100&&this.undoStack.shift(),this.redoStack=[]}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}undo(){const t=this.undoStack.pop();t&&(this.redoStack.push({pages:At(this.pages),activePageIndex:this.activePageIndex}),this.pages=t.pages,this.activePageIndex=Math.min(t.activePageIndex,t.pages.length-1),this.resetSelection(),this.emit())}redo(){const t=this.redoStack.pop();t&&(this.undoStack.push({pages:At(this.pages),activePageIndex:this.activePageIndex}),this.pages=t.pages,this.activePageIndex=Math.min(t.activePageIndex,t.pages.length-1),this.resetSelection(),this.emit())}resetZoom(){this.setScale(100)}setScale(t,o=h.MIN_SCALE_PERCENT){this.scale=Math.max(o,Math.round(t)),this.emit(!1)}getTemplateJson(){const t=this.pages.map(hn),o=t.length===1?t[0]:{version:1,pages:t};return JSON.stringify(o)}loadTemplate(t){this.pages=gi(t),this.activePageIndex=0,this.resetSelection(),this.recordHistory(),this.emit()}get paperSize(){return h.getPaperDimensions(this.templateData)}}const yt=Symbol("mixed"),Xo=new Set(["text","longText"]),Ia=["top","right","bottom","left"],La={on:!0,off:!1,mixed:yt};function mi(e){const t=h.resolveBorderEdgeStates(e),o={};for(const r of Ia)o[r]=La[t[r]];return o}const za=["fontFamily","fontSize","fontWeight","color","textAlign","verticalAlign","textDecoration"];class Oa{constructor(t){this.store=t}store;borderStyle="solid";borderWidth=.75;borderColor="#333333";borderMixed={style:!1,width:!1,color:!1};borderDraftKey="";get borderMixedAny(){return this.borderMixed.style||this.borderMixed.width||this.borderMixed.color}painterActive=!1;painterLocked=!1;painterSource=null;painterSnapshot=null;get selectedElements(){return this.store.elements.filter(t=>this.store.selectedIds.has(t.id)&&!t.options.locked)}get tableElement(){const t=this.store.tableSelection;return t?this.store.elements.find(o=>o.id===t.elementId)??null:null}get context(){return this.store.tableSelection&&this.tableElement?"cells":this.selectedElements.length>0||this.store.selectedIds.size>0?"elements":"none"}get targetCells(){const t=this.store.tableSelection,o=this.tableElement?.options.tableRows;if(!t||!o)return[];const r=[];for(let i=t.r1;i<=t.r2;i++)for(let n=t.c1;n<=t.c2;n++){const s=o[i]?.cells[n];s&&!s.merged&&r.push(s)}return r}get textTargets(){return this.selectedElements.filter(t=>Xo.has(t.printElementType.type))}get fontEditable(){return this.context==="cells"?this.targetCells.length>0:this.context!=="elements"?!1:this.selectedElements.length>0&&this.textTargets.length===this.selectedElements.length}get styleTargets(){return this.context==="cells"?this.targetCells:this.textTargets.map(t=>t.options)}pick(t){if(!t.length)return;const o=t[0];return t.every(r=>r===o)?o:yt}hasToken(t,o){return(t??"").split(/\s+/).includes(o)}get values(){const t=this.styleTargets;if(!t.length)return{fontFamily:void 0,fontSize:void 0,color:void 0,backgroundColor:void 0,textAlign:void 0,verticalAlign:void 0,bold:!1,underline:!1,strike:!1};const o=t.map(i=>i.fontWeight==="bold"||i.fontWeight==="bolder"),r=t.map(i=>i.textDecoration);return{fontFamily:this.pick(t.map(i=>i.fontFamily)),fontSize:this.pick(t.map(i=>i.fontSize)),color:this.pick(t.map(i=>i.color)),backgroundColor:this.pick(t.map(i=>i.backgroundColor)),textAlign:this.pick(t.map(i=>this.context==="cells"?i.align:i.textAlign)),verticalAlign:this.pick(t.map(i=>this.context==="cells"?i.valign:i.verticalAlign)),bold:o.every(Boolean)?!0:o.some(Boolean)?yt:!1,underline:r.map(i=>this.hasToken(i,"underline")).every(Boolean)?!0:r.some(i=>this.hasToken(i,"underline"))?yt:!1,strike:r.map(i=>this.hasToken(i,"line-through")).every(Boolean)?!0:r.some(i=>this.hasToken(i,"line-through"))?yt:!1}}commit(){this.store.recordHistory(),this.store.emit()}writeCells(t){const o=this.targetCells;o.length&&(o.forEach(t),this.commit())}applyStyle(t){if(this.context==="cells"){this.writeCells(d=>{"fontFamily"in t&&(d.fontFamily=t.fontFamily),"fontSize"in t&&(d.fontSize=t.fontSize),"color"in t&&(d.color=t.color),"backgroundColor"in t&&(d.backgroundColor=t.backgroundColor),"textAlign"in t&&(d.align=t.textAlign),"verticalAlign"in t&&(d.valign=t.verticalAlign)});return}const o=this.textTargets,r=this.selectedElements,n=["fontFamily","fontSize","color","textAlign","verticalAlign"].some(d=>d in t),s="backgroundColor"in t;!(o.length&&n)&&!(r.length&&s)||(o.forEach(d=>{const c=d.options;"fontFamily"in t&&(c.fontFamily=t.fontFamily),"fontSize"in t&&(c.fontSize=t.fontSize),"color"in t&&(c.color=t.color),"textAlign"in t&&(c.textAlign=t.textAlign),"verticalAlign"in t&&(c.verticalAlign=t.verticalAlign)}),s&&r.forEach(d=>{d.options.backgroundColor=t.backgroundColor}),this.commit())}toggleBold(){if(this.context==="cells"){const r=this.values.bold!==!0;this.writeCells(i=>{i.fontWeight=r?"bold":void 0});return}const t=this.values.bold!==!0,o=this.textTargets;o.length&&(o.forEach(r=>{r.options.fontWeight=t?"bold":"normal"}),this.commit())}toggleDecoration(t){if(this.context==="cells")return;const o=this.textTargets;if(!o.length)return;const r=this.values[t==="underline"?"underline":"strike"]!==!0;o.forEach(i=>{const n=(i.options.textDecoration??"").split(/\s+/).filter(Boolean),s=n.indexOf(t);r&&s<0&&n.push(t),!r&&s>=0&&n.splice(s,1),i.options.textDecoration=n.length?n.join(" "):void 0}),this.commit()}toggleUnderline(){this.toggleDecoration("underline")}toggleStrike(){this.toggleDecoration("line-through")}syncBorderDraft(){if(this.context!=="cells"){this.borderDraftKey&&(this.borderDraftKey="",this.borderStyle="solid",this.borderWidth=.75,this.borderColor="#333333",this.borderMixed={style:!1,width:!1,color:!1});return}const t=this.store.tableSelection,o=this.tableElement?.options.tableRows;if(!t||!o)return;const r=`cells:${t.elementId}:${t.r1}:${t.c1}:${t.r2}:${t.c2}`;if(r===this.borderDraftKey)return;if(this.borderDraftKey=r,h.resolveCellGroupMode(o,t).mode==="multi"){this.borderStyle="solid",this.borderWidth=.75,this.borderColor="#333333",this.borderMixed={style:!1,width:!1,color:!1};return}const i=h.resolveCellBorderDisplay(o,t);if(i.style===void 0&&i.width===void 0&&i.color===void 0){this.borderMixed={style:!1,width:!1,color:!1},this.borderStyle=null,this.borderWidth=0,this.borderColor="#333333";return}this.borderMixed={style:i.style==="mixed",width:i.width==="mixed",color:i.color==="mixed"},this.borderMixed.style?this.borderStyle=null:i.style===void 0?this.borderStyle="solid":i.style==="none"?this.borderStyle=null:this.borderStyle=i.style,this.borderWidth=this.borderMixed.width?void 0:typeof i.width=="number"?i.width:.75,this.borderColor=this.borderMixed.color?void 0:typeof i.color=="string"?i.color:"#333333"}borderSpec(){const t=this.borderStyle??(this.borderMixed.style?"solid":"none");return{width:this.borderWidth??.75,style:t,color:this.borderColor??"#333333"}}setBorderWidth(t){this.borderWidth=t,this.borderMixed.width=!1}setBorderColor(t){this.borderColor=t,this.borderMixed.color=!1}settleBorderDraft(){this.context==="cells"&&(this.borderMixed.style&&(this.borderStyle="solid",this.borderMixed.style=!1),this.borderMixed.width&&(this.borderWidth=.75,this.borderMixed.width=!1),this.borderMixed.color&&(this.borderColor="#333333",this.borderMixed.color=!1))}toggleBorderStyle(t){const o=this.borderStyle===t?null:t;this.borderMixed.style=!1,this.borderStyle=o,o===null?this.borderWidth=0:this.borderWidth===0&&(this.borderWidth=.75)}applyElementBorder(t,o){const r=this.selectedElements;r.length&&(r.forEach(i=>{h.applyElementBorderPreset(i.options,t,o)}),this.commit())}applyCellBorderPreset(t,o){const r=this.store.tableSelection,i=this.tableElement?.options.tableRows;!r||!i||(h.applyBorderPreset(i,{r1:r.r1,c1:r.c1,r2:r.r2,c2:r.c2},t,o),this.commit())}applyCellBorderEdges(t,o,r){this.writeCells(i=>{for(const n of t)h.setCellBorderEdge(i,n,r?o:null)})}get cellEdges(){if(this.context!=="cells")return null;const t=this.targetCells;return t.length?mi(t.map(o=>o.borders)):null}toggleCellEdge(t,o){const r=this.cellEdges?.[t]!==!0;this.applyCellBorderEdges([t],o,r)}get elementEdges(){if(this.context!=="elements")return null;const t=this.selectedElements;return t.length?mi(t.map(o=>h.elementVisibleBorders(o.options))):null}toggleElementEdge(t,o){const r=this.selectedElements;if(!r.length)return;const i=this.elementEdges?.[t]!==!0;r.forEach(n=>h.setElementBorderEdgeVisible(n.options,t,i,o)),this.commit()}applyBorderPreset(t){const o=this.borderStyle===null;if(this.context==="cells"){const r=o&&!this.borderMixed.style;this.applyCellBorderPreset(r?"none":t,this.borderSpec()),this.settleBorderDraft()}else this.applyElementBorder(o||t==="none"?"none":"all",this.borderSpec())}applyEdge(t){if(this.borderStyle===null&&!this.borderMixed.style){this.context==="cells"?(this.applyCellBorderEdges([t],this.borderSpec(),!1),this.settleBorderDraft()):this.clearElementEdge(t);return}this.context==="cells"?(this.toggleCellEdge(t,this.borderSpec()),this.settleBorderDraft()):this.toggleElementEdge(t,this.borderSpec())}clearElementEdge(t){const o=this.selectedElements;o.length&&(o.forEach(r=>h.setElementBorderEdgeVisible(r.options,t,!1)),this.commit())}edgeOn(t){return(this.context==="cells"?this.cellEdges:this.elementEdges)?.[t]===!0}get painterCapturable(){return this.selectedElements.length===1}clonePainterBorders(t){if(!t)return;const o={};for(const r of h.ELEMENT_BORDER_SIDES){const i=t[r];i&&(o[r]={...i})}return o}pickPainterSource(t=!1){const o=this.selectedElements[0];if(!o)return!1;const r=o.options,i=o.printElementType.type;return this.painterSnapshot={text:Xo.has(i)?Object.fromEntries(za.map(n=>[n,r[n]])):null,backgroundColor:r.backgroundColor,border:h.acceptsElementBorder(i)?{borderWidth:r.borderWidth,borderStyle:r.borderStyle,borderColor:r.borderColor,borders:this.clonePainterBorders(r.borders)}:null},this.painterSource=o.id,this.painterActive=!0,this.painterLocked=t,!0}cancelPainter(){this.painterActive=!1,this.painterLocked=!1,this.painterSource=null,this.painterSnapshot=null}applyPainter(t){const o=this.painterSnapshot;if(!o||t.options.locked||t.id===this.painterSource)return!1;const r=t.options,i=t.printElementType.type;return o.text&&Xo.has(i)&&Object.assign(r,o.text),r.backgroundColor=o.backgroundColor,o.border&&h.acceptsElementBorder(i)&&(r.borderWidth=o.border.borderWidth,r.borderStyle=o.border.borderStyle,r.borderColor=o.border.borderColor,r.borders=this.clonePainterBorders(o.border.borders)),!0}painterSyncSelection(){if(!this.painterActive||!this.painterSnapshot)return;const t=this.selectedElements;if(!t.length){this.cancelPainter();return}let o=!1;t.forEach(r=>{o=this.applyPainter(r)||o}),o&&(this.commit(),this.painterLocked||this.cancelPainter())}handlePainterKeydown(t){if(t.key!=="Escape"||!this.painterActive)return;const o=t.target?.tagName;o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||this.cancelPainter()}}const Na={AlignCenterHorizontal:'<path d="M2 12h20" /><path d="M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4" /><path d="M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4" /><path d="M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1" /><path d="M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1" />',AlignCenterVertical:'<path d="M12 2v20" /><path d="M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4" /><path d="M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4" /><path d="M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1" /><path d="M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1" />',AlignEndHorizontal:'<rect width="6" height="16" x="4" y="2" rx="2" /><rect width="6" height="9" x="14" y="9" rx="2" /><path d="M22 22H2" />',AlignEndVertical:'<rect width="16" height="6" x="2" y="4" rx="2" /><rect width="9" height="6" x="9" y="14" rx="2" /><path d="M22 22V2" />',AlignHorizontalSpaceBetween:'<rect width="6" height="14" x="3" y="5" rx="2" /><rect width="6" height="10" x="15" y="7" rx="2" /><path d="M3 2v20" /><path d="M21 2v20" />',AlignStartHorizontal:'<rect width="6" height="16" x="4" y="6" rx="2" /><rect width="6" height="9" x="14" y="6" rx="2" /><path d="M22 2H2" />',AlignStartVertical:'<rect width="9" height="6" x="6" y="14" rx="2" /><rect width="16" height="6" x="6" y="4" rx="2" /><path d="M2 2v20" />',AlignVerticalSpaceBetween:'<rect width="14" height="6" x="5" y="15" rx="2" /><rect width="10" height="6" x="7" y="3" rx="2" /><path d="M2 21h20" /><path d="M2 3h20" />',ArrowDown:'<path d="M12 5v14" /><path d="m19 12-7 7-7-7" />',ArrowDownToLine:'<path d="M12 17V3" /><path d="m6 11 6 6 6-6" /><path d="M19 21H5" />',ArrowUp:'<path d="m5 12 7-7 7 7" /><path d="M12 19V5" />',ArrowUpToLine:'<path d="M5 3h14" /><path d="m18 13-6-6-6 6" /><path d="M12 7v14" />',Barcode:'<path d="M3 5v14" /><path d="M8 5v14" /><path d="M12 5v14" /><path d="M17 5v14" /><path d="M21 5v14" />',Bold:'<path d="M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" />',ChartArea:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z" />',ChartBar:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M7 16h8" /><path d="M7 11h12" /><path d="M7 6h3" />',ChartColumn:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M18 17V9" /><path d="M13 17V5" /><path d="M8 17v-3" />',ChartLine:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="m19 9-5 5-4-4-3 3" />',ChartPie:'<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /><path d="M21.21 15.89A10 10 0 1 1 8 2.83" />',ChartScatter:'<circle cx="7.5" cy="7.5" r=".5" fill="currentColor" /><circle cx="18.5" cy="5.5" r=".5" fill="currentColor" /><circle cx="11.5" cy="11.5" r=".5" fill="currentColor" /><circle cx="7.5" cy="16.5" r=".5" fill="currentColor" /><circle cx="17.5" cy="14.5" r=".5" fill="currentColor" /><path d="M3 3v16a2 2 0 0 0 2 2h16" />',Check:'<path d="M20 6 9 17l-5-5" />',ChevronDown:'<path d="m6 9 6 6 6-6" />',ChevronsLeft:'<path d="m11 17-5-5 5-5" /><path d="m18 17-5-5 5-5" />',ChevronsRight:'<path d="m6 17 5-5-5-5" /><path d="m13 17 5-5-5-5" />',ChevronsUpDown:'<path d="m7 15 5 5 5-5" /><path d="m7 9 5-5 5 5" />',Circle:'<circle cx="12" cy="12" r="10" />',ClipboardPaste:'<path d="M11 14h10" /><path d="M16 4h2a2 2 0 0 1 2 2v1.344" /><path d="m17 18 4-4-4-4" /><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113" /><rect x="8" y="2" width="8" height="4" rx="1" />',Code:'<path d="m16 18 6-6-6-6" /><path d="m8 6-6 6 6 6" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />',Donut:'<path d="M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3" /><circle cx="12" cy="12" r="3" />',Ellipsis:'<circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" /><circle cx="5" cy="12" r="1" />',Eye:'<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" /><circle cx="12" cy="12" r="3" />',FileText:'<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /><path d="M14 2v5a1 1 0 0 0 1 1h5" /><path d="M10 9H8" /><path d="M16 13H8" /><path d="M16 17H8" />',Funnel:'<path d="M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" />',Gauge:'<path d="m12 14 4-4" /><path d="M3.34 19a10 10 0 1 1 17.32 0" />',Grid3x3:'<rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" /><path d="M3 15h18" /><path d="M9 3v18" /><path d="M15 3v18" />',Group:'<path d="M3 7V5c0-1.1.9-2 2-2h2" /><path d="M17 3h2c1.1 0 2 .9 2 2v2" /><path d="M21 17v2c0 1.1-.9 2-2 2h-2" /><path d="M7 21H5c-1.1 0-2-.9-2-2v-2" /><rect width="7" height="5" x="7" y="7" rx="1" /><rect width="7" height="5" x="10" y="12" rx="1" />',Image:'<rect width="18" height="18" x="3" y="3" rx="2" ry="2" /><circle cx="9" cy="9" r="2" /><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />',Layers:'<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z" /><path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12" /><path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17" />',List:'<path d="M3 5h.01" /><path d="M3 12h.01" /><path d="M3 19h.01" /><path d="M8 5h13" /><path d="M8 12h13" /><path d="M8 19h13" />',ListTree:'<path d="M8 5h13" /><path d="M13 12h8" /><path d="M13 19h8" /><path d="M3 10a2 2 0 0 0 2 2h3" /><path d="M3 5v12a2 2 0 0 0 2 2h3" />',Maximize:'<path d="M8 3H5a2 2 0 0 0-2 2v3" /><path d="M21 8V5a2 2 0 0 0-2-2h-3" /><path d="M3 16v3a2 2 0 0 0 2 2h3" /><path d="M16 21h3a2 2 0 0 0 2-2v-3" />',Minus:'<path d="M5 12h14" />',PaintBucket:'<path d="M11 7 6 2" /><path d="M18.992 12H2.041" /><path d="M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595" /><path d="m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33" />',Paintbrush:'<path d="m14.622 17.897-10.68-2.913" /><path d="M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z" /><path d="M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15" />',QrCode:'<rect width="5" height="5" x="3" y="3" rx="1" /><rect width="5" height="5" x="16" y="3" rx="1" /><rect width="5" height="5" x="3" y="16" rx="1" /><path d="M21 16h-3a2 2 0 0 0-2 2v3" /><path d="M21 21v.01" /><path d="M12 7v3a2 2 0 0 1-2 2H7" /><path d="M3 12h.01" /><path d="M12 3h.01" /><path d="M12 16v.01" /><path d="M16 12h1" /><path d="M21 12v.01" /><path d="M12 21v-1" />',Radar:'<path d="M19.07 4.93A10 10 0 0 0 6.99 3.34" /><path d="M4 6h.01" /><path d="M2.29 9.62A10 10 0 1 0 21.31 8.35" /><path d="M16.24 7.76A6 6 0 1 0 8.23 16.67" /><path d="M12 18h.01" /><path d="M17.99 11.66A6 6 0 0 1 15.77 16.67" /><circle cx="12" cy="12" r="2" /><path d="m13.41 10.59 5.66-5.66" />',Redo2:'<path d="m15 14 5-5-5-5" /><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" />',RotateCcw:'<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" />',SeparatorVertical:'<path d="M12 3v18" /><path d="m16 16 4-4-4-4" /><path d="m8 8-4 4 4 4" />',Shapes:'<path d="M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z" /><rect x="3" y="14" width="7" height="7" rx="1" /><circle cx="17.5" cy="17.5" r="3.5" />',Square:'<rect width="18" height="18" x="3" y="3" rx="2" />',Strikethrough:'<path d="M16 4H9a3 3 0 0 0-2.83 4" /><path d="M14 12a4 4 0 0 1 0 8H6" /><line x1="4" x2="20" y1="12" y2="12" />',Table:'<path d="M12 3v18" /><rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" /><path d="M3 15h18" />',Table2:'<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18" />',TextAlignCenter:'<path d="M21 5H3" /><path d="M17 12H7" /><path d="M19 19H5" />',TextAlignEnd:'<path d="M21 5H3" /><path d="M21 12H9" /><path d="M21 19H7" />',TextAlignJustify:'<path d="M3 5h18" /><path d="M3 12h18" /><path d="M3 19h18" />',TextAlignStart:'<path d="M21 5H3" /><path d="M15 12H3" /><path d="M17 19H3" />',Trash2:'<path d="M10 11v6" /><path d="M14 11v6" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /><path d="M3 6h18" /><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />',Type:'<path d="M12 4v16" /><path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" /><path d="M9 20h6" />',Underline:'<path d="M6 4v6a6 6 0 0 0 12 0V4" /><line x1="4" x2="20" y1="20" y2="20" />',Undo2:'<path d="M9 14 4 9l5-5" /><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11" />',Ungroup:'<rect width="8" height="6" x="5" y="4" rx="1" /><rect width="8" height="6" x="11" y="14" rx="1" />',ZoomIn:'<circle cx="11" cy="11" r="8" /><line x1="21" x2="16.65" y1="21" y2="16.65" /><line x1="11" x2="11" y1="8" y2="14" /><line x1="8" x2="14" y1="11" y2="11" />',ZoomOut:'<circle cx="11" cy="11" r="8" /><line x1="21" x2="16.65" y1="21" y2="16.65" /><line x1="8" x2="14" y1="11" y2="11" />'};function ge(e,t=15,o){const r=Na[e];return r?`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}"${o?` class="${o}"`:""} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${r}</svg>`:""}var vt=null;function Mr(e){const t=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;const o=t[1],r=o.length===3?o.split("").map(i=>i+i).join(""):o;return{r:Number.parseInt(r.slice(0,2),16),g:Number.parseInt(r.slice(2,4),16),b:Number.parseInt(r.slice(4,6),16)}}function _r(e){const t=Mr(e);return t?fn(t):"#000000"}function fn({r:e,g:t,b:o}){return`#${[e,t,o].map(r=>Math.round(Gt(r/255)*255).toString(16).padStart(2,"0")).join("")}`}function Ba(e,t,o){const r=e/255,i=t/255,n=o/255,s=Math.max(r,i,n),d=Math.min(r,i,n),c=s-d;let u=0;return c!==0&&(s===r?u=(i-n)/c%6:s===i?u=(n-r)/c+2:u=(r-i)/c+4,u*=60,u<0&&(u+=360)),{h:u,s:s===0?0:c/s,v:s}}function Ua(e,t,o){const r=o*t,i=(e%360+360)%360/60,n=r*(1-Math.abs(i%2-1)),[s,d,c]=i<1?[r,n,0]:i<2?[n,r,0]:i<3?[0,r,n]:i<4?[0,n,r]:i<5?[n,0,r]:[r,0,n],u=o-r;return{r:(s+u)*255,g:(d+u)*255,b:(c+u)*255}}function Ha(e){return((Number.isFinite(e)?e:0)%360+360)%360}function Gt(e){return Math.min(1,Math.max(0,Number.isFinite(e)?e:0))}function $a(e){const t=e.translator??we.t,o=e.title??t("colorPicker.pickColor");return l("button",{type:"button",class:`preset-color-trigger${e.triggerClass?` ${e.triggerClass}`:""}`,"aria-expanded":"false","aria-haspopup":"dialog",title:o,onClick:r=>{const i=r.currentTarget??r.target,n=i.getRootNode();if(!!vt&&vt.root===n&&vt.title===o&&vt.trigger===i){Kt();return}Kt(),Wa(i,e,t)}},[l("span",{class:"preset-color-swatch",style:e.value?{background:e.value}:{background:"transparent"}})])}function Kt(){const e=vt;e&&(vt=null,e.teardowns.forEach(t=>t()),e.trigger.setAttribute("aria-expanded","false"),e.panel.remove())}function Wa(e,t,o){const r=e.getRootNode(),i=r instanceof ShadowRoot?r:document.body,n={root:r,title:t.title??o("colorPicker.pickColor"),trigger:e,panel:null,clearable:t.clearable!==!1,onChange:t.onChange,model:t.value||void 0,hue:0,saturation:0,value_:0,hexText:"",dragging:!1,current:null,hex:null,area:null,handle:null,hueRange:null,clearBtn:null,translator:o,items:[],teardowns:[]};t.value&&Fr(n,t.value)?n.hexText=_r(t.value).toUpperCase():n.hexText=t.value?String(t.value):"",n.panel=Se(qa(n),i),n.current=n.panel.querySelector(".picker-current"),n.hex=n.panel.querySelector(".picker-hex"),n.area=n.panel.querySelector(".picker-area"),n.handle=n.panel.querySelector(".picker-handle"),n.hueRange=n.panel.querySelector(".picker-hue"),n.clearBtn=n.panel.querySelector(".picker-clear"),n.items=Array.from(n.panel.querySelectorAll(".preset-color-item")).map((s,d)=>({el:s,color:h.PRESET_COLORS[d]})),vo(n),Ka(n),Va(n),vt=n,e.setAttribute("aria-expanded","true")}function Ka(e){const t=e.trigger.getBoundingClientRect(),o=190,r=e.panel.offsetHeight||216,i=8,n=Math.max(i,Math.min(t.left,window.innerWidth-o-i)),s=t.bottom+6,d=s+r>window.innerHeight-i?Math.max(i,t.top-r-6):s;e.panel.style.left=`${n}px`,e.panel.style.top=`${d}px`}function Va(e){const t=i=>{const n=Ga(i);n.includes(e.trigger)||n.includes(e.panel)||Kt()},o=i=>{i.key==="Escape"&&Kt()},r=()=>Kt();document.addEventListener("pointerdown",t,!0),document.addEventListener("keydown",o),window.addEventListener("scroll",r,!0),window.addEventListener("resize",r),e.root.addEventListener("scroll",r,!0),e.teardowns.push(()=>document.removeEventListener("pointerdown",t,!0),()=>document.removeEventListener("keydown",o),()=>window.removeEventListener("scroll",r,!0),()=>window.removeEventListener("resize",r),()=>e.root.removeEventListener("scroll",r,!0))}function Ga(e){const t=typeof e.composedPath=="function"?e.composedPath():[];return t.length?t:[e.target]}function qa(e){const t=e.translator;return l("div",{class:"preset-color-panel",role:"dialog","aria-label":t("colorPicker.pickColor"),style:{position:"fixed"},onPointerdown:o=>o.stopPropagation()},[l("div",{class:"picker-preview"},[l("span",{class:"picker-current"}),l("input",{class:"picker-hex",type:"text",maxlength:7,spellcheck:"false","aria-label":t("colorPicker.hexValue"),onInput:o=>ja(e,o.target.value)})]),l("div",{class:"picker-area","aria-label":t("colorPicker.customColor"),tabindex:0,onPointerdown:o=>Xa(e,o),onKeydown:o=>Za(e,o)},[l("span",{class:"picker-handle"})]),l("input",{class:"picker-hue",type:"range",min:0,max:360,step:1,"aria-label":t("colorPicker.hue"),onInput:o=>Qa(e,Number(o.target.value)),onChange:()=>Ir(e)}),l("div",{class:"picker-heading"},[l("span",{text:t("colorPicker.commonColors")}),e.clearable?l("button",{type:"button",class:"picker-clear",title:t("colorPicker.clear"),onClick:()=>uo(e,void 0)},[l("svg",{viewBox:"0 0 16 16",width:12,height:12,"aria-hidden":"true"},[l("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round",fill:"none"})]),t("colorPicker.clearShort")]):""].filter(Boolean)),l("div",{class:"preset-color-grid"},h.PRESET_COLORS.map(o=>l("button",{type:"button",class:"preset-color-item",style:{background:o},title:o,"aria-label":o,onClick:()=>Ya(e,o)})))])}function Rr(e){return fn(Ua(e.hue,e.saturation,e.value_))}function vo(e){const t=Rr(e);e.hex.value!==e.hexText&&(e.hex.value=e.hexText),e.current.className=e.model?"picker-current":"picker-current is-empty",e.model?e.current.style.background=t:e.current.style.removeProperty("background"),e.area.style.setProperty("--picker-hue",`${Math.round(e.hue)}deg`),e.handle.style.left=`${e.saturation*100}%`,e.handle.style.top=`${(1-e.value_)*100}%`,e.handle.style.background=t;const o=String(Math.round(e.hue));e.hueRange.value!==o&&(e.hueRange.value=o),e.clearBtn&&(e.clearBtn.disabled=!e.model);for(const r of e.items)r.el.className=e.model&&r.color.toLowerCase()===e.model.toLowerCase()?"preset-color-item active":"preset-color-item"}function Fr(e,t){const o=Mr(t);if(!o)return!1;const r=Ba(o.r,o.g,o.b);return e.hue=r.h,e.saturation=r.s,e.value_=r.v,e.hexText=_r(t).toUpperCase(),!0}function Rt(e,t,o,r){e.hue=Ha(t),e.saturation=Gt(o),e.value_=Gt(r),e.hexText=Rr(e).toUpperCase(),vo(e)}function Ir(e){const t=Rr(e);e.model=t,vo(e),e.onChange(t)}function uo(e,t){e.model=t,t||(e.hexText=""),vo(e),e.onChange(t)}function Ya(e,t){Fr(e,t),uo(e,t)}function ja(e,t){const o=t.trim();if(!o){e.clearable&&uo(e,void 0);return}Mr(o)&&(Fr(e,o),uo(e,_r(o)))}function Xa(e,t){e.dragging=!0,bi(e,t);const o=i=>{e.dragging&&bi(e,i)},r=()=>{e.dragging&&(e.dragging=!1,document.removeEventListener("pointermove",o),document.removeEventListener("pointerup",r),document.removeEventListener("pointercancel",r),Ir(e))};document.addEventListener("pointermove",o),document.addEventListener("pointerup",r),document.addEventListener("pointercancel",r)}function bi(e,t){const o=e.area.getBoundingClientRect();if(!o.width||!o.height)return;const r=Gt((t.clientX-o.left)/o.width),i=Gt(1-(t.clientY-o.top)/o.height);Rt(e,e.hue,r,i)}function Za(e,t){const o=t.shiftKey?.1:.02;let r=!0;t.key==="ArrowLeft"?Rt(e,e.hue,e.saturation-o,e.value_):t.key==="ArrowRight"?Rt(e,e.hue,e.saturation+o,e.value_):t.key==="ArrowUp"?Rt(e,e.hue,e.saturation,e.value_+o):t.key==="ArrowDown"?Rt(e,e.hue,e.saturation,e.value_-o):r=!1,r&&(t.preventDefault(),Ir(e))}function Qa(e,t){Rt(e,t,e.saturation,e.value_)}function a(e,t,o){return e.t?e.t(t,o):we.t(t,o)}let Ft=null;function Ja(e,t){const o=Ft;Ft=e;try{t()}finally{Ft=o}}function N(e,t){return Ft?Ft(e,t):we.t(e,t)}function ne(e,t,o,r){return l("button",{class:`tb-btn tb-icon${r.on?" on":""}${r.danger?" danger":""}`,type:"button",disabled:!!r.disabled,dataset:{tip:r.tip,...r.test?{test:r.test}:{}},onClick:()=>e.fire(o,r.arg),html:ge(t)})}function fo(e,t,o,r){const i=e.state.openDd===t,n=()=>{e.state.openDd=i?null:t,e.repaint()};return l("div",{class:"tb-dd"},[l("button",{type:"button",class:`tb-dd-trigger${i?" on":""}`,disabled:!!o.disabled,dataset:{test:o.testId??t,tip:o.tip},onClick:n,html:`${o.icon?ge(o.icon):""}${o.text?`<span class="${o.textClass??"tb-btn-text"}">${o.text}</span>`:""}${ge("ChevronDown",12,`tb-dd-arrow${i?" up":""}`)}`}),i?l("div",{class:`tb-dd-panel${o.panelClass?` ${o.panelClass}`:""}`},r):""].filter(Boolean))}function H(e){const t=e.step??1,o=String(t),r=o.indexOf("."),i=r===-1?0:o.length-r-1,n=b=>Number.isFinite(b)?Number(b.toFixed(i)):0,s=b=>{let m=n(b);return e.min!==void 0&&m<e.min&&(m=e.min),e.max!==void 0&&m>e.max&&(m=e.max),m},d=e.value===void 0||e.value===null||!Number.isFinite(e.value)?void 0:n(e.value),c=d??e.min??0,u=b=>{b!==d&&e.onCommit(b)},f=l("input",{class:"pd-input pd-step-input",type:"number",value:d===void 0?"":String(d),min:e.min,max:e.max,step:t,placeholder:e.placeholder,disabled:!!e.disabled,onChange:b=>{const m=b.target,E=(m.value??"").trim();if(E===""){d!==void 0&&(m.value=String(d));return}const y=Number(E);if(!Number.isFinite(y)){m.value=d===void 0?"":String(d);return}const C=s(y);m.value=String(C),u(C)}});return l("div",{class:"pd-stepper"},[l("button",{type:"button",class:"pd-step-btn pd-step-minus",disabled:!!e.disabled||c<=(e.min??-1/0),title:N("controls.k28"),"aria-label":N("controls.k29"),text:"−",onClick:()=>u(s(c-t))}),f,l("button",{type:"button",class:"pd-step-btn pd-step-plus",disabled:!!e.disabled||c>=(e.max??1/0),title:N("controls.k30"),"aria-label":N("controls.k31"),text:"+",onClick:()=>u(s(c+t))})])}function q(e,t,o,r){return l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:e}),r??""]),t,o?l("p",{class:"pd-hint",text:o}):""].filter(Boolean))}const mr=e=>l("button",{class:"pd-help",type:"button","data-tip":e,"aria-label":N("controls.k32")});function xe(e,t,o,r){return l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t"},[e,mr(o)]),r??""]),t])}function kt(e){const t=e.base?.[e.propKey],o=e.target?.[e.propKey]!==t,r=e.force===!0||o,i=e.tipOverride??(e.tipValue===void 0?N("controls.k33"):N("controls.k34",{v0:e.tipValue,v1:e.tipUnit?" "+e.tipUnit:""})),n=e.force?N("controls.k35",{v0:i}):i;return l("button",{type:"button",class:`pd-reset-btn${o&&!e.force?" is-dirty":""}`,"data-tip":n,"aria-label":n,html:ge("RotateCcw",13),onClick:()=>{r&&(e.write?e.write(t):e.target[e.propKey]=t,e.onReset?.())}})}const Ge=e=>l("h3",{class:"pd-divider",text:e});function Ae(e,t,o=N("controls.k36"),r){return $a({value:e,title:o,triggerClass:r,translator:Ft??we.t,onChange:i=>t(i)})}function dt(e,t,o,r,i=!1){return l("div",{class:`pd-radio-group${i?" pd-radio-group--2col":""}`,role:"radiogroup"},t.map(n=>l("label",{class:"pd-radio"},[l("input",{type:"radio",name:e,value:n.value,checked:o===n.value,onChange:()=>r(n.value)}),l("span",{text:n.label})])))}function gn(e,t,o,r={}){const i=document.createElement("select");i.className=r.className??"pd-select",r.width&&(i.style.width=r.width);for(const n of t){const s=document.createElement("option");s.value=n.value,s.textContent=n.label,n.disabled&&(s.disabled=!0),i.appendChild(s)}return i.value=e,t.some(n=>n.value===e)||(i.selectedIndex=-1),i.addEventListener("change",()=>o(i.value)),i}const el="propertyPanel.k328",tl=()=>N(el);function mn(){const e=[];for(const{plugin:t,kind:o}of h.getElementPluginKinds()){const r=gr.getElementUI(o.type);if(!r)continue;const n=(o.designer??t.designer)?.materialCard;e.push({type:o.type,label:o.label,icon:o.icon??n?.icon??"Shapes",group:n?.group??r.group,ui:r})}return e}function Lr(e){if(e)return mn().find(t=>t.type===e)}function br(e){if(!e)return;const t=Lr(e.printElementType.type);if(!t||!t.ui.renderProperty)return;const o=t.ui;if(o.hasProperties)try{if(!o.hasProperties(e))return}catch{return}const r=tl();return{ui:o,label:r,icon:t.icon,searchKeywords:o.searchKeywords?[...o.searchKeywords]:[r,t.label,t.type]}}const xo=Object.freeze([{type:"text",label:N("elementDefinitions.k553"),icon:"Type",material:!0,propertyGroup:"text",dblEditableField:"formatter",origin:"builtin"},{type:"barcode",label:N("elementDefinitions.k554"),icon:"Barcode",material:!0,propertyGroup:"code",dblEditableField:"formatter",origin:"builtin"},{type:"qrcode",label:N("elementDefinitions.k555"),icon:"QrCode",material:!0,propertyGroup:"code",dblEditableField:"formatter",origin:"builtin"},{type:"image",label:N("elementDefinitions.k556"),icon:"Image",material:!0,propertyGroup:"general",dblEditableField:"src",origin:"builtin"},{type:"table",label:N("elementDefinitions.k557"),icon:"Table",material:!0,propertyGroup:"table",origin:"builtin"},{type:"longText",label:N("elementDefinitions.k558"),icon:"TextAlignStart",material:!0,propertyGroup:"text",dblEditableField:"formatter",origin:"builtin"},{type:"flowList",label:N("elementDefinitions.k559"),icon:"List",material:!0,propertyGroup:"general",dblEditableField:"formatter",origin:"builtin"},{type:"hline",label:N("elementDefinitions.k560"),icon:"Minus",material:!0,propertyGroup:"general",origin:"builtin"},{type:"vline",label:N("elementDefinitions.k561"),icon:"SeparatorVertical",material:!0,propertyGroup:"general",origin:"builtin"},{type:"rect",label:N("elementDefinitions.k562"),icon:"Square",material:!0,propertyGroup:"general",origin:"builtin"},{type:"oval",label:N("elementDefinitions.k563"),icon:"Circle",material:!0,propertyGroup:"general",origin:"builtin"},{type:"html",label:"HTML",icon:"Code",material:!1,propertyGroup:"general",origin:"builtin"},{type:"pageNumber",label:N("elementDefinitions.k564"),icon:"Shapes",material:!1,propertyGroup:"general",origin:"builtin"}]),yi=Symbol.for("worm-print-platform.element-definitions.v1"),vi=globalThis;function Ue(){const e=vi[yi];if(e)return e;const t={overrides:new Map,builtinRenderers:new Map,rendererOverrides:new Map,listeners:new Set,nextSeq:0,seq:new Map};return vi[yi]=t,t}function qt(){for(const e of[...Ue().listeners])try{e()}catch{}}function bn(e){const t=Ue();return t.listeners.add(e),()=>{t.listeners.delete(e)}}function ol(){return new Map(xo.map(e=>[e.type,e]))}function rl(e){if(!e?.type||typeof e.type!="string")throw new Error(N("elementDefinitions.k565"));if(!e.label||typeof e.label!="string")throw new Error(N("elementDefinitions.k566"));const t=Ue(),o={...e,origin:e.origin??"custom"};return t.overrides.set(o.type,o),t.seq.set(o.type,t.nextSeq++),qt(),()=>{const r=Ue();r.overrides.get(o.type)===o&&(r.overrides.delete(o.type),qt())}}function il(e,t){if(!e||typeof t!="function")throw new Error(N("elementDefinitions.k567"));return Ue().rendererOverrides.set(e,t),qt(),()=>{const r=Ue();r.rendererOverrides.get(e)===t&&(r.rendererOverrides.delete(e),qt())}}function yn(e){const t=Ue();for(const[o,r]of Object.entries(e))t.builtinRenderers.set(o,r);return()=>{const o=Ue();for(const[r,i]of Object.entries(e))o.builtinRenderers.get(r)===i&&o.builtinRenderers.delete(r)}}function nl(e){const t=Lr(e);if(t)return{type:t.type,label:t.label,icon:t.icon,group:t.group,material:!0,propertyGroup:"general",origin:"plugin"}}function pt(e){if(!e)return;const t=Ue(),o=t.overrides.get(e)??ol().get(e)??nl(e);if(!o)return;const r=t.rendererOverrides.get(e)??t.builtinRenderers.get(e);return r?{...o,renderContent:r}:o}function vn(){const e=Ue(),t=[],o=new Set;for(const i of xo)t.push(pt(i.type)??i),o.add(i.type);const r=[...e.overrides.entries()].filter(([i])=>!o.has(i)).sort((i,n)=>(e.seq.get(i[0])??0)-(e.seq.get(n[0])??0));for(const[i]of r){const n=pt(i);n&&t.push(n),o.add(i)}for(const i of mn()){if(o.has(i.type))continue;const n=pt(i.type);n&&t.push(n),o.add(i.type)}return t}function xn(){return vn().filter(e=>e.material)}function wn(e){return pt(e)?.propertyGroup??"general"}function kn(e){return pt(e)?.dblEditableField}function En(e){return pt(e)?.icon??"Shapes"}function al(){const e=Ue();e.overrides.clear(),e.rendererOverrides.clear(),e.seq.clear(),e.nextSeq=0,qt()}const zr="1.4.0",Sn="print-designer",Or=["template","fields","name","fonts","design-data","theme","theme-config","field-display","lang"],Tn=["is-edit","show-help","show-preview","show-save"],ll=Object.freeze({bubbles:!0,composed:!0}),Nr=["container","toolbar","format-bar","left-panel","canvas-area","property-panel","status-bar","page-tabs"],Cn=["--pd-bg","--pd-surface","--pd-field-bg","--pd-sidebar","--pd-sidebar-hover","--pd-canvas-bg","--pd-paper","--pd-accent","--pd-accent-2","--pd-accent-soft","--pd-accent-secondary","--pd-danger-soft","--pd-ink-green","--pd-text","--pd-text-muted","--pd-text-faint","--pd-border","--pd-border-soft","--pd-input-bg","--pd-hover-tint","--pd-danger","--pd-danger-bg","--pd-danger-border","--pd-menu-text","--pd-menu-hover","--pd-menu-border","--pd-menu-divider","--pd-menu-muted","--pd-menu-disabled","--pd-scrollbar","--pd-scrollbar-thumb","--pd-scrollbar-thumb-hover","--pd-help-field-bg","--pd-help-field-line","--pd-help-field-ink","--pd-help-function-bg","--pd-help-function-line","--pd-help-function-ink","--pd-help-variable-bg","--pd-help-variable-line","--pd-help-variable-ink","--pd-help-conditional-bg","--pd-help-conditional-line","--pd-help-conditional-ink","--pd-handle","--pd-ruler","--pd-ruler-bg","--pd-ruler-cursor","--pd-radius","--pd-shadow-sm","--pd-shadow-md","--pd-shadow-paper","--pd-success","--pd-text-regular","--pd-fill-light"],Dn=["getTemplateJson","loadTemplate","save","validateTemplate","getGeometryWarnings","setLocale"],Pn=["template","fields","fonts","designData","isEdit","showHelp","showPreview","showSave","theme","themeConfig","uploadImage","uploadDesignBackground","fieldDisplay","lang","messages"],Be=Object.freeze({save:"save",preview:"preview",help:"help",dblclickElement:"dblclick-element",dblclickCell:"dblclick-cell"}),An=[Be.save,Be.preview,Be.help,Be.dblclickElement,Be.dblclickCell];function yr(){return{version:zr,tag:Sn,attributes:Or,booleanAttributes:Tn,events:An,parts:Nr,themeTokens:Cn,methods:Dn,properties:Pn}}const sl={"--pd-bg":"#181a20","--pd-surface":"#1f2229","--pd-field-bg":"#252830","--pd-sidebar":"#1f2229","--pd-sidebar-hover":"#2b2f39","--pd-accent":"#4C8DFF","--pd-accent-2":"#6C9DFF","--pd-accent-soft":"rgba(76, 141, 255, .16)","--pd-accent-secondary":"#ff7a7a","--pd-danger-soft":"rgba(255, 122, 122, .14)","--pd-ink-green":"#6cce5a","--pd-text":"#e6e8ee","--pd-text-muted":"#9aa0ad","--pd-text-faint":"#6f7683","--pd-text-regular":"#c9cdd8","--pd-border":"#3a3f4b","--pd-border-soft":"#2d323c","--pd-input-bg":"#262a33","--pd-hover-tint":"rgba(76, 141, 255, .12)","--pd-fill-light":"#2b2f39","--pd-danger":"#ff6b6b","--pd-danger-bg":"#3a2226","--pd-danger-border":"#6b3535","--pd-success":"#4ade80","--pd-menu-text":"#d6d9e0","--pd-menu-hover":"#2b2f39","--pd-menu-border":"#3a3f4b","--pd-menu-divider":"#2d323c","--pd-menu-muted":"#8b91a0","--pd-menu-disabled":"#555b68","--pd-scrollbar":"rgba(255, 255, 255, .18)","--pd-scrollbar-thumb":"rgba(255, 255, 255, .16)","--pd-scrollbar-thumb-hover":"rgba(255, 255, 255, .3)","--pd-help-field-bg":"#16283a","--pd-help-field-line":"#2c5870","--pd-help-field-ink":"#7cc4f5","--pd-help-function-bg":"#162e22","--pd-help-function-line":"#2c5b3c","--pd-help-function-ink":"#79d69a","--pd-help-variable-bg":"#302c16","--pd-help-variable-line":"#6b5d24","--pd-help-variable-ink":"#d6b25e","--pd-help-conditional-bg":"#301a28","--pd-help-conditional-line":"#6b3454","--pd-help-conditional-ink":"#e58ab5","--pd-shadow-sm":"0 1px 2px rgba(0, 0, 0, .3)","--pd-shadow-md":"0 2px 8px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .5)"};function xi(e,t){(t==null||t>e.length)&&(t=e.length);for(var o=0,r=Array(t);o<t;o++)r[o]=e[o];return r}function dl(e){if(Array.isArray(e))return e}function pl(e,t){var o=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(o!=null){var r,i,n,s,d=[],c=!0,u=!1;try{if(n=(o=o.call(e)).next,t!==0)for(;!(c=(r=n.call(o)).done)&&(d.push(r.value),d.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&o.return!=null&&(s=o.return(),Object(s)!==s))return}finally{if(u)throw i}}return d}}function cl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hl(e,t){return dl(e)||pl(e,t)||ul(e,t)||cl()}function ul(e,t){if(e){if(typeof e=="string")return xi(e,t);var o={}.toString.call(e).slice(8,-1);return o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set"?Array.from(e):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?xi(e,t):void 0}}const Mn=Object.entries,fl=Object.keys,wi=Object.setPrototypeOf,gl=Object.isFrozen,_n=Object.getPrototypeOf,Rn=Object.getOwnPropertyDescriptor;let me=Object.freeze,pe=Object.seal,st=Object.create,Fn=typeof Reflect<"u"&&Reflect,go=Fn.apply,vr=Fn.construct;me||(me=function(t){return t});pe||(pe=function(t){return t});go||(go=function(t,o){for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];return t.apply(o,i)});vr||(vr=function(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return new t(...r)});const Ze=oe(Array.prototype.forEach),ml=oe(Array.prototype.lastIndexOf),ki=oe(Array.prototype.pop),Nt=oe(Array.prototype.push),bl=oe(Array.prototype.slice),yl=oe(Array.prototype.splice),It=Array.isArray,Zo=In(Set),Qo=oe(Set.prototype.add),Bt=oe(Set.prototype.has),mt=oe(String.prototype.toLowerCase),Jo=oe(String.prototype.toString),vl=oe(String.prototype.match),no=oe(String.prototype.replace),er=oe(String.prototype.indexOf),xl=oe(String.prototype.trim),wl=oe(Number.prototype.toString),kl=oe(Boolean.prototype.toString),Ei=typeof BigInt>"u"?null:oe(BigInt.prototype.toString),Si=typeof Symbol>"u"?null:oe(Symbol.prototype.toString),Ee=oe(Object.prototype.hasOwnProperty),Ut=oe(Object.prototype.toString),El=RegExp.prototype.test,fe=function(t,o){return t instanceof RegExp&&(t.lastIndex=0),go(El,t,[o])},Qe=In(TypeError);function oe(e){return function(t){for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return go(e,t,r)}}function In(e){return function(){for(var t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return vr(e,o)}}function j(e,t){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:mt;if(wi&&wi(e,null),!It(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const n=o(i);n!==i&&(gl(t)||(t[r]=n),i=n)}e[i]=!0}return e}function Sl(e){for(let t=0;t<e.length;t++)Ee(e,t)||(e[t]=null);return e}function mo(e){const t=st(null);for(const r of Mn(e)){var o=hl(r,2);const i=o[0],n=o[1];Ee(e,i)&&(It(n)?t[i]=Sl(n):n&&typeof n=="object"&&n.constructor===Object?t[i]=mo(n):t[i]=n)}return t}function Wt(e){const t=st(null),o=fl(e);let r=o.length;for(;r--;)t[o[r]]=e[o[r]];return t}function Tl(e){switch(typeof e){case"string":return e;case"number":return wl(e);case"boolean":return kl(e);case"bigint":return Ei?Ei(e):"0";case"symbol":return Si?Si(e):"Symbol()";case"undefined":return Ut(e);case"function":case"object":{if(e===null)return Ut(e);const t=e,o=_e(t,"toString");if(typeof o=="function"){const r=o(t);return typeof r=="string"?r:Ut(r)}return Ut(e)}default:return Ut(e)}}function _e(e,t){for(;e!==null;){const r=Rn(e,t);if(r){if(r.get)return oe(r.get);if(typeof r.value=="function")return oe(r.value)}e=_n(e)}function o(){return null}return o}function Cl(e,t){for(;e!==null;){const o=Rn(e,t);if(o)return o.get?oe(o.get):null;e=_n(e)}return null}function Dl(e){if(!e)return!1;try{return fe(e,""),!0}catch{return!1}}const Ti=me(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),tr=me(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),or=me(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Pl=me(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),rr=me(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Al=me(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ci=me(["#text"]),Di=me(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ir=me(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Pi=me(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ao=me(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ml=pe(/{{[\w\W]*|^[\w\W]*}}/g),_l=pe(/<%[\w\W]*|^[\w\W]*%>/g),Rl=pe(/\${[\w\W]*/g),Fl=pe(/{{|}}|\${|<%|%>|<%|%>/),Il=pe(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ll=pe(/^aria-[\-\w]+$/),Ai=pe(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zl=pe(/^(?:\w+script|data):/i),Ol=pe(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Nl=pe(/^html$/i),Bl=pe(/^[a-z][.\w]*(-[.\w]+)+$/i),nr=pe(/<[/\w!]/g),Mi=pe(/<[/\w]/g),Ul=pe(/<\/no(script|embed|frames)/i),_i=pe(/\/>/i),Hl=pe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),$l=pe(/^[\r\n\t ]+/),se={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},Wl=me(j({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Kl=function(){return typeof window>"u"?null:window},Vl=function(t,o){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";o&&o.hasAttribute(i)&&(r=o.getAttribute(i));const n="dompurify"+(r?"#"+r:"");try{return t.createPolicy(n,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+n+" could not be created."),null}},Ri=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},at=function(t,o,r,i){return Ee(t,o)&&It(t[o])?j(i.base?Wt(i.base):{},t[o],i.transform):r},ar=function(t,o,r){const i=Ee(t,o)?t[o]:void 0;return i&&typeof i=="object"?mo(i):r};function Ln(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Kl();const t=k=>Ln(k);if(t.version="3.4.18",t.removed=[],!e||!e.document||e.document.nodeType!==se.document||!e.Element)return t.isSupported=!1,t;let o=e.document;const r=o,i=r.currentScript,n=e.HTMLTemplateElement,s=e.Node,d=e.Element,c=e.NodeFilter,u=e.DOMParser,f=e.trustedTypes,b=d.prototype,m=_e(b,"cloneNode"),E=_e(b,"remove"),y=_e(b,"removeAttributeNode"),C=_e(b,"nextSibling"),D=_e(b,"childNodes"),S=_e(b,"parentNode"),_=_e(b,"shadowRoot"),z=_e(b,"attributes"),A=s&&s.prototype?_e(s.prototype,"nodeType"):null,I=s&&s.prototype?_e(s.prototype,"nodeName"):null,K=s&&s.prototype?_e(s.prototype,"ownerDocument"):null,B=function(p){return A?A(p):p.nodeType},L=function(p){return I?I(p):p.nodeName},U=Cl(b,"namespaceURI"),re=function(p){return U?U(p):p.namespaceURI};if(typeof n=="function"){const k=o.createElement("template");k.content&&k.content.ownerDocument&&(o=k.content.ownerDocument)}let V,he="",ie,Ce=!1,ke=0;const v=function(){if(ke>0)throw Qe('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ee=function(p){v(),ke++;try{return V.createHTML(p)}finally{ke--}},be=function(p){return V&&Ro?ee(p):p},He=function(p){v(),ke++;try{return V.createScriptURL(p)}finally{ke--}},W=function(){return Ce||(ie=Vl(f,i),Ce=!0),ie},ae=o,Re=ae.implementation,Fe=ae.createNodeIterator,qe=ae.createDocumentFragment,Y=ae.getElementsByTagName,Ye=r.importNode;let Z=Ri();t.isSupported=typeof Mn=="function"&&typeof S=="function"&&Re&&Re.createHTMLDocument!==void 0;const To=Ml,ct=_l,De=Rl,Me=Il,Co=Ll,Do=zl,Po=Ol,Ao=Bl;let jt=Ai,Q=null;const rt=j({},[...Ti,...tr,...or,...rr,...Ci]);let J=null;const it=j({},[...Di,...ir,...Pi,...ao]);let ue=null,ht=null,X=null;const Ie=Object.seal(st(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Lt=!0,x=!0,G=!1,ye=!0,te=!1,Le=!0,je=!1,Mo=!1,Xt=null,Zt=null,_o=!1,Et=!1,Qt=!1,Ro=!1,Gr=!0,qr=!1;const Yr="user-content-";let Fo=!0,Io=!1,ut=null,St=!1,ft=null;const jr=j({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Xr=null;const Zr=j({},["audio","video","img","source","image","track"]);let Qr=null;const Jr=j({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Jt="http://www.w3.org/1998/Math/MathML",eo="http://www.w3.org/2000/svg",$e="http://www.w3.org/1999/xhtml";let Tt=$e,Lo=!1,ei=null;const ra=j({},[Jt,eo,$e],Jo),ia=me(j({},["mi","mo","mn","ms","mtext"]));let zo=null;const na=me(j({},["annotation-xml"]));let Oo=null;const aa=me(st(null)),la=j({},["title","style","font","a","script"]);let zt=null;const sa=["application/xhtml+xml","text/html"],da="text/html";let le=null,to=null;const pa=o.createElement("form"),ti=function(p){return p instanceof RegExp||p instanceof Function},No=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(!p||typeof p!="object")&&(p={}),p=mo(p),zt=sa.indexOf(p.PARSER_MEDIA_TYPE)===-1?da:p.PARSER_MEDIA_TYPE,le=zt==="application/xhtml+xml"?Jo:mt,Q=at(p,"ALLOWED_TAGS",rt,{transform:le}),J=at(p,"ALLOWED_ATTR",it,{transform:le}),ei=at(p,"ALLOWED_NAMESPACES",ra,{transform:Jo}),Qr=at(p,"ADD_URI_SAFE_ATTR",Jr,{transform:le,base:Jr}),Xr=at(p,"ADD_DATA_URI_TAGS",Zr,{transform:le,base:Zr}),ft=at(p,"FORBID_CONTENTS",jr,{transform:le}),ht=at(p,"FORBID_TAGS",st(null),{transform:le}),X=at(p,"FORBID_ATTR",st(null),{transform:le}),St=Ee(p,"USE_PROFILES")?p.USE_PROFILES&&typeof p.USE_PROFILES=="object"?mo(p.USE_PROFILES):p.USE_PROFILES:!1,Lt=p.ALLOW_ARIA_ATTR!==!1,x=p.ALLOW_DATA_ATTR!==!1,G=p.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,te=p.SAFE_FOR_TEMPLATES||!1,Le=p.SAFE_FOR_XML!==!1,je=p.WHOLE_DOCUMENT||!1,Et=p.RETURN_DOM||!1,Qt=p.RETURN_DOM_FRAGMENT||!1,Ro=p.RETURN_TRUSTED_TYPE||!1,_o=p.FORCE_BODY||!1,Gr=p.SANITIZE_DOM!==!1,qr=p.SANITIZE_NAMED_PROPS||!1,Fo=p.KEEP_CONTENT!==!1,Io=p.IN_PLACE||!1,jt=Dl(p.ALLOWED_URI_REGEXP)?p.ALLOWED_URI_REGEXP:Ai,Tt=typeof p.NAMESPACE=="string"?p.NAMESPACE:$e,zo=ar(p,"MATHML_TEXT_INTEGRATION_POINTS",ia),Oo=ar(p,"HTML_INTEGRATION_POINTS",na);const g=ar(p,"CUSTOM_ELEMENT_HANDLING",aa);if(ue=st(null),Ee(g,"tagNameCheck")&&ti(g.tagNameCheck)&&(ue.tagNameCheck=g.tagNameCheck),Ee(g,"attributeNameCheck")&&ti(g.attributeNameCheck)&&(ue.attributeNameCheck=g.attributeNameCheck),Ee(g,"allowCustomizedBuiltInElements")&&typeof g.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=g.allowCustomizedBuiltInElements),pe(ue),te&&(x=!1),Qt&&(Et=!0),St&&((Ee(p,"ALLOWED_TAGS")||Ee(p,"ALLOWED_ATTR"))&&typeof console<"u"&&typeof console.warn=="function"&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),Q=j({},Ci),J=st(null),St.html===!0&&(j(Q,Ti),j(J,Di)),St.svg===!0&&(j(Q,tr),j(J,ir),j(J,ao)),St.svgFilters===!0&&(j(Q,or),j(J,ir),j(J,ao)),St.mathMl===!0&&(j(Q,rr),j(J,Pi),j(J,ao))),Ie.tagCheck=null,Ie.attributeCheck=null,Ee(p,"ADD_TAGS")&&(typeof p.ADD_TAGS=="function"?Ie.tagCheck=p.ADD_TAGS:It(p.ADD_TAGS)&&(Q===rt&&(Q=Wt(Q)),j(Q,p.ADD_TAGS,le))),Ee(p,"ADD_ATTR")&&(typeof p.ADD_ATTR=="function"?Ie.attributeCheck=p.ADD_ATTR:It(p.ADD_ATTR)&&(J===it&&(J=Wt(J)),j(J,p.ADD_ATTR,le))),Ee(p,"ADD_FORBID_CONTENTS")&&It(p.ADD_FORBID_CONTENTS)&&(ft===jr&&(ft=Wt(ft)),j(ft,p.ADD_FORBID_CONTENTS,le)),Fo&&(Q["#text"]=!0),je&&j(Q,["html","head","body"]),Q.table&&(Q.tbody=!0,delete ht.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Qe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const w=V;V=p.TRUSTED_TYPES_POLICY;try{he=ee("")}catch(T){throw V=w,T}}else p.TRUSTED_TYPES_POLICY===null?(V=void 0,he=""):(V===void 0&&(V=W()),V&&typeof he=="string"&&(he=ee("")));to=me(p)},oi=j({},[...tr,...or,...Pl]),ri=j({},[...rr,...Al]),ca=function(p,g,w){return g===$e?p==="svg":g===Jt?p==="svg"&&(w==="annotation-xml"||zo[w]):!!oi[p]},ha=function(p,g,w){return g===$e?p==="math":g===eo?p==="math"&&Oo[w]:!!ri[p]},ua=function(p,g,w){return g===eo&&!Oo[w]||g===Jt&&!zo[w]?!1:!ri[p]&&(la[p]||!oi[p])},fa=function(p){const g=re(p),w=mt(L(p)),T=S(p);let F=Tt,O="template";return T&&B(T)===se.element&&(F=re(T),O=mt(L(T))),ei[g]?g===eo?ca(w,F,O):g===Jt?ha(w,F,O):g===$e?ua(w,F,O):zt==="application/xhtml+xml":!1},nt=function(p){Nt(t.removed,{element:p});try{S(p).removeChild(p)}catch{if(E(p),!S(p))throw Qe("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ii=function(p,g,w){try{y(p,g)}catch{try{p.removeAttribute(w)}catch{}}},Bo=function(p){$o(p);const g=D(p);g&&Ze(bl(g),w=>{try{E(w)}catch{}}),B(p)===se.element&&Uo(p,!1)},Ct=function(p,g,w){if(!w)try{w=g.getAttributeNode(p)}catch{w=null}if(Nt(t.removed,{attribute:w||null,from:g}),w)ii(g,w,p);else try{g.removeAttribute(p)}catch{}if(p==="is")if(Et||Qt)try{nt(g)}catch{}else try{g.setAttribute(p,"")}catch{}},Uo=function(p,g){const w=z(p);if(w)for(let T=w.length-1;T>=0;--T){const F=w[T],O=F&&F.name;typeof O=="string"&&!(g&&J[le(O)])&&ii(p,F,O)}},Ho=function(p,g){let w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const T=[p];for(;T.length>0;){const F=T.pop();if(g(F)===!1)continue;if(w&&B(F)===se.element){const $=_(F);Dt($)&&T.push($)}const O=D(F);if(O)for(let $=O.length-1;$>=0;--$)T.push(O[$])}},$o=function(p){Ho(p,g=>{B(g)===se.element&&Uo(g,!0)})},Wo=function(p){const g=[];return Ho(p,w=>{g.push(w)},!0),g},ga=function(p,g){const w=Zo();Ze(Wo(p),T=>{B(T)===se.element&&Qo(w,T)}),Ze(g,T=>{B(T)===se.element&&!Bt(w,T)&&Uo(T,!0)})},ni=function(p,g){let w=!1;return Ze(t.removed,T=>{T.element&&(w=w||T.element===p,$o(T.element))}),ga(p,g),w},ma=8,ba=function(p,g){const w=ut;let T=null;const F=()=>(T||(T=Zo(),Ze(g,O=>{Qo(T,O)})),T);for(let O=0;;O++){const $=Wo(p),ce=[p];let Xe=!1;if(Ze($,Oe=>{B(Oe)===se.documentFragment?Nt(ce,Oe):!Xe&&!Bt(w,Oe)&&(Xe=Bt(F(),Oe))}),!Xe)return;if(O>=ma)throw Qe("the tree kept changing during in-place sanitization; refusing to return it");Ze(ce,(Oe,Pe)=>{ya(Oe,Pe>0,p,F())})}},ya=function(p,g,w,T){const F=oo(p);let O;for(;O=F.nextNode();)!Bt(T,O)||Bt(ut,O)||(g&&ze(Z.uponSanitizeShadowNode,O,null),qo(O,w))},va=function(p){ut&&Qo(ut,p)},ai=function(p,g){return Le?p==="patchsrc"?!0:p==="for"&&g!=="label"&&g!=="output":!1},xa=function(p){Le&&Ho(p,g=>{const w=B(g);if(w===se.processingInstruction||w===se.comment&&fe(Mi,g.data)){try{E(g)}catch{}return!1}if(w===se.element){const T=g,F=le(L(g));try{T.hasAttribute&&T.hasAttribute("patchsrc")&&T.removeAttribute("patchsrc"),T.hasAttribute&&T.hasAttribute("for")&&ai("for",F)&&T.removeAttribute("for")}catch{}}return!0})},li=function(p){let g=null,w=null;if(_o)p="<remove></remove>"+p;else{const O=vl(p,$l);w=O&&O[0]}zt==="application/xhtml+xml"&&Tt===$e&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const T=V?ee(p):p;if(Tt===$e)try{g=new u().parseFromString(T,zt)}catch{}if(!g||!g.documentElement){g=Re.createDocument(Tt,"template",null);try{g.documentElement.innerHTML=Lo?he:T}catch{}}const F=g.body||g.documentElement;return p&&w&&F.insertBefore(o.createTextNode(w),F.childNodes[0]||null),Tt===$e?Y.call(g,je?"html":"body")[0]:je?g.documentElement:F},oo=function(p){let g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const w=K?K(p):p.ownerDocument;return Fe.call(w||p,p,(g?0:c.SHOW_ELEMENT)|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Ko=function(p){return p=no(p,To," "),p=no(p,ct," "),p=no(p,De," "),p},Vo=function(p){var g;Go(p);const w=(g=p.querySelectorAll)===null||g===void 0?void 0:g.call(p,"template");w&&Ze(w,T=>{Dt(T.content)&&Vo(T.content)})},Go=function(p){p.normalize();const g=oo(p,!0);let w=g.nextNode();for(;w;)w.data=Ko(w.data),w=g.nextNode()},ro=function(p){const g=I?I(p):null;return typeof g!="string"||le(g)!=="form"?!1:typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||p.attributes!==z(p)||typeof p.removeAttribute!="function"||typeof p.removeAttributeNode!="function"||typeof p.getAttributeNode!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function"||p.nodeType!==A(p)||p.childNodes!==D(p)},si=function(p){if(!A||typeof p!="object"||p===null)return null;try{const g=A(p);return typeof g=="number"?g:null}catch{return null}},Dt=function(p){return si(p)===se.documentFragment},Ot=function(p){return si(p)!==null};function ze(k,p,g){k.length!==0&&Ze(k,w=>{w.call(t,p,g,to)})}const wa=function(p,g,w){return!!(Le&&w===se.element&&p.hasChildNodes()&&!Ot(p.firstElementChild)&&fe(nr,p.textContent)&&fe(nr,p.innerHTML)||Le&&Wl[g]&&w===se.element&&re(p)===$e&&(Ot(p.firstElementChild)||typeof p.textContent=="string"&&fe(nr,p.textContent))||w===se.processingInstruction||Le&&w===se.comment&&fe(Mi,p.data))},io=function(p,g){if(p instanceof RegExp)return fe(p,g);if(p instanceof Function){for(var w=arguments.length,T=new Array(w>2?w-2:0),F=2;F<w;F++)T[F-2]=arguments[F];return!!p(g,...T)}return!1},ka=function(p,g,w){if(!ht[g]&&ci(g)&&io(ue.tagNameCheck,g))return!1;if(Fo&&!ft[g]&&!ft[mt(g)]){const T=S(p),F=D(p);if(F&&T){const O=F.length;for(let $=O-1;$>=0;--$){const ce=p===w?m(F[$],!0):F[$];T.insertBefore(ce,C(p))}}}return nt(p),!0},di=function(p,g,w,T){return p.length===0?g:g===w||g===T?Wt(g):g},Pt=function(p,g){return p===g||S(p)!==null?!1:(Io&&$o(p),!0)},Ea=function(p,g){if(va(p),ze(Z.beforeSanitizeElements,p,null),Pt(p,g))return!0;if(ro(p))return nt(p),!0;const w=le(L(p)),T=B(p);if(Q=di(Z.uponSanitizeElement,Q,rt,Xt),ze(Z.uponSanitizeElement,p,{tagName:w,allowedTags:Q}),Pt(p,g))return!0;if(wa(p,w,T))return nt(p),!0;if(ht[w]||!(Ie.tagCheck instanceof Function&&Ie.tagCheck(w))&&!Q[w]){const F=ka(p,w,g);return F===!1&&(ze(Z.afterSanitizeElements,p,null),Pt(p,g))?!0:F}if(T===se.element&&!fa(p)||(w==="noscript"||w==="noembed"||w==="noframes")&&fe(Ul,p.innerHTML))return nt(p),!0;if(te&&T===se.text){const F=p.textContent,O=Ko(F);F!==O&&(Nt(t.removed,{element:p.cloneNode()}),p.textContent=O)}return ze(Z.afterSanitizeElements,p,null),Pt(p,g)},pi=function(p,g,w){if(X[g]||ai(g,p)||Gr&&(g==="id"||g==="name")&&(w in o||w in pa))return!1;const T=J[g]||Ie.attributeCheck instanceof Function&&Ie.attributeCheck(g,p);if(x&&fe(Me,g)||Lt&&fe(Co,g))return!0;if(!T)return ci(p)&&io(ue.tagNameCheck,p)&&io(ue.attributeNameCheck,g,p)||g==="is"&&ue.allowCustomizedBuiltInElements&&io(ue.tagNameCheck,w);if(Qr[g])return!0;const F=no(w,Po,"");return fe(jt,F)||(g==="src"||g==="xlink:href"||g==="href")&&p!=="script"&&er(w,"data:")===0&&Xr[p]||G&&!fe(Do,F)?!0:!w},Sa=j({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ci=function(p){return!Sa[mt(p)]&&fe(Ao,p)},Ta=function(p,g,w,T){if(V&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!w)switch(f.getAttributeType(p,g)){case"TrustedHTML":return ee(T);case"TrustedScriptURL":return He(T)}return T},Ca=function(p,g,w,T){try{return w?p.setAttributeNS(w,g,T):p.setAttribute(g,T),ro(p)?(nt(p),!1):!0}catch{return Ct(g,p),!1}},hi=function(p,g){return Le&&fe(Hl,g)?!0:mt(p)==="attributename"&&er(g,"href")!==-1},Da=function(p,g){if(ze(Z.beforeSanitizeAttributes,p,null),Pt(p,g))return;const w=p.attributes;if(!w||ro(p))return;J=di(Z.uponSanitizeAttribute,J,it,Zt);const T={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let F=w.length;const O=le(L(p));for(;F--;){const $=w[F],ce=$.name,Xe=$.namespaceURI,Oe=$.value,Pe=le(ce),We=Oe;let ve=ce==="value"?We:xl(We),ui=!1;if(T.attrName=Pe,T.attrValue=ve,T.keepAttr=!0,T.forceKeepAttr=void 0,ze(Z.uponSanitizeAttribute,p,T),ve=T.attrValue,qr&&(Pe==="id"||Pe==="name")&&er(ve,Yr)!==0&&(Ct(ce,p,$),ve=Yr+ve,ui=!0),hi(ce,ve)){Ct(ce,p,$);continue}if(!T.forceKeepAttr){if(!T.keepAttr){Ct(ce,p,$);continue}if(!ye&&fe(_i,ve)){Ct(ce,p,$);continue}if(te&&(ve=Ko(ve)),!pi(O,Pe,ve)){Ct(ce,p,$);continue}ve=Ta(O,Pe,Xe,ve),ve!==We&&Ca(p,ce,Xe,ve)&&ui&&ki(t.removed)}}ze(Z.afterSanitizeAttributes,p,null),Pt(p,g)},qo=function(p,g){Ea(p,g),Da(p,g),Dt(p.content)&&Yo(p.content)},Yo=function(p){let g=null;const w=oo(p);for(ze(Z.beforeSanitizeShadowDOM,p,null);g=w.nextNode();)if(ze(Z.uponSanitizeShadowNode,g,null),qo(g,p),B(g)===se.element){const T=_(g);Dt(T)&&(jo(T),Yo(T))}te&&Go(p),ze(Z.afterSanitizeShadowDOM,p,null)},jo=function(p){const g=[{node:p,shadow:null}];for(;g.length>0;){const w=g.pop();if(w.shadow){Yo(w.shadow);continue}const T=w.node,F=B(T)===se.element,O=D(T);if(O)for(let $=O.length-1;$>=0;--$)g.push({node:O[$],shadow:null});if(F){const $=I?I(T):null;if(typeof $=="string"&&le($)==="template"){const ce=T.content;Dt(ce)&&g.push({node:ce,shadow:null})}}if(F){const $=_(T);Dt($)&&g.push({node:null,shadow:$},{node:$,shadow:null})}}};return t.sanitize=function(k){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=null,w=null,T=null,F=null;if(Lo=!k,Lo&&(k="<!-->"),typeof k!="string"&&!Ot(k)&&(k=Tl(k),typeof k!="string"))throw Qe("dirty is not a string, aborting");if(!t.isSupported)return k;Mo?(Q=Xt,J=Zt):No(p),t.removed=[];const O=Io&&typeof k!="string"&&Ot(k);let $=[];const ce=ut;if(O){xa(k);const We=L(k);if(typeof We=="string"){const ve=le(We);if(!Q[ve]||ht[ve])throw Bo(k),Qe("root node is forbidden and cannot be sanitized in-place")}if(ro(k))throw Bo(k),Qe("root node is clobbered and cannot be sanitized in-place");$=Wo(k),ut=Zo()}else if(Ot(k))g=li("<!---->"),w=g.ownerDocument.importNode(k,!0),w.nodeType===se.element&&w.nodeName==="BODY"||w.nodeName==="HTML"?g=w:g.appendChild(w),jo(g);else{if(!Et&&!te&&!je&&k.indexOf("<")===-1)return be(k);if(g=li(k),!g)return Et?null:Ro?he:""}g&&_o&&nt(g.firstChild);const Xe=O?k:g;try{O&&jo(k);const We=oo(Xe);for(;T=We.nextNode();)qo(T,Xe);O&&ba(k,$)}catch(We){throw O&&(Bo(k),ni(k,$)),We}finally{ut=ce}if(O){if(ni(k,$))throw Qe("a node selected for removal could not be safely returned; refusing to sanitize in place");return te&&Vo(k),k}if(Et){if(te&&Vo(g),Qt)for(F=qe.call(g.ownerDocument);g.firstChild;)F.appendChild(g.firstChild);else F=g;return(J.shadowroot||J.shadowrootmode)&&(F=Ye.call(r,F,!0)),F}const Oe=()=>je?g.outerHTML:g.innerHTML;let Pe=Oe();return te&&fe(Fl,Pe)&&(Go(g),Pe=Oe()),je&&Q["!doctype"]&&g.ownerDocument&&g.ownerDocument.doctype&&g.ownerDocument.doctype.name&&fe(Nl,g.ownerDocument.doctype.name)&&(Pe="<!DOCTYPE "+g.ownerDocument.doctype.name+`>
|
|
3
|
-
`+Pe),be(Pe)},t.setConfig=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};No(k),Mo=!0,Xt=Q,Zt=J},t.clearConfig=function(){to=null,Mo=!1,Xt=null,Zt=null,V=ie,he=""},t.isValidAttribute=function(k,p,g){to||No({});const w=le(k),T=le(p);return typeof g=="string"&&(hi(p,g)||!ye&&fe(_i,g))?!1:pi(w,T,g)},t.addHook=function(k,p){typeof p=="function"&&Ee(Z,k)&&Nt(Z[k],p)},t.removeHook=function(k,p){if(Ee(Z,k)){if(p!==void 0){const g=ml(Z[k],p);return g===-1?void 0:yl(Z[k],g,1)[0]}return ki(Z[k])}},t.removeHooks=function(k){Ee(Z,k)&&(Z[k]=[])},t.removeAllHooks=function(){Z=Ri()},t}var Gl=Ln();const ql={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Yl(e,t){const o=e.options;return h.resolveBarcodeDesignValue(o.formatter,t,String(o.testData||o.title||""))||"1234567890128"}function jl(e){return l("div",{class:"print-qrcode",dataset:{codeId:e.id,codeKind:"qrcode"}})}function Xl(e){const t=e.options;return l("div",{class:"print-barcode",dataset:{codeId:e.id,codeKind:"barcode"}},[l("svg",{preserveAspectRatio:ql[String(t.fit||"contain")]??"xMidYMid meet",style:{maxWidth:"100%",maxHeight:"100%"}})])}function Zl(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(o=>!Number.isFinite(o))?null:{width:t[2],height:t[3]}}function Ql(e,t,o){const r=e.options,i=h.barcodeUnitsPerModule(r.barWidth),n=h.barcodeQuietZoneModules(r.barQuietZone),s=d=>{pn(t,Yl(e,o),{format:String(r.barcodeType||"CODE128"),width:i,height:d*i,displayValue:!r.hideTitle,fontSize:(r.fontSize??h.BARCODE_TEXT_FONT_SIZE_MODULES)*i,margin:0,marginLeft:n*i,marginRight:n*i,marginTop:0,marginBottom:h.BARCODE_MARGIN_BOTTOM_MODULES*i});const c=Zl(t);return c?{widthUnits:c.width,heightUnits:c.height}:null};try{const d=h.layoutBarcodeSize({barHeightMm:r.barHeight,boxWidthMm:h.barcodeAvailableBoxMm(r.width,r.maxWidth),boxHeightMm:h.barcodeAvailableBoxMm(r.height,r.maxHeight),dpi:r.printerDpi,barWidth:r.barWidth,measure:s});t.style.width=d.size?`${d.size.widthMm}mm`:"",t.style.height=d.size?`${d.size.heightMm}mm`:""}catch{t.replaceChildren();return}t.setAttribute("shape-rendering","crispEdges")}function Jl(e,t,o){const r=e.options,i=h.resolveBarcodeDesignValue(r.formatter,o,String(r.testData||r.title||""))||N("code.k27");t.replaceChildren();try{const n=Dr.browserCodeRenderer.render(i,"qrcode",{qrCodeLevel:String(r.qrCodeLevel??"M"),qrQuietZone:typeof r.qrQuietZone=="number"?r.qrQuietZone:void 0}),s=document.createElement("img");s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,s.alt="qrcode",s.style.width="100%",s.style.height="100%",s.style.objectFit=String(r.fit||"contain"),s.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",s.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%",t.appendChild(s)}catch{}}function es(e,t,o){for(const r of Array.from(e.querySelectorAll("[data-code-kind]"))){const i=r.dataset.codeId,n=t.find(s=>s.id===i);if(n)if(r.dataset.codeKind==="barcode"){const s=r.querySelector("svg");s&&Ql(n,s,o)}else Jl(n,r,o)}}const bo=new Map;function ts(e){return typeof Node<"u"&&e instanceof Node}function zn(e,t,o){if(On(e),typeof t=="string"){o.innerHTML=t;return}if(ts(t)){o.appendChild(t);return}typeof t.node=="string"?o.innerHTML=t.node:o.appendChild(t.node),typeof t.dispose=="function"&&bo.set(e,t.dispose)}function On(e){const t=bo.get(e);if(t){bo.delete(e);try{t()}catch{}}}function Fi(){for(const e of[...bo.keys()])On(e)}const os={header:"table.k450",data:"table.k451",subtotal:"table.k452",summary:"table.k453"},rs=[{value:"header",labelKey:"table.k454"},{value:"data",labelKey:"table.k455"},{value:"subtotal",labelKey:"table.k456"},{value:"summary",labelKey:"table.k457"}],co=3.7795275591,is=.1,xr=e=>JSON.parse(JSON.stringify(e)),Ii=new WeakMap;function ot(e){let t=Ii.get(e);return t||(t={menu:null,menuElId:null,anchor:null,layouts:new Map},Ii.set(e,t)),t}function Yt(e,t){return e.templateData.elements.find(o=>o.id===t)??null}function ns(e,t){const o=e.tableSelection;return!o||o.elementId!==t.id?null:e.selectedElement?.id!==t.id?(e.tableSelection=null,null):o}function Nn(e,t,o,r){const i=Yt(e,o.id);if(!i)return null;const n=o.options;return{store:e,fire:t,el:o,real:i,options:n,rows:n.tableRows??[],colWidths:n.tableColWidths??[],isSelected:e.selectedIds.has(o.id),selection:ns(e,o),maxTableWidth:Bn(e),designData:r}}function Bn(e){return e.paperSize.width-e.templateData.margins.left-e.templateData.margins.right}function Br(e){return e.options.tableDefaultFontSize??10}function Un(e){return e.options.tableDefaultColor??"#333333"}function as(e,t){let o=0;for(let r=0;r<t;r++)o+=e.rows[r].height;return o}function ls(e,t){return ot(e.store).layouts.get(e.el.id)?.[t]?.top??as(e,t)}function ss(e,t){return ot(e.store).layouts.get(e.el.id)?.[t]?.height??e.rows[t]?.height??0}function ds(e){const t=e.options.dataSource;if(t&&Array.isArray(h.DEFAULT_DEMO_DATA[t]))return h.DEFAULT_DEMO_DATA[t];for(const o of Object.values(h.DEFAULT_DEMO_DATA))if(Array.isArray(o))return o}function Hn(e){return e.cellType==="barcode"||e.cellType==="qrcode"}function $n(e,t){return Hn(t)?h.resolveBarcodeDesignValue(t.formatter,ds(e)):t.formatter||""}function ps(e,t){const o={designMode:!0,showGhostBorder:e.store.showTableGhostBorder};return{fontFamily:R.resolveCanvasFontFamily(t.fontFamily??e.options.tableDefaultFontFamily),textAlign:t.align??"left",...t.align==="justify"?{textAlignLast:"justify"}:{},verticalAlign:t.valign??"middle",fontSize:(t.fontSize??Br(e))+"pt",fontWeight:t.fontWeight??"normal",color:t.color??Un(e),backgroundColor:t.backgroundColor??"transparent",borderTop:h.resolveCellBorderCss(t.borders?.top,o),borderRight:h.resolveCellBorderCss(t.borders?.right,o),borderBottom:h.resolveCellBorderCss(t.borders?.bottom,o),borderLeft:h.resolveCellBorderCss(t.borders?.left,o),padding:(t.padding??e.options.tableDefaultPadding??1)+"mm",whiteSpace:t.wordWrap??!0?"pre-wrap":"nowrap",overflow:t.wordWrap??!0?"visible":"hidden"}}function cs(e,t,o){const r=e.selection;return[!!r&&t>=r.r1&&t<=r.r2&&o>=r.c1&&o<=r.c2?"cell-selected":"",e.rows[t]?.type==="data"?"row-data-bg":""].filter(Boolean).join(" ")}function Wn(e){return h.resolveCellTextFit(e)}function hs(e){return Wn(e)!=="autoHeight"}function us(e,t){return t.fontSize??Br(e)}function wo(e,t,o){return h.cellFitCapMm(e.rows,t,o,e.options.tableDefaultPadding??1)}function fs(e,t,o){return h.cellFitWidthMm(e.colWidths,t,o,e.options.tableDefaultPadding??1)}function gs(e,t,o){return{maxHeight:wo(e,o,t)+"mm",overflow:"hidden",...t.wordWrap===!1?{whiteSpace:"nowrap",textOverflow:"ellipsis"}:{}}}function ms(e,t,o){const r={fitBase:String(us(e,t)),fitMin:String(h.resolveShrinkMinFontSize(t.shrinkMinFontSize)),fitMm:String(wo(e,o,t))};return Wn(t)==="shrink"&&(r.fit="shrink"),r}function bs(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(o=>!Number.isFinite(o))?null:{width:t[2],height:t[3]}}const ys={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function vs(e,t,o,r){const i=document.createElement("div");i.className="cell-barcode";const n=document.createElementNS(Ra,"svg");i.appendChild(n);const s=$n(e,r);if(r.cellType==="barcode"){n.setAttribute("preserveAspectRatio",ys[r.fit||"contain"]??"xMidYMid meet");const d=h.barcodeUnitsPerModule(r.barWidth),c=h.barcodeQuietZoneModules(r.barQuietZone),u=m=>{pn(n,s,{format:r.barcodeType||"CODE128",width:d,height:m*d,displayValue:r.showBarcodeText!==!1,fontSize:(r.barFontSize??h.BARCODE_TEXT_FONT_SIZE_MODULES)*d,margin:0,marginLeft:c*d,marginRight:c*d,marginTop:0,marginBottom:h.BARCODE_MARGIN_BOTTOM_MODULES*d});const E=bs(n);return E?{widthUnits:E.width,heightUnits:E.height}:null};let f=null;try{f=h.layoutBarcodeSize({barHeightMm:r.barHeight,boxWidthMm:h.barcodeAvailableBoxMm(fs(e,o,r),r.maxWidth),boxHeightMm:h.barcodeAvailableBoxMm(wo(e,t,r),r.maxHeight),dpi:r.printerDpi,barWidth:r.barWidth,measure:u})}catch{f=null}if(!f){n.style.display="none";const m=document.createElement("span");return m.className="cell-barcode-fallback",m.textContent=s||a(e,"table.k458"),i.appendChild(m),i}const b=f.size;return b?(n.style.width=`${b.widthMm}mm`,n.style.height=`${b.heightMm}mm`):(n.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",n.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%"),n.setAttribute("shape-rendering","crispEdges"),i}if(n.style.display="none",!s)return i;try{const d=Dr.browserCodeRenderer.render(s,"qrcode",{qrCodeLevel:String(r.qrCodeLevel||"M"),qrQuietZone:typeof r.qrQuietZone=="number"?r.qrQuietZone:void 0}),c=document.createElement("img");c.setAttribute("src",`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`),c.setAttribute("alt","qrcode"),c.style.width="100%",c.style.height="100%",c.style.objectFit=r.fit||"contain",r.objectPosition&&(c.style.objectPosition=r.objectPosition),c.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",c.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%",i.appendChild(c)}catch{}return i}function Li(){const e=document.createElement("div");return e.className="image-placeholder",e.textContent=N("table.k459"),e}function xs(e,t){const o=e.formatter||"";if(!o)return"";if(!o.includes("{"))return o;const r=t.designData?.length?t.designData[0]:h.DEFAULT_DEMO_DATA;return h.evaluateTemplate(o,r)}function ws(e,t,o){const r=document.createElement("div");r.className="cell-image";const i=h.cellImageBoxMm(o.fit,wo(e,t,o));i!==void 0&&(r.style.height=`${i}mm`);const n=xs(o,e);if(!n)return r.appendChild(Li()),r;const s=document.createElement("img");s.setAttribute("src",n),i!==void 0&&(s.style.width="100%",s.style.height="100%"),s.style.objectFit=o.fit||"contain";for(const[d,c]of Object.entries(h.cropStyleDeclarations(o.fit,o.fitScale,o.objectPosition)))s.style[d]=c;return s.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",s.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",s.addEventListener("error",()=>{s.remove(),r.appendChild(Li())},{once:!0}),r.appendChild(s),r}function ks(e,t,o,r,i){if(Hn(i))return vs(e,o,r,i);if(i.cellType==="image")return ws(e,o,i);const n=$n(e,i),s=()=>t.type==="data"?l("span",{class:"data-placeholder",text:n}):n;return hs(i)?l("div",{class:"cell-fit",style:gs(e,i,o),dataset:ms(e,i,o)},[s()]):s()}function yo(e,t,o){const r={elementId:e.el.id,...h.normalizeSelection(e.rows,t,o)};e.store.setTableSelection(r),e.fire("table-selection-change",{elementId:e.el.id,selection:r})}function Es(e,t,o,r,i){if(i.button!==0||(e.fire("table-cell-mousedown",{elementId:e.el.id,r:t,c:o,cellId:r,event:i}),!e.isSelected))return;i.stopPropagation();const n=ot(e.store);i.shiftKey&&e.selection?yo(e,{r:e.selection.r1,c:e.selection.c1},{r:t,c:o}):(n.anchor={r:t,c:o},yo(e,{r:t,c:o},{r:t,c:o})),document.addEventListener("mouseup",()=>{ot(e.store).anchor=null},{once:!0})}function Ss(e,t,o){const r=ot(e.store).anchor;r&&yo(e,r,{r:t,c:o})}function Ur(e,t){const o=ot(e);o.menu?.visible&&(o.menu.visible=!1,t("table-menu-close",{elementId:o.menuElId}),e.emit(!1))}function Ts(e,t,o,r){r.preventDefault(),r.stopPropagation(),e.isSelected||e.store.selectOne(e.el.id);const i=e.selection;i&&t>=i.r1&&t<=i.r2&&o>=i.c1&&o<=i.c2||yo(e,{r:t,c:o},{r:t,c:o});const s=ot(e.store);s.menuElId=e.el.id,s.menu&&(s.menu.x=r.clientX,s.menu.y=r.clientY,s.menu.visible=!0),e.fire("table-cell-contextmenu",{elementId:e.el.id,r:t,c:o,clientX:r.clientX,clientY:r.clientY}),e.store.emit(!1),document.addEventListener("mousedown",()=>Ur(e.store,e.fire),{once:!0})}function zi(e,t,o){const r=e.reduce((i,n)=>i+n,0)+(e[t]??0);return r>o?N("table.k460",{v0:Math.round(r*10)/10,v1:o}):null}function Cs(e,t){const o=e.real.options.tableRows??[],r=e.real.options.tableColWidths??[],i=t(xr(o),xr(r));return i?(window.alert(i),!1):(e.store.recordHistory(),t(o,r),e.store.setTableSelection(null),h.syncTableElementSize(e.real.options),e.store.emit(),!0)}function Je(e,t,o){Ur(e.store,e.fire);const r=e.selection;if(!r)return;let i=null;switch(t){case"insert-row-above":i=n=>(h.insertRow(n,r.r1,"above"),null);break;case"insert-row-below":i=n=>(h.insertRow(n,r.r2,"below"),null);break;case"delete-row":i=n=>h.deleteRow(n,r.r1);break;case"insert-col-left":i=(n,s)=>{const d=zi(s,r.c1,e.maxTableWidth);return d||(h.insertCol(n,s,r.c1,"left"),null)};break;case"insert-col-right":i=(n,s)=>{const d=zi(s,r.c2,e.maxTableWidth);return d||(h.insertCol(n,s,r.c2,"right"),null)};break;case"delete-col":i=(n,s)=>h.deleteCol(n,s,r.c1);break;case"merge":i=n=>(h.mergeCells(n,r),null);break;case"split":i=n=>(h.splitCells(n,r),null);break;case"set-row-type":i=n=>o?h.setRowType(n,r.r1,o):a(e,"table.k461");break}i&&Cs(e,i)&&e.fire(`table-${t}`,{elementId:e.el.id,...o?{type:o}:{}})}function Ds(e){const t=e.selection;if(!t)return!1;for(let o=t.r1;o<=t.r2;o++)for(let r=t.c1;r<=t.c2;r++){const i=e.rows[o]?.cells[r];if(i&&!i.merged&&((i.rowspan??1)>1||(i.colspan??1)>1))return!0}return!1}function Ps(e){const t=e.selection;if(!t)return;const o=h.findMainCell(e.rows,t.r1,t.c1),r=!e.rows[o.r]?.cells[o.c]?.mergeSameValue;for(let i=t.r1;i<=t.r2;i++)for(let n=t.c1;n<=t.c2;n++){const s=e.rows[i]?.cells[n];s&&!s.merged&&(s.mergeSameValue=r)}e.store.updateElement(e.el.id,{tableRows:e.rows}),Ur(e.store,e.fire)}function Oi(e){const t=e.selection;if(!t)return a(e,"table.k462");for(let o=t.r1;o<=t.r2;o++)if(e.rows[o]?.type!=="data")return a(e,"table.k463");return null}function Ni(e,t){const o=e.selection;return o?o.r1!==o.r2?a(e,"table.k465"):h.setRowType(xr(e.rows),o.r1,t):a(e,"table.k464")}function Ke(e,t,o={}){return l("div",{class:`menu-item${o.disabled?" disabled":""}${o.active?" active":""}`,title:o.title||"",text:e,onClick:()=>{o.disabled||t()}})}const lr=()=>l("div",{class:"menu-divider"});function As(e,t,o){const r=ot(e);if(r.menu=o,!o.visible||!r.menuElId)return"";const i=Yt(e,r.menuElId);if(!i||i.printElementType.type!=="table")return"";const n=Nn(e,t,i);if(!n)return"";const s=n.selection?h.canMergeReason(n.rows,n.selection):a(n,"table.k466"),d=n.selection?n.rows[n.selection.r1]?.type??null:null;return l("div",{class:"table-ctx-menu",style:{left:o.x+"px",top:o.y+"px"},onMousedown:c=>c.stopPropagation()},[Ke(a(n,"table.k467"),()=>Je(n,"insert-row-above")),Ke(a(n,"table.k468"),()=>Je(n,"insert-row-below")),Ke(a(n,"table.k469"),()=>Je(n,"delete-row"),{disabled:n.rows.length<=1}),lr(),Ke(a(n,"table.k470"),()=>Je(n,"insert-col-left")),Ke(a(n,"table.k471"),()=>Je(n,"insert-col-right")),Ke(a(n,"table.k472"),()=>Je(n,"delete-col"),{disabled:n.colWidths.length<=1}),lr(),Ke(a(n,"table.k473"),()=>Je(n,"merge"),{disabled:!!s,title:s||""}),Ke(a(n,"table.k474"),()=>Je(n,"split"),{disabled:!Ds(n)}),Ke(a(n,"table.k475"),()=>Ps(n),{disabled:!!Oi(n),title:Oi(n)||"",active:(()=>{const c=n.selection;if(!c)return!1;const u=h.findMainCell(n.rows,c.r1,c.c1);return n.rows[u.r]?.cells[u.c]?.mergeSameValue===!0})()}),lr(),l("div",{class:"menu-group-title",text:a(n,"table.k476")}),...rs.map(c=>Ke(N(c.labelKey),()=>Je(n,"set-row-type",c.value),{disabled:!!Ni(n,c.value),title:Ni(n,c.value)||"",active:d===c.value}))])}let xt=null;function Kn(){xt&&(document.removeEventListener("mousemove",Hr),document.removeEventListener("mouseup",$r),xt.handle.classList.remove("dragging"),xt=null)}function Ms(e,t){const o=e.closest(".hiprint-printPaper");return(o&&o.offsetWidth>0?o.getBoundingClientRect().width/o.offsetWidth:0)||(t.scale||100)/100}function _s(e,t,o){if(o.button!==0)return;const r=o.currentTarget,i=r.closest(".print-table");if(!i)return;Kn();const n=e.real.options.tableColWidths??[];xt={store:e.store,fire:e.fire,elId:e.real.id,boundary:t,startX:o.clientX,startWidth:n[t-1]??0,scale:Ms(i,e.store),root:i,wrapper:r.closest(".print-element"),handle:r},r.classList.add("dragging"),e.store.recordHistory(),document.addEventListener("mousemove",Hr),document.addEventListener("mouseup",$r)}function Hr(e){const t=xt;if(!t)return;const o=Yt(t.store,t.elId),r=o?.options.tableColWidths;if(!o||!r)return;const i=(e.clientX-t.startX)/(t.scale*co),n=t.boundary-1;r[n]=h.clampResizedColumnWidth(r,n,t.startWidth+i,Bn(t.store)),h.syncTableElementSize(o.options),r.forEach((s,d)=>{const c=t.root.querySelector(`colgroup col:nth-child(${d+1})`);c&&(c.style.width=`${s}mm`)}),t.root.querySelectorAll(".col-resize-handle").forEach((s,d)=>{s.style.left=`${r.slice(0,d+1).reduce((c,u)=>c+u,0)}mm`}),t.wrapper&&(t.wrapper.style.width=`${o.options.width}mm`,t.wrapper.style.height=`${o.options.height}mm`)}function $r(){document.removeEventListener("mousemove",Hr),document.removeEventListener("mouseup",$r);const e=xt;if(!e)return;xt=null,e.handle.classList.remove("dragging");const t=Yt(e.store,e.elId);t&&h.syncTableElementSize(t.options),e.store.emit(),e.fire("table-col-resize-end",{elementId:e.elId})}function Rs(e,t,o){const r=o.querySelector("table");if(!r)return;const i=r.offsetHeight;if(i<=0)return;const n=Yt(e,t);if(!n)return;let s=!1;const d=i/co;Math.abs(d-(n.options.height??0))>is&&(n.options.height=Math.round(d*100)/100,s=!0);const c=r.offsetTop,u=Array.from(r.rows).map(b=>({top:(b.offsetTop-c)/co,height:b.offsetHeight/co})),f=ot(e);Fs(f.layouts.get(t),u)||(f.layouts.set(t,u),s=!0),s&&e.emit(!1)}function Fs(e,t){return!e||e.length!==t.length?!1:t.every((o,r)=>{const i=e[r];return Math.round(o.top*10)===Math.round(i.top*10)&&Math.round(o.height*10)===Math.round(i.height*10)})}function Is(e,t){const o=document.createComment("pd-table-measure");return requestAnimationFrame(()=>{if(!o.isConnected)return;const r=o.parentElement;r&&Rs(e,t,r)}),o}function Ls(e){return e.isSelected&&!e.real.options.locked&&e.colWidths.length>=1}function zs(e){return Array.from({length:e.colWidths.length},(t,o)=>o+1)}function Os(e,t){return e.colWidths.slice(0,t).reduce((o,r)=>o+r,0)}function Ns(e,t,o,r){const i=Nn(t,o,e,r);if(!i)return l("div",{class:"print-table"});const n=[l("table",{style:{fontSize:`${Br(i)}pt`,color:Un(i)}},[l("colgroup",{},i.colWidths.map(s=>l("col",{style:{width:s+"mm"}}))),l("tbody",{},i.rows.map((s,d)=>l("tr",{style:{height:s.height+"mm"}},s.cells.map((c,u)=>c.merged?"":l("td",{rowspan:c.rowspan||1,colspan:c.colspan||1,class:cs(i,d,u),style:ps(i,c),onMousedown:f=>Es(i,d,u,c.id,f),onMouseenter:()=>Ss(i,d,u),onContextmenu:f=>Ts(i,d,u,f)},[ks(i,s,d,u,c)])).filter(Boolean))))])];return Ls(i)&&n.push(l("div",{class:"col-resize-layer"},zs(i).map(s=>l("div",{class:"col-resize-handle",role:"separator","aria-label":a(i,"table.k477",{v0:s}),style:{left:Os(i,s)+"mm"},onMousedown:d=>{d.stopPropagation(),d.preventDefault(),_s(i,s,d)}})))),i.isSelected&&n.push(l("div",{class:"row-badges"},i.rows.map((s,d)=>l("span",{class:"row-badge",style:{top:ls(i,d)+"mm",height:ss(i,d)+"mm"},text:N(os[s.type])})))),n.push(Is(t,e.id)),l("div",{class:"print-table design-mode",dataset:{tableId:e.id},onContextmenu:s=>s.preventDefault()},n)}const Bs=["flowList.k44","flowList.k45","flowList.k46","flowList.k47","flowList.k48","flowList.k49","flowList.k50"];function Us(){return Bs.map(e=>N(e))}function wr(e){return Array.isArray(e)&&e.length>0?e:[]}function Hs(e,t){const o=h.detectFlowListKey(e,t)??(t?Object.keys(t).find(i=>Array.isArray(t[i])):void 0);if(o)return wr(t?.[o]);const r=h.detectFlowListKey(e,h.DEFAULT_DEMO_DATA);return r?wr(h.DEFAULT_DEMO_DATA[r]):[]}function $s(e,t){const o=e.options,r=typeof o.formatter=="string"?o.formatter:"",i=wr(t)[0],n=Hs(r,i);if(n.length===0)return Us();if(!r)return n.map(c=>String(c?.name??JSON.stringify(c)));const s=i??{},d=h.detectFlowListKey(r,s)??Object.keys(s).find(c=>Array.isArray(s[c]));return n.map(c=>{try{return h.evaluateTemplate(r,{...s,...c,...d?{[d]:c}:{}})}catch{return r}})}const Ws=3.7795275591,Ks=.1;function Vs(e,t){return e.templateData.elements.find(o=>o.id===t)??null}function Gs(e){const t=e.parentElement;if(!t?.classList.contains("print-element"))return 0;const o=getComputedStyle(t);return(parseFloat(o.borderTopWidth)||0)+(parseFloat(o.borderBottomWidth)||0)}function qs(e,t,o){const r=o.offsetHeight+Gs(o);if(r<=0)return;const i=Vs(e,t);if(!i)return;const n=r/Ws;Math.abs(n-(i.options.height??0))>Ks&&(i.options.height=Math.round(n*100)/100,e.emit(!1))}function Ys(e,t){const o=document.createComment("pd-flowlist-measure");return requestAnimationFrame(()=>{if(!o.isConnected)return;const r=o.parentElement;r&&qs(e,t,r)}),o}function js(e,t,o){const r=e.options,i=h.resolveFlowColumns(r.flowColumns),n=h.resolveFlowGapX(r.flowGapX),s=h.resolveFlowRowHeight(r.flowRowHeight),d=h.resolveFlowLayoutMode(r.flowLayoutMode)==="dynamic",c=h.resolveFlowPadding(r),u={display:"grid",gridTemplateColumns:`repeat(${i},minmax(0,1fr))`,columnGap:`${n}mm`,gridAutoRows:`minmax(${s}mm,auto)`,width:"100%",...d?{padding:`${c.top}mm ${c.right}mm ${c.bottom}mm ${c.left}mm`,height:"auto",overflow:"visible"}:{height:"100%",overflow:"hidden"},fontSize:`${r.fontSize||12}pt`,fontWeight:r.fontWeight||"normal",color:r.color||"#333",boxSizing:"border-box"};r.fontFamily&&(u.fontFamily=String(r.fontFamily)),r.backgroundColor&&(u.backgroundColor=String(r.backgroundColor));const f=$s(e,t).map(b=>l("div",{class:"print-flow-cell",text:b}));return d&&o&&f.push(Ys(o,e.id)),l("div",{class:"print-flowlist",style:u},f)}const Bi={top:"flex-start",middle:"center",bottom:"flex-end"},Xs={left:"flex-start",center:"center",right:"flex-end"};function Zs(e,t){const o=e.options,r=h.resolveElementMargins(o),i=h.resolveElementBorder(e.printElementType.type,o),n={};if(i?.all&&(n.border=`${i.all.borderWidth} ${i.all.borderStyle} ${i.all.borderColor}`),i)for(const s of h.ELEMENT_BORDER_SIDES){const d=i.edges[s];d&&(n[`border${s.charAt(0).toUpperCase()}${s.slice(1)}`]=`${d.borderWidth} ${d.borderStyle} ${d.borderColor}`)}return{position:"absolute",left:`${o.left}mm`,top:`${o.top}mm`,width:`${o.width}mm`,height:`${o.height}mm`,...r.top!==0?{marginTop:`${r.top}mm`}:{},...r.right!==0?{marginRight:`${r.right}mm`}:{},...r.bottom!==0?{marginBottom:`${r.bottom}mm`}:{},...r.left!==0?{marginLeft:`${r.left}mm`}:{},zIndex:String(o.zIndex||"auto"),...n,...Qs(e,t)}}function Qs(e,t){if(t?.has(e.id))return{};const o=h.resolveElementRotation(e.printElementType.type,e.options);return o===void 0?{}:{rotate:`${o}deg`}}function Ui(e){const t=e.options,o=e.printElementType.type==="longText",r=h.resolveElementTextFit(e.printElementType.type,t),i=t.fontSize||12,n=r==="autoHeight",s={fontSize:`${i}pt`,fontWeight:t.fontWeight||"normal",fontFamily:R.resolveCanvasFontFamily(t.fontFamily),color:t.color||"#333",backgroundColor:t.backgroundColor||"transparent",textAlign:t.textAlign||"left",...t.textAlign==="justify"?{textAlignLast:"justify"}:{},lineHeight:t.lineHeight?`${t.lineHeight}pt`:o?"1.5":"normal",letterSpacing:t.letterSpacing?`${t.letterSpacing}pt`:"normal",width:"100%",height:n?"auto":"100%",boxSizing:"border-box",overflow:n?"visible":"hidden",...o?{wordBreak:"break-all",textIndent:t.longTextIndent?`${t.longTextIndent}em`:"0"}:{textDecoration:t.textDecoration||"none",padding:`${t.contentPaddingTop||0}pt ${t.contentPaddingRight||0}pt ${t.contentPaddingBottom||0}pt ${t.contentPaddingLeft||0}pt`}};h.resolveElementNowrap(t)&&(s.whiteSpace="nowrap",s.textOverflow="ellipsis");const d=h.resolveElementWhiteSpace(t);return d&&(s.whiteSpace=d),t.verticalAlign&&(s.display="flex",t.textAlign==="justify"?(s.flexDirection="column",s.justifyContent=Bi[t.verticalAlign]??"flex-start"):(s.alignItems=Bi[t.verticalAlign]??"flex-start",s.justifyContent=Xs[t.textAlign||"left"]??"flex-start")),{style:s,fit:r}}function Hi(e){const t=e.options,o=`${t.borderWidth||.75}pt`,r=t.borderStyle||"solid",i=t.borderColor||"#333";return e.printElementType.type==="hline"?{width:"100%",height:"0",borderTop:`${o} ${r} ${i}`,boxSizing:"border-box"}:{width:"0",height:"100%",borderLeft:`${o} ${r} ${i}`,boxSizing:"border-box"}}function $i(e){const t=e.options;return{width:"100%",height:"100%",borderWidth:`${t.borderWidth||1}pt`,borderStyle:t.borderStyle||"solid",borderColor:t.borderColor||"#333",backgroundColor:t.backgroundColor||"transparent",borderRadius:e.printElementType.type==="oval"?"50%":"0",boxSizing:"border-box"}}function Js(e){const t=e.options;return{objectFit:t.fit||"contain",...h.cropStyleDeclarations(t.fit,t.fitScale,t.objectPosition),maxWidth:t.maxWidth?`${t.maxWidth}mm`:"100%",maxHeight:t.maxHeight?`${t.maxHeight}mm`:"100%"}}function Wi(e){const t=e.options,o={fitBase:String(t.fontSize||12),fitMin:String(h.resolveShrinkMinFontSize(t.shrinkMinFontSize))};return h.resolveElementTextFit(e.printElementType.type,t)==="shrink"&&(o.fit="shrink"),o}const ed={text:e=>{const{style:t}=Ui(e),o=e.options;return l("div",{class:"print-text",style:t,dataset:Wi(e),text:String(o.testData||o.formatter||"")||N("elements.k41")})},longText:e=>{const{style:t}=Ui(e),o=e.options;return l("div",{class:"print-longtext",style:t,dataset:Wi(e),text:String(o.formatter||"")||N("elements.k42")})},hline:e=>l("div",{class:"print-line",style:Hi(e)}),vline:e=>l("div",{class:"print-line",style:Hi(e)}),rect:e=>l("div",{class:"print-shape",style:$i(e)}),oval:e=>l("div",{class:"print-shape",style:$i(e)}),image:(e,t,o)=>{const r=e.options,i=String(r.src??""),n=o?.designData?.length?o.designData[0]:h.DEFAULT_DEMO_DATA,s=i.includes("{")?h.evaluateTemplate(i,n):i;return l("div",{class:"print-image"},[s?l("img",{src:s,style:Js(e)}):l("div",{class:"image-placeholder",text:N("elements.k43")})])},qrcode:e=>jl(e),barcode:e=>Xl(e),html:e=>{const t=e.options,o=String(t.formatter??""),r=o?Gl.sanitize(h.evaluateTemplate(o,{})):'<div style="background:#e0e0e0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:10pt;color:#999">HTML</div>';return l("div",{class:"print-html",html:r})},pageNumber:(e,t)=>{const o=e.options;return l("div",{class:"page-number-element",style:{fontSize:`${o.fontSize||12}pt`,fontWeight:o.fontWeight||"normal",fontFamily:R.resolveCanvasFontFamily(o.fontFamily),color:o.color||"#333",textAlign:o.textAlign||"left",...o.textAlign==="justify"?{textAlignLast:"justify"}:{}},text:t?o.title||"{pageIndex}/{totalPages}":String(o.title||"")})},table:(e,t,o)=>o?Ns(e,o.store,o.fire,o.designData):l("div",{class:"print-table"}),flowList:(e,t,o)=>js(e,void 0,o?.store)};yn(ed);function td(e,t,o){const r=e.printElementType.type,i=pt(r)?.renderContent;if(i)return i(e,t,o);const n=Lr(r);if(!n)return l("div",{text:r});const s=document.createElement("div");s.className="plugin-kit-canvas",s.style.width="100%",s.style.height="100%";try{zn(`canvas:${e.id}`,n.ui.renderCanvas({element:e,data:o?.designData?.length?o.designData:[h.DEFAULT_DEMO_DATA],designMode:!0}),s)}catch{s.textContent=String(r)}return s}function Vn(e){return`x:${Math.round(e.left)} y:${Math.round(e.top)} ${Math.round(e.width)}×${Math.round(e.height)}mm`}function od(e,t,o){const r=e.store,i=r.selectedIds.has(t.id),n=r.previewIds.has(t.id),s=t.options,d=t.zone||"content",c=[td(t,!0,{store:r,fire:e.fire,designData:e.host.designData})];return r.draggingIds.has(t.id)&&c.push(l("div",{class:"drag-preview"})),i&&(c.push(l("div",{class:"resize-handles"},h.RESIZE_POINTS.map(u=>l("div",{class:`resize-handle handle-${u}`,dataset:{point:u,elId:t.id},onMousedown:f=>e.fire("resize-start",{event:f,id:t.id,point:u})})))),c.push(l("div",{class:"selected-indicator"},[l("div",{class:"position-label",text:Vn(s)})]))),l("div",{class:["print-element",`type-${t.printElementType.type}`,`zone-${d}`,i?"selected":"",n?"previewed":"",r.draggingIds.has(t.id)?"drag-ghost":"","design-mode",s.locked?"locked":"",s.visible===!1?"hidden":""].filter(Boolean).join(" "),style:Zs(t,o),dataset:{elId:t.id},onMousedown:u=>e.fire("element-mousedown",{event:u,id:t.id}),onContextmenu:u=>{u.preventDefault(),u.stopPropagation(),e.fire("contextmenu",{event:u,id:t.id})}},c)}function kr(e,t){const o=e.margins,r=e.header?.height??10,i=e.footer?.height??10,n=t.width-o.left-o.right;return{header:{left:o.left,top:o.top,width:n,height:r},content:{left:o.left,top:o.top+r,width:n,height:t.height-o.top-o.bottom-r-i},footer:{left:o.left,top:t.height-o.bottom-i,width:n,height:i}}}const rd='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M0 .5H20M.5 0V20" fill="none" stroke="rgba(0,0,0,0.08)" stroke-width="1" stroke-dasharray="4 4"/></svg>';function Ki(e,t){return e.type==="vertical"?{left:`${e.position}mm`,top:"0",height:`${t.height}mm`,borderLeftColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}:{top:`${e.position}mm`,left:"0",width:`${t.width}mm`,borderTopColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}}function id(e,t){const o=R.resolveWatermarkLayout(e.watermark,[],t);return o?l("div",{class:"watermark-layer",style:{opacity:String(o.opacity)}},o.tiles.map(r=>l("svg",{class:"watermark-tile",width:`${r.widthMm}mm`,height:`${r.heightMm}mm`,viewBox:`0 0 ${o.tileWidthPx} ${o.tileHeightPx}`,style:{left:`${r.leftMm}mm`,top:`${r.topMm}mm`}},[l("text",{x:String(o.tileWidthPx/2),y:String(o.tileHeightPx/2),"font-size":String(o.fontSizePx),fill:o.color,"text-anchor":"middle","dominant-baseline":"middle",transform:`rotate(${o.rotate},${o.tileWidthPx/2},${o.tileHeightPx/2})`,text:o.text})]))):""}function sr(e,t,o,r,i,n){const s=e.store,d=[];o!=="content"&&d.push(l("span",{class:"zone-label",text:o==="header"?a(e,"canvas.k11"):a(e,"canvas.k12")}));const c=o==="content"?R.collectFollowMemberIds(i):void 0;if(d.push(...i.map(u=>od(e,u,c))),o!=="content"){const u=o==="header"?"bottom":"top";d.push(l("div",{class:`zone-resize-handle handle-${u}`,dataset:{zone:o},onMousedown:f=>e.fire("zone-resize",{event:f,zone:o})},[t.zoneResizing===o?l("div",{class:"zone-height-tip",text:`${(o==="header"?s.templateData.header.height:s.templateData.footer.height).toFixed(1)}mm`}):""]))}return l("div",{class:`zone-layer zone-${o} design-mode`,style:{position:"absolute",left:`${r.left}mm`,top:`${r.top}mm`,width:`${r.width}mm`,height:`${r.height}mm`},dataset:{zone:o,paperWidth:String(n.width),paperHeight:String(n.height)}},d.filter(Boolean))}function nd(e){const t=e.currentTarget,o=e.dataTransfer?.types??[],r=o.includes("fieldkey"),i=o.includes("elementtype");if(!r&&!i){t.querySelector(".drop-hint")?.remove();return}r&&(e.ctrlKey||e.metaKey)&&(t.dataset.dropLabelIntent="1");const n=i?N("canvas.k13"):t.dataset.dropLabelIntent?N("canvas.k14"):N("canvas.k15");let s=t.querySelector(".drop-hint");s||(s=document.createElement("div"),s.className="drop-hint",t.appendChild(s)),s.textContent=n,s.style.left=`${e.clientX+14}px`,s.style.top=`${e.clientY+18}px`}function Gn(e){e&&(e.querySelector(".drop-hint")?.remove(),delete e.dataset.dropLabelIntent)}function ad(e,t){const o=e.store,r=o.templateData,i=R.getPaperDimensions(r),n=(o.scale||100)/100,s=kr(r,i),d=b=>o.elements.filter(m=>(m.zone||"content")===b),c=l("div",{class:"hiprint-printPaper-content",dataset:{content:""},style:{padding:`${r.margins.top}mm ${r.margins.right}mm ${r.margins.bottom}mm ${r.margins.left}mm`,position:"relative",boxSizing:"border-box",minHeight:`${i.height}mm`}},[o.showGrid?l("div",{class:"grid-bg",style:{backgroundImage:`url("data:image/svg+xml,${encodeURIComponent(rd)}")`,backgroundSize:"5mm 5mm",backgroundPosition:"0 0"}}):"",...r.watermark&&Object.keys(r.watermark).length?[id(r,i)]:[],sr(e,t,"header",s.header,d("header"),i),sr(e,t,"content",s.content,d("content"),i),sr(e,t,"footer",s.footer,d("footer"),i),...o.adsorbGuides.map(b=>l("div",{class:`adsorb-guide guide-${b.type}`,style:Ki(b,i)})),...(r.guides??[]).map(b=>l("div",{class:`manual-guide guide-${b.type}`,style:{...Ki(b,i),"--guide-hit":`${8/n}px`},dataset:{guideId:String(b.id??"")},onMousedown:m=>e.fire("guide-mousedown",{event:m,id:b.id}),onDblclick:m=>{m.preventDefault(),e.fire("guide-remove",b.id)}}))].filter(Boolean)),u=l("div",{class:"hiprint-printPaper",dataset:{test:"paper"},style:{width:`${i.width}mm`,minHeight:`${i.height}mm`,background:r.pageBackground||"var(--pd-paper, #fff)",boxShadow:"var(--pd-shadow-paper, 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08))",overflow:"hidden",position:"relative",transform:`scale(${n})`,transformOrigin:"0 0"}},[...r.designBackground?.src?[l("div",{class:"design-background",style:{width:`${i.width}mm`,height:`${i.height}mm`,left:"0",top:"0",transform:r.designBackground.rotation?`rotate(${r.designBackground.rotation}deg)`:""}},[l("img",{src:r.designBackground.src,draggable:!1,alt:""})])]:[],c]),f=[l("div",{class:"canvas-scroll"},[l("div",{class:"paper-wrapper",style:{width:`${R.mmToPx(i.width)*n}px`,height:`${R.mmToPx(i.height)*n}px`,position:"relative"}},[u])])];if(o.showRuler&&f.push(l("div",{class:"ruler-overlay",style:{transform:`translate(${t.scrollX}px, ${t.scrollY}px)`}},[l("div",{class:"ruler-corner"}),l("canvas",{class:"pd-ruler is-horizontal",dataset:{ruler:"horizontal"},style:{width:`${t.geom.viewW}px`,height:"20px"},onMousedown:b=>e.fire("ruler-mousedown",{event:b,orientation:"horizontal"})}),l("canvas",{class:"pd-ruler is-vertical",dataset:{ruler:"vertical"},style:{width:"20px",height:`${t.geom.viewH}px`},onMousedown:b=>e.fire("ruler-mousedown",{event:b,orientation:"vertical"})})])),t.guidePreview&&f.push(l("div",{class:`ruler-guide-preview guide-${t.guidePreview.type}`,style:t.guidePreview.type==="vertical"?{left:`${t.guidePreview.position}px`,top:"0",height:"100%"}:{top:`${t.guidePreview.position}px`,left:"0",width:"100%"}})),t.marquee.visible&&f.push(l("div",{class:"marquee-selection",style:{left:`${t.marquee.x}px`,top:`${t.marquee.y}px`,width:`${t.marquee.w}px`,height:`${t.marquee.h}px`}})),t.contextMenu.visible){const b=t.contextMenu;f.push(l("div",{class:"context-menu",style:{left:`${t.contextMenu.x+t.contextMenu.flipX}px`,top:`${t.contextMenu.y+t.contextMenu.flipY}px`}},t.contextMenu.targetId?[Ne(e,b,a(e,"canvas.k16"),"copy"),Ne(e,b,a(e,"canvas.k17"),"cut"),Ne(e,b,a(e,"canvas.k18"),"paste",!o.hasClipboard),Ne(e,b,a(e,"canvas.k19"),"delete"),l("div",{class:"context-menu-sep"}),Ne(e,b,a(e,"canvas.k20"),"move-layer",!1,"top"),Ne(e,b,a(e,"canvas.k21"),"move-layer",!1,"up"),Ne(e,b,a(e,"canvas.k22"),"move-layer",!1,"down"),Ne(e,b,a(e,"canvas.k23"),"move-layer",!1,"bottom")]:[Ne(e,b,a(e,"canvas.k24"),"paste-at",!o.hasClipboard),Ne(e,b,a(e,"canvas.k25"),"select-all"),Ne(e,b,a(e,"canvas.k26"),"clear-selection")]))}return l("div",{class:"canvas-area",dataset:{test:"canvas-area"},onDragover:b=>{const m=b;m.preventDefault(),m.dataTransfer&&(m.dataTransfer.dropEffect="copy"),nd(m)},onDragleave:b=>{const m=b.currentTarget,E=b.relatedTarget;(!E||!m.contains(E))&&m.querySelector(".drop-hint")?.remove()},onDrop:b=>{const m=b,E=b.currentTarget,y=E.dataset.dropLabelIntent==="1";Gn(E),y&&(m.labelIntent=!0),e.fire("drop",m)},onMousedown:b=>e.fire("canvas-mousedown",b),onMousemove:b=>e.fire("canvas-mousemove",b),onMouseleave:()=>e.fire("canvas-mouseleave"),onWheel:b=>e.fire("wheel",b),onScroll:b=>e.fire("scroll",b),onContextmenu:b=>{b.preventDefault(),e.fire("canvas-contextmenu",b)}},f.filter(Boolean))}function Ne(e,t,o,r,i=!1,n){return l("div",{class:`context-menu-item${i?" disabled":""}`,text:o,onClick:()=>{t.visible=!1,i||e.fire(r,n),e.repaint()}})}function ld(e){const t=window.innerHeight;for(let o=e.parentElement;o&&o!==document.body;o=o.parentElement){const r=getComputedStyle(o).overflowY;if(r==="auto"||r==="scroll"||r==="hidden"||r==="clip"){const i=o.getBoundingClientRect();return{top:Math.max(0,i.top),bottom:Math.min(t,i.bottom)}}}return{top:0,bottom:t}}function ko(e){const t=R.normalizeFontCatalog(e.fonts),o=e.placeholder??N("fontSelect.k51"),r=`font-select-list-${e.id}`,i=L=>{const U=L?.trim();return U?R.findFontOption(t,U)?.label??U:""},n=L=>{const U=R.normalizeFontQuery(L);return t.find(V=>V.label&&R.normalizeFontQuery(V.label)===U)?.family??L},s=()=>{const L=e.value?.trim();return L?R.findFontOption(t,L)?"":L:""},d=L=>{const U=(e.value??"").trim(),re=(ie,Ce,ke,v)=>({kind:ie,key:Ce,label:ke,value:v,selected:(v??"")===U}),V=L.trim();if(!V){const ie=[re("clear","__clear__",o)],Ce=s();Ce&&ie.push(re("unknown","__unknown__",N("fontSelect.k52",{v0:Ce}),Ce));for(const ke of t)ie.push(re("font",ke.family,R.fontOptionLabel(ke),ke.family));return ie}const he=R.filterFontOptions(t,V).map(ie=>re("font",ie.family,R.fontOptionLabel(ie),ie.family));if(!he.length){const ie=n(V);he.push(re("free","__free__",N("fontSelect.k53",{v0:ie}),ie))}return he},c=document.createElement("div");c.className="font-select";const u=document.createElement("input");u.className="pd-input font-select-input",u.type="text",u.setAttribute("role","combobox"),u.setAttribute("aria-autocomplete","list"),u.setAttribute("aria-controls",r),u.autocomplete="off",u.placeholder=o,u.disabled=!!e.disabled,u.value=i(e.value);const f=document.createElement("ul");f.id=r,f.className="font-select-list",f.setAttribute("role","listbox");const b=e.state.fontOpen?.id===e.id?e.state.fontOpen:null,m={open:!!b&&!e.disabled,query:b?.query??"",highlighted:b?.highlighted??-1};m.open&&(u.value=m.query);const E=()=>{e.state.fontOpen=m.open?{id:e.id,query:m.query,highlighted:m.highlighted}:null};E();const y=()=>{const L=(e.value??"").trim();return d(m.query).findIndex(U=>(U.value??"")===L)},C=()=>{const L=u.getBoundingClientRect(),U=ld(u);f.classList.toggle("is-up",h.resolveOverlayPlacement({triggerTop:L.top,triggerBottom:L.bottom,overlayHeight:f.getBoundingClientRect().height,boundaryTop:U.top,boundaryBottom:U.bottom})==="up")},D=()=>{if(!m.open){f.isConnected&&f.remove(),u.setAttribute("aria-expanded","false"),u.setAttribute("aria-activedescendant","");return}f.isConnected||c.appendChild(f);const L=d(m.query);f.replaceChildren(...L.map((U,re)=>{const V=document.createElement("li");return V.id=`${r}-${re}`,V.className="font-select-option"+(re===m.highlighted?" is-active":"")+(U.kind==="unknown"||U.kind==="free"?" is-muted":""),V.setAttribute("role","option"),V.setAttribute("aria-selected",String(U.selected)),V.textContent=U.label,V.addEventListener("mousedown",he=>{he.preventDefault(),K(U)}),V})),u.setAttribute("aria-expanded","true"),u.setAttribute("aria-activedescendant",m.highlighted>=0?`${r}-${m.highlighted}`:""),C()},S=()=>{m.open||e.disabled||(m.open=!0,m.query="",m.highlighted=y(),E(),D())},_=()=>{m.open||S()},z=()=>{m.open=!0,m.query=u.value,m.highlighted=d(m.query).length?0:-1,E(),D()},A=L=>{if(!m.open){S();return}const U=d(m.query).length-1;if(U<0)return;m.highlighted=Math.min(Math.max(m.highlighted+L,0),U),E(),D(),f.children[m.highlighted]?.scrollIntoView?.({block:"nearest"})},I=()=>{if(!m.open)return;const L=d(m.query)[m.highlighted];if(L){K(L);return}const U=m.query.trim();if(U){const re=n(U);K({value:re})}},K=L=>{m.open=!1,m.query="",m.highlighted=-1,E(),u.value=i(L.value),D(),e.onChange(L.value)},B=()=>{m.open&&(m.open=!1,m.query="",m.highlighted=-1,E(),u.value=i(e.value),D())};return u.addEventListener("focus",S),u.addEventListener("click",_),u.addEventListener("input",z),u.addEventListener("blur",B),u.addEventListener("keydown",L=>{const U=L;U.key==="ArrowDown"?(U.preventDefault(),A(1)):U.key==="ArrowUp"?(U.preventDefault(),A(-1)):U.key==="Enter"?(U.preventDefault(),I()):U.key==="Escape"&&(U.preventDefault(),B())}),c.append(u),D(),m.open&&(u.focus(),u.setSelectionRange(m.query.length,m.query.length)),c}const sd=[{key:"solid",labelKey:"formatBar.k54",preview:"1.5px solid currentColor"},{key:"dashed",labelKey:"formatBar.k55",preview:"1.5px dashed currentColor"},{key:"dotted",labelKey:"formatBar.k56",preview:"1.5px dotted currentColor"},{key:"double",labelKey:"formatBar.k57",preview:"3px double currentColor"}],dd={left:"TextAlignStart",center:"TextAlignCenter",right:"TextAlignEnd",justify:"TextAlignJustify"};function lt(e,t,o,r,i={}){return l("button",{type:"button",class:`ft-cell-btn${i.on?" on":""}`,dataset:{test:e,tip:t},disabled:!!i.disabled,onClick:r,html:`<svg viewBox="0 0 18 18" width="18" height="18" aria-hidden="true">${o}</svg>`})}const Mt='<rect class="g-faint" x="2.5" y="2.5" width="13" height="13" />',Vi='<rect class="g-solid" x="2.5" y="2.5" width="13" height="13" fill="none" />';function pd(e){const t=e.format;t.syncBorderDraft();const o=t.values,r=!t.fontEditable,i=r||t.context==="cells",n=t.context==="none",s=t.context==="cells",d=!t.painterActive&&(t.context==="none"||t.context==="cells"||!t.painterCapturable),c=t.painterActive?a(e,"formatBar.k58"):t.context==="cells"?a(e,"formatBar.k59"):t.context==="none"?a(e,"formatBar.k60"):t.painterCapturable?a(e,"formatBar.k62"):a(e,"formatBar.k61"),u=m=>r?a(e,"formatBar.k63",{v0:m}):m,f=[l("div",{class:"ft-border-panel",dataset:{test:"border-panel"}},[l("div",{class:"ft-border-grid"},[lt("preset-none",a(e,"formatBar.k64"),`${Mt}<line class="g-solid" x1="4" y1="14" x2="14" y2="4" />`,()=>t.applyBorderPreset("none")),lt("preset-all",a(e,"formatBar.k65"),`${Vi}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("all")),lt("preset-outer",a(e,"formatBar.k66"),Vi,()=>t.applyBorderPreset("outer")),lt("preset-inner",s?a(e,"formatBar.k67"):a(e,"formatBar.k68"),`${Mt}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("inner"),{disabled:!s}),lt("edge-top",a(e,"formatBar.k69"),`${Mt}<line class="g-solid" x1="2" y1="3" x2="16" y2="3" />`,()=>t.applyEdge("top"),{on:t.edgeOn("top")}),lt("edge-bottom",a(e,"formatBar.k70"),`${Mt}<line class="g-solid" x1="2" y1="15" x2="16" y2="15" />`,()=>t.applyEdge("bottom"),{on:t.edgeOn("bottom")}),lt("edge-left",a(e,"formatBar.k71"),`${Mt}<line class="g-solid" x1="3" y1="2" x2="3" y2="16" />`,()=>t.applyEdge("left"),{on:t.edgeOn("left")}),lt("edge-right",a(e,"formatBar.k72"),`${Mt}<line class="g-solid" x1="15" y1="2" x2="15" y2="16" />`,()=>t.applyEdge("right"),{on:t.edgeOn("right")})]),l("div",{class:"ft-style-row"},sd.map(m=>l("button",{type:"button",class:`ft-style-btn${t.borderStyle===m.key?" on":""}`,dataset:{test:`style-${m.key}`,tip:t.borderStyle===m.key?a(e,"formatBar.k73",{v0:a(e,m.labelKey)}):a(e,m.labelKey)},onClick:()=>{t.toggleBorderStyle(m.key),e.repaint()}},[l("span",{class:"ft-style-line",style:{borderTop:m.preview}})]))),l("div",{class:"ft-border-style-row"},[l("span",{class:"ft-edge-label",text:a(e,"formatBar.k74")}),l("div",{class:"ft-line-width"},[H({value:t.borderWidth,min:.25,max:5,step:.25,placeholder:t.borderMixed.width?a(e,"formatBar.k75"):void 0,onCommit:m=>{t.setBorderWidth(m),e.repaint()}})])]),l("div",{class:"ft-border-style-row"},[l("span",{class:"ft-edge-label",text:a(e,"formatBar.k76")}),Ae(t.borderColor,m=>{t.setBorderColor(m),e.repaint()},a(e,"formatBar.k77"))]),t.borderMixedAny?l("p",{class:"pd-hint",text:a(e,"formatBar.k78")}):""].filter(Boolean))],b=[l("div",{class:"ft-align-panel",dataset:{test:"align-panel"}},[l("div",{class:"ft-align-row"},[["left",a(e,"formatBar.k79"),"TextAlignStart"],["center",a(e,"formatBar.k80"),"TextAlignCenter"],["right",a(e,"formatBar.k81"),"TextAlignEnd"],["justify",a(e,"formatBar.k82"),"TextAlignJustify"]].map(([m,E,y])=>l("button",{type:"button",class:`ft-cell-btn${o.textAlign===m?" on":""}`,dataset:{test:`align-${m}`,tip:E},disabled:r,onClick:()=>t.applyStyle({textAlign:m}),html:ge(y)}))),l("div",{class:"ft-align-row"},[["top",a(e,"formatBar.k83"),"ArrowUpToLine"],["middle",a(e,"formatBar.k84"),"ChevronsUpDown"],["bottom",a(e,"formatBar.k85"),"ArrowDownToLine"]].map(([m,E,y])=>l("button",{type:"button",class:`ft-cell-btn${o.verticalAlign===m?" on":""}`,dataset:{test:`valign-${m}`,tip:E},disabled:r,onClick:()=>t.applyStyle({verticalAlign:m}),html:ge(y)})))])];return l("div",{class:"format-toolbar"},[l("div",{class:"tb-ou ft-group",dataset:{unit:"painter"}},[l("button",{type:"button",class:`ft-btn${t.painterActive?" on":""}`,dataset:{test:"format-painter",tip:c},disabled:d,onClick:()=>{t.painterActive?t.cancelPainter():t.pickPainterSource(!1),e.repaint()},onDblclick:()=>{t.pickPainterSource(!0),e.repaint()},html:ge("Paintbrush")})]),l("div",{class:"tb-ou ft-group",dataset:{unit:"font"}},[l("div",{class:"ft-font"},[ko({id:"ft-font",state:e.state,fonts:e.host.fonts,value:typeof o.fontFamily=="string"?o.fontFamily:void 0,placeholder:o.fontFamily===yt?a(e,"formatBar.k86"):a(e,"formatBar.k87"),disabled:r,onChange:m=>t.applyStyle({fontFamily:m})})]),l("div",{class:"ft-size",dataset:{test:"font-size"}},[H({value:typeof o.fontSize=="number"?o.fontSize:void 0,min:5,max:72,disabled:r,placeholder:o.fontSize===yt?a(e,"formatBar.k88"):a(e,"formatBar.k89"),onCommit:m=>t.applyStyle({fontSize:m})})])]),l("div",{class:"tb-ou ft-group",dataset:{unit:"style"}},[...[["bold","Bold",a(e,"formatBar.k90"),()=>t.toggleBold()],["underline","Underline",a(e,"formatBar.k91"),()=>t.toggleUnderline()],["strike","Strikethrough",a(e,"formatBar.k92"),()=>t.toggleStrike()]].map(([m,E,y,C])=>l("button",{type:"button",class:`ft-btn${o[m]===!0?" on":""}`,dataset:{test:m,tip:u(y)},disabled:m==="bold"?r:i,onClick:C,html:ge(E)}))]),l("div",{class:"tb-ou ft-group",dataset:{unit:"color"}},[l("span",{class:`ft-color-btn${r?" dim":""}`,title:a(e,"formatBar.k93",{v0:r?a(e,"formatBar.fontDisabledHint"):""})},[Ae(typeof o.color=="string"?o.color:void 0,m=>t.applyStyle({color:m})),l("span",{class:"ft-glyph",text:"A"})]),l("span",{class:`ft-color-btn${n?" dim":""}`,title:a(e,"formatBar.k94")},[Ae(typeof o.backgroundColor=="string"?o.backgroundColor:void 0,m=>t.applyStyle({backgroundColor:m})),l("span",{class:"ft-glyph",html:ge("PaintBucket",14)})])]),l("div",{class:"tb-ou ft-group",dataset:{unit:"align"}},[fo(e,"align",{icon:dd[String(o.textAlign)]??"TextAlignStart",text:a(e,"formatBar.k95"),textClass:"ft-btn-text",tip:r?a(e,"formatBar.k96"):a(e,"formatBar.k97"),disabled:r,testId:"align-dd"},b)]),l("div",{class:"tb-ou ft-group",dataset:{unit:"border"}},[fo(e,"border",{icon:"Grid3x3",text:a(e,"formatBar.k98"),textClass:"ft-btn-text",tip:n?a(e,"formatBar.k99"):a(e,"formatBar.k100"),disabled:n,testId:"border"},f)])])}const cd="1.6.1";xo.filter(e=>e.material).map(e=>({type:e.type,label:e.label,icon:e.icon}));function Eo(e,t){return ge(e??"Shapes",t)||ge("Shapes",t)}function hd(e){const t=e.state;if(t.leftCollapsed)return l("div",{class:"left-panel collapsed"},[l("div",{class:"left-collapsed"},[Gi("ChevronsRight",a(e,"panels.k137"),()=>{t.leftCollapsed=!1,e.repaint()}),...[["elements",a(e,"panels.k138"),"Table2"],["fields",a(e,"panels.k139"),"ListTree"],["layers",a(e,"panels.k140"),"Layers"]].map(([r,i,n])=>l("button",{type:"button",class:`lc-btn${t.leftTab===r?" on":""}`,title:i,html:Eo(n,14),onClick:()=>{t.leftTab=r,t.leftCollapsed=!1,e.repaint()}}))])]);const o=(r,i,n="")=>l("div",{class:`pd-tab-pane${n?` ${n}`:""}`,role:"tabpanel",dataset:{pane:`left:${r}`},style:t.leftTab===r?"":{display:"none"}},i);return l("div",{class:"left-panel"},[l("div",{class:"left-head"},[l("span",{class:"left-title",text:a(e,"panels.k141")}),Gi("ChevronsLeft",a(e,"panels.k142"),()=>{t.leftCollapsed=!0,e.repaint()})]),l("div",{class:"pd-tabs left-tabs"},[l("div",{class:"pd-tab-bar",role:"tablist"},[...[["elements",a(e,"panels.k143")],["fields",a(e,"panels.k144")],["layers",a(e,"panels.k145")]].map(([r,i])=>l("button",{type:"button",class:`pd-tab${t.leftTab===r?" active":""}`,text:i,onClick:()=>{t.leftTab=r,e.repaint()}}))]),o("elements",gd(e),"material-grid"),o("fields",[md(e)]),o("layers",[yd(e)])])])}function Gi(e,t,o){return l("button",{type:"button",class:"collapse-btn",title:t,html:Eo(e,14),onClick:o})}const qn={text:"elementDefinitions.k553",barcode:"elementDefinitions.k554",qrcode:"elementDefinitions.k555",image:"elementDefinitions.k556",table:"elementDefinitions.k557",longText:"elementDefinitions.k558",flowList:"elementDefinitions.k559",hline:"elementDefinitions.k560",vline:"elementDefinitions.k561",rect:"elementDefinitions.k562",oval:"elementDefinitions.k563",pageNumber:"elementDefinitions.k564",barChart:"echarts.series.typeNames.bar",barHChart:"echarts.series.typeNames.barH",lineChart:"echarts.series.typeNames.line",areaChart:"echarts.series.typeNames.area",pieChart:"echarts.series.typeNames.pie",doughnutChart:"echarts.series.typeNames.doughnut",scatterChart:"echarts.series.typeNames.scatter",radarChart:"echarts.series.typeNames.radar",funnelChart:"echarts.series.typeNames.funnel",gaugeChart:"echarts.series.typeNames.gauge"},ud={barChart:"elementGroup.chart"};function fd(e,t,o,r){return l("div",{class:`material-card${h.isWideMaterialLabel(r??t)?" material-card--wide":""}`,draggable:!0,dataset:{test:`material-${e}`},onDragstart:i=>{const n=i.dataTransfer;n?.setData("elementType",e),n&&(n.effectAllowed="all")}},[l("span",{class:"material-icon","data-icon":o,html:Eo(o,14)}),l("span",{class:"material-label",text:r??t})])}function gd(e){const t=[];let o;for(const r of xn()){const i=r.group;if(i&&i!==o){const c=ud[r.type];t.push(l("div",{class:"material-group-title",text:c?a(e,c):i}))}i&&(o=i);const n=qn[r.type],s=n?a(e,n):void 0,d=s&&s!==n?s:void 0;t.push(fd(r.type,r.label,r.icon,d))}return[l("div",{class:"panel-title",text:a(e,"panels.k146")}),...t]}function md(e){const t=e.state,o=t.fieldDisplay??"both",r=h.groupFields(e.store.fields),i=(t.fieldSearch??"").trim().toLowerCase(),n=i?r.map(s=>({...s,fields:s.fields.filter(d=>`${d.fieldLabel}${d.fieldKey}`.toLowerCase().includes(i))})).filter(s=>s.fields.length):r;return l("div",{class:"field-tree-panel"},[l("div",{class:"panel-title",text:a(e,"panels.k147")}),l("input",{class:"pd-input search-input",type:"search",placeholder:a(e,"panels.k148"),"aria-label":a(e,"panels.k149"),value:t.fieldSearch??"",onInput:s=>{t.fieldSearch=s.target.value},onChange:()=>e.repaint()}),l("div",{class:"tree-container"},n.flatMap(s=>{const d=t.collapsedGroups.has(s.key)&&!i,c=s.key?l("div",{class:`field-group-header${s.isList?" is-list":""}`,onClick:()=>{d?t.collapsedGroups.delete(s.key):t.collapsedGroups.add(s.key),e.repaint()}},[l("span",{class:"expand-icon",text:d?"▶":"▼"}),l("span",{class:"node-icon",text:s.isList?"📋":"📁"}),l("span",{class:"group-label",text:s.label,"data-tip":s.label})]):"",u=d?[]:s.fields.map(f=>l("div",{class:"field-row",draggable:!0,"data-tip":a(e,"panels.k150",{v0:f.fieldLabel,v1:f.fieldKey}),style:{paddingLeft:`${s.key?22:8}px`},onDragstart:b=>{const m=b.dataTransfer;m?.setData("fieldKey",f.fieldKey),m&&(m.effectAllowed="all")},onClick:()=>{h.copyTextToClipboard(f.fieldLabel||f.fieldKey).then(b=>{b&&(t.copiedFieldKey=f.fieldKey,e.repaint(),setTimeout(()=>{t.copiedFieldKey===f.fieldKey&&(t.copiedFieldKey="",e.repaint())},1200))})}},[l("span",{class:"node-icon",text:"📄"}),l("span",{class:"node-meta"},[o!=="key"?l("span",{class:"node-label",text:f.fieldLabel||f.fieldKey}):"",o!=="label"?l("span",{class:`node-key${o==="key"?" is-primary":""}`,text:o==="key"?f.fieldKey:`(${f.fieldKey})`}):""].filter(Boolean)),t.copiedFieldKey===f.fieldKey?l("span",{class:"copy-hint",text:a(e,"panels.k151")}):""].filter(Boolean)));return[c,l("div",{},u.filter(Boolean))].filter(Boolean)})),n.length===0?l("p",{class:"pd-empty",text:a(e,"panels.k152")}):""].filter(Boolean))}function bd(e,t){if(e.options.title)return e.options.title;const o=qn[e.printElementType.type];return o?a(t,o):e.printElementType.title||e.printElementType.type}function yd(e){const t=e.store,o=[...t.elements].sort((d,c)=>(c.options.zIndex??0)-(d.options.zIndex??0)),r=t.elements.filter(d=>t.selectedIds.has(d.id)),i=r.length>=2,n=r.some(d=>!!d.options.groupId),s=d=>d.zone==="header"?a(e,"panels.k153"):d.zone==="footer"?a(e,"panels.k154"):"";return l("div",{class:"layer-panel"},[l("div",{class:"panel-title",text:a(e,"panels.k155")}),...o.map(d=>{const c=En(d.printElementType.type);return l("div",{class:`layer-item${t.selectedIds.has(d.id)?" active":""}`,onClick:u=>t.selectElement(d.id,u.ctrlKey||u.metaKey)},[l("span",{class:"layer-icon","data-icon":c??"Shapes",html:Eo(c,12)}),l("span",{class:"layer-name",text:bd(d,e)}),s(d)?l("span",{class:"layer-zone",text:s(d)}):"",l("span",{class:"layer-zindex",text:`z:${d.options.zIndex??0}`})].filter(Boolean))}),o.length?l("div",{class:"layer-actions"},[...[["top",a(e,"panels.k156"),"ArrowUpToLine"],["up",a(e,"panels.k157"),"ArrowUp"],["down",a(e,"panels.k158"),"ArrowDown"],["bottom",a(e,"panels.k159"),"ArrowDownToLine"]].map(([d,c,u])=>l("button",{type:"button",class:"pd-button small",title:c,html:ge(u,14),onClick:()=>e.fire("move-layer",d)}))]):"",i||n?l("div",{class:"layer-actions"},[i?l("button",{type:"button",class:"pd-button small",title:a(e,"panels.k160"),html:ge("Group",14),onClick:()=>e.fire("group")}):"",n?l("button",{type:"button",class:"pd-button small",title:a(e,"panels.k161"),html:ge("Ungroup",14),onClick:()=>e.fire("ungroup")}):""].filter(Boolean)):""].filter(Boolean))}function vd(e){const t=e.store,o=e.state,r=t.pages.length>1,i=t.pages[t.activePageIndex]?.name||a(e,"panels.k162",{v0:t.activePageIndex+1}),n=t.tilingEnabled;return l("div",{class:"page-tabs"},[l("div",{class:"page-tabs-list"},t.pages.map((d,c)=>o.renamingPage===c?l("input",{class:"page-tab-rename",dataset:{test:"page-rename-input"},value:o.renameText??"",onInput:u=>{o.renameText=u.target.value},onBlur:()=>s(),onKeydown:u=>{const f=u;if(f.key==="Enter"){s();return}f.key==="Escape"&&(o.renamingPage=null,e.repaint())}}):l("button",{type:"button",class:`page-tab${c===t.activePageIndex?" active":""}`,dataset:{tip:d.name?a(e,"panels.k163",{v0:d.name}):a(e,"panels.k164")},text:d.name||a(e,"panels.k165",{v0:c+1}),onClick:()=>t.switchPage(c),onDblclick:()=>{o.renamingPage=c,o.renameText=d.name??"",e.repaint()}}))),l("div",{class:"page-tabs-actions"},[l("button",{type:"button",dataset:{test:"add-page",tip:n?a(e,"panels.k166"):a(e,"panels.k167")},disabled:n,text:"+",onClick:()=>e.fire("add-page")}),l("button",{type:"button",dataset:{test:"duplicate-page",tip:n?a(e,"panels.k168"):a(e,"panels.k169",{v0:i})},disabled:n,text:"⧉",onClick:()=>e.fire("duplicate-page")}),l("button",{type:"button",dataset:{test:"delete-page",tip:r?a(e,"panels.k170",{v0:i}):a(e,"panels.k171")},disabled:!r,text:"✕",onClick:()=>e.fire("delete-page")}),l("button",{type:"button",dataset:{test:"move-left",tip:a(e,"panels.k172",{v0:i})},disabled:t.activePageIndex<=0,text:"←",onClick:()=>e.fire("move-page",-1)}),l("button",{type:"button",dataset:{test:"move-right",tip:a(e,"panels.k173",{v0:i})},disabled:t.activePageIndex>=t.pages.length-1,text:"→",onClick:()=>e.fire("move-page",1)})])]);function s(){const d=(o.renameText??"").trim();o.renamingPage!==null&&d&&t.renamePage(o.renamingPage,d),o.renamingPage=null,e.repaint()}}function xd(e){const t=e.store,o=t.templateData,r=h.getPaperDimensions(o),i=o.orientation==="landscape"?a(e,"panels.k174"):a(e,"panels.k175"),n=h.PAPER_PRESETS[o.paperSize],s=n?a(e,n.labelKey):o.paperSize,d=o.outputRotation,c=`${s} ${i} ${Math.round(r.width)}×${Math.round(r.height)}mm${d?a(e,"panels.paperRotated",{rot:d}):""}`;return l("div",{class:"status-bar"},[l("span",{class:"status-item coord",dataset:{coord:""},style:{display:"none"}}),l("span",{class:"status-item",text:a(e,"panels.k176",{v0:t.scale})}),l("span",{class:"status-item",text:a(e,"panels.statusElements",{count:t.elements.length,selected:t.selectedIds.size?a(e,"panels.statusSelected",{n:t.selectedIds.size}):""})}),l("span",{class:"status-item status-version",text:`v${cd}`}),l("span",{class:"status-item status-paper",text:c})])}const wd=Object.keys(h.PAPER_PRESETS).filter(e=>e!=="CUSTOM"&&!h.PAPER_PRESETS[e]?.continuous);function kd(e){const t=document.createElement("label");t.className="pd-button small upload-label";const o=document.createTextNode(a(e,"pageExtras.k103")),r=document.createElement("input");r.className="visually-hidden",r.type="file",r.accept="image/*",t.append(o,r);const i=n=>{t.className=`pd-button small upload-label${n?" disabled":""}`,r.disabled=n};return r.addEventListener("change",async()=>{const n=r.files?.[0];if(!n)return;if(!n.type.startsWith("image/")){alert(a(e,"pageExtras.k104")),r.value="";return}const s=e.host.uploadDesignBackground;if(!s){alert(a(e,"pageExtras.k105")),r.value="";return}i(!0),o.textContent=a(e,"pageExtras.k106");try{const d=await s(n);d?e.store.updateTemplateData({designBackground:{src:d,rotation:0}}):alert(a(e,"pageExtras.k107"))}catch(d){alert(d instanceof Error?d.message:a(e,"pageExtras.k108"))}finally{o.textContent=a(e,"pageExtras.k109"),i(!e.host.uploadDesignBackground),r.value=""}}),e.host.uploadDesignBackground||i(!0),t}function Ed(e){const o=e.store.templateData.designBackground,r=o?.rotation??0;return l("div",{class:"design-background-config"},[Ge(a(e,"pageExtras.k110")),l("p",{class:"design-background-tip",text:a(e,"pageExtras.k111")}),o?.src?[l("div",{class:"design-background-path",title:o.src,text:o.src}),l("div",{class:"design-background-actions"},[l("button",{type:"button",class:"pd-button small rotate-btn",text:a(e,"pageExtras.k112",{v0:(r+90)%360}),onClick:()=>e.store.updateTemplateData({designBackground:{...o,rotation:(r+90)%360}})}),l("button",{type:"button",class:"pd-button small remove-btn",text:a(e,"pageExtras.k113"),onClick:()=>e.store.updateTemplateData({designBackground:void 0})})])]:kd(e)].flat())}function Sd(e){const t=e.store,o=t.templateData,r=o.tiling,i={...R.TILE_DEFAULTS,...r??{},enabled:r?.enabled??!1,sheetMargin:{...R.TILE_DEFAULTS.sheetMargin,...r?.sheetMargin??{}}},n=h.isContinuousPaperSize(o.paperSize),s=y=>t.updateTemplateData({tiling:{...i,...y}}),d=y=>kt({target:i,base:R.TILE_DEFAULTS,propKey:y,write:()=>s({[y]:R.TILE_DEFAULTS[y]})}),c=y=>kt({target:i.sheetMargin,base:R.TILE_DEFAULTS.sheetMargin,propKey:y,write:()=>u(y,R.TILE_DEFAULTS.sheetMargin[y])}),u=(y,C)=>s({sheetMargin:{...i.sheetMargin,[y]:C??0}}),f={...o,tiling:i},b=R.validateTiling(f),m=Math.max(R.computeMaxColumns(f),1);let E="";if(!b.length)try{const y=R.computeTileLayout(f),C=R.resolveSheetMm(f),D=i.sheetPaperSize==="CUSTOM"?a(e,"pageExtras.k114"):i.sheetPaperSize??"A4",S=i.sheetPaperSize==="CUSTOM"?"":i.sheetOrientation==="landscape"?a(e,"pageExtras.k115"):a(e,"pageExtras.k116");E=a(e,"pageExtras.k117",{v0:D,v1:S,v2:C.width,v3:C.height,v4:y.columns,v5:y.rows,v6:y.perSheet,v7:y.tile.width,v8:y.tile.height})}catch{E=""}return l("div",{class:"tiling-config",dataset:{test:"tiling-config"}},[Ge(a(e,"pageExtras.k118")),l("p",{class:"pd-hint",text:a(e,"pageExtras.k119")}),l("div",{class:"pd-field"},[l("label",{class:"tiling-switch"},[l("input",{type:"checkbox",checked:i.enabled===!0,disabled:n,onChange:y=>{if(!y.target.checked){s({enabled:!1});return}s({...R.TILE_DEFAULTS,columns:Math.min(R.TILE_DEFAULTS.columns,Math.max(m,1))})}}),l("span",{text:a(e,"pageExtras.k120")})]),n?l("p",{class:"pd-hint tiling-error",text:a(e,"pageExtras.k121")}):""].filter(Boolean)),i.enabled&&!n?[q(a(e,"pageExtras.k122"),l("select",{class:"pd-select",style:{width:"100%"},onChange:y=>{const C=y.target.value;if(C!=="CUSTOM"){s({sheetPaperSize:C});return}const D=R.resolveSheetMm(f);s({sheetPaperSize:"CUSTOM",sheetCustomWidth:i.sheetCustomWidth??D.width,sheetCustomHeight:i.sheetCustomHeight??D.height})}},[...wd.map(y=>l("option",{value:y,text:a(e,h.PAPER_PRESETS[y]?.labelKey??y),selected:(i.sheetPaperSize??"A4")===y})),l("option",{value:"CUSTOM",text:a(e,"pageExtras.k123"),selected:i.sheetPaperSize==="CUSTOM"})]),void 0,d("sheetPaperSize")),i.sheetPaperSize==="CUSTOM"?q(a(e,"pageExtras.k124"),l("div",{class:"custom-size-grid"},[H({value:Number(i.sheetCustomWidth??0),min:25,max:2e3,onCommit:y=>s({sheetCustomWidth:y})}),l("span",{class:"custom-size-x",text:"×"}),H({value:Number(i.sheetCustomHeight??0),min:25,max:2e3,onCommit:y=>s({sheetCustomHeight:y})})])):q(a(e,"pageExtras.k125"),dt("tiling-ori",[{value:"portrait",label:a(e,"pageExtras.k126")},{value:"landscape",label:a(e,"pageExtras.k127")}],i.sheetOrientation==="landscape"?"landscape":"portrait",y=>s({sheetOrientation:y})),void 0,d("sheetOrientation")),Ge(a(e,"pageExtras.k128")),l("div",{class:"margin-grid"},[q(a(e,"pageExtras.k129"),H({value:i.sheetMargin.top??0,min:0,max:100,onCommit:y=>u("top",y)}),void 0,c("top")),q(a(e,"pageExtras.k130"),H({value:i.sheetMargin.bottom??0,min:0,max:100,onCommit:y=>u("bottom",y)}),void 0,c("bottom")),q(a(e,"pageExtras.k131"),H({value:i.sheetMargin.left??0,min:0,max:100,onCommit:y=>u("left",y)}),void 0,c("left")),q(a(e,"pageExtras.k132"),H({value:i.sheetMargin.right??0,min:0,max:100,onCommit:y=>u("right",y)}),void 0,c("right"))]),Ge(a(e,"pageExtras.k133")),q(a(e,"pageExtras.k134"),H({value:i.gapX??0,min:0,max:50,onCommit:y=>s({gapX:y??0})}),void 0,d("gapX")),q(a(e,"pageExtras.k135"),H({value:i.gapY??0,min:0,max:50,onCommit:y=>s({gapY:y??0})}),void 0,d("gapY")),q(a(e,"pageExtras.k136"),H({value:i.columns??1,min:1,max:m,onCommit:y=>s({columns:y||1})})),...b.map(y=>l("p",{class:"pd-hint tiling-error",text:y.message})),!b.length&&E?l("p",{class:"pd-hint tiling-summary",text:E}):""]:""].flat().filter(Boolean))}const Td=new Set(h.PROPERTY_REGISTRY.map(e=>e.group)),Cd={"table-settings":"content"},qi=new Map;function Wr(e){const t=e??"";let o=qi.get(t);if(!o){const{groups:r,itemKeys:i}=h.searchProperties(t);o={groups:r,keys:i,searching:!!t.trim()},qi.set(t,o)}return o}function Kr(e){const t=Cd[e]??e;return Td.has(t)?t:""}function Dd(e,t){const o=Wr(e.state.propSearch);if(!o.searching)return!0;const r=Kr(t);return!r||o.groups.includes(r)}function Pd(e,t){const o=Wr(e.state.propSearch);return!o.searching||o.keys.has(t)}function Yn(e,t){const o=e.props.style??{};return e.props.style={...o,display:t?"":"none"},e}function M(e,t,o){const r=o.props.dataset??{};return o.props.dataset={...r,propKey:t},Yn(o,Pd(e,t))}function Ad(e,t,o){const r=Kr(t);if(!r)return o;const i=o.props.dataset??{};return o.props.dataset={...i,propGroup:r},Yn(o,Dd(e,t))}function jn(e,t){const o=Wr(t);for(const r of Array.from(e.querySelectorAll("[data-prop-group]"))){const i=Kr(r.dataset.propGroup??"");r.style.display=!o.searching||!i||o.groups.includes(i)?"":"none"}for(const r of Array.from(e.querySelectorAll("[data-prop-key]")))r.style.display=!o.searching||o.keys.has(r.dataset.propKey??"")?"":"none"}function Md(e){return l("div",{class:"property-search"},[l("input",{class:"pd-input",type:"search",placeholder:a(e,"propertySearch.k328"),"aria-label":a(e,"propertySearch.k329"),value:e.state.propSearch??"",onInput:t=>{const o=t.target,r=o.value;e.state.propSearch=r,jn(o.getRootNode(),r)}})])}const _d={Document:"≡",Brush:"◧",Setting:"⚙"};function Rd(e,t){try{const o=window.localStorage.getItem(`property-group-${e}`);return o===null?t:o==="true"}catch{return t}}function Fd(e,t){try{window.localStorage.setItem(`property-group-${e}`,String(t))}catch{}}function Te(e,t,o,r,i,n=!0,s=[]){const d=Rd(t,n);return Ad(e,t,l("div",{class:`property-group${d?" is-expanded":""}`},[l("div",{class:"group-header",onClick:()=>{Fd(t,!d),e.repaint()}},[l("span",{class:"group-icon",text:_d[r]||"•"}),l("span",{class:"group-title",text:o}),...s,l("span",{class:"expand-icon",text:d?"▾":"▸"})]),l("div",{class:"group-content",style:d?"":{display:"none"}},i.filter(Boolean))]))}function So(e){return l("form",{class:"pd-form",onSubmit:t=>t.preventDefault()},e.filter(Boolean))}function Xn(e){return e.split(".").flatMap(t=>{const o=t.match(/^([^\[]+)((?:\[\d+\])*)$/);if(!o)return[t];const r=o[1],i=[...o[2].matchAll(/\[(\d+)\]/g)].map(n=>Number(n[1]));return[r,...i]})}function Yi(e,t){return Xn(t).reduce((i,n)=>i==null?"":i[n],e)??""}function Vr(e,t,o,r){const i=Xn(o),n=i.pop(),s=i.reduce((d,c)=>((d[c]===void 0||d[c]===null)&&(d[c]={}),d[c]),t);s[n]=r||void 0,e.recordHistory(),e.emit()}function Id(e,t){const o=e.store;if(t.printElementType.type==="table"&&o.tableSelection?.elementId===t.id){const{r1:r,c1:i}=o.tableSelection,n=(t.options.tableRows??[])[r];if(n)return h.getTableCellBindings(n.type,r,i,t.options.fields?.[0]?.dataSource)}return h.getElementBindings(t)}function Ld(e,t){const o=document.createElement("label");o.className="pd-button small upload-label",Se(l("svg",{class:"pd-icon",viewBox:"0 0 24 24","aria-hidden":"true"},[l("path",{fill:"currentColor",d:"M12 3l4 4h-3v7h-2V7H8zm-7 12h14v5H5Z"})]),o);const r=document.createTextNode(a(e,"binding.k1")),i=document.createElement("input");i.className="visually-hidden",i.type="file",i.accept="image/*",o.append(r,i);const n=c=>{o.className=`pd-button small upload-label${c?" disabled":""}`,i.disabled=c};i.addEventListener("change",async()=>{const c=i.files?.[0];if(!c)return;if(!c.type.startsWith("image/")){alert(a(e,"binding.k2")),i.value="";return}const u=e.host.uploadImage;if(!u){alert(a(e,"binding.k3")),i.value="";return}n(!0),r.textContent=a(e,"binding.k4");try{const f=await u(c);f?Vr(e.store,t,"options.src",f):alert(a(e,"binding.k5"))}catch(f){alert(f instanceof Error?f.message:a(e,"binding.k6"))}finally{r.textContent=a(e,"binding.k7"),n(!e.host.uploadImage),i.value=""}}),e.host.uploadImage||n(!0);const s=document.createElement("div");s.className="image-content-upload";const d=document.createElement("p");return d.className="upload-tip",d.textContent=a(e,"binding.k8"),s.append(o,d),s}function zd(e,t){const o=r=>e.fire("open-expression",{elementId:t.id,targetPath:r.targetPath,value:Yi(t,r.targetPath)});return Te(e,"binding",a(e,"binding.k9"),"Document",[...Id(e,t).map(r=>q(r.labelKey?a(e,r.labelKey):r.label,l("input",{class:"pd-input",type:"text",value:Yi(t,r.targetPath),placeholder:r.placeholder||a(e,"binding.k10"),onChange:i=>Vr(e.store,t,r.targetPath,i.target.value),onDblclick:()=>o(r)}))),t.printElementType.type==="image"?Ld(e,t):""].filter(Boolean))}const Ht=new Map;function lo(e){return`${Math.round(e*1e4)/1e4}%`}function Zn(e,t){const o=h.parseCropAnchor(t.value),r=o.kind==="custom",i=o.kind==="axes"?o.x:50,n=o.kind==="axes"?o.y:50,s=h.resolveCropPreview(t.src),d=Ht.get(s.src),c={widthMm:t.widthMm,heightMm:t.heightMm,naturalWidth:d?.width,naturalHeight:d?.height,fit:t.fit,scalePct:t.scale},u=h.resolveCropTravel(c),f=h.cropWindow(c,i,n),b=document.createElement("select");b.className="pd-select",b.style.width="100%";for(const C of h.cropPresetOptions(u,i,n)){const D=document.createElement("option");D.value=C.value,D.textContent=C.label,b.appendChild(D)}if(r){const C=document.createElement("option");C.value="custom",C.textContent=a(e,"cropAnchor.k37"),b.appendChild(C)}b.value=r?"custom":`${i},${n}`,b.selectedIndex<0&&(b.selectedIndex=r?b.options.length-1:0),b.addEventListener("change",()=>{if(b.value==="custom")return;const[C,D]=b.value.split(",").map(Number);t.onCommit(h.buildCropAnchor(C,D))});const m=a(e,`propertyTips.${t.fieldKey}`),E=[l("div",{class:"pd-field",dataset:{field:t.fieldKey}},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t"},[t.label,mr(m)]),t.resetAnchor??""].filter(Boolean)),b])];E.push(l("div",{class:"pd-field",dataset:{field:"ap-img-fit-scale"}},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t"},[h.cropScaleLabel(),mr(a(e,"propertyTips.ap-img-fit-scale"))]),t.resetScale??""].filter(Boolean)),H({value:t.scale,min:h.CROP_SCALE_MIN,max:h.CROP_SCALE_MAX,step:5,placeholder:a(e,"cropAnchor.k38"),onCommit:C=>t.onScaleCommit(C>h.CROP_SCALE_MIN?C:void 0)})]));for(const C of h.cropAxisFields(u,i,n))E.push(l("div",{class:"pd-field",dataset:{field:t.fieldKey}},[l("span",{class:"pd-label",text:C.label}),H({value:C.value,min:0,max:100,step:1,onCommit:D=>t.onCommit(h.buildCropAnchor(C.name==="horizontal"?D:i,C.name==="vertical"?D:n))})]));const y=h.cropAxisNote(u,r);return y&&E.push(l("p",{class:"pd-crop-note",text:y})),s.isSample&&E.push(l("p",{class:"pd-crop-note",text:h.cropSampleNote()})),E.push(l("div",{class:"pd-crop-preview"},[l("img",{class:"pd-crop-thumb",src:s.src,alt:s.isSample?a(e,"cropAnchor.k39"):a(e,"cropAnchor.k40"),onLoad:C=>{const D=C.target;if(!(D.naturalWidth>0&&D.naturalHeight>0))return;const S=Ht.get(s.src);S&&S.width===D.naturalWidth&&S.height===D.naturalHeight||(Ht.set(s.src,{width:D.naturalWidth,height:D.naturalHeight}),e.repaint())},onError:()=>{Ht.has(s.src)&&(Ht.delete(s.src),e.repaint())}}),f?l("div",{class:"pd-crop-win",style:{left:lo(f.leftPct),top:lo(f.topPct),width:lo(f.widthPct),height:lo(f.heightPct)}}):""])),l("div",{class:t.containerClass??"pd-crop-anchor"},E)}const bt=e=>Number(e??0),Er=e=>e||void 0;function wt(e,t,o,r,i,n){return l("div",{class:"pd-field"},[l("span",{class:"pd-label",...r?{title:r}:{}},[l("span",{class:"pd-label-t",text:e}),i??""].filter(Boolean)),l("input",{class:"pd-switch",type:"checkbox",checked:t,...n?{disabled:!0}:{},onChange:s=>o(s.target.checked)})])}function Qn(e,t,o,r,i=!1,n){return l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:e}),""].filter(Boolean)),l("select",{class:"pd-select",...i?{style:{width:"100%"}}:{},onChange:s=>r(s.target.value)},o.map(s=>l("option",{value:s.value,text:s.label,selected:s.value===t})))])}function $t(e,t,o,r,i={}){return l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:e}),i.reset??""].filter(Boolean)),gn(t,o,r,{className:"pd-select",...i.full?{width:"100%"}:{}})])}const _t=e=>l("p",{class:"pd-hint",text:e});function Jn(e,t){return e.map(o=>({value:o.value,label:o.labelKey?a(t,o.labelKey):o.label??o.value,...o.disabled?{disabled:!0}:{}}))}const Od="tableProps.k330",Nd=[{value:"header",labelKey:"tableProps.k331"},{value:"data",labelKey:"tableProps.k332"},{value:"subtotal",labelKey:"tableProps.k333"},{value:"summary",labelKey:"tableProps.k334"}],Bd=[{value:"CODE128",labelKey:"tableProps.k335"},{value:"EAN13",labelKey:"tableProps.k336"},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],Ud=[{value:"L",labelKey:"tableProps.k337"},{value:"M",labelKey:"tableProps.k338"},{value:"Q",label:"Q"},{value:"H",labelKey:"tableProps.k339"}],Hd=[{value:"clip",labelKey:"tableProps.k340"},{value:"shrink",labelKey:"tableProps.k341"},{value:"autoHeight",labelKey:"tableProps.k342"}],$d={value:"__multi__",labelKey:"tableProps.k343",disabled:!0};function Wd(e,t){const o=e.store,r=o.tableSelection,i=t.options.tableRows??[],n=r?i[r.r1]:void 0;if(!r||!n)return Te(e,"table-row",a(e,"tableProps.k344"),"Grid",[]);const s=d=>o.updateElement(t.id,d);return Te(e,"table-row",a(e,"tableProps.k345"),"Grid",[So([Qn(a(e,"tableProps.k346"),n.type,Jn(Nd,e),d=>{const c=h.setRowType(i,r.r1,d);if(c){window.alert(c);return}s({tableRows:i})},!0),l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"tableProps.k347")}),H({value:n.height,min:3,max:100,step:.5,onCommit:d=>{n.height=d,s({tableRows:i})}})]),n.type==="header"?wt(a(e,"tableProps.k348"),n.repeatOnPage??!1,d=>{h.setHeaderRepeat(i,d),s({tableRows:i})},a(e,Od)):""])])}function Kd(e,t){const o=e.store,r=t.options,i=f=>o.updateElement(t.id,f),n=r.tableColWidths??[],s=o.paperSize.width-o.templateData.margins.left-o.templateData.margins.right,d=o.fields.filter(f=>f.fieldType==="list").map(f=>({value:f.fieldKey,label:f.fieldLabel})),c=h.createDefaultOptions("table"),u=f=>kt({target:r,base:c,propKey:f,write:()=>i({[f]:c[f]})});return Te(e,"table-settings",a(e,"tableProps.k349"),"Grid",[So([Qn(a(e,"tableProps.k350"),r.dataSource??"",d,f=>i({dataSource:f||void 0}),!0),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k351")}),u("tableDefaultFontFamily")]),ko({id:"table-default-font",state:e.state,fonts:e.host.fonts,value:r.tableDefaultFontFamily,placeholder:a(e,"tableProps.k352"),onChange:f=>i({tableDefaultFontFamily:f||void 0})})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k353")}),u("tableDefaultFontSize")]),H({value:bt(r.tableDefaultFontSize),min:0,max:72,placeholder:a(e,"tableProps.k354"),onCommit:f=>i({tableDefaultFontSize:Er(f)})})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k355")}),u("tableDefaultColor")]),Ae(r.tableDefaultColor,f=>i({tableDefaultColor:f}),a(e,"tableProps.k356"))]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k357")}),u("tableDefaultPadding")]),H({value:bt(r.tableDefaultPadding),min:0,max:10,step:.5,placeholder:a(e,"tableProps.k358"),onCommit:f=>i({tableDefaultPadding:Er(f)})})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"tableProps.k359")}),...n.map((f,b)=>l("div",{class:"col-width-row"},[l("span",{style:{width:"60px"},text:a(e,"tableProps.k360",{v0:b+1})}),H({value:f,min:5,max:200,onCommit:m=>{const E=n.reduce((y,C,D)=>D===b?y:y+C,0);if(E+m>s){const y=Math.max(5,Math.round((s-E)*10)/10);window.alert(a(e,"tableProps.k361",{v0:s,v1:b+1,v2:y})),n[b]=y}else n[b]=m;i({tableColWidths:n})}})]))])])])}function Vd(e,t){const o=e.store,r=t.options,i=t.printElementType.type==="table",n=d=>o.updateElement(t.id,d),s=[];if(i)s.push(M(e,"pg-enabled",wt(a(e,"tableProps.k362"),r.tablePagination?.enabled??!0,d=>n({tablePagination:{enabled:d}}))));else{const d=r.pagination?.pageable??!0,c=r.pagination?.keepWithNext??!1;s.push(M(e,"pg-pageable",wt(a(e,"tableProps.k363"),d,u=>n({pagination:{pageable:u,keepWithNext:c}})))),s.push(M(e,"pg-keep-with-next",wt(a(e,"tableProps.k364"),c,u=>n({pagination:{pageable:d,keepWithNext:u}}))))}return Te(e,"pagination",a(e,"tableProps.k365"),"Document",[So(s)],!1)}const dr=new WeakMap,ji=[{value:"top",labelKey:"tableProps.k366"},{value:"right",labelKey:"tableProps.k367"},{value:"bottom",labelKey:"tableProps.k368"},{value:"left",labelKey:"tableProps.k369"}];function Gd(e,t){const o=e.store,r=o.tableSelection,i=t.options.tableRows??[];if(!r)return Te(e,"table-cell",a(e,"tableProps.k370"),"Menu",[]);const n=h.findMainCell(i,r.r1,r.c1),s=i[n.r]?.cells[n.c];if(!s)return Te(e,"table-cell",a(e,"tableProps.k371"),"Menu",[]);const d=()=>h.collectWritableCells(i,r),c=h.resolveCellGroupMode(i,r),u=c.count,f=c.mode==="multi",b=`${t.id}:${r.r1}:${r.c1}:${r.r2}:${r.c2}`,m=dr.get(o),E=m?.key===b?m:{key:b,border:{},values:{},edges:{}};m?.key!==b&&dr.set(o,E);const y=x=>{dr.set(o,{key:b,border:x.border??E.border,values:x.values??E.values,edges:x.edges??E.edges})},C=(x,G)=>{y({border:{...E.border,[x]:G}}),e.repaint()},D=(x,G)=>{d().forEach(x),f&&G&&y({values:{...E.values,...G}}),o.updateElement(t.id,{tableRows:i})},S=(x,G)=>{D(ye=>{ye[x]=G},{[x]:G})},_=x=>f?E.values[x]:s[x],z=x=>f&&x in E.values,A=f?{width:void 0,style:void 0,color:void 0}:h.resolveCellBorderDisplay(i,r),I=!f&&d().some(x=>!!x.borders&&!!(x.borders.top||x.borders.right||x.borders.bottom||x.borders.left)),K=!f&&!I,B={width:K?0:typeof A.width=="number"?A.width:h.DEFAULT_BORDER.width,style:K?"none":typeof A.style=="string"&&A.style!=="mixed"?A.style:h.DEFAULT_BORDER.style,color:typeof A.color=="string"&&A.color!=="mixed"?A.color:h.DEFAULT_BORDER.color,...E.border},L="__mixed__",U={style:!f&&A.style==="mixed",width:!f&&A.width==="mixed",color:!f&&A.color==="mixed"},re=U.style&&!("style"in E.border),V=U.width&&!("width"in E.border),he=U.color&&!("color"in E.border),ie=re||V||he,Ce=re?L:B.style,ke=V?void 0:B.width,v=he?void 0:B.color,ee=x=>{const G={style:x};x!=="none"&&ke===0?G.width=h.DEFAULT_BORDER.width:x==="none"&&!I&&(G.width=0),y({border:{...E.border,...G}}),e.repaint()},be=()=>({...B}),He=f?ji.reduce((x,G)=>(x[G.value]=E.edges[G.value]?"on":"off",x),{}):h.resolveBorderEdgeStates(d().map(x=>x.borders)),W=f?"cellType"in E.values?E.values.cellType??"text":h.resolveSharedCellType(i,r):s.cellType??"text",ae=W==="barcode",Re=W==="qrcode",Fe=W==="image",qe=W==="text",Y=ae&&!!_("printerDpi"),Ye=h.barcodeBarWidthRecommendText(_("printerDpi"),_("barWidth"),e.t??N),Z=f?E.values.textFit:h.resolveCellTextFit(s),To=f?"cellType"in E.values?E.values.cellType??"text":"":s.cellType||"text",ct=x=>Jn(f?[$d,...x]:x,e),De=x=>f?a(e,"tableProps.k372"):x,Me=(x,G)=>f?E.values[x]:G,Co=f?_("barcodeType")??"__multi__":s.barcodeType||"CODE128",Do=f?z("printerDpi")?_("printerDpi")?String(_("printerDpi")):"":"__multi__":s.printerDpi?String(s.printerDpi):"",Po=f?_("qrCodeLevel")??"__multi__":s.qrCodeLevel||"M",Ao=f?_("fit")??"__multi__":s.fit||"contain",jt=Z??"__multi__",Q=h.canMergeReason(i,r);let rt=!0;for(let x=r.r1;x<=r.r2;x++)if(i[x]?.type!=="data"){rt=!1;break}const J=rt?"":a(e,"tableProps.k373");let it=!1;for(let x=r.r1;x<=r.r2&&!it;x++)for(let G=r.c1;G<=r.c2&&!it;G++){const ye=i[x]?.cells[G];ye&&!ye.merged&&((ye.rowspan??1)>1||(ye.colspan??1)>1)&&(it=!0)}const ue=(x,G,ye,te={},Le)=>l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:x}),Le??""].filter(Boolean)),H({value:G,...te,onCommit:je=>S(ye,Er(je))})]),ht=a(e,"tableProps.k374"),X=x=>kt({target:s,base:{},propKey:x,tipOverride:ht,force:f,write:()=>S(x,void 0)}),Ie=t.options.tableDefaultPadding??1,Lt={width:h.cellFitWidthMm(t.options.tableColWidths??[],n.c,s,Ie),height:h.cellFitCapMm(i,n.r,s,Ie)};return Te(e,"table-cell",a(e,"tableProps.k375"),"Menu",[So([f?_t(a(e,"tableProps.k376",{v0:u})):"",l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"tableProps.k377")}),dt("cell-type",[{value:"text",label:a(e,"tableProps.k378")},{value:"barcode",label:a(e,"tableProps.k379")},{value:"qrcode",label:a(e,"tableProps.k380")},{value:"image",label:a(e,"tableProps.k381")}],To,x=>{const G=x==="text"?void 0:x,ye={cellType:x};x!=="barcode"&&Object.assign(ye,{barcodeType:void 0,showBarcodeText:void 0,printerDpi:void 0,barQuietZone:void 0,barHeight:void 0}),x!=="qrcode"&&Object.assign(ye,{qrCodeLevel:void 0,qrQuietZone:void 0}),D(te=>{te.cellType=G,x!=="barcode"&&(te.barcodeType=void 0,te.showBarcodeText=void 0,te.printerDpi=void 0,te.barQuietZone=void 0,te.barHeight=void 0),x!=="qrcode"&&(te.qrCodeLevel=void 0,te.qrQuietZone=void 0)},ye)})]),ae?$t(a(e,"tableProps.k382"),Co,ct(Bd),x=>{x!=="__multi__"&&S("barcodeType",x||void 0)}):"",ae?wt(a(e,"tableProps.k383"),f?E.values.showBarcodeText===!0:s.showBarcodeText!==!1,x=>S("showBarcodeText",x),void 0,X("showBarcodeText")):"",ae?ue(a(e,"tableProps.k384"),Me("barWidth",s.barWidth??2),"barWidth",{min:2,max:8,step:.5,placeholder:De("")},X("barWidth")):"",ae?_t((Y?a(e,"tableProps.k385"):a(e,"tableProps.k386"))+(Ye?`。${Ye}`:"")):"",ae?xe(a(e,"tableProps.k387"),H({value:Me("barQuietZone",s.barQuietZone),min:0,max:20,placeholder:De(a(e,"tableProps.k388")),onCommit:x=>S("barQuietZone",x)}),a(e,"propertyTips.cd-bar-quiet-zone"),X("barQuietZone")):"",ae?xe(a(e,"tableProps.k389"),H({value:Me("barHeight",s.barHeight),min:1,max:100,placeholder:De(a(e,"tableProps.k390")),onCommit:x=>S("barHeight",x??void 0)}),a(e,"propertyTips.cd-bar-height"),X("barHeight")):"",ae?ue(a(e,"tableProps.k391"),Me("barFontSize",s.barFontSize??10),"barFontSize",{min:5,max:24,placeholder:De(a(e,"tableProps.k392"))},X("barFontSize")):"",ae?$t(a(e,"tableProps.k393"),Do,ct([{value:"",label:a(e,"tableProps.k394")},{value:"203",label:a(e,"tableProps.k395")},{value:"300",label:a(e,"tableProps.k396")},{value:"600",label:a(e,"tableProps.k397")}]),x=>{if(x==="__multi__")return;const G=Number(x);S("printerDpi",G>0?G:void 0)},{reset:X("printerDpi")}):"",ae?_t(a(e,"tableProps.k398")):"",Re?$t(a(e,"tableProps.k399"),Po,ct(Ud),x=>{x!=="__multi__"&&S("qrCodeLevel",x||void 0)},{reset:X("qrCodeLevel")}):"",Re?xe(a(e,"tableProps.k400"),H({value:Me("qrQuietZone",s.qrQuietZone),min:0,max:8,placeholder:De(a(e,"tableProps.k401")),onCommit:x=>S("qrQuietZone",x)}),a(e,"propertyTips.cd-quiet-zone"),X("qrQuietZone")):"",ae?_t(a(e,"tableProps.k402")):"",Re||Fe?$t(a(e,"tableProps.k403"),Ao,ct(h.imageFitOptions(e.t??N)),x=>{x!=="__multi__"&&S("fit",x)},{reset:X("fit")}):"",Fe&&!f&&s.fit==="cover"?Zn(e,{fieldKey:"ap-img-object-position",label:a(e,"tableProps.k404"),src:h.resolveDesignImageSrc(s.formatter),fit:s.fit,containerClass:"pd-cell-anchor",widthMm:Lt.width,heightMm:Lt.height,scale:s.fitScale,value:s.objectPosition,onCommit:x=>S("objectPosition",x),onScaleCommit:x=>S("fitScale",x),resetAnchor:X("objectPosition"),resetScale:X("fitScale")}):"",ae||Re||Fe?ue(a(e,"tableProps.k405"),Me("maxWidth",bt(s.maxWidth)),"maxWidth",{min:0,max:200,placeholder:De(a(e,"tableProps.k406"))},X("maxWidth")):"",ae||Re||Fe?ue(a(e,"tableProps.k407"),Me("maxHeight",bt(s.maxHeight)),"maxHeight",{min:0,max:200,placeholder:De(a(e,"tableProps.k408"))},X("maxHeight")):"",l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"tableProps.k409")}),l("input",{class:"pd-input",type:"text",value:f?_("formatter")??"":s.formatter||"",placeholder:f?a(e,"tableProps.k410"):a(e,"tableProps.k411"),onChange:x=>S("formatter",x.target.value||void 0),onDblclick:()=>e.fire("table-cell-dblclick",{elementId:t.id,r:n.r,c:n.c,cellId:s.id})})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k412")}),X("align")]),dt("cell-align",[{value:"left",label:a(e,"tableProps.k413")},{value:"center",label:a(e,"tableProps.k414")},{value:"right",label:a(e,"tableProps.k415")},{value:"justify",label:a(e,"tableProps.k416")}],f?E.values.align??"":s.align||"left",x=>S("align",x))]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k417")}),X("valign")]),dt("cell-valign",[{value:"top",label:a(e,"tableProps.k418")},{value:"middle",label:a(e,"tableProps.k419")},{value:"bottom",label:a(e,"tableProps.k420")}],f?E.values.valign??"":s.valign||"top",x=>S("valign",x))]),l("div",{class:"cell-style-grid"},[l("div",{class:"pd-field cell-font-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k421")}),X("fontFamily")]),ko({id:"cell-font",state:e.state,fonts:e.host.fonts,value:f?_("fontFamily"):s.fontFamily,placeholder:De(a(e,"tableProps.k422")),onChange:x=>S("fontFamily",x)})]),ue(a(e,"tableProps.k423"),Me("fontSize",bt(s.fontSize)),"fontSize",{min:0,max:72,placeholder:De(a(e,"tableProps.k424"))},X("fontSize")),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k425")}),X("fontWeight")]),l("input",{class:"pd-switch",type:"checkbox",checked:f?E.values.fontWeight==="bold":s.fontWeight==="bold",onChange:x=>S("fontWeight",x.target.checked?"bold":void 0)})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k426")}),X("color")]),Ae(f?_("color"):s.color,x=>S("color",x),a(e,"tableProps.k427"))]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k428")}),X("backgroundColor")]),Ae(f?_("backgroundColor"):s.backgroundColor,x=>S("backgroundColor",x),a(e,"tableProps.k429"))])]),Ge(a(e,"tableProps.k430")),l("div",{class:"border-style-row"},[gn(Ce,[...re?[{value:L,label:a(e,"tableProps.k431"),disabled:!0}]:[],...h.BORDER_LINE_STYLES.map(x=>({...x,label:a(e,x.labelKey)}))],x=>{x!==L&&ee(x)},{width:"90px"}),l("div",{style:{width:"112px",flexShrink:"0"}},[H({value:ke,min:.25,max:5,step:.25,placeholder:f?a(e,"tableProps.k432"):V?a(e,"tableProps.k433"):void 0,onCommit:x=>C("width",x)})]),Ae(v,x=>C("color",x),a(e,"tableProps.k434"))]),l("div",{class:"pd-button-group border-presets"},[["all",a(e,"tableProps.k435")],["outer",a(e,"tableProps.k436")],["inner",a(e,"tableProps.k437")],["none",a(e,"tableProps.k438")]].map(([x,G])=>l("button",{type:"button",class:"pd-button small",text:G,onClick:()=>{h.applyBorderPreset(i,r,B.style==="none"?"none":x,be()),o.updateElement(t.id,{tableRows:i})}}))),l("div",{class:"pd-checkbox-group"},ji.map(x=>l("label",{class:"pd-checkbox"},[l("input",{type:"checkbox",value:x.value,checked:He[x.value]==="on",indeterminate:He[x.value]==="mixed",onChange:G=>{const te=G.target.checked&&B.style!=="none";f&&y({edges:{...E.edges,[x.value]:te}}),D(Le=>{h.setCellBorderEdge(Le,x.value,te?be():null)})}}),l("span",{text:a(e,x.labelKey)})]))),_t(a(e,f?h.CELL_BORDER_APPLY_HINT_MULTI_KEY:ie?h.CELL_BORDER_APPLY_HINT_MIXED_KEY:h.CELL_BORDER_APPLY_HINT_KEY)),ue(a(e,"tableProps.k439"),Me("padding",bt(s.padding)),"padding",{min:0,max:10,step:.5,placeholder:De(a(e,"tableProps.k440"))},X("padding")),wt(a(e,"tableProps.k441"),f?E.values.wordWrap===!0:s.wordWrap??!0,x=>S("wordWrap",x),void 0,X("wordWrap")),qe?$t(a(e,"tableProps.k442"),jt,ct(Hd),x=>{x!=="__multi__"&&S("textFit",x)},{full:!0,reset:X("textFit")}):"",qe&&Z==="shrink"?ue(a(e,"tableProps.k443"),Me("shrinkMinFontSize",bt(s.shrinkMinFontSize)),"shrinkMinFontSize",{min:0,max:72,step:.5,placeholder:De(a(e,"tableProps.k444"))},X("shrinkMinFontSize")):"",l("div",{class:"merge-card"},[l("div",{class:"merge-card-title",text:a(e,"tableProps.k445")}),l("div",{class:"merge-btns"},[l("button",{type:"button",class:"pd-button small",text:a(e,"tableProps.k446"),disabled:!!Q,title:Q||"",onClick:()=>{h.mergeCells(i,r),o.updateElement(t.id,{tableRows:i})}}),l("button",{type:"button",class:"pd-button small",text:a(e,"tableProps.k447"),disabled:!it,onClick:()=>{h.splitCells(i,r),o.updateElement(t.id,{tableRows:i})}})]),l("div",{class:"merge-card-divider"}),wt(a(e,"tableProps.k448"),f?E.values.mergeSameValue===!0:s.mergeSameValue===!0,x=>S("mergeSameValue",x),J||void 0,rt?X("mergeSameValue"):void 0,!rt),_t(a(e,"tableProps.k449"))])])])}const pr=R.WATERMARK_DENSITY_PRESETS;function Sr(e){const t=e.trim();return t?/[{}]/.test(t)||/^[A-Za-z_$][\w$]*\s*\(/.test(t)?!0:/^[A-Za-z_$][\w$]*(\.[\w$]+)+$/.test(t):!1}function qd(e){return e?e.mode==="binding"?e.binding??"":e.content??"":""}function Yd(e){const t=e.store.templateData.watermark,o=qd(t),r=t?.mode==="binding"||o!==""&&Sr(o),i=(()=>{const u=t?.tileWidth??R.WATERMARK_DEFAULTS.tileWidth,f=t?.tileHeight??R.WATERMARK_DEFAULTS.tileHeight;for(const[b,m]of Object.entries(pr))if(m.width===u&&m.height===f)return b;return"custom"})(),n=u=>{const f={...t,testData:t?.testData??"",rotate:t?.rotate??R.WATERMARK_DEFAULTS.rotate,color:t?.color||R.WATERMARK_DEFAULTS.color,opacity:t?.opacity??R.WATERMARK_DEFAULTS.opacity,tileWidth:t?.tileWidth??R.WATERMARK_DEFAULTS.tileWidth,tileHeight:t?.tileHeight??R.WATERMARK_DEFAULTS.tileHeight};e.store.updateTemplateData({watermark:{...f,...u}})},s=()=>e.fire("open-expression",{elementId:"",targetPath:"watermark.content",value:o}),d={rotate:t?.rotate??R.WATERMARK_DEFAULTS.rotate,color:t?.color||R.WATERMARK_DEFAULTS.color,opacity:t?.opacity??R.WATERMARK_DEFAULTS.opacity,tileWidth:t?.tileWidth??R.WATERMARK_DEFAULTS.tileWidth,tileHeight:t?.tileHeight??R.WATERMARK_DEFAULTS.tileHeight},c=u=>kt({target:d,base:R.WATERMARK_DEFAULTS,propKey:u,write:()=>n({[u]:R.WATERMARK_DEFAULTS[u]})});return l("div",{class:"watermark-config"},[Ge(a(e,"watermark.k538")),l("form",{class:"pd-form",onSubmit:u=>u.preventDefault()},[l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"watermark.k539")}),l("input",{class:"pd-input",type:"text",value:o,placeholder:a(e,"watermark.k540"),title:a(e,"watermark.k541"),onChange:u=>{const f=u.target.value;n(Sr(f)?{mode:"binding",binding:f,content:""}:{mode:"fixed",content:f,binding:""})},onDblclick:s}),l("button",{type:"button",class:"pd-button small",text:a(e,"watermark.k542"),onClick:s})]),r?q(a(e,"watermark.k543"),l("input",{class:"pd-input",type:"text",value:t?.testData??"",placeholder:a(e,"watermark.k544"),onChange:u=>n({testData:u.target.value})})):"",l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"watermark.k545")}),c("rotate")]),l("input",{type:"range",class:"pd-range",min:-90,max:90,step:5,value:String(t?.rotate??R.WATERMARK_DEFAULTS.rotate),onChange:u=>n({rotate:Number(u.target.value)})}),l("span",{class:"pd-hint",text:`${t?.rotate??R.WATERMARK_DEFAULTS.rotate}°`})]),q(a(e,"watermark.k546"),Ae(t?.color||R.WATERMARK_DEFAULTS.color,u=>n({color:u}),a(e,"watermark.k547")),void 0,c("color")),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"watermark.k548")}),c("opacity")]),l("input",{type:"range",class:"pd-range",min:.05,max:.5,step:.05,value:String(t?.opacity??R.WATERMARK_DEFAULTS.opacity),onChange:u=>n({opacity:Number(u.target.value)})}),l("span",{class:"pd-hint",text:(t?.opacity??R.WATERMARK_DEFAULTS.opacity).toFixed(2)})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"watermark.k549")}),l("select",{class:"pd-select",style:{width:"100%"},onChange:u=>{const f=u.target.value,b=pr[f];b&&n({tileWidth:b.width,tileHeight:b.height})}},[...Object.entries(pr).map(([u,f])=>l("option",{value:u,text:`${a(e,f.labelKey)}${a(e,"constants.watermark.density.size",{w:f.width,h:f.height})}`,selected:i===u})),l("option",{value:"custom",text:a(e,"watermark.k550"),selected:i==="custom"})])]),i==="custom"?l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"watermark.k551")}),c("tileWidth")]),l("input",{type:"number",class:"pd-input",min:R.WATERMARK_DEFAULTS.minTileWidth,step:10,value:String(t?.tileWidth??R.WATERMARK_DEFAULTS.tileWidth),onChange:u=>n({tileWidth:Number(u.target.value)})})]):"",i==="custom"?l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"watermark.k552")}),c("tileHeight")]),l("input",{type:"number",class:"pd-input",min:R.WATERMARK_DEFAULTS.minTileHeight,step:10,value:String(t?.tileHeight??R.WATERMARK_DEFAULTS.tileHeight),onChange:u=>n({tileHeight:Number(u.target.value)})})]):""].filter(Boolean))])}function de(e,t,o,r,i={},n){return q(t,H({value:o,...i,onCommit:r}),void 0,n)}function et(e,t,o,r,i,n,s){const d=document.createElement("select");d.className="pd-select",d.addEventListener("change",()=>i(d.value));for(const c of r){const u=document.createElement("option");u.value=c.value,u.textContent=c.label,d.appendChild(u)}return d.value=o,r.some(c=>c.value===o)||(d.selectedIndex=-1),n?xe(t,d,n,s):q(t,d,void 0,s)}function gt(e,t,o,r,i){return q(t,l("input",{type:"checkbox",class:"pd-switch",checked:o,onChange:n=>r(n.target.checked)}),void 0,i)}const jd=[{value:"all",labelKey:"propertyPanel.k177"},{value:"outer",labelKey:"propertyPanel.k178"},{value:"inner",labelKey:"propertyPanel.k179"},{value:"none",labelKey:"propertyPanel.k180"}],Xd=[{value:"top",labelKey:"propertyPanel.k181"},{value:"right",labelKey:"propertyPanel.k182"},{value:"bottom",labelKey:"propertyPanel.k183"},{value:"left",labelKey:"propertyPanel.k184"}];function Zd(e,t){const o=e.store,r=t.options,i=t.printElementType.type,n=v=>o.updateElement(t.id,v),s=wn(i),d=s==="text",c=s==="code",u=s==="table",f=u&&o.tableSelection?.elementId===t.id,b=f&&h.resolveCellGroupMode(t.options.tableRows??[],o.tableSelection).mode==="multi",m=[];b||m.push(zd(e,t));const E=h.createDefaultOptions(i),y=(v,ee)=>{const be=h.propertyDefault(ee);return kt({target:r,base:E,propKey:v,tipValue:be?.value,tipUnit:be?.unit,write:()=>n({[v]:E[v]})})};f||m.push(Te(e,"position-size",a(e,"propertyPanel.k185"),"Location",[l("form",{class:"pd-form",onSubmit:v=>v.preventDefault()},[l("div",{class:"position-grid"},[M(e,"ps-left",de(e,"X",r.left,v=>n({left:v}),{min:0})),M(e,"ps-top",de(e,"Y",r.top,v=>n({top:v}),{min:0})),M(e,"ps-width",de(e,"W",r.width,v=>n({width:v}),{min:4})),M(e,"ps-height",de(e,"H",r.height,v=>n({height:v}),{min:4}))]),l("h3",{class:"pd-divider",text:a(e,"propertyPanel.k186")}),l("div",{class:"margin-grid"},[M(e,"ps-margin-top",de(e,a(e,"propertyPanel.k187"),r.marginTop,v=>n({marginTop:v===0?void 0:v}),{},y("marginTop","ps-margin-top"))),M(e,"ps-margin-right",de(e,a(e,"propertyPanel.k188"),r.marginRight,v=>n({marginRight:v===0?void 0:v}),{},y("marginRight","ps-margin-right"))),M(e,"ps-margin-bottom",de(e,a(e,"propertyPanel.k189"),r.marginBottom,v=>n({marginBottom:v===0?void 0:v}),{},y("marginBottom","ps-margin-bottom"))),M(e,"ps-margin-left",de(e,a(e,"propertyPanel.k190"),r.marginLeft,v=>n({marginLeft:v===0?void 0:v}),{},y("marginLeft","ps-margin-left")))])])]));const C=typeof r.rotate=="number"&&Number.isFinite(r.rotate)&&r.rotate!==0?h.normalizeRotationAngle(r.rotate):void 0,D=v=>n({rotate:v===void 0||v===0?void 0:h.normalizeRotationAngle(v)}),S=h.isFreeAngleEditable(i,r),_=h.isRotationExcludedType(i)||h.collectFollowMemberIds(o.elements).has(t.id),z=_?"":M(e,"ap-rotate",xe(a(e,"propertyPanel.k191"),l("div",{class:"pd-rotate-row"},[l("button",{type:"button",class:"pd-rotate-btn",title:a(e,"propertyPanel.k192"),"aria-label":a(e,"propertyPanel.k193"),text:"↺",onClick:()=>D((C??0)-90)}),l("div",{class:"pd-rotate-stepper"},[H({value:C,min:0,max:359,placeholder:"0",disabled:!S,onCommit:v=>D(v)})]),l("button",{type:"button",class:"pd-rotate-btn",title:a(e,"propertyPanel.k194"),"aria-label":a(e,"propertyPanel.k195"),text:"↻",onClick:()=>D((C??0)+90)})]),a(e,"propertyTips.ap-rotate"),y("rotate","ap-rotate"))),A=_||S?"":l("p",{class:"pd-hint pd-rotate-note",text:h.codeObliqueNote(e.t??N)});if(m.push(Te(e,"appearance",a(e,"propertyPanel.k196"),"Brush",[l("form",{class:"pd-form",onSubmit:v=>v.preventDefault()},d?[M(e,"ap-font-family",q(a(e,"propertyPanel.k197"),ko({id:"prop-font",state:e.state,fonts:e.host.fonts,value:typeof r.fontFamily=="string"?r.fontFamily:void 0,placeholder:a(e,"propertyPanel.k198"),onChange:v=>n({fontFamily:v})}),void 0,y("fontFamily","ap-font-family"))),M(e,"ap-font-size",de(e,a(e,"propertyPanel.k199"),r.fontSize,v=>n({fontSize:v}),{min:8,max:72},y("fontSize","ap-font-size"))),M(e,"ap-font-weight",et(e,a(e,"propertyPanel.k200"),String(r.fontWeight??""),[{value:"normal",label:a(e,"propertyPanel.k201")},{value:"bold",label:a(e,"propertyPanel.k202")},{value:"bolder",label:a(e,"propertyPanel.k203")},{value:"lighter",label:a(e,"propertyPanel.k204")}],v=>n({fontWeight:v}),void 0,y("fontWeight","ap-font-weight"))),M(e,"ap-align",q(a(e,"propertyPanel.k205"),dt("ta",[{value:"left",label:a(e,"propertyPanel.k206")},{value:"center",label:a(e,"propertyPanel.k207")},{value:"right",label:a(e,"propertyPanel.k208")},{value:"justify",label:a(e,"propertyPanel.k209")}],r.textAlign||"left",v=>n({textAlign:v})),void 0,y("textAlign","ap-align"))),M(e,"ap-vertical-align",q(a(e,"propertyPanel.k210"),dt("va",[{value:"top",label:a(e,"propertyPanel.k211")},{value:"middle",label:a(e,"propertyPanel.k212")},{value:"bottom",label:a(e,"propertyPanel.k213")}],r.verticalAlign||"top",v=>n({verticalAlign:v})),void 0,y("verticalAlign","ap-vertical-align"))),l("div",{class:"color-row"},[M(e,"ap-color",q(a(e,"propertyPanel.k214"),Ae(r.color,v=>n({color:v}),a(e,"propertyPanel.k215")),void 0,y("color","ap-color"))),M(e,"ap-bg-color",q(a(e,"propertyPanel.k216"),Ae(r.backgroundColor,v=>n({backgroundColor:v}),a(e,"propertyPanel.k217")),void 0,y("backgroundColor","ap-bg-color")))]),M(e,"ap-line-height",de(e,a(e,"propertyPanel.k218"),r.lineHeight,v=>n({lineHeight:v||void 0}),{min:0,max:100},y("lineHeight","ap-line-height"))),M(e,"ap-letter-spacing",de(e,a(e,"propertyPanel.k219"),r.letterSpacing,v=>n({letterSpacing:v||void 0}),{min:0,max:20,step:.5},y("letterSpacing","ap-letter-spacing"))),M(e,"ap-text-fit",et(e,a(e,"propertyPanel.k220"),h.resolveElementTextFit(i,r),[{value:"clip",label:a(e,"propertyPanel.k221")},{value:"shrink",label:a(e,"propertyPanel.k222")},{value:"autoHeight",label:a(e,"propertyPanel.k223")}],v=>n({textFit:v}),void 0,y("textFit","ap-text-fit"))),r.textFit==="shrink"?M(e,"ap-shrink-min",q(a(e,"propertyPanel.k224"),H({value:r.shrinkMinFontSize,min:1,max:72,step:.5,placeholder:a(e,"propertyPanel.k225"),onCommit:v=>n({shrinkMinFontSize:v||void 0})}),void 0,y("shrinkMinFontSize","ap-shrink-min"))):"",i==="longText"?M(e,"ap-long-text-indent",xe(a(e,"propertyPanel.k226"),H({value:r.longTextIndent,min:0,max:10,placeholder:a(e,"propertyPanel.k227"),onCommit:v=>n({longTextIndent:v||void 0})}),a(e,"propertyTips.ap-long-text-indent"),y("longTextIndent","ap-long-text-indent"))):"",M(e,"ap-word-wrap",gt(e,a(e,"propertyPanel.k228"),r.wordWrap!==!1,v=>n({wordWrap:v?void 0:!1}),y("wordWrap","ap-word-wrap"))),M(e,"ap-keep-line-breaks",gt(e,a(e,"propertyPanel.k229"),r.keepLineBreaks===!0,v=>n({keepLineBreaks:v?!0:void 0}),y("keepLineBreaks","ap-keep-line-breaks"))),z,A]:[i==="image"?M(e,"ap-img-fit",et(e,a(e,"propertyPanel.k230"),String(r.fit??"contain"),h.imageFitOptions(e.t??N),v=>n({fit:v}),a(e,"propertyTips.ap-img-fit"),y("fit","ap-img-fit"))):"",i==="image"&&r.fit==="cover"?M(e,"ap-img-object-position",Zn(e,{fieldKey:"ap-img-object-position",label:a(e,"propertyPanel.k231"),src:h.resolveDesignImageSrc(r.src),widthMm:Number(r.width)||0,heightMm:Number(r.height)||0,fit:r.fit,scale:r.fitScale,value:r.objectPosition===void 0?void 0:String(r.objectPosition),onCommit:v=>n({objectPosition:v}),onScaleCommit:v=>n({fitScale:v}),resetAnchor:y("objectPosition","ap-img-object-position"),resetScale:y("fitScale","ap-img-fit-scale")})):"",z,A,i==="flowList"?l("p",{class:"pd-empty",text:a(e,"propertyPanel.k232")}):""].filter(Boolean))])),c){const v=i==="barcode",ee=String(r.barcodeType||"CODE128").toUpperCase(),be=r.printerDpi?String(r.printerDpi):"",He=h.barcodeBarWidthRecommendText(r.printerDpi,r.barWidth,e.t??N);m.push(Te(e,"code",a(e,"propertyPanel.k233"),"Postcard",[l("form",{class:"pd-form",onSubmit:W=>W.preventDefault()},[v?[M(e,"cd-type",et(e,a(e,"propertyPanel.k234"),ee,[{value:"CODE128",label:a(e,"propertyPanel.k235")},{value:"EAN13",label:a(e,"propertyPanel.k236")},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],W=>n({barcodeType:W==="CODE128"?void 0:W}))),M(e,"cd-dpi",et(e,a(e,"propertyPanel.k237"),be,[{value:"",label:a(e,"propertyPanel.k238")},{value:"203",label:a(e,"propertyPanel.k239")},{value:"300",label:a(e,"propertyPanel.k240")},{value:"600",label:a(e,"propertyPanel.k241")}],W=>n({printerDpi:Number(W)>0?Number(W):void 0}),void 0,y("printerDpi","cd-dpi"))),M(e,"cd-dpi",l("p",{class:"pd-hint",text:a(e,"propertyPanel.k242")})),M(e,"cd-bar-width",de(e,a(e,"propertyPanel.k243"),r.barWidth??2,W=>n({barWidth:W}),{min:2,max:8,step:.5},y("barWidth","cd-bar-width"))),M(e,"cd-bar-width",l("p",{class:"pd-hint",text:(be?a(e,"propertyPanel.k244"):a(e,"propertyPanel.k245"))+(He?`。${He}`:"")})),M(e,"cd-bar-quiet-zone",xe(a(e,"propertyPanel.k246"),H({value:r.barQuietZone,min:0,max:20,placeholder:a(e,"propertyPanel.k247"),onCommit:W=>n({barQuietZone:W})}),a(e,"propertyTips.cd-bar-quiet-zone"),y("barQuietZone","cd-bar-quiet-zone"))),M(e,"cd-bar-height",xe(a(e,"propertyPanel.k248"),H({value:r.barHeight,min:1,max:100,placeholder:a(e,"propertyPanel.k249"),onCommit:W=>n({barHeight:W??void 0})}),a(e,"propertyTips.cd-bar-height"),y("barHeight","cd-bar-height"))),M(e,"cd-show-text",gt(e,a(e,"propertyPanel.k250"),r.hideTitle!==!0,W=>n({hideTitle:W?void 0:!0}),y("hideTitle","cd-show-text"))),M(e,"cd-font-size",q(a(e,"propertyPanel.k251"),H({value:r.fontSize,min:5,max:24,placeholder:a(e,"propertyPanel.k252"),onCommit:W=>n({fontSize:W||void 0})}),void 0,y("fontSize","cd-font-size")))]:[M(e,"cd-ec-level",et(e,a(e,"propertyPanel.k253"),String(r.qrCodeLevel??"M"),[{value:"L",label:a(e,"propertyPanel.k254")},{value:"M",label:a(e,"propertyPanel.k255")},{value:"Q",label:"Q"},{value:"H",label:a(e,"propertyPanel.k256")}],W=>n({qrCodeLevel:W}),void 0,y("qrCodeLevel","cd-ec-level"))),M(e,"cd-quiet-zone",xe(a(e,"propertyPanel.k257"),H({value:r.qrQuietZone,min:0,max:8,placeholder:a(e,"propertyPanel.k258"),onCommit:W=>n({qrQuietZone:W})}),a(e,"propertyTips.cd-quiet-zone"),y("qrQuietZone","cd-quiet-zone")))],Ge(a(e,"propertyPanel.k259")),v?l("p",{class:"pd-hint",text:a(e,"propertyPanel.k260")}):"",v?"":M(e,"cd-fit",et(e,a(e,"propertyPanel.k261"),String(r.fit||"contain"),h.imageFitOptions(e.t??N),W=>n({fit:W||void 0}),void 0,y("fit","cd-fit"))),M(e,"cd-max-width",q(a(e,"propertyPanel.k262"),H({value:r.maxWidth,min:1,max:200,placeholder:a(e,"propertyPanel.k263"),onCommit:W=>n({maxWidth:W||void 0})}),void 0,y("maxWidth","cd-max-width"))),M(e,"cd-max-height",q(a(e,"propertyPanel.k264"),H({value:r.maxHeight,min:1,max:200,placeholder:a(e,"propertyPanel.k265"),onCommit:W=>n({maxHeight:W||void 0})}),void 0,y("maxHeight","cd-max-height")))].flat().filter(Boolean))]))}if(f&&(m.push(Wd(e,t)),m.push(Gd(e,t))),u&&m.push(Kd(e,t)),i==="flowList"){const v=h.resolveFlowColumns(r.flowColumns),ee=h.resolveFlowRowHeight(r.flowRowHeight),be=h.resolveFlowGapX(r.flowGapX),He=h.resolveFlowMaxSpan(r.flowMaxSpan,v),W=h.suggestFlowColumns(r.width??0,be,r.fontSize??12),ae=h.resolveFlowLayoutMode(r.flowLayoutMode),Re=ae==="dynamic",Fe=h.resolveFlowPadding(r),qe=(Y,Ye)=>{n({[Y]:typeof Ye=="number"&&Number.isFinite(Ye)&&Ye>0?Ye:0})};m.push(Te(e,"flowList",a(e,"propertyPanel.k266"),"Grid3x3",[l("form",{class:"pd-form",onSubmit:Y=>Y.preventDefault()},[M(e,"fl-layout-mode",et(e,a(e,"propertyPanel.k267"),ae,[{value:"fixed",label:a(e,"propertyPanel.k268")},{value:"dynamic",label:a(e,"propertyPanel.k269")}],Y=>n({flowLayoutMode:Y==="dynamic"?"dynamic":"fixed"}),a(e,"propertyTips.fl-layout-mode"))),...Re?[M(e,"fl-padding-top",xe(a(e,"propertyPanel.k270"),H({value:Fe.top,min:0,max:100,step:.5,onCommit:Y=>qe("flowPaddingTop",Y)}),a(e,"propertyTips.fl-padding-top"))),M(e,"fl-padding-right",xe(a(e,"propertyPanel.k271"),H({value:Fe.right,min:0,max:100,step:.5,onCommit:Y=>qe("flowPaddingRight",Y)}),a(e,"propertyTips.fl-padding-right"))),M(e,"fl-padding-bottom",xe(a(e,"propertyPanel.k272"),H({value:Fe.bottom,min:0,max:100,step:.5,onCommit:Y=>qe("flowPaddingBottom",Y)}),a(e,"propertyTips.fl-padding-bottom"))),M(e,"fl-padding-left",xe(a(e,"propertyPanel.k273"),H({value:Fe.left,min:0,max:100,step:.5,onCommit:Y=>qe("flowPaddingLeft",Y)}),a(e,"propertyTips.fl-padding-left")))]:[],M(e,"fl-columns",xe(a(e,"propertyPanel.k274"),H({value:v,min:1,max:12,onCommit:Y=>n({flowColumns:h.resolveFlowColumns(Y),flowMaxSpan:h.resolveFlowMaxSpan(r.flowMaxSpan,h.resolveFlowColumns(Y))})}),a(e,"propertyTips.fl-columns"))),M(e,"fl-row-height",xe(a(e,"propertyPanel.k275"),H({value:ee,min:3,max:100,step:.5,onCommit:Y=>n({flowRowHeight:h.resolveFlowRowHeight(Y)})}),a(e,"propertyTips.fl-row-height"))),M(e,"fl-gap-x",xe(a(e,"propertyPanel.k276"),H({value:be,min:0,max:50,step:.5,onCommit:Y=>n({flowGapX:h.resolveFlowGapX(Y)})}),a(e,"propertyTips.fl-gap-x"))),M(e,"fl-auto-span",gt(e,a(e,"propertyPanel.k277"),r.flowAutoSpan===!0,Y=>{n(Y?{flowAutoSpan:Y,flowMaxSpan:He}:{flowAutoSpan:Y})})),r.flowAutoSpan===!0?M(e,"fl-max-span",xe(a(e,"propertyPanel.k278"),H({value:He,min:1,max:v,onCommit:Y=>n({flowMaxSpan:h.resolveFlowMaxSpan(Y,v)})}),a(e,"propertyTips.fl-max-span"))):"",v>W?l("p",{class:"pd-hint",text:a(e,"propertyPanel.k279",{v0:v,v1:W,v2:v})}):""].flat().filter(Boolean))]))}const I=()=>({borderWidth:r.borderWidth,borderStyle:r.borderStyle,borderColor:r.borderColor,borders:r.borders}),K=v=>{const ee=I();h.applyElementBorderPreset(ee,v,h.effectiveElementBorderSpec(ee)),n(ee)},B=v=>{const ee=I();h.setElementBorderEdgeVisible(ee,v,!h.elementBorderEdgeVisible(ee,v)),n(ee)},L=h.resolveElementBorderDisplay(r),U=L.style==="mixed",re=typeof L.width=="number"?L.width:void 0,V=U||L.style===void 0?"":L.style,he=typeof L.color=="string"?L.color:void 0,ie=(v,ee)=>{const be=I();h.setElementBorderField(be,v,ee),n(be)},Ce=h.BORDER_LINE_STYLES.map(v=>({...v,label:a(e,v.labelKey)})),ke=U?[{value:"",label:a(e,"propertyPanel.k280")},...Ce]:Ce;return m.push(Te(e,"border-bg",a(e,"propertyPanel.k281"),"Picture",[l("form",{class:"pd-form",onSubmit:v=>v.preventDefault()},[M(e,"bb-border-style",et(e,a(e,"propertyPanel.k282"),V,ke,v=>ie("borderStyle",v))),l("div",{class:"border-row"},[M(e,"bb-border-width",de(e,a(e,"propertyPanel.k283"),re,v=>ie("borderWidth",v),{min:0,max:20,step:.25,placeholder:L.width==="mixed"?a(e,"propertyPanel.k284"):void 0},y("borderWidth","bb-border-width"))),M(e,"bb-border-color",q(a(e,"propertyPanel.k285"),Ae(he,v=>ie("borderColor",v),a(e,"propertyPanel.k286")),void 0,y("borderColor","bb-border-color")))]),...h.acceptsElementBorder(i)?[l("div",{class:"pd-button-group border-presets"},jd.map(v=>l("button",{type:"button",class:"pd-button small",text:a(e,v.labelKey),disabled:v.value==="inner",onClick:()=>K(v.value)}))),l("div",{class:"pd-checkbox-group"},Xd.map(v=>l("label",{class:"pd-checkbox"},[l("input",{type:"checkbox",checked:h.elementBorderEdgeVisible(r,v.value),onChange:()=>B(v.value)}),l("span",{text:a(e,v.labelKey)})]))),l("p",{class:"pd-hint",text:a(e,h.ELEMENT_BORDER_APPLY_HINT_KEY)})]:[],M(e,"bb-bg-color",q(a(e,"propertyPanel.k287"),Ae(r.backgroundColor,v=>n({backgroundColor:v}),a(e,"propertyPanel.k288")),void 0,y("backgroundColor","bb-bg-color")))])])),m.push(Vd(e,t)),m.push(Te(e,"advanced",a(e,"propertyPanel.k289"),"Setting",[l("form",{class:"pd-form",onSubmit:v=>v.preventDefault()},[l("div",{class:"advanced-row"},[M(e,"ad-locked",gt(e,a(e,"propertyPanel.k290"),!!r.locked,v=>n({locked:v}),y("locked","ad-locked"))),M(e,"ad-fixed",gt(e,a(e,"propertyPanel.k291"),!!r.repeatOnEveryPage,v=>n({repeatOnEveryPage:v}),y("repeatOnEveryPage","ad-fixed"))),M(e,"ad-fixed-position",gt(e,a(e,"propertyPanel.k292"),!!r.fixed,v=>n({fixed:v}),y("fixed","ad-fixed-position")))]),M(e,"ad-z-index",de(e,a(e,"propertyPanel.k293"),r.zIndex,v=>n({zIndex:v}),{min:0,max:999},y("zIndex","ad-z-index"))),M(e,"ad-delete",l("div",{class:"pd-field"},[l("button",{type:"button",class:"pd-button danger",text:a(e,"propertyPanel.k294"),onClick:()=>o.deleteSelected()})]))])],!1,[l("button",{type:"button",class:"group-help",title:a(e,"propertyPanel.k295"),"aria-label":a(e,"propertyPanel.k296"),text:"?",onClick:v=>{v.stopPropagation(),e.fire("help","advanced-settings")}})])),l("div",{class:"property-content"},m)}function Qd(e){const t=e.store,o=t.templateData,r=c=>t.updateTemplateData(c),i=c=>{const u=o.tiling,f=b=>b===90||b===270;if(u?.enabled&&f(c)!==f(o.outputRotation)){const b=R.computeMaxColumns({...o,outputRotation:c});r({outputRotation:c,tiling:{...u,columns:Math.max(b,1)}});return}r({outputRotation:c})},n=[];for(const[c,u]of Object.entries(h.PAPER_PRESETS)){const f=a(e,`constants.paper.group.${u.group}`);let b=n.find(m=>m.group===f);b||(b={group:f,items:[]},n.push(b)),b.items.push({key:c,label:a(e,u.labelKey)})}const s=!h.PAPER_PRESETS[o.paperSize],d=h.isContinuousPaperSize(o.paperSize);return l("form",{class:"pd-form",onSubmit:c=>c.preventDefault()},[Ge(a(e,"propertyPanel.k298")),q(a(e,"propertyPanel.k299"),l("select",{class:"pd-select",style:{width:"100%"},onChange:c=>r({paperSize:c.target.value})},[...n.map(c=>l("optgroup",{label:c.group},c.items.map(u=>l("option",{value:u.key,text:u.label,selected:o.paperSize===u.key})))),l("option",{value:"CUSTOM",text:a(e,"propertyPanel.k300"),selected:s})])),d||s?q(d?a(e,"propertyPanel.k301"):a(e,"propertyPanel.k302"),l("div",{class:"custom-size-grid"},[H({value:Number(o.customWidth??0),min:25,max:2e3,onCommit:c=>r({customWidth:c})}),...s?[l("span",{class:"custom-size-x",text:"×"}),H({value:Number(o.customHeight??0),min:25,max:2e3,onCommit:c=>r({customHeight:c})})]:[]])):"",d?"":q(a(e,"propertyPanel.k303"),dt("ori",[{value:"portrait",label:a(e,"propertyPanel.k304")},{value:"landscape",label:a(e,"propertyPanel.k305")}],o.orientation==="landscape"?"landscape":"portrait",c=>r({orientation:c})),a(e,"propertyPanel.k306")),d?"":q(a(e,"propertyPanel.k307"),dt("rot",[{value:"0",label:"0°"},{value:"90",label:"90°"},{value:"180",label:"180°"},{value:"270",label:"270°"}],String(o.outputRotation??0),c=>i(Number(c)),!0),o.tiling?.enabled?a(e,"propertyPanel.k308"):a(e,"propertyPanel.k309")),q(a(e,"propertyPanel.k310"),l("div",{class:"page-bg-row"},[Ae(o.pageBackground,c=>r({pageBackground:c}),a(e,"propertyPanel.k311"),"page-bg-picker")]),void 0,kt({target:o,base:{pageBackground:void 0},propKey:"pageBackground",write:()=>r({pageBackground:void 0})})),Ed(e),t.pages.length>1?"":Sd(e),Ge(a(e,"propertyPanel.k312")),l("div",{class:"margin-grid"},[de(e,a(e,"propertyPanel.k313"),o.margins.top,c=>r({margins:{...o.margins,top:c}}),{min:0,max:50}),de(e,a(e,"propertyPanel.k314"),o.margins.bottom,c=>r({margins:{...o.margins,bottom:c}}),{min:0,max:100}),de(e,a(e,"propertyPanel.k315"),o.margins.left,c=>r({margins:{...o.margins,left:c}}),{min:0,max:50}),de(e,a(e,"propertyPanel.k316"),o.margins.right,c=>r({margins:{...o.margins,right:c}}),{min:0,max:50})]),Ge(a(e,"propertyPanel.k317")),de(e,a(e,"propertyPanel.k318"),o.header.height??10,c=>r({header:{...o.header,height:c}}),{min:0,max:100,step:.1}),de(e,a(e,"propertyPanel.k319"),o.footer.height??10,c=>r({footer:{...o.footer,height:c}}),{min:0,max:100,step:.1}),Yd(e)].filter(Boolean))}function Jd(e,t,o){const r=(e.state.propSearch??"").trim(),i=!r||h.matchKeywords(r,[...o.searchKeywords,o.label]),n=document.createElement("div");if(n.className="property-content",i)try{zn(`property:${t.id}`,o.ui.renderProperty({element:t,data:e.host.designData?.length?e.host.designData:[h.DEFAULT_DEMO_DATA],fields:e.host.fields??[],update:s=>e.store.updateElement(t.id,s),repaint:()=>e.repaint(),t:e.t??N}),n)}catch{}return l("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:custom"},style:e.state.propTab==="custom"?"":{display:"none"}},[n])}function ep(e){const t=e.store,o=e.state,r=t.selectedElement,i=r?br(r):void 0;if(o.propCollapsed)return l("div",{class:"property-panel collapsed"},[l("div",{class:"prop-collapsed"},[l("button",{type:"button",class:"pc-btn",title:a(e,"propertyPanel.k320"),text:"«",onClick:()=>{o.propCollapsed=!1,e.repaint()}}),...i?[l("button",{type:"button",class:`pc-btn${o.propTab==="custom"?" on":""}`,title:i.label,html:ge(i.icon,14)||ge("Shapes",14),onClick:()=>{o.propTab="custom",o.propCollapsed=!1,e.repaint()}})]:[],...[["element",a(e,"propertyPanel.k321"),"▦"],["page",a(e,"propertyPanel.k322"),"▤"]].map(([s,d,c])=>l("button",{type:"button",class:`pc-btn${o.propTab===s?" on":""}`,title:d,text:c,onClick:()=>{o.propTab=s,o.propCollapsed=!1,e.repaint()}}))])]);const n=r?o.propTab==="custom"&&!i?"element":o.propTab:"page";return l("div",{class:"property-panel"},[l("div",{class:"prop-head"},[l("span",{class:"prop-title",text:a(e,"propertyPanel.k323")}),l("button",{type:"button",class:"collapse-btn",title:a(e,"propertyPanel.k324"),text:"»",onClick:()=>{o.propCollapsed=!0,e.repaint()}})]),l("div",{class:"pd-tabs prop-tabs"},[l("div",{class:"pd-tab-bar",role:"tablist"},[...i?[l("button",{type:"button",class:`pd-tab${n==="custom"?" active":""}`,text:i.label,onClick:()=>{o.propTab="custom",e.repaint()}})]:[],l("button",{type:"button",class:`pd-tab${n==="element"?" active":""}`,text:a(e,"propertyPanel.k325"),onClick:()=>{o.propTab="element",e.repaint()}}),l("button",{type:"button",class:`pd-tab${n==="page"?" active":""}`,text:a(e,"propertyPanel.k326"),onClick:()=>{o.propTab="page",e.repaint()}})]),i&&r?Jd(e,r,i):"",l("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:element"},style:n==="element"?"":{display:"none"}},r?[Md(e),Zd(e,r)]:[l("p",{class:"pd-empty",text:a(e,"propertyPanel.k327")})]),l("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:page"},style:n==="page"?"":{display:"none"}},[Qd(e)])].filter(Boolean))])}var P=we.t,tp={Check:'<path d="M20 6 9 17l-5-5" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />'};function op(e,t=16){return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${tp[e]??""}</svg>`}function ho(e){const t=typeof e=="string"?e.trim().toLowerCase():"";return t==="label"||t==="key"||t==="both"?t:"both"}function cr(){return[{key:"field",text:P("expression.tabField")},{key:"variable",text:P("expression.tabVariable")},{key:"function",text:P("expression.tabFunction")}]}function Xi(){return{field:P("expression.placeholderField"),variable:P("expression.placeholderVariable"),function:P("expression.placeholderFunction")}}function rp(){return[{name:"SUM",label:P("expression.fnSum"),template:"SUM()"},{name:"AVG",label:P("expression.fnAvg"),template:"AVG()"},{name:"COUNT",label:P("expression.fnCount"),template:"COUNT()"},{name:"MIN",label:P("expression.fnMin"),template:"MIN()"},{name:"MAX",label:P("expression.fnMax"),template:"MAX()"}]}function ip(){return[{name:"ADD",label:P("expression.fnAdd"),template:"ADD()"},{name:"SUB",label:P("expression.fnSub"),template:"SUB()"},{name:"MUL",label:P("expression.fnMul"),template:"MUL()"},{name:"DIV",label:P("expression.fnDiv"),template:"DIV()"},{name:"ROUND",label:P("expression.fnRound"),template:"ROUND()"},{name:"ROUNDUP",label:P("expression.fnRoundUp"),template:"ROUNDUP()"},{name:"ROUNDDOWN",label:P("expression.fnRoundDown"),template:"ROUNDDOWN()"},{name:"ROUNDBANK",label:P("expression.fnRoundBank"),template:"ROUNDBANK()"}]}function np(){return[{name:"MONEY",label:P("expression.fnMoney"),template:"MONEY()"},{name:"DATE",label:P("expression.fnDate"),template:"DATE()"},{name:"UPPER",label:P("expression.fnUpper"),template:"UPPER()"},{name:"IF",label:P("expression.fnIf"),template:"IF()"}]}function ap(){return[{name:"pageIndex",label:P("expression.varPageIndex"),template:"{pageIndex}"},{name:"totalPages",label:P("expression.varTotalPages"),template:"{totalPages}"},{name:"printDate",label:P("expression.varPrintDate"),template:"{printDate}"},{name:"printTime",label:P("expression.varPrintTime"),template:"{printTime}"}]}function lp(){return[{title:P("expression.groupAggregate"),items:rp()},{title:P("expression.groupMath"),items:ip()},{title:P("expression.groupFormat"),items:np()}]}var sp="expression.previewEmpty",dp="expression.previewNoValue",Tr="expression.previewError";function Zi(e,t){if(!e.trim())return P(sp);try{const o={...h.DEFAULT_DEMO_DATA,...t??{},...R.resolveSystemVariables()},r=h.evaluateTemplate(e,o);return r==null?P(dp):String(r)}catch{return P(Tr)}}function Qi(e,t){const o=t.trim().toLowerCase();return o?e.filter(r=>r.label.toLowerCase().includes(o)||r.name.toLowerCase().includes(o)):e}function pp(e,t){const o=e.substring(0,t),r=o.lastIndexOf("{"),i=r!==-1&&!o.slice(r+1).includes("}"),n=o.lastIndexOf("("),s=n!==-1&&!o.slice(n+1).includes(")");return{insideBlock:i,insideParens:s}}var cp=e=>/[\u4e00-\u9fff]/.test(e),hp=e=>`字段「${e}」含中文,请用 {${e}} 引用(函数参数内写 ${e});中文可直接在 {} 中使用,无需 data['...'] 方括号`;function up(e,t){const o=/^\{\s*([^{}]+?)\s*\}$/.exec(e.trim());if(!o)return null;const r=o[1]??"";return t.find(i=>i.fieldKey===r)??null}function hr(e,t,o="both"){return o==="label"?l("div",{class:"ee-field-info"},[l("span",{class:"ee-item-label",text:e})]):o==="key"?l("div",{class:"ee-field-info"},[l("span",{class:"ee-item-key is-primary",text:t})]):l("div",{class:"ee-field-info"},[l("span",{class:"ee-item-label",text:e}),l("span",{class:"ee-item-key",text:t})])}function Ve(e){return e.currentTarget.getRootNode()}function so(e,t,o){const r=[];return o.forEach((i,n)=>{r.push(i),n<o.length-1&&r.push(l("br"))}),l("div",{class:`ee-help-card ${e}`},[l("div",{class:"ee-help-card-title",text:t}),l("div",{class:"ee-help-card-content"},r)])}function fp(){return l("div",{class:"ee-help-section"},[l("div",{class:"ee-help-title",text:P("expression.k1")}),l("div",{class:"ee-help-grid"},[so("ee-help-field",P("expression.k2"),[P("expression.k3"),P("expression.k4"),P("expression.k5"),P("expression.k6"),P("expression.k7"),P("expression.k8"),P("expression.k9")]),so("ee-help-function",P("expression.k10"),[P("expression.k11"),P("expression.k12"),P("expression.k13"),P("expression.k14"),P("expression.k15"),P("expression.k16")]),so("ee-help-variable",P("expression.k17"),[P("expression.k18"),P("expression.k19"),P("expression.k20")]),so("ee-help-conditional",P("expression.k21"),[P("expression.k22"),P("expression.k23"),P("expression.k24"),P("expression.k25"),P("expression.k26")])])])}function gp(e,t){P=e.t??we.t;const o=ho(e.fieldDisplay),r={activeTab:"field",searchText:"",expression:t.value||"",binding:t.binding,copiedFieldKey:"",keyHint:""},i=(S,_)=>S.querySelector(_),n=S=>{const _=i(S,".ee-preview");if(!_)return;const z=Zi(r.expression,e.demoData);_.textContent=z,_.classList.toggle("ee-preview-error",z===P(Tr))},s=S=>{const _=i(S,".ee-key-hint");_&&(_.textContent=r.keyHint,_.style.display=r.keyHint?"":"none")},d=()=>{if(r.activeTab==="variable")return Qi(ap(),r.searchText).map(z=>l("div",{class:"ee-list-item",onDblclick:A=>{const{insideParens:I}=f(A);b(Ve(A),I?z.template.replace(/^\{|\}$/g,""):z.template,void 0,"")}},[hr(z.label,z.template)]));if(r.activeTab==="function")return lp().map(z=>l("div",{class:"ee-func-group"},[l("div",{class:"ee-func-group-title",text:z.title}),...Qi(z.items,r.searchText).map(A=>l("div",{class:"ee-list-item",onDblclick:I=>{const{insideBlock:K}=f(I),B=K?A.template:`{${A.template}}`;b(Ve(I),B,B.indexOf("(")+1,"")}},[hr(A.label,`${A.name}()`)]))]));const S=h.filterGroups(h.groupFields(e.fields??[]),r.searchText);if(!S.length)return[l("p",{class:"pd-empty",text:P("expression.k27")})];const _=[];for(const z of S){z.key&&_.push(l("div",{class:`ee-field-group${z.isList?" is-list":""}`},[l("span",{class:"ee-field-group-icon",text:z.isList?"📋":"📁"}),l("span",{text:z.label})]));for(const A of z.fields)_.push(l("div",{class:"ee-list-item ee-field-item",style:{paddingLeft:z.key?"22px":"10px"},onDblclick:I=>{const{insideParens:K}=f(I),B=I;if(B.ctrlKey||B.metaKey){const L=A.fieldLabel||A.fieldKey;b(Ve(I),K?`"${L}"`:L,void 0,"");return}b(Ve(I),K?A.fieldKey:`{${A.fieldKey}}`,void 0,cp(A.fieldKey)?hp(A.fieldKey):"")}},[hr(A.fieldLabel||A.fieldKey,A.fieldKey,o),l("button",{type:"button",class:`ee-copy-btn${r.copiedFieldKey===A.fieldKey?" is-copied":""}`,"data-tip":r.copiedFieldKey===A.fieldKey?P("expression.k28"):`复制字段名「${A.fieldLabel}」`,"aria-label":`复制字段名 ${A.fieldLabel}`,html:op(r.copiedFieldKey===A.fieldKey?"Check":"Copy",13),onClick:I=>{I.stopPropagation(),u(I,A)},onDblclick:I=>I.stopPropagation()})]))}return _},c=S=>{Array.from(S.querySelectorAll(".ee-nav-tab")).forEach((K,B)=>K.classList.toggle("active",cr()[B]?.key===r.activeTab));const z=i(S,".ee-content-search .pd-input");if(z){const K=Xi()[r.activeTab];z.placeholder!==K&&(z.placeholder=K),z.value!==r.searchText&&(z.value=r.searchText)}const A=i(S,".ee-textarea");A&&A.value!==r.expression&&(A.value=r.expression);const I=i(S,".ee-content-list");if(I){cn(I);for(const K of d())Se(K,I)}n(S),s(S)};function u(S,_){const z=Ve(S);h.copyTextToClipboard(_.fieldLabel||_.fieldKey).then(A=>{A&&(r.copiedFieldKey=_.fieldKey,c(z),setTimeout(()=>{r.copiedFieldKey===_.fieldKey&&(r.copiedFieldKey="",c(z))},1200))})}const f=S=>{const z=i(Ve(S),".ee-textarea")?.selectionStart??r.expression.length;return pp(r.expression,z)},b=(S,_,z=_.length,A)=>{A!==void 0&&(r.keyHint=A);const I=i(S,".ee-textarea");if(!I){r.expression+=_,n(S),s(S);return}const K=I.selectionStart??r.expression.length,B=I.selectionEnd??K;r.expression=r.expression.substring(0,K)+_+r.expression.substring(B);const L=K+z;I.value=r.expression,I.focus(),I.selectionStart=I.selectionEnd=L,n(S),s(S)},m=()=>{const S=r.expression;if(r.binding===void 0){e.onApply({formatter:S}),e.onClose();return}const _=up(S,e.fields??[]);e.onApply(_?{formatter:S,binding:_.fieldKey,title:_.fieldLabel}:{formatter:S}),e.onClose()},E=l("div",{class:"ee-nav"},[l("div",{class:"ee-nav-title",text:P("expression.k29")}),l("div",{class:"ee-nav-tabs"},cr().map((S,_)=>l("div",{class:`ee-nav-tab${r.activeTab===S.key?" active":""}`,text:S.text,onClick:z=>{r.activeTab=cr()[_].key,c(Ve(z))}})))]),y=l("div",{class:"ee-content"},[l("div",{class:"ee-content-search"},[l("input",{class:"pd-input",placeholder:Xi()[r.activeTab],onInput:S=>{r.searchText=S.target.value,c(Ve(S))}})]),l("div",{class:"ee-content-list"},d())]),C=Zi(r.expression,e.demoData),D=l("div",{class:"ee-editor"},[l("div",{class:"ee-editor-section"},[l("div",{class:"ee-editor-title",text:P("expression.k30")}),l("textarea",{class:"ee-textarea",rows:6,placeholder:P("expression.k31"),text:r.expression,onInput:S=>{r.expression=S.target.value,r.keyHint="",n(Ve(S)),s(Ve(S))}}),l("div",{class:"pd-hint ee-key-hint",style:{display:"none",color:"var(--pd-accent, #165DFF)"},text:""})]),l("div",{class:"ee-editor-section"},[l("div",{class:"ee-editor-title",text:P("expression.k32")}),l("div",{class:`ee-preview${C===P(Tr)?" ee-preview-error":""}`,text:C})]),fp()]);return l("div",{class:"pd-dialog-overlay",onKeydown:S=>{S.key==="Escape"&&e.onClose()}},[l("section",{class:"pd-dialog pd-dialog-large",role:"dialog","aria-modal":"true","aria-labelledby":"expression-editor-title"},[l("header",{class:"pd-dialog-header"},[l("strong",{id:"expression-editor-title",text:P("expression.k33")}),l("button",{type:"button",class:"pd-close","aria-label":P("expression.k34"),text:"×",onClick:()=>e.onClose()})]),l("div",{class:"expression-editor"},[E,y,D]),l("footer",{class:"pd-dialog-footer"},[l("button",{type:"button",class:"pd-button",text:P("expression.k35"),onClick:()=>e.onClose()}),l("button",{type:"button",class:"pd-button primary",text:P("expression.k36"),onClick:()=>m()})])])])}const mp={id:"getting-started",title:"快速入门",content:`
|
|
3
|
+
`+Pe),be(Pe)},t.setConfig=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};No(k),Mo=!0,Xt=Q,Zt=J},t.clearConfig=function(){to=null,Mo=!1,Xt=null,Zt=null,V=ie,he=""},t.isValidAttribute=function(k,p,g){to||No({});const w=le(k),T=le(p);return typeof g=="string"&&(hi(p,g)||!ye&&fe(_i,g))?!1:pi(w,T,g)},t.addHook=function(k,p){typeof p=="function"&&Ee(Z,k)&&Nt(Z[k],p)},t.removeHook=function(k,p){if(Ee(Z,k)){if(p!==void 0){const g=ml(Z[k],p);return g===-1?void 0:yl(Z[k],g,1)[0]}return ki(Z[k])}},t.removeHooks=function(k){Ee(Z,k)&&(Z[k]=[])},t.removeAllHooks=function(){Z=Ri()},t}var Gl=Ln();const ql={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Yl(e,t){const o=e.options;return h.resolveBarcodeDesignValue(o.formatter,t,String(o.testData||o.title||""))||"1234567890128"}function jl(e){return l("div",{class:"print-qrcode",dataset:{codeId:e.id,codeKind:"qrcode"}})}function Xl(e){const t=e.options;return l("div",{class:"print-barcode",dataset:{codeId:e.id,codeKind:"barcode"}},[l("svg",{preserveAspectRatio:ql[String(t.fit||"contain")]??"xMidYMid meet",style:{maxWidth:"100%",maxHeight:"100%"}})])}function Zl(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(o=>!Number.isFinite(o))?null:{width:t[2],height:t[3]}}function Ql(e,t,o){const r=e.options,i=h.barcodeUnitsPerModule(r.barWidth),n=h.barcodeQuietZoneModules(r.barQuietZone),s=d=>{pn(t,Yl(e,o),{format:String(r.barcodeType||"CODE128"),width:i,height:d*i,displayValue:!r.hideTitle,fontSize:(r.fontSize??h.BARCODE_TEXT_FONT_SIZE_MODULES)*i,margin:0,marginLeft:n*i,marginRight:n*i,marginTop:0,marginBottom:h.BARCODE_MARGIN_BOTTOM_MODULES*i});const c=Zl(t);return c?{widthUnits:c.width,heightUnits:c.height}:null};try{const d=h.layoutBarcodeSize({barHeightMm:r.barHeight,boxWidthMm:h.barcodeAvailableBoxMm(r.width,r.maxWidth),boxHeightMm:h.barcodeAvailableBoxMm(r.height,r.maxHeight),dpi:r.printerDpi,barWidth:r.barWidth,measure:s});t.style.width=d.size?`${d.size.widthMm}mm`:"",t.style.height=d.size?`${d.size.heightMm}mm`:""}catch{t.replaceChildren();return}t.setAttribute("shape-rendering","crispEdges")}function Jl(e,t,o){const r=e.options,i=h.resolveBarcodeDesignValue(r.formatter,o,String(r.testData||r.title||""))||N("code.k27");t.replaceChildren();try{const n=Dr.browserCodeRenderer.render(i,"qrcode",{qrCodeLevel:String(r.qrCodeLevel??"M"),qrQuietZone:typeof r.qrQuietZone=="number"?r.qrQuietZone:void 0}),s=document.createElement("img");s.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`,s.alt="qrcode",s.style.width="100%",s.style.height="100%",s.style.objectFit=String(r.fit||"contain"),s.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",s.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%",t.appendChild(s)}catch{}}function es(e,t,o){for(const r of Array.from(e.querySelectorAll("[data-code-kind]"))){const i=r.dataset.codeId,n=t.find(s=>s.id===i);if(n)if(r.dataset.codeKind==="barcode"){const s=r.querySelector("svg");s&&Ql(n,s,o)}else Jl(n,r,o)}}const bo=new Map;function ts(e){return typeof Node<"u"&&e instanceof Node}function zn(e,t,o){if(On(e),typeof t=="string"){o.innerHTML=t;return}if(ts(t)){o.appendChild(t);return}typeof t.node=="string"?o.innerHTML=t.node:o.appendChild(t.node),typeof t.dispose=="function"&&bo.set(e,t.dispose)}function On(e){const t=bo.get(e);if(t){bo.delete(e);try{t()}catch{}}}function Fi(){for(const e of[...bo.keys()])On(e)}const os={header:"table.k450",data:"table.k451",subtotal:"table.k452",summary:"table.k453"},rs=[{value:"header",labelKey:"table.k454"},{value:"data",labelKey:"table.k455"},{value:"subtotal",labelKey:"table.k456"},{value:"summary",labelKey:"table.k457"}],co=3.7795275591,is=.1,xr=e=>JSON.parse(JSON.stringify(e)),Ii=new WeakMap;function ot(e){let t=Ii.get(e);return t||(t={menu:null,menuElId:null,anchor:null,layouts:new Map},Ii.set(e,t)),t}function Yt(e,t){return e.templateData.elements.find(o=>o.id===t)??null}function ns(e,t){const o=e.tableSelection;return!o||o.elementId!==t.id?null:e.selectedElement?.id!==t.id?(e.tableSelection=null,null):o}function Nn(e,t,o,r){const i=Yt(e,o.id);if(!i)return null;const n=o.options;return{store:e,fire:t,el:o,real:i,options:n,rows:n.tableRows??[],colWidths:n.tableColWidths??[],isSelected:e.selectedIds.has(o.id),selection:ns(e,o),maxTableWidth:Bn(e),designData:r}}function Bn(e){return e.paperSize.width-e.templateData.margins.left-e.templateData.margins.right}function Br(e){return e.options.tableDefaultFontSize??10}function Un(e){return e.options.tableDefaultColor??"#333333"}function as(e,t){let o=0;for(let r=0;r<t;r++)o+=e.rows[r].height;return o}function ls(e,t){return ot(e.store).layouts.get(e.el.id)?.[t]?.top??as(e,t)}function ss(e,t){return ot(e.store).layouts.get(e.el.id)?.[t]?.height??e.rows[t]?.height??0}function ds(e){const t=e.options.dataSource;if(t)return Array.isArray(h.DEFAULT_DEMO_DATA[t])?h.DEFAULT_DEMO_DATA[t]:void 0;for(const o of Object.values(h.DEFAULT_DEMO_DATA))if(Array.isArray(o))return o}function Hn(e){return e.cellType==="barcode"||e.cellType==="qrcode"}function $n(e,t){return Hn(t)?h.resolveBarcodeDesignValue(t.formatter,ds(e)):t.formatter||""}function ps(e,t){const o={designMode:!0,showGhostBorder:e.store.showTableGhostBorder};return{fontFamily:R.resolveCanvasFontFamily(t.fontFamily??e.options.tableDefaultFontFamily),textAlign:t.align??"left",...t.align==="justify"?{textAlignLast:"justify"}:{},verticalAlign:t.valign??"middle",fontSize:(t.fontSize??Br(e))+"pt",fontWeight:t.fontWeight??"normal",color:t.color??Un(e),backgroundColor:t.backgroundColor??"transparent",borderTop:h.resolveCellBorderCss(t.borders?.top,o),borderRight:h.resolveCellBorderCss(t.borders?.right,o),borderBottom:h.resolveCellBorderCss(t.borders?.bottom,o),borderLeft:h.resolveCellBorderCss(t.borders?.left,o),padding:(t.padding??e.options.tableDefaultPadding??1)+"mm",whiteSpace:t.wordWrap??!0?"pre-wrap":"nowrap",overflow:t.wordWrap??!0?"visible":"hidden"}}function cs(e,t,o){const r=e.selection;return[!!r&&t>=r.r1&&t<=r.r2&&o>=r.c1&&o<=r.c2?"cell-selected":"",e.rows[t]?.type==="data"?"row-data-bg":""].filter(Boolean).join(" ")}function Wn(e){return h.resolveCellTextFit(e)}function hs(e){return Wn(e)!=="autoHeight"}function us(e,t){return t.fontSize??Br(e)}function wo(e,t,o){return h.cellFitCapMm(e.rows,t,o,e.options.tableDefaultPadding??1)}function fs(e,t,o){return h.cellFitWidthMm(e.colWidths,t,o,e.options.tableDefaultPadding??1)}function gs(e,t,o){return{maxHeight:wo(e,o,t)+"mm",overflow:"hidden",...t.wordWrap===!1?{whiteSpace:"nowrap",textOverflow:"ellipsis"}:{}}}function ms(e,t,o){const r={fitBase:String(us(e,t)),fitMin:String(h.resolveShrinkMinFontSize(t.shrinkMinFontSize)),fitMm:String(wo(e,o,t))};return Wn(t)==="shrink"&&(r.fit="shrink"),r}function bs(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(o=>!Number.isFinite(o))?null:{width:t[2],height:t[3]}}const ys={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function vs(e,t,o,r){const i=document.createElement("div");i.className="cell-barcode";const n=document.createElementNS(Ra,"svg");i.appendChild(n);const s=$n(e,r);if(r.cellType==="barcode"){n.setAttribute("preserveAspectRatio",ys[r.fit||"contain"]??"xMidYMid meet");const d=h.barcodeUnitsPerModule(r.barWidth),c=h.barcodeQuietZoneModules(r.barQuietZone),u=m=>{pn(n,s,{format:r.barcodeType||"CODE128",width:d,height:m*d,displayValue:r.showBarcodeText!==!1,fontSize:(r.barFontSize??h.BARCODE_TEXT_FONT_SIZE_MODULES)*d,margin:0,marginLeft:c*d,marginRight:c*d,marginTop:0,marginBottom:h.BARCODE_MARGIN_BOTTOM_MODULES*d});const E=bs(n);return E?{widthUnits:E.width,heightUnits:E.height}:null};let f=null;try{f=h.layoutBarcodeSize({barHeightMm:r.barHeight,boxWidthMm:h.barcodeAvailableBoxMm(fs(e,o,r),r.maxWidth),boxHeightMm:h.barcodeAvailableBoxMm(wo(e,t,r),r.maxHeight),dpi:r.printerDpi,barWidth:r.barWidth,measure:u})}catch{f=null}if(!f){n.style.display="none";const m=document.createElement("span");return m.className="cell-barcode-fallback",m.textContent=s||a(e,"table.k458"),i.appendChild(m),i}const b=f.size;return b?(n.style.width=`${b.widthMm}mm`,n.style.height=`${b.heightMm}mm`):(n.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",n.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%"),n.setAttribute("shape-rendering","crispEdges"),i}if(n.style.display="none",!s)return i;try{const d=Dr.browserCodeRenderer.render(s,"qrcode",{qrCodeLevel:String(r.qrCodeLevel||"M"),qrQuietZone:typeof r.qrQuietZone=="number"?r.qrQuietZone:void 0}),c=document.createElement("img");c.setAttribute("src",`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`),c.setAttribute("alt","qrcode"),c.style.width="100%",c.style.height="100%",c.style.objectFit=r.fit||"contain",r.objectPosition&&(c.style.objectPosition=r.objectPosition),c.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",c.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%",i.appendChild(c)}catch{}return i}function Li(){const e=document.createElement("div");return e.className="image-placeholder",e.textContent=N("table.k459"),e}function xs(e,t){const o=e.formatter||"";if(!o)return"";if(!o.includes("{"))return o;const r=t.designData?.length?t.designData[0]:h.DEFAULT_DEMO_DATA;return h.evaluateTemplate(o,r)}function ws(e,t,o){const r=document.createElement("div");r.className="cell-image";const i=h.cellImageBoxMm(o.fit,wo(e,t,o));i!==void 0&&(r.style.height=`${i}mm`);const n=xs(o,e);if(!n)return r.appendChild(Li()),r;const s=document.createElement("img");s.setAttribute("src",n),i!==void 0&&(s.style.width="100%",s.style.height="100%"),s.style.objectFit=o.fit||"contain";for(const[d,c]of Object.entries(h.cropStyleDeclarations(o.fit,o.fitScale,o.objectPosition)))s.style[d]=c;return s.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",s.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",s.addEventListener("error",()=>{s.remove(),r.appendChild(Li())},{once:!0}),r.appendChild(s),r}function ks(e,t,o,r,i){if(Hn(i))return vs(e,o,r,i);if(i.cellType==="image")return ws(e,o,i);const n=$n(e,i),s=()=>t.type==="data"?l("span",{class:"data-placeholder",text:n}):n;return hs(i)?l("div",{class:"cell-fit",style:gs(e,i,o),dataset:ms(e,i,o)},[s()]):s()}function yo(e,t,o){const r={elementId:e.el.id,...h.normalizeSelection(e.rows,t,o)};e.store.setTableSelection(r),e.fire("table-selection-change",{elementId:e.el.id,selection:r})}function Es(e,t,o,r,i){if(i.button!==0||(e.fire("table-cell-mousedown",{elementId:e.el.id,r:t,c:o,cellId:r,event:i}),!e.isSelected))return;i.stopPropagation();const n=ot(e.store);i.shiftKey&&e.selection?yo(e,{r:e.selection.r1,c:e.selection.c1},{r:t,c:o}):(n.anchor={r:t,c:o},yo(e,{r:t,c:o},{r:t,c:o})),document.addEventListener("mouseup",()=>{ot(e.store).anchor=null},{once:!0})}function Ss(e,t,o){const r=ot(e.store).anchor;r&&yo(e,r,{r:t,c:o})}function Ur(e,t){const o=ot(e);o.menu?.visible&&(o.menu.visible=!1,t("table-menu-close",{elementId:o.menuElId}),e.emit(!1))}function Ts(e,t,o,r){r.preventDefault(),r.stopPropagation(),e.isSelected||e.store.selectOne(e.el.id);const i=e.selection;i&&t>=i.r1&&t<=i.r2&&o>=i.c1&&o<=i.c2||yo(e,{r:t,c:o},{r:t,c:o});const s=ot(e.store);s.menuElId=e.el.id,s.menu&&(s.menu.x=r.clientX,s.menu.y=r.clientY,s.menu.visible=!0),e.fire("table-cell-contextmenu",{elementId:e.el.id,r:t,c:o,clientX:r.clientX,clientY:r.clientY}),e.store.emit(!1),document.addEventListener("mousedown",()=>Ur(e.store,e.fire),{once:!0})}function zi(e,t,o){const r=e.reduce((i,n)=>i+n,0)+(e[t]??0);return r>o?N("table.k460",{v0:Math.round(r*10)/10,v1:o}):null}function Cs(e,t){const o=e.real.options.tableRows??[],r=e.real.options.tableColWidths??[],i=t(xr(o),xr(r));return i?(window.alert(i),!1):(e.store.recordHistory(),t(o,r),e.store.setTableSelection(null),h.syncTableElementSize(e.real.options),e.store.emit(),!0)}function Je(e,t,o){Ur(e.store,e.fire);const r=e.selection;if(!r)return;let i=null;switch(t){case"insert-row-above":i=n=>(h.insertRow(n,r.r1,"above"),null);break;case"insert-row-below":i=n=>(h.insertRow(n,r.r2,"below"),null);break;case"delete-row":i=n=>h.deleteRow(n,r.r1);break;case"insert-col-left":i=(n,s)=>{const d=zi(s,r.c1,e.maxTableWidth);return d||(h.insertCol(n,s,r.c1,"left"),null)};break;case"insert-col-right":i=(n,s)=>{const d=zi(s,r.c2,e.maxTableWidth);return d||(h.insertCol(n,s,r.c2,"right"),null)};break;case"delete-col":i=(n,s)=>h.deleteCol(n,s,r.c1);break;case"merge":i=n=>(h.mergeCells(n,r),null);break;case"split":i=n=>(h.splitCells(n,r),null);break;case"set-row-type":i=n=>o?h.setRowType(n,r.r1,o):a(e,"table.k461");break}i&&Cs(e,i)&&e.fire(`table-${t}`,{elementId:e.el.id,...o?{type:o}:{}})}function Ds(e){const t=e.selection;if(!t)return!1;for(let o=t.r1;o<=t.r2;o++)for(let r=t.c1;r<=t.c2;r++){const i=e.rows[o]?.cells[r];if(i&&!i.merged&&((i.rowspan??1)>1||(i.colspan??1)>1))return!0}return!1}function Ps(e){const t=e.selection;if(!t)return;const o=h.findMainCell(e.rows,t.r1,t.c1),r=!e.rows[o.r]?.cells[o.c]?.mergeSameValue;for(let i=t.r1;i<=t.r2;i++)for(let n=t.c1;n<=t.c2;n++){const s=e.rows[i]?.cells[n];s&&!s.merged&&(s.mergeSameValue=r)}e.store.updateElement(e.el.id,{tableRows:e.rows}),Ur(e.store,e.fire)}function Oi(e){const t=e.selection;if(!t)return a(e,"table.k462");for(let o=t.r1;o<=t.r2;o++)if(e.rows[o]?.type!=="data")return a(e,"table.k463");return null}function Ni(e,t){const o=e.selection;return o?o.r1!==o.r2?a(e,"table.k465"):h.setRowType(xr(e.rows),o.r1,t):a(e,"table.k464")}function Ke(e,t,o={}){return l("div",{class:`menu-item${o.disabled?" disabled":""}${o.active?" active":""}`,title:o.title||"",text:e,onClick:()=>{o.disabled||t()}})}const lr=()=>l("div",{class:"menu-divider"});function As(e,t,o){const r=ot(e);if(r.menu=o,!o.visible||!r.menuElId)return"";const i=Yt(e,r.menuElId);if(!i||i.printElementType.type!=="table")return"";const n=Nn(e,t,i);if(!n)return"";const s=n.selection?h.canMergeReason(n.rows,n.selection):a(n,"table.k466"),d=n.selection?n.rows[n.selection.r1]?.type??null:null;return l("div",{class:"table-ctx-menu",style:{left:o.x+"px",top:o.y+"px"},onMousedown:c=>c.stopPropagation()},[Ke(a(n,"table.k467"),()=>Je(n,"insert-row-above")),Ke(a(n,"table.k468"),()=>Je(n,"insert-row-below")),Ke(a(n,"table.k469"),()=>Je(n,"delete-row"),{disabled:n.rows.length<=1}),lr(),Ke(a(n,"table.k470"),()=>Je(n,"insert-col-left")),Ke(a(n,"table.k471"),()=>Je(n,"insert-col-right")),Ke(a(n,"table.k472"),()=>Je(n,"delete-col"),{disabled:n.colWidths.length<=1}),lr(),Ke(a(n,"table.k473"),()=>Je(n,"merge"),{disabled:!!s,title:s||""}),Ke(a(n,"table.k474"),()=>Je(n,"split"),{disabled:!Ds(n)}),Ke(a(n,"table.k475"),()=>Ps(n),{disabled:!!Oi(n),title:Oi(n)||"",active:(()=>{const c=n.selection;if(!c)return!1;const u=h.findMainCell(n.rows,c.r1,c.c1);return n.rows[u.r]?.cells[u.c]?.mergeSameValue===!0})()}),lr(),l("div",{class:"menu-group-title",text:a(n,"table.k476")}),...rs.map(c=>Ke(N(c.labelKey),()=>Je(n,"set-row-type",c.value),{disabled:!!Ni(n,c.value),title:Ni(n,c.value)||"",active:d===c.value}))])}let xt=null;function Kn(){xt&&(document.removeEventListener("mousemove",Hr),document.removeEventListener("mouseup",$r),xt.handle.classList.remove("dragging"),xt=null)}function Ms(e,t){const o=e.closest(".hiprint-printPaper");return(o&&o.offsetWidth>0?o.getBoundingClientRect().width/o.offsetWidth:0)||(t.scale||100)/100}function _s(e,t,o){if(o.button!==0)return;const r=o.currentTarget,i=r.closest(".print-table");if(!i)return;Kn();const n=e.real.options.tableColWidths??[];xt={store:e.store,fire:e.fire,elId:e.real.id,boundary:t,startX:o.clientX,startWidth:n[t-1]??0,scale:Ms(i,e.store),root:i,wrapper:r.closest(".print-element"),handle:r},r.classList.add("dragging"),e.store.recordHistory(),document.addEventListener("mousemove",Hr),document.addEventListener("mouseup",$r)}function Hr(e){const t=xt;if(!t)return;const o=Yt(t.store,t.elId),r=o?.options.tableColWidths;if(!o||!r)return;const i=(e.clientX-t.startX)/(t.scale*co),n=t.boundary-1;r[n]=h.clampResizedColumnWidth(r,n,t.startWidth+i,Bn(t.store)),h.syncTableElementSize(o.options),r.forEach((s,d)=>{const c=t.root.querySelector(`colgroup col:nth-child(${d+1})`);c&&(c.style.width=`${s}mm`)}),t.root.querySelectorAll(".col-resize-handle").forEach((s,d)=>{s.style.left=`${r.slice(0,d+1).reduce((c,u)=>c+u,0)}mm`}),t.wrapper&&(t.wrapper.style.width=`${o.options.width}mm`,t.wrapper.style.height=`${o.options.height}mm`)}function $r(){document.removeEventListener("mousemove",Hr),document.removeEventListener("mouseup",$r);const e=xt;if(!e)return;xt=null,e.handle.classList.remove("dragging");const t=Yt(e.store,e.elId);t&&h.syncTableElementSize(t.options),e.store.emit(),e.fire("table-col-resize-end",{elementId:e.elId})}function Rs(e,t,o){const r=o.querySelector("table");if(!r)return;const i=r.offsetHeight;if(i<=0)return;const n=Yt(e,t);if(!n)return;let s=!1;const d=i/co;Math.abs(d-(n.options.height??0))>is&&(n.options.height=Math.round(d*100)/100,s=!0);const c=r.offsetTop,u=Array.from(r.rows).map(b=>({top:(b.offsetTop-c)/co,height:b.offsetHeight/co})),f=ot(e);Fs(f.layouts.get(t),u)||(f.layouts.set(t,u),s=!0),s&&e.emit(!1)}function Fs(e,t){return!e||e.length!==t.length?!1:t.every((o,r)=>{const i=e[r];return Math.round(o.top*10)===Math.round(i.top*10)&&Math.round(o.height*10)===Math.round(i.height*10)})}function Is(e,t){const o=document.createComment("pd-table-measure");return requestAnimationFrame(()=>{if(!o.isConnected)return;const r=o.parentElement;r&&Rs(e,t,r)}),o}function Ls(e){return e.isSelected&&!e.real.options.locked&&e.colWidths.length>=1}function zs(e){return Array.from({length:e.colWidths.length},(t,o)=>o+1)}function Os(e,t){return e.colWidths.slice(0,t).reduce((o,r)=>o+r,0)}function Ns(e,t,o,r){const i=Nn(t,o,e,r);if(!i)return l("div",{class:"print-table"});const n=[l("table",{style:{fontSize:`${Br(i)}pt`,color:Un(i)}},[l("colgroup",{},i.colWidths.map(s=>l("col",{style:{width:s+"mm"}}))),l("tbody",{},i.rows.map((s,d)=>l("tr",{style:{height:s.height+"mm"}},s.cells.map((c,u)=>c.merged?"":l("td",{rowspan:c.rowspan||1,colspan:c.colspan||1,class:cs(i,d,u),style:ps(i,c),onMousedown:f=>Es(i,d,u,c.id,f),onMouseenter:()=>Ss(i,d,u),onContextmenu:f=>Ts(i,d,u,f)},[ks(i,s,d,u,c)])).filter(Boolean))))])];return Ls(i)&&n.push(l("div",{class:"col-resize-layer"},zs(i).map(s=>l("div",{class:"col-resize-handle",role:"separator","aria-label":a(i,"table.k477",{v0:s}),style:{left:Os(i,s)+"mm"},onMousedown:d=>{d.stopPropagation(),d.preventDefault(),_s(i,s,d)}})))),i.isSelected&&n.push(l("div",{class:"row-badges"},i.rows.map((s,d)=>l("span",{class:"row-badge",style:{top:ls(i,d)+"mm",height:ss(i,d)+"mm"},text:N(os[s.type])})))),n.push(Is(t,e.id)),l("div",{class:"print-table design-mode",dataset:{tableId:e.id},onContextmenu:s=>s.preventDefault()},n)}const Bs=["flowList.k44","flowList.k45","flowList.k46","flowList.k47","flowList.k48","flowList.k49","flowList.k50"];function Us(){return Bs.map(e=>N(e))}function wr(e){return Array.isArray(e)&&e.length>0?e:[]}function Hs(e,t){const o=h.detectFlowListKey(e,t)??(t?Object.keys(t).find(i=>Array.isArray(t[i])):void 0);if(o)return wr(t?.[o]);const r=h.detectFlowListKey(e,h.DEFAULT_DEMO_DATA);return r?wr(h.DEFAULT_DEMO_DATA[r]):[]}function $s(e,t){const o=e.options,r=typeof o.formatter=="string"?o.formatter:"",i=wr(t)[0],n=Hs(r,i);if(n.length===0)return Us();if(!r)return n.map(c=>String(c?.name??JSON.stringify(c)));const s=i??{},d=h.detectFlowListKey(r,s)??Object.keys(s).find(c=>Array.isArray(s[c]));return n.map(c=>{try{return h.evaluateTemplate(r,{...s,...c,...d?{[d]:c}:{}})}catch{return r}})}const Ws=3.7795275591,Ks=.1;function Vs(e,t){return e.templateData.elements.find(o=>o.id===t)??null}function Gs(e){const t=e.parentElement;if(!t?.classList.contains("print-element"))return 0;const o=getComputedStyle(t);return(parseFloat(o.borderTopWidth)||0)+(parseFloat(o.borderBottomWidth)||0)}function qs(e,t,o){const r=o.offsetHeight+Gs(o);if(r<=0)return;const i=Vs(e,t);if(!i)return;const n=r/Ws;Math.abs(n-(i.options.height??0))>Ks&&(i.options.height=Math.round(n*100)/100,e.emit(!1))}function Ys(e,t){const o=document.createComment("pd-flowlist-measure");return requestAnimationFrame(()=>{if(!o.isConnected)return;const r=o.parentElement;r&&qs(e,t,r)}),o}function js(e,t,o){const r=e.options,i=h.resolveFlowColumns(r.flowColumns),n=h.resolveFlowGapX(r.flowGapX),s=h.resolveFlowRowHeight(r.flowRowHeight),d=h.resolveFlowLayoutMode(r.flowLayoutMode)==="dynamic",c=h.resolveFlowPadding(r),u={display:"grid",gridTemplateColumns:`repeat(${i},minmax(0,1fr))`,columnGap:`${n}mm`,gridAutoRows:`minmax(${s}mm,auto)`,width:"100%",...d?{padding:`${c.top}mm ${c.right}mm ${c.bottom}mm ${c.left}mm`,height:"auto",overflow:"visible"}:{height:"100%",overflow:"hidden"},fontSize:`${r.fontSize||12}pt`,fontWeight:r.fontWeight||"normal",color:r.color||"#333",boxSizing:"border-box"};r.fontFamily&&(u.fontFamily=String(r.fontFamily)),r.backgroundColor&&(u.backgroundColor=String(r.backgroundColor));const f=$s(e,t).map(b=>l("div",{class:"print-flow-cell",text:b}));return d&&o&&f.push(Ys(o,e.id)),l("div",{class:"print-flowlist",style:u},f)}const Bi={top:"flex-start",middle:"center",bottom:"flex-end"},Xs={left:"flex-start",center:"center",right:"flex-end"};function Zs(e,t){const o=e.options,r=h.resolveElementMargins(o),i=h.resolveElementBorder(e.printElementType.type,o),n={};if(i?.all&&(n.border=`${i.all.borderWidth} ${i.all.borderStyle} ${i.all.borderColor}`),i)for(const s of h.ELEMENT_BORDER_SIDES){const d=i.edges[s];d&&(n[`border${s.charAt(0).toUpperCase()}${s.slice(1)}`]=`${d.borderWidth} ${d.borderStyle} ${d.borderColor}`)}return{position:"absolute",left:`${o.left}mm`,top:`${o.top}mm`,width:`${o.width}mm`,height:`${o.height}mm`,...r.top!==0?{marginTop:`${r.top}mm`}:{},...r.right!==0?{marginRight:`${r.right}mm`}:{},...r.bottom!==0?{marginBottom:`${r.bottom}mm`}:{},...r.left!==0?{marginLeft:`${r.left}mm`}:{},zIndex:String(o.zIndex||"auto"),...n,...Qs(e,t)}}function Qs(e,t){if(t?.has(e.id))return{};const o=h.resolveElementRotation(e.printElementType.type,e.options);return o===void 0?{}:{rotate:`${o}deg`}}function Ui(e){const t=e.options,o=e.printElementType.type==="longText",r=h.resolveElementTextFit(e.printElementType.type,t),i=t.fontSize||12,n=r==="autoHeight",s={fontSize:`${i}pt`,fontWeight:t.fontWeight||"normal",fontFamily:R.resolveCanvasFontFamily(t.fontFamily),color:t.color||"#333",backgroundColor:t.backgroundColor||"transparent",textAlign:t.textAlign||"left",...t.textAlign==="justify"?{textAlignLast:"justify"}:{},lineHeight:t.lineHeight?`${t.lineHeight}pt`:o?"1.5":"normal",letterSpacing:t.letterSpacing?`${t.letterSpacing}pt`:"normal",width:"100%",height:n?"auto":"100%",boxSizing:"border-box",overflow:n?"visible":"hidden",...o?{wordBreak:"break-all",textIndent:t.longTextIndent?`${t.longTextIndent}em`:"0"}:{textDecoration:t.textDecoration||"none",padding:`${t.contentPaddingTop||0}pt ${t.contentPaddingRight||0}pt ${t.contentPaddingBottom||0}pt ${t.contentPaddingLeft||0}pt`}};h.resolveElementNowrap(t)&&(s.whiteSpace="nowrap",s.textOverflow="ellipsis");const d=h.resolveElementWhiteSpace(t);return d&&(s.whiteSpace=d),t.verticalAlign&&(s.display="flex",t.textAlign==="justify"?(s.flexDirection="column",s.justifyContent=Bi[t.verticalAlign]??"flex-start"):(s.alignItems=Bi[t.verticalAlign]??"flex-start",s.justifyContent=Xs[t.textAlign||"left"]??"flex-start")),{style:s,fit:r}}function Hi(e){const t=e.options,o=`${t.borderWidth||.75}pt`,r=t.borderStyle||"solid",i=t.borderColor||"#333";return e.printElementType.type==="hline"?{width:"100%",height:"0",borderTop:`${o} ${r} ${i}`,boxSizing:"border-box"}:{width:"0",height:"100%",borderLeft:`${o} ${r} ${i}`,boxSizing:"border-box"}}function $i(e){const t=e.options;return{width:"100%",height:"100%",borderWidth:`${t.borderWidth||1}pt`,borderStyle:t.borderStyle||"solid",borderColor:t.borderColor||"#333",backgroundColor:t.backgroundColor||"transparent",borderRadius:e.printElementType.type==="oval"?"50%":"0",boxSizing:"border-box"}}function Js(e){const t=e.options;return{objectFit:t.fit||"contain",...h.cropStyleDeclarations(t.fit,t.fitScale,t.objectPosition),maxWidth:t.maxWidth?`${t.maxWidth}mm`:"100%",maxHeight:t.maxHeight?`${t.maxHeight}mm`:"100%"}}function Wi(e){const t=e.options,o={fitBase:String(t.fontSize||12),fitMin:String(h.resolveShrinkMinFontSize(t.shrinkMinFontSize))};return h.resolveElementTextFit(e.printElementType.type,t)==="shrink"&&(o.fit="shrink"),o}const ed={text:e=>{const{style:t}=Ui(e),o=e.options;return l("div",{class:"print-text",style:t,dataset:Wi(e),text:String(o.testData||o.formatter||"")||N("elements.k41")})},longText:e=>{const{style:t}=Ui(e),o=e.options;return l("div",{class:"print-longtext",style:t,dataset:Wi(e),text:String(o.formatter||"")||N("elements.k42")})},hline:e=>l("div",{class:"print-line",style:Hi(e)}),vline:e=>l("div",{class:"print-line",style:Hi(e)}),rect:e=>l("div",{class:"print-shape",style:$i(e)}),oval:e=>l("div",{class:"print-shape",style:$i(e)}),image:(e,t,o)=>{const r=e.options,i=String(r.src??""),n=o?.designData?.length?o.designData[0]:h.DEFAULT_DEMO_DATA,s=i.includes("{")?h.evaluateTemplate(i,n):i;return l("div",{class:"print-image"},[s?l("img",{src:s,style:Js(e)}):l("div",{class:"image-placeholder",text:N("elements.k43")})])},qrcode:e=>jl(e),barcode:e=>Xl(e),html:e=>{const t=e.options,o=String(t.formatter??""),r=o?Gl.sanitize(h.evaluateTemplate(o,{})):'<div style="background:#e0e0e0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:10pt;color:#999">HTML</div>';return l("div",{class:"print-html",html:r})},pageNumber:(e,t)=>{const o=e.options;return l("div",{class:"page-number-element",style:{fontSize:`${o.fontSize||12}pt`,fontWeight:o.fontWeight||"normal",fontFamily:R.resolveCanvasFontFamily(o.fontFamily),color:o.color||"#333",textAlign:o.textAlign||"left",...o.textAlign==="justify"?{textAlignLast:"justify"}:{}},text:t?o.title||"{pageIndex}/{totalPages}":String(o.title||"")})},table:(e,t,o)=>o?Ns(e,o.store,o.fire,o.designData):l("div",{class:"print-table"}),flowList:(e,t,o)=>js(e,void 0,o?.store)};yn(ed);function td(e,t,o){const r=e.printElementType.type,i=pt(r)?.renderContent;if(i)return i(e,t,o);const n=Lr(r);if(!n)return l("div",{text:r});const s=document.createElement("div");s.className="plugin-kit-canvas",s.style.width="100%",s.style.height="100%";try{zn(`canvas:${e.id}`,n.ui.renderCanvas({element:e,data:o?.designData?.length?o.designData:[h.DEFAULT_DEMO_DATA],designMode:!0}),s)}catch{s.textContent=String(r)}return s}function Vn(e){return`x:${Math.round(e.left)} y:${Math.round(e.top)} ${Math.round(e.width)}×${Math.round(e.height)}mm`}function od(e,t,o){const r=e.store,i=r.selectedIds.has(t.id),n=r.previewIds.has(t.id),s=t.options,d=t.zone||"content",c=[td(t,!0,{store:r,fire:e.fire,designData:e.host.designData})];return r.draggingIds.has(t.id)&&c.push(l("div",{class:"drag-preview"})),i&&(c.push(l("div",{class:"resize-handles"},h.RESIZE_POINTS.map(u=>l("div",{class:`resize-handle handle-${u}`,dataset:{point:u,elId:t.id},onMousedown:f=>e.fire("resize-start",{event:f,id:t.id,point:u})})))),c.push(l("div",{class:"selected-indicator"},[l("div",{class:"position-label",text:Vn(s)})]))),l("div",{class:["print-element",`type-${t.printElementType.type}`,`zone-${d}`,i?"selected":"",n?"previewed":"",r.draggingIds.has(t.id)?"drag-ghost":"","design-mode",s.locked?"locked":"",s.visible===!1?"hidden":""].filter(Boolean).join(" "),style:Zs(t,o),dataset:{elId:t.id},onMousedown:u=>e.fire("element-mousedown",{event:u,id:t.id}),onContextmenu:u=>{u.preventDefault(),u.stopPropagation(),e.fire("contextmenu",{event:u,id:t.id})}},c)}function kr(e,t){const o=e.margins,r=e.header?.height??10,i=e.footer?.height??10,n=t.width-o.left-o.right;return{header:{left:o.left,top:o.top,width:n,height:r},content:{left:o.left,top:o.top+r,width:n,height:t.height-o.top-o.bottom-r-i},footer:{left:o.left,top:t.height-o.bottom-i,width:n,height:i}}}const rd='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M0 .5H20M.5 0V20" fill="none" stroke="rgba(0,0,0,0.08)" stroke-width="1" stroke-dasharray="4 4"/></svg>';function Ki(e,t){return e.type==="vertical"?{left:`${e.position}mm`,top:"0",height:`${t.height}mm`,borderLeftColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}:{top:`${e.position}mm`,left:"0",width:`${t.width}mm`,borderTopColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}}function id(e,t){const o=R.resolveWatermarkLayout(e.watermark,[],t);return o?l("div",{class:"watermark-layer",style:{opacity:String(o.opacity)}},o.tiles.map(r=>l("svg",{class:"watermark-tile",width:`${r.widthMm}mm`,height:`${r.heightMm}mm`,viewBox:`0 0 ${o.tileWidthPx} ${o.tileHeightPx}`,style:{left:`${r.leftMm}mm`,top:`${r.topMm}mm`}},[l("text",{x:String(o.tileWidthPx/2),y:String(o.tileHeightPx/2),"font-size":String(o.fontSizePx),fill:o.color,"text-anchor":"middle","dominant-baseline":"middle",transform:`rotate(${o.rotate},${o.tileWidthPx/2},${o.tileHeightPx/2})`,text:o.text})]))):""}function sr(e,t,o,r,i,n){const s=e.store,d=[];o!=="content"&&d.push(l("span",{class:"zone-label",text:o==="header"?a(e,"canvas.k11"):a(e,"canvas.k12")}));const c=o==="content"?R.collectFollowMemberIds(i):void 0;if(d.push(...i.map(u=>od(e,u,c))),o!=="content"){const u=o==="header"?"bottom":"top";d.push(l("div",{class:`zone-resize-handle handle-${u}`,dataset:{zone:o},onMousedown:f=>e.fire("zone-resize",{event:f,zone:o})},[t.zoneResizing===o?l("div",{class:"zone-height-tip",text:`${(o==="header"?s.templateData.header.height:s.templateData.footer.height).toFixed(1)}mm`}):""]))}return l("div",{class:`zone-layer zone-${o} design-mode`,style:{position:"absolute",left:`${r.left}mm`,top:`${r.top}mm`,width:`${r.width}mm`,height:`${r.height}mm`},dataset:{zone:o,paperWidth:String(n.width),paperHeight:String(n.height)}},d.filter(Boolean))}function nd(e){const t=e.currentTarget,o=e.dataTransfer?.types??[],r=o.includes("fieldkey"),i=o.includes("elementtype");if(!r&&!i){t.querySelector(".drop-hint")?.remove();return}r&&(e.ctrlKey||e.metaKey)&&(t.dataset.dropLabelIntent="1");const n=i?N("canvas.k13"):t.dataset.dropLabelIntent?N("canvas.k14"):N("canvas.k15");let s=t.querySelector(".drop-hint");s||(s=document.createElement("div"),s.className="drop-hint",t.appendChild(s)),s.textContent=n,s.style.left=`${e.clientX+14}px`,s.style.top=`${e.clientY+18}px`}function Gn(e){e&&(e.querySelector(".drop-hint")?.remove(),delete e.dataset.dropLabelIntent)}function ad(e,t){const o=e.store,r=o.templateData,i=R.getPaperDimensions(r),n=(o.scale||100)/100,s=kr(r,i),d=b=>o.elements.filter(m=>(m.zone||"content")===b),c=l("div",{class:"hiprint-printPaper-content",dataset:{content:""},style:{padding:`${r.margins.top}mm ${r.margins.right}mm ${r.margins.bottom}mm ${r.margins.left}mm`,position:"relative",boxSizing:"border-box",minHeight:`${i.height}mm`}},[o.showGrid?l("div",{class:"grid-bg",style:{backgroundImage:`url("data:image/svg+xml,${encodeURIComponent(rd)}")`,backgroundSize:"5mm 5mm",backgroundPosition:"0 0"}}):"",...r.watermark&&Object.keys(r.watermark).length?[id(r,i)]:[],sr(e,t,"header",s.header,d("header"),i),sr(e,t,"content",s.content,d("content"),i),sr(e,t,"footer",s.footer,d("footer"),i),...o.adsorbGuides.map(b=>l("div",{class:`adsorb-guide guide-${b.type}`,style:Ki(b,i)})),...(r.guides??[]).map(b=>l("div",{class:`manual-guide guide-${b.type}`,style:{...Ki(b,i),"--guide-hit":`${8/n}px`},dataset:{guideId:String(b.id??"")},onMousedown:m=>e.fire("guide-mousedown",{event:m,id:b.id}),onDblclick:m=>{m.preventDefault(),e.fire("guide-remove",b.id)}}))].filter(Boolean)),u=l("div",{class:"hiprint-printPaper",dataset:{test:"paper"},style:{width:`${i.width}mm`,minHeight:`${i.height}mm`,background:r.pageBackground||"var(--pd-paper, #fff)",boxShadow:"var(--pd-shadow-paper, 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08))",overflow:"hidden",position:"relative",transform:`scale(${n})`,transformOrigin:"0 0"}},[...r.designBackground?.src?[l("div",{class:"design-background",style:{width:`${i.width}mm`,height:`${i.height}mm`,left:"0",top:"0",transform:r.designBackground.rotation?`rotate(${r.designBackground.rotation}deg)`:""}},[l("img",{src:r.designBackground.src,draggable:!1,alt:""})])]:[],c]),f=[l("div",{class:"canvas-scroll"},[l("div",{class:"paper-wrapper",style:{width:`${R.mmToPx(i.width)*n}px`,height:`${R.mmToPx(i.height)*n}px`,position:"relative"}},[u])])];if(o.showRuler&&f.push(l("div",{class:"ruler-overlay",style:{transform:`translate(${t.scrollX}px, ${t.scrollY}px)`}},[l("div",{class:"ruler-corner"}),l("canvas",{class:"pd-ruler is-horizontal",dataset:{ruler:"horizontal"},style:{width:`${t.geom.viewW}px`,height:"20px"},onMousedown:b=>e.fire("ruler-mousedown",{event:b,orientation:"horizontal"})}),l("canvas",{class:"pd-ruler is-vertical",dataset:{ruler:"vertical"},style:{width:"20px",height:`${t.geom.viewH}px`},onMousedown:b=>e.fire("ruler-mousedown",{event:b,orientation:"vertical"})})])),t.guidePreview&&f.push(l("div",{class:`ruler-guide-preview guide-${t.guidePreview.type}`,style:t.guidePreview.type==="vertical"?{left:`${t.guidePreview.position}px`,top:"0",height:"100%"}:{top:`${t.guidePreview.position}px`,left:"0",width:"100%"}})),t.marquee.visible&&f.push(l("div",{class:"marquee-selection",style:{left:`${t.marquee.x}px`,top:`${t.marquee.y}px`,width:`${t.marquee.w}px`,height:`${t.marquee.h}px`}})),t.contextMenu.visible){const b=t.contextMenu;f.push(l("div",{class:"context-menu",style:{left:`${t.contextMenu.x+t.contextMenu.flipX}px`,top:`${t.contextMenu.y+t.contextMenu.flipY}px`}},t.contextMenu.targetId?[Ne(e,b,a(e,"canvas.k16"),"copy"),Ne(e,b,a(e,"canvas.k17"),"cut"),Ne(e,b,a(e,"canvas.k18"),"paste",!o.hasClipboard),Ne(e,b,a(e,"canvas.k19"),"delete"),l("div",{class:"context-menu-sep"}),Ne(e,b,a(e,"canvas.k20"),"move-layer",!1,"top"),Ne(e,b,a(e,"canvas.k21"),"move-layer",!1,"up"),Ne(e,b,a(e,"canvas.k22"),"move-layer",!1,"down"),Ne(e,b,a(e,"canvas.k23"),"move-layer",!1,"bottom")]:[Ne(e,b,a(e,"canvas.k24"),"paste-at",!o.hasClipboard),Ne(e,b,a(e,"canvas.k25"),"select-all"),Ne(e,b,a(e,"canvas.k26"),"clear-selection")]))}return l("div",{class:"canvas-area",dataset:{test:"canvas-area"},onDragover:b=>{const m=b;m.preventDefault(),m.dataTransfer&&(m.dataTransfer.dropEffect="copy"),nd(m)},onDragleave:b=>{const m=b.currentTarget,E=b.relatedTarget;(!E||!m.contains(E))&&m.querySelector(".drop-hint")?.remove()},onDrop:b=>{const m=b,E=b.currentTarget,y=E.dataset.dropLabelIntent==="1";Gn(E),y&&(m.labelIntent=!0),e.fire("drop",m)},onMousedown:b=>e.fire("canvas-mousedown",b),onMousemove:b=>e.fire("canvas-mousemove",b),onMouseleave:()=>e.fire("canvas-mouseleave"),onWheel:b=>e.fire("wheel",b),onScroll:b=>e.fire("scroll",b),onContextmenu:b=>{b.preventDefault(),e.fire("canvas-contextmenu",b)}},f.filter(Boolean))}function Ne(e,t,o,r,i=!1,n){return l("div",{class:`context-menu-item${i?" disabled":""}`,text:o,onClick:()=>{t.visible=!1,i||e.fire(r,n),e.repaint()}})}function ld(e){const t=window.innerHeight;for(let o=e.parentElement;o&&o!==document.body;o=o.parentElement){const r=getComputedStyle(o).overflowY;if(r==="auto"||r==="scroll"||r==="hidden"||r==="clip"){const i=o.getBoundingClientRect();return{top:Math.max(0,i.top),bottom:Math.min(t,i.bottom)}}}return{top:0,bottom:t}}function ko(e){const t=R.normalizeFontCatalog(e.fonts),o=e.placeholder??N("fontSelect.k51"),r=`font-select-list-${e.id}`,i=L=>{const U=L?.trim();return U?R.findFontOption(t,U)?.label??U:""},n=L=>{const U=R.normalizeFontQuery(L);return t.find(V=>V.label&&R.normalizeFontQuery(V.label)===U)?.family??L},s=()=>{const L=e.value?.trim();return L?R.findFontOption(t,L)?"":L:""},d=L=>{const U=(e.value??"").trim(),re=(ie,Ce,ke,v)=>({kind:ie,key:Ce,label:ke,value:v,selected:(v??"")===U}),V=L.trim();if(!V){const ie=[re("clear","__clear__",o)],Ce=s();Ce&&ie.push(re("unknown","__unknown__",N("fontSelect.k52",{v0:Ce}),Ce));for(const ke of t)ie.push(re("font",ke.family,R.fontOptionLabel(ke),ke.family));return ie}const he=R.filterFontOptions(t,V).map(ie=>re("font",ie.family,R.fontOptionLabel(ie),ie.family));if(!he.length){const ie=n(V);he.push(re("free","__free__",N("fontSelect.k53",{v0:ie}),ie))}return he},c=document.createElement("div");c.className="font-select";const u=document.createElement("input");u.className="pd-input font-select-input",u.type="text",u.setAttribute("role","combobox"),u.setAttribute("aria-autocomplete","list"),u.setAttribute("aria-controls",r),u.autocomplete="off",u.placeholder=o,u.disabled=!!e.disabled,u.value=i(e.value);const f=document.createElement("ul");f.id=r,f.className="font-select-list",f.setAttribute("role","listbox");const b=e.state.fontOpen?.id===e.id?e.state.fontOpen:null,m={open:!!b&&!e.disabled,query:b?.query??"",highlighted:b?.highlighted??-1};m.open&&(u.value=m.query);const E=()=>{e.state.fontOpen=m.open?{id:e.id,query:m.query,highlighted:m.highlighted}:null};E();const y=()=>{const L=(e.value??"").trim();return d(m.query).findIndex(U=>(U.value??"")===L)},C=()=>{const L=u.getBoundingClientRect(),U=ld(u);f.classList.toggle("is-up",h.resolveOverlayPlacement({triggerTop:L.top,triggerBottom:L.bottom,overlayHeight:f.getBoundingClientRect().height,boundaryTop:U.top,boundaryBottom:U.bottom})==="up")},D=()=>{if(!m.open){f.isConnected&&f.remove(),u.setAttribute("aria-expanded","false"),u.setAttribute("aria-activedescendant","");return}f.isConnected||c.appendChild(f);const L=d(m.query);f.replaceChildren(...L.map((U,re)=>{const V=document.createElement("li");return V.id=`${r}-${re}`,V.className="font-select-option"+(re===m.highlighted?" is-active":"")+(U.kind==="unknown"||U.kind==="free"?" is-muted":""),V.setAttribute("role","option"),V.setAttribute("aria-selected",String(U.selected)),V.textContent=U.label,V.addEventListener("mousedown",he=>{he.preventDefault(),K(U)}),V})),u.setAttribute("aria-expanded","true"),u.setAttribute("aria-activedescendant",m.highlighted>=0?`${r}-${m.highlighted}`:""),C()},S=()=>{m.open||e.disabled||(m.open=!0,m.query="",m.highlighted=y(),E(),D())},_=()=>{m.open||S()},z=()=>{m.open=!0,m.query=u.value,m.highlighted=d(m.query).length?0:-1,E(),D()},A=L=>{if(!m.open){S();return}const U=d(m.query).length-1;if(U<0)return;m.highlighted=Math.min(Math.max(m.highlighted+L,0),U),E(),D(),f.children[m.highlighted]?.scrollIntoView?.({block:"nearest"})},I=()=>{if(!m.open)return;const L=d(m.query)[m.highlighted];if(L){K(L);return}const U=m.query.trim();if(U){const re=n(U);K({value:re})}},K=L=>{m.open=!1,m.query="",m.highlighted=-1,E(),u.value=i(L.value),D(),e.onChange(L.value)},B=()=>{m.open&&(m.open=!1,m.query="",m.highlighted=-1,E(),u.value=i(e.value),D())};return u.addEventListener("focus",S),u.addEventListener("click",_),u.addEventListener("input",z),u.addEventListener("blur",B),u.addEventListener("keydown",L=>{const U=L;U.key==="ArrowDown"?(U.preventDefault(),A(1)):U.key==="ArrowUp"?(U.preventDefault(),A(-1)):U.key==="Enter"?(U.preventDefault(),I()):U.key==="Escape"&&(U.preventDefault(),B())}),c.append(u),D(),m.open&&(u.focus(),u.setSelectionRange(m.query.length,m.query.length)),c}const sd=[{key:"solid",labelKey:"formatBar.k54",preview:"1.5px solid currentColor"},{key:"dashed",labelKey:"formatBar.k55",preview:"1.5px dashed currentColor"},{key:"dotted",labelKey:"formatBar.k56",preview:"1.5px dotted currentColor"},{key:"double",labelKey:"formatBar.k57",preview:"3px double currentColor"}],dd={left:"TextAlignStart",center:"TextAlignCenter",right:"TextAlignEnd",justify:"TextAlignJustify"};function lt(e,t,o,r,i={}){return l("button",{type:"button",class:`ft-cell-btn${i.on?" on":""}`,dataset:{test:e,tip:t},disabled:!!i.disabled,onClick:r,html:`<svg viewBox="0 0 18 18" width="18" height="18" aria-hidden="true">${o}</svg>`})}const Mt='<rect class="g-faint" x="2.5" y="2.5" width="13" height="13" />',Vi='<rect class="g-solid" x="2.5" y="2.5" width="13" height="13" fill="none" />';function pd(e){const t=e.format;t.syncBorderDraft();const o=t.values,r=!t.fontEditable,i=r||t.context==="cells",n=t.context==="none",s=t.context==="cells",d=!t.painterActive&&(t.context==="none"||t.context==="cells"||!t.painterCapturable),c=t.painterActive?a(e,"formatBar.k58"):t.context==="cells"?a(e,"formatBar.k59"):t.context==="none"?a(e,"formatBar.k60"):t.painterCapturable?a(e,"formatBar.k62"):a(e,"formatBar.k61"),u=m=>r?a(e,"formatBar.k63",{v0:m}):m,f=[l("div",{class:"ft-border-panel",dataset:{test:"border-panel"}},[l("div",{class:"ft-border-grid"},[lt("preset-none",a(e,"formatBar.k64"),`${Mt}<line class="g-solid" x1="4" y1="14" x2="14" y2="4" />`,()=>t.applyBorderPreset("none")),lt("preset-all",a(e,"formatBar.k65"),`${Vi}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("all")),lt("preset-outer",a(e,"formatBar.k66"),Vi,()=>t.applyBorderPreset("outer")),lt("preset-inner",s?a(e,"formatBar.k67"):a(e,"formatBar.k68"),`${Mt}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("inner"),{disabled:!s}),lt("edge-top",a(e,"formatBar.k69"),`${Mt}<line class="g-solid" x1="2" y1="3" x2="16" y2="3" />`,()=>t.applyEdge("top"),{on:t.edgeOn("top")}),lt("edge-bottom",a(e,"formatBar.k70"),`${Mt}<line class="g-solid" x1="2" y1="15" x2="16" y2="15" />`,()=>t.applyEdge("bottom"),{on:t.edgeOn("bottom")}),lt("edge-left",a(e,"formatBar.k71"),`${Mt}<line class="g-solid" x1="3" y1="2" x2="3" y2="16" />`,()=>t.applyEdge("left"),{on:t.edgeOn("left")}),lt("edge-right",a(e,"formatBar.k72"),`${Mt}<line class="g-solid" x1="15" y1="2" x2="15" y2="16" />`,()=>t.applyEdge("right"),{on:t.edgeOn("right")})]),l("div",{class:"ft-style-row"},sd.map(m=>l("button",{type:"button",class:`ft-style-btn${t.borderStyle===m.key?" on":""}`,dataset:{test:`style-${m.key}`,tip:t.borderStyle===m.key?a(e,"formatBar.k73",{v0:a(e,m.labelKey)}):a(e,m.labelKey)},onClick:()=>{t.toggleBorderStyle(m.key),e.repaint()}},[l("span",{class:"ft-style-line",style:{borderTop:m.preview}})]))),l("div",{class:"ft-border-style-row"},[l("span",{class:"ft-edge-label",text:a(e,"formatBar.k74")}),l("div",{class:"ft-line-width"},[H({value:t.borderWidth,min:.25,max:5,step:.25,placeholder:t.borderMixed.width?a(e,"formatBar.k75"):void 0,onCommit:m=>{t.setBorderWidth(m),e.repaint()}})])]),l("div",{class:"ft-border-style-row"},[l("span",{class:"ft-edge-label",text:a(e,"formatBar.k76")}),Ae(t.borderColor,m=>{t.setBorderColor(m),e.repaint()},a(e,"formatBar.k77"))]),t.borderMixedAny?l("p",{class:"pd-hint",text:a(e,"formatBar.k78")}):""].filter(Boolean))],b=[l("div",{class:"ft-align-panel",dataset:{test:"align-panel"}},[l("div",{class:"ft-align-row"},[["left",a(e,"formatBar.k79"),"TextAlignStart"],["center",a(e,"formatBar.k80"),"TextAlignCenter"],["right",a(e,"formatBar.k81"),"TextAlignEnd"],["justify",a(e,"formatBar.k82"),"TextAlignJustify"]].map(([m,E,y])=>l("button",{type:"button",class:`ft-cell-btn${o.textAlign===m?" on":""}`,dataset:{test:`align-${m}`,tip:E},disabled:r,onClick:()=>t.applyStyle({textAlign:m}),html:ge(y)}))),l("div",{class:"ft-align-row"},[["top",a(e,"formatBar.k83"),"ArrowUpToLine"],["middle",a(e,"formatBar.k84"),"ChevronsUpDown"],["bottom",a(e,"formatBar.k85"),"ArrowDownToLine"]].map(([m,E,y])=>l("button",{type:"button",class:`ft-cell-btn${o.verticalAlign===m?" on":""}`,dataset:{test:`valign-${m}`,tip:E},disabled:r,onClick:()=>t.applyStyle({verticalAlign:m}),html:ge(y)})))])];return l("div",{class:"format-toolbar"},[l("div",{class:"tb-ou ft-group",dataset:{unit:"painter"}},[l("button",{type:"button",class:`ft-btn${t.painterActive?" on":""}`,dataset:{test:"format-painter",tip:c},disabled:d,onClick:()=>{t.painterActive?t.cancelPainter():t.pickPainterSource(!1),e.repaint()},onDblclick:()=>{t.pickPainterSource(!0),e.repaint()},html:ge("Paintbrush")})]),l("div",{class:"tb-ou ft-group",dataset:{unit:"font"}},[l("div",{class:"ft-font"},[ko({id:"ft-font",state:e.state,fonts:e.host.fonts,value:typeof o.fontFamily=="string"?o.fontFamily:void 0,placeholder:o.fontFamily===yt?a(e,"formatBar.k86"):a(e,"formatBar.k87"),disabled:r,onChange:m=>t.applyStyle({fontFamily:m})})]),l("div",{class:"ft-size",dataset:{test:"font-size"}},[H({value:typeof o.fontSize=="number"?o.fontSize:void 0,min:5,max:72,disabled:r,placeholder:o.fontSize===yt?a(e,"formatBar.k88"):a(e,"formatBar.k89"),onCommit:m=>t.applyStyle({fontSize:m})})])]),l("div",{class:"tb-ou ft-group",dataset:{unit:"style"}},[...[["bold","Bold",a(e,"formatBar.k90"),()=>t.toggleBold()],["underline","Underline",a(e,"formatBar.k91"),()=>t.toggleUnderline()],["strike","Strikethrough",a(e,"formatBar.k92"),()=>t.toggleStrike()]].map(([m,E,y,C])=>l("button",{type:"button",class:`ft-btn${o[m]===!0?" on":""}`,dataset:{test:m,tip:u(y)},disabled:m==="bold"?r:i,onClick:C,html:ge(E)}))]),l("div",{class:"tb-ou ft-group",dataset:{unit:"color"}},[l("span",{class:`ft-color-btn${r?" dim":""}`,title:a(e,"formatBar.k93",{v0:r?a(e,"formatBar.fontDisabledHint"):""})},[Ae(typeof o.color=="string"?o.color:void 0,m=>t.applyStyle({color:m})),l("span",{class:"ft-glyph",text:"A"})]),l("span",{class:`ft-color-btn${n?" dim":""}`,title:a(e,"formatBar.k94")},[Ae(typeof o.backgroundColor=="string"?o.backgroundColor:void 0,m=>t.applyStyle({backgroundColor:m})),l("span",{class:"ft-glyph",html:ge("PaintBucket",14)})])]),l("div",{class:"tb-ou ft-group",dataset:{unit:"align"}},[fo(e,"align",{icon:dd[String(o.textAlign)]??"TextAlignStart",text:a(e,"formatBar.k95"),textClass:"ft-btn-text",tip:r?a(e,"formatBar.k96"):a(e,"formatBar.k97"),disabled:r,testId:"align-dd"},b)]),l("div",{class:"tb-ou ft-group",dataset:{unit:"border"}},[fo(e,"border",{icon:"Grid3x3",text:a(e,"formatBar.k98"),textClass:"ft-btn-text",tip:n?a(e,"formatBar.k99"):a(e,"formatBar.k100"),disabled:n,testId:"border"},f)])])}const cd="1.6.3";xo.filter(e=>e.material).map(e=>({type:e.type,label:e.label,icon:e.icon}));function Eo(e,t){return ge(e??"Shapes",t)||ge("Shapes",t)}function hd(e){const t=e.state;if(t.leftCollapsed)return l("div",{class:"left-panel collapsed"},[l("div",{class:"left-collapsed"},[Gi("ChevronsRight",a(e,"panels.k137"),()=>{t.leftCollapsed=!1,e.repaint()}),...[["elements",a(e,"panels.k138"),"Table2"],["fields",a(e,"panels.k139"),"ListTree"],["layers",a(e,"panels.k140"),"Layers"]].map(([r,i,n])=>l("button",{type:"button",class:`lc-btn${t.leftTab===r?" on":""}`,title:i,html:Eo(n,14),onClick:()=>{t.leftTab=r,t.leftCollapsed=!1,e.repaint()}}))])]);const o=(r,i,n="")=>l("div",{class:`pd-tab-pane${n?` ${n}`:""}`,role:"tabpanel",dataset:{pane:`left:${r}`},style:t.leftTab===r?"":{display:"none"}},i);return l("div",{class:"left-panel"},[l("div",{class:"left-head"},[l("span",{class:"left-title",text:a(e,"panels.k141")}),Gi("ChevronsLeft",a(e,"panels.k142"),()=>{t.leftCollapsed=!0,e.repaint()})]),l("div",{class:"pd-tabs left-tabs"},[l("div",{class:"pd-tab-bar",role:"tablist"},[...[["elements",a(e,"panels.k143")],["fields",a(e,"panels.k144")],["layers",a(e,"panels.k145")]].map(([r,i])=>l("button",{type:"button",class:`pd-tab${t.leftTab===r?" active":""}`,text:i,onClick:()=>{t.leftTab=r,e.repaint()}}))]),o("elements",gd(e),"material-grid"),o("fields",[md(e)]),o("layers",[yd(e)])])])}function Gi(e,t,o){return l("button",{type:"button",class:"collapse-btn",title:t,html:Eo(e,14),onClick:o})}const qn={text:"elementDefinitions.k553",barcode:"elementDefinitions.k554",qrcode:"elementDefinitions.k555",image:"elementDefinitions.k556",table:"elementDefinitions.k557",longText:"elementDefinitions.k558",flowList:"elementDefinitions.k559",hline:"elementDefinitions.k560",vline:"elementDefinitions.k561",rect:"elementDefinitions.k562",oval:"elementDefinitions.k563",pageNumber:"elementDefinitions.k564",barChart:"echarts.series.typeNames.bar",barHChart:"echarts.series.typeNames.barH",lineChart:"echarts.series.typeNames.line",areaChart:"echarts.series.typeNames.area",pieChart:"echarts.series.typeNames.pie",doughnutChart:"echarts.series.typeNames.doughnut",scatterChart:"echarts.series.typeNames.scatter",radarChart:"echarts.series.typeNames.radar",funnelChart:"echarts.series.typeNames.funnel",gaugeChart:"echarts.series.typeNames.gauge"},ud={barChart:"elementGroup.chart"};function fd(e,t,o,r){return l("div",{class:`material-card${h.isWideMaterialLabel(r??t)?" material-card--wide":""}`,draggable:!0,dataset:{test:`material-${e}`},onDragstart:i=>{const n=i.dataTransfer;n?.setData("elementType",e),n&&(n.effectAllowed="all")}},[l("span",{class:"material-icon","data-icon":o,html:Eo(o,14)}),l("span",{class:"material-label",text:r??t})])}function gd(e){const t=[];let o;for(const r of xn()){const i=r.group;if(i&&i!==o){const c=ud[r.type];t.push(l("div",{class:"material-group-title",text:c?a(e,c):i}))}i&&(o=i);const n=qn[r.type],s=n?a(e,n):void 0,d=s&&s!==n?s:void 0;t.push(fd(r.type,r.label,r.icon,d))}return[l("div",{class:"panel-title",text:a(e,"panels.k146")}),...t]}function md(e){const t=e.state,o=t.fieldDisplay??"both",r=h.groupFields(e.store.fields),i=(t.fieldSearch??"").trim().toLowerCase(),n=i?r.map(s=>({...s,fields:s.fields.filter(d=>`${d.fieldLabel}${d.fieldKey}`.toLowerCase().includes(i))})).filter(s=>s.fields.length):r;return l("div",{class:"field-tree-panel"},[l("div",{class:"panel-title",text:a(e,"panels.k147")}),l("input",{class:"pd-input search-input",type:"search",placeholder:a(e,"panels.k148"),"aria-label":a(e,"panels.k149"),value:t.fieldSearch??"",onInput:s=>{t.fieldSearch=s.target.value},onChange:()=>e.repaint()}),l("div",{class:"tree-container"},n.flatMap(s=>{const d=t.collapsedGroups.has(s.key)&&!i,c=s.key?l("div",{class:`field-group-header${s.isList?" is-list":""}`,onClick:()=>{d?t.collapsedGroups.delete(s.key):t.collapsedGroups.add(s.key),e.repaint()}},[l("span",{class:"expand-icon",text:d?"▶":"▼"}),l("span",{class:"node-icon",text:s.isList?"📋":"📁"}),l("span",{class:"group-label",text:s.label,"data-tip":s.label})]):"",u=d?[]:s.fields.map(f=>l("div",{class:"field-row",draggable:!0,"data-tip":a(e,"panels.k150",{v0:f.fieldLabel,v1:f.fieldKey}),style:{paddingLeft:`${s.key?22:8}px`},onDragstart:b=>{const m=b.dataTransfer;m?.setData("fieldKey",f.fieldKey),m&&(m.effectAllowed="all")},onClick:()=>{h.copyTextToClipboard(f.fieldLabel||f.fieldKey).then(b=>{b&&(t.copiedFieldKey=f.fieldKey,e.repaint(),setTimeout(()=>{t.copiedFieldKey===f.fieldKey&&(t.copiedFieldKey="",e.repaint())},1200))})}},[l("span",{class:"node-icon",text:"📄"}),l("span",{class:"node-meta"},[o!=="key"?l("span",{class:"node-label",text:f.fieldLabel||f.fieldKey}):"",o!=="label"?l("span",{class:`node-key${o==="key"?" is-primary":""}`,text:o==="key"?f.fieldKey:`(${f.fieldKey})`}):""].filter(Boolean)),t.copiedFieldKey===f.fieldKey?l("span",{class:"copy-hint",text:a(e,"panels.k151")}):""].filter(Boolean)));return[c,l("div",{},u.filter(Boolean))].filter(Boolean)})),n.length===0?l("p",{class:"pd-empty",text:a(e,"panels.k152")}):""].filter(Boolean))}function bd(e,t){if(e.options.title)return e.options.title;const o=qn[e.printElementType.type];return o?a(t,o):e.printElementType.title||e.printElementType.type}function yd(e){const t=e.store,o=[...t.elements].sort((d,c)=>(c.options.zIndex??0)-(d.options.zIndex??0)),r=t.elements.filter(d=>t.selectedIds.has(d.id)),i=r.length>=2,n=r.some(d=>!!d.options.groupId),s=d=>d.zone==="header"?a(e,"panels.k153"):d.zone==="footer"?a(e,"panels.k154"):"";return l("div",{class:"layer-panel"},[l("div",{class:"panel-title",text:a(e,"panels.k155")}),...o.map(d=>{const c=En(d.printElementType.type);return l("div",{class:`layer-item${t.selectedIds.has(d.id)?" active":""}`,onClick:u=>t.selectElement(d.id,u.ctrlKey||u.metaKey)},[l("span",{class:"layer-icon","data-icon":c??"Shapes",html:Eo(c,12)}),l("span",{class:"layer-name",text:bd(d,e)}),s(d)?l("span",{class:"layer-zone",text:s(d)}):"",l("span",{class:"layer-zindex",text:`z:${d.options.zIndex??0}`})].filter(Boolean))}),o.length?l("div",{class:"layer-actions"},[...[["top",a(e,"panels.k156"),"ArrowUpToLine"],["up",a(e,"panels.k157"),"ArrowUp"],["down",a(e,"panels.k158"),"ArrowDown"],["bottom",a(e,"panels.k159"),"ArrowDownToLine"]].map(([d,c,u])=>l("button",{type:"button",class:"pd-button small",title:c,html:ge(u,14),onClick:()=>e.fire("move-layer",d)}))]):"",i||n?l("div",{class:"layer-actions"},[i?l("button",{type:"button",class:"pd-button small",title:a(e,"panels.k160"),html:ge("Group",14),onClick:()=>e.fire("group")}):"",n?l("button",{type:"button",class:"pd-button small",title:a(e,"panels.k161"),html:ge("Ungroup",14),onClick:()=>e.fire("ungroup")}):""].filter(Boolean)):""].filter(Boolean))}function vd(e){const t=e.store,o=e.state,r=t.pages.length>1,i=t.pages[t.activePageIndex]?.name||a(e,"panels.k162",{v0:t.activePageIndex+1}),n=t.tilingEnabled;return l("div",{class:"page-tabs"},[l("div",{class:"page-tabs-list"},t.pages.map((d,c)=>o.renamingPage===c?l("input",{class:"page-tab-rename",dataset:{test:"page-rename-input"},value:o.renameText??"",onInput:u=>{o.renameText=u.target.value},onBlur:()=>s(),onKeydown:u=>{const f=u;if(f.key==="Enter"){s();return}f.key==="Escape"&&(o.renamingPage=null,e.repaint())}}):l("button",{type:"button",class:`page-tab${c===t.activePageIndex?" active":""}`,dataset:{tip:d.name?a(e,"panels.k163",{v0:d.name}):a(e,"panels.k164")},text:d.name||a(e,"panels.k165",{v0:c+1}),onClick:()=>t.switchPage(c),onDblclick:()=>{o.renamingPage=c,o.renameText=d.name??"",e.repaint()}}))),l("div",{class:"page-tabs-actions"},[l("button",{type:"button",dataset:{test:"add-page",tip:n?a(e,"panels.k166"):a(e,"panels.k167")},disabled:n,text:"+",onClick:()=>e.fire("add-page")}),l("button",{type:"button",dataset:{test:"duplicate-page",tip:n?a(e,"panels.k168"):a(e,"panels.k169",{v0:i})},disabled:n,text:"⧉",onClick:()=>e.fire("duplicate-page")}),l("button",{type:"button",dataset:{test:"delete-page",tip:r?a(e,"panels.k170",{v0:i}):a(e,"panels.k171")},disabled:!r,text:"✕",onClick:()=>e.fire("delete-page")}),l("button",{type:"button",dataset:{test:"move-left",tip:a(e,"panels.k172",{v0:i})},disabled:t.activePageIndex<=0,text:"←",onClick:()=>e.fire("move-page",-1)}),l("button",{type:"button",dataset:{test:"move-right",tip:a(e,"panels.k173",{v0:i})},disabled:t.activePageIndex>=t.pages.length-1,text:"→",onClick:()=>e.fire("move-page",1)})])]);function s(){const d=(o.renameText??"").trim();o.renamingPage!==null&&d&&t.renamePage(o.renamingPage,d),o.renamingPage=null,e.repaint()}}function xd(e){const t=e.store,o=t.templateData,r=h.getPaperDimensions(o),i=o.orientation==="landscape"?a(e,"panels.k174"):a(e,"panels.k175"),n=h.PAPER_PRESETS[o.paperSize],s=n?a(e,n.labelKey):o.paperSize,d=o.outputRotation,c=`${s} ${i} ${Math.round(r.width)}×${Math.round(r.height)}mm${d?a(e,"panels.paperRotated",{rot:d}):""}`;return l("div",{class:"status-bar"},[l("span",{class:"status-item coord",dataset:{coord:""},style:{display:"none"}}),l("span",{class:"status-item",text:a(e,"panels.k176",{v0:t.scale})}),l("span",{class:"status-item",text:a(e,"panels.statusElements",{count:t.elements.length,selected:t.selectedIds.size?a(e,"panels.statusSelected",{n:t.selectedIds.size}):""})}),l("span",{class:"status-item status-version",text:`v${cd}`}),l("span",{class:"status-item status-paper",text:c})])}const wd=Object.keys(h.PAPER_PRESETS).filter(e=>e!=="CUSTOM"&&!h.PAPER_PRESETS[e]?.continuous);function kd(e){const t=document.createElement("label");t.className="pd-button small upload-label";const o=document.createTextNode(a(e,"pageExtras.k103")),r=document.createElement("input");r.className="visually-hidden",r.type="file",r.accept="image/*",t.append(o,r);const i=n=>{t.className=`pd-button small upload-label${n?" disabled":""}`,r.disabled=n};return r.addEventListener("change",async()=>{const n=r.files?.[0];if(!n)return;if(!n.type.startsWith("image/")){alert(a(e,"pageExtras.k104")),r.value="";return}const s=e.host.uploadDesignBackground;if(!s){alert(a(e,"pageExtras.k105")),r.value="";return}i(!0),o.textContent=a(e,"pageExtras.k106");try{const d=await s(n);d?e.store.updateTemplateData({designBackground:{src:d,rotation:0}}):alert(a(e,"pageExtras.k107"))}catch(d){alert(d instanceof Error?d.message:a(e,"pageExtras.k108"))}finally{o.textContent=a(e,"pageExtras.k109"),i(!e.host.uploadDesignBackground),r.value=""}}),e.host.uploadDesignBackground||i(!0),t}function Ed(e){const o=e.store.templateData.designBackground,r=o?.rotation??0;return l("div",{class:"design-background-config"},[Ge(a(e,"pageExtras.k110")),l("p",{class:"design-background-tip",text:a(e,"pageExtras.k111")}),o?.src?[l("div",{class:"design-background-path",title:o.src,text:o.src}),l("div",{class:"design-background-actions"},[l("button",{type:"button",class:"pd-button small rotate-btn",text:a(e,"pageExtras.k112",{v0:(r+90)%360}),onClick:()=>e.store.updateTemplateData({designBackground:{...o,rotation:(r+90)%360}})}),l("button",{type:"button",class:"pd-button small remove-btn",text:a(e,"pageExtras.k113"),onClick:()=>e.store.updateTemplateData({designBackground:void 0})})])]:kd(e)].flat())}function Sd(e){const t=e.store,o=t.templateData,r=o.tiling,i={...R.TILE_DEFAULTS,...r??{},enabled:r?.enabled??!1,sheetMargin:{...R.TILE_DEFAULTS.sheetMargin,...r?.sheetMargin??{}}},n=h.isContinuousPaperSize(o.paperSize),s=y=>t.updateTemplateData({tiling:{...i,...y}}),d=y=>kt({target:i,base:R.TILE_DEFAULTS,propKey:y,write:()=>s({[y]:R.TILE_DEFAULTS[y]})}),c=y=>kt({target:i.sheetMargin,base:R.TILE_DEFAULTS.sheetMargin,propKey:y,write:()=>u(y,R.TILE_DEFAULTS.sheetMargin[y])}),u=(y,C)=>s({sheetMargin:{...i.sheetMargin,[y]:C??0}}),f={...o,tiling:i},b=R.validateTiling(f),m=Math.max(R.computeMaxColumns(f),1);let E="";if(!b.length)try{const y=R.computeTileLayout(f),C=R.resolveSheetMm(f),D=i.sheetPaperSize==="CUSTOM"?a(e,"pageExtras.k114"):i.sheetPaperSize??"A4",S=i.sheetPaperSize==="CUSTOM"?"":i.sheetOrientation==="landscape"?a(e,"pageExtras.k115"):a(e,"pageExtras.k116");E=a(e,"pageExtras.k117",{v0:D,v1:S,v2:C.width,v3:C.height,v4:y.columns,v5:y.rows,v6:y.perSheet,v7:y.tile.width,v8:y.tile.height})}catch{E=""}return l("div",{class:"tiling-config",dataset:{test:"tiling-config"}},[Ge(a(e,"pageExtras.k118")),l("p",{class:"pd-hint",text:a(e,"pageExtras.k119")}),l("div",{class:"pd-field"},[l("label",{class:"tiling-switch"},[l("input",{type:"checkbox",checked:i.enabled===!0,disabled:n,onChange:y=>{if(!y.target.checked){s({enabled:!1});return}s({...R.TILE_DEFAULTS,columns:Math.min(R.TILE_DEFAULTS.columns,Math.max(m,1))})}}),l("span",{text:a(e,"pageExtras.k120")})]),n?l("p",{class:"pd-hint tiling-error",text:a(e,"pageExtras.k121")}):""].filter(Boolean)),i.enabled&&!n?[q(a(e,"pageExtras.k122"),l("select",{class:"pd-select",style:{width:"100%"},onChange:y=>{const C=y.target.value;if(C!=="CUSTOM"){s({sheetPaperSize:C});return}const D=R.resolveSheetMm(f);s({sheetPaperSize:"CUSTOM",sheetCustomWidth:i.sheetCustomWidth??D.width,sheetCustomHeight:i.sheetCustomHeight??D.height})}},[...wd.map(y=>l("option",{value:y,text:a(e,h.PAPER_PRESETS[y]?.labelKey??y),selected:(i.sheetPaperSize??"A4")===y})),l("option",{value:"CUSTOM",text:a(e,"pageExtras.k123"),selected:i.sheetPaperSize==="CUSTOM"})]),void 0,d("sheetPaperSize")),i.sheetPaperSize==="CUSTOM"?q(a(e,"pageExtras.k124"),l("div",{class:"custom-size-grid"},[H({value:Number(i.sheetCustomWidth??0),min:25,max:2e3,onCommit:y=>s({sheetCustomWidth:y})}),l("span",{class:"custom-size-x",text:"×"}),H({value:Number(i.sheetCustomHeight??0),min:25,max:2e3,onCommit:y=>s({sheetCustomHeight:y})})])):q(a(e,"pageExtras.k125"),dt("tiling-ori",[{value:"portrait",label:a(e,"pageExtras.k126")},{value:"landscape",label:a(e,"pageExtras.k127")}],i.sheetOrientation==="landscape"?"landscape":"portrait",y=>s({sheetOrientation:y})),void 0,d("sheetOrientation")),Ge(a(e,"pageExtras.k128")),l("div",{class:"margin-grid"},[q(a(e,"pageExtras.k129"),H({value:i.sheetMargin.top??0,min:0,max:100,onCommit:y=>u("top",y)}),void 0,c("top")),q(a(e,"pageExtras.k130"),H({value:i.sheetMargin.bottom??0,min:0,max:100,onCommit:y=>u("bottom",y)}),void 0,c("bottom")),q(a(e,"pageExtras.k131"),H({value:i.sheetMargin.left??0,min:0,max:100,onCommit:y=>u("left",y)}),void 0,c("left")),q(a(e,"pageExtras.k132"),H({value:i.sheetMargin.right??0,min:0,max:100,onCommit:y=>u("right",y)}),void 0,c("right"))]),Ge(a(e,"pageExtras.k133")),q(a(e,"pageExtras.k134"),H({value:i.gapX??0,min:0,max:50,onCommit:y=>s({gapX:y??0})}),void 0,d("gapX")),q(a(e,"pageExtras.k135"),H({value:i.gapY??0,min:0,max:50,onCommit:y=>s({gapY:y??0})}),void 0,d("gapY")),q(a(e,"pageExtras.k136"),H({value:i.columns??1,min:1,max:m,onCommit:y=>s({columns:y||1})})),...b.map(y=>l("p",{class:"pd-hint tiling-error",text:y.message})),!b.length&&E?l("p",{class:"pd-hint tiling-summary",text:E}):""]:""].flat().filter(Boolean))}const Td=new Set(h.PROPERTY_REGISTRY.map(e=>e.group)),Cd={"table-settings":"content"},qi=new Map;function Wr(e){const t=e??"";let o=qi.get(t);if(!o){const{groups:r,itemKeys:i}=h.searchProperties(t);o={groups:r,keys:i,searching:!!t.trim()},qi.set(t,o)}return o}function Kr(e){const t=Cd[e]??e;return Td.has(t)?t:""}function Dd(e,t){const o=Wr(e.state.propSearch);if(!o.searching)return!0;const r=Kr(t);return!r||o.groups.includes(r)}function Pd(e,t){const o=Wr(e.state.propSearch);return!o.searching||o.keys.has(t)}function Yn(e,t){const o=e.props.style??{};return e.props.style={...o,display:t?"":"none"},e}function M(e,t,o){const r=o.props.dataset??{};return o.props.dataset={...r,propKey:t},Yn(o,Pd(e,t))}function Ad(e,t,o){const r=Kr(t);if(!r)return o;const i=o.props.dataset??{};return o.props.dataset={...i,propGroup:r},Yn(o,Dd(e,t))}function jn(e,t){const o=Wr(t);for(const r of Array.from(e.querySelectorAll("[data-prop-group]"))){const i=Kr(r.dataset.propGroup??"");r.style.display=!o.searching||!i||o.groups.includes(i)?"":"none"}for(const r of Array.from(e.querySelectorAll("[data-prop-key]")))r.style.display=!o.searching||o.keys.has(r.dataset.propKey??"")?"":"none"}function Md(e){return l("div",{class:"property-search"},[l("input",{class:"pd-input",type:"search",placeholder:a(e,"propertySearch.k328"),"aria-label":a(e,"propertySearch.k329"),value:e.state.propSearch??"",onInput:t=>{const o=t.target,r=o.value;e.state.propSearch=r,jn(o.getRootNode(),r)}})])}const _d={Document:"≡",Brush:"◧",Setting:"⚙"};function Rd(e,t){try{const o=window.localStorage.getItem(`property-group-${e}`);return o===null?t:o==="true"}catch{return t}}function Fd(e,t){try{window.localStorage.setItem(`property-group-${e}`,String(t))}catch{}}function Te(e,t,o,r,i,n=!0,s=[]){const d=Rd(t,n);return Ad(e,t,l("div",{class:`property-group${d?" is-expanded":""}`},[l("div",{class:"group-header",onClick:()=>{Fd(t,!d),e.repaint()}},[l("span",{class:"group-icon",text:_d[r]||"•"}),l("span",{class:"group-title",text:o}),...s,l("span",{class:"expand-icon",text:d?"▾":"▸"})]),l("div",{class:"group-content",style:d?"":{display:"none"}},i.filter(Boolean))]))}function So(e){return l("form",{class:"pd-form",onSubmit:t=>t.preventDefault()},e.filter(Boolean))}function Xn(e){return e.split(".").flatMap(t=>{const o=t.match(/^([^\[]+)((?:\[\d+\])*)$/);if(!o)return[t];const r=o[1],i=[...o[2].matchAll(/\[(\d+)\]/g)].map(n=>Number(n[1]));return[r,...i]})}function Yi(e,t){return Xn(t).reduce((i,n)=>i==null?"":i[n],e)??""}function Vr(e,t,o,r){const i=Xn(o),n=i.pop(),s=i.reduce((d,c)=>((d[c]===void 0||d[c]===null)&&(d[c]={}),d[c]),t);s[n]=r||void 0,e.recordHistory(),e.emit()}function Id(e,t){const o=e.store;if(t.printElementType.type==="table"&&o.tableSelection?.elementId===t.id){const{r1:r,c1:i}=o.tableSelection,n=(t.options.tableRows??[])[r];if(n)return h.getTableCellBindings(n.type,r,i,t.options.fields?.[0]?.dataSource)}return h.getElementBindings(t)}function Ld(e,t){const o=document.createElement("label");o.className="pd-button small upload-label",Se(l("svg",{class:"pd-icon",viewBox:"0 0 24 24","aria-hidden":"true"},[l("path",{fill:"currentColor",d:"M12 3l4 4h-3v7h-2V7H8zm-7 12h14v5H5Z"})]),o);const r=document.createTextNode(a(e,"binding.k1")),i=document.createElement("input");i.className="visually-hidden",i.type="file",i.accept="image/*",o.append(r,i);const n=c=>{o.className=`pd-button small upload-label${c?" disabled":""}`,i.disabled=c};i.addEventListener("change",async()=>{const c=i.files?.[0];if(!c)return;if(!c.type.startsWith("image/")){alert(a(e,"binding.k2")),i.value="";return}const u=e.host.uploadImage;if(!u){alert(a(e,"binding.k3")),i.value="";return}n(!0),r.textContent=a(e,"binding.k4");try{const f=await u(c);f?Vr(e.store,t,"options.src",f):alert(a(e,"binding.k5"))}catch(f){alert(f instanceof Error?f.message:a(e,"binding.k6"))}finally{r.textContent=a(e,"binding.k7"),n(!e.host.uploadImage),i.value=""}}),e.host.uploadImage||n(!0);const s=document.createElement("div");s.className="image-content-upload";const d=document.createElement("p");return d.className="upload-tip",d.textContent=a(e,"binding.k8"),s.append(o,d),s}function zd(e,t){const o=r=>e.fire("open-expression",{elementId:t.id,targetPath:r.targetPath,value:Yi(t,r.targetPath)});return Te(e,"binding",a(e,"binding.k9"),"Document",[...Id(e,t).map(r=>q(r.labelKey?a(e,r.labelKey):r.label,l("input",{class:"pd-input",type:"text",value:Yi(t,r.targetPath),placeholder:r.placeholder||a(e,"binding.k10"),onChange:i=>Vr(e.store,t,r.targetPath,i.target.value),onDblclick:()=>o(r)}))),t.printElementType.type==="image"?Ld(e,t):""].filter(Boolean))}const Ht=new Map;function lo(e){return`${Math.round(e*1e4)/1e4}%`}function Zn(e,t){const o=h.parseCropAnchor(t.value),r=o.kind==="custom",i=o.kind==="axes"?o.x:50,n=o.kind==="axes"?o.y:50,s=h.resolveCropPreview(t.src),d=Ht.get(s.src),c={widthMm:t.widthMm,heightMm:t.heightMm,naturalWidth:d?.width,naturalHeight:d?.height,fit:t.fit,scalePct:t.scale},u=h.resolveCropTravel(c),f=h.cropWindow(c,i,n),b=document.createElement("select");b.className="pd-select",b.style.width="100%";for(const C of h.cropPresetOptions(u,i,n)){const D=document.createElement("option");D.value=C.value,D.textContent=C.label,b.appendChild(D)}if(r){const C=document.createElement("option");C.value="custom",C.textContent=a(e,"cropAnchor.k37"),b.appendChild(C)}b.value=r?"custom":`${i},${n}`,b.selectedIndex<0&&(b.selectedIndex=r?b.options.length-1:0),b.addEventListener("change",()=>{if(b.value==="custom")return;const[C,D]=b.value.split(",").map(Number);t.onCommit(h.buildCropAnchor(C,D))});const m=a(e,`propertyTips.${t.fieldKey}`),E=[l("div",{class:"pd-field",dataset:{field:t.fieldKey}},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t"},[t.label,mr(m)]),t.resetAnchor??""].filter(Boolean)),b])];E.push(l("div",{class:"pd-field",dataset:{field:"ap-img-fit-scale"}},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t"},[h.cropScaleLabel(),mr(a(e,"propertyTips.ap-img-fit-scale"))]),t.resetScale??""].filter(Boolean)),H({value:t.scale,min:h.CROP_SCALE_MIN,max:h.CROP_SCALE_MAX,step:5,placeholder:a(e,"cropAnchor.k38"),onCommit:C=>t.onScaleCommit(C>h.CROP_SCALE_MIN?C:void 0)})]));for(const C of h.cropAxisFields(u,i,n))E.push(l("div",{class:"pd-field",dataset:{field:t.fieldKey}},[l("span",{class:"pd-label",text:C.label}),H({value:C.value,min:0,max:100,step:1,onCommit:D=>t.onCommit(h.buildCropAnchor(C.name==="horizontal"?D:i,C.name==="vertical"?D:n))})]));const y=h.cropAxisNote(u,r);return y&&E.push(l("p",{class:"pd-crop-note",text:y})),s.isSample&&E.push(l("p",{class:"pd-crop-note",text:h.cropSampleNote()})),E.push(l("div",{class:"pd-crop-preview"},[l("img",{class:"pd-crop-thumb",src:s.src,alt:s.isSample?a(e,"cropAnchor.k39"):a(e,"cropAnchor.k40"),onLoad:C=>{const D=C.target;if(!(D.naturalWidth>0&&D.naturalHeight>0))return;const S=Ht.get(s.src);S&&S.width===D.naturalWidth&&S.height===D.naturalHeight||(Ht.set(s.src,{width:D.naturalWidth,height:D.naturalHeight}),e.repaint())},onError:()=>{Ht.has(s.src)&&(Ht.delete(s.src),e.repaint())}}),f?l("div",{class:"pd-crop-win",style:{left:lo(f.leftPct),top:lo(f.topPct),width:lo(f.widthPct),height:lo(f.heightPct)}}):""])),l("div",{class:t.containerClass??"pd-crop-anchor"},E)}const bt=e=>Number(e??0),Er=e=>e||void 0;function wt(e,t,o,r,i,n){return l("div",{class:"pd-field"},[l("span",{class:"pd-label",...r?{title:r}:{}},[l("span",{class:"pd-label-t",text:e}),i??""].filter(Boolean)),l("input",{class:"pd-switch",type:"checkbox",checked:t,...n?{disabled:!0}:{},onChange:s=>o(s.target.checked)})])}function Qn(e,t,o,r,i=!1,n){return l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:e}),""].filter(Boolean)),l("select",{class:"pd-select",...i?{style:{width:"100%"}}:{},onChange:s=>r(s.target.value)},o.map(s=>l("option",{value:s.value,text:s.label,selected:s.value===t})))])}function $t(e,t,o,r,i={}){return l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:e}),i.reset??""].filter(Boolean)),gn(t,o,r,{className:"pd-select",...i.full?{width:"100%"}:{}})])}const _t=e=>l("p",{class:"pd-hint",text:e});function Jn(e,t){return e.map(o=>({value:o.value,label:o.labelKey?a(t,o.labelKey):o.label??o.value,...o.disabled?{disabled:!0}:{}}))}const Od="tableProps.k330",Nd=[{value:"header",labelKey:"tableProps.k331"},{value:"data",labelKey:"tableProps.k332"},{value:"subtotal",labelKey:"tableProps.k333"},{value:"summary",labelKey:"tableProps.k334"}],Bd=[{value:"CODE128",labelKey:"tableProps.k335"},{value:"EAN13",labelKey:"tableProps.k336"},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],Ud=[{value:"L",labelKey:"tableProps.k337"},{value:"M",labelKey:"tableProps.k338"},{value:"Q",label:"Q"},{value:"H",labelKey:"tableProps.k339"}],Hd=[{value:"clip",labelKey:"tableProps.k340"},{value:"shrink",labelKey:"tableProps.k341"},{value:"autoHeight",labelKey:"tableProps.k342"}],$d={value:"__multi__",labelKey:"tableProps.k343",disabled:!0};function Wd(e,t){const o=e.store,r=o.tableSelection,i=t.options.tableRows??[],n=r?i[r.r1]:void 0;if(!r||!n)return Te(e,"table-row",a(e,"tableProps.k344"),"Grid",[]);const s=d=>o.updateElement(t.id,d);return Te(e,"table-row",a(e,"tableProps.k345"),"Grid",[So([Qn(a(e,"tableProps.k346"),n.type,Jn(Nd,e),d=>{const c=h.setRowType(i,r.r1,d);if(c){window.alert(c);return}s({tableRows:i})},!0),l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"tableProps.k347")}),H({value:n.height,min:3,max:100,step:.5,onCommit:d=>{n.height=d,s({tableRows:i})}})]),n.type==="header"?wt(a(e,"tableProps.k348"),n.repeatOnPage??!1,d=>{h.setHeaderRepeat(i,d),s({tableRows:i})},a(e,Od)):""])])}function Kd(e,t){const o=e.store,r=t.options,i=f=>o.updateElement(t.id,f),n=r.tableColWidths??[],s=o.paperSize.width-o.templateData.margins.left-o.templateData.margins.right,d=o.fields.filter(f=>f.fieldType==="list").map(f=>({value:f.fieldKey,label:f.fieldLabel})),c=h.createDefaultOptions("table"),u=f=>kt({target:r,base:c,propKey:f,write:()=>i({[f]:c[f]})});return Te(e,"table-settings",a(e,"tableProps.k349"),"Grid",[So([Qn(a(e,"tableProps.k350"),r.dataSource??"",d,f=>i({dataSource:f||void 0}),!0),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k351")}),u("tableDefaultFontFamily")]),ko({id:"table-default-font",state:e.state,fonts:e.host.fonts,value:r.tableDefaultFontFamily,placeholder:a(e,"tableProps.k352"),onChange:f=>i({tableDefaultFontFamily:f||void 0})})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k353")}),u("tableDefaultFontSize")]),H({value:bt(r.tableDefaultFontSize),min:0,max:72,placeholder:a(e,"tableProps.k354"),onCommit:f=>i({tableDefaultFontSize:Er(f)})})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k355")}),u("tableDefaultColor")]),Ae(r.tableDefaultColor,f=>i({tableDefaultColor:f}),a(e,"tableProps.k356"))]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k357")}),u("tableDefaultPadding")]),H({value:bt(r.tableDefaultPadding),min:0,max:10,step:.5,placeholder:a(e,"tableProps.k358"),onCommit:f=>i({tableDefaultPadding:Er(f)})})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"tableProps.k359")}),...n.map((f,b)=>l("div",{class:"col-width-row"},[l("span",{style:{width:"60px"},text:a(e,"tableProps.k360",{v0:b+1})}),H({value:f,min:5,max:200,onCommit:m=>{const E=n.reduce((y,C,D)=>D===b?y:y+C,0);if(E+m>s){const y=Math.max(5,Math.round((s-E)*10)/10);window.alert(a(e,"tableProps.k361",{v0:s,v1:b+1,v2:y})),n[b]=y}else n[b]=m;i({tableColWidths:n})}})]))])])])}function Vd(e,t){const o=e.store,r=t.options,i=t.printElementType.type==="table",n=d=>o.updateElement(t.id,d),s=[];if(i)s.push(M(e,"pg-enabled",wt(a(e,"tableProps.k362"),r.tablePagination?.enabled??!0,d=>n({tablePagination:{enabled:d}}))));else{const d=r.pagination?.pageable??!0,c=r.pagination?.keepWithNext??!1;s.push(M(e,"pg-pageable",wt(a(e,"tableProps.k363"),d,u=>n({pagination:{pageable:u,keepWithNext:c}})))),s.push(M(e,"pg-keep-with-next",wt(a(e,"tableProps.k364"),c,u=>n({pagination:{pageable:d,keepWithNext:u}}))))}return Te(e,"pagination",a(e,"tableProps.k365"),"Document",[So(s)],!1)}const dr=new WeakMap,ji=[{value:"top",labelKey:"tableProps.k366"},{value:"right",labelKey:"tableProps.k367"},{value:"bottom",labelKey:"tableProps.k368"},{value:"left",labelKey:"tableProps.k369"}];function Gd(e,t){const o=e.store,r=o.tableSelection,i=t.options.tableRows??[];if(!r)return Te(e,"table-cell",a(e,"tableProps.k370"),"Menu",[]);const n=h.findMainCell(i,r.r1,r.c1),s=i[n.r]?.cells[n.c];if(!s)return Te(e,"table-cell",a(e,"tableProps.k371"),"Menu",[]);const d=()=>h.collectWritableCells(i,r),c=h.resolveCellGroupMode(i,r),u=c.count,f=c.mode==="multi",b=`${t.id}:${r.r1}:${r.c1}:${r.r2}:${r.c2}`,m=dr.get(o),E=m?.key===b?m:{key:b,border:{},values:{},edges:{}};m?.key!==b&&dr.set(o,E);const y=x=>{dr.set(o,{key:b,border:x.border??E.border,values:x.values??E.values,edges:x.edges??E.edges})},C=(x,G)=>{y({border:{...E.border,[x]:G}}),e.repaint()},D=(x,G)=>{d().forEach(x),f&&G&&y({values:{...E.values,...G}}),o.updateElement(t.id,{tableRows:i})},S=(x,G)=>{D(ye=>{ye[x]=G},{[x]:G})},_=x=>f?E.values[x]:s[x],z=x=>f&&x in E.values,A=f?{width:void 0,style:void 0,color:void 0}:h.resolveCellBorderDisplay(i,r),I=!f&&d().some(x=>!!x.borders&&!!(x.borders.top||x.borders.right||x.borders.bottom||x.borders.left)),K=!f&&!I,B={width:K?0:typeof A.width=="number"?A.width:h.DEFAULT_BORDER.width,style:K?"none":typeof A.style=="string"&&A.style!=="mixed"?A.style:h.DEFAULT_BORDER.style,color:typeof A.color=="string"&&A.color!=="mixed"?A.color:h.DEFAULT_BORDER.color,...E.border},L="__mixed__",U={style:!f&&A.style==="mixed",width:!f&&A.width==="mixed",color:!f&&A.color==="mixed"},re=U.style&&!("style"in E.border),V=U.width&&!("width"in E.border),he=U.color&&!("color"in E.border),ie=re||V||he,Ce=re?L:B.style,ke=V?void 0:B.width,v=he?void 0:B.color,ee=x=>{const G={style:x};x!=="none"&&ke===0?G.width=h.DEFAULT_BORDER.width:x==="none"&&!I&&(G.width=0),y({border:{...E.border,...G}}),e.repaint()},be=()=>({...B}),He=f?ji.reduce((x,G)=>(x[G.value]=E.edges[G.value]?"on":"off",x),{}):h.resolveBorderEdgeStates(d().map(x=>x.borders)),W=f?"cellType"in E.values?E.values.cellType??"text":h.resolveSharedCellType(i,r):s.cellType??"text",ae=W==="barcode",Re=W==="qrcode",Fe=W==="image",qe=W==="text",Y=ae&&!!_("printerDpi"),Ye=h.barcodeBarWidthRecommendText(_("printerDpi"),_("barWidth"),e.t??N),Z=f?E.values.textFit:h.resolveCellTextFit(s),To=f?"cellType"in E.values?E.values.cellType??"text":"":s.cellType||"text",ct=x=>Jn(f?[$d,...x]:x,e),De=x=>f?a(e,"tableProps.k372"):x,Me=(x,G)=>f?E.values[x]:G,Co=f?_("barcodeType")??"__multi__":s.barcodeType||"CODE128",Do=f?z("printerDpi")?_("printerDpi")?String(_("printerDpi")):"":"__multi__":s.printerDpi?String(s.printerDpi):"",Po=f?_("qrCodeLevel")??"__multi__":s.qrCodeLevel||"M",Ao=f?_("fit")??"__multi__":s.fit||"contain",jt=Z??"__multi__",Q=h.canMergeReason(i,r);let rt=!0;for(let x=r.r1;x<=r.r2;x++)if(i[x]?.type!=="data"){rt=!1;break}const J=rt?"":a(e,"tableProps.k373");let it=!1;for(let x=r.r1;x<=r.r2&&!it;x++)for(let G=r.c1;G<=r.c2&&!it;G++){const ye=i[x]?.cells[G];ye&&!ye.merged&&((ye.rowspan??1)>1||(ye.colspan??1)>1)&&(it=!0)}const ue=(x,G,ye,te={},Le)=>l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:x}),Le??""].filter(Boolean)),H({value:G,...te,onCommit:je=>S(ye,Er(je))})]),ht=a(e,"tableProps.k374"),X=x=>kt({target:s,base:{},propKey:x,tipOverride:ht,force:f,write:()=>S(x,void 0)}),Ie=t.options.tableDefaultPadding??1,Lt={width:h.cellFitWidthMm(t.options.tableColWidths??[],n.c,s,Ie),height:h.cellFitCapMm(i,n.r,s,Ie)};return Te(e,"table-cell",a(e,"tableProps.k375"),"Menu",[So([f?_t(a(e,"tableProps.k376",{v0:u})):"",l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"tableProps.k377")}),dt("cell-type",[{value:"text",label:a(e,"tableProps.k378")},{value:"barcode",label:a(e,"tableProps.k379")},{value:"qrcode",label:a(e,"tableProps.k380")},{value:"image",label:a(e,"tableProps.k381")}],To,x=>{const G=x==="text"?void 0:x,ye={cellType:x};x!=="barcode"&&Object.assign(ye,{barcodeType:void 0,showBarcodeText:void 0,printerDpi:void 0,barQuietZone:void 0,barHeight:void 0}),x!=="qrcode"&&Object.assign(ye,{qrCodeLevel:void 0,qrQuietZone:void 0}),D(te=>{te.cellType=G,x!=="barcode"&&(te.barcodeType=void 0,te.showBarcodeText=void 0,te.printerDpi=void 0,te.barQuietZone=void 0,te.barHeight=void 0),x!=="qrcode"&&(te.qrCodeLevel=void 0,te.qrQuietZone=void 0)},ye)})]),ae?$t(a(e,"tableProps.k382"),Co,ct(Bd),x=>{x!=="__multi__"&&S("barcodeType",x||void 0)}):"",ae?wt(a(e,"tableProps.k383"),f?E.values.showBarcodeText===!0:s.showBarcodeText!==!1,x=>S("showBarcodeText",x),void 0,X("showBarcodeText")):"",ae?ue(a(e,"tableProps.k384"),Me("barWidth",s.barWidth??2),"barWidth",{min:2,max:8,step:.5,placeholder:De("")},X("barWidth")):"",ae?_t((Y?a(e,"tableProps.k385"):a(e,"tableProps.k386"))+(Ye?`。${Ye}`:"")):"",ae?xe(a(e,"tableProps.k387"),H({value:Me("barQuietZone",s.barQuietZone),min:0,max:20,placeholder:De(a(e,"tableProps.k388")),onCommit:x=>S("barQuietZone",x)}),a(e,"propertyTips.cd-bar-quiet-zone"),X("barQuietZone")):"",ae?xe(a(e,"tableProps.k389"),H({value:Me("barHeight",s.barHeight),min:1,max:100,placeholder:De(a(e,"tableProps.k390")),onCommit:x=>S("barHeight",x??void 0)}),a(e,"propertyTips.cd-bar-height"),X("barHeight")):"",ae?ue(a(e,"tableProps.k391"),Me("barFontSize",s.barFontSize??10),"barFontSize",{min:5,max:24,placeholder:De(a(e,"tableProps.k392"))},X("barFontSize")):"",ae?$t(a(e,"tableProps.k393"),Do,ct([{value:"",label:a(e,"tableProps.k394")},{value:"203",label:a(e,"tableProps.k395")},{value:"300",label:a(e,"tableProps.k396")},{value:"600",label:a(e,"tableProps.k397")}]),x=>{if(x==="__multi__")return;const G=Number(x);S("printerDpi",G>0?G:void 0)},{reset:X("printerDpi")}):"",ae?_t(a(e,"tableProps.k398")):"",Re?$t(a(e,"tableProps.k399"),Po,ct(Ud),x=>{x!=="__multi__"&&S("qrCodeLevel",x||void 0)},{reset:X("qrCodeLevel")}):"",Re?xe(a(e,"tableProps.k400"),H({value:Me("qrQuietZone",s.qrQuietZone),min:0,max:8,placeholder:De(a(e,"tableProps.k401")),onCommit:x=>S("qrQuietZone",x)}),a(e,"propertyTips.cd-quiet-zone"),X("qrQuietZone")):"",ae?_t(a(e,"tableProps.k402")):"",Re||Fe?$t(a(e,"tableProps.k403"),Ao,ct(h.imageFitOptions(e.t??N)),x=>{x!=="__multi__"&&S("fit",x)},{reset:X("fit")}):"",Fe&&!f&&s.fit==="cover"?Zn(e,{fieldKey:"ap-img-object-position",label:a(e,"tableProps.k404"),src:h.resolveDesignImageSrc(s.formatter),fit:s.fit,containerClass:"pd-cell-anchor",widthMm:Lt.width,heightMm:Lt.height,scale:s.fitScale,value:s.objectPosition,onCommit:x=>S("objectPosition",x),onScaleCommit:x=>S("fitScale",x),resetAnchor:X("objectPosition"),resetScale:X("fitScale")}):"",ae||Re||Fe?ue(a(e,"tableProps.k405"),Me("maxWidth",bt(s.maxWidth)),"maxWidth",{min:0,max:200,placeholder:De(a(e,"tableProps.k406"))},X("maxWidth")):"",ae||Re||Fe?ue(a(e,"tableProps.k407"),Me("maxHeight",bt(s.maxHeight)),"maxHeight",{min:0,max:200,placeholder:De(a(e,"tableProps.k408"))},X("maxHeight")):"",l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"tableProps.k409")}),l("input",{class:"pd-input",type:"text",value:f?_("formatter")??"":s.formatter||"",placeholder:f?a(e,"tableProps.k410"):a(e,"tableProps.k411"),onChange:x=>S("formatter",x.target.value||void 0),onDblclick:()=>e.fire("table-cell-dblclick",{elementId:t.id,r:n.r,c:n.c,cellId:s.id})})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k412")}),X("align")]),dt("cell-align",[{value:"left",label:a(e,"tableProps.k413")},{value:"center",label:a(e,"tableProps.k414")},{value:"right",label:a(e,"tableProps.k415")},{value:"justify",label:a(e,"tableProps.k416")}],f?E.values.align??"":s.align||"left",x=>S("align",x))]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k417")}),X("valign")]),dt("cell-valign",[{value:"top",label:a(e,"tableProps.k418")},{value:"middle",label:a(e,"tableProps.k419")},{value:"bottom",label:a(e,"tableProps.k420")}],f?E.values.valign??"":s.valign||"top",x=>S("valign",x))]),l("div",{class:"cell-style-grid"},[l("div",{class:"pd-field cell-font-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k421")}),X("fontFamily")]),ko({id:"cell-font",state:e.state,fonts:e.host.fonts,value:f?_("fontFamily"):s.fontFamily,placeholder:De(a(e,"tableProps.k422")),onChange:x=>S("fontFamily",x)})]),ue(a(e,"tableProps.k423"),Me("fontSize",bt(s.fontSize)),"fontSize",{min:0,max:72,placeholder:De(a(e,"tableProps.k424"))},X("fontSize")),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k425")}),X("fontWeight")]),l("input",{class:"pd-switch",type:"checkbox",checked:f?E.values.fontWeight==="bold":s.fontWeight==="bold",onChange:x=>S("fontWeight",x.target.checked?"bold":void 0)})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k426")}),X("color")]),Ae(f?_("color"):s.color,x=>S("color",x),a(e,"tableProps.k427"))]),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"tableProps.k428")}),X("backgroundColor")]),Ae(f?_("backgroundColor"):s.backgroundColor,x=>S("backgroundColor",x),a(e,"tableProps.k429"))])]),Ge(a(e,"tableProps.k430")),l("div",{class:"border-style-row"},[gn(Ce,[...re?[{value:L,label:a(e,"tableProps.k431"),disabled:!0}]:[],...h.BORDER_LINE_STYLES.map(x=>({...x,label:a(e,x.labelKey)}))],x=>{x!==L&&ee(x)},{width:"90px"}),l("div",{style:{width:"112px",flexShrink:"0"}},[H({value:ke,min:.25,max:5,step:.25,placeholder:f?a(e,"tableProps.k432"):V?a(e,"tableProps.k433"):void 0,onCommit:x=>C("width",x)})]),Ae(v,x=>C("color",x),a(e,"tableProps.k434"))]),l("div",{class:"pd-button-group border-presets"},[["all",a(e,"tableProps.k435")],["outer",a(e,"tableProps.k436")],["inner",a(e,"tableProps.k437")],["none",a(e,"tableProps.k438")]].map(([x,G])=>l("button",{type:"button",class:"pd-button small",text:G,onClick:()=>{h.applyBorderPreset(i,r,B.style==="none"?"none":x,be()),o.updateElement(t.id,{tableRows:i})}}))),l("div",{class:"pd-checkbox-group"},ji.map(x=>l("label",{class:"pd-checkbox"},[l("input",{type:"checkbox",value:x.value,checked:He[x.value]==="on",indeterminate:He[x.value]==="mixed",onChange:G=>{const te=G.target.checked&&B.style!=="none";f&&y({edges:{...E.edges,[x.value]:te}}),D(Le=>{h.setCellBorderEdge(Le,x.value,te?be():null)})}}),l("span",{text:a(e,x.labelKey)})]))),_t(a(e,f?h.CELL_BORDER_APPLY_HINT_MULTI_KEY:ie?h.CELL_BORDER_APPLY_HINT_MIXED_KEY:h.CELL_BORDER_APPLY_HINT_KEY)),ue(a(e,"tableProps.k439"),Me("padding",bt(s.padding)),"padding",{min:0,max:10,step:.5,placeholder:De(a(e,"tableProps.k440"))},X("padding")),wt(a(e,"tableProps.k441"),f?E.values.wordWrap===!0:s.wordWrap??!0,x=>S("wordWrap",x),void 0,X("wordWrap")),qe?$t(a(e,"tableProps.k442"),jt,ct(Hd),x=>{x!=="__multi__"&&S("textFit",x)},{full:!0,reset:X("textFit")}):"",qe&&Z==="shrink"?ue(a(e,"tableProps.k443"),Me("shrinkMinFontSize",bt(s.shrinkMinFontSize)),"shrinkMinFontSize",{min:0,max:72,step:.5,placeholder:De(a(e,"tableProps.k444"))},X("shrinkMinFontSize")):"",l("div",{class:"merge-card"},[l("div",{class:"merge-card-title",text:a(e,"tableProps.k445")}),l("div",{class:"merge-btns"},[l("button",{type:"button",class:"pd-button small",text:a(e,"tableProps.k446"),disabled:!!Q,title:Q||"",onClick:()=>{h.mergeCells(i,r),o.updateElement(t.id,{tableRows:i})}}),l("button",{type:"button",class:"pd-button small",text:a(e,"tableProps.k447"),disabled:!it,onClick:()=>{h.splitCells(i,r),o.updateElement(t.id,{tableRows:i})}})]),l("div",{class:"merge-card-divider"}),wt(a(e,"tableProps.k448"),f?E.values.mergeSameValue===!0:s.mergeSameValue===!0,x=>S("mergeSameValue",x),J||void 0,rt?X("mergeSameValue"):void 0,!rt),_t(a(e,"tableProps.k449"))])])])}const pr=R.WATERMARK_DENSITY_PRESETS;function Sr(e){const t=e.trim();return t?/[{}]/.test(t)||/^[A-Za-z_$][\w$]*\s*\(/.test(t)?!0:/^[A-Za-z_$][\w$]*(\.[\w$]+)+$/.test(t):!1}function qd(e){return e?e.mode==="binding"?e.binding??"":e.content??"":""}function Yd(e){const t=e.store.templateData.watermark,o=qd(t),r=t?.mode==="binding"||o!==""&&Sr(o),i=(()=>{const u=t?.tileWidth??R.WATERMARK_DEFAULTS.tileWidth,f=t?.tileHeight??R.WATERMARK_DEFAULTS.tileHeight;for(const[b,m]of Object.entries(pr))if(m.width===u&&m.height===f)return b;return"custom"})(),n=u=>{const f={...t,testData:t?.testData??"",rotate:t?.rotate??R.WATERMARK_DEFAULTS.rotate,color:t?.color||R.WATERMARK_DEFAULTS.color,opacity:t?.opacity??R.WATERMARK_DEFAULTS.opacity,tileWidth:t?.tileWidth??R.WATERMARK_DEFAULTS.tileWidth,tileHeight:t?.tileHeight??R.WATERMARK_DEFAULTS.tileHeight};e.store.updateTemplateData({watermark:{...f,...u}})},s=()=>e.fire("open-expression",{elementId:"",targetPath:"watermark.content",value:o}),d={rotate:t?.rotate??R.WATERMARK_DEFAULTS.rotate,color:t?.color||R.WATERMARK_DEFAULTS.color,opacity:t?.opacity??R.WATERMARK_DEFAULTS.opacity,tileWidth:t?.tileWidth??R.WATERMARK_DEFAULTS.tileWidth,tileHeight:t?.tileHeight??R.WATERMARK_DEFAULTS.tileHeight},c=u=>kt({target:d,base:R.WATERMARK_DEFAULTS,propKey:u,write:()=>n({[u]:R.WATERMARK_DEFAULTS[u]})});return l("div",{class:"watermark-config"},[Ge(a(e,"watermark.k538")),l("form",{class:"pd-form",onSubmit:u=>u.preventDefault()},[l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"watermark.k539")}),l("input",{class:"pd-input",type:"text",value:o,placeholder:a(e,"watermark.k540"),title:a(e,"watermark.k541"),onChange:u=>{const f=u.target.value;n(Sr(f)?{mode:"binding",binding:f,content:""}:{mode:"fixed",content:f,binding:""})},onDblclick:s}),l("button",{type:"button",class:"pd-button small",text:a(e,"watermark.k542"),onClick:s})]),r?q(a(e,"watermark.k543"),l("input",{class:"pd-input",type:"text",value:t?.testData??"",placeholder:a(e,"watermark.k544"),onChange:u=>n({testData:u.target.value})})):"",l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"watermark.k545")}),c("rotate")]),l("input",{type:"range",class:"pd-range",min:-90,max:90,step:5,value:String(t?.rotate??R.WATERMARK_DEFAULTS.rotate),onChange:u=>n({rotate:Number(u.target.value)})}),l("span",{class:"pd-hint",text:`${t?.rotate??R.WATERMARK_DEFAULTS.rotate}°`})]),q(a(e,"watermark.k546"),Ae(t?.color||R.WATERMARK_DEFAULTS.color,u=>n({color:u}),a(e,"watermark.k547")),void 0,c("color")),l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"watermark.k548")}),c("opacity")]),l("input",{type:"range",class:"pd-range",min:.05,max:.5,step:.05,value:String(t?.opacity??R.WATERMARK_DEFAULTS.opacity),onChange:u=>n({opacity:Number(u.target.value)})}),l("span",{class:"pd-hint",text:(t?.opacity??R.WATERMARK_DEFAULTS.opacity).toFixed(2)})]),l("div",{class:"pd-field"},[l("span",{class:"pd-label",text:a(e,"watermark.k549")}),l("select",{class:"pd-select",style:{width:"100%"},onChange:u=>{const f=u.target.value,b=pr[f];b&&n({tileWidth:b.width,tileHeight:b.height})}},[...Object.entries(pr).map(([u,f])=>l("option",{value:u,text:`${a(e,f.labelKey)}${a(e,"constants.watermark.density.size",{w:f.width,h:f.height})}`,selected:i===u})),l("option",{value:"custom",text:a(e,"watermark.k550"),selected:i==="custom"})])]),i==="custom"?l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"watermark.k551")}),c("tileWidth")]),l("input",{type:"number",class:"pd-input",min:R.WATERMARK_DEFAULTS.minTileWidth,step:10,value:String(t?.tileWidth??R.WATERMARK_DEFAULTS.tileWidth),onChange:u=>n({tileWidth:Number(u.target.value)})})]):"",i==="custom"?l("div",{class:"pd-field"},[l("span",{class:"pd-label"},[l("span",{class:"pd-label-t",text:a(e,"watermark.k552")}),c("tileHeight")]),l("input",{type:"number",class:"pd-input",min:R.WATERMARK_DEFAULTS.minTileHeight,step:10,value:String(t?.tileHeight??R.WATERMARK_DEFAULTS.tileHeight),onChange:u=>n({tileHeight:Number(u.target.value)})})]):""].filter(Boolean))])}function de(e,t,o,r,i={},n){return q(t,H({value:o,...i,onCommit:r}),void 0,n)}function et(e,t,o,r,i,n,s){const d=document.createElement("select");d.className="pd-select",d.addEventListener("change",()=>i(d.value));for(const c of r){const u=document.createElement("option");u.value=c.value,u.textContent=c.label,d.appendChild(u)}return d.value=o,r.some(c=>c.value===o)||(d.selectedIndex=-1),n?xe(t,d,n,s):q(t,d,void 0,s)}function gt(e,t,o,r,i){return q(t,l("input",{type:"checkbox",class:"pd-switch",checked:o,onChange:n=>r(n.target.checked)}),void 0,i)}const jd=[{value:"all",labelKey:"propertyPanel.k177"},{value:"outer",labelKey:"propertyPanel.k178"},{value:"inner",labelKey:"propertyPanel.k179"},{value:"none",labelKey:"propertyPanel.k180"}],Xd=[{value:"top",labelKey:"propertyPanel.k181"},{value:"right",labelKey:"propertyPanel.k182"},{value:"bottom",labelKey:"propertyPanel.k183"},{value:"left",labelKey:"propertyPanel.k184"}];function Zd(e,t){const o=e.store,r=t.options,i=t.printElementType.type,n=v=>o.updateElement(t.id,v),s=wn(i),d=s==="text",c=s==="code",u=s==="table",f=u&&o.tableSelection?.elementId===t.id,b=f&&h.resolveCellGroupMode(t.options.tableRows??[],o.tableSelection).mode==="multi",m=[];b||m.push(zd(e,t));const E=h.createDefaultOptions(i),y=(v,ee)=>{const be=h.propertyDefault(ee);return kt({target:r,base:E,propKey:v,tipValue:be?.value,tipUnit:be?.unit,write:()=>n({[v]:E[v]})})};f||m.push(Te(e,"position-size",a(e,"propertyPanel.k185"),"Location",[l("form",{class:"pd-form",onSubmit:v=>v.preventDefault()},[l("div",{class:"position-grid"},[M(e,"ps-left",de(e,"X",r.left,v=>n({left:v}),{min:0})),M(e,"ps-top",de(e,"Y",r.top,v=>n({top:v}),{min:0})),M(e,"ps-width",de(e,"W",r.width,v=>n({width:v}),{min:4})),M(e,"ps-height",de(e,"H",r.height,v=>n({height:v}),{min:4}))]),l("h3",{class:"pd-divider",text:a(e,"propertyPanel.k186")}),l("div",{class:"margin-grid"},[M(e,"ps-margin-top",de(e,a(e,"propertyPanel.k187"),r.marginTop,v=>n({marginTop:v===0?void 0:v}),{},y("marginTop","ps-margin-top"))),M(e,"ps-margin-right",de(e,a(e,"propertyPanel.k188"),r.marginRight,v=>n({marginRight:v===0?void 0:v}),{},y("marginRight","ps-margin-right"))),M(e,"ps-margin-bottom",de(e,a(e,"propertyPanel.k189"),r.marginBottom,v=>n({marginBottom:v===0?void 0:v}),{},y("marginBottom","ps-margin-bottom"))),M(e,"ps-margin-left",de(e,a(e,"propertyPanel.k190"),r.marginLeft,v=>n({marginLeft:v===0?void 0:v}),{},y("marginLeft","ps-margin-left")))])])]));const C=typeof r.rotate=="number"&&Number.isFinite(r.rotate)&&r.rotate!==0?h.normalizeRotationAngle(r.rotate):void 0,D=v=>n({rotate:v===void 0||v===0?void 0:h.normalizeRotationAngle(v)}),S=h.isFreeAngleEditable(i,r),_=h.isRotationExcludedType(i)||h.collectFollowMemberIds(o.elements).has(t.id),z=_?"":M(e,"ap-rotate",xe(a(e,"propertyPanel.k191"),l("div",{class:"pd-rotate-row"},[l("button",{type:"button",class:"pd-rotate-btn",title:a(e,"propertyPanel.k192"),"aria-label":a(e,"propertyPanel.k193"),text:"↺",onClick:()=>D((C??0)-90)}),l("div",{class:"pd-rotate-stepper"},[H({value:C,min:0,max:359,placeholder:"0",disabled:!S,onCommit:v=>D(v)})]),l("button",{type:"button",class:"pd-rotate-btn",title:a(e,"propertyPanel.k194"),"aria-label":a(e,"propertyPanel.k195"),text:"↻",onClick:()=>D((C??0)+90)})]),a(e,"propertyTips.ap-rotate"),y("rotate","ap-rotate"))),A=_||S?"":l("p",{class:"pd-hint pd-rotate-note",text:h.codeObliqueNote(e.t??N)});if(m.push(Te(e,"appearance",a(e,"propertyPanel.k196"),"Brush",[l("form",{class:"pd-form",onSubmit:v=>v.preventDefault()},d?[M(e,"ap-font-family",q(a(e,"propertyPanel.k197"),ko({id:"prop-font",state:e.state,fonts:e.host.fonts,value:typeof r.fontFamily=="string"?r.fontFamily:void 0,placeholder:a(e,"propertyPanel.k198"),onChange:v=>n({fontFamily:v})}),void 0,y("fontFamily","ap-font-family"))),M(e,"ap-font-size",de(e,a(e,"propertyPanel.k199"),r.fontSize,v=>n({fontSize:v}),{min:8,max:72},y("fontSize","ap-font-size"))),M(e,"ap-font-weight",et(e,a(e,"propertyPanel.k200"),String(r.fontWeight??""),[{value:"normal",label:a(e,"propertyPanel.k201")},{value:"bold",label:a(e,"propertyPanel.k202")},{value:"bolder",label:a(e,"propertyPanel.k203")},{value:"lighter",label:a(e,"propertyPanel.k204")}],v=>n({fontWeight:v}),void 0,y("fontWeight","ap-font-weight"))),M(e,"ap-align",q(a(e,"propertyPanel.k205"),dt("ta",[{value:"left",label:a(e,"propertyPanel.k206")},{value:"center",label:a(e,"propertyPanel.k207")},{value:"right",label:a(e,"propertyPanel.k208")},{value:"justify",label:a(e,"propertyPanel.k209")}],r.textAlign||"left",v=>n({textAlign:v})),void 0,y("textAlign","ap-align"))),M(e,"ap-vertical-align",q(a(e,"propertyPanel.k210"),dt("va",[{value:"top",label:a(e,"propertyPanel.k211")},{value:"middle",label:a(e,"propertyPanel.k212")},{value:"bottom",label:a(e,"propertyPanel.k213")}],r.verticalAlign||"top",v=>n({verticalAlign:v})),void 0,y("verticalAlign","ap-vertical-align"))),l("div",{class:"color-row"},[M(e,"ap-color",q(a(e,"propertyPanel.k214"),Ae(r.color,v=>n({color:v}),a(e,"propertyPanel.k215")),void 0,y("color","ap-color"))),M(e,"ap-bg-color",q(a(e,"propertyPanel.k216"),Ae(r.backgroundColor,v=>n({backgroundColor:v}),a(e,"propertyPanel.k217")),void 0,y("backgroundColor","ap-bg-color")))]),M(e,"ap-line-height",de(e,a(e,"propertyPanel.k218"),r.lineHeight,v=>n({lineHeight:v||void 0}),{min:0,max:100},y("lineHeight","ap-line-height"))),M(e,"ap-letter-spacing",de(e,a(e,"propertyPanel.k219"),r.letterSpacing,v=>n({letterSpacing:v||void 0}),{min:0,max:20,step:.5},y("letterSpacing","ap-letter-spacing"))),M(e,"ap-text-fit",et(e,a(e,"propertyPanel.k220"),h.resolveElementTextFit(i,r),[{value:"clip",label:a(e,"propertyPanel.k221")},{value:"shrink",label:a(e,"propertyPanel.k222")},{value:"autoHeight",label:a(e,"propertyPanel.k223")}],v=>n({textFit:v}),void 0,y("textFit","ap-text-fit"))),r.textFit==="shrink"?M(e,"ap-shrink-min",q(a(e,"propertyPanel.k224"),H({value:r.shrinkMinFontSize,min:1,max:72,step:.5,placeholder:a(e,"propertyPanel.k225"),onCommit:v=>n({shrinkMinFontSize:v||void 0})}),void 0,y("shrinkMinFontSize","ap-shrink-min"))):"",i==="longText"?M(e,"ap-long-text-indent",xe(a(e,"propertyPanel.k226"),H({value:r.longTextIndent,min:0,max:10,placeholder:a(e,"propertyPanel.k227"),onCommit:v=>n({longTextIndent:v||void 0})}),a(e,"propertyTips.ap-long-text-indent"),y("longTextIndent","ap-long-text-indent"))):"",M(e,"ap-word-wrap",gt(e,a(e,"propertyPanel.k228"),r.wordWrap!==!1,v=>n({wordWrap:v?void 0:!1}),y("wordWrap","ap-word-wrap"))),M(e,"ap-keep-line-breaks",gt(e,a(e,"propertyPanel.k229"),r.keepLineBreaks===!0,v=>n({keepLineBreaks:v?!0:void 0}),y("keepLineBreaks","ap-keep-line-breaks"))),z,A]:[i==="image"?M(e,"ap-img-fit",et(e,a(e,"propertyPanel.k230"),String(r.fit??"contain"),h.imageFitOptions(e.t??N),v=>n({fit:v}),a(e,"propertyTips.ap-img-fit"),y("fit","ap-img-fit"))):"",i==="image"&&r.fit==="cover"?M(e,"ap-img-object-position",Zn(e,{fieldKey:"ap-img-object-position",label:a(e,"propertyPanel.k231"),src:h.resolveDesignImageSrc(r.src),widthMm:Number(r.width)||0,heightMm:Number(r.height)||0,fit:r.fit,scale:r.fitScale,value:r.objectPosition===void 0?void 0:String(r.objectPosition),onCommit:v=>n({objectPosition:v}),onScaleCommit:v=>n({fitScale:v}),resetAnchor:y("objectPosition","ap-img-object-position"),resetScale:y("fitScale","ap-img-fit-scale")})):"",z,A,i==="flowList"?l("p",{class:"pd-empty",text:a(e,"propertyPanel.k232")}):""].filter(Boolean))])),c){const v=i==="barcode",ee=String(r.barcodeType||"CODE128").toUpperCase(),be=r.printerDpi?String(r.printerDpi):"",He=h.barcodeBarWidthRecommendText(r.printerDpi,r.barWidth,e.t??N);m.push(Te(e,"code",a(e,"propertyPanel.k233"),"Postcard",[l("form",{class:"pd-form",onSubmit:W=>W.preventDefault()},[v?[M(e,"cd-type",et(e,a(e,"propertyPanel.k234"),ee,[{value:"CODE128",label:a(e,"propertyPanel.k235")},{value:"EAN13",label:a(e,"propertyPanel.k236")},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],W=>n({barcodeType:W==="CODE128"?void 0:W}))),M(e,"cd-dpi",et(e,a(e,"propertyPanel.k237"),be,[{value:"",label:a(e,"propertyPanel.k238")},{value:"203",label:a(e,"propertyPanel.k239")},{value:"300",label:a(e,"propertyPanel.k240")},{value:"600",label:a(e,"propertyPanel.k241")}],W=>n({printerDpi:Number(W)>0?Number(W):void 0}),void 0,y("printerDpi","cd-dpi"))),M(e,"cd-dpi",l("p",{class:"pd-hint",text:a(e,"propertyPanel.k242")})),M(e,"cd-bar-width",de(e,a(e,"propertyPanel.k243"),r.barWidth??2,W=>n({barWidth:W}),{min:2,max:8,step:.5},y("barWidth","cd-bar-width"))),M(e,"cd-bar-width",l("p",{class:"pd-hint",text:(be?a(e,"propertyPanel.k244"):a(e,"propertyPanel.k245"))+(He?`。${He}`:"")})),M(e,"cd-bar-quiet-zone",xe(a(e,"propertyPanel.k246"),H({value:r.barQuietZone,min:0,max:20,placeholder:a(e,"propertyPanel.k247"),onCommit:W=>n({barQuietZone:W})}),a(e,"propertyTips.cd-bar-quiet-zone"),y("barQuietZone","cd-bar-quiet-zone"))),M(e,"cd-bar-height",xe(a(e,"propertyPanel.k248"),H({value:r.barHeight,min:1,max:100,placeholder:a(e,"propertyPanel.k249"),onCommit:W=>n({barHeight:W??void 0})}),a(e,"propertyTips.cd-bar-height"),y("barHeight","cd-bar-height"))),M(e,"cd-show-text",gt(e,a(e,"propertyPanel.k250"),r.hideTitle!==!0,W=>n({hideTitle:W?void 0:!0}),y("hideTitle","cd-show-text"))),M(e,"cd-font-size",q(a(e,"propertyPanel.k251"),H({value:r.fontSize,min:5,max:24,placeholder:a(e,"propertyPanel.k252"),onCommit:W=>n({fontSize:W||void 0})}),void 0,y("fontSize","cd-font-size")))]:[M(e,"cd-ec-level",et(e,a(e,"propertyPanel.k253"),String(r.qrCodeLevel??"M"),[{value:"L",label:a(e,"propertyPanel.k254")},{value:"M",label:a(e,"propertyPanel.k255")},{value:"Q",label:"Q"},{value:"H",label:a(e,"propertyPanel.k256")}],W=>n({qrCodeLevel:W}),void 0,y("qrCodeLevel","cd-ec-level"))),M(e,"cd-quiet-zone",xe(a(e,"propertyPanel.k257"),H({value:r.qrQuietZone,min:0,max:8,placeholder:a(e,"propertyPanel.k258"),onCommit:W=>n({qrQuietZone:W})}),a(e,"propertyTips.cd-quiet-zone"),y("qrQuietZone","cd-quiet-zone")))],Ge(a(e,"propertyPanel.k259")),v?l("p",{class:"pd-hint",text:a(e,"propertyPanel.k260")}):"",v?"":M(e,"cd-fit",et(e,a(e,"propertyPanel.k261"),String(r.fit||"contain"),h.imageFitOptions(e.t??N),W=>n({fit:W||void 0}),void 0,y("fit","cd-fit"))),M(e,"cd-max-width",q(a(e,"propertyPanel.k262"),H({value:r.maxWidth,min:1,max:200,placeholder:a(e,"propertyPanel.k263"),onCommit:W=>n({maxWidth:W||void 0})}),void 0,y("maxWidth","cd-max-width"))),M(e,"cd-max-height",q(a(e,"propertyPanel.k264"),H({value:r.maxHeight,min:1,max:200,placeholder:a(e,"propertyPanel.k265"),onCommit:W=>n({maxHeight:W||void 0})}),void 0,y("maxHeight","cd-max-height")))].flat().filter(Boolean))]))}if(f&&(m.push(Wd(e,t)),m.push(Gd(e,t))),u&&m.push(Kd(e,t)),i==="flowList"){const v=h.resolveFlowColumns(r.flowColumns),ee=h.resolveFlowRowHeight(r.flowRowHeight),be=h.resolveFlowGapX(r.flowGapX),He=h.resolveFlowMaxSpan(r.flowMaxSpan,v),W=h.suggestFlowColumns(r.width??0,be,r.fontSize??12),ae=h.resolveFlowLayoutMode(r.flowLayoutMode),Re=ae==="dynamic",Fe=h.resolveFlowPadding(r),qe=(Y,Ye)=>{n({[Y]:typeof Ye=="number"&&Number.isFinite(Ye)&&Ye>0?Ye:0})};m.push(Te(e,"flowList",a(e,"propertyPanel.k266"),"Grid3x3",[l("form",{class:"pd-form",onSubmit:Y=>Y.preventDefault()},[M(e,"fl-layout-mode",et(e,a(e,"propertyPanel.k267"),ae,[{value:"fixed",label:a(e,"propertyPanel.k268")},{value:"dynamic",label:a(e,"propertyPanel.k269")}],Y=>n({flowLayoutMode:Y==="dynamic"?"dynamic":"fixed"}),a(e,"propertyTips.fl-layout-mode"))),...Re?[M(e,"fl-padding-top",xe(a(e,"propertyPanel.k270"),H({value:Fe.top,min:0,max:100,step:.5,onCommit:Y=>qe("flowPaddingTop",Y)}),a(e,"propertyTips.fl-padding-top"))),M(e,"fl-padding-right",xe(a(e,"propertyPanel.k271"),H({value:Fe.right,min:0,max:100,step:.5,onCommit:Y=>qe("flowPaddingRight",Y)}),a(e,"propertyTips.fl-padding-right"))),M(e,"fl-padding-bottom",xe(a(e,"propertyPanel.k272"),H({value:Fe.bottom,min:0,max:100,step:.5,onCommit:Y=>qe("flowPaddingBottom",Y)}),a(e,"propertyTips.fl-padding-bottom"))),M(e,"fl-padding-left",xe(a(e,"propertyPanel.k273"),H({value:Fe.left,min:0,max:100,step:.5,onCommit:Y=>qe("flowPaddingLeft",Y)}),a(e,"propertyTips.fl-padding-left")))]:[],M(e,"fl-columns",xe(a(e,"propertyPanel.k274"),H({value:v,min:1,max:12,onCommit:Y=>n({flowColumns:h.resolveFlowColumns(Y),flowMaxSpan:h.resolveFlowMaxSpan(r.flowMaxSpan,h.resolveFlowColumns(Y))})}),a(e,"propertyTips.fl-columns"))),M(e,"fl-row-height",xe(a(e,"propertyPanel.k275"),H({value:ee,min:3,max:100,step:.5,onCommit:Y=>n({flowRowHeight:h.resolveFlowRowHeight(Y)})}),a(e,"propertyTips.fl-row-height"))),M(e,"fl-gap-x",xe(a(e,"propertyPanel.k276"),H({value:be,min:0,max:50,step:.5,onCommit:Y=>n({flowGapX:h.resolveFlowGapX(Y)})}),a(e,"propertyTips.fl-gap-x"))),M(e,"fl-auto-span",gt(e,a(e,"propertyPanel.k277"),r.flowAutoSpan===!0,Y=>{n(Y?{flowAutoSpan:Y,flowMaxSpan:He}:{flowAutoSpan:Y})})),r.flowAutoSpan===!0?M(e,"fl-max-span",xe(a(e,"propertyPanel.k278"),H({value:He,min:1,max:v,onCommit:Y=>n({flowMaxSpan:h.resolveFlowMaxSpan(Y,v)})}),a(e,"propertyTips.fl-max-span"))):"",v>W?l("p",{class:"pd-hint",text:a(e,"propertyPanel.k279",{v0:v,v1:W,v2:v})}):""].flat().filter(Boolean))]))}const I=()=>({borderWidth:r.borderWidth,borderStyle:r.borderStyle,borderColor:r.borderColor,borders:r.borders}),K=v=>{const ee=I();h.applyElementBorderPreset(ee,v,h.effectiveElementBorderSpec(ee)),n(ee)},B=v=>{const ee=I();h.setElementBorderEdgeVisible(ee,v,!h.elementBorderEdgeVisible(ee,v)),n(ee)},L=h.resolveElementBorderDisplay(r),U=L.style==="mixed",re=typeof L.width=="number"?L.width:void 0,V=U||L.style===void 0?"":L.style,he=typeof L.color=="string"?L.color:void 0,ie=(v,ee)=>{const be=I();h.setElementBorderField(be,v,ee),n(be)},Ce=h.BORDER_LINE_STYLES.map(v=>({...v,label:a(e,v.labelKey)})),ke=U?[{value:"",label:a(e,"propertyPanel.k280")},...Ce]:Ce;return m.push(Te(e,"border-bg",a(e,"propertyPanel.k281"),"Picture",[l("form",{class:"pd-form",onSubmit:v=>v.preventDefault()},[M(e,"bb-border-style",et(e,a(e,"propertyPanel.k282"),V,ke,v=>ie("borderStyle",v))),l("div",{class:"border-row"},[M(e,"bb-border-width",de(e,a(e,"propertyPanel.k283"),re,v=>ie("borderWidth",v),{min:0,max:20,step:.25,placeholder:L.width==="mixed"?a(e,"propertyPanel.k284"):void 0},y("borderWidth","bb-border-width"))),M(e,"bb-border-color",q(a(e,"propertyPanel.k285"),Ae(he,v=>ie("borderColor",v),a(e,"propertyPanel.k286")),void 0,y("borderColor","bb-border-color")))]),...h.acceptsElementBorder(i)?[l("div",{class:"pd-button-group border-presets"},jd.map(v=>l("button",{type:"button",class:"pd-button small",text:a(e,v.labelKey),disabled:v.value==="inner",onClick:()=>K(v.value)}))),l("div",{class:"pd-checkbox-group"},Xd.map(v=>l("label",{class:"pd-checkbox"},[l("input",{type:"checkbox",checked:h.elementBorderEdgeVisible(r,v.value),onChange:()=>B(v.value)}),l("span",{text:a(e,v.labelKey)})]))),l("p",{class:"pd-hint",text:a(e,h.ELEMENT_BORDER_APPLY_HINT_KEY)})]:[],M(e,"bb-bg-color",q(a(e,"propertyPanel.k287"),Ae(r.backgroundColor,v=>n({backgroundColor:v}),a(e,"propertyPanel.k288")),void 0,y("backgroundColor","bb-bg-color")))])])),m.push(Vd(e,t)),m.push(Te(e,"advanced",a(e,"propertyPanel.k289"),"Setting",[l("form",{class:"pd-form",onSubmit:v=>v.preventDefault()},[l("div",{class:"advanced-row"},[M(e,"ad-locked",gt(e,a(e,"propertyPanel.k290"),!!r.locked,v=>n({locked:v}),y("locked","ad-locked"))),M(e,"ad-fixed",gt(e,a(e,"propertyPanel.k291"),!!r.repeatOnEveryPage,v=>n({repeatOnEveryPage:v}),y("repeatOnEveryPage","ad-fixed"))),M(e,"ad-fixed-position",gt(e,a(e,"propertyPanel.k292"),!!r.fixed,v=>n({fixed:v}),y("fixed","ad-fixed-position")))]),M(e,"ad-z-index",de(e,a(e,"propertyPanel.k293"),r.zIndex,v=>n({zIndex:v}),{min:0,max:999},y("zIndex","ad-z-index"))),M(e,"ad-delete",l("div",{class:"pd-field"},[l("button",{type:"button",class:"pd-button danger",text:a(e,"propertyPanel.k294"),onClick:()=>o.deleteSelected()})]))])],!1,[l("button",{type:"button",class:"group-help",title:a(e,"propertyPanel.k295"),"aria-label":a(e,"propertyPanel.k296"),text:"?",onClick:v=>{v.stopPropagation(),e.fire("help","advanced-settings")}})])),l("div",{class:"property-content"},m)}function Qd(e){const t=e.store,o=t.templateData,r=c=>t.updateTemplateData(c),i=c=>{const u=o.tiling,f=b=>b===90||b===270;if(u?.enabled&&f(c)!==f(o.outputRotation)){const b=R.computeMaxColumns({...o,outputRotation:c});r({outputRotation:c,tiling:{...u,columns:Math.max(b,1)}});return}r({outputRotation:c})},n=[];for(const[c,u]of Object.entries(h.PAPER_PRESETS)){const f=a(e,`constants.paper.group.${u.group}`);let b=n.find(m=>m.group===f);b||(b={group:f,items:[]},n.push(b)),b.items.push({key:c,label:a(e,u.labelKey)})}const s=!h.PAPER_PRESETS[o.paperSize],d=h.isContinuousPaperSize(o.paperSize);return l("form",{class:"pd-form",onSubmit:c=>c.preventDefault()},[Ge(a(e,"propertyPanel.k298")),q(a(e,"propertyPanel.k299"),l("select",{class:"pd-select",style:{width:"100%"},onChange:c=>r({paperSize:c.target.value})},[...n.map(c=>l("optgroup",{label:c.group},c.items.map(u=>l("option",{value:u.key,text:u.label,selected:o.paperSize===u.key})))),l("option",{value:"CUSTOM",text:a(e,"propertyPanel.k300"),selected:s})])),d||s?q(d?a(e,"propertyPanel.k301"):a(e,"propertyPanel.k302"),l("div",{class:"custom-size-grid"},[H({value:Number(o.customWidth??0),min:25,max:2e3,onCommit:c=>r({customWidth:c})}),...s?[l("span",{class:"custom-size-x",text:"×"}),H({value:Number(o.customHeight??0),min:25,max:2e3,onCommit:c=>r({customHeight:c})})]:[]])):"",d?"":q(a(e,"propertyPanel.k303"),dt("ori",[{value:"portrait",label:a(e,"propertyPanel.k304")},{value:"landscape",label:a(e,"propertyPanel.k305")}],o.orientation==="landscape"?"landscape":"portrait",c=>r({orientation:c})),a(e,"propertyPanel.k306")),d?"":q(a(e,"propertyPanel.k307"),dt("rot",[{value:"0",label:"0°"},{value:"90",label:"90°"},{value:"180",label:"180°"},{value:"270",label:"270°"}],String(o.outputRotation??0),c=>i(Number(c)),!0),o.tiling?.enabled?a(e,"propertyPanel.k308"):a(e,"propertyPanel.k309")),q(a(e,"propertyPanel.k310"),l("div",{class:"page-bg-row"},[Ae(o.pageBackground,c=>r({pageBackground:c}),a(e,"propertyPanel.k311"),"page-bg-picker")]),void 0,kt({target:o,base:{pageBackground:void 0},propKey:"pageBackground",write:()=>r({pageBackground:void 0})})),Ed(e),t.pages.length>1?"":Sd(e),Ge(a(e,"propertyPanel.k312")),l("div",{class:"margin-grid"},[de(e,a(e,"propertyPanel.k313"),o.margins.top,c=>r({margins:{...o.margins,top:c}}),{min:0,max:50}),de(e,a(e,"propertyPanel.k314"),o.margins.bottom,c=>r({margins:{...o.margins,bottom:c}}),{min:0,max:100}),de(e,a(e,"propertyPanel.k315"),o.margins.left,c=>r({margins:{...o.margins,left:c}}),{min:0,max:50}),de(e,a(e,"propertyPanel.k316"),o.margins.right,c=>r({margins:{...o.margins,right:c}}),{min:0,max:50})]),Ge(a(e,"propertyPanel.k317")),de(e,a(e,"propertyPanel.k318"),o.header.height??10,c=>r({header:{...o.header,height:c}}),{min:0,max:100,step:.1}),de(e,a(e,"propertyPanel.k319"),o.footer.height??10,c=>r({footer:{...o.footer,height:c}}),{min:0,max:100,step:.1}),Yd(e)].filter(Boolean))}function Jd(e,t,o){const r=(e.state.propSearch??"").trim(),i=!r||h.matchKeywords(r,[...o.searchKeywords,o.label]),n=document.createElement("div");if(n.className="property-content",i)try{zn(`property:${t.id}`,o.ui.renderProperty({element:t,data:e.host.designData?.length?e.host.designData:[h.DEFAULT_DEMO_DATA],fields:e.host.fields??[],update:s=>e.store.updateElement(t.id,s),repaint:()=>e.repaint(),t:e.t??N}),n)}catch{}return l("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:custom"},style:e.state.propTab==="custom"?"":{display:"none"}},[n])}function ep(e){const t=e.store,o=e.state,r=t.selectedElement,i=r?br(r):void 0;if(o.propCollapsed)return l("div",{class:"property-panel collapsed"},[l("div",{class:"prop-collapsed"},[l("button",{type:"button",class:"pc-btn",title:a(e,"propertyPanel.k320"),text:"«",onClick:()=>{o.propCollapsed=!1,e.repaint()}}),...i?[l("button",{type:"button",class:`pc-btn${o.propTab==="custom"?" on":""}`,title:i.label,html:ge(i.icon,14)||ge("Shapes",14),onClick:()=>{o.propTab="custom",o.propCollapsed=!1,e.repaint()}})]:[],...[["element",a(e,"propertyPanel.k321"),"▦"],["page",a(e,"propertyPanel.k322"),"▤"]].map(([s,d,c])=>l("button",{type:"button",class:`pc-btn${o.propTab===s?" on":""}`,title:d,text:c,onClick:()=>{o.propTab=s,o.propCollapsed=!1,e.repaint()}}))])]);const n=r?o.propTab==="custom"&&!i?"element":o.propTab:"page";return l("div",{class:"property-panel"},[l("div",{class:"prop-head"},[l("span",{class:"prop-title",text:a(e,"propertyPanel.k323")}),l("button",{type:"button",class:"collapse-btn",title:a(e,"propertyPanel.k324"),text:"»",onClick:()=>{o.propCollapsed=!0,e.repaint()}})]),l("div",{class:"pd-tabs prop-tabs"},[l("div",{class:"pd-tab-bar",role:"tablist"},[...i?[l("button",{type:"button",class:`pd-tab${n==="custom"?" active":""}`,text:i.label,onClick:()=>{o.propTab="custom",e.repaint()}})]:[],l("button",{type:"button",class:`pd-tab${n==="element"?" active":""}`,text:a(e,"propertyPanel.k325"),onClick:()=>{o.propTab="element",e.repaint()}}),l("button",{type:"button",class:`pd-tab${n==="page"?" active":""}`,text:a(e,"propertyPanel.k326"),onClick:()=>{o.propTab="page",e.repaint()}})]),i&&r?Jd(e,r,i):"",l("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:element"},style:n==="element"?"":{display:"none"}},r?[Md(e),Zd(e,r)]:[l("p",{class:"pd-empty",text:a(e,"propertyPanel.k327")})]),l("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:page"},style:n==="page"?"":{display:"none"}},[Qd(e)])].filter(Boolean))])}var P=we.t,tp={Check:'<path d="M20 6 9 17l-5-5" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />'};function op(e,t=16){return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${tp[e]??""}</svg>`}function ho(e){const t=typeof e=="string"?e.trim().toLowerCase():"";return t==="label"||t==="key"||t==="both"?t:"both"}function cr(){return[{key:"field",text:P("expression.tabField")},{key:"variable",text:P("expression.tabVariable")},{key:"function",text:P("expression.tabFunction")}]}function Xi(){return{field:P("expression.placeholderField"),variable:P("expression.placeholderVariable"),function:P("expression.placeholderFunction")}}function rp(){return[{name:"SUM",label:P("expression.fnSum"),template:"SUM()"},{name:"AVG",label:P("expression.fnAvg"),template:"AVG()"},{name:"COUNT",label:P("expression.fnCount"),template:"COUNT()"},{name:"MIN",label:P("expression.fnMin"),template:"MIN()"},{name:"MAX",label:P("expression.fnMax"),template:"MAX()"}]}function ip(){return[{name:"ADD",label:P("expression.fnAdd"),template:"ADD()"},{name:"SUB",label:P("expression.fnSub"),template:"SUB()"},{name:"MUL",label:P("expression.fnMul"),template:"MUL()"},{name:"DIV",label:P("expression.fnDiv"),template:"DIV()"},{name:"ROUND",label:P("expression.fnRound"),template:"ROUND()"},{name:"ROUNDUP",label:P("expression.fnRoundUp"),template:"ROUNDUP()"},{name:"ROUNDDOWN",label:P("expression.fnRoundDown"),template:"ROUNDDOWN()"},{name:"ROUNDBANK",label:P("expression.fnRoundBank"),template:"ROUNDBANK()"}]}function np(){return[{name:"MONEY",label:P("expression.fnMoney"),template:"MONEY()"},{name:"DATE",label:P("expression.fnDate"),template:"DATE()"},{name:"UPPER",label:P("expression.fnUpper"),template:"UPPER()"},{name:"IF",label:P("expression.fnIf"),template:"IF()"}]}function ap(){return[{name:"pageIndex",label:P("expression.varPageIndex"),template:"{pageIndex}"},{name:"totalPages",label:P("expression.varTotalPages"),template:"{totalPages}"},{name:"printDate",label:P("expression.varPrintDate"),template:"{printDate}"},{name:"printTime",label:P("expression.varPrintTime"),template:"{printTime}"}]}function lp(){return[{title:P("expression.groupAggregate"),items:rp()},{title:P("expression.groupMath"),items:ip()},{title:P("expression.groupFormat"),items:np()}]}var sp="expression.previewEmpty",dp="expression.previewNoValue",Tr="expression.previewError";function Zi(e,t){if(!e.trim())return P(sp);try{const o={...h.DEFAULT_DEMO_DATA,...t??{},...R.resolveSystemVariables()},r=h.evaluateTemplate(e,o);return r==null?P(dp):String(r)}catch{return P(Tr)}}function Qi(e,t){const o=t.trim().toLowerCase();return o?e.filter(r=>r.label.toLowerCase().includes(o)||r.name.toLowerCase().includes(o)):e}function pp(e,t){const o=e.substring(0,t),r=o.lastIndexOf("{"),i=r!==-1&&!o.slice(r+1).includes("}"),n=o.lastIndexOf("("),s=n!==-1&&!o.slice(n+1).includes(")");return{insideBlock:i,insideParens:s}}var cp=e=>/[\u4e00-\u9fff]/.test(e),hp=e=>`字段「${e}」含中文,请用 {${e}} 引用(函数参数内写 ${e});中文可直接在 {} 中使用,无需 data['...'] 方括号`;function up(e,t){const o=/^\{\s*([^{}]+?)\s*\}$/.exec(e.trim());if(!o)return null;const r=o[1]??"";return t.find(i=>i.fieldKey===r)??null}function hr(e,t,o="both"){return o==="label"?l("div",{class:"ee-field-info"},[l("span",{class:"ee-item-label",text:e})]):o==="key"?l("div",{class:"ee-field-info"},[l("span",{class:"ee-item-key is-primary",text:t})]):l("div",{class:"ee-field-info"},[l("span",{class:"ee-item-label",text:e}),l("span",{class:"ee-item-key",text:t})])}function Ve(e){return e.currentTarget.getRootNode()}function so(e,t,o){const r=[];return o.forEach((i,n)=>{r.push(i),n<o.length-1&&r.push(l("br"))}),l("div",{class:`ee-help-card ${e}`},[l("div",{class:"ee-help-card-title",text:t}),l("div",{class:"ee-help-card-content"},r)])}function fp(){return l("div",{class:"ee-help-section"},[l("div",{class:"ee-help-title",text:P("expression.k1")}),l("div",{class:"ee-help-grid"},[so("ee-help-field",P("expression.k2"),[P("expression.k3"),P("expression.k4"),P("expression.k5"),P("expression.k6"),P("expression.k7"),P("expression.k8"),P("expression.k9")]),so("ee-help-function",P("expression.k10"),[P("expression.k11"),P("expression.k12"),P("expression.k13"),P("expression.k14"),P("expression.k15"),P("expression.k16")]),so("ee-help-variable",P("expression.k17"),[P("expression.k18"),P("expression.k19"),P("expression.k20")]),so("ee-help-conditional",P("expression.k21"),[P("expression.k22"),P("expression.k23"),P("expression.k24"),P("expression.k25"),P("expression.k26")])])])}function gp(e,t){P=e.t??we.t;const o=ho(e.fieldDisplay),r={activeTab:"field",searchText:"",expression:t.value||"",binding:t.binding,copiedFieldKey:"",keyHint:""},i=(S,_)=>S.querySelector(_),n=S=>{const _=i(S,".ee-preview");if(!_)return;const z=Zi(r.expression,e.demoData);_.textContent=z,_.classList.toggle("ee-preview-error",z===P(Tr))},s=S=>{const _=i(S,".ee-key-hint");_&&(_.textContent=r.keyHint,_.style.display=r.keyHint?"":"none")},d=()=>{if(r.activeTab==="variable")return Qi(ap(),r.searchText).map(z=>l("div",{class:"ee-list-item",onDblclick:A=>{const{insideParens:I}=f(A);b(Ve(A),I?z.template.replace(/^\{|\}$/g,""):z.template,void 0,"")}},[hr(z.label,z.template)]));if(r.activeTab==="function")return lp().map(z=>l("div",{class:"ee-func-group"},[l("div",{class:"ee-func-group-title",text:z.title}),...Qi(z.items,r.searchText).map(A=>l("div",{class:"ee-list-item",onDblclick:I=>{const{insideBlock:K}=f(I),B=K?A.template:`{${A.template}}`;b(Ve(I),B,B.indexOf("(")+1,"")}},[hr(A.label,`${A.name}()`)]))]));const S=h.filterGroups(h.groupFields(e.fields??[]),r.searchText);if(!S.length)return[l("p",{class:"pd-empty",text:P("expression.k27")})];const _=[];for(const z of S){z.key&&_.push(l("div",{class:`ee-field-group${z.isList?" is-list":""}`},[l("span",{class:"ee-field-group-icon",text:z.isList?"📋":"📁"}),l("span",{text:z.label})]));for(const A of z.fields)_.push(l("div",{class:"ee-list-item ee-field-item",style:{paddingLeft:z.key?"22px":"10px"},onDblclick:I=>{const{insideParens:K}=f(I),B=I;if(B.ctrlKey||B.metaKey){const L=A.fieldLabel||A.fieldKey;b(Ve(I),K?`"${L}"`:L,void 0,"");return}b(Ve(I),K?A.fieldKey:`{${A.fieldKey}}`,void 0,cp(A.fieldKey)?hp(A.fieldKey):"")}},[hr(A.fieldLabel||A.fieldKey,A.fieldKey,o),l("button",{type:"button",class:`ee-copy-btn${r.copiedFieldKey===A.fieldKey?" is-copied":""}`,"data-tip":r.copiedFieldKey===A.fieldKey?P("expression.k28"):`复制字段名「${A.fieldLabel}」`,"aria-label":`复制字段名 ${A.fieldLabel}`,html:op(r.copiedFieldKey===A.fieldKey?"Check":"Copy",13),onClick:I=>{I.stopPropagation(),u(I,A)},onDblclick:I=>I.stopPropagation()})]))}return _},c=S=>{Array.from(S.querySelectorAll(".ee-nav-tab")).forEach((K,B)=>K.classList.toggle("active",cr()[B]?.key===r.activeTab));const z=i(S,".ee-content-search .pd-input");if(z){const K=Xi()[r.activeTab];z.placeholder!==K&&(z.placeholder=K),z.value!==r.searchText&&(z.value=r.searchText)}const A=i(S,".ee-textarea");A&&A.value!==r.expression&&(A.value=r.expression);const I=i(S,".ee-content-list");if(I){cn(I);for(const K of d())Se(K,I)}n(S),s(S)};function u(S,_){const z=Ve(S);h.copyTextToClipboard(_.fieldLabel||_.fieldKey).then(A=>{A&&(r.copiedFieldKey=_.fieldKey,c(z),setTimeout(()=>{r.copiedFieldKey===_.fieldKey&&(r.copiedFieldKey="",c(z))},1200))})}const f=S=>{const z=i(Ve(S),".ee-textarea")?.selectionStart??r.expression.length;return pp(r.expression,z)},b=(S,_,z=_.length,A)=>{A!==void 0&&(r.keyHint=A);const I=i(S,".ee-textarea");if(!I){r.expression+=_,n(S),s(S);return}const K=I.selectionStart??r.expression.length,B=I.selectionEnd??K;r.expression=r.expression.substring(0,K)+_+r.expression.substring(B);const L=K+z;I.value=r.expression,I.focus(),I.selectionStart=I.selectionEnd=L,n(S),s(S)},m=()=>{const S=r.expression;if(r.binding===void 0){e.onApply({formatter:S}),e.onClose();return}const _=up(S,e.fields??[]);e.onApply(_?{formatter:S,binding:_.fieldKey,title:_.fieldLabel}:{formatter:S}),e.onClose()},E=l("div",{class:"ee-nav"},[l("div",{class:"ee-nav-title",text:P("expression.k29")}),l("div",{class:"ee-nav-tabs"},cr().map((S,_)=>l("div",{class:`ee-nav-tab${r.activeTab===S.key?" active":""}`,text:S.text,onClick:z=>{r.activeTab=cr()[_].key,c(Ve(z))}})))]),y=l("div",{class:"ee-content"},[l("div",{class:"ee-content-search"},[l("input",{class:"pd-input",placeholder:Xi()[r.activeTab],onInput:S=>{r.searchText=S.target.value,c(Ve(S))}})]),l("div",{class:"ee-content-list"},d())]),C=Zi(r.expression,e.demoData),D=l("div",{class:"ee-editor"},[l("div",{class:"ee-editor-section"},[l("div",{class:"ee-editor-title",text:P("expression.k30")}),l("textarea",{class:"ee-textarea",rows:6,placeholder:P("expression.k31"),text:r.expression,onInput:S=>{r.expression=S.target.value,r.keyHint="",n(Ve(S)),s(Ve(S))}}),l("div",{class:"pd-hint ee-key-hint",style:{display:"none",color:"var(--pd-accent, #165DFF)"},text:""})]),l("div",{class:"ee-editor-section"},[l("div",{class:"ee-editor-title",text:P("expression.k32")}),l("div",{class:`ee-preview${C===P(Tr)?" ee-preview-error":""}`,text:C})]),fp()]);return l("div",{class:"pd-dialog-overlay",onKeydown:S=>{S.key==="Escape"&&e.onClose()}},[l("section",{class:"pd-dialog pd-dialog-large",role:"dialog","aria-modal":"true","aria-labelledby":"expression-editor-title"},[l("header",{class:"pd-dialog-header"},[l("strong",{id:"expression-editor-title",text:P("expression.k33")}),l("button",{type:"button",class:"pd-close","aria-label":P("expression.k34"),text:"×",onClick:()=>e.onClose()})]),l("div",{class:"expression-editor"},[E,y,D]),l("footer",{class:"pd-dialog-footer"},[l("button",{type:"button",class:"pd-button",text:P("expression.k35"),onClick:()=>e.onClose()}),l("button",{type:"button",class:"pd-button primary",text:P("expression.k36"),onClick:()=>m()})])])])}const mp={id:"getting-started",title:"快速入门",content:`
|
|
4
4
|
<h2>界面布局</h2>
|
|
5
5
|
<p>打印模板设计器采用三栏布局:</p>
|
|
6
6
|
<ul>
|
|
@@ -464,6 +464,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
464
464
|
<p><strong>提示</strong>:水印配置保存在模板 JSON 的 <code>watermark</code> 字段中,仅对当前模板生效。</p>
|
|
465
465
|
</blockquote>
|
|
466
466
|
`},wp={id:"changelog",title:"更新记录",content:`
|
|
467
|
+
<h2>V1.6.3<small>(2026-11-24)</small></h2>
|
|
468
|
+
|
|
469
|
+
<h3>修复</h3>
|
|
470
|
+
<ul>
|
|
471
|
+
<li><strong>数据绑定串用</strong>:表格 demo 数据源缺失时不再回退到第一个数组;图表显式绑定数据源缺失时保持占位,字段下拉不再混入示例字段,避免条码与图表显示未绑定数据。</li>
|
|
472
|
+
</ul>
|
|
473
|
+
|
|
474
|
+
<h2>V1.6.2<small>(2026-11-23)</small></h2>
|
|
475
|
+
|
|
476
|
+
<h3>修复</h3>
|
|
477
|
+
<ul>
|
|
478
|
+
<li><strong>图表插件安装</strong>:修复插件市场命令行经 npx 调用静默空转、Git 源安装图表插件因缺语言资源失败的问题;经市场安装百度图表插件恢复可用。</li>
|
|
479
|
+
</ul>
|
|
480
|
+
|
|
467
481
|
<h2>V1.6.1<small>(2026-11-22)</small></h2>
|
|
468
482
|
|
|
469
483
|
<h3>新增</h3>
|
|
@@ -1252,6 +1266,20 @@ to keep a number of decimals use <code>ROUND</code> (half up), <code>ROUNDUP</co
|
|
|
1252
1266
|
<h2>Can I use charts and other custom elements?</h2>
|
|
1253
1267
|
<p>Yes. Optional plugins such as the ECharts chart pack register extra element types. Once installed, they appear in the asset panel and provide a "Custom Properties" tab when selected.</p>
|
|
1254
1268
|
`},Dp={id:"changelog",title:"Release Notes",content:`
|
|
1269
|
+
<h2>V1.6.3<small>(2026-11-24)</small></h2>
|
|
1270
|
+
|
|
1271
|
+
<h3>Fixed</h3>
|
|
1272
|
+
<ul>
|
|
1273
|
+
<li><strong>Data-binding fallbacks</strong>: table demo data sources no longer fall back to the first array when missing; charts keep the placeholder when an explicitly bound data source is absent, and field pickers no longer mix in sample-data fields.</li>
|
|
1274
|
+
</ul>
|
|
1275
|
+
|
|
1276
|
+
<h2>V1.6.2<small>(2026-11-23)</small></h2>
|
|
1277
|
+
|
|
1278
|
+
<h3>Fixed</h3>
|
|
1279
|
+
<ul>
|
|
1280
|
+
<li><strong>Chart plugin installation</strong>: fixed the marketplace CLI silently doing nothing when invoked via npx, and chart plugin installs from Git sources failing due to missing language resources; installing the Baidu chart plugin via the marketplace works again.</li>
|
|
1281
|
+
</ul>
|
|
1282
|
+
|
|
1255
1283
|
<h2>V1.6.1<small>(2026-11-22)</small></h2>
|
|
1256
1284
|
|
|
1257
1285
|
<h3>Added</h3>
|
|
@@ -1757,6 +1785,20 @@ to keep a number of decimals use <code>ROUND</code> (half up), <code>ROUNDUP</co
|
|
|
1757
1785
|
<h2>ฉันสามารถใช้แผนภูมิและองค์ประกอบกำหนดเองอื่นได้หรือไม่?</h2>
|
|
1758
1786
|
<p>ได้ ปลั๊กอินเสริมเช่นชุดแผนภูมิ ECharts จะลงทะเบียนประเภทองค์ประกอบเพิ่มเติม เมื่อติดตั้งแล้วจะปรากฏในแผงทรัพยากรและมีแท็บ "คุณสมบัติที่กำหนดเอง" เมื่อเลือก</p>
|
|
1759
1787
|
`},Fp={id:"changelog",title:"บันทึกการเปิดตัว",content:`
|
|
1788
|
+
<h2>V1.6.3<small>(2026-11-24)</small></h2>
|
|
1789
|
+
|
|
1790
|
+
<h3>แก้ไข</h3>
|
|
1791
|
+
<ul>
|
|
1792
|
+
<li><strong>การผูกข้อมูล</strong>: ตารางเดโมไม่กลับไปใช้อาร์เรย์ตัวแรกเมื่อไม่พบแหล่งข้อมูลที่ระบุ แผนภูมิคงตัวยึดตำแหน่งเมื่อแหล่งข้อมูลที่ผูกไว้ขาดหาย และรายการฟิลด์ไม่ผสมฟิลด์จากข้อมูลตัวอย่างอีกต่อไป</li>
|
|
1793
|
+
</ul>
|
|
1794
|
+
|
|
1795
|
+
<h2>V1.6.2<small>(2026-11-23)</small></h2>
|
|
1796
|
+
|
|
1797
|
+
<h3>แก้ไข</h3>
|
|
1798
|
+
<ul>
|
|
1799
|
+
<li><strong>การติดตั้งปลั๊กอินแผนภูมิ</strong>: แก้ไขปัญหาเครื่องมือ CLI ของตลาดปลั๊กอินไม่ทำงานเมื่อเรียกผ่าน npx และปัญหาการติดตั้งปลั๊กอินแผนภูมิจากแหล่ง Git ล้มเหลวเนื่องจากขาดทรัพยากรภาษา ตอนนี้การติดตั้งปลั๊กอินแผนภูมิ Baidu ผ่านตลาดปลั๊กอินกลับมาใช้งานได้แล้ว</li>
|
|
1800
|
+
</ul>
|
|
1801
|
+
|
|
1760
1802
|
<h2>V1.6.1<small>(2026-11-22)</small></h2>
|
|
1761
1803
|
|
|
1762
1804
|
<h3>เพิ่ม</h3>
|