soliddesigner 0.1.2 → 0.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ import{$ as h,$a as ha,$b as hb,$c as hc,$d as hd,$e as he,$f as hf,$g as ig,$h as ih,$i as ii,Aa as I,Ab as Ia,Ac as Ib,Ad as Ic,Ae as Id,Af as Ie,Ag as Jf,Ah as Jg,Ai as Jh,Ba as J,Bb as Ja,Bc as Jb,Bd as Jc,Be as Jd,Bf as Je,Bg as Kf,Bh as Kg,Bi as Kh,Ca as K,Cb as Ka,Cc as Kb,Cd as Kc,Ce as Kd,Cf as Ke,Cg as Lf,Ch as Lg,Ci as Lh,Da as L,Db as La,Dc as Lb,Dd as Lc,De as Ld,Df as Le,Dg as Mf,Dh as Mg,Di as Mh,Ea as M,Eb as Ma,Ec as Mb,Ed as Mc,Ee as Md,Ef as Me,Eg as Nf,Eh as Ng,Ei as Nh,Fa as N,Fb as Na,Fc as Nb,Fd as Nc,Fe as Nd,Ff as Ne,Fg as Of,Fh as Og,Fi as Oh,Ga as O,Gb as Oa,Gc as Ob,Gd as Oc,Ge as Od,Gf as Oe,Gg as Pf,Gh as Pg,Gi as Ph,Ha as P,Hb as Pa,Hc as Pb,Hd as Pc,He as Pd,Hf as Pe,Hg as Qf,Hh as Qg,Hi as Qh,Ia as Q,Ib as Qa,Ic as Qb,Id as Qc,Ie as Qd,If as Qe,Ig as Rf,Ih as Rg,Ii as Rh,Ja as R,Jb as Ra,Jc as Rb,Jd as Rc,Je as Rd,Jf as Re,Jg as Sf,Jh as Sg,Ji as Sh,Ka as S,Kb as Sa,Kc as Sb,Kd as Sc,Ke as Sd,Kf as Se,Kg as Tf,Kh as Tg,Ki as Th,La as T,Lb as Ta,Lc as Tb,Ld as Tc,Le as Td,Lf as Te,Lg as Uf,Lh as Ug,Li as Uh,Ma as U,Mb as Ua,Mc as Ub,Md as Uc,Me as Ud,Mf as Ue,Mg as Vf,Mh as Vg,Mi as Vh,Na as V,Nb as Va,Nc as Vb,Nd as Vc,Ne as Vd,Nf as Ve,Ng as Wf,Nh as Wg,Ni as Wh,Oa as W,Ob as Wa,Oc as Wb,Od as Wc,Oe as Wd,Of as We,Og as Xf,Oh as Xg,Oi as Xh,Pa as X,Pb as Xa,Pc as Xb,Pd as Xc,Pe as Xd,Pf as Xe,Pg as Yf,Ph as Yg,Pi as Yh,Qa as Y,Qb as Ya,Qc as Yb,Qd as Yc,Qe as Yd,Qf as Ye,Qg as Zf,Qh as Zg,Qi as Zh,Ra as Z,Rb as Za,Rc as Zb,Rd as Zc,Re as Zd,Rf as Ze,Rg as _f,Rh as _g,Ri as _h,Sa as _,Sb as _a,Sc as _b,Sd as _c,Se as _d,Sf as _e,Sg as $f,Sh as $g,Si as $h,Ta as $,Tb as $a,Tc as $b,Td as $c,Te as $d,Tf as $e,Tg as ag,Th as ah,Ti as ai,Ua as aa,Ub as ab,Uc as ac,Ud as ad,Ue as ae,Uf as af,Ug as bg,Uh as bh,Ui as bi,Va as ba,Vb as bb,Vc as bc,Vd as bd,Ve as be,Vf as bf,Vg as cg,Vh as ch,Vi as ci,Wa as ca,Wb as cb,Wc as cc,Wd as cd,We as ce,Wf as cf,Wg as dg,Wh as dh,Wi as di,X as d,Xa as da,Xb as db,Xc as dc,Xd as dd,Xe as de,Xf as df,Xg as eg,Xh as eh,Xi as ei,Y as e,Ya as ea,Yb as eb,Yc as ec,Yd as ed,Ye as ee,Yf as ef,Yg as fg,Yh as fh,Yi as fi,Z as f,Za as fa,Zb as fb,Zc as fc,Zd as fd,Ze as fe,Zf as ff,Zg as gg,Zh as gh,Zi as gi,_ as g,_a as ga,_b as gb,_c as gc,_d as gd,_e as ge,_f as gf,_g as hg,_h as hh,_i as hi,aa as i,ab as ia,ac as ib,ad as ic,ae as id,af as ie,ag as jf,ah as jg,ai as jh,aj as ji,ba as j,bb as ja,bc as jb,bd as jc,be as jd,bf as je,bg as kf,bh as kg,bi as kh,bj as ki,ca as k,cb as ka,cc as kb,cd as kc,ce as kd,cf as ke,cg as lf,ch as lg,ci as lh,cj as li,da as l,db as la,dc as lb,dd as lc,de as ld,df as le,dg as mf,dh as mg,di as mh,dj as mi,ea as m,eb as ma,ec as mb,ed as mc,ee as md,ef as me,eg as nf,eh as ng,ei as nh,ej as ni,f as a,fa as n,fb as na,fc as nb,fd as nc,fe as nd,ff as ne,fg as of,fh as og,fi as oh,fj as oi,g as b,ga as o,gb as oa,gc as ob,gd as oc,ge as od,gf as oe,gg as pf,gh as pg,gi as ph,gj as pi,h as c,ha as p,hb as pa,hc as pb,hd as pc,he as pd,hf as pe,hg as qf,hh as qg,hi as qh,hj as qi,ia as q,ib as qa,ic as qb,id as qc,ie as qd,if as qe,ig as rf,ih as rg,ii as rh,ij as ri,ja as r,jb as ra,jc as rb,jd as rc,je as rd,jf as re,jg as sf,jh as sg,ji as sh,jj as si,ka as s,kb as sa,kc as sb,kd as sc,ke as sd,kf as se,kg as tf,kh as tg,ki as th,kj as ti,la as t,lb as ta,lc as tb,ld as tc,le as td,lf as te,lg as uf,lh as ug,li as uh,ma as u,mb as ua,mc as ub,md as uc,me as ud,mf as ue,mg as vf,mh as vg,mi as vh,na as v,nb as va,nc as vb,nd as vc,ne as vd,nf as ve,ng as wf,nh as wg,ni as wh,oa as w,ob as wa,oc as wb,od as wc,oe as wd,of as we,og as xf,oh as xg,oi as xh,pa as x,pb as xa,pc as xb,pd as xc,pe as xd,pf as xe,pg as yf,ph as yg,pi as yh,qa as y,qb as ya,qc as yb,qd as yc,qe as yd,qf as ye,qg as zf,qh as zg,qi as zh,ra as z,rb as za,rc as zb,rd as zc,re as zd,rf as ze,rg as Af,rh as Ag,ri as Ah,sa as A,sb as Aa,sc as Ab,sd as Ac,se as Ad,sf as Ae,sg as Bf,sh as Bg,si as Bh,ta as B,tb as Ba,tc as Bb,td as Bc,te as Bd,tf as Be,tg as Cf,th as Cg,ti as Ch,ua as C,ub as Ca,uc as Cb,ud as Cc,ue as Cd,uf as Ce,ug as Df,uh as Dg,ui as Dh,va as D,vb as Da,vc as Db,vd as Dc,ve as Dd,vf as De,vg as Ef,vh as Eg,vi as Eh,wa as E,wb as Ea,wc as Eb,wd as Ec,we as Ed,wf as Ee,wg as Ff,wh as Fg,wi as Fh,xa as F,xb as Fa,xc as Fb,xd as Fc,xe as Fd,xf as Fe,xg as Gf,xh as Gg,xi as Gh,ya as G,yb as Ga,yc as Gb,yd as Gc,ye as Gd,yf as Ge,yg as Hf,yh as Hg,yi as Hh,za as H,zb as Ha,zc as Hb,zd as Hc,ze as Hd,zf as He,zg as If,zh as Ig,zi as Ih}from"./chunk-B3PWEOJU.js";export{Wa as ANIMATION_MODULE_TYPE,qd as APP_BOOTSTRAP_LISTENER,Sa as APP_ID,nd as APP_INITIALIZER,hb as AfterRenderPhase,pd as ApplicationInitStatus,Hh as ApplicationModule,td as ApplicationRef,ma as Attribute,Tg as COMPILER_OPTIONS,Xa as CSP_NONCE,tb as CUSTOM_ELEMENTS_SCHEMA,La as ChangeDetectionStrategy,sh as ChangeDetectorRef,Sg as Compiler,Ug as CompilerFactory,Ig as Component,cc as ComponentFactory,dc as ComponentFactoryResolver,bc as ComponentRef,xc as ContentChild,wc as ContentChildren,ah as DEFAULT_CURRENCY_CODE,zh as DebugElement,wh as DebugEventListener,yh as DebugNode,Bh as DefaultIterableDiffer,sa as DestroyRef,Hg as Directive,M as ENVIRONMENT_INITIALIZER,Ga as ElementRef,vh as EmbeddedViewRef,U as EnvironmentInjector,Aa as ErrorHandler,xa as EventEmitter,ra as HOST_TAG_NAME,L as Host,qa as HostAttributeToken,Mg as HostBinding,Ng as HostListener,N as INJECTOR,H as Inject,C as InjectFlags,na as Injectable,u as InjectionToken,pa as Injector,Kg as Input,Ch as IterableDiffers,Dh as KeyValueDiffers,$g as LOCALE_ID,dh as MissingTranslationStrategy,Rg as ModuleWithComponentFactories,ub as NO_ERRORS_SCHEMA,Og as NgModule,Hc as NgModuleFactory,Gc as NgModuleRef,sd as NgProbeToken,ya as NgZone,I as Optional,Lg as Output,Ca as OutputEmitterRef,Va as PACKAGE_ROOT_URL,Ua as PLATFORM_ID,Ta as PLATFORM_INITIALIZER,wa as PendingTasks,Jg as Pipe,fh as PlatformRef,vc as Query,Ka as QueryList,ri as REQUEST,ti as REQUEST_CONTEXT,si as RESPONSE_INIT,fc as Renderer2,ec as RendererFactory2,Yb as RendererStyleFlags2,$h as ResourceStatus,gc as Sanitizer,Jb as SecurityContext,J as Self,aa as SimpleChange,K as SkipSelf,bh as TRANSLATIONS,ch as TRANSLATIONS_FORMAT,ac as TemplateRef,hd as Testability,id as TestabilityRegistry,$a as TransferState,Z as Type,Qg as VERSION,Pg as Version,zc as ViewChild,yc as ViewChildren,pc as ViewContainerRef,sb as ViewEncapsulation,uh as ViewRef,kb as afterNextRender,jb as afterRender,ni as afterRenderEffect,xh as asNativeElements,X as assertInInjectionContext,gb as assertNotInReactiveContext,ih as assertPlatform,Ph as booleanAttribute,Xh as computed,sc as contentChild,tc as contentChildren,oi as createComponent,Mc as createEnvironmentInjector,Ic as createNgModule,Jc as createNgModuleRef,gh as createPlatform,hh as createPlatformFactory,o as defineInjectable,kh as destroyPlatform,_h as effect,ph as enableProdMode,l as forwardRef,Ah as getDebugNode,qh as getModuleFactory,rh as getNgModuleById,jh as getPlatform,S as importProvidersFrom,F as inject,Fa as input,oh as isDevMode,Ha as isSignal,P as isStandalone,ai as linkedSignal,Q as makeEnvironmentProviders,_a as makeStateKey,qi as mergeApplicationConfig,uc as model,Qh as numberAttribute,Ea as output,Gh as platformCore,od as provideAppInitializer,R as provideEnvironmentInitializer,nh as provideExperimentalCheckNoChangesForDebug,_g as provideExperimentalZonelessChangeDetection,mh as providePlatformInitializer,Yg as provideZoneChangeDetection,pi as reflectComponentType,m as resolveForwardRef,bi as resource,W as runInInjectionContext,jd as setTestabilityGetter,Ja as signal,Wh as untracked,qc as viewChild,rc as viewChildren,ib as \u0275AfterRenderManager,Lh as \u0275CLIENT_RENDER_MODE_FLAG,$ as \u0275CONTAINER_HEADER_OFFSET,ta as \u0275ChangeDetectionScheduler,Zg as \u0275ChangeDetectionSchedulerImpl,cc as \u0275ComponentFactory,cd as \u0275Console,Ke as \u0275DEFAULT_LOCALE_ID,Yc as \u0275DEFER_BLOCK_CONFIG,Xc as \u0275DEFER_BLOCK_DEPENDENCY_INTERCEPTOR,ob as \u0275DEHYDRATED_BLOCK_REGISTRY,mb as \u0275DeferBlockBehavior,lb as \u0275DeferBlockState,eh as \u0275ENABLE_ROOT_COMPONENT_BOOTSTRAP,kd as \u0275EffectScheduler,qb as \u0275HydrationStatus,Za as \u0275IMAGE_CONFIG,Ya as \u0275IMAGE_CONFIG_DEFAULTS,T as \u0275INJECTOR_SCOPE,g as \u0275INPUT_SIGNAL_BRAND_WRITE_TYPE,Ba as \u0275INTERNAL_APPLICATION_ERROR_HANDLER,ab as \u0275IS_HYDRATION_DOM_REUSE_ENABLED,bb as \u0275IS_INCREMENTAL_HYDRATION_ENABLED,cb as \u0275JSACTION_BLOCK_ELEMENT_MAP,nb as \u0275JSACTION_EVENT_CONTRACT,Ma as \u0275LContext,Je as \u0275LocaleDataIndex,Yh as \u0275MicrotaskEffectScheduler,x as \u0275NG_COMP_DEF,y as \u0275NG_DIR_DEF,B as \u0275NG_ELEMENT_ID,t as \u0275NG_INJ_DEF,A as \u0275NG_MOD_DEF,z as \u0275NG_PIPE_DEF,s as \u0275NG_PROV_DEF,kc as \u0275NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR,Wb as \u0275NO_CHANGE,Lc as \u0275NgModuleFactory,za as \u0275NoopNgZone,Rh as \u0275PERFORMANCE_MARK_PREFIX,Wg as \u0275PROVIDED_NG_ZONE,va as \u0275PendingTasksInternal,V as \u0275R3Injector,_ as \u0275ReflectionCapabilities,nc as \u0275Render3ComponentFactory,oc as \u0275Render3ComponentRef,Kc as \u0275Render3NgModuleRef,ci as \u0275ResourceImpl,e as \u0275RuntimeError,a as \u0275SIGNAL,pb as \u0275SSR_CONTENT_INTEGRITY_MARKER,fd as \u0275TESTABILITY,gd as \u0275TESTABILITY_GETTER,Wc as \u0275TimerScheduler,db as \u0275TracingAction,eb as \u0275TracingService,ic as \u0275USE_RUNTIME_DEPS_TRACKER_FOR_JIT,Zb as \u0275ViewRef,d as \u0275XSS_SECURITY_URL,ua as \u0275ZONELESS_ENABLED,Ib as \u0275_sanitizeHtml,Hb as \u0275_sanitizeUrl,Ab as \u0275allowSanitizationBypassAndThrow,Kh as \u0275annotateForHydration,Cb as \u0275bypassSanitizationTrustHtml,Gb as \u0275bypassSanitizationTrustResourceUrl,Eb as \u0275bypassSanitizationTrustScript,Db as \u0275bypassSanitizationTrustStyle,Fb as \u0275bypassSanitizationTrustUrl,Cc as \u0275clearResolutionOfComponentResourcesQueue,Eg as \u0275compileComponent,Fg as \u0275compileDirective,yg as \u0275compileNgModule,zg as \u0275compileNgModuleDefs,Vg as \u0275compileNgModuleFactory,Gg as \u0275compilePipe,G as \u0275convertToBitFlags,oa as \u0275createInjector,lh as \u0275createOrReusePlatformInjector,Eh as \u0275defaultIterableDiffers,Fh as \u0275defaultKeyValueDiffers,jc as \u0275depsTracker,ud as \u0275detectChangesInViewIfRequired,Uc as \u0275devModeEqual,Vh as \u0275disableProfiling,Uh as \u0275enableProfiling,Fe as \u0275findLocaleData,xg as \u0275flushModuleScopingQueueAsMuchAsPossible,f as \u0275formatRuntimeError,Ag as \u0275generateStandaloneInDeclarationsError,$c as \u0275getAsyncClassMetadataFn,di as \u0275getClosestComponentName,O as \u0275getComponentDef,Ah as \u0275getDebugNode,dd as \u0275getDeferBlocks,Oa as \u0275getDirectives,Ra as \u0275getDocument,Pa as \u0275getHostElement,q as \u0275getInjectableDef,Na as \u0275getLContext,Ge as \u0275getLocaleCurrencyCode,He as \u0275getLocalePluralCase,Da as \u0275getOutputDestroyRef,Bb as \u0275getSanitizationBypassType,wb as \u0275getUnknownElementStrictMode,yb as \u0275getUnknownPropertyStrictMode,i as \u0275global,th as \u0275injectChangeDetectorRef,Ih as \u0275internalCreateApplication,Xg as \u0275internalProvideZoneChangeDetection,rd as \u0275isBoundToModule,Bc as \u0275isComponentDefPendingResolution,w as \u0275isEnvironmentProviders,r as \u0275isInjectable,hc as \u0275isNgModule,ld as \u0275isPromise,md as \u0275isSubscribable,_b as \u0275isViewDirty,$b as \u0275markForRefresh,Zh as \u0275microtaskEffect,h as \u0275noSideEffects,Cg as \u0275patchComponentDefWithScope,fb as \u0275performanceMarkFeature,ed as \u0275publishExternalGlobalUtil,rb as \u0275readHydrationInfo,Ee as \u0275registerLocaleData,Zc as \u0275renderDeferBlockState,Bg as \u0275resetCompiledComponents,wg as \u0275resetJitOptions,Ac as \u0275resolveComponentResources,Dc as \u0275restoreComponentResolutionQueue,Fc as \u0275setAllowDuplicateNgModuleIdsForTest,b as \u0275setAlternateWeakRefImpl,tg as \u0275setClassDebugInfo,bd as \u0275setClassMetadata,ad as \u0275setClassMetadataAsync,c as \u0275setCurrentInjector,Qa as \u0275setDocument,v as \u0275setInjectorProfilerContext,Le as \u0275setLocaleId,vb as \u0275setUnknownElementStrictMode,xb as \u0275setUnknownPropertyStrictMode,Sh as \u0275startMeasuring,Th as \u0275stopMeasuring,ca as \u0275store,j as \u0275stringify,Dg as \u0275transitiveScopesFor,vd as \u0275triggerResourceLoading,k as \u0275truncateMiddle,Ie as \u0275unregisterLocaleData,zb as \u0275unwrapSafeValue,Ia as \u0275unwrapWritableSignal,Mh as \u0275withDomHydration,Jh as \u0275withEventReplay,Nh as \u0275withI18nSupport,Oh as \u0275withIncrementalHydration,Sc as \u0275\u0275CopyDefinitionFeature,_f as \u0275\u0275ExternalStylesFeature,Y as \u0275\u0275FactoryTarget,Tc as \u0275\u0275HostDirectivesFeature,Rc as \u0275\u0275InheritDefinitionFeature,ba as \u0275\u0275NgOnChangesFeature,Zf as \u0275\u0275ProvidersFeature,Xb as \u0275\u0275advance,Yf as \u0275\u0275attachSourceLocations,Td as \u0275\u0275attribute,Ud as \u0275\u0275attributeInterpolate1,Vd as \u0275\u0275attributeInterpolate2,Wd as \u0275\u0275attributeInterpolate3,Xd as \u0275\u0275attributeInterpolate4,Yd as \u0275\u0275attributeInterpolate5,Zd as \u0275\u0275attributeInterpolate6,_d as \u0275\u0275attributeInterpolate7,$d as \u0275\u0275attributeInterpolate8,ae as \u0275\u0275attributeInterpolateV,fe as \u0275\u0275classMap,ge as \u0275\u0275classMapInterpolate1,he as \u0275\u0275classMapInterpolate2,ie as \u0275\u0275classMapInterpolate3,je as \u0275\u0275classMapInterpolate4,ke as \u0275\u0275classMapInterpolate5,le as \u0275\u0275classMapInterpolate6,me as \u0275\u0275classMapInterpolate7,ne as \u0275\u0275classMapInterpolate8,oe as \u0275\u0275classMapInterpolateV,de as \u0275\u0275classProp,pe as \u0275\u0275componentInstance,qe as \u0275\u0275conditional,gf as \u0275\u0275contentQuery,lf as \u0275\u0275contentQuerySignal,Vf as \u0275\u0275declareLet,wd as \u0275\u0275defer,_c as \u0275\u0275deferEnableTimerScheduling,Ad as \u0275\u0275deferHydrateNever,Md as \u0275\u0275deferHydrateOnHover,Dd as \u0275\u0275deferHydrateOnIdle,Gd as \u0275\u0275deferHydrateOnImmediate,Pd as \u0275\u0275deferHydrateOnInteraction,Jd as \u0275\u0275deferHydrateOnTimer,Sd as \u0275\u0275deferHydrateOnViewport,zd as \u0275\u0275deferHydrateWhen,Kd as \u0275\u0275deferOnHover,Bd as \u0275\u0275deferOnIdle,Ed as \u0275\u0275deferOnImmediate,Nd as \u0275\u0275deferOnInteraction,Hd as \u0275\u0275deferOnTimer,Qd as \u0275\u0275deferOnViewport,Ld as \u0275\u0275deferPrefetchOnHover,Cd as \u0275\u0275deferPrefetchOnIdle,Fd as \u0275\u0275deferPrefetchOnImmediate,Od as \u0275\u0275deferPrefetchOnInteraction,Id as \u0275\u0275deferPrefetchOnTimer,Rd as \u0275\u0275deferPrefetchOnViewport,yd as \u0275\u0275deferPrefetchWhen,xd as \u0275\u0275deferWhen,Nc as \u0275\u0275defineComponent,Pc as \u0275\u0275defineDirective,n as \u0275\u0275defineInjectable,p as \u0275\u0275defineInjector,Oc as \u0275\u0275defineNgModule,Qc as \u0275\u0275definePipe,lc as \u0275\u0275directiveInject,ea as \u0275\u0275disableBindings,xe as \u0275\u0275element,Ae as \u0275\u0275elementContainer,ze as \u0275\u0275elementContainerEnd,ye as \u0275\u0275elementContainerStart,we as \u0275\u0275elementEnd,ve as \u0275\u0275elementStart,da as \u0275\u0275enableBindings,sg as \u0275\u0275getComponentDepsFactory,Be as \u0275\u0275getCurrentView,ka as \u0275\u0275getInheritedFactory,ug as \u0275\u0275getReplaceMetadataURL,Ce as \u0275\u0275hostProperty,Oe as \u0275\u0275i18n,Re as \u0275\u0275i18nApply,Pe as \u0275\u0275i18nAttributes,Ne as \u0275\u0275i18nEnd,Qe as \u0275\u0275i18nExp,Se as \u0275\u0275i18nPostprocess,Me as \u0275\u0275i18nStart,D as \u0275\u0275inject,la as \u0275\u0275injectAttribute,mc as \u0275\u0275invalidFactory,E as \u0275\u0275invalidFactoryDep,Te as \u0275\u0275listener,kf as \u0275\u0275loadQuery,ja as \u0275\u0275namespaceHTML,ia as \u0275\u0275namespaceMathML,ha as \u0275\u0275namespaceSVG,Ve as \u0275\u0275nextContext,fi as \u0275\u0275ngDeclareClassMetadata,gi as \u0275\u0275ngDeclareClassMetadataAsync,hi as \u0275\u0275ngDeclareComponent,ei as \u0275\u0275ngDeclareDirective,ii as \u0275\u0275ngDeclareFactory,ji as \u0275\u0275ngDeclareInjectable,ki as \u0275\u0275ngDeclareInjector,li as \u0275\u0275ngDeclareNgModule,mi as \u0275\u0275ngDeclarePipe,lg as \u0275\u0275pipe,mg as \u0275\u0275pipeBind1,ng as \u0275\u0275pipeBind2,og as \u0275\u0275pipeBind3,pg as \u0275\u0275pipeBind4,qg as \u0275\u0275pipeBindV,Xe as \u0275\u0275projection,We as \u0275\u0275projectionDef,be as \u0275\u0275property,Ye as \u0275\u0275propertyInterpolate,Ze as \u0275\u0275propertyInterpolate1,_e as \u0275\u0275propertyInterpolate2,$e as \u0275\u0275propertyInterpolate3,af as \u0275\u0275propertyInterpolate4,bf as \u0275\u0275propertyInterpolate5,cf as \u0275\u0275propertyInterpolate6,df as \u0275\u0275propertyInterpolate7,ef as \u0275\u0275propertyInterpolate8,ff as \u0275\u0275propertyInterpolateV,bg as \u0275\u0275pureFunction0,cg as \u0275\u0275pureFunction1,dg as \u0275\u0275pureFunction2,eg as \u0275\u0275pureFunction3,fg as \u0275\u0275pureFunction4,gg as \u0275\u0275pureFunction5,hg as \u0275\u0275pureFunction6,ig as \u0275\u0275pureFunction7,jg as \u0275\u0275pureFunction8,kg as \u0275\u0275pureFunctionV,nf as \u0275\u0275queryAdvance,jf as \u0275\u0275queryRefresh,Xf as \u0275\u0275readContextLet,of as \u0275\u0275reference,Ec as \u0275\u0275registerNgModuleType,ue as \u0275\u0275repeater,te as \u0275\u0275repeaterCreate,se as \u0275\u0275repeaterTrackByIdentity,re as \u0275\u0275repeaterTrackByIndex,vg as \u0275\u0275replaceMetadata,ga as \u0275\u0275resetView,Vb as \u0275\u0275resolveBody,Ub as \u0275\u0275resolveDocument,Tb as \u0275\u0275resolveWindow,fa as \u0275\u0275restoreView,Kb as \u0275\u0275sanitizeHtml,Nb as \u0275\u0275sanitizeResourceUrl,Ob as \u0275\u0275sanitizeScript,Lb as \u0275\u0275sanitizeStyle,Mb as \u0275\u0275sanitizeUrl,Rb as \u0275\u0275sanitizeUrlOrResourceUrl,$f as \u0275\u0275setComponentScope,ag as \u0275\u0275setNgModuleScope,Wf as \u0275\u0275storeLet,ee as \u0275\u0275styleMap,pf as \u0275\u0275styleMapInterpolate1,qf as \u0275\u0275styleMapInterpolate2,rf as \u0275\u0275styleMapInterpolate3,sf as \u0275\u0275styleMapInterpolate4,tf as \u0275\u0275styleMapInterpolate5,uf as \u0275\u0275styleMapInterpolate6,vf as \u0275\u0275styleMapInterpolate7,wf as \u0275\u0275styleMapInterpolate8,xf as \u0275\u0275styleMapInterpolateV,ce as \u0275\u0275styleProp,yf as \u0275\u0275stylePropInterpolate1,zf as \u0275\u0275stylePropInterpolate2,Af as \u0275\u0275stylePropInterpolate3,Bf as \u0275\u0275stylePropInterpolate4,Cf as \u0275\u0275stylePropInterpolate5,Df as \u0275\u0275stylePropInterpolate6,Ef as \u0275\u0275stylePropInterpolate7,Ff as \u0275\u0275stylePropInterpolate8,Gf as \u0275\u0275stylePropInterpolateV,Ue as \u0275\u0275syntheticHostListener,De as \u0275\u0275syntheticHostProperty,Vc as \u0275\u0275template,rg as \u0275\u0275templateRefExtractor,Hf as \u0275\u0275text,If as \u0275\u0275textInterpolate,Jf as \u0275\u0275textInterpolate1,Kf as \u0275\u0275textInterpolate2,Lf as \u0275\u0275textInterpolate3,Mf as \u0275\u0275textInterpolate4,Nf as \u0275\u0275textInterpolate5,Of as \u0275\u0275textInterpolate6,Pf as \u0275\u0275textInterpolate7,Qf as \u0275\u0275textInterpolate8,Rf as \u0275\u0275textInterpolateV,Pb as \u0275\u0275trustConstantHtml,Qb as \u0275\u0275trustConstantResourceUrl,Tf as \u0275\u0275twoWayBindingSet,Uf as \u0275\u0275twoWayListener,Sf as \u0275\u0275twoWayProperty,Sb as \u0275\u0275validateAttribute,hf as \u0275\u0275viewQuery,mf as \u0275\u0275viewQuerySignal};
@@ -0,0 +1 @@
1
+ import{A as S,E as X,I as W,R as Y,T as I,U as q,V as J,m as k,y as R}from"./chunk-T55JQPIL.js";import{$a as V,Bb as x,Ec as N,Fd as C,Lf as c,Nd as y,Nf as l,Oi as M,Pc as d,Ri as b,Ve as _,Xe as H,Za as p,_a as m,a as E,b as L,bb as B,ch as $,dh as j,if as w,kf as F,lf as U,mf as A,nf as o,of as s,pb as h,pf as u,tf as z,xa as g,yg as f,zg as v}from"./chunk-B3PWEOJU.js";var D=class a{index;imageUrl;isCurrent=!1;selectPage=new h;dragStarted=new h;dropped=new h;contextMenuEvent=new h;dragOver=!1;dropSide=null;saveService=g(I);cacheBuster="";constructor(){b(()=>{let e=this.saveService.saveSuccessPulse(),t=typeof e=="object"?e.count:e;this.isCurrent&&t>0&&(this.cacheBuster=`t=${t}`)})}get displayImageUrl(){if(!this.cacheBuster||!this.imageUrl)return this.imageUrl;let e=this.imageUrl.includes("?")?"&":"?";return`${this.imageUrl}${e}${this.cacheBuster}`}onDragStart(e){this.dragStarted.emit(this.index),e.dataTransfer&&(e.dataTransfer.effectAllowed="move")}onDragOver(e){e.preventDefault(),this.dragOver=!0;let t=e.currentTarget.getBoundingClientRect(),i=t.left+t.width/2;this.dropSide=e.clientX<i?"before":"after"}onDrop(e){e.preventDefault(),this.dropSide&&this.dropped.emit({targetIndex:this.index,side:this.dropSide}),this.onDragEnd()}onDragLeave(){this.dragOver=!1,this.dropSide=null}onDragEnd(){this.dragOver=!1,this.dropSide=null}onContextMenu(e){e.preventDefault(),this.contextMenuEvent.emit({event:e,index:this.index})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=C({type:a,selectors:[["app-page-grid-item"]],inputs:{index:"index",imageUrl:"imageUrl",isCurrent:"isCurrent"},outputs:{selectPage:"selectPage",dragStarted:"dragStarted",dropped:"dropped",contextMenuEvent:"contextMenuEvent"},decls:4,vars:8,consts:[["draggable","true",1,"page-grid-item",3,"dragstart","dragover","dragleave","drop","dragend","click","contextmenu"],["alt","Page Thumbnail","loading","lazy",1,"page-image",3,"src"],[1,"page-number"]],template:function(t,i){t&1&&(o(0,"div",0),c("dragstart",function(r){return i.onDragStart(r)})("dragover",function(r){return i.onDragOver(r)})("dragleave",function(){return i.onDragLeave()})("drop",function(r){return i.onDrop(r)})("dragend",function(){return i.onDragEnd()})("click",function(){return i.selectPage.emit(i.index)})("contextmenu",function(r){return i.onContextMenu(r)}),u(1,"img",1),o(2,"span",2),f(3),s()()),t&2&&(H("current",i.isCurrent)("drag-before",i.dragOver&&i.dropSide==="before")("drag-after",i.dragOver&&i.dropSide==="after"),d(),_("src",i.displayImageUrl,N),d(2),v(i.index+1))},dependencies:[k,S],styles:[`[_nghost-%COMP%]{display:block}.page-grid-item[_ngcontent-%COMP%]{background-color:var(--gray-4);border-radius:var(--radius-xs);padding:var(--spacing-xs);display:flex;flex-direction:column;gap:var(--spacing-xs);width:144px;height:220px;border:1px solid var(--gray-3);align-items:center;cursor:move;margin:0;position:relative;transition:transform .2s,background-color .2s;box-sizing:border-box}.page-grid-item[_ngcontent-%COMP%]:hover{transform:scale(1.05);background-color:var(--gray-3)}.page-grid-item.current[_ngcontent-%COMP%]{border-color:var(--active)}.page-image[_ngcontent-%COMP%]{background-color:#fff;border-radius:0;pointer-events:none;height:calc(100% - 2 * var(--spacing-xs) - 15px);width:auto;max-width:100%;object-fit:contain}.page-number[_ngcontent-%COMP%]{font-size:10px;color:var(--white)}.page-grid-item[_ngcontent-%COMP%]:before, .page-grid-item[_ngcontent-%COMP%]:after{content:"";position:absolute;top:0;bottom:0;width:4px;background:var(--active);z-index:100;opacity:0;transition:opacity .2s;border-radius:2px}.page-grid-item.drag-before[_ngcontent-%COMP%]:before{left:-4px;opacity:1}.page-grid-item.drag-after[_ngcontent-%COMP%]:after{right:-4px;opacity:1}[_nghost-%COMP%]:nth-child(odd) .page-grid-item[_ngcontent-%COMP%]{margin:0!important;border-right:0!important;border-top-right-radius:0;border-bottom-right-radius:0;box-shadow:2px 0 5px #0003}[_nghost-%COMP%]:nth-child(odd) .page-image[_ngcontent-%COMP%]{margin-left:auto;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3e %3cline x1='100%25' y1='0' x2='100%25' y2='20' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='26' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='34' x2='100%25' y2='54' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='60' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='68' x2='100%25' y2='88' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='64' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='102' x2='100%25' y2='122' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='128' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='136' x2='100%25' y2='156' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='100%25' cy='162' r='3' fill='%234f4f59'/%3e %3cline x1='100%25' y1='170' x2='100%25' y2='190' stroke='%234f4f59' stroke-width='1.5'/%3e %3cline x1='0' y1='0' x2='100%25' y2='0' stroke='black' stroke-width='2'/%3e %3cline x1='0' y1='0' x2='0' y2='100%25' stroke='black' stroke-width='2'/%3e %3cline x1='0' y1='100%25' x2='100%25' y2='100%25' stroke='black' stroke-width='2'/%3e %3c/svg%3e");border-right:0}[_nghost-%COMP%]:nth-child(2n) .page-grid-item[_ngcontent-%COMP%]{margin:0!important;border-left:0!important;border-top-left-radius:0;border-bottom-left-radius:0;box-shadow:-2px 0 5px #0003}[_nghost-%COMP%]:nth-child(2n) .page-image[_ngcontent-%COMP%]{margin-right:auto;background-image:url("data:image/svg+xml, %3csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3e %3cline x1='0' y1='0' x2='0' y2='20' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='26' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='34' x2='0' y2='54' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='60' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='68' x2='0' y2='88' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='94' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='102' x2='0' y2='122' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='128' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='136' x2='0' y2='156' stroke='%234f4f59' stroke-width='1.5'/%3e %3ccircle cx='0' cy='162' r='3' fill='%234f4f59'/%3e %3cline x1='0' y1='170' x2='0' y2='190' stroke='%234f4f59' stroke-width='1.5'/%3e %3cline x1='0' y1='0' x2='100%25' y2='0' stroke='black' stroke-width='2'/%3e %3cline x1='100%25' y1='0' x2='100%25' y2='100%25' stroke='black' stroke-width='2'/%3e %3cline x1='0' y1='100%25' x2='100%25' y2='100%25' stroke='black' stroke-width='2'/%3e %3c/svg%3e");border-left:0}`]})};function ne(a,e){a&1&&u(0,"div",26)}function re(a,e){if(a&1){let t=z();o(0,"app-page-grid-item",28),c("selectPage",function(n){p(t);let r=l(3);return m(r.goToPage(n))})("dragStarted",function(n){p(t);let r=l(3);return m(r.onDragStart(n))})("dropped",function(n){p(t);let r=l(3);return m(r.onDrop(n))})("contextMenuEvent",function(n){p(t);let r=l(3);return m(r.onPageContextMenu(n))}),s()}if(a&2){let t=l().$implicit,i=l(2);_("index",t.index)("imageUrl",i.pageImageUrls()[t.index])("isCurrent",t.index===i.currentPageIndex())}}function ae(a,e){if(a&1&&y(0,ne,1,0,"div",26)(1,re,1,3,"app-page-grid-item",27),a&2){let t=e.$implicit;w(t.isFake?0:1)}}function oe(a,e){if(a&1&&(o(0,"div",17),U(1,ae,2,1,null,null,F),s()),a&2){let t=e.$implicit;d(),A(t)}}function se(a,e){a&1&&(o(0,"div",24),u(1,"div",29),s())}function de(a,e){if(a&1){let t=z();o(0,"app-confirm-delete-modal",30),c("confirm",function(){p(t);let n=l();return m(n.confirmDelete())})("cancel",function(){p(t);let n=l();return m(n.cancelDelete())}),s()}}var K=class a{appParams=g(X);assetsService=g(Y);modalService=g(W);saveService=g(I);onPageSelect;isLoading=x(!1);pages=x([]);currentPageIndex=M(()=>{let e=this.appParams.pageGuid();return this.pages().findIndex(i=>i.documentPageGuid===e)});pageSpreads=M(()=>{let e=this.pages(),t=[{isFake:!0}];e.forEach((n,r)=>{t.push(L(E({},n),{index:r}))});let i=[];for(let n=0;n<t.length;n+=2)i.push(t.slice(n,n+2));return i});pageCacheBusters=x({});sessionBuster=`s=${Date.now()}`;pageImageUrls=M(()=>{let e=this.pageCacheBusters();return this.pages().map(t=>{let i=t.publicationTemplateUrl;if(!i)return"";let n=t.documentPageGuid,r=e[n]||this.sessionBuster,P=i.includes("?")?"&":"?";return`${i}${P}${r}`})});dragSourceIndex=null;contextMenuVisible=!1;contextMenuPosition={x:0,y:0};contextMenuPageIndex=null;showDeleteConfirm=x(!1);deleteIndex=null;constructor(){b(()=>{let t=this.appParams.params().documentData;t&&Array.isArray(t)&&this.pages.set([...t])}),b(()=>{let e=this.saveService.saveSuccessPulse(),t=typeof e=="object"?e.count:e,i=this.pages()[this.currentPageIndex()];if(i&&t>0){let n=i.documentPageGuid;this.pageCacheBusters.update(r=>L(E({},r),{[n]:`t=${t}`}))}})}ngOnInit(){}addPage(){let e=this.appParams.guid;e&&(this.isLoading.set(!0),this.assetsService.addDocumentPage(e).subscribe(t=>{t?this.refreshPages():this.isLoading.set(!1)}))}addPageBefore(e){let t=this.appParams.guid;t&&(this.isLoading.set(!0),this.assetsService.addDocumentPage(t,e+1).subscribe(i=>{i?this.refreshPages():this.isLoading.set(!1)}))}addPageAfter(e){let t=this.appParams.guid;t&&(this.isLoading.set(!0),this.assetsService.addDocumentPage(t,e+2).subscribe(i=>{i?this.refreshPages():this.isLoading.set(!1)}))}duplicatePage(e){let t=this.appParams.guid,i=this.pages()[e];!t||!i||(this.isLoading.set(!0),this.assetsService.duplicateDocumentPage(t,i.documentPageGuid).subscribe(n=>{n?this.refreshPages():this.isLoading.set(!1)}))}deletePage(e){this.deleteIndex=e,this.showDeleteConfirm.set(!0)}confirmDelete(){if(this.deleteIndex===null)return;let e=this.deleteIndex,t=this.pages()[e],i=this.appParams.guid;if(!i||!t){this.cancelDelete();return}this.isLoading.set(!0),this.assetsService.deleteDocumentPage(i,t.documentPageGuid).subscribe(n=>{n?this.refreshPages():this.isLoading.set(!1)}),this.cancelDelete()}cancelDelete(){this.showDeleteConfirm.set(!1),this.deleteIndex=null}refreshPages(){let e=this.appParams.guid;e&&this.assetsService.getSVGDocumentPages(e).subscribe(t=>{t&&t.template&&this.appParams.setParams({documentData:[...t.template]}),this.isLoading.set(!1)})}close(){this.modalService.close()}goToPage(e){this.onPageSelect&&this.onPageSelect(e),this.close()}onDragStart(e){this.dragSourceIndex=e}onDrop(e){if(this.dragSourceIndex===null)return;let t=this.dragSourceIndex,i=e.targetIndex;if(e.side==="after"&&i++,i===t||i===t+1){this.dragSourceIndex=null;return}let n=this.appParams.guid;if(!n)return;let r=this.pages(),P=r[t];if(!P)return;let Q=P.documentPageGuid,O=i;t<i&&O--;let Z=O+1;this.pages.update(G=>{let T=[...G],[ee]=T.splice(t,1);return T.splice(O,0,ee),T}),this.assetsService.moveDocumentPage(n,Q,Z).subscribe({next:G=>{G||this.pages.set(r)},error:()=>{this.pages.set(r)}}),this.dragSourceIndex=null}onPageContextMenu(e){this.contextMenuPosition={x:e.event.clientX,y:e.event.clientY},this.contextMenuPageIndex=e.index,this.contextMenuVisible=!0}onContextMenuAction(e){switch(e.action){case"open":this.goToPage(e.index);break;case"insert-before":this.addPageBefore(e.index);break;case"insert-after":this.addPageAfter(e.index);break;case"duplicate":this.duplicatePage(e.index);break;case"delete":this.deletePage(e.index);break}this.contextMenuVisible=!1}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=C({type:a,selectors:[["app-page-grid-modal"]],inputs:{onPageSelect:"onPageSelect"},decls:33,vars:12,consts:[["id","page-grid-backdrop",3,"click"],["id","page-grid",3,"click"],["id","page-grid-title"],["id","icon-page-grid",1,"icon"],["width","24","height","24","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["x","3","y","3","width","5","height","5","fill","var(--white)"],["x","9.5","y","3","width","5","height","5","fill","var(--white)"],["x","16","y","3","width","5","height","5","fill","var(--white)"],["x","3","y","9.5","width","5","height","5","fill","var(--white)"],["x","9.5","y","9.5","width","5","height","5","fill","var(--white)"],["x","16","y","9.5","width","5","height","5","fill","var(--white)"],["x","3","y","16","width","5","height","5","fill","var(--white)"],["x","9.5","y","16","width","5","height","5","fill","var(--white)"],["x","16","y","16","width","5","height","5","fill","var(--white)"],["id","title-page-grid"],["id","close-page-grid",1,"close-btn",3,"click"],[1,"page-grid-content"],[1,"page-spread"],[1,"page-grid-item-add",3,"click"],[1,"page-grid-item-add-page"],["width","48","height","48","viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["x1","12","y1","5","x2","12","y2","19","stroke","var(--gray-1)","stroke-width","2","stroke-linecap","round"],["x1","5","y1","12","x2","19","y2","12","stroke","var(--gray-1)","stroke-width","2","stroke-linecap","round"],[1,"page-number"],[1,"page-grid-loader"],[3,"action","closeMenu","visible","position","pageIndex","isCurrentPage"],[1,"page-grid-fake-item"],[3,"index","imageUrl","isCurrent"],[3,"selectPage","dragStarted","dropped","contextMenuEvent","index","imageUrl","isCurrent"],[1,"spinner"],[3,"confirm","cancel"]],template:function(t,i){t&1&&(o(0,"div",0),c("click",function(){return i.close()}),o(1,"div",1),c("click",function(r){return r.stopPropagation()}),o(2,"div",2)(3,"span",3),V(),o(4,"svg",4),u(5,"rect",5)(6,"rect",6)(7,"rect",7)(8,"rect",8)(9,"rect",9)(10,"rect",10)(11,"rect",11)(12,"rect",12)(13,"rect",13),s()(),B(),o(14,"span",14),f(15),$(16,"translate"),s(),o(17,"button",15),c("click",function(){return i.close()}),f(18," \xD7 "),s()(),o(19,"div",16),U(20,oe,3,0,"div",17,F),o(22,"div",18),c("click",function(){return i.addPage()}),o(23,"div",19),V(),o(24,"svg",20),u(25,"line",21)(26,"line",22),s()(),B(),o(27,"span",23),f(28),$(29,"translate"),s()()()(),y(30,se,2,0,"div",24),s(),o(31,"app-page-context-menu",25),c("action",function(r){return i.onContextMenuAction(r)})("closeMenu",function(){return i.contextMenuVisible=!1}),s(),y(32,de,1,0,"app-confirm-delete-modal")),t&2&&(d(15),v(j(16,8,"GLOBAL.PAGES.GRID_VIEW")),d(5),A(i.pageSpreads()),d(8),v(j(29,10,"GLOBAL.PAGES.ADD_PAGE")),d(2),w(i.isLoading()?30:-1),d(),_("visible",i.contextMenuVisible)("position",i.contextMenuPosition)("pageIndex",i.contextMenuPageIndex)("isCurrentPage",i.contextMenuPageIndex===i.currentPageIndex()),d(),w(i.showDeleteConfirm()?32:-1))},dependencies:[k,S,R,D,q,J],styles:["#page-grid-backdrop[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100vw;height:100vh;background:#000000b3;z-index:2000;display:flex;justify-content:center;align-items:center}#page-grid[_ngcontent-%COMP%]{position:absolute;top:var(--spacing-s);left:var(--spacing-s);right:var(--spacing-s);bottom:var(--spacing-s);width:calc(100vw - 2 * var(--spacing-s));height:calc(100vh - 2 * var(--spacing-s));background-color:var(--gray-5);border-radius:var(--radius-s);padding:0 20px;display:flex;flex-direction:column;opacity:1;transition:opacity .5s ease;pointer-events:auto;overflow-y:auto;box-sizing:border-box}#page-grid-title[_ngcontent-%COMP%]{display:flex;align-items:center;width:100%;padding-top:var(--spacing-s);flex-shrink:0}#page-grid-title[_ngcontent-%COMP%] #icon-page-grid[_ngcontent-%COMP%]{background:var(--gray-3);border-radius:50%;width:32px;height:32px;display:flex;align-items:center;justify-content:center}#page-grid-title[_ngcontent-%COMP%] #title-page-grid[_ngcontent-%COMP%]{font-size:var(--font-size-medium);font-weight:var(--font-weight-bold);color:var(--white);margin-top:var(--spacing-s);margin-bottom:var(--spacing-xs);margin-left:var(--spacing-xs)!important}#close-page-grid[_ngcontent-%COMP%]{margin-left:auto;background:none;border:none;font-size:32px;cursor:pointer;color:var(--white)}.page-grid-content[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;justify-content:center;padding-bottom:40px;gap:var(--spacing-m)}.page-spread[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:flex-end}.page-grid-content[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{margin-bottom:var(--spacing-s)}.page-grid-fake-item[_ngcontent-%COMP%]{background-color:var(--gray-4);border-radius:var(--radius-xs);border-top-right-radius:0;border-bottom-right-radius:0;padding:var(--spacing-xs);display:flex;flex-direction:column;gap:var(--spacing-xs);width:144px;height:220px;border:1px solid var(--gray-3);border-right:0;align-items:center;margin:0;box-sizing:border-box;box-shadow:2px 0 5px #0003}.page-grid-item-add[_ngcontent-%COMP%]{background-color:var(--gray-3);border-radius:var(--radius-xs);padding:var(--spacing-xs);display:flex;flex-direction:column;gap:var(--spacing-xs);width:144px;height:220px;border:none;align-items:center;cursor:pointer;margin:var(--spacing-s) 0;box-sizing:border-box;transition:transform .2s,background-color .2s}.page-grid-item-add[_ngcontent-%COMP%]:hover{transform:scale(1.05);background-color:var(--gray-2)}.page-grid-item-add-page[_ngcontent-%COMP%]{display:flex;align-content:center;flex-direction:column;justify-content:center;align-items:center;width:120px;height:180px;background:#fff;border:2px solid black;box-sizing:border-box;min-width:130px;min-height:186px}.page-number[_ngcontent-%COMP%]{font-size:10px;color:var(--white);text-align:center}.page-grid-loader[_ngcontent-%COMP%]{position:absolute;inset:0;background:#0006;display:flex;justify-content:center;align-items:center;z-index:3000;border-radius:var(--radius-s)}.spinner[_ngcontent-%COMP%]{width:40px;height:40px;border:4px solid rgba(255,255,255,.3);border-top:4px solid var(--white);border-radius:50%;animation:_ngcontent-%COMP%_spin 1s linear infinite}@keyframes _ngcontent-%COMP%_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}"]})};export{K as PageGridModalComponent};
@@ -0,0 +1,82 @@
1
+ import{$a as yn,Ad as Tn,Ag as Gt,B as Nt,Bb as A,Bf as Ue,C as Ot,D as hn,Fd as be,G as st,Gd as ye,Hd as ae,I as M,Ia as pn,Id as ke,J as ot,L as Pe,Lf as B,M as Pt,Ma as mn,Mc as wn,Nd as Be,Nf as G,Ni as jt,Oa as gn,Of as Fn,Oi as ut,Pc as V,Pf as Ln,Qc as vn,R as It,Ri as dt,Sh as Mn,T as Ie,Uc as Bt,Va as bn,Ve as le,We as An,Xe as _n,Y,Yc as Cn,Za as $,Zc as Vt,_a as j,a as v,b as L,bb as En,cb as at,ch as W,dd as I,dh as K,e as de,fa as y,ha as ge,hb as Dn,hd as lt,ji as ct,k as dn,ma as P,n as J,nb as kt,nf as _,of as k,pb as te,pf as Ee,s as fn,t as T,tf as Ve,ti as Rn,ui as $t,v as oe,va as C,x as it,xa as S,xf as Ut,y as R,yb as fe,yd as Sn,yg as H,zg as X}from"./chunk-B3PWEOJU.js";var De=new P("");var On=null;function ft(){return On}function Br(r){On??=r}var Ht=class{},zt=(()=>{class r{historyGo(e){throw new Error("")}static \u0275fac=function(n){return new(n||r)};static \u0275prov=y({token:r,factory:()=>S(Pn),providedIn:"platform"})}return r})();var Pn=(()=>{class r extends zt{_location;_history;_doc=S(De);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ft().getBaseHref(this._doc)}onPopState(e){let n=ft().getGlobalEventTarget(this._doc,"window");return n.addEventListener("popstate",e,!1),()=>n.removeEventListener("popstate",e)}onHashChange(e){let n=ft().getGlobalEventTarget(this._doc,"window");return n.addEventListener("hashchange",e,!1),()=>n.removeEventListener("hashchange",e)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(e){this._location.pathname=e}pushState(e,n,i){this._history.pushState(e,n,i)}replaceState(e,n,i){this._history.replaceState(e,n,i)}forward(){this._history.forward()}back(){this._history.back()}historyGo(e=0){this._history.go(e)}getState(){return this._history.state}static \u0275fac=function(n){return new(n||r)};static \u0275prov=y({token:r,factory:()=>new r,providedIn:"platform"})}return r})();function In(r,t){return r?t?r.endsWith("/")?t.startsWith("/")?r+t.slice(1):r+t:t.startsWith("/")?r+t:`${r}/${t}`:r:t}function xn(r){let t=r.search(/#|\?|$/);return r[t-1]==="/"?r.slice(0,t-1)+r.slice(t):r}function ce(r){return r&&r[0]!=="?"?`?${r}`:r}var ht=(()=>{class r{historyGo(e){throw new Error("")}static \u0275fac=function(n){return new(n||r)};static \u0275prov=y({token:r,factory:()=>S(Bn),providedIn:"root"})}return r})(),kn=new P(""),Bn=(()=>{class r extends ht{_platformLocation;_baseHref;_removeListenerFns=[];constructor(e,n){super(),this._platformLocation=e,this._baseHref=n??this._platformLocation.getBaseHrefFromDOM()??S(De).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(e){this._removeListenerFns.push(this._platformLocation.onPopState(e),this._platformLocation.onHashChange(e))}getBaseHref(){return this._baseHref}prepareExternalUrl(e){return In(this._baseHref,e)}path(e=!1){let n=this._platformLocation.pathname+ce(this._platformLocation.search),i=this._platformLocation.hash;return i&&e?`${n}${i}`:n}pushState(e,n,i,s){let o=this.prepareExternalUrl(i+ce(s));this._platformLocation.pushState(e,n,o)}replaceState(e,n,i,s){let o=this.prepareExternalUrl(i+ce(s));this._platformLocation.replaceState(e,n,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(e=0){this._platformLocation.historyGo?.(e)}static \u0275fac=function(n){return new(n||r)(C(zt),C(kn,8))};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),Vn=(()=>{class r{_subject=new J;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(e){this._locationStrategy=e;let n=this._locationStrategy.getBaseHref();this._basePath=Gr(xn(Nn(n))),this._locationStrategy.onPopState(i=>{this._subject.next({url:this.path(!0),pop:!0,state:i.state,type:i.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(e=!1){return this.normalize(this._locationStrategy.path(e))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(e,n=""){return this.path()==this.normalize(e+ce(n))}normalize(e){return r.stripTrailingSlash(Ur(this._basePath,Nn(e)))}prepareExternalUrl(e){return e&&e[0]!=="/"&&(e="/"+e),this._locationStrategy.prepareExternalUrl(e)}go(e,n="",i=null){this._locationStrategy.pushState(i,"",e,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+ce(n)),i)}replaceState(e,n="",i=null){this._locationStrategy.replaceState(i,"",e,n),this._notifyUrlChangeListeners(this.prepareExternalUrl(e+ce(n)),i)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(e=0){this._locationStrategy.historyGo?.(e)}onUrlChange(e){return this._urlChangeListeners.push(e),this._urlChangeSubscription??=this.subscribe(n=>{this._notifyUrlChangeListeners(n.url,n.state)}),()=>{let n=this._urlChangeListeners.indexOf(e);this._urlChangeListeners.splice(n,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(e="",n){this._urlChangeListeners.forEach(i=>i(e,n))}subscribe(e,n,i){return this._subject.subscribe({next:e,error:n??void 0,complete:i??void 0})}static normalizeQueryParams=ce;static joinWithSlash=In;static stripTrailingSlash=xn;static \u0275fac=function(n){return new(n||r)(C(ht))};static \u0275prov=y({token:r,factory:()=>Vr(),providedIn:"root"})}return r})();function Vr(){return new Vn(C(ht))}function Ur(r,t){if(!r||!t.startsWith(r))return t;let e=t.substring(r.length);return e===""||["/",";","?","#"].includes(e[0])?e:t}function Nn(r){return r.replace(/\/index.html$/,"")}function Gr(r){if(new RegExp("^(https?:)?//").test(r)){let[,e]=r.split(/\/\/[^\/]+/);return e}return r}var Zt=function(r){return r[r.Decimal=0]="Decimal",r[r.Percent=1]="Percent",r[r.Currency=2]="Currency",r[r.Scientific=3]="Scientific",r}(Zt||{});var Q={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function we(r,t){let e=Ut(r),n=e[Ue.NumberSymbols][t];if(typeof n>"u"){if(t===Q.CurrencyDecimal)return e[Ue.NumberSymbols][Q.Decimal];if(t===Q.CurrencyGroup)return e[Ue.NumberSymbols][Q.Group]}return n}function qn(r,t){return Ut(r)[Ue.NumberFormats][t]}var $r=/^(\d+)?\.((\d+)(-(\d+))?)?$/,Un=22,pt=".",Ge="0",jr=";",Hr=",",qt="#";function zr(r,t,e,n,i,s,o=!1){let a="",l=!1;if(!isFinite(r))a=we(e,Q.Infinity);else{let c=Kr(r);o&&(c=Wr(c));let h=t.minInt,d=t.minFrac,u=t.maxFrac;if(s){let E=s.match($r);if(E===null)throw new Error(`${s} is not a valid digit info`);let w=E[1],D=E[3],O=E[5];w!=null&&(h=Wt(w)),D!=null&&(d=Wt(D)),O!=null?u=Wt(O):D!=null&&d>u&&(u=d)}Zr(c,d,u);let p=c.digits,m=c.integerLen,g=c.exponent,b=[];for(l=p.every(E=>!E);m<h;m++)p.unshift(0);for(;m<0;m++)p.unshift(0);m>0?b=p.splice(m,p.length):(b=p,p=[0]);let f=[];for(p.length>=t.lgSize&&f.unshift(p.splice(-t.lgSize,p.length).join(""));p.length>t.gSize;)f.unshift(p.splice(-t.gSize,p.length).join(""));p.length&&f.unshift(p.join("")),a=f.join(we(e,n)),b.length&&(a+=we(e,i)+b.join("")),g&&(a+=we(e,Q.Exponential)+"+"+g)}return r<0&&!l?a=t.negPre+a+t.negSuf:a=t.posPre+a+t.posSuf,a}function Wn(r,t,e){let n=qn(t,Zt.Decimal),i=qr(n,we(t,Q.MinusSign));return zr(r,i,t,Q.Group,Q.Decimal,e)}function qr(r,t="-"){let e={minInt:1,minFrac:0,maxFrac:0,posPre:"",posSuf:"",negPre:"",negSuf:"",gSize:0,lgSize:0},n=r.split(jr),i=n[0],s=n[1],o=i.indexOf(pt)!==-1?i.split(pt):[i.substring(0,i.lastIndexOf(Ge)+1),i.substring(i.lastIndexOf(Ge)+1)],a=o[0],l=o[1]||"";e.posPre=a.substring(0,a.indexOf(qt));for(let h=0;h<l.length;h++){let d=l.charAt(h);d===Ge?e.minFrac=e.maxFrac=h+1:d===qt?e.maxFrac=h+1:e.posSuf+=d}let c=a.split(Hr);if(e.gSize=c[1]?c[1].length:0,e.lgSize=c[2]||c[1]?(c[2]||c[1]).length:0,s){let h=i.length-e.posPre.length-e.posSuf.length,d=s.indexOf(qt);e.negPre=s.substring(0,d).replace(/'/g,""),e.negSuf=s.slice(d+h).replace(/'/g,"")}else e.negPre=t+e.posPre,e.negSuf=e.posSuf;return e}function Wr(r){if(r.digits[0]===0)return r;let t=r.digits.length-r.integerLen;return r.exponent?r.exponent+=2:(t===0?r.digits.push(0,0):t===1&&r.digits.push(0),r.integerLen+=2),r}function Kr(r){let t=Math.abs(r)+"",e=0,n,i,s,o,a;for((i=t.indexOf(pt))>-1&&(t=t.replace(pt,"")),(s=t.search(/e/i))>0?(i<0&&(i=s),i+=+t.slice(s+1),t=t.substring(0,s)):i<0&&(i=t.length),s=0;t.charAt(s)===Ge;s++);if(s===(a=t.length))n=[0],i=1;else{for(a--;t.charAt(a)===Ge;)a--;for(i-=s,n=[],o=0;s<=a;s++,o++)n[o]=Number(t.charAt(s))}return i>Un&&(n=n.splice(0,Un-1),e=i-1,i=1),{digits:n,exponent:e,integerLen:i}}function Zr(r,t,e){if(t>e)throw new Error(`The minimum number of digits after fraction (${t}) is higher than the maximum (${e}).`);let n=r.digits,i=n.length-r.integerLen,s=Math.min(Math.max(t,i),e),o=s+r.integerLen,a=n[o];if(o>0){n.splice(Math.max(r.integerLen,o));for(let d=o;d<n.length;d++)n[d]=0}else{i=Math.max(0,i),r.integerLen=1,n.length=Math.max(1,o=s+1),n[0]=0;for(let d=1;d<o;d++)n[d]=0}if(a>=5)if(o-1<0){for(let d=0;d>o;d--)n.unshift(0),r.integerLen++;n.unshift(1),r.integerLen++}else n[o-1]++;for(;i<Math.max(0,s);i++)n.push(0);let l=s!==0,c=t+r.integerLen,h=n.reduceRight(function(d,u,p,m){return u=u+d,m[p]=u<10?u:u-10,l&&(m[p]===0&&p>=c?m.pop():l=!1),u>=10?1:0},0);h&&(n.unshift(h),r.integerLen++)}function Wt(r){let t=parseInt(r);if(isNaN(t))throw new Error("Invalid integer literal when parsing "+r);return t}var Kt=/\s+/,Gn=[],Jr=(()=>{class r{_ngEl;_renderer;initialClasses=Gn;rawClass;stateMap=new Map;constructor(e,n){this._ngEl=e,this._renderer=n}set klass(e){this.initialClasses=e!=null?e.trim().split(Kt):Gn}set ngClass(e){this.rawClass=typeof e=="string"?e.trim().split(Kt):e}ngDoCheck(){for(let n of this.initialClasses)this._updateState(n,!0);let e=this.rawClass;if(Array.isArray(e)||e instanceof Set)for(let n of e)this._updateState(n,!0);else if(e!=null)for(let n of Object.keys(e))this._updateState(n,!!e[n]);this._applyStateDiff()}_updateState(e,n){let i=this.stateMap.get(e);i!==void 0?(i.enabled!==n&&(i.changed=!0,i.enabled=n),i.touched=!0):this.stateMap.set(e,{enabled:n,changed:!0,touched:!0})}_applyStateDiff(){for(let e of this.stateMap){let n=e[0],i=e[1];i.changed?(this._toggleClass(n,i.enabled),i.changed=!1):i.touched||(i.enabled&&this._toggleClass(n,!1),this.stateMap.delete(n)),i.touched=!1}}_toggleClass(e,n){e=e.trim(),e.length>0&&e.split(Kt).forEach(i=>{n?this._renderer.addClass(this._ngEl.nativeElement,i):this._renderer.removeClass(this._ngEl.nativeElement,i)})}static \u0275fac=function(n){return new(n||r)(I(fe),I(Vt))};static \u0275dir=ae({type:r,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return r})(),Yr=(()=>{class r{_viewContainerRef;ngComponentOutlet=null;ngComponentOutletInputs;ngComponentOutletInjector;ngComponentOutletContent;ngComponentOutletNgModule;ngComponentOutletNgModuleFactory;_componentRef;_moduleRef;_inputsUsed=new Map;get componentInstance(){return this._componentRef?.instance??null}constructor(e){this._viewContainerRef=e}_needToReCreateNgModuleInstance(e){return e.ngComponentOutletNgModule!==void 0||e.ngComponentOutletNgModuleFactory!==void 0}_needToReCreateComponentInstance(e){return e.ngComponentOutlet!==void 0||e.ngComponentOutletContent!==void 0||e.ngComponentOutletInjector!==void 0||this._needToReCreateNgModuleInstance(e)}ngOnChanges(e){if(this._needToReCreateComponentInstance(e)&&(this._viewContainerRef.clear(),this._inputsUsed.clear(),this._componentRef=void 0,this.ngComponentOutlet)){let n=this.ngComponentOutletInjector||this._viewContainerRef.parentInjector;this._needToReCreateNgModuleInstance(e)&&(this._moduleRef?.destroy(),this.ngComponentOutletNgModule?this._moduleRef=Tn(this.ngComponentOutletNgModule,$n(n)):this.ngComponentOutletNgModuleFactory?this._moduleRef=this.ngComponentOutletNgModuleFactory.create($n(n)):this._moduleRef=void 0),this._componentRef=this._viewContainerRef.createComponent(this.ngComponentOutlet,{injector:n,ngModuleRef:this._moduleRef,projectableNodes:this.ngComponentOutletContent})}}ngDoCheck(){if(this._componentRef){if(this.ngComponentOutletInputs)for(let e of Object.keys(this.ngComponentOutletInputs))this._inputsUsed.set(e,!0);this._applyInputStateDiff(this._componentRef)}}ngOnDestroy(){this._moduleRef?.destroy()}_applyInputStateDiff(e){for(let[n,i]of this._inputsUsed)i?(e.setInput(n,this.ngComponentOutletInputs[n]),this._inputsUsed.set(n,!1)):(e.setInput(n,void 0),this._inputsUsed.delete(n))}static \u0275fac=function(n){return new(n||r)(I(lt))};static \u0275dir=ae({type:r,selectors:[["","ngComponentOutlet",""]],inputs:{ngComponentOutlet:"ngComponentOutlet",ngComponentOutletInputs:"ngComponentOutletInputs",ngComponentOutletInjector:"ngComponentOutletInjector",ngComponentOutletContent:"ngComponentOutletContent",ngComponentOutletNgModule:"ngComponentOutletNgModule",ngComponentOutletNgModuleFactory:"ngComponentOutletNgModuleFactory"},exportAs:["ngComponentOutlet"],features:[bn]})}return r})();function $n(r){return r.get(Sn).injector}var mt=class{$implicit;ngForOf;index;count;constructor(t,e,n,i){this.$implicit=t,this.ngForOf=e,this.index=n,this.count=i}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},Kn=(()=>{class r{_viewContainer;_template;_differs;set ngForOf(e){this._ngForOf=e,this._ngForOfDirty=!0}set ngForTrackBy(e){this._trackByFn=e}get ngForTrackBy(){return this._trackByFn}_ngForOf=null;_ngForOfDirty=!0;_differ=null;_trackByFn;constructor(e,n,i){this._viewContainer=e,this._template=n,this._differs=i}set ngForTemplate(e){e&&(this._template=e)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let e=this._ngForOf;!this._differ&&e&&(this._differ=this._differs.find(e).create(this.ngForTrackBy))}if(this._differ){let e=this._differ.diff(this._ngForOf);e&&this._applyChanges(e)}}_applyChanges(e){let n=this._viewContainer;e.forEachOperation((i,s,o)=>{if(i.previousIndex==null)n.createEmbeddedView(this._template,new mt(i.item,this._ngForOf,-1,-1),o===null?void 0:o);else if(o==null)n.remove(s===null?void 0:s);else if(s!==null){let a=n.get(s);n.move(a,o),jn(a,i)}});for(let i=0,s=n.length;i<s;i++){let a=n.get(i).context;a.index=i,a.count=s,a.ngForOf=this._ngForOf}e.forEachIdentityChange(i=>{let s=n.get(i.currentIndex);jn(s,i)})}static ngTemplateContextGuard(e,n){return!0}static \u0275fac=function(n){return new(n||r)(I(lt),I(Bt),I(Rn))};static \u0275dir=ae({type:r,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return r})();function jn(r,t){r.context.$implicit=t.item}var $e=(()=>{class r{_viewContainer;_context=new gt;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(e,n){this._viewContainer=e,this._thenTemplateRef=n}set ngIf(e){this._context.$implicit=this._context.ngIf=e,this._updateView()}set ngIfThen(e){Hn(e,!1),this._thenTemplateRef=e,this._thenViewRef=null,this._updateView()}set ngIfElse(e){Hn(e,!1),this._elseTemplateRef=e,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(e,n){return!0}static \u0275fac=function(n){return new(n||r)(I(lt),I(Bt))};static \u0275dir=ae({type:r,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return r})(),gt=class{$implicit=null;ngIf=null};function Hn(r,t){if(r&&!r.createEmbeddedView)throw new Y(2020,!1)}var Xr=(()=>{class r{_ngEl;_differs;_renderer;_ngStyle=null;_differ=null;constructor(e,n,i){this._ngEl=e,this._differs=n,this._renderer=i}set ngStyle(e){this._ngStyle=e,!this._differ&&e&&(this._differ=this._differs.find(e).create())}ngDoCheck(){if(this._differ){let e=this._differ.diff(this._ngStyle);e&&this._applyChanges(e)}}_setStyle(e,n){let[i,s]=e.split("."),o=i.indexOf("-")===-1?void 0:vn.DashCase;n!=null?this._renderer.setStyle(this._ngEl.nativeElement,i,s?`${n}${s}`:n,o):this._renderer.removeStyle(this._ngEl.nativeElement,i,o)}_applyChanges(e){e.forEachRemovedItem(n=>this._setStyle(n.key,null)),e.forEachAddedItem(n=>this._setStyle(n.key,n.currentValue)),e.forEachChangedItem(n=>this._setStyle(n.key,n.currentValue))}static \u0275fac=function(n){return new(n||r)(I(fe),I($t),I(Vt))};static \u0275dir=ae({type:r,selectors:[["","ngStyle",""]],inputs:{ngStyle:"ngStyle"}})}return r})();function Qr(r,t){return new Y(2100,!1)}function ei(r,t){return{key:r,value:t}}var ti=(()=>{class r{differs;constructor(e){this.differs=e}differ;keyValues=[];compareFn=zn;transform(e,n=zn){if(!e||!(e instanceof Map)&&typeof e!="object")return null;this.differ??=this.differs.find(e).create();let i=this.differ.diff(e),s=n!==this.compareFn;return i&&(this.keyValues=[],i.forEachItem(o=>{this.keyValues.push(ei(o.key,o.currentValue))})),(i||s)&&(n&&this.keyValues.sort(n),this.compareFn=n),this.keyValues}static \u0275fac=function(n){return new(n||r)(I($t,16))};static \u0275pipe=ke({name:"keyvalue",type:r,pure:!1})}return r})();function zn(r,t){let e=r.key,n=t.key;if(e===n)return 0;if(e==null)return 1;if(n==null)return-1;if(typeof e=="string"&&typeof n=="string")return e<n?-1:1;if(typeof e=="number"&&typeof n=="number")return e-n;if(typeof e=="boolean"&&typeof n=="boolean")return e<n?-1:1;let i=String(e),s=String(n);return i==s?0:i<s?-1:1}var ni=(()=>{class r{_locale;constructor(e){this._locale=e}transform(e,n,i){if(!ri(e))return null;i||=this._locale;try{let s=ii(e);return Wn(s,i,n)}catch(s){throw Qr(r,s.message)}}static \u0275fac=function(n){return new(n||r)(I(Mn,16))};static \u0275pipe=ke({name:"number",type:r,pure:!0})}return r})();function ri(r){return!(r==null||r===""||r!==r)}function ii(r){if(typeof r=="string"&&!isNaN(Number(r)-parseFloat(r)))return Number(r);if(typeof r!="number")throw new Error(`${r} is not a number`);return r}var he=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=ye({type:r});static \u0275inj=ge({})}return r})();function Jt(r,t){t=encodeURIComponent(t);for(let e of r.split(";")){let n=e.indexOf("="),[i,s]=n==-1?[e,""]:[e.slice(0,n),e.slice(n+1)];if(i.trim()===t)return decodeURIComponent(s)}return null}var Zn="browser",Jn="server";function si(r){return r===Zn}function oi(r){return r===Jn}var je=class{};var qe=class{},Qn=(()=>{class r{handle(e){return e.key}static \u0275fac=function(n){return new(n||r)};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),ve=class{},er=(()=>{class r extends ve{compile(e,n){return e}compileTranslations(e,n){return e}static \u0275fac=(()=>{let e;return function(i){return(e||(e=at(r)))(i||r)}})();static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),Ce=class{},tr=(()=>{class r extends Ce{getTranslation(e){return T({})}static \u0275fac=(()=>{let e;return function(i){return(e||(e=at(r)))(i||r)}})();static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})();function We(r,t){if(r===t)return!0;if(r===null||t===null)return!1;if(r!==r&&t!==t)return!0;let e=typeof r,n=typeof t,i;if(e==n&&e=="object")if(Array.isArray(r)){if(!Array.isArray(t))return!1;if((i=r.length)==t.length){for(let s=0;s<i;s++)if(!We(r[s],t[s]))return!1;return!0}}else{if(Array.isArray(t))return!1;if(ne(r)&&ne(t)){let s=Object.create(null);for(let o in r){if(!We(r[o],t[o]))return!1;s[o]=!0}for(let o in t)if(!(o in s)&&typeof t[o]<"u")return!1;return!0}}return!1}function z(r){return typeof r<"u"&&r!==null}function Xn(r){return r!==void 0}function ne(r){return ze(r)&&!pe(r)&&r!==null}function ze(r){return typeof r=="object"&&r!==null}function pe(r){return Array.isArray(r)}function Ke(r){return typeof r=="string"}function ai(r){return typeof r=="function"}function bt(r){if(pe(r))return r.map(t=>bt(t));if(ne(r)){let t={};return Object.keys(r).forEach(e=>{t[e]=bt(r[e])}),t}else return r}function en(r,t){if(!ze(r))return bt(t);let e=bt(r);return ze(e)&&ze(t)&&Object.keys(t).forEach(n=>{ne(t[n])?n in r?e[n]=en(r[n],t[n]):Object.assign(e,{[n]:t[n]}):Object.assign(e,{[n]:t[n]})}),e}function nr(r,t){let e=t.split(".");t="";do{t+=e.shift();let n=!e.length;if(z(r)){if(ne(r)&&Xn(r[t])&&(ne(r[t])||pe(r[t])||n)){r=r[t],t="";continue}if(pe(r)){let i=parseInt(t,10);if(Xn(r[i])&&(ne(r[i])||pe(r[i])||n)){r=r[i],t="";continue}}}if(n){r=void 0;continue}t+="."}while(e.length);return r}function li(r,t,e){return en(r,ci(t,e))}function ci(r,t){return r.split(".").reduceRight((e,n)=>({[n]:e}),t)}var Se=class{},rr=(()=>{class r extends Se{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(e,n){if(Ke(e))return this.interpolateString(e,n);if(ai(e))return this.interpolateFunction(e,n)}interpolateFunction(e,n){return e(n)}interpolateString(e,n){return n?e.replace(this.templateMatcher,(i,s)=>{let o=this.getInterpolationReplacement(n,s);return o!==void 0?o:i}):e}getInterpolationReplacement(e,n){return this.formatValue(nr(e,n))}formatValue(e){if(Ke(e))return e;if(typeof e=="number"||typeof e=="boolean")return e.toString();if(e===null)return"null";if(pe(e))return e.join(", ");if(ze(e))return typeof e.toString=="function"&&e.toString!==Object.prototype.toString?e.toString():JSON.stringify(e)}static \u0275fac=(()=>{let e;return function(i){return(e||(e=at(r)))(i||r)}})();static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),Yt=(()=>{class r{_onTranslationChange=new J;_onLangChange=new J;_onFallbackLangChange=new J;fallbackLang=null;currentLang;translations={};languages=[];getTranslations(e){return this.translations[e]}setTranslations(e,n,i){this.translations[e]=i&&this.hasTranslationFor(e)?en(this.translations[e],n):n,this.addLanguages([e]),this._onTranslationChange.next({lang:e,translations:this.getTranslations(e)})}getLanguages(){return this.languages}getCurrentLang(){return this.currentLang}getFallbackLang(){return this.fallbackLang}setFallbackLang(e,n=!0){this.fallbackLang=e,n&&this._onFallbackLangChange.next({lang:e,translations:this.translations[e]})}setCurrentLang(e,n=!0){this.currentLang=e,n&&this._onLangChange.next({lang:e,translations:this.translations[e]})}get onTranslationChange(){return this._onTranslationChange.asObservable()}get onLangChange(){return this._onLangChange.asObservable()}get onFallbackLangChange(){return this._onFallbackLangChange.asObservable()}addLanguages(e){this.languages=Array.from(new Set([...this.languages,...e]))}hasTranslationFor(e){return typeof this.translations[e]<"u"}deleteTranslations(e){delete this.translations[e]}getTranslation(e){let n=this.getValue(this.currentLang,e);return n===void 0&&this.fallbackLang!=null&&this.fallbackLang!==this.currentLang&&(n=this.getValue(this.fallbackLang,e)),n}getValue(e,n){return nr(this.getTranslations(e),n)}static \u0275fac=function(n){return new(n||r)};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),Xt=new P("TRANSLATE_CONFIG"),He=r=>oe(r)?r:T(r);var yt=(()=>{class r{loadingTranslations;pending=!1;_translationRequests={};lastUseLanguage=null;currentLoader=S(Ce);compiler=S(ve);parser=S(Se);missingTranslationHandler=S(qe);store=S(Yt);extend=!1;get onTranslationChange(){return this.store.onTranslationChange}get onLangChange(){return this.store.onLangChange}get onFallbackLangChange(){return this.store.onFallbackLangChange}get onDefaultLangChange(){return this.store.onFallbackLangChange}constructor(){let e=v({extend:!1,fallbackLang:null},S(Xt,{optional:!0}));e.lang&&this.use(e.lang),e.fallbackLang&&this.setFallbackLang(e.fallbackLang),e.extend&&(this.extend=!0)}setFallbackLang(e){this.getFallbackLang()||this.store.setFallbackLang(e,!1);let n=this.loadOrExtendLanguage(e);return oe(n)?(n.pipe(Pe(1)).subscribe({next:()=>{this.store.setFallbackLang(e)},error:()=>{}}),n):(this.store.setFallbackLang(e),T(this.store.getTranslations(e)))}use(e){this.lastUseLanguage=e,this.getCurrentLang()||this.store.setCurrentLang(e,!1);let n=this.loadOrExtendLanguage(e);return oe(n)?(n.pipe(Pe(1)).subscribe({next:()=>{this.changeLang(e)},error:()=>{}}),n):(this.changeLang(e),T(this.store.getTranslations(e)))}loadOrExtendLanguage(e){if(!this.store.hasTranslationFor(e)||this.extend)return this._translationRequests[e]=this._translationRequests[e]||this.loadAndCompileTranslations(e),this._translationRequests[e]}changeLang(e){e===this.lastUseLanguage&&this.store.setCurrentLang(e)}getCurrentLang(){return this.store.getCurrentLang()}loadAndCompileTranslations(e){this.pending=!0;let n=this.currentLoader.getTranslation(e).pipe(It(1),Pe(1));return this.loadingTranslations=n.pipe(R(i=>this.compiler.compileTranslations(i,e)),It(1),Pe(1)),this.loadingTranslations.subscribe({next:i=>{this.store.setTranslations(e,i,this.extend),this.pending=!1},error:i=>{this.pending=!1}}),n}setTranslation(e,n,i=!1){let s=this.compiler.compileTranslations(n,e);this.store.setTranslations(e,s,i||this.extend)}getLangs(){return this.store.getLanguages()}addLangs(e){this.store.addLanguages(e)}getParsedResultForKey(e,n){let i=this.getTextToInterpolate(e);if(z(i))return this.runInterpolation(i,n);let s=this.missingTranslationHandler.handle(v({key:e,translateService:this},n!==void 0&&{interpolateParams:n}));return s!==void 0?s:e}getFallbackLang(){return this.store.getFallbackLang()}getTextToInterpolate(e){return this.store.getTranslation(e)}runInterpolation(e,n){if(z(e))return pe(e)?this.runInterpolationOnArray(e,n):ne(e)?this.runInterpolationOnDict(e,n):this.parser.interpolate(e,n)}runInterpolationOnArray(e,n){return e.map(i=>this.runInterpolation(i,n))}runInterpolationOnDict(e,n){let i={};for(let s in e){let o=this.runInterpolation(e[s],n);o!==void 0&&(i[s]=o)}return i}getParsedResult(e,n){return e instanceof Array?this.getParsedResultForArray(e,n):this.getParsedResultForKey(e,n)}getParsedResultForArray(e,n){let i={},s=!1;for(let a of e)i[a]=this.getParsedResultForKey(a,n),s=s||oe(i[a]);if(!s)return i;let o=e.map(a=>He(i[a]));return hn(o).pipe(R(a=>{let l={};return a.forEach((c,h)=>{l[e[h]]=c}),l}))}get(e,n){if(!z(e)||!e.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(ot(()=>He(this.getParsedResult(e,n)))):He(this.getParsedResult(e,n))}getStreamOnTranslationChange(e,n){if(!z(e)||!e.length)throw new Error('Parameter "key" is required and cannot be empty');return Nt(Ot(()=>this.get(e,n)),this.onTranslationChange.pipe(Ie(()=>{let i=this.getParsedResult(e,n);return He(i)})))}stream(e,n){if(!z(e)||!e.length)throw new Error('Parameter "key" required');return Nt(Ot(()=>this.get(e,n)),this.onLangChange.pipe(Ie(()=>{let i=this.getParsedResult(e,n);return He(i)})))}instant(e,n){if(!z(e)||e.length===0)throw new Error('Parameter "key" is required and cannot be empty');let i=this.getParsedResult(e,n);return oe(i)?Array.isArray(e)?e.reduce((s,o)=>(s[o]=o,s),{}):e:i}set(e,n,i=this.getCurrentLang()){this.store.setTranslations(i,li(this.store.getTranslations(i),e,Ke(n)?this.compiler.compile(n,i):this.compiler.compileTranslations(n,i)),!1)}reloadLang(e){return this.resetLang(e),this.loadAndCompileTranslations(e)}resetLang(e){delete this._translationRequests[e],this.store.deleteTranslations(e)}static getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let e=this.getBrowserCultureLang();return e?e.split(/[-_]/)[0]:void 0}static getBrowserCultureLang(){if(!(typeof window>"u"||typeof window.navigator>"u"))return window.navigator.languages?window.navigator.languages[0]:window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage}getBrowserLang(){return r.getBrowserLang()}getBrowserCultureLang(){return r.getBrowserCultureLang()}get defaultLang(){return this.getFallbackLang()}get currentLang(){return this.store.getCurrentLang()}get langs(){return this.store.getLanguages()}setDefaultLang(e){return this.setFallbackLang(e)}getDefaultLang(){return this.getFallbackLang()}static \u0275fac=function(n){return new(n||r)};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),Jo=(()=>{class r{translateService=S(yt);element=S(fe);_ref=S(ct);key;lastParams;currentParams;onLangChangeSub;onFallbackLangChangeSub;onTranslationChangeSub;set translate(e){e&&(this.key=e,this.checkNodes())}set translateParams(e){We(this.currentParams,e)||(this.currentParams=e,this.checkNodes(!0))}constructor(){this.onTranslationChangeSub||(this.onTranslationChangeSub=this.translateService.onTranslationChange.subscribe(e=>{e.lang===this.translateService.currentLang&&this.checkNodes(!0,e.translations)})),this.onLangChangeSub||(this.onLangChangeSub=this.translateService.onLangChange.subscribe(e=>{this.checkNodes(!0,e.translations)})),this.onFallbackLangChangeSub||(this.onFallbackLangChangeSub=this.translateService.onFallbackLangChange.subscribe(e=>{this.checkNodes(!0)}))}ngAfterViewChecked(){this.checkNodes()}checkNodes(e=!1,n){let i=this.element.nativeElement.childNodes;i.length||(this.setContent(this.element.nativeElement,this.key),i=this.element.nativeElement.childNodes),i.forEach(s=>{let o=s;if(o.nodeType===3){let a;if(e&&(o.lastKey=null),z(o.lookupKey))a=o.lookupKey;else if(this.key)a=this.key;else{let l=this.getContent(o),c=l.trim();c.length&&(o.lookupKey=c,l!==o.currentValue?(a=c,o.originalContent=l||o.originalContent):o.originalContent&&(a=o.originalContent.trim()))}this.updateValue(a,o,n)}})}updateValue(e,n,i){if(e){if(n.lastKey===e&&this.lastParams===this.currentParams)return;this.lastParams=this.currentParams;let s=o=>{(o!==e||!n.lastKey)&&(n.lastKey=e),n.originalContent||(n.originalContent=this.getContent(n)),Ke(o)?n.currentValue=o:z(o)?n.currentValue=JSON.stringify(o):n.currentValue=n.originalContent||e,this.setContent(n,this.key?n.currentValue:n.originalContent.replace(e,n.currentValue)),this._ref.markForCheck()};if(z(i)){let o=this.translateService.getParsedResult(e,this.currentParams);oe(o)?o.subscribe({next:s}):s(o)}else this.translateService.get(e,this.currentParams).subscribe(s)}}getContent(e){return z(e.textContent)?e.textContent:e.data}setContent(e,n){z(e.textContent)?e.textContent=n:e.data=n}ngOnDestroy(){this.onLangChangeSub&&this.onLangChangeSub.unsubscribe(),this.onFallbackLangChangeSub&&this.onFallbackLangChangeSub.unsubscribe(),this.onTranslationChangeSub&&this.onTranslationChangeSub.unsubscribe()}static \u0275fac=function(n){return new(n||r)};static \u0275dir=ae({type:r,selectors:[["","translate",""],["","ngx-translate",""]],inputs:{translate:"translate",translateParams:"translateParams"}})}return r})(),Te=(()=>{class r{translate=S(yt);_ref=S(ct);value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onFallbackLangChange;updateValue(e,n,i){let s=o=>{this.value=o!==void 0?o:e,this.lastKey=e,this._ref.markForCheck()};if(i){let o=this.translate.getParsedResult(e,n);oe(o)?o.subscribe(s):s(o)}this.translate.get(e,n).subscribe(s)}transform(e,...n){if(!e||!e.length)return e;if(We(e,this.lastKey)&&We(n,this.lastParams))return this.value;let i;if(z(n[0])&&n.length)if(Ke(n[0])&&n[0].length){let s=n[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{i=JSON.parse(s)}catch(o){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${n[0]}`)}}else ne(n[0])&&(i=n[0]);return this.lastKey=e,this.lastParams=n,this.updateValue(e,i),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(s=>{(this.lastKey&&s.lang===this.translate.getCurrentLang()||s.lang===this.translate.getFallbackLang())&&(this.lastKey=null,this.updateValue(e,i,s.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(s=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,i,s.translations))})),this.onFallbackLangChange||(this.onFallbackLangChange=this.translate.onFallbackLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(e,i))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onFallbackLangChange<"u"&&(this.onFallbackLangChange.unsubscribe(),this.onFallbackLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(n){return new(n||r)};static \u0275pipe=ke({name:"translate",type:r,pure:!1});static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})();function ir(r){return{provide:Ce,useClass:r}}function sr(r){return{provide:ve,useClass:r}}function or(r){return{provide:Se,useClass:r}}function ar(r){return{provide:qe,useClass:r}}function Yo(r={}){return Qt(v({compiler:sr(er),parser:or(rr),loader:ir(tr),missingTranslationHandler:ar(Qn)},r),!0)}function Qt(r={},t){let e=[];r.loader&&e.push(r.loader),r.compiler&&e.push(r.compiler),r.parser&&e.push(r.parser),r.missingTranslationHandler&&e.push(r.missingTranslationHandler),t&&e.push(Yt),(r.useDefaultLang||r.defaultLanguage)&&(console.warn("The `useDefaultLang` and `defaultLanguage` options are deprecated. Please use `fallbackLang` instead."),r.useDefaultLang===!0&&r.defaultLanguage&&(r.fallbackLang=r.defaultLanguage));let n={fallbackLang:r.fallbackLang??null,lang:r.lang,extend:r.extend??!1};return e.push({provide:Xt,useValue:n}),e.push({provide:yt,useClass:yt,deps:[Yt,Ce,ve,Se,qe,Xt]}),e}var Ae=(()=>{class r{static forRoot(e={}){return{ngModule:r,providers:[...Qt(v({compiler:sr(er),parser:or(rr),loader:ir(tr),missingTranslationHandler:ar(Qn)},e),!0)]}}static forChild(e={}){return{ngModule:r,providers:[...Qt(e,e.isolate??!1)]}}static \u0275fac=function(n){return new(n||r)};static \u0275mod=ye({type:r});static \u0275inj=ge({})}return r})();var ee=class r{params=A({});pageGuid=A("");setParams(t){this.params.update(e=>v(v({},e),t))}updateTemplateName(t){this.params.update(e=>{let n=e.templateData?L(v({},e.templateData),{publicationTemplateName:t}):{publicationTemplateName:t};return L(v({},e),{templateData:n})})}get token(){return this.params().token}get type(){return this.params().type}get guid(){return this.params().guid}get apiUrl(){return this.params().apiUrl}get language(){return this.params().language}get templateData(){return this.params().templateData}get documentData(){return this.params().documentData}static \u0275fac=function(e){return new(e||r)};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var lr=class r{modalState=new J;modalState$=this.modalState.asObservable();open(t,e){this.modalState.next({component:t,data:e})}close(){this.modalState.next(null)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var Fe=class{},Ze=class{},F=class r{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(t){t?typeof t=="string"?this.lazyInit=()=>{this.headers=new Map,t.split(`
2
+ `).forEach(e=>{let n=e.indexOf(":");if(n>0){let i=e.slice(0,n),s=e.slice(n+1).trim();this.addHeaderEntry(i,s)}})}:typeof Headers<"u"&&t instanceof Headers?(this.headers=new Map,t.forEach((e,n)=>{this.addHeaderEntry(n,e)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(t).forEach(([e,n])=>{this.setHeaderEntries(e,n)})}:this.headers=new Map}has(t){return this.init(),this.headers.has(t.toLowerCase())}get(t){this.init();let e=this.headers.get(t.toLowerCase());return e&&e.length>0?e[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(t){return this.init(),this.headers.get(t.toLowerCase())||null}append(t,e){return this.clone({name:t,value:e,op:"a"})}set(t,e){return this.clone({name:t,value:e,op:"s"})}delete(t,e){return this.clone({name:t,value:e,op:"d"})}maybeSetNormalizedName(t,e){this.normalizedNames.has(e)||this.normalizedNames.set(e,t)}init(){this.lazyInit&&(this.lazyInit instanceof r?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(t=>this.applyUpdate(t)),this.lazyUpdate=null))}copyFrom(t){t.init(),Array.from(t.headers.keys()).forEach(e=>{this.headers.set(e,t.headers.get(e)),this.normalizedNames.set(e,t.normalizedNames.get(e))})}clone(t){let e=new r;return e.lazyInit=this.lazyInit&&this.lazyInit instanceof r?this.lazyInit:this,e.lazyUpdate=(this.lazyUpdate||[]).concat([t]),e}applyUpdate(t){let e=t.name.toLowerCase();switch(t.op){case"a":case"s":let n=t.value;if(typeof n=="string"&&(n=[n]),n.length===0)return;this.maybeSetNormalizedName(t.name,e);let i=(t.op==="a"?this.headers.get(e):void 0)||[];i.push(...n),this.headers.set(e,i);break;case"d":let s=t.value;if(!s)this.headers.delete(e),this.normalizedNames.delete(e);else{let o=this.headers.get(e);if(!o)return;o=o.filter(a=>s.indexOf(a)===-1),o.length===0?(this.headers.delete(e),this.normalizedNames.delete(e)):this.headers.set(e,o)}break}}addHeaderEntry(t,e){let n=t.toLowerCase();this.maybeSetNormalizedName(t,n),this.headers.has(n)?this.headers.get(n).push(e):this.headers.set(n,[e])}setHeaderEntries(t,e){let n=(Array.isArray(e)?e:[e]).map(s=>s.toString()),i=t.toLowerCase();this.headers.set(i,n),this.maybeSetNormalizedName(t,i)}forEach(t){this.init(),Array.from(this.normalizedNames.keys()).forEach(e=>t(this.normalizedNames.get(e),this.headers.get(e)))}};var Dt=class{encodeKey(t){return cr(t)}encodeValue(t){return cr(t)}decodeKey(t){return decodeURIComponent(t)}decodeValue(t){return decodeURIComponent(t)}};function ui(r,t){let e=new Map;return r.length>0&&r.replace(/^\?/,"").split("&").forEach(i=>{let s=i.indexOf("="),[o,a]=s==-1?[t.decodeKey(i),""]:[t.decodeKey(i.slice(0,s)),t.decodeValue(i.slice(s+1))],l=e.get(o)||[];l.push(a),e.set(o,l)}),e}var di=/%(\d[a-f0-9])/gi,fi={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function cr(r){return encodeURIComponent(r).replace(di,(t,e)=>fi[e]??t)}function Et(r){return`${r}`}var re=class r{map;encoder;updates=null;cloneFrom=null;constructor(t={}){if(this.encoder=t.encoder||new Dt,t.fromString){if(t.fromObject)throw new Y(2805,!1);this.map=ui(t.fromString,this.encoder)}else t.fromObject?(this.map=new Map,Object.keys(t.fromObject).forEach(e=>{let n=t.fromObject[e],i=Array.isArray(n)?n.map(Et):[Et(n)];this.map.set(e,i)})):this.map=null}has(t){return this.init(),this.map.has(t)}get(t){this.init();let e=this.map.get(t);return e?e[0]:null}getAll(t){return this.init(),this.map.get(t)||null}keys(){return this.init(),Array.from(this.map.keys())}append(t,e){return this.clone({param:t,value:e,op:"a"})}appendAll(t){let e=[];return Object.keys(t).forEach(n=>{let i=t[n];Array.isArray(i)?i.forEach(s=>{e.push({param:n,value:s,op:"a"})}):e.push({param:n,value:i,op:"a"})}),this.clone(e)}set(t,e){return this.clone({param:t,value:e,op:"s"})}delete(t,e){return this.clone({param:t,value:e,op:"d"})}toString(){return this.init(),this.keys().map(t=>{let e=this.encoder.encodeKey(t);return this.map.get(t).map(n=>e+"="+this.encoder.encodeValue(n)).join("&")}).filter(t=>t!=="").join("&")}clone(t){let e=new r({encoder:this.encoder});return e.cloneFrom=this.cloneFrom||this,e.updates=(this.updates||[]).concat(t),e}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(t=>this.map.set(t,this.cloneFrom.map.get(t))),this.updates.forEach(t=>{switch(t.op){case"a":case"s":let e=(t.op==="a"?this.map.get(t.param):void 0)||[];e.push(Et(t.value)),this.map.set(t.param,e);break;case"d":if(t.value!==void 0){let n=this.map.get(t.param)||[],i=n.indexOf(Et(t.value));i!==-1&&n.splice(i,1),n.length>0?this.map.set(t.param,n):this.map.delete(t.param)}else{this.map.delete(t.param);break}}}),this.cloneFrom=this.updates=null)}};var wt=class{map=new Map;set(t,e){return this.map.set(t,e),this}get(t){return this.map.has(t)||this.map.set(t,t.defaultValue()),this.map.get(t)}delete(t){return this.map.delete(t),this}has(t){return this.map.has(t)}keys(){return this.map.keys()}};function hi(r){switch(r){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function ur(r){return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer}function dr(r){return typeof Blob<"u"&&r instanceof Blob}function fr(r){return typeof FormData<"u"&&r instanceof FormData}function pi(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}var hr="Content-Type",pr="Accept",gr="X-Request-URL",br="text/plain",yr="application/json",mi=`${yr}, ${br}, */*`,_e=class r{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(t,e,n,i){this.url=e,this.method=t.toUpperCase();let s;if(hi(this.method)||i?(this.body=n!==void 0?n:null,s=i):s=n,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params),this.transferCache=s.transferCache),this.headers??=new F,this.context??=new wt,!this.params)this.params=new re,this.urlWithParams=e;else{let o=this.params.toString();if(o.length===0)this.urlWithParams=e;else{let a=e.indexOf("?"),l=a===-1?"?":a<e.length-1?"&":"";this.urlWithParams=e+l+o}}}serializeBody(){return this.body===null?null:typeof this.body=="string"||ur(this.body)||dr(this.body)||fr(this.body)||pi(this.body)?this.body:this.body instanceof re?this.body.toString():typeof this.body=="object"||typeof this.body=="boolean"||Array.isArray(this.body)?JSON.stringify(this.body):this.body.toString()}detectContentTypeHeader(){return this.body===null||fr(this.body)?null:dr(this.body)?this.body.type||null:ur(this.body)?null:typeof this.body=="string"?br:this.body instanceof re?"application/x-www-form-urlencoded;charset=UTF-8":typeof this.body=="object"||typeof this.body=="number"||typeof this.body=="boolean"?yr:null}clone(t={}){let e=t.method||this.method,n=t.url||this.url,i=t.responseType||this.responseType,s=t.transferCache??this.transferCache,o=t.body!==void 0?t.body:this.body,a=t.withCredentials??this.withCredentials,l=t.reportProgress??this.reportProgress,c=t.headers||this.headers,h=t.params||this.params,d=t.context??this.context;return t.setHeaders!==void 0&&(c=Object.keys(t.setHeaders).reduce((u,p)=>u.set(p,t.setHeaders[p]),c)),t.setParams&&(h=Object.keys(t.setParams).reduce((u,p)=>u.set(p,t.setParams[p]),h)),new r(e,n,o,{params:h,headers:c,context:d,reportProgress:l,responseType:i,withCredentials:a,transferCache:s})}},me=function(r){return r[r.Sent=0]="Sent",r[r.UploadProgress=1]="UploadProgress",r[r.ResponseHeader=2]="ResponseHeader",r[r.DownloadProgress=3]="DownloadProgress",r[r.Response=4]="Response",r[r.User=5]="User",r}(me||{}),Le=class{headers;status;statusText;url;ok;type;constructor(t,e=200,n="OK"){this.headers=t.headers||new F,this.status=t.status!==void 0?t.status:e,this.statusText=t.statusText||n,this.url=t.url||null,this.ok=this.status>=200&&this.status<300}},vt=class r extends Le{constructor(t={}){super(t)}type=me.ResponseHeader;clone(t={}){return new r({headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},Je=class r extends Le{body;constructor(t={}){super(t),this.body=t.body!==void 0?t.body:null}type=me.Response;clone(t={}){return new r({body:t.body!==void 0?t.body:this.body,headers:t.headers||this.headers,status:t.status!==void 0?t.status:this.status,statusText:t.statusText||this.statusText,url:t.url||this.url||void 0})}},Ye=class extends Le{name="HttpErrorResponse";message;error;ok=!1;constructor(t){super(t,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${t.url||"(unknown url)"}`:this.message=`Http failure response for ${t.url||"(unknown url)"}: ${t.status} ${t.statusText}`,this.error=t.error||null}},gi=200,bi=204;function rn(r,t){return{body:t,headers:r.headers,context:r.context,observe:r.observe,params:r.params,reportProgress:r.reportProgress,responseType:r.responseType,withCredentials:r.withCredentials,transferCache:r.transferCache}}var Me=(()=>{class r{handler;constructor(e){this.handler=e}request(e,n,i={}){let s;if(e instanceof _e)s=e;else{let l;i.headers instanceof F?l=i.headers:l=new F(i.headers);let c;i.params&&(i.params instanceof re?c=i.params:c=new re({fromObject:i.params})),s=new _e(e,n,i.body!==void 0?i.body:null,{headers:l,context:i.context,params:c,reportProgress:i.reportProgress,responseType:i.responseType||"json",withCredentials:i.withCredentials,transferCache:i.transferCache})}let o=T(s).pipe(ot(l=>this.handler.handle(l)));if(e instanceof _e||i.observe==="events")return o;let a=o.pipe(st(l=>l instanceof Je));switch(i.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(R(l=>{if(l.body!==null&&!(l.body instanceof ArrayBuffer))throw new Y(2806,!1);return l.body}));case"blob":return a.pipe(R(l=>{if(l.body!==null&&!(l.body instanceof Blob))throw new Y(2807,!1);return l.body}));case"text":return a.pipe(R(l=>{if(l.body!==null&&typeof l.body!="string")throw new Y(2808,!1);return l.body}));case"json":default:return a.pipe(R(l=>l.body))}case"response":return a;default:throw new Y(2809,!1)}}delete(e,n={}){return this.request("DELETE",e,n)}get(e,n={}){return this.request("GET",e,n)}head(e,n={}){return this.request("HEAD",e,n)}jsonp(e,n){return this.request("JSONP",e,{params:new re().append(n,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(e,n={}){return this.request("OPTIONS",e,n)}patch(e,n,i={}){return this.request("PATCH",e,rn(i,n))}post(e,n,i={}){return this.request("POST",e,rn(i,n))}put(e,n,i={}){return this.request("PUT",e,rn(i,n))}static \u0275fac=function(n){return new(n||r)(C(Fe))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})();var yi=new P("");function Er(r,t){return t(r)}function Ei(r,t){return(e,n)=>t.intercept(e,{handle:i=>r(i,n)})}function Di(r,t,e){return(n,i)=>gn(e,()=>t(n,s=>r(s,i)))}var Dr=new P(""),on=new P(""),wr=new P(""),an=new P("",{providedIn:"root",factory:()=>!0});function wi(){let r=null;return(t,e)=>{r===null&&(r=(S(Dr,{optional:!0})??[]).reduceRight(Ei,Er));let n=S(kt);if(S(an)){let s=n.add();return r(t,e).pipe(Pt(()=>n.remove(s)))}else return r(t,e)}}var Ct=(()=>{class r extends Fe{backend;injector;chain=null;pendingTasks=S(kt);contributeToStability=S(an);constructor(e,n){super(),this.backend=e,this.injector=n}handle(e){if(this.chain===null){let n=Array.from(new Set([...this.injector.get(on),...this.injector.get(wr,[])]));this.chain=n.reduceRight((i,s)=>Di(i,s,this.injector),Er)}if(this.contributeToStability){let n=this.pendingTasks.add();return this.chain(e,i=>this.backend.handle(i)).pipe(Pt(()=>this.pendingTasks.remove(n)))}else return this.chain(e,n=>this.backend.handle(n))}static \u0275fac=function(n){return new(n||r)(C(Ze),C(mn))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})();var vi=/^\)\]\}',?\n/,Ci=RegExp(`^${gr}:`,"m");function Si(r){return"responseURL"in r&&r.responseURL?r.responseURL:Ci.test(r.getAllResponseHeaders())?r.getResponseHeader(gr):null}var sn=(()=>{class r{xhrFactory;constructor(e){this.xhrFactory=e}handle(e){if(e.method==="JSONP")throw new Y(-2800,!1);let n=this.xhrFactory;return(n.\u0275loadImpl?fn(n.\u0275loadImpl()):T(null)).pipe(Ie(()=>new dn(s=>{let o=n.build();if(o.open(e.method,e.urlWithParams),e.withCredentials&&(o.withCredentials=!0),e.headers.forEach((g,b)=>o.setRequestHeader(g,b.join(","))),e.headers.has(pr)||o.setRequestHeader(pr,mi),!e.headers.has(hr)){let g=e.detectContentTypeHeader();g!==null&&o.setRequestHeader(hr,g)}if(e.responseType){let g=e.responseType.toLowerCase();o.responseType=g!=="json"?g:"text"}let a=e.serializeBody(),l=null,c=()=>{if(l!==null)return l;let g=o.statusText||"OK",b=new F(o.getAllResponseHeaders()),f=Si(o)||e.url;return l=new vt({headers:b,status:o.status,statusText:g,url:f}),l},h=()=>{let{headers:g,status:b,statusText:f,url:E}=c(),w=null;b!==bi&&(w=typeof o.response>"u"?o.responseText:o.response),b===0&&(b=w?gi:0);let D=b>=200&&b<300;if(e.responseType==="json"&&typeof w=="string"){let O=w;w=w.replace(vi,"");try{w=w!==""?JSON.parse(w):null}catch(Z){w=O,D&&(D=!1,w={error:Z,text:w})}}D?(s.next(new Je({body:w,headers:g,status:b,statusText:f,url:E||void 0})),s.complete()):s.error(new Ye({error:w,headers:g,status:b,statusText:f,url:E||void 0}))},d=g=>{let{url:b}=c(),f=new Ye({error:g,status:o.status||0,statusText:o.statusText||"Unknown Error",url:b||void 0});s.error(f)},u=!1,p=g=>{u||(s.next(c()),u=!0);let b={type:me.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(b.total=g.total),e.responseType==="text"&&o.responseText&&(b.partialText=o.responseText),s.next(b)},m=g=>{let b={type:me.UploadProgress,loaded:g.loaded};g.lengthComputable&&(b.total=g.total),s.next(b)};return o.addEventListener("load",h),o.addEventListener("error",d),o.addEventListener("timeout",d),o.addEventListener("abort",d),e.reportProgress&&(o.addEventListener("progress",p),a!==null&&o.upload&&o.upload.addEventListener("progress",m)),o.send(a),s.next({type:me.Sent}),()=>{o.removeEventListener("error",d),o.removeEventListener("abort",d),o.removeEventListener("load",h),o.removeEventListener("timeout",d),e.reportProgress&&(o.removeEventListener("progress",p),a!==null&&o.upload&&o.upload.removeEventListener("progress",m)),o.readyState!==o.DONE&&o.abort()}})))}static \u0275fac=function(n){return new(n||r)(C(je))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),vr=new P(""),Ti="XSRF-TOKEN",Ai=new P("",{providedIn:"root",factory:()=>Ti}),_i="X-XSRF-TOKEN",Fi=new P("",{providedIn:"root",factory:()=>_i}),Xe=class{},Li=(()=>{class r{doc;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(e,n){this.doc=e,this.cookieName=n}getToken(){let e=this.doc.cookie||"";return e!==this.lastCookieString&&(this.parseCount++,this.lastToken=Jt(e,this.cookieName),this.lastCookieString=e),this.lastToken}static \u0275fac=function(n){return new(n||r)(C(De),C(Ai))};static \u0275prov=y({token:r,factory:r.\u0275fac})}return r})(),Mi=/^(?:https?:)?\/\//i;function Ri(r,t){if(!S(vr)||r.method==="GET"||r.method==="HEAD"||Mi.test(r.url))return t(r);let e=S(Xe).getToken(),n=S(Fi);return e!=null&&!r.headers.has(n)&&(r=r.clone({headers:r.headers.set(n,e)})),t(r)}var ln=function(r){return r[r.Interceptors=0]="Interceptors",r[r.LegacyInterceptors=1]="LegacyInterceptors",r[r.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",r[r.NoXsrfProtection=3]="NoXsrfProtection",r[r.JsonpSupport=4]="JsonpSupport",r[r.RequestsMadeViaParent=5]="RequestsMadeViaParent",r[r.Fetch=6]="Fetch",r}(ln||{});function xi(r,t){return{\u0275kind:r,\u0275providers:t}}function Cr(...r){let t=[Me,sn,Ct,{provide:Fe,useExisting:Ct},{provide:Ze,useFactory:()=>S(yi,{optional:!0})??S(sn)},{provide:on,useValue:Ri,multi:!0},{provide:vr,useValue:!0},{provide:Xe,useClass:Li}];for(let e of r)t.push(...e.\u0275providers);return pn(t)}var mr=new P("");function Sr(){return xi(ln.LegacyInterceptors,[{provide:mr,useFactory:wi},{provide:on,useExisting:mr,multi:!0}])}var Ni=(()=>{class r{static \u0275fac=function(n){return new(n||r)};static \u0275mod=ye({type:r});static \u0275inj=ge({providers:[Cr(Sr())]})}return r})();var St=class r{constructor(t,e){this.http=t;this.appParams=e}getSVGTemplate(t){let e=`${this.appParams.apiUrl}DataSheets/${t}`,n=this.appParams.token,i=new F({Authorization:`bearer ${n}`});return this.http.get(e,{headers:i}).pipe(M(s=>(console.error("Error in getSVGTemplate",s),T(null))))}getTemplateBackgroundsList(t){let e=`${this.appParams.apiUrl}DataSheets/backgrounds/template?templateId=${t}`,n=this.appParams.token,i=new F({Authorization:`bearer ${n}`});return this.http.get(e,{headers:i}).pipe(M(s=>(console.error("Error in getTemplateBackgroundsList",s),T(null))))}getSVGDocumentPages(t){let e=`${this.appParams.apiUrl}dam/documents/${t}`,n=this.appParams.token,i=new F({Authorization:`bearer ${n}`});return this.http.get(e,{headers:i}).pipe(M(s=>(console.error("Error in getSVGDocumentPages",s),T(null))))}getTemplateDimensions(){let t=`${this.appParams.apiUrl}DataSheets/templateDimensions`,e=this.appParams.token,n=new F({Authorization:`bearer ${e}`});return this.http.get(t,{headers:n}).pipe(M(i=>(console.error("Error in getTemplateDimensions",i),T(null))))}saveDocument(t,e){switch(t){case"productblock":t="productblocks";break;case"background":t="backgrounds";break;case"cover":t="coverpages";break;case"marketing":t="marketing";break;case"document":t="documents";break;default:break}let n=`${this.appParams.apiUrl}DataSheets/upload/${t.toLowerCase()}`,i=new F({Authorization:`bearer ${this.appParams.token}`});return this.http.post(n,e,{headers:i}).pipe(M(s=>(console.error("Error saving document",s),T(null))))}loadSvgFromUrl(t){let e=Date.now(),n=t.includes("?")?"&":"?",i=`${t}${n}date=${e}`;return this.http.get(i,{responseType:"text"}).pipe(M(s=>(console.error("Error loading SVG from URL",s),T(""))))}addDocumentPage(t,e){let n=`${this.appParams.apiUrl}Dam/documents/page`,i=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"}),s={assetGuid:t};return e!=null&&(s.start=e),this.http.post(n,s,{headers:i}).pipe(R(o=>o?.addPageToDocument),M(o=>(console.error("Error adding document page",o),T(null))))}duplicateDocumentPage(t,e){let n=`${this.appParams.apiUrl}Dam/documents/page`,i=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"});return this.http.post(n,{assetGuid:t,fileGuid:e},{headers:i}).pipe(R(s=>s?.addPageToDocument),M(s=>(console.error("Error duplicating document page",s),T(null))))}moveDocumentPage(t,e,n){let i=`${this.appParams.apiUrl}Dam/documents/page/${t}/${e}/${n}`,s=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"});return this.http.put(i,null,{headers:s}).pipe(R(o=>o?.movePageOfDocument),M(o=>(console.error("Error moving document page",o),T(null))))}deleteDocumentPage(t,e){let n=`${this.appParams.apiUrl}Dam/documents/page/${t}/${e}`,i=new F({Authorization:`bearer ${this.appParams.token}`});return this.http.delete(n,{headers:i}).pipe(R(s=>s?.deletePageOfDocument),M(s=>(console.error("Error deleting document page",s),T(null))))}updateTemplateField(t,e){let n=`${this.appParams.apiUrl}DataSheets/field`,i=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"});return this.http.put(n,{publicationTemplateGuid:this.appParams.guid,fieldName:t,fieldValue:e},{headers:i}).pipe(M(s=>(console.error("Error updating template field",s),T(null))))}getTemplates(){let t=`${this.appParams.apiUrl}DataSheets/publicationstemplates`,e=new F({Authorization:`bearer ${this.appParams.token}`});return this.http.get(t,{headers:e}).pipe(R(n=>n?.Gabarits||[]),M(n=>(console.error("Error fetching templates",n),T([]))))}publishYoubooky(){let t=`${this.appParams.apiUrl}DataSheets/youbooky`,e=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"}),n={documentGuid:this.appParams.guid,isPublication:!1};return this.http.post(t,n,{headers:e}).pipe(M(i=>(console.error("Error publishing to Youbooky",i),T(null))))}checkPdfExistence(){let t=`${this.appParams.apiUrl}Dam/documents/exist/${this.appParams.guid}`,e=new F({Authorization:`bearer ${this.appParams.token}`});return this.http.get(t,{headers:e}).pipe(M(n=>(console.error("Error checking PDF existence",n),T(null))))}generatePdf(t=!1){let e=`${this.appParams.apiUrl}DataSheets/generate/svg`,n=new F({Authorization:`bearer ${this.appParams.token}`,"Content-Type":"application/json"}),i={source:6,sourceGuid:this.appParams.guid,type:1,highDefinition:t,language:this.appParams.language};return this.http.post(e,i,{headers:n}).pipe(M(s=>(console.error("Error generating PDF",s),T(null))))}static \u0275fac=function(e){return new(e||r)(C(Me),C(ee))};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var Qe="1.104";function Ii(r){let t=r.getAttribute("data-sp-version");if(!t){let s=r.getAttribute("version");t=s&&s!=="1.1"?s:"1.0"}let e=["1.0","1.1","1.101","1.102","1.103","1.104"],n=e.indexOf(t);if(n===-1)return console.warn("Unknown version:",t),!1;if(n===e.length-1)return r.setAttribute("data-sp-version",t),r.setAttribute("version","1.1"),!1;let i=!1;for(let s=n+1;s<e.length;s++){let o=e[s],a=Bi[o];typeof a=="function"&&(a(r),r.setAttribute("data-sp-version",o),r.setAttribute("version","1.1"),i=!0)}return i}var Ar=["B","I","U","FONT"];function _r(r,t){if(!r.trim())return null;let e=document.createElement("tspan"),n=e,i=t.slice();for(let s=i.length-1;s>=0;s--){let o=document.createElement(i[s].nodeName.toLowerCase());for(let a of Array.from(i[s].attributes))o.setAttribute(a.name,a.value);n.appendChild(o),n=o}return n.textContent=r,e}function ki(r){let t=/\{\{([^}]+)\}\}/g,e=[];function n(i,s=[]){if(i.nodeType===Node.TEXT_NODE){let o=i.textContent||"",a=0,l;for(;(l=t.exec(o))!==null;){let d=o.slice(a,l.index),u=l[0];a=t.lastIndex;let p=null;d&&(p=_r(d,s)),p||(p=document.createElement("tspan")),e.push(p);let m=l[1],g=s.every(f=>Ar.includes(f.nodeName)),b=document.createElement("tspan");if(b.setAttribute("class","textAttribute"),b.setAttribute("contenteditable","false"),b.setAttribute("data-info",m),b.setAttribute("data-show-text","true"),g){let f=b;for(let E=s.length-1;E>=0;E--){let w=document.createElement(s[E].nodeName.toLowerCase());for(let D of Array.from(s[E].attributes))w.setAttribute(D.name,D.value);f.appendChild(w),f=w}f.textContent=m}else b.textContent=m;e.push(b)}let c=o.slice(a),h=null;c&&(h=_r(c,s)),h||(h=document.createElement("tspan")),e.push(h)}else if(i.nodeType===Node.ELEMENT_NODE&&Ar.includes(i.nodeName))for(let o of Array.from(i.childNodes))n(o,[...s,i]);else for(let o of Array.from(i.childNodes))n(o,s)}return n(r),e}var Bi={"1.1":r=>{},"1.101":r=>{r.querySelectorAll('foreignObject[data-type="text"] > div > *:not(div)').forEach(n=>{let i=document.createElement("div");i.innerHTML=n.outerHTML,i.setAttribute("data-info",n.getAttribute("data-info")||""),n.replaceWith(i)}),r.querySelectorAll('foreignObject[data-type="text"] > div > div:not(.textAttribute)').forEach(n=>{let i=document.createElement("div");i.innerHTML=n.innerHTML;let s=ki(i).filter(a=>a!==null),o=document.createElement("div");o.setAttribute("data-info",n.getAttribute("data-info")||""),s.forEach(a=>o.appendChild(a)),n.replaceWith(o)})},"1.102":r=>{let t=/(.*?)\{\{(.*?)\}\}(.*)/;r.querySelectorAll('foreignObject[data-type="variantsTable"]').forEach(n=>{let i=n.querySelector("tbody");if(!i||i.children.length<2)return;Array.from(i.children[1].children).forEach(o=>{let a=o.querySelector(".cellContent");if(!a)return;let c=(a.textContent||"").match(t);c&&(a.innerHTML=`<tspan></tspan><tspan class="textAttribute">${c[2]}</tspan><tspan></tspan>`)})})},"1.103":r=>{r.querySelectorAll('foreignObject[data-type="productTable"]').forEach(e=>{let n=e.querySelector("tbody");if(!n)return;Array.from(n.querySelectorAll("tr")).forEach(s=>{if(s.classList.contains("columns-index-row"))return;Array.from(s.children).forEach(a=>{if(a.classList.contains("row-index-cell"))return;let l=a,c=l.textContent?.trim();if(!c)return;let h=/\{\{(.+?)\}\}/g,d=0,u="";u+="<tspan></tspan>";let p;for(;(p=h.exec(c))!==null;){let g=c.slice(d,p.index),b=p[1];g&&(u+=`<tspan>${g}</tspan>`),u+=`<tspan class="textAttribute" contenteditable="false">${b}</tspan>`,d=h.lastIndex}let m=c.slice(d);m&&(u+=`<tspan>${m}</tspan>`),u+="<tspan></tspan>",l.innerHTML=u})})})},"1.104":r=>{r.querySelectorAll('foreignObject[data-type="variantsTable"] table, foreignObject[data-type="productTable"] table').forEach(i=>{let s=i;s.style.removeProperty("height"),s.style.minWidth==="var(--min-width)"&&s.style.removeProperty("min-width")}),r.querySelectorAll('foreignObject[data-type="variantsTable"], foreignObject[data-type="productTable"]').forEach(i=>{i.style.removeProperty("--min-width")}),r.querySelectorAll('foreignObject[data-type="productTable"] .wrap').forEach(i=>{i.removeAttribute("style")})}};function Vi(r){r.querySelectorAll('foreignObject[data-type="text"], foreignObject[data-type="variantsTable"], foreignObject[data-type="productTable"]').forEach(e=>{e.querySelectorAll("tspan.textAttribute").forEach(n=>{let i=n;for(;i.children.length>0;)i=i.children[0];let o=i.innerHTML.replace(/^\{\{(.*)\}\}$/,"$1");i.innerHTML=o,i.setAttribute("data-info",o)})})}function Fr(r){r.querySelectorAll('foreignObject[data-type="text"], foreignObject[data-type="variantsTable"], foreignObject[data-type="productTable"]').forEach(e=>{e.querySelectorAll("tspan.textAttribute").forEach(n=>{let i=n;for(;i.children.length>0;)i=i.children[0];let s=i.innerHTML;!s.startsWith("{{")&&!s.endsWith("}}")&&(i.innerHTML=`{{${s}}}`,i.setAttribute("data-info",`{{${s}}}`))})})}function Ui(r){r.querySelectorAll("[data-type='text']").forEach(e=>{let n=e.querySelector("style");n&&n.remove()})}function Gi(r){let t=r.querySelector("#Block");t&&t.remove()}function $i(r){let t=Array.from(r.children).filter(e=>e.tagName.toLowerCase()==="g"&&!e.hasAttribute("data-side"));if(t.length===1)t[0].removeAttribute("id");else if(t.length>1){let e=0;t.forEach(n=>{if(!n.id){let i=1;for(;r.querySelector(`#group_${i}`);)i++;let s=`group_${i}`;n.setAttribute("id",s),e++}})}t.forEach(e=>{e.style.pointerEvents="all"})}function Ha(r){zi(r),Ki(r),Gi(r);let t=Ii(r);return Vi(r),Ui(r),Hi(r),ji(r),$i(r),qi(r),t}function ji(r){r.querySelectorAll("style").forEach(e=>e.remove())}function Hi(r){let t=Array.from(r.querySelectorAll("g")),e=null;if(e=t.find(n=>{if(n.getAttribute("data-side")==="left")return!0;let i=n.querySelector("title");return i&&i.textContent?.trim()==="Layer 1"})||null,!e){let i=Array.from(r.children).filter(s=>s.tagName.toLowerCase()!=="defs").filter(s=>s.tagName.toLowerCase()==="g");i.length>0&&(e=i[0])}}function zi(r){Wi(r)}function qi(r){let t=r.getAttribute("fill"),e=r.style.backgroundColor;(!t||t==="none"||t==="transparent")&&(!e||e==="none"||e==="transparent")&&(r.style.backgroundColor="#FFFFFF")}function Wi(r){let t=r.querySelectorAll('foreignObject[data-type="text"]')}function Ki(r){r.querySelectorAll("*").forEach(e=>{if(e instanceof SVGElement&&e.hasAttribute("style")){let n=e.getAttribute("style");n&&n.split(";").forEach(s=>{let o=s.split(":");if(o.length>1){let a=o[0].trim(),l=o.slice(1).join(":").trim();a&&l&&["fill","stroke","stroke-width","opacity","font-size","font-family"].includes(a)&&(e.hasAttribute(a)||e.setAttribute(a,l))}})}})}function za(r){return r=r.replace(/<DIV/g,"<div").replace(/<\/DIV/g,"</div").replace(/<SPAN/g,"<tspan").replace(/<\/SPAN/g,"</tspan").replace(/<span/g,"<tspan").replace(/<\/span/g,"</tspan").replace(/<TSPAN/g,"<tspan").replace(/<\/TSPAN/g,"</tspan").replace(/<I>/g,"<i>").replace(/<\/I>/g,"</i>").replace(/<B>/g,"<b>").replace(/<\/B>/g,"</b>").replace(/<U>/g,"<u>").replace(/<\/U>/g,"</u>").replace(/<col(?!group)([^>]*)\/>/g,"<col$1>").replace(/<col(?!group)([^>]*)>/g,"<col$1/>"),r=r.replace(/{{Modèle code \(Déclinaison\)}}/g,"{{R\xE9f\xE9rence (D\xE9clinaison)}}"),r=r.replace(/{{Model code \(Variant\)}}/g,"{{Reference (Variant)}}"),r=r.replace(/{{Código de modelo SKU \(Declinación\)}}/g,"{{Referencia (Declinaci\xF3n)}}"),r=r.replace(/{{Modelcode \(Varianten\)}}/g,"{{Referentie (Varianten)}}"),r}function Zi(r){let t="",e=0;for(;;){let n=r.indexOf("<!--",e);if(n===-1){t+=r.slice(e);break}t+=r.slice(e,n);let i=r.indexOf("-->",n+4);if(i===-1)break;e=i+3}return t}function Ji(r){let t="<TSPAN",e=t.length,n="",i=0;for(;;){let s=r.indexOf(t,i);if(s===-1){n+=r.slice(i);break}let o=s,a=!0;for(;a;){for(a=!1;o>0&&(r[o-1]===" "||r[o-1]===" "||r[o-1]===`
3
+ `||r[o-1]==="\r");)o--,a=!0;let l="-->";if(o>=l.length&&r.slice(o-l.length,o)===l){let c=r.lastIndexOf("<!--",o-l.length);c!==-1&&c<o&&(o=c,a=!0)}}o>0&&r[o-1]===">"?n+=r.slice(i,o):n+=r.slice(i,s),n+=t,i=s+e}return n}function Lr(r){return r=Zi(r),r=r.replace(/<div([^>]*)\s*\/>/gi,"<div$1></div>"),r=r.replace(/<font([^>]*)\s*\/>/gi,"<font$1></font>"),r=r.replace(/<b(?=\s|\/)([^>]*)\/>/gi,"<b$1></b>"),r=r.replace(/<br(?=\s|\/)([^>]*)\/>/gi,"<br$1></br>"),r=r.replace(/<tspan\b/gi,"<TSPAN"),r=r.replace(/<\/tspan\s*>/gi,"</TSPAN>"),r=r.replace(/<TSPAN\b([^>]*)>([\s\S]*?)<\/TSPAN>/gi,(t,e,n)=>{let i=n.replace(/\s*\n\s*/g,"");return`<TSPAN${e}>${i}</TSPAN>`}),r=Ji(r),r=r.replace(/<TSPAN([^>]*)\s*\/>/gi,"<TSPAN$1></TSPAN>"),r=r.replace(/{{Référence \(Déclinaison\)}}/g,"{{Mod\xE8le code (D\xE9clinaison)}}"),r=r.replace(/{{Reference \(Variant\)}}/g,"{{Model code (Variant)}}"),r=r.replace(/{{Referencia \(Declinación\)}}/g,"{{C\xF3digo de modelo SKU (Declinaci\xF3n)}}"),r=r.replace(/{{Referentie \(Varianten\)}}/g,"{{Modelcode (Varianten)}}"),r=r.replace(/xmlns:undefined="[^"]*"/g,""),r=r.replace(/&quot;/g,"'"),r=r.replace(/font-family:\s*['"]*([^;'"\n\r]+?)['"]*(?=[;"]|$)/g,(t,e)=>{let n=e.trim();return n.includes(" ")?`font-family: '${n}'`:`font-family: ${n}`}),r=r.replace(/<line\b[^>]*\bclass="[^"]*\bsnappingLine\b[^"]*"[^>]*>[\s\S]*?<\/line>/g,""),r=r.replace(/<col(?!group)([^>]*?)(?<!\/)>/g,"<col$1/>"),r=r.replace(/<img([^>]*?)(?<!\/)>/g,"<img$1/>"),r=r.replace(/&nbsp;/g," "),r=r.replace(/<br\s*\/?>\s*<\/br>/g,"<br/>"),r=r.replace(/<br>/g,"<br/>"),r=Yi(r),r}function Yi(r){return r.replace(/font-family:\s*['"]?([^;'"\n\r]+?)['"]?(?=[;"]|$)/g,(t,e)=>{let n=e.trim();return`font-family: ${n.includes(" ")?`'${n}'`:n}`})}var N=class{static canvasService;static documentRoot;static setDocumentRoot(t){this.documentRoot=t}static setCanvasService(t){this.canvasService=t}static getDocumentRoot(){return this.documentRoot}static getElementById(t){if(!t)return null;let e=this.getDocumentRoot();return e&&"getElementById"in e?e.getElementById(t):e&&"querySelector"in e?e.querySelector(`[id="${t}"]`):document.getElementById(t)}static getSelection(){let t=this.getDocumentRoot();if(t&&typeof t.getSelection=="function"){let e=t.getSelection();if(e)return e}return window.getSelection()}static create(t,e={}){e.id=this.getNextId(e["data-type"]||t);let n=document.createElementNS("http://www.w3.org/2000/svg",t);for(let i in e)e.hasOwnProperty(i)&&n.setAttribute(i,e[i]);return n}static findParent(t,e){let n=t.parentNode;for(;n;){if(n.nodeName.toLowerCase()===e.toLowerCase())return n;n=n.parentNode}return null}static getElementType(t){return t?t.getAttribute("data-type")||t.tagName.toLowerCase():null}static getNextId(t){let n=this.canvasService?.drawingGroup||this.getDocumentRoot()?.querySelector(".drawing-layer");if(!n){console.warn("No container found for element type: "+t);let o=this.getDocumentRoot()||document,a=1,l=`${t}_${a}`;for(;o.querySelector(`#${l}`);)a++,l=`${t}_${a}`;return l}t==="dynamicImage"&&(t="image");let i=1,s=`${t}_${i}`;for(;n.querySelector(`#${s}`);)i++,s=`${t}_${i}`;return s}static cloneWithNewIds(t,e=new Set){let n=t.cloneNode(!0),i=this.canvasService?.drawingGroup||this.getDocumentRoot()?.querySelector(".drawing-layer"),s=a=>{let l=a;l==="dynamicImage"&&(l="image");let c=1,h=`${l}_${c}`;for(;i&&i.querySelector(`#${h}`)||e.has(h);)c++,h=`${l}_${c}`;return e.add(h),h},o=a=>{if(a.hasAttribute("id")){let l=this.getElementType(a)||a.tagName.toLowerCase();a.setAttribute("id",s(l))}Array.from(a.children).forEach(l=>{l instanceof SVGElement&&o(l)})};return o(n),n}static getRotation(t){let e=t.getAttribute("transform");if(!e)return 0;let n=e.match(/rotate\(([-+]?\d*\.?\d+)/);return n?Number.parseFloat(n[1]):0}static setAttribute(t,e,n){if(!t)return;let i=this.getElementType(t);switch(e){case"x":this.setX(t,i,n);break;case"y":this.setY(t,i,n);break;case"width":this.setWidth(t,i,n);break;case"height":this.setHeight(t,i,n);break;case"rotation":this.setRotation(t,n);break;default:t.setAttribute(e,String(n));break}}static setX(t,e,n){if(e==="circle"||e==="ellipse")t.setAttribute("cx",String(n));else if(e==="path"||e==="g"||e==="line"){let s=0;e==="line"?s=Number(t.getAttribute("x1")||0):s=t.getBBox().x;let o=Number(n)-s;Math.abs(o)>.001&&this.shiftElement(t,o,0)}else t.setAttribute("x",String(n));let i=this.getRotation(t);Math.abs(i)>.001&&this.setRotation(t,i)}static setY(t,e,n){if(e==="circle"||e==="ellipse")t.setAttribute("cy",String(n));else if(e==="path"||e==="g"||e==="line"){let s=0;e==="line"?s=Number(t.getAttribute("y1")||0):s=t.getBBox().y;let o=Number(n)-s;Math.abs(o)>.001&&this.shiftElement(t,0,o)}else t.setAttribute("y",String(n));let i=this.getRotation(t);Math.abs(i)>.001&&this.setRotation(t,i)}static shiftElement(t,e,n){if(Math.abs(e)<.001&&Math.abs(n)<.001)return;let i=this.getElementType(t);if(i==="g")Array.from(t.children).forEach(o=>{o instanceof SVGElement&&this.shiftElement(o,e,n)});else if(i==="path"){let o=t.getAttribute("d")||"";t.setAttribute("d",this.shiftPath(o,e,n))}else if(i==="circle"||i==="ellipse"){let o=Number(t.getAttribute("cx")||0),a=Number(t.getAttribute("cy")||0);t.setAttribute("cx",String(o+e)),t.setAttribute("cy",String(a+n))}else if(i==="line"){let o=Number(t.getAttribute("x1")||0),a=Number(t.getAttribute("y1")||0),l=Number(t.getAttribute("x2")||0),c=Number(t.getAttribute("y2")||0);t.setAttribute("x1",String(o+e)),t.setAttribute("y1",String(a+n)),t.setAttribute("x2",String(l+e)),t.setAttribute("y2",String(c+n))}else{let o=Number(t.getAttribute("x")||0),a=Number(t.getAttribute("y")||0);t.setAttribute("x",String(o+e)),t.setAttribute("y",String(a+n))}let s=this.getRotation(t);Math.abs(s)>.001&&this.setRotation(t,s)}static setWidth(t,e,n){let i=Number(n);if(e==="circle")t.setAttribute("r",String(i/2));else if(e==="ellipse")t.setAttribute("rx",String(i/2));else if(e==="path"||e==="g"){let o=t.getBBox();if(o.width>0){let a=i/o.width;this.scaleElement(t,a,1,o.x,o.y)}}else t.setAttribute("width",String(n));let s=this.getRotation(t);Math.abs(s)>.001&&this.setRotation(t,s)}static setHeight(t,e,n){let i=Number(n);if(e==="circle")t.setAttribute("r",String(i/2));else if(e==="ellipse")t.setAttribute("ry",String(i/2));else if(e==="path"||e==="g"){let o=t.getBBox();if(o.height>0){let a=i/o.height;this.scaleElement(t,1,a,o.x,o.y)}}else t.setAttribute("height",String(n));let s=this.getRotation(t);Math.abs(s)>.001&&this.setRotation(t,s)}static scaleElement(t,e,n,i,s){if(Math.abs(e-1)<.001&&Math.abs(n-1)<.001)return;let o=this.getElementType(t);if(o==="g")Array.from(t.children).forEach(l=>{l instanceof SVGElement&&this.scaleElement(l,e,n,i,s)});else if(o==="path"){let l=t.getBBox(),c=t.getAttribute("d")||"",h=l.width*e,d=l.height*n,u=i+(l.x-i)*e,p=s+(l.y-s)*n;t.setAttribute("d",this.scalePath(c,l,u,p,h,d))}else if(o==="circle"){let l=Number(t.getAttribute("cx")||0),c=Number(t.getAttribute("cy")||0),h=Number(t.getAttribute("r")||0);t.setAttribute("cx",String(i+(l-i)*e)),t.setAttribute("cy",String(s+(c-s)*n)),t.setAttribute("r",String(h*Math.sqrt(e*n)))}else if(o==="ellipse"){let l=Number(t.getAttribute("cx")||0),c=Number(t.getAttribute("cy")||0),h=Number(t.getAttribute("rx")||0),d=Number(t.getAttribute("ry")||0);t.setAttribute("cx",String(i+(l-i)*e)),t.setAttribute("cy",String(s+(c-s)*n)),t.setAttribute("rx",String(h*e)),t.setAttribute("ry",String(d*n))}else if(o==="line"){let l=Number(t.getAttribute("x1")||0),c=Number(t.getAttribute("y1")||0),h=Number(t.getAttribute("x2")||0),d=Number(t.getAttribute("y2")||0);t.setAttribute("x1",String(i+(l-i)*e)),t.setAttribute("y1",String(s+(c-s)*n)),t.setAttribute("x2",String(i+(h-i)*e)),t.setAttribute("y2",String(s+(d-s)*n))}else{let l=Number(t.getAttribute("x")||0),c=Number(t.getAttribute("y")||0),h=Number(t.getAttribute("width")||0),d=Number(t.getAttribute("height")||0);t.setAttribute("x",String(i+(l-i)*e)),t.setAttribute("y",String(s+(c-s)*n)),t.setAttribute("width",String(h*e)),t.setAttribute("height",String(d*n))}let a=this.getRotation(t);Math.abs(a)>.001&&this.setRotation(t,a)}static setRotation(t,e){let n=Number(e),i=t.getBBox?t.getBBox():{x:0,y:0,width:0,height:0},s=i.x+i.width/2,o=i.y+i.height/2,a=t.getAttribute("transform")||"";if(a=a.replace(/rotate\([^)]+\)/g,"").trim(),Math.abs(n)>.001){let l=`rotate(${n} ${s} ${o})`;t.setAttribute("transform",`${a} ${l}`.trim())}else a?t.setAttribute("transform",a):t.removeAttribute("transform")}static shiftPath(t,e,n){return this.transformPath(t,1,1,e,n)}static scalePath(t,e,n,i,s,o){let a=e.width===0?1:s/e.width,l=e.height===0?1:o/e.height,c=n-e.x*a,h=i-e.y*l;return this.transformPath(t,a,l,c,h)}static transformPath(t,e,n,i,s){let o=/([MmLlHhVvCcSsQqTtAaZz])([^MmLlHhVvCcSsQqTtAaZz]*)/g,a,l="",c=!0;for(;(a=o.exec(t))!==null;){let h=a[1],d=a[2].trim(),u=d?d.match(/[-+]?(?:\d*\.\d+|\d+)(?:[eE][-+]?\d+)?/g)?.map(Number)||[]:[],p=h.toUpperCase(),m=h===h.toLowerCase()&&p!=="Z",g=[];switch(p){case"M":for(let f=0;f<u.length;f+=2){let E=m;c&&f===0&&(E=!1),E?g.push(u[f]*e,u[f+1]*n):g.push(u[f]*e+i,u[f+1]*n+s)}c&&(c=!1);break;case"L":case"T":for(let f=0;f<u.length;f+=2)m?g.push(u[f]*e,u[f+1]*n):g.push(u[f]*e+i,u[f+1]*n+s);c&&(c=!1);break;case"H":for(let f=0;f<u.length;f++)g.push(m?u[f]*e:u[f]*e+i);break;case"V":for(let f=0;f<u.length;f++)g.push(m?u[f]*n:u[f]*n+s);break;case"C":for(let f=0;f<u.length;f+=6)m?(g.push(u[f]*e,u[f+1]*n),g.push(u[f+2]*e,u[f+3]*n),g.push(u[f+4]*e,u[f+5]*n)):(g.push(u[f]*e+i,u[f+1]*n+s),g.push(u[f+2]*e+i,u[f+3]*n+s),g.push(u[f+4]*e+i,u[f+5]*n+s));break;case"S":case"Q":for(let f=0;f<u.length;f+=4)m?(g.push(u[f]*e,u[f+1]*n),g.push(u[f+2]*e,u[f+3]*n)):(g.push(u[f]*e+i,u[f+1]*n+s),g.push(u[f+2]*e+i,u[f+3]*n+s));break;case"A":for(let f=0;f<u.length;f+=7){g.push(Math.abs(u[f]*e),Math.abs(u[f+1]*n)),g.push(u[f+2]),g.push(u[f+3]);let E=u[f+4];e*n<0&&(E=E===1?0:1),g.push(E),m?g.push(u[f+5]*e,u[f+6]*n):g.push(u[f+5]*e+i,u[f+6]*n+s)}break;case"Z":break}let b=g.map(f=>Number.isInteger(f)?f:Number(f.toFixed(3)));l+=h+b.join(" ")+" "}return l.trim()}static setStyle(t,e,n){t&&t.style.setProperty(e,String(n))}static getStyle(t,e){return t?t.style.getPropertyValue(e):null}static removeAttribute(t,e){t.removeAttribute(e)}static toggleVisibility(t){if(!t)return;t.getAttribute("display")!=="none"?t.setAttribute("display","none"):t.removeAttribute("display")}static toggleLock(t){if(!t)return;t.getAttribute("data-protected")==="true"?t.removeAttribute("data-protected"):t.setAttribute("data-protected","true")}};var et=class{static isCtrlOrCmd(t){return t.ctrlKey||t.metaKey}static isShift(t){return t.shiftKey}static isAlt(t){return t.altKey}static getShortcutString(t){let e=this.isCtrlOrCmd(t)?"cmd_":"",n=t.key.toLowerCase();if(["control","meta","shift","alt"].includes(n))return n;let i=this.isShift(t)?"shift_":"",s=this.isAlt(t)?"alt_":"";return`${e}${i}${s}${n}`}};var Re=class r{_eventBus=new J;constructor(){this.initGlobalListeners()}emit(t,e){this._eventBus.next({type:t,payload:e})}on(t){return this._eventBus.asObservable().pipe(st(e=>e.type===t),R(e=>e.payload))}get all$(){return this._eventBus.asObservable()}initGlobalListeners(){window.addEventListener("keydown",t=>this.handleKeyDown(t)),window.addEventListener("keyup",t=>this.handleKeyUp(t))}handleKeyDown(t){if(t.repeat)return;let e=t.composedPath&&t.composedPath().length>0?t.composedPath()[0]:t.target,n=e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable,i=et.getShortcutString(t);if(i==="alt"){this.emit("SHORTCUT_ALT_DOWN"),N.getElementById("svg-editor")?.classList.add("altPressed");return}if(n&&!["cmd_s","cmd_z","cmd_y","cmd_shift_z","escape"].includes(i))return;let s=!0;switch(i){case"m":this.emit("SHORTCUT_TOOL_PAN");break;case"v":this.emit("SHORTCUT_TOOL_SELECT");break;case"t":this.emit("SHORTCUT_TOOL_TEXT");break;case"r":this.emit("SHORTCUT_TOOL_RECT");break;case"o":this.emit("SHORTCUT_TOOL_ELLIPSE");break;case"l":this.emit("SHORTCUT_TOOL_LINE");break;case"n":this.emit("SHORTCUT_TOOL_PENCIL");break;case"p":this.emit("SHORTCUT_TOOL_PATH");break;case"i":this.emit("SHORTCUT_TOOL_IMAGE");break;case"b":this.emit("SHORTCUT_TOOL_BARCODE");break;case"q":this.emit("SHORTCUT_TOOL_QRCODE");break;case"shift_x":this.emit("SHORTCUT_SWITCH_PAINT");break;case"cmd_s":this.emit("SHORTCUT_SAVE");break;case"cmd_z":this.emit("SHORTCUT_UNDO");break;case"cmd_y":this.emit("SHORTCUT_REDO");break;case"cmd_shift_z":this.emit("SHORTCUT_REDO");break;case"cmd_c":this.emit("SHORTCUT_COPY");break;case"cmd_v":this.emit("SHORTCUT_PASTE");break;case"cmd_x":this.emit("SHORTCUT_CUT");break;case"cmd_d":this.emit("SHORTCUT_DUPLICATE");break;case"cmd_u":this.emit("SHORTCUT_VIEW_SOURCE");break;case"cmd_a":this.emit("SHORTCUT_SELECT_ALL");break;case"cmd_g":this.emit("SHORTCUT_GROUP");break;case"cmd_shift_g":this.emit("SHORTCUT_UNGROUP");break;case"cmd_k":this.emit("SHORTCUT_PLACE_IMAGE");break;case"backspace":case"delete":this.emit("SHORTCUT_DELETE");break;case"cmd_arrowleft":this.emit("SHORTCUT_ROTATE",-1);break;case"cmd_arrowright":this.emit("SHORTCUT_ROTATE",1);break;case"cmd_shift_arrowleft":this.emit("SHORTCUT_ROTATE",-5);break;case"cmd_shift_arrowright":this.emit("SHORTCUT_ROTATE",5);break;case"shift_o":this.emit("SHORTCUT_CYCLE_ELEMENT",0);break;case"shift_p":this.emit("SHORTCUT_CYCLE_ELEMENT",1);break;case"shift_r":this.emit("SHORTCUT_TOGGLE_RULERS");break;case"cmd_+":this.emit("SHORTCUT_ZOOM_IN");break;case"cmd_-":this.emit("SHORTCUT_ZOOM_OUT");break;case"cmd_=":this.emit("SHORTCUT_ZOOM_RESET");break;case"arrowleft":this.emit("SHORTCUT_NUDGE",{dx:-1,dy:0});break;case"arrowright":this.emit("SHORTCUT_NUDGE",{dx:1,dy:0});break;case"arrowup":this.emit("SHORTCUT_NUDGE",{dx:0,dy:-1});break;case"arrowdown":this.emit("SHORTCUT_NUDGE",{dx:0,dy:1});break;case"shift_arrowleft":this.emit("SHORTCUT_JUMP",{dx:-1,dy:0});break;case"shift_arrowright":this.emit("SHORTCUT_JUMP",{dx:1,dy:0});break;case"shift_arrowup":this.emit("SHORTCUT_JUMP",{dx:0,dy:-1});break;case"shift_arrowdown":this.emit("SHORTCUT_JUMP",{dx:0,dy:1});break;case"cmd_arrowup":this.emit("SHORTCUT_BRING_FORWARD");break;case"cmd_arrowdown":this.emit("SHORTCUT_SEND_BACKWARD");break;case"cmd_shift_arrowup":this.emit("SHORTCUT_BRING_TO_FRONT");break;case"cmd_shift_arrowdown":this.emit("SHORTCUT_SEND_TO_BACK");break;case"cmd_b":this.emit("SHORTCUT_TEXT_BOLD");break;case"cmd_i":this.emit("SHORTCUT_TEXT_ITALIC");break;case"escape":case"enter":this.emit("SHORTCUT_ESCAPE_MODE");break;case"shift_?":case"cmd_shift_?":case"ctrl_?":this.emit("SHORTCUT_HELP");break;case" ":this.emit("SHORTCUT_PAN_START");break;default:s=!1}s&&t.preventDefault()}handleKeyUp(t){let e=t.composedPath&&t.composedPath().length>0?t.composedPath()[0]:t.target;if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)return;let i=et.getShortcutString(t);i==="alt"&&(this.emit("SHORTCUT_ALT_UP"),N.getElementById("svg-editor")?.classList.remove("altPressed")),i===" "&&this.emit("SHORTCUT_PAN_STOP")}static \u0275fac=function(e){return new(e||r)};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var xe=class r{appParams=S(ee);properties=A({width:800,height:600,unit:this.getInitialUnit(),backgroundColor:"#ffffff",marginVertical:0,headerHeight:0,footerHeight:0,marginLeft:0,marginRight:0,bleedMargin:0,side:"left"});getInitialUnit(){let t=this.appParams.params(),e=["px","cm","mm","in"],n=(t.unit||"mm").toLowerCase();return e.includes(n)?n:"mm"}constructor(){}get dimensions(){return this.properties}updateDimensions(t,e){this.properties.update(n=>L(v({},n),{width:t,height:e,viewBox:`0 0 ${t} ${e}`}))}updateUnit(t){this.properties.update(e=>L(v({},e),{unit:t}))}updateProperty(t,e){this.properties.update(n=>{let i=L(v({},n),{[t]:e});return(t==="width"||t==="height")&&(i.viewBox=`0 0 ${i.width} ${i.height}`),i})}static \u0275fac=function(e){return new(e||r)};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var Tt=class r{config=A({showGrid:!0,showRulers:!0,showWireframe:!1,showMargins:!0,snapToGrid:!1,theme:"light"});updateConfig(t){this.config.update(e=>v(v({},e),t))}toggleGrid(){this.config.update(t=>L(v({},t),{showGrid:!t.showGrid}))}toggleRulers(){this.config.update(t=>L(v({},t),{showRulers:!t.showRulers}))}toggleWireframe(){this.config.update(t=>L(v({},t),{showWireframe:!t.showWireframe}))}toggleMargins(){this.config.update(t=>L(v({},t),{showMargins:!t.showMargins}))}static \u0275fac=function(e){return new(e||r)};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var At=class r{selectedElements=A([]);updated=A(0);count=ut(()=>this.selectedElements().length);isEmpty=ut(()=>this.count()===0);first=ut(()=>this.selectedElements()[0]||null);select(t){this.selectedElements.set(t)}add(t){this.selectedElements.update(e=>e.includes(t)?e:[...e,t])}toggle(t){this.selectedElements.update(e=>e.indexOf(t)>-1?e.filter(i=>i!==t):[...e,t])}clear(){this.selectedElements.set([])}triggerUpdate(){this.updated.update(t=>t+1)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ne=class r{_svgElement=null;_wrapperElement=null;_transform={x:0,y:0,scale:1};zoomLevel=A(1);panOffset=A({x:0,y:0});baseScale=A(1);isReady=A(!1);currentContext=A(null);modifiedPulse=A(0);isSilent=A(!0);versionUpgraded=A(!1);disabledElems=[];docService=S(xe);eventsService=S(Re);selectionStore=S(At);injector=S(Dn);constructor(){this.eventsService.on("SHORTCUT_DELETE").subscribe(()=>this.deleteSelectedElements()),dt(()=>{let t=this.docService.properties(),e=`${t.width}-${t.height}-${t.doublePage}`;jt(()=>{this.isReady()&&this.modifiedPulse.update(n=>n+1)})})}get svgElement(){if(!this._svgElement)throw new Error("Canvas not initialized. Call setSvgElement() first.");return this._svgElement}get wrapperElement(){if(!this._wrapperElement)throw new Error("Wrapper element not set. Call setWrapperElement() first.");return this._wrapperElement}setSvgElement(t){this._svgElement=t,this.isReady.set(!0);let e=t.querySelector("g.drawing-layer");this.setContext(e||t)}setContext(t){if(this.leaveContext(),!t)return;this.currentContext.set(t);let e=this.drawingGroup;if(!e||t===e)return;let n=t;for(;n&&n!==e;){let i=n.parentElement;i&&Array.from(i.children).forEach(s=>{if(s!==n&&s instanceof SVGGraphicsElement){let o=s.getAttribute("opacity");this.disabledElems.push({elem:s,origOpac:o}),s.setAttribute("opacity",(Number.parseFloat(o||"1")*.33).toFixed(2)),s.style.pointerEvents="none"}}),n=i}}leaveContext(){this.disabledElems.forEach(({elem:t,origOpac:e})=>{e?t.setAttribute("opacity",e):t.removeAttribute("opacity"),t.style.pointerEvents="inherit"}),this.disabledElems=[]}setWrapperElement(t){this._wrapperElement=t,this._wrapperElement.addEventListener("wheel",this.handleWheel.bind(this),{passive:!1})}destroy(){this._wrapperElement&&this._wrapperElement.removeEventListener("wheel",this.handleWheel.bind(this))}get drawingGroup(){return this._svgElement?this._svgElement.querySelector("g.drawing-layer"):null}get activeContainer(){let t=this.currentContext(),e=this.drawingGroup;if(t&&e&&t===e){let n=this.docService.properties().side||"left",i=Array.from(e.children).find(s=>s.tagName.toLowerCase()==="g"&&s.getAttribute("data-side")===n);if(i instanceof SVGGElement)return i}return t||e||this.svgElement}getSvgPoint(t,e,n){if(!this._svgElement)throw new Error("SVG not ready");let i=this._svgElement.createSVGPoint();i.x=t,i.y=e;let o=(n||this._svgElement).getScreenCTM();return o?i.matrixTransform(o.inverse()):i}screenToLocal(t,e,n){if(!this._svgElement)throw new Error("SVG not ready");let i=this._svgElement.createSVGPoint();return i.x=t,i.y=e,i.matrixTransform(n.inverse())}handleWheel(t){if(t.preventDefault(),t.ctrlKey||t.metaKey){let n=-Math.sign(t.deltaY),i=Math.exp(n*.1);this.zoom(i,t.clientX,t.clientY)}else this.pan(-t.deltaX,-t.deltaY)}zoom(t,e,n){if(!this._svgElement)return;let i=this._transform.scale,s=i*t,o=s/this.baseScale();if(o<.05||o>16)return;let a=this._svgElement.getBoundingClientRect(),l=e-a.left,c=n-a.top,h=s/i;this._transform.x+=l*(1-h),this._transform.y+=c*(1-h),this._transform.scale=s,this.zoomLevel.set(s),this.panOffset.set({x:this._transform.x,y:this._transform.y}),this.updateTransform()}pan(t,e){this._transform.x+=t,this._transform.y+=e,this.panOffset.set({x:this._transform.x,y:this._transform.y}),this.updateTransform()}updateTransform(){this._svgElement&&(this._svgElement.style.transform=`translate(${this._transform.x}px, ${this._transform.y}px) scale(${this._transform.scale})`)}getTransform(){return v({},this._transform)}groupElements(t){if(!t||t.length===0||!t[0].parentElement)return null;let n=[...t].sort((s,o)=>s===o?0:s.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1),i=document.createElementNS("http://www.w3.org/2000/svg","g");return i.id=N.getNextId("group"),n[0].before(i),n.forEach(s=>i.appendChild(s)),i}alignElements(t,e,n){!t||t.length===0||(t.forEach(i=>{let s=i.getBBox();switch(e){case"left":N.setAttribute(i,"x",n.x);break;case"center":N.setAttribute(i,"x",n.x+n.width/2-s.width/2);break;case"right":N.setAttribute(i,"x",n.x+n.width-s.width);break;case"top":N.setAttribute(i,"y",n.y);break;case"middle":N.setAttribute(i,"y",n.y+n.height/2-s.height/2);break;case"bottom":N.setAttribute(i,"y",n.y+n.height-s.height);break}}),this.modifiedPulse.update(i=>i+1))}ungroupElement(t){if(!t.parentElement)return[];let n=Array.from(t.children);return n.forEach(i=>{t.before(i)}),t.remove(),n}migrateLegacyToDoublePage(){let t=this.drawingGroup;if(!t||Array.from(t.children).some(l=>l.hasAttribute&&l.hasAttribute("data-side")))return;let n=document.createElementNS("http://www.w3.org/2000/svg","g");n.setAttribute("data-side","left");let i=document.createElementNS("http://www.w3.org/2000/svg","g");i.setAttribute("data-side","right");let s=[],o=l=>{l.tagName.toLowerCase()==="g"&&!l.id&&!l.hasAttribute("data-gsvg")&&!l.hasAttribute("app-table")?Array.from(l.children).forEach(o):s.push(l)};Array.from(t.children).forEach(o),t.innerHTML="";let a=new Set;s.forEach(l=>{l.id&&a.add(l.id),l.querySelectorAll("[id]").forEach(c=>{a.add(c.id)})}),s.forEach(l=>{if(n.appendChild(l),l instanceof SVGElement){let c=N.cloneWithNewIds(l,a);i.appendChild(c)}}),t.appendChild(n),t.appendChild(i)}deleteSelectedElements(){let t=this.selectionStore.selectedElements();t.length!==0&&(t.forEach(e=>e.remove()),this.selectionStore.clear(),this.modifiedPulse.update(e=>e+1))}loadedSvg=null;creationOverlayRect=null;startDrawingSelection(t,e){if(!this.isReady())return;this.finishDrawingSelection(),this.creationOverlayRect=document.createElementNS("http://www.w3.org/2000/svg","rect"),this.creationOverlayRect.setAttribute("id","creation-band-overlay"),this.creationOverlayRect.setAttribute("fill","transparent"),this.creationOverlayRect.setAttribute("stroke","var(--active)"),this.creationOverlayRect.setAttribute("stroke-width","1"),this.creationOverlayRect.setAttribute("x",String(t)),this.creationOverlayRect.setAttribute("y",String(e)),this.creationOverlayRect.setAttribute("width","0"),this.creationOverlayRect.setAttribute("height","0"),this.creationOverlayRect.style.pointerEvents="none";let n=this._svgElement?.querySelector(".overlay-layer");n?n.appendChild(this.creationOverlayRect):this._svgElement?.appendChild(this.creationOverlayRect)}updateDrawingSelection(t,e,n,i){this.creationOverlayRect&&(this.creationOverlayRect.setAttribute("x",String(t)),this.creationOverlayRect.setAttribute("y",String(e)),this.creationOverlayRect.setAttribute("width",String(n)),this.creationOverlayRect.setAttribute("height",String(i)))}finishDrawingSelection(){this.creationOverlayRect&&(this.creationOverlayRect.remove(),this.creationOverlayRect=null),this.isReady()&&this._svgElement?.querySelectorAll("#creation-band-overlay")?.forEach(e=>e.remove())}fitToScreen(){if(!this.wrapperElement||!this._svgElement)return;let t=this.wrapperElement.clientWidth,e=this.wrapperElement.clientHeight;if(t===0||e===0){requestAnimationFrame(()=>this.fitToScreen());return}let n=this.docService.properties().width,i=this.docService.properties().height;if(!n||!i||n===0||i===0)return;let s=getComputedStyle(this.wrapperElement),o=parseFloat(s.getPropertyValue("--container-width"))||300,a=parseFloat(s.getPropertyValue("--spacing-s"))||12,c=this.injector.get(Tt).config().showRulers,h=c?30:0,d=o+2*a+h,u=o+2*a,p=a+(c?30:0),m=a,g=t-d-u-40,b=e-p-m-40,f=g/n,E=b/i,w=Math.min(f,E);this.baseScale.set(w);let D=w*.9;this._transform.scale=D,this.zoomLevel.set(D);let O=n*D,Z=i*D,ue=d+(t-d-u)/2,U=p+(e-p-m)/2;this._transform.x=ue-O/2,this._transform.y=U-Z/2,this.panOffset.set({x:this._transform.x,y:this._transform.y}),this.updateTransform()}panToSide(t){if(!this._svgElement||!this._wrapperElement)return;let e=this.docService.properties().width,n=this._transform.scale,i=this._wrapperElement.clientWidth,s=e/2,o=0;t==="left"?o=s/2*n:o=(s+s/2)*n,this._transform.x=i/2-o;let a=this.docService.properties().height*n;this._transform.y=(this._wrapperElement.clientHeight-a)/2,this.panOffset.set({x:this._transform.x,y:this._transform.y}),this.updateTransform()}isLockedOrOverlay(t){return t.getAttribute("data-protected")==="true"||!!t.closest('[data-protected="true"]')||!!t.closest(".overlay-layer")||!!t.closest("[app-grid-overlay]")}findSelectableElement(t){let e=this.currentContext();if(!e)return null;let n=t;for(;n&&n!==this._svgElement&&n!==e;){if(n instanceof SVGGraphicsElement&&n.id&&!n.hasAttribute("data-side")&&!this.isLockedOrOverlay(n)){let i=n,s=n.parentElement;for(;s&&s!==e;){if(s.hasAttribute("data-side")){s=s.parentElement;continue}s instanceof SVGGraphicsElement&&s.id&&!this.isLockedOrOverlay(s)&&(i=s),s=s.parentElement}return i}n=n.parentElement}return null}static \u0275fac=function(e){return new(e||r)};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var _t=class r{notifications=A([]);show(t,e="info",n=3e3){let i=Math.random().toString(36).substring(2,9),s={id:i,type:e,message:t,closing:!1};this.notifications.update(o=>[...o,s]),n>0&&setTimeout(()=>{this.close(i)},n)}success(t,e=3e3){this.show(t,"success",e)}info(t,e=3e3){this.show(t,"info",e)}warning(t,e=3e3){this.show(t,"warning",e)}error(t,e=3e3){this.show(t,"error",e)}close(t){this.notifications.update(e=>e.map(n=>n.id===t?L(v({},n),{closing:!0}):n)),setTimeout(()=>{this.notifications.update(e=>e.filter(n=>n.id!==t))},400)}static \u0275fac=function(e){return new(e||r)};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var Ft=class r{constructor(t,e){this.http=t;this.appParams=e}get headers(){return new F({Authorization:`bearer ${this.appParams.token}`})}getFonts(){let t=`${this.appParams.apiUrl}Publications/fonts`;return this.http.get(t,{headers:this.headers}).pipe(R(e=>e.fonts||[]),M(e=>(console.error("Error fetching fonts",e),T([]))))}addFont(t){let e=`${this.appParams.apiUrl}Publications/fonts`;return this.http.post(e,t,{headers:this.headers}).pipe(M(n=>(console.error("Error adding font",n),T(null))))}updateFont(t){let e=`${this.appParams.apiUrl}Publications/fonts`,n=this.headers.set("Content-Type","application/json");return this.http.put(e,t,{headers:n}).pipe(R(i=>i),M(i=>(console.error("Error updating font",i),T(null))))}deleteFont(t){let e=`${this.appParams.apiUrl}Publications/fonts/${t}`;return this.http.delete(e,{headers:this.headers}).pipe(R(n=>n),M(n=>(console.error("Error deleting font",n),T(null))))}getFontAsBase64(t,e,n){return this.http.get(e,{headers:this.headers,responseType:"arraybuffer"}).pipe(R(i=>({base64:btoa(new Uint8Array(i).reduce((o,a)=>o+String.fromCharCode(a),"")),fontName:t,fontFilename:n})),M(i=>(console.error("Error fetching font as base64",i),T(null))))}static \u0275fac=function(e){return new(e||r)(C(Me),C(ee))};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var Lt=class r{constructor(t){this.fontApiService=t}fontsNames=A(["sans-serif","serif","monospace"]);availableFonts=A({});fontsImported=[];customFontFaces={};baseFonts=[{fontName:"sans-serif"},{fontName:"serif"},{fontName:"monospace"},{fontName:"Arial"},{fontName:"Helvetica"},{fontName:"Times New Roman"},{fontName:"Courier New"},{fontName:"Verdana"},{fontName:"Georgia"},{fontName:"Comic Sans MS"},{fontName:"Trebuchet MS"},{fontName:"Arial Black"},{fontName:"Impact"},{fontName:"Abril Fatface"},{fontName:"Aclonica"},{fontName:"Alkatra"},{fontName:"Alegreya"},{fontName:"Alumni Sans"},{fontName:"Andada Pro"},{fontName:"Anek Bangla"},{fontName:"Antonio"},{fontName:"Archivo"},{fontName:"Arimo"},{fontName:"Asap"},{fontName:"Assistant"},{fontName:"Azeret Mono"},{fontName:"Besley"},{fontName:"Big Shoulders Display"},{fontName:"Bitter"},{fontName:"Bodoni Moda"},{fontName:"Brygada 1918"},{fontName:"Cabin"},{fontName:"Catamaran"},{fontName:"Caveat"},{fontName:"Changa"},{fontName:"Cinzel"},{fontName:"Comfortaa"},{fontName:"Commissioner"},{fontName:"Crimson Pro"},{fontName:"Cuprum"},{fontName:"Dancing Script"},{fontName:"Domine"},{fontName:"Dosis"},{fontName:"EB Garamond"},{fontName:"El Messiri"},{fontName:"Encode Sans"},{fontName:"Epilogue"},{fontName:"Exo"},{fontName:"Faustina"},{fontName:"Fira Code"},{fontName:"Fraunces"},{fontName:"Gemunu Libre"},{fontName:"Georama"},{fontName:"Glory"},{fontName:"Gluten"},{fontName:"Grandstander"},{fontName:"Grenze Gotisch"},{fontName:"Hahmlet"},{fontName:"Heebo"},{fontName:"Hepta Slab"},{fontName:"Ibarra Real Nova"},{fontName:"Imbue"},{fontName:"Inconsolata"},{fontName:"Inter"},{fontName:"JetBrains Mono"},{fontName:"Josefin Sans"},{fontName:"Josefin Slab"},{fontName:"Jost"},{fontName:"Jura"},{fontName:"Karla"},{fontName:"Kreon"},{fontName:"Kufam"},{fontName:"Kumbh Sans"},{fontName:"Lemonada"},{fontName:"Lexend"},{fontName:"Libre Franklin"},{fontName:"Literata"},{fontName:"Lora"},{fontName:"Manrope"},{fontName:"Manuale"},{fontName:"Markazi Text"},{fontName:"Maven Pro"},{fontName:"Merriweather Sans"},{fontName:"Mulish"},{fontName:"MuseoModerno"},{fontName:"Newsreader"},{fontName:"Noto Sans Display"},{fontName:"Noto Sans Mono"},{fontName:"Noto Serif Display"},{fontName:"Open Sans"},{fontName:"Orbitron"},{fontName:"Oswald"},{fontName:"Oxanium"},{fontName:"Petrona"},{fontName:"Piazzolla"},{fontName:"Playfair Display"},{fontName:"Podkova"},{fontName:"Public Sans"},{fontName:"Quicksand"},{fontName:"Raleway"},{fontName:"Rasa"},{fontName:"Recursive"},{fontName:"Red Hat Display"},{fontName:"Red Hat Text"},{fontName:"Red Rose"},{fontName:"Reem Kufi"},{fontName:"Roboto Mono"},{fontName:"Roboto Slab"},{fontName:"Rokkitt"},{fontName:"Rosario"},{fontName:"Rubik"},{fontName:"Ruda"},{fontName:"STIX Two Text"},{fontName:"Saira"},{fontName:"Sansita Swashed"},{fontName:"Signika"},{fontName:"Sora"},{fontName:"Space Grotesk"},{fontName:"Spartan"},{fontName:"Stick No Bills"},{fontName:"Syne"},{fontName:"Texturina"},{fontName:"Tourney"},{fontName:"Trispace"},{fontName:"Truculenta"},{fontName:"Urbanist"},{fontName:"Varta"},{fontName:"Vollkorn"},{fontName:"Work Sans"},{fontName:"Yaldevi"},{fontName:"Yanone Kaffeesatz"},{fontName:"Yrsa"}];init(){return de(this,null,function*(){yield this.loadFonts();let t=Object.values(this.availableFonts());this.injectGoogleFontsPreconnect(),this.injectAllGoogleFonts(t),this.injectDocumentFonts(t)})}loadFonts(){return de(this,null,function*(){try{let t=yield it(this.fontApiService.getFonts()),n=(Array.isArray(t)?t:[]).reduce((o,a)=>{let{fontName:l,fontFilename:c,fontUrl:h,fontPath:d,publicationFontGuid:u,publicationFontId:p,fontGuid:m}=a;return o[l]={fontName:l,fontFilename:c,fontUrl:h,fontPath:d,publicationFontGuid:u,publicationFontId:p,fontGuid:m||u,axes:{ital:{name:"Italic",range:[0,1],value:0},wght:{name:"Weight",range:[400,900],value:400}}},o},{}),i=v({},n);this.baseFonts.forEach(o=>{i[o.fontName]||(i[o.fontName]=o)}),this.availableFonts.set(i),this.injectAllGoogleFonts(t);let s=Object.keys(i).sort();this.fontsNames.set([...new Set(["sans-serif","serif","monospace",...s])]);for(let o of Object.keys(n)){let a=n[o];a.fontUrl&&this.loadCustomFont(a)}}catch(t){console.error("Failed to load fonts",t)}})}injectGoogleFontsPreconnect(){if(!document.getElementById("google-fonts-preconnect")){let t=document.createElement("link");t.id="google-fonts-preconnect",t.rel="preconnect",t.href="https://fonts.googleapis.com",document.head.appendChild(t);let e=document.createElement("link");e.rel="preconnect",e.href="https://fonts.gstatic.com",e.crossOrigin="anonymous",document.head.appendChild(e)}}loadCustomFont(t){return de(this,null,function*(){if(!(!t.fontUrl||!t.fontFilename))try{let e=yield it(this.fontApiService.getFontAsBase64(t.fontName,t.fontUrl,t.fontFilename));if(e&&e.base64){let{mime:n,type:i}=this.getFontMimeAndType(t.fontUrl),s=`
4
+ @font-face {
5
+ font-family: '${t.fontName}';
6
+ src: url('data:${n};base64,${e.base64}') format('${i}');
7
+ font-weight: normal;
8
+ font-style: normal;
9
+ }
10
+ `;if(this.customFontFaces[t.fontName]=s,!this.isFontAlreadyInDocument(t.fontName)){let o=document.createElement("style");o.innerHTML=s,document.head.appendChild(o)}}}catch(e){console.error(`Failed to load custom font: ${t.fontName}`,e)}})}deleteFont(t){return de(this,null,function*(){let e=t.fontGuid||t.publicationFontGuid||t.fontName;yield it(this.fontApiService.deleteFont(e)),yield this.loadFonts()})}getFontMimeAndType(t){switch(t.split(".").pop()?.toLowerCase()){case"otf":return{mime:"font/otf",type:"opentype"};case"ttf":return{mime:"font/ttf",type:"truetype"};case"woff":return{mime:"font/woff",type:"woff"};case"woff2":return{mime:"font/woff2",type:"woff2"};default:return{mime:"application/octet-stream",type:"truetype"}}}isFontAlreadyInDocument(t){return Array.from(document.styleSheets).some(e=>{try{return Array.from(e.cssRules||[]).some(n=>n.cssText.includes(`font-family: '${t}'`)||n.cssText.includes(`font-family: "${t}"`))}catch{return!1}})}getGoogleFontLink(t){return`https://fonts.googleapis.com/css2?family=${t.replace(/ /g,"+")}`}injectGoogleFont(t){let e=`google-font-${t.replace(/ /g,"-").toLowerCase()}`;if(!document.getElementById(e)){let n=document.createElement("link");n.id=e,n.rel="stylesheet",n.href=this.getGoogleFontLink(t),document.head.appendChild(n)}}injectAllGoogleFonts(t){t.forEach(e=>{!e.fontUrl&&e.fontName!=="sans-serif"&&e.fontName!=="serif"&&e.fontName!=="monospace"&&this.injectGoogleFont(e.fontName)})}injectDocumentFonts(t){t.forEach(e=>{e.fontUrl&&this.loadCustomFont(e)})}isGoogleFont(t){let e=t.replace(/['"]/g,""),i=this.availableFonts()[e];return i?!i.fontUrl:this.baseFonts.some(s=>s.fontName===e)}getCustomFontUrlFace(t){let e=t.replace(/['"]/g,"").toLowerCase(),n=this.availableFonts(),i=Object.keys(n).find(s=>s.toLowerCase()===e);if(i){let s=n[i];if(s.fontUrl){let o=s.fontUrl.split(".").pop()?.toLowerCase(),a="truetype";return o==="otf"?a="opentype":o==="woff"?a="woff":o==="woff2"&&(a="woff2"),`
11
+ @font-face {
12
+ font-family: '${s.fontName}';
13
+ src: url('${s.fontUrl}') format('${a}');
14
+ font-weight: normal;
15
+ font-style: normal;
16
+ font-display: swap;
17
+ }
18
+ `}}return null}static \u0275fac=function(e){return new(e||r)(C(Ft))};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var Mt=class r{constructor(){}toSvgColor(t){return t}hexToRgba(t){let e=t.substring(1).split("");e.length===3&&(e=[e[0],e[0],e[1],e[1],e[2],e[2]]);let n=1;e.length===8&&(n=parseInt(e.slice(6,8).join(""),16)/255,e=e.slice(0,6));let i=parseInt(e.join(""),16);return{r:i>>16&255,g:i>>8&255,b:i&255,a:n}}rgbaToHex(t){let{r:e,g:n,b:i,a:s}=t,o=l=>{let c=Math.round(l).toString(16);return c.length===1?"0"+c:c},a="#"+o(e)+o(n)+o(i);return s<1&&(a+=o(Math.round(s*255))),a}rgbToHsv(t,e,n){t/=255,e/=255,n/=255;let i=Math.max(t,e,n),s=Math.min(t,e,n),o=0,a,l=i,c=i-s;if(a=i===0?0:c/i,i===s)o=0;else{switch(i){case t:o=(e-n)/c+(e<n?6:0);break;case e:o=(n-t)/c+2;break;case n:o=(t-e)/c+4;break}o/=6}return{h:o*360,s:a*100,v:l*100}}hsvToRgb(t,e,n){let i,s,o;t=t/360,e=e/100,n=n/100;let a=Math.floor(t*6),l=t*6-a,c=n*(1-e),h=n*(1-l*e),d=n*(1-(1-l)*e);switch(a%6){case 0:i=n,s=d,o=c;break;case 1:i=h,s=n,o=c;break;case 2:i=c,s=n,o=d;break;case 3:i=c,s=h,o=n;break;case 4:i=d,s=c,o=n;break;case 5:i=n,s=c,o=h;break}return{r:Math.round(i*255),g:Math.round(s*255),b:Math.round(o*255)}}rgbToHsl(t,e,n){t/=255,e/=255,n/=255;let i=Math.max(t,e,n),s=Math.min(t,e,n),o=0,a,l=(i+s)/2;if(i===s)o=a=0;else{let c=i-s;switch(a=l>.5?c/(2-i-s):c/(i+s),i){case t:o=(e-n)/c+(e<n?6:0);break;case e:o=(n-t)/c+2;break;case n:o=(t-e)/c+4;break}o/=6}return{h:Math.round(o*360),s:Math.round(a*100),l:Math.round(l*100)}}hslToRgb(t,e,n){let i,s,o;if(t/=360,e/=100,n/=100,e===0)i=s=o=n;else{let a=(h,d,u)=>(u<0&&(u+=1),u>1&&(u-=1),u<.16666666666666666?h+(d-h)*6*u:u<.5?d:u<.6666666666666666?h+(d-h)*(.6666666666666666-u)*6:h),l=n<.5?n*(1+e):n+e-n*e,c=2*n-l;i=a(c,l,t+1/3),s=a(c,l,t),o=a(c,l,t-1/3)}return{r:Math.round(i*255),g:Math.round(s*255),b:Math.round(o*255)}}rgbToCmyk(t,e,n){let i=1-t/255,s=1-e/255,o=1-n/255,a=Math.min(i,Math.min(s,o));return i=(i-a)/(1-a)||0,s=(s-a)/(1-a)||0,o=(o-a)/(1-a)||0,{c:Math.round(i*100),m:Math.round(s*100),y:Math.round(o*100),k:Math.round(a*100)}}cmykToRgb(t,e,n,i){t=t/100,e=e/100,n=n/100,i=i/100;let s=255*(1-t)*(1-i),o=255*(1-e)*(1-i),a=255*(1-n)*(1-i);return{r:Math.round(s),g:Math.round(o),b:Math.round(a)}}isHex(t){return typeof t!="string"?!1:(t=t.trim(),/^#([0-9A-F]{3}){1,2}$/i.test(t)||/^#([0-9A-F]{4}){1,2}$/i.test(t))}isRgb(t){return typeof t=="string"?t.trim().toLowerCase().startsWith("rgb"):typeof t=="object"&&t!==null&&"r"in t&&"g"in t&&"b"in t}isHsl(t){return typeof t=="string"?t.trim().toLowerCase().startsWith("hsl"):typeof t=="object"&&t!==null&&"h"in t&&"s"in t&&"l"in t}isHsv(t){return typeof t=="string"?t.trim().toLowerCase().startsWith("hsv"):typeof t=="object"&&t!==null&&"h"in t&&"s"in t&&"v"in t}isCmyk(t){return typeof t=="string"?t.trim().toLowerCase().startsWith("cmyk"):typeof t=="object"&&t!==null&&"c"in t&&"m"in t&&"y"in t&&"k"in t}toRgba(t){if(!t)return{r:0,g:0,b:0,a:1};if(this.isHex(t))return this.hexToRgba(t);if(this.isRgb(t))return typeof t=="string"?this.parseRgbString(t):{r:Number(t.r),g:Number(t.g),b:Number(t.b),a:t.a!==void 0?Number(t.a):1};if(this.isHsl(t)){if(typeof t=="string")return this.parseHslString(t);let e=this.hslToRgb(t.h,t.s,t.l);return L(v({},e),{a:t.a!==void 0?Number(t.a):1})}if(this.isHsv(t)){if(typeof t=="string")return this.parseHsvString(t);let e=this.hsvToRgb(t.h,t.s,t.v);return L(v({},e),{a:t.a!==void 0?Number(t.a):1})}if(this.isCmyk(t)){if(typeof t=="string")return this.parseCmykString(t);let e=this.cmykToRgb(t.c,t.m,t.y,t.k);return L(v({},e),{a:1})}return{r:0,g:0,b:0,a:1}}toHex(t){let e=this.toRgba(t);return this.rgbaToHex(e)}toHsl(t){let e=this.toRgba(t),n=this.rgbToHsl(e.r,e.g,e.b);return L(v({},n),{a:e.a})}toHsv(t){let e=this.toRgba(t),n=this.rgbToHsv(e.r,e.g,e.b);return L(v({},n),{a:e.a})}toCmyk(t){let e=this.toRgba(t);return this.rgbToCmyk(e.r,e.g,e.b)}parseRgbString(t){let e=t.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return e?{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10),a:e[4]?parseFloat(e[4]):1}:{r:0,g:0,b:0,a:1}}parseHslString(t){let e=t.match(/hsla?\((\d+),\s*(\d+)%,\s*(\d+)%(?:,\s*([\d.]+))?\)/);if(e){let n=parseInt(e[1],10),i=parseInt(e[2],10),s=parseInt(e[3],10),o=e[4]?parseFloat(e[4]):1,a=this.hslToRgb(n,i,s);return L(v({},a),{a:o})}return{r:0,g:0,b:0,a:1}}parseHsvString(t){let e=t.match(/hsva?\((\d+),\s*(\d+)%?,\s*(\d+)%?(?:,\s*([\d.]+))?\)/);if(e){let n=parseInt(e[1],10),i=parseInt(e[2],10),s=parseInt(e[3],10),o=e[4]?parseFloat(e[4]):1,a=this.hsvToRgb(n,i,s);return L(v({},a),{a:o})}return{r:0,g:0,b:0,a:1}}parseCmykString(t){let e=t.match(/cmyk\((\d+)%?,\s*(\d+)%?,\s*(\d+)%?,\s*(\d+)%?\)/);if(e){let n=parseInt(e[1],10),i=parseInt(e[2],10),s=parseInt(e[3],10),o=parseInt(e[4],10),a=this.cmykToRgb(n,i,s,o);return L(v({},a),{a:1})}return{r:0,g:0,b:0,a:1}}static \u0275fac=function(e){return new(e||r)};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var tt=29,is=`--vertical-padding:5px; --horizontal-padding:5px; min-width: var(--min-width); --indexSize: ${tt}px; border-collapse: collapse;`,cn={"font-size":"16px","font-family":"serif",color:"rgb(0, 0, 0)","text-align":"left","justify-content":"normal","align-items":"normal","font-weight":"400","font-style":"normal","text-decoration":"none solid rgb(0, 0, 0)","background-color":"transparent","border-width":"1px","border-color":"rgb(0, 0, 0)","border-style":"solid"},ss=["font-size","font-family","color","text-align","justify-content","align-items","font-weight","font-style","text-decoration","background-color","border-top-width","border-top-color","border-top-style","border-right-width","border-right-color","border-right-style","border-bottom-width","border-bottom-color","border-bottom-style","border-left-width","border-left-color","border-left-style","padding-top","padding-right","padding-bottom","padding-left"],Rr=`<svg class="open" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
19
+ <path d="M3.72727 6H10.2727C10.2727 6 11 6 11 6.88889V13.1111C11 13.1111 11 14 10.2727 14H3.72727C3.72727 14 3 14 3 13.1111V6.88889C3 6.88889 3 6 3.72727 6Z" fill="var(--gray-15)" stroke="none"/>
20
+ <path d="M13 5V3.97726C13 3.35957 12.7192 2.77538 12.2369 2.38951L12.102 2.28162C11.19 1.55199 9.87521 1.6248 9.04932 2.45067V2.45067C8.69759 2.80238 8.49999 3.27941 8.49999 3.77682V6" stroke="var(--gray-15)" stroke-linecap="round" stroke-linejoin="round"/>
21
+ </svg>`,xr=`<svg class="close" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
22
+ <path d="M3.72727 6H10.2727C10.2727 6 11 6 11 6.88889V13.1111C11 13.1111 11 14 10.2727 14H3.72727C3.72727 14 3 14 3 13.1111V6.88889C3 6.88889 3 6 3.72727 6Z" fill="var(--gray-15)" stroke="none"/>
23
+ <path d="M9 5.8V4.0869C9 3.64531 8.83333 3.22 8.53332 2.89598L8.43577 2.79063C7.5745 1.86045 6.07979 1.94229 5.32522 2.96093V2.96093C5.11401 3.24606 5 3.5915 5 3.94634V7" stroke="var(--gray-15)" stroke-linecap="square" stroke-linejoin="round"/>
24
+ </svg>`,Rt=class r{constructor(t,e,n){this.canvasService=e;this.colorService=n;this.renderer=t.createRenderer(null,null)}renderer;createProductTable(t,e,n,i,s){return this._createTable(t,e,n,i,"productTable",s)}createVariantsTable(t,e,n,i,s){return this._createTable(t,e,n,i,"variantsTable",s)}_createTable(t,e,n,i,s,o){let a=2,l=2,c=null;o&&(c=o.querySelector("table"),c&&(a=Array.from((c.querySelector("tr")||{children:[]}).children).filter(D=>!D.classList.contains("row-index-cell")).length,l=c.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)").length));let h=is;if(o&&c){let D=c.style.getPropertyValue("--vertical-padding"),O=c.style.getPropertyValue("--horizontal-padding");h+=`; --vertical-padding: ${D&&D.trim()?D:"5px"}; --horizontal-padding: ${O&&O.trim()?O:"5px"}`}let d="<colgroup>";for(let D=0;D<a;D++){let O="auto";if(c){let Z=c.querySelectorAll("colgroup col"),ue=c.querySelector(".columns-index-row")?1:0;Z[D+ue]&&(O=Z[D+ue].style.width||"auto")}d+=`<col style="width:${O}; ${O!=="auto"?"max-width:"+O:""}" />`}d+="</colgroup>";let u=c?Array.from(c.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)")):[],p="";for(let D=0;D<l;D++){let O=u[D]&&u[D].style.minHeight||"10px",Z="";u[D]?Z=u[D].classList.contains("header-row")?' class="header-row"':"":s==="variantsTable"&&D===0&&(Z=' class="header-row"'),p+=`<tr${Z} style="min-height:${O}">`;let ue=u[D]?Array.from(u[D].children).filter(U=>!U.classList.contains("row-index-cell")):[];for(let U=0;U<a;U++){let ie="",se="",Oe="";if(ue[U]){let q=ue[U],nt=q.querySelector(".cellContent");if(ie=nt?nt.innerHTML:q.innerHTML||"",q.style){let kr=window.getComputedStyle(q);Oe=ss.map(un=>`${un}:${kr.getPropertyValue(un)}`).join(";")}let rt=q;rt.colSpan>1&&(se+=` colspan="${rt.colSpan}"`),rt.rowSpan>1&&(se+=` rowspan="${rt.rowSpan}"`),q.classList.contains("hidden")&&(se+=' class="hidden"'),Oe&&(se+=` style="${Oe}"`),q.dataset.parentColIndex&&(se+=` data-parent-col-index="${q.dataset.parentColIndex}"`),q.dataset.parentRowIndex&&(se+=` data-parent-row-index="${q.dataset.parentRowIndex}"`)}else Oe=Object.entries(cn).map(([q,nt])=>`${q}:${nt}`).join(";"),s==="variantsTable"&&D===0?U===0?ie="R\xE9f\xE9rence":U===1?ie="Prix":ie=`Title ${U+1}`:s==="variantsTable"&&D===1&&(U===0?ie='<tspan></tspan><tspan class="textAttribute" data-type="text">R\xE9f\xE9rence (D\xE9clinaison)</tspan><tspan></tspan>':U===1?ie='<tspan></tspan><tspan class="textAttribute" data-type="text">Prix</tspan><tspan></tspan>':ie=`<tspan></tspan><tspan class="textAttribute" data-type="text">Variable ${U+1}</tspan><tspan></tspan>`),se=` style="${Oe}"`;p+=`<td${se}>`,p+='<div class="wrap">',p+=`<div class="cellContent">${ie}</div>`,p+="</div></td>"}p+="</tr>"}let m=`<table class="product-table" data-type="${s}" data-already-edited="false" style="${h}" xmlns="http://www.w3.org/1999/xhtml">`+d+"<tbody>"+p+"</tbody></table>",g=Math.max(n,200),b=Math.max(i,80),f=N.create("foreignObject",{x:t.toString(),y:e.toString(),width:g.toString(),height:b.toString(),"data-type":s}),E=this.renderer.createElement("div","http://www.w3.org/1999/xhtml");E.style.overflow="hidden",E.style.pointerEvents="none",E.innerHTML=m,f.appendChild(E);let w=this.canvasService.activeContainer;return w&&this.renderer.appendChild(w,f),setTimeout(()=>this.resizeTableContainer(f),0),f}addRow(t,e,n=!1){if(!(t.tagName==="TABLE"?t:t.querySelector("table")))return;let s=t.querySelectorAll("td.selected, th.selected"),o=null;if(s.length&&!n)o=e==="afterend"?s[s.length-1].parentElement:s[0].parentElement;else{let p=t.querySelectorAll("tr");o=e==="afterend"?p[p.length-1]:p[1]}if(!o)return;let a=t.querySelector(".columns-index-row"),l=a?a.children.length-1:2,c=document.createElement("tr");c.style.minHeight="10px";let h=document.createElement("td");h.classList.add("row-index-cell");let d=document.createElement("span");d.classList.add("index-view");let u=document.createElement("span");u.classList.add("row-resize"),h.appendChild(d),h.appendChild(u),c.appendChild(h);for(let p=0;p<l;p++){let m=document.createElement("td");Object.entries(cn).forEach(([g,b])=>{m.style.setProperty(g,b)}),m.innerHTML='<div class="wrap"><div class="cellContent"></div></div>',c.appendChild(m)}o.insertAdjacentElement(e,c),this.rewriteRowIndexes(t)}removeRow(t){let e=t.querySelectorAll("td.selected, th.selected"),n=[];e.forEach(i=>{let s=i.parentElement;s&&!n.includes(s)&&n.push(s)});for(let i of n){if(t.querySelectorAll("tr").length<=2)break;for(let s of Array.from(i.children))if(s.rowSpan>1&&this.splitCells(t,s),s.classList.contains("hidden")){let o=[s.dataset.parentColIndex,s.dataset.parentRowIndex];if(o[0]&&o[1]){let a=t.querySelectorAll("tr")[parseInt(o[1])].children[parseInt(o[0])];a&&(a.rowSpan-=1)}}i.remove()}this.rewriteRowIndexes(t)}moveRow(t,e){let n=t.querySelectorAll("td.selected, th.selected"),i=[];n.forEach(s=>{let o=s.parentElement;o&&!i.includes(o)&&i.push(o)}),e==="down"&&(i=i.reverse());for(let s of i)if(e==="up"){let o=s.previousElementSibling;if(!o||o.classList.contains("columns-index-row")||o.classList.contains("spacing-row"))return;o.insertAdjacentElement("beforebegin",s)}else{let o=s.nextElementSibling;if(!o)return;o.insertAdjacentElement("afterend",s)}this.rewriteRowIndexes(t)}addColumn(t,e,n=!1){let i=t.tagName==="TABLE"?t:t.querySelector("table");if(!i)return;let s=t.querySelectorAll("td.selected, th.selected"),o=(t.querySelector(".columns-index-row")?.children.length??2)-1,a;if(s.length&&!n){a=Array.prototype.indexOf.call(s[0].parentNode.children,s[0]);for(let d of Array.from(s)){let u=Array.prototype.indexOf.call(d.parentNode.children,d);a=e==="beforebegin"?Math.min(a,u):Math.max(a,u)}}else a=e==="beforebegin"?1:o;let l=this._getColumnByIndex(i,a),c=t.querySelectorAll("colgroup col");for(let d=0;d<l.length;d++){if(!l[d])continue;let u=l[d].parentElement;if(u?.classList.contains("columns-index-row")){let p=document.createElement("td");p.classList.add("col-index-cell");let m=document.createElement("span");m.classList.add("index-view");let g=document.createElement("span");g.classList.add("col-resize");let b=document.createElement("span");b.className="lockIcon",b.innerHTML=`${xr}${Rr}`,p.appendChild(b),p.appendChild(m),p.appendChild(g),l[d].insertAdjacentElement(e,p)}else if(u?.classList.contains("spacing-row")){let p=document.createElement("td");l[d].insertAdjacentElement(e,p)}else{let p=l[d].style,m=document.createElement("td");m.style.setProperty("font-size",p.fontSize||"16px"),m.style.setProperty("font-family",p.fontFamily||"serif"),m.style.setProperty("color",p.color||"rgb(0, 0, 0)"),m.style.setProperty("text-align",p.textAlign||"left"),m.style.setProperty("justify-content",p.justifyContent||"normal"),m.style.setProperty("align-items",p.alignItems||"normal"),m.style.setProperty("font-weight",p.fontWeight||"400"),m.style.setProperty("font-style",p.fontStyle||"normal"),m.style.setProperty("text-decoration",p.textDecoration||"none solid rgb(0, 0, 0)"),m.style.setProperty("background-color",p.backgroundColor||"rgba(0, 0, 0, 0)"),m.style.setProperty("border-width",p.borderWidth||"1px"),m.style.setProperty("border-color",p.borderColor||"rgb(0, 0, 0)"),m.style.setProperty("border-style",p.borderStyle||"solid"),m.innerHTML='<div class="wrap"><div class="cellContent"></div></div>',(t.dataset?.type||t.querySelector("table")?.dataset?.type)==="variantsTable"&&u===t.querySelectorAll("tr")[3]&&(m.querySelector(".cellContent").innerHTML='<tspan></tspan><tspan class="textAttribute" data-type="text"></tspan><tspan></tspan>'),l[d].insertAdjacentElement(e,m)}}let h=document.createElement("col");h.style.width="auto",c[a]&&c[a].insertAdjacentElement(e,h),this.rewriteColumnsIndexes(t)}removeColumn(t,e=-1){let n=t.tagName==="TABLE"?t:t.querySelector("table");if(!n)return;let i=[];e!==-1?i.push(e):t.querySelectorAll("td.selected, th.selected").forEach(o=>{let a=Array.prototype.indexOf.call(o.parentNode.children,o);i.includes(a)||i.push(a)});for(let s=i.length-1;s>=0;s--){let o=t.querySelectorAll("colgroup col"),a=i[s],l=this._getColumnByIndex(n,a);if((t.querySelector("tr")?.children.length??0)<=2)break;for(let c of l)c&&(c.rowSpan>1&&this.splitCells(t,c),c.remove());o[a]&&o[a].remove()}this.rewriteColumnsIndexes(t)}moveColumn(t,e){let n=t.tagName==="TABLE"?t:t.querySelector("table");if(!n)return;let i=t.querySelectorAll("td.selected, th.selected"),s=[];i.forEach(o=>{let a=Array.prototype.indexOf.call(o.parentNode.children,o);s.includes(a)||s.push(a)}),e==="right"&&(s=s.reverse());for(let o of s){let a=this._getColumnByIndex(n,o),l=t.querySelectorAll("colgroup col");if(e==="left"){let c=this._getColumnByIndex(n,o-1);if(!c[1]||c[1].classList.contains("row-index-cell"))return;for(let h=0;h<a.length;h++)c[h]&&a[h]&&c[h].insertAdjacentElement("beforebegin",a[h]);l[o-1]&&l[o]&&l[o-1].insertAdjacentElement("beforebegin",l[o])}else{let c=this._getColumnByIndex(n,o+1);if(!c[0])return;for(let h=0;h<a.length;h++)c[h]&&a[h]&&c[h].insertAdjacentElement("afterend",a[h]);l[o+1]&&l[o]&&l[o+1].insertAdjacentElement("afterend",l[o])}}this.rewriteColumnsIndexes(t)}mergeCells(t){let e=Array.from(t.querySelectorAll("td.selected, th.selected"));if(e.length<2)return;let n=t.querySelectorAll("tr");if(e.some(m=>m.colSpan!==1||m.rowSpan!==1||m.classList.contains("hidden")))return;let s=1/0,o=1/0,a=-1/0,l=-1/0;e.forEach(m=>{let g=Array.prototype.indexOf.call(m.parentNode.children,m),b=Array.prototype.indexOf.call(m.parentNode.parentNode.children,m.parentNode);s=Math.min(s,g),o=Math.min(o,b),a=Math.max(a,g),l=Math.max(l,b)});let c=a-s+1,h=l-o+1,d=n[o].children[s];d.colSpan=c,d.rowSpan=h;let u=Array.prototype.indexOf.call(d.parentNode.children,d),p=Array.prototype.indexOf.call(d.parentNode.parentNode.children,d.parentNode);for(let m of e)m!==d&&(m.classList.add("hidden"),m.dataset.parentColIndex=String(u),m.dataset.parentRowIndex=String(p))}splitCells(t,e){let n=e??t.querySelector("td.selected, th.selected");if(!n)return;let i=t.querySelectorAll("tr"),s=n.colSpan,o=n.rowSpan;if(s<=1&&o<=1)return;let a=Array.prototype.indexOf.call(n.parentNode.children,n),l=Array.prototype.indexOf.call(n.parentNode.parentNode.children,n.parentNode);for(let c=0;c<o;c++)for(let h=0;h<s;h++){let d=i[l+c];if(!d)continue;let u=d.children[a+h];u&&(u.classList.remove("hidden"),u.classList.remove("d-none"),delete u.dataset.parentColIndex,delete u.dataset.parentRowIndex)}n.colSpan=1,n.rowSpan=1}applyStyleToSelected(t,e,n,i){let s=t.querySelectorAll("td.selected, th.selected");if(s.length===0)return;let o=i!==void 0&&s[0].style.getPropertyValue(e)===n;s.forEach(a=>{let l=o?i??n:n;a.style.setProperty(e,l)})}applyBorderStylesToSelected(t,e,n,i=["all"]){let s=Array.from(t.querySelectorAll("td.selected")),o=Array.from(t.querySelectorAll("tr")),a=o.map(l=>Array.from(l.children));s.forEach(l=>{let c=l.parentElement;if(!c)return;let h=o.indexOf(c),d=Array.prototype.indexOf.call(c.children,l),u=l.rowSpan||1,p=l.colSpan||1;if(i.includes("all"))l.style.setProperty(e,n),["top","bottom","left","right"].forEach(m=>{this._syncAdjacentBorder(a,s,e,n,m,h,d,u,p)});else for(let m of i){let g=e.replace("border","border-"+m);l.style.setProperty(g,n),this._syncAdjacentBorder(a,s,e,n,m,h,d,u,p)}})}_syncAdjacentBorder(t,e,n,i,s,o,a,l,c){let h=[],d="";if(s==="top"){d="bottom";for(let u=a;u<a+c;u++)h.push(this._getVisibleCell(t,o-1,u))}else if(s==="bottom"){d="top";for(let u=a;u<a+c;u++)h.push(this._getVisibleCell(t,o+l,u))}else if(s==="left"){d="right";for(let u=o;u<o+l;u++)h.push(this._getVisibleCell(t,u,a-1))}else if(s==="right"){d="left";for(let u=o;u<o+l;u++)h.push(this._getVisibleCell(t,u,a+c))}h.forEach(u=>{u&&!e.includes(u)&&u.style.setProperty(n.replace("border","border-"+d),i)})}_getVisibleCell(t,e,n){if(e<0||e>=t.length||n<0||n>=t[e].length)return null;let i=t[e][n];if(!i)return null;if(i.classList.contains("hidden")){let s=i.dataset.parentRowIndex,o=i.dataset.parentColIndex;return s!==void 0&&o!==void 0&&t[parseInt(s)][parseInt(o)]||null}return i}clearTableStyle(t){t.querySelectorAll("td").forEach(n=>{n.removeAttribute("style"),n.children[0]&&n.children[0].removeAttribute("style"),n.removeAttribute("colspan"),n.removeAttribute("rowspan"),n.classList.remove("hidden"),delete n.dataset.parentColIndex,delete n.dataset.parentRowIndex}),t.querySelectorAll("colgroup col").forEach(n=>{n.style.width="10px"}),t.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)").forEach(n=>{n.style.minHeight="10px"})}clearTable(t){t.querySelectorAll("td:not(:has(.index-view)) .cellContent").forEach(e=>{e.innerHTML=""}),this.clearTableStyle(t),t.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)").forEach(e=>{e.style.minHeight="10px"}),t.querySelectorAll("colgroup col").forEach(e=>{e.style.width="10px",e.style.removeProperty("max-width"),e.style.removeProperty("min-width")})}setDefaultStyleToCell(t){Object.entries(cn).forEach(([e,n])=>{t.style.setProperty(e,n)})}resizeTableContainer(t){let e=t.querySelector("table");if(!e)return;let n=this.canvasService.zoomLevel(),i=e.getBoundingClientRect();i.width>0&&i.height>0&&(t.setAttribute("width",String(i.width*(1/n))),t.setAttribute("height",String(i.height*(1/n))))}setTableEditMode(t){let e=t.querySelector("table");e&&(e.classList.add("edit-mode"),t.setAttribute("width",String(Number(t.getAttribute("width"))+tt)),t.setAttribute("height",String(Number(t.getAttribute("height"))+tt+10)),setTimeout(()=>this.resizeTableContainer(t),100),this.rewriteRowIndexes(t))}removeTableEditMode(t){let e=t.querySelector("table");if(!e)return;let n=e.querySelector(".cell-edit-input");n&&this.removeEditInput(n.closest("td")),e.classList.remove("edit-mode"),t.querySelectorAll(".selected").forEach(i=>i.classList.remove("selected")),this.resizeTableContainer(t)}getTableSize(t){let e=(t.querySelector(".columns-index-row")?.children.length??2)-1;return{rows:t.querySelectorAll("tr").length-1,cols:e}}setTableSize(t,e,n){let i=t.tagName==="TABLE"?t:t.querySelector("table");if(!i)return;let s=i.dataset?.type==="variantsTable",o=this.getTableSize(t);if(s&&(e=3),e>o.rows)for(let a=o.rows;a<e;a++)this.addRow(t,"afterend",!0);else if(e<o.rows){let a=t.querySelectorAll("tr");for(let l=a.length-1;l>e;l--)a[l].remove()}if(n>o.cols)for(let a=o.cols;a<n;a++)this.addColumn(t,"afterend",!0);else if(n<o.cols)for(let a=o.cols;a>n;a--){this._getColumnByIndex(i,a).forEach(h=>h?.remove());let c=t.querySelectorAll("colgroup col");c[a]&&c[a].remove()}this.rewriteRowIndexes(t),this.rewriteColumnsIndexes(t)}setEditInput(t){let e=t.children[0];if(!e)return;let n=e.querySelector(".cellContent");n&&(n.setAttribute("contenteditable","true"),n.classList.add("cell-edit-input"),n.querySelectorAll(".textAttribute").forEach(i=>{i.setAttribute("contenteditable","false"),i.style.userSelect="none"}),n.focus())}removeEditInput(t){let e=t.querySelector(".cell-edit-input");e&&(e.removeAttribute("contenteditable"),e.classList.remove("cell-edit-input"),e.querySelectorAll(".textAttribute").forEach(n=>{n.removeAttribute("contenteditable"),n.style.userSelect=""}),e.innerHTML=e.innerHTML)}selectCells(t,e){this.deselectAllCells(t),e.forEach(n=>n.classList.add("selected"))}deselectAllCells(t){t.querySelectorAll("td.selected, th.selected").forEach(e=>e.classList.remove("selected")),t.querySelectorAll(".cell-edit-input").forEach(e=>{e.removeAttribute("contenteditable"),e.classList.remove("cell-edit-input")})}rewriteRowIndexes(t){let e=t.querySelectorAll(".row-index-cell"),n=t.querySelector("table")?.dataset.type==="variantsTable";e.forEach((i,s)=>{let o=i.querySelector(".index-view");o&&(n&&s===0?o.textContent="":o.textContent=String(s+(n?0:1)))})}rewriteColumnsIndexes(t){t.querySelectorAll(".col-index-cell").forEach((n,i)=>{let s=n.querySelector(".index-view");s&&(s.textContent=this._colIndexToLetter(i))})}exportTable(t){let e=t.tagName==="TABLE"?t:t.querySelector("table");if(!e)return"";let n=e.cloneNode(!0);n.classList.remove("edit-mode"),n.querySelectorAll(".spacing-row").forEach(o=>o.remove()),n.querySelectorAll("tr").forEach(o=>{o.querySelectorAll(".wrap").forEach(a=>{a.style.removeProperty("width")}),o.style.minHeight||(o.style.minHeight="10px")});let i=n.querySelector(".columns-index-row"),s=!!i;if(i&&i.remove(),n.querySelectorAll(".row-index-cell").forEach(o=>o.remove()),n.querySelectorAll(".index-view").forEach(o=>o.remove()),n.querySelectorAll(".col-resize").forEach(o=>o.remove()),n.querySelectorAll(".row-resize").forEach(o=>o.remove()),n.querySelectorAll(".lockIcon").forEach(o=>o.remove()),s){let o=n.querySelector("colgroup col");o&&o.remove()}if(n.querySelectorAll("colgroup col").forEach(o=>{o.style.minWidth="30px"}),n.querySelectorAll(".hidden").forEach(o=>{o.style.display="none"}),n.querySelectorAll(".selected").forEach(o=>o.classList.remove("selected")),n.querySelectorAll(".cell-edit-input").forEach(o=>{o.removeAttribute("contenteditable"),o.classList.remove("cell-edit-input")}),n.querySelectorAll("td .wrap").forEach(o=>{o.removeAttribute("style")}),s){let o=parseFloat(n.style.minWidth);isNaN(o)||(n.style.minWidth=String(o-tt)+"px")}return n.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),n.outerHTML}enableEditMode(t){let e=t.dataset.type==="variantsTable"||t.dataset.type==="variantTable"||t.closest("foreignObject")?.dataset.type==="variantsTable";if(t.classList.add("edit-mode"),t.querySelectorAll("td:not(.col-index-cell):not(.row-index-cell):not(.selectAll), th:not(.col-index-cell):not(.row-index-cell):not(.selectAll)").forEach(d=>{if(!d.querySelector(".wrap")){let u=d.innerHTML;d.innerHTML='<div class="wrap"><div class="cellContent"></div></div>';let p=d.querySelector(".cellContent");p.innerHTML=u}}),t.querySelector(".columns-index-row"))return;let n=Array.from(t.querySelectorAll("tr")).filter(d=>!d.classList.contains("spacing-row")),i=0;n.length>0&&(i=Array.from(n[0].children).filter(d=>!d.classList.contains("row-index-cell")).length);let s=t.querySelector("colgroup");if(!s){s=document.createElement("colgroup");for(let d=0;d<i;d++){let u=document.createElement("col");u.style.width="auto",s.appendChild(u)}t.prepend(s)}let o=document.createElement("col");o.style.width="30px",o.style.minWidth="30px",s.prepend(o);let a=document.createElement("tr");a.className="columns-index-row",a.innerHTML='<td class="selectAll"><span class="index-view"></span></td>';for(let d=0;d<i;d++)a.innerHTML+=`<td class="col-index-cell"><span class="index-view">${this._colIndexToLetter(d)}</span><span class="col-resize"></span><span class="lockIcon">${xr}${Rr}</span></td>`;let l=t.querySelector("thead");l?l.prepend(a):(t.querySelector("tbody")||t).prepend(a);let c=0;if(Array.from(t.querySelectorAll("tr")).forEach(d=>{if(d.classList.contains("columns-index-row")||d.classList.contains("spacing-row"))return;let u=document.createElement(d.parentElement?.tagName==="THEAD"?"th":"td");u.className="row-index-cell";let p=e&&c===0?"":String(c+(e?0:1));u.innerHTML=`<span class="index-view">${p}</span><span class="row-resize"></span>`,d.prepend(u),c++}),e&&!t.querySelector(".spacing-row")){let d=document.createElement("tr");d.className="spacing-row",d.style.height="8px";let u=t.querySelectorAll("tr");if(u.length>2){let p=u[2];p.parentNode?.insertBefore(d,p)}}t.querySelectorAll(".hidden").forEach(d=>{d.style.display="table-cell"});let h=parseFloat(t.style.minWidth);isNaN(h)||(t.style.minWidth=h+tt+"px")}_colIndexToLetter(t){let e="",n=t;for(;n>=0;)e=String.fromCharCode(65+n%26)+e,n=Math.floor(n/26)-1;return e}_getColumnByIndex(t,e){let n=t.querySelectorAll("tr"),i=[];return n.forEach(s=>{s.children[e]&&i.push(s.children[e])}),i}exportVariantsTableSettings(t){let e=t.querySelector("table");if(!e)return null;let n=(o,a="rgb(255, 255, 255)")=>{if(!o||o==="transparent"||o==="rgba(0, 0, 0, 0)")return a;let l=this.colorService.toRgba(o);return l.a===0?"rgba(0, 0, 0, 0)":`rgb(${l.r}, ${l.g}, ${l.b})`},i={showHeader:e.getAttribute("data-show-header")!=="false",hideEmptyCells:e.getAttribute("data-remove-empty-cells")==="true",backgroundVariation:{hasVariation:e.getAttribute("data-background-variation")==="true",backgroundColor:n(e.getAttribute("data-background-variation-color")||"#ffffff","rgba(0, 0, 0, 0)")},globalBorder:{color:e.dataset.globalBorderColor||"black",stroke:e.dataset.globalBorderStyle||"solid",width:e.dataset.globalBorderSize||"1px"},width:t.getAttribute("width"),padding:{horizontal:e.style.getPropertyValue("--horizontal-padding"),vertical:e.style.getPropertyValue("--vertical-padding")}},s=e.querySelectorAll("tr:not(.spacing-row):not(.columns-index-row)");return Array.from(s).forEach((o,a)=>{let l=o.querySelectorAll("td, th"),c=a===0?"headerRow":"bodyRow",h=[];Array.from(l).forEach(d=>{let u=d;if(u.classList.contains("row-index-cell"))return;let p=window.getComputedStyle(u),m={text:{alignment:p.textAlign||"left",verticalAlignment:p.verticalAlign||p.alignItems||"top",style:p.fontStyle||"normal",weight:p.fontWeight||"400",decoration:p.textDecoration||"none",color:n(p.color,"rgb(0, 0, 0)"),font:p.fontFamily.split(",")[0].replace(/'/g,"").replace(/"/g,"").trim()||"serif",size:p.fontSize||"16px"},border:{color:n(p.borderColor||"black","rgb(0, 0, 0)"),stroke:p.borderStyle||"solid",width:p.borderWidth||"1px"},backgroundColor:n(p.backgroundColor,"rgba(0, 0, 0, 0)")},g=u.querySelector(".cellContent");if(g){let f=g.textContent||"";m.fieldName=f.replace(/{{(.*)}}/g,"$1").trim()}if(c==="headerRow"){let f=Array.prototype.indexOf.call(o.children,u),E=e.querySelector("colgroup");if(E){let w=E.children[f];w&&(m.width=w.style.width)}}let b=u;u.classList.contains("hidden")&&(m.display=!1),b.colSpan>1&&(m.colSpan=b.colSpan),b.rowSpan>1&&(m.rowSpan=b.rowSpan),h.push(m)}),i[c]=h}),i}static \u0275fac=function(e){return new(e||r)(C(Cn),C(Ne),C(Mt))};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};var Nr=class r{constructor(t,e,n,i,s,o,a,l){this.canvasService=t;this.appParams=e;this.docService=n;this.assetsService=i;this.notificationService=s;this.eventsService=o;this.fontService=a;this.tableService=l;dt(()=>{let c=this.canvasService.modifiedPulse();if(this.canvasService.isSilent()){this.lastPulse=c;return}c>this.lastPulse?(this.lastPulse=c,import("./chunk-HQAPYEAU.js").then(({untracked:d})=>{d(()=>{this.setDirty(!0)})})):this.lastPulse=c}),this.eventsService.on("SHORTCUT_SAVE").subscribe(()=>{this.save()})}isDirty=A(!1);saveSuccessPulse=A({guid:"",count:0});lastPulse=0;setDirty(t){this.isDirty.set(t)}getSvgString(){if(!this.canvasService.isReady())return"";let t=this.canvasService.svgElement,e=t.cloneNode(!0);Array.from(e.children).forEach(f=>{f.matches("g.drawing-layer")||f.remove()}),e.style.removeProperty("transform"),e.style.removeProperty("background-color"),e.setAttribute("data-sp-version",Qe),e.setAttribute("version","1.1");let n=this.docService.properties().doublePage||!1;e.setAttribute("data-double-page",String(n)),e.querySelectorAll(".se-selection-box, .se-handler, #canvasGrid, #selection-outline, .page-divider, #creation-band-overlay").forEach(f=>f.remove()),Fr(e),Array.from(e.querySelectorAll('g[data-gsvg="true"]')).forEach(f=>{let E=f.attributes.length;for(let w=0;w<f.attributes.length;w++)(f.attributes[w].name==="id"||f.attributes[w].name==="style")&&E--;if(E<=0&&f.children.length>0){let w=f.children[0];f.replaceWith(w)}}),Array.from(e.getElementsByTagName("foreignObject")).forEach(f=>{f.removeAttribute("fill"),f.removeAttribute("stroke")});let i=t.getAttribute("width")||"0",s=t.getAttribute("height")||"0",o=e.getElementById("Block");if(o)o.setAttribute("fill","none");else{let f=document.createElementNS("http://www.w3.org/2000/svg","rect");f.setAttribute("id","Block"),f.setAttribute("x","0"),f.setAttribute("y","0"),f.setAttribute("width",i),f.setAttribute("height",s),f.setAttribute("fill","none"),e.insertBefore(f,e.firstChild)}let a=Math.random().toString(36).substring(2,9);e.setAttribute("id",a);let l=new Set;e.querySelectorAll('[style*="font-family"]').forEach(f=>{let E=f.style.fontFamily;E&&E.split(",").forEach(w=>{let D=w.trim().replace(/['"]/g,"");D&&l.add(D)})}),e.querySelectorAll("[font-family]").forEach(f=>{let E=f.getAttribute("font-family");E&&E.split(",").forEach(w=>{let D=w.trim().replace(/['"]/g,"");D&&l.add(D)})});let c=Array.from(l),h=c.filter(f=>this.fontService.isGoogleFont(f)),d=c.filter(f=>!this.fontService.isGoogleFont(f)),u="";if(h.length>0){let f=h.filter(E=>!["serif","sans-serif","monospace"].includes(E.toLowerCase())).map(E=>E.replace(/ /g,"+")).join("|");f&&(u=`@import url("https://fonts.googleapis.com/css?family=${f}:400,400i,700,700i&display=swap");
25
+ `)}d.forEach(f=>{let E=this.fontService.getCustomFontUrlFace(f);E&&(u+=E+`
26
+ `)});let p=`
27
+ ${u}
28
+
29
+ #${a} foreignObject * {
30
+ box-sizing: border-box;
31
+ }
32
+
33
+ #${a} foreignObject table {
34
+ table-layout: fixed;
35
+ min-height: inherit;
36
+ min-width: var(--min-width);
37
+ border-collapse: collapse;
38
+ }
39
+ #${a} foreignObject td, #${a} foreignObject th {
40
+ line-height: 120%;
41
+ overflow: hidden;
42
+ text-align: left;
43
+ padding: 5px;
44
+ border-width: 0.8px;
45
+ border-color: rgb(0, 0, 0);
46
+ border-style: solid;
47
+ font-family: "serif";
48
+ font-size: 16px;
49
+ color: rgb(0, 0, 0);
50
+ font-style: normal;
51
+ font-weight: 400;
52
+ text-decoration: none solid rgb(0, 0, 0);
53
+ background-color: transparent;
54
+ min-height: inherit;
55
+ }
56
+ #${a} foreignObject .cellContent {
57
+ display: flex;
58
+ align-items: inherit;
59
+ justify-content: inherit;
60
+ width: 100%;
61
+ height: 100%;
62
+ flex-direction: column;
63
+ }
64
+ #${a} foreignObject .cellContent div {
65
+ width: max-content;
66
+ }
67
+ #${a} [locked='true'].fake-textarea > * {
68
+ max-width: 100%;
69
+ }
70
+ #${a} .fake-textarea,
71
+ #${a} .fake-textarea div {
72
+ width: 100%;
73
+ }
74
+ #${a} .fake-textarea {
75
+ display: flex;
76
+ flex-direction: column;
77
+ overflow-wrap: break-word;
78
+ outline: none;
79
+ height: 100%;
80
+ width: 100%;
81
+ }
82
+ `,m=document.createElementNS("http://www.w3.org/2000/svg","style");m.setAttribute("id","style-"+a),m.textContent=p,e.insertBefore(m,e.firstChild);let g=e.outerHTML;if(g=Lr(g),(this.appParams.type||"documents").toLowerCase()!=="background"){let f=N.getDocumentRoot().querySelector("svg style");f&&(g=g.replace(/<svg[^>]*>/,`$&${f.outerHTML}`))}return g}save(){let t=this.getSvgString();if(!t)return;let e=new Blob([t],{type:"image/svg+xml;charset=utf-8"}),n=this.appParams.type||"document",i=this.appParams.guid||"",s=this.appParams.pageGuid?this.appParams.pageGuid().toString():"1",o=new FormData;o.append("file",e,n=="document"?i:this.appParams.templateData.publicationTemplateName),o.append("publicationTemplateguid",i),o.append(n=="document"?"pageGuid":"pageId",n=="document"?s:"1"),this.assetsService.saveDocument(n,o).subscribe({next:a=>{if(a===null)this.notificationService.error("Erreur lors de la sauvegarde du document.");else if(this.notificationService.success("Document sauvegard\xE9 avec succ\xE8s !"),this.setDirty(!1),this.saveSuccessPulse.set({guid:s,count:this.saveSuccessPulse().count+1}),n!=="document"){let l=this.appParams.templateData?.publicationTemplateVersion;(this.canvasService.versionUpgraded()||!l)&&["background","cover","marketing","productblock"].includes(n)&&this.assetsService.updateTemplateField("publicationTemplateVersion",Qe).subscribe({next:()=>{console.log("Template version updated to",Qe),this.canvasService.versionUpgraded.set(!1),this.appParams.templateData&&(this.appParams.templateData.publicationTemplateVersion=Qe)},error:u=>console.error("Error updating template version",u)});let h=N.getDocumentRoot().querySelector('[data-type="variantsTable"]');if(h){let d=this.tableService.exportVariantsTableSettings(h);d&&this.assetsService.updateTemplateField("publicationTemplateSettingVariants",JSON.stringify(d)).subscribe({next:()=>console.log("Variants settings updated"),error:u=>console.error("Error updating variants settings",u)})}}},error:a=>{this.notificationService.error("Erreur lors de la sauvegarde du document.")}})}static \u0275fac=function(e){return new(e||r)(C(Ne),C(ee),C(xe),C(St),C(_t),C(Re),C(Lt),C(Rt))};static \u0275prov=y({token:r,factory:r.\u0275fac,providedIn:"root"})};function as(r,t){if(r&1){let e=Ve();_(0,"div",1),B("contextmenu",function(i){return $(e),j(i.preventDefault())}),_(1,"div",2),B("click",function(){$(e);let i=G();return j(i.onAction("open"))}),_(2,"span"),H(3),W(4,"translate"),k()(),Ee(5,"div",3),_(6,"div",2),B("click",function(){$(e);let i=G();return j(i.onAction("insert-before"))}),_(7,"span"),H(8),W(9,"translate"),k()(),_(10,"div",2),B("click",function(){$(e);let i=G();return j(i.onAction("insert-after"))}),_(11,"span"),H(12),W(13,"translate"),k()(),Ee(14,"div",3),_(15,"div",2),B("click",function(){$(e);let i=G();return j(i.onAction("duplicate"))}),_(16,"span"),H(17),W(18,"translate"),k()(),Ee(19,"div",3),_(20,"div",4),B("click",function(){$(e);let i=G();return j(i.onAction("delete"))}),_(21,"span"),H(22),W(23,"translate"),k()()()}if(r&2){let e=G();An("top",e.position.y,"px")("left",e.position.x,"px"),V(3),X(K(4,11,"GLOBAL.PAGES.OPEN")),V(5),X(K(9,13,"GLOBAL.PAGES.INSERT_BEFORE")),V(4),X(K(13,15,"GLOBAL.PAGES.INSERT_AFTER")),V(5),X(K(18,17,"GLOBAL.PAGES.DUPLICATE")),V(3),_n("disabled",e.isCurrentPage),V(2),X(K(23,19,"GLOBAL.PAGES.DELETE"))}}var Or=class r{constructor(t){this.elementRef=t}visible=!1;position={x:0,y:0};pageIndex=null;isCurrentPage=!1;action=new te;closeMenu=new te;onDocumentClick(t){if(this.visible){let e=t.composedPath?t.composedPath():[];(e.length>0?e.includes(this.elementRef.nativeElement):this.elementRef.nativeElement.contains(t.target))||this.closeMenu.emit()}}onAction(t){t==="delete"&&this.isCurrentPage||(this.pageIndex!==null&&this.action.emit({action:t,index:this.pageIndex}),this.closeMenu.emit())}static \u0275fac=function(e){return new(e||r)(I(fe))};static \u0275cmp=be({type:r,selectors:[["app-page-context-menu"]],hostBindings:function(e,n){e&1&&B("mousedown",function(s){return n.onDocumentClick(s)},!1,wn)},inputs:{visible:"visible",position:"position",pageIndex:"pageIndex",isCurrentPage:"isCurrentPage"},outputs:{action:"action",closeMenu:"closeMenu"},decls:1,vars:1,consts:[["class","context-menu",3,"top","left","contextmenu",4,"ngIf"],[1,"context-menu",3,"contextmenu"],[1,"menu-item",3,"click"],[1,"separator"],[1,"menu-item","delete",3,"click"]],template:function(e,n){e&1&&Be(0,as,24,21,"div",0),e&2&&le("ngIf",n.visible)},dependencies:[he,$e,Ae,Te],styles:[".context-menu[_ngcontent-%COMP%]{position:fixed;background:var(--gray-4);border:1px solid var(--gray-3);border-radius:var(--radius-m);box-shadow:0 4px 12px #0006;z-index:3000;min-width:180px;padding:4px 0;color:var(--white);-webkit-user-select:none;user-select:none}.menu-item[_ngcontent-%COMP%]{padding:8px 12px;cursor:pointer;display:flex;justify-content:space-between;align-items:center;font-size:13px;transition:background-color .1s ease}.menu-item[_ngcontent-%COMP%]:hover{background:var(--active);color:var(--white)}.menu-item.delete[_ngcontent-%COMP%]:hover{background:#e53935}.menu-item.disabled[_ngcontent-%COMP%]{opacity:.4;cursor:not-allowed;pointer-events:none}.menu-item.disabled[_ngcontent-%COMP%]:hover{background:transparent}.separator[_ngcontent-%COMP%]{height:1px;background-color:var(--gray-3);margin:4px 0}"]})};var ls=["*"];function cs(r,t){if(r&1){let e=Ve();_(0,"div",7)(1,"button",8),B("click",function(){$(e);let i=G(2);return j(i.close())}),H(2),W(3,"translate"),k(),_(4,"button",9),B("click",function(){$(e);let i=G(2);return j(i.submit())}),H(5),W(6,"translate"),k()()}if(r&2){let e=G(2);V(2),Gt(" ",K(3,3,"CANCEL")," "),V(2),le("disabled",e.isSubmitDisabled),V(),Gt(" ",K(6,5,"CONFIRM")," ")}}function us(r,t){if(r&1){let e=Ve();_(0,"div",1),B("click",function(){$(e);let i=G();return j(i.close())}),_(1,"div",2),B("click",function(i){return $(e),j(i.stopPropagation())}),_(2,"div",3)(3,"h3"),H(4),k(),_(5,"button",4),B("click",function(){$(e);let i=G();return j(i.close())}),H(6,"\xD7"),k()(),_(7,"div",5),Ln(8),k(),Be(9,cs,7,7,"div",6),k()()}if(r&2){let e=G();V(4),X(e.title),V(5),le("ngIf",e.showFooter)}}var xt=class r{title="Modal";isOpen=!1;showFooter=!0;isSubmitDisabled=!1;closeEvent=new te;submitEvent=new te;close(){this.closeEvent.emit(),this.isOpen=!1}submit(){this.submitEvent.emit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=be({type:r,selectors:[["app-basic-modal"]],inputs:{title:"title",isOpen:"isOpen",showFooter:"showFooter",isSubmitDisabled:"isSubmitDisabled"},outputs:{closeEvent:"closeEvent",submitEvent:"submitEvent"},ngContentSelectors:ls,decls:1,vars:1,consts:[["class","modal-backdrop",3,"click",4,"ngIf"],[1,"modal-backdrop",3,"click"],[1,"modal-content",3,"click"],[1,"modal-header"],[1,"close-btn",3,"click"],[1,"modal-body"],["class","modal-footer",4,"ngIf"],[1,"modal-footer"],[1,"cancel-btn",3,"click"],[1,"save-btn",3,"click","disabled"]],template:function(e,n){e&1&&(Fn(),Be(0,us,10,2,"div",0)),e&2&&le("ngIf",n.isOpen)},dependencies:[he,$e,Ae,Te],styles:[".modal-backdrop[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100%;height:100%;background:var(--white-alpha-medium);display:flex;justify-content:center;align-items:center;z-index:2000}.modal-content[_ngcontent-%COMP%]{background:var(--gray-5);border-radius:var(--radius-s);min-width:300px;box-shadow:var(--shadow);color:var(--white)}.modal-header[_ngcontent-%COMP%]{padding:var(--spacing-m);border-bottom:1px solid var(--gray-3);display:flex;justify-content:space-between;align-items:center}.modal-body[_ngcontent-%COMP%]{padding:var(--spacing-m)}.modal-footer[_ngcontent-%COMP%]{padding:var(--spacing-s) var(--spacing-m);border-top:1px solid var(--gray-3);display:flex;justify-content:flex-end;gap:var(--spacing-s)}h3[_ngcontent-%COMP%]{margin:0;font-size:var(--font-size-regular);font-weight:var(--font-weight-semi-bold)}.close-btn[_ngcontent-%COMP%]{background:none;border:none;font-size:24px;cursor:pointer;color:var(--white);transition:color .2s}.close-btn[_ngcontent-%COMP%]:hover{color:var(--error)}.cancel-btn[_ngcontent-%COMP%]{background:var(--gray-4);color:var(--white);border:none;padding:var(--spacing-s) var(--spacing-m);border-radius:var(--radius-s);cursor:pointer;transition:background .2s}.cancel-btn[_ngcontent-%COMP%]:hover{background:var(--gray-3)}.save-btn[_ngcontent-%COMP%]{background:var(--active);color:var(--white);border:none;padding:var(--spacing-s) var(--spacing-m);border-radius:var(--radius-s);cursor:pointer;transition:background .2s}.save-btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--active-hover)}.save-btn[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}"]})};var Ir=class r{message;confirm=new te;cancel=new te;onConfirm(){this.confirm.emit()}onCancel(){this.cancel.emit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=be({type:r,selectors:[["app-confirm-delete-modal"]],inputs:{message:"message"},outputs:{confirm:"confirm",cancel:"cancel"},decls:9,vars:7,consts:[[3,"closeEvent","submitEvent","title","isOpen"],[1,"confirm-content"],[1,"warning-icon"],["viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M12 9V14M12 17.01L12.01 16.9986M5.07183 19H18.9282C20.4678 19 21.4301 17.3333 20.6603 16L13.7321 4C12.9623 2.66667 11.0378 2.66667 10.268 4L3.33975 16C2.56995 17.3333 3.53223 19 5.07183 19Z","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"]],template:function(e,n){e&1&&(_(0,"app-basic-modal",0),W(1,"translate"),B("closeEvent",function(){return n.onCancel()})("submitEvent",function(){return n.onConfirm()}),_(2,"div",1)(3,"div",2),yn(),_(4,"svg",3),Ee(5,"path",4),k()(),En(),_(6,"p"),H(7),W(8,"translate"),k()()()),e&2&&(le("title",K(1,3,"GLOBAL.PAGES.DELETE_CONFIRM_TITLE"))("isOpen",!0),V(7),X(n.message||K(8,5,"GLOBAL.PAGES.DELETE_CONFIRM_MSG")))},dependencies:[he,Ae,Te,xt],styles:[".confirm-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:var(--spacing-m) 0}.warning-icon[_ngcontent-%COMP%]{width:48px;height:48px;background:#e539351a;color:var(--error);border-radius:50%;display:flex;align-items:center;justify-content:center;margin-bottom:var(--spacing-m)}.warning-icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{width:28px;height:28px}p[_ngcontent-%COMP%]{margin:0;color:var(--gray-1);font-size:14px;line-height:1.5;max-width:250px}[_nghost-%COMP%] .save-btn{background-color:var(--error)!important}[_nghost-%COMP%] .save-btn:hover{background-color:var(--error)!important}"]})};export{De as a,ft as b,Br as c,Ht as d,Vn as e,Jr as f,Yr as g,Kn as h,$e as i,Xr as j,ti as k,ni as l,he as m,Jt as n,Zn as o,si as p,oi as q,je as r,F as s,Me as t,Cr as u,Ni as v,yt as w,Jo as x,Te as y,Yo as z,Ae as A,At as B,N as C,Re as D,ee as E,xe as F,Tt as G,Ne as H,lr as I,Mt as J,xt as K,Rt as L,Ft as M,Lt as N,$i as O,Ha as P,za as Q,St as R,_t as S,Nr as T,Or as U,Ir as V};