PageSourceSearch

https://dillprint.web.app/chunk-D81930NI.js

js dillprint.web.app collected 2026-10-03 12:21:18 UTC 11,017 bytes, 1 lines download raw bytes

1import {h as h$1}from'./chunk-V1rXD-a0.js';import {dV as z,dW as rt,dX as k$1,dY as Fe,dZ as it,d_ as eH,d$ as fH,w,aN as Ee,G as re,T as Tt,K as ql,dB as ei,I as as,d4 as st,e0 as vD,e1 as O,d5 as x$1,e2 as de,cA as pn,e3 as hs,am as re$1,aR as ds,co as ie,e4 as bt,e5 as N$1,U as U$1,$ as $$1,dI as nr,e6 as qq}from'./main-O7VJ3WP5.js';function n$1(e){return JSON.parse(JSON.stringify(e))}var A=rt({source:"Template Designer/List",events:{"Load Templates":Fe(),"Load Templates Success":k$1(),"Load Templates Failure":k$1(),"Delete Template Confirmed":k$1(),"Delete Template Success":k$1()}}),D=rt({source:"Template Designer/Editor",events:{"Open Template":k$1(),"Add Element":k$1(),"Update Element":k$1(),"Move Element":k$1(),"Resize Element":k$1(),"Delete Element":Fe(),"Select Element":k$1(),Deselect:Fe(),"Set Paper Size":k$1(),"Set Template Name":k$1(),"Set Orientation":k$1(),Undo:Fe(),Redo:Fe(),"Set Zoom":k$1(),"Toggle Grid":Fe(),"Toggle Snap":Fe(),Publish:Fe(),"Publish Success":k$1(),"Publish Failure":k$1(),"Discard Changes":Fe()}});var _={templates:null,templatesLoading:false,templatesError:null,active:null,originalSnapshot:null,selectedElementIndex:null,past:[],future:[],zoom:1,showGrid:false,snapToGrid:true,gridSizeCm:.2,publishing:false,publishError:null},C="templateDesigner";var n=it(C),x=z(n,e=>e.templates),G=z(n,e=>e.templatesLoading),y=z(n,e=>e.templatesError),F$1=z(x,e=>e?Object.values(e):[]),g=z(n,e=>e.active),M=z(n,e=>e.originalSnapshot),S=z(n,e=>e.selectedElementIndex),N=z(g,S,(e,i)=>e&&i!==null?e.elements[i]??null:null),R=z(n,e=>e.zoom),v=z(n,e=>e.showGrid),U=z(n,e=>e.snapToGrid),k=z(n,e=>e.gridSizeCm),Z$1=z(n,e=>e.past.length>0),j=z(n,e=>e.future.length>0),H=z(n,e=>e.publishing),J=z(n,e=>e.publishError),K$1=z(g,e=>new Set(e?.elements.map(i=>i.id)??[])),W=z(g,M,(e,i)=>!e||!i?false:JSON.stringify(e)!==JSON.stringify(i));function q(e,i,l){let r=Math.min(e,i),m=Math.max(e,i);return l?{width:r,height:m}:{width:m,height:r}}function E(e,i){return {left:e.left<0,top:e.top<0,width:e.left+e.width>i.width,height:e.top+e.height>i.height}}function Q(e,i){let l=E(e,i);return l.left||l.top||l.width||l.height}function V(e,i){let r=Object.entries(T),m=a=>{let h=null;for(let[f,c]of a){let w=Math.max(Math.abs(c.widthCm-e),Math.abs(c.heightCm-i)),b=Math.max(Math.abs(c.widthCm-i),Math.abs(c.heightCm-e)),d=Math.min(w,b);d<=.15&&(!h||d<h.dist)&&(h={key:f,dist:d});}return h?h.key:null};return m(r.filter(([,a])=>a.heightCm>=a.widthCm))??m(r)}var T={mm50x100:{widthCm:5,heightCm:10,label:"50 \xD7 100mm",isContinuous:false},mm100x100:{widthCm:10,heightCm:10,label:"100 \xD7 100mm",isContinuous:false},mm51x51:{widthCm:5.1,heightCm:5.1,label:"50 \xD7 50mm",isContinuous:false},mm54x48:{widthCm:5.4,heightCm:4.8,label:"50 \xD7 50mm (alt)",isContinuous:false},mm58x110:{widthCm:5.8,heightCm:11,label:"58 \xD7 110mm",isContinuous:false},mm51x26:{widthCm:5.1,heightCm:2.6,label:"51 \xD7 26mm",isContinuous:false},mm54x132:{widthCm:5.4,heightCm:13.2,label:"54 \xD7 132mm",isContinuous:false},mm50x200:{widthCm:5,heightCm:20,label:"50 \xD7 200mm",isContinuous:false},mm35x70_p:{widthCm:3.5,heightCm:7,label:"Edge shelf 35 \xD7 70mm",isContinuous:false},mm48_25:{widthCm:4.8,heightCm:2.5,label:"48 \xD7 25mm",isContinuous:false},mm73x200:{widthCm:7.3,heightCm:20,label:"73 \xD7 200mm",isContinuous:false},mm44x60:{widthCm:4.4,heightCm:6,label:"44 \xD7 60mm",isContinuous:false},mm47x200:{widthCm:4.7,heightCm:20,label:"47 \xD7 200mm",isContinuous:false},in1x2:{widthCm:2.54,heightCm:5.08,label:"1 \xD7 2 inch",isContinuous:false}
1,in125x225:{widthCm:3.18,heightCm:5.72,label:"1.25 \xD7 2.25 inch",isContinuous:false},mm50w:{widthCm:5,heightCm:15,label:"Continuous roll 50mm",isContinuous:true},mm58w:{widthCm:5.8,heightCm:15,label:"Continuous roll 58mm",isContinuous:true},mm62w:{widthCm:6.2,heightCm:15,label:"Continuous roll 62mm",isContinuous:true},mm76w:{widthCm:7.6,heightCm:15,label:"Continuous roll 76mm",isContinuous:true},mm100w:{widthCm:10,heightCm:15,label:"Continuous roll 100mm",isContinuous:true}},X$1={title:{width:4.8,height:.9,fontSizeMM:6,textAlign:"center"},ingredients:{width:4.7,height:4,fontSizeMM:2.5,label:"<*Ingredients*> (Allergens in <*Bold*>):"},instruction:{width:4.7,height:1.5,fontSizeMM:2.5},instruction2:{width:4.7,height:1,fontSizeMM:2.5},description:{width:4.7,height:1.5,fontSizeMM:2.5},batch:{width:2,height:.5,fontSizeMM:2.5},address:{width:4.7,height:.7,fontSizeMM:2},web:{width:4.7,height:.5,fontSizeMM:2},price:{width:1.5,height:.7,fontSizeMM:3.5,textAlign:"center"},weight:{width:2,height:.5,fontSizeMM:2.5},detail:{width:4,height:.5,fontSizeMM:2.2},allergens:{width:4.7,height:.7,fontSizeMM:2.5},bestBefore:{width:2,height:.7,fontSizeMM:3,dateFormat:"dd/MM/yy"},bestBefore2:{width:2,height:.5,fontSizeMM:2.5,dateFormat:"dd/MM/yy HH:mm"},nutritional:{width:3.5,height:5,fontSizeMM:1.75,config:{type:"fda"}},barcode:{width:3,height:1},logo:{width:2,height:1,textAlign:"center"},static_img:{width:2,height:2},foodMarks:{width:2,height:.5}},$=["title","ingredients","instruction","instruction2","description","batch","address","web","price","logo","barcode","bestBefore","bestBefore2","weight","nutritional","detail"],ee={title:"Title",ingredients:"Ingredients",instruction:"Instruction 1",instruction2:"Instruction 2",description:"Description",batch:"Batch",address:"Address",web:"Website",price:"Price",logo:"Logo",foodMarks:"Food Marks",barcode:"Barcode",bestBefore:"Best Before",bestBefore2:"Best Before 2",weight:"Weight",nutritional:"Nutritional",detail:"Detail 1",static_img:"Static Image",allergens:"Allergens"};var K=(()=>{class e{constructor(){this.actions$=w(st),this.store=w(Ee),this.service=w(vD),this.loadTemplates$=O(()=>this.actions$.pipe(x$1(A.loadTemplates),de(()=>this.store.select(pn)),hs(([,i])=>i?this.service.getAllPositionTemplates(i).pipe(re$1(o=>A.loadTemplatesSuccess({templates:o})),ds(o=>as(A.loadTemplatesFailure({error:String(o)})))):as(A.loadTemplatesFailure({error:"No user"}))))),this.deleteTemplate$=O(()=>this.actions$.pipe(x$1(A.deleteTemplateConfirmed),de(()=>this.store.select(pn)),ql(([{key:i},o])=>o?this.service.deleteTemplateDesign(o,i).pipe(re$1(()=>A.deleteTemplateSuccess({key:i})),ds(()=>as())):as()))),this.publish$=O(()=>this.actions$.pipe(x$1(D.publish),de(()=>this.store.select(pn)),ql(([,i])=>i?this.store.select(g).pipe(Tt(1),ql(o=>o?this.service.saveTemplateDesign(i,o).pipe(re$1(()=>D.publishSuccess({template:o})),ds(p=>as(D.publishFailure({error:String(p)})))):as(D.publishFailure({error:"No template"})))):as(D.publishFailure({error:"No user"})))));}static{this.\u0275fac=function(o){return new(o||e)};}static{this.\u0275prov=ie({token:e,factory:e.\u0275fac});}}return e})();var F=50;function h(e){if(!e.active)return e;let t=[...e.past,e.active].slice(-F);return U$1($$1({},e),{past:t,future:[]})}var X=bt(_,N$1(A.loadTemplates,e=>U$1($$1({},e),{templatesLoading:true,templatesError:null})),N$1(A.loadTemplatesSuccess,(e,{templates:t})=>U$1($$1({},e),{templates:t,templatesLoading:false})),N$1(A.loadTemplatesFailure,(e,{error:t})=>U$1($$1({},e),{templatesLoading:false,templatesError:t})),N$1(A.deleteTemplateSuccess,(e,{key:t})=>{if(!e.templates)return e;let i=$$1({},e.templates);return delete i[t],U$1($$1({},e),{templates:i})}),N$1(D.openTemplate,(e,{template:t})=>U$1($$1({},e),{active:n$1(t),originalSnapshot:n$1(t),selectedElementIndex:null,past:[],future:[],publishError:null})),N$1(D.addElement,(e,{element:t})=>{if(!e.active)return e;let i=h(e),o=[...i.active.elements,t];return U$1($$1({},i),{active:U$1($$1({},i.active),{elements:o}),selectedElementIndex:o.length-1})}),N$1(D.updateElement,(e,{index:t,patch:i})=>{if(!e.active)return e;let o=h(e),p=o.active.elements.map((v,m)=>m===t?$$1($$1({},v),i):v);return U$1($$1({},o),{active:U$1($$1({},o.active),{elements:p})})}),N$1(D.moveElement,(e,{index:t,dx:i,dy:o})=>{if(!e.active)return e;let p=h(e),v=p.active.elements.map((m,E)=>E!==t?m:U$1($$1({},m),{left:nr(m.left+i),top:nr(m.top+o)}));return U$1($$1({},p),{active:U$1($$1({},p.active),{elements:v})})}),N$1(D.resizeElement,(e,{index:t,left:i,top:o,width:p,height:v,fontSizeMM:m})=>
1{if(!e.active)return e;let E=h(e),q=E.active.elements.map((G,B)=>B===t?$$1(U$1($$1({},G),{left:nr(i),top:nr(o),width:nr(qq(p,.2)),height:nr(qq(v,.2))}),m!==void 0?{fontSizeMM:m}:{}):G);return U$1($$1({},E),{active:U$1($$1({},E.active),{elements:q})})}),N$1(D.deleteElement,e=>{if(!e.active||e.selectedElementIndex===null)return e;let t=h(e),i=t.active.elements.filter((o,p)=>p!==e.selectedElementIndex);return U$1($$1({},t),{active:U$1($$1({},t.active),{elements:i}),selectedElementIndex:null})}),N$1(D.selectElement,(e,{index:t})=>U$1($$1({},e),{selectedElementIndex:t})),N$1(D.deselect,e=>U$1($$1({},e),{selectedElementIndex:null})),N$1(D.setPaperSize,(e,{paper:t,width:i,height:o})=>{if(!e.active)return e;let p=h(e);return U$1($$1({},p),{active:U$1($$1({},p.active),{paper:t,width:i,height:o})})}),N$1(D.setTemplateName,(e,{name:t})=>e.active?U$1($$1({},e),{active:U$1($$1({},e.active),{name:t})}):e),N$1(D.setOrientation,(e,{isPortrait:t})=>{if(!e.active)return e;let i=h(e),{width:o,height:p}=q(i.active.width,i.active.height,t);return U$1($$1({},i),{active:U$1($$1({},i.active),{isPortrait:t,width:o,height:p})})}),N$1(D.undo,e=>{if(!e.past.length||!e.active)return e;let t=[...e.past],i=t.pop();return U$1($$1({},e),{past:t,future:[e.active,...e.future].slice(0,F),active:n$1(i),selectedElementIndex:null})}),N$1(D.redo,e=>{if(!e.future.length||!e.active)return e;let t=[...e.future],i=t.shift();return U$1($$1({},e),{future:t,past:[...e.past,e.active].slice(-F),active:n$1(i),selectedElementIndex:null})}),N$1(D.setZoom,(e,{zoom:t})=>U$1($$1({},e),{zoom:t})),N$1(D.toggleGrid,e=>U$1($$1({},e),{showGrid:!e.showGrid})),N$1(D.toggleSnap,e=>U$1($$1({}
1,e),{snapToGrid:!e.snapToGrid})),N$1(D.publish,e=>U$1($$1({},e),{publishing:true,publishError:null})),N$1(D.publishSuccess,(e,{template:t})=>U$1($$1({},e),{publishing:false,originalSnapshot:n$1(t),past:[],future:[],templates:e.templates?U$1($$1({},e.templates),{[t.id]:t}):e.templates})),N$1(D.publishFailure,(e,{error:t})=>U$1($$1({},e),{publishing:false,publishError:t})),N$1(D.discardChanges,e=>U$1($$1({},e),{active:e.originalSnapshot?n$1(e.originalSnapshot):e.active,past:[],future:[],selectedElementIndex:null})));var Z=()=>{let e=w(Ee),t=w(re);return e.select(W).pipe(Tt(1),ql(i=>i?t.open(ei,{width:"400px",data:{title:"Unsaved changes",message:"You have unsaved changes. If you leave, your work will be lost."}}).afterClosed():as(true)))};var $e=[{path:"",canActivate:[h$1],providers:[eH(C,X),fH(K)],children:[{path:"",loadComponent:()=>import('./chunk-BVJa1RJR.js').then(e=>e.TemplateListComponent)},{path:"edit/:id",loadComponent:()=>import('./chunk-Baa14b3S.js').then(e=>e.TemplateEditorComponent),canDeactivate:[Z]}]}];var chunkNSRLDS4D=/*#__PURE__*/Object.freeze({__proto__:null,templateDesignerRoutes:$e});export{$,A,D,E,F$1 as F,G,H,J,K$1 as K,N,Q,R,S,T,U,V,W,X$1 as X,Z$1 as Z,chunkNSRLDS4D as c,ee as e,g,j,k,n$1 as n,q,v,x,y};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.