@ixon-cdk/simulator 1.16.0-next.1 → 1.16.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{require_jszip_min}from"./chunk-4R2H3OTM.js";import{quill_default}from"./chunk-KMUH6KCJ.js";import{A11yModule,ACTIVE_RUNTIME_CHECKS,ANIMATION_MODULE_TYPE,APP_CONFIG,APP_INITIALIZER,AUTO_STYLE,Actions,ActionsSubject,ActivatedRoute,AnimationGroupPlayer,AnimationMetadataType,AnonymousSubject,ApplicationRef,AsyncPipe,BackendComponentCallerService,BackendComponentCallerServiceFactory,BackendComponentClient,BackendComponentClientProxyService,BehaviorSubject,BreakpointObserver,Breakpoints,BrowserModule,CdkDrag,CdkDragPlaceholder,CdkDragPreview,CdkDropList,CdkPortalOutlet,CdkScrollable,CdkTextareaAutosize,CdkTrapFocus,ChangeDetectorRef,Clipboard,ClipboardModule,CommonModule,ComponentFactoryResolver$1,ComponentPortal,ComponentTemplateValidatorService,DEFAULT_CARD_DIMENSIONS,DEFAULT_CBC_INGRESS_URL,DEFAULT_REPORT_DIMENSIONS,DEFAULT_SHEET_DIMENSIONS,DOCUMENT,DateAdapter,DefaultClassDirective,DefaultFlexDirective,DefaultLayoutAlignDirective,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultShowHideDirective,DefaultValueAccessor,DestroyRef,DomRendererFactory2,DomSanitizer,DragDropModule,EMPTY,EffectsModule,ElementRef,ErrorHandler,EventEmitter,FlexLayoutModule,FlexModule,FormArray,FormBuilder,FormControl,FormControlDirective,FormControlName,FormGroup,FormGroupDirective,FormGroupName,FormsModule,HTTP_INTERCEPTORS,HttpClient,HttpContext,HttpErrorResponse,HttpHeaders,HttpParams,HttpResponse,INIT,INITIAL_STATE,IXAPI_OPTIONS,InjectionToken,Injector,IxApi2RequestErrorMessages,IxApiErrorMessages,IxApiErrors,IxApiHeaderKeys,IxApiModule,IxApiRequestErrorMessages,IxApiRequestErrors,IxApiService,LayoutModule,Location,LowerCasePipe,MAT_BOTTOM_SHEET_DATA,MAT_DATE_FORMATS,MAT_DATE_LOCALE,MAT_DIALOG_DATA,MatActionList,MatBadge,MatBadgeModule,MatBottomSheet,MatBottomSheetRef,MatButton,MatButtonModule,MatCard,MatCardActions,MatCardHeader,MatCardModule,MatCardSubtitle,MatCardTitle,MatCheckbox,MatCheckboxModule,MatDatepicker,MatDatepickerInput,MatDatepickerToggle,MatDialog,MatDialogActions,MatDialogClose,MatDialogContainer,MatDialogContent,MatDialogModule,MatDialogRef,MatDialogTitle,MatDivider,MatDividerModule,MatDrawer,MatDrawerContainer,MatDrawerContent,MatError,MatExpansionPanel,MatFormField,MatFormFieldModule,MatHint,MatIcon,MatIconAnchor,MatIconButton,MatIconModule,MatIconRegistry,MatInput,MatInputModule,MatLabel,MatList,MatListItem,MatListItemIcon,MatListItemLine,MatListItemMeta,MatListItemTitle,MatListModule,MatListOption,MatListSubheaderCssMatStyler,MatMenu,MatMenuContent,MatMenuItem,MatMenuModule,MatMenuTrigger,MatNavList,MatOptgroup,MatOption,MatPaginatorModule,MatPrefix,MatProgressSpinner,MatProgressSpinnerModule,MatSelect,MatSelectModule,MatSelectTrigger,MatSelectionList,MatSidenav,MatSidenavContainer,MatSidenavModule,MatSnackBar,MatSnackBarModule,MatSuffix,MatTab,MatTabGroup,MatToolbar,MatToolbarModule,MatTooltip,MatTooltipModule,MediaObserver,Meta,MinValidator,NG_VALIDATORS,NG_VALUE_ACCESSOR,NavigationCancel,NavigationEnd,NavigationError,NavigationStart,NgClass,NgControl,NgControlStatus,NgControlStatusGroup,NgForOf,NgForm,NgIf,NgModel,NgSelectOption,NgStyle,NgTemplateOutlet,NgZone,NoopAnimationPlayer,NumberValueAccessor,ONE_WEEK,OTP_SMS_REQUIRED_PATTERN,Observable,Overlay,OverlayConfig,PAGE_COMPONENT,PLATFORM_ID,PageComponentTemplateManifestModule,PageComponentTemplateModule,PageComponentTemplateService,Platform,PortalInjector,PortalModule,REQUIRES_BRANDING,REQUIRES_COMPANY,ReactiveFormsModule,ReducerManagerDispatcher,ReducerObservable,Renderer2,RendererFactory2,ReplaySubject,RequiredValidator,ResourceDataClient,ResourceDataClientProxyService,ResourceDataServiceFactory,Router,RouterLink,RouterLinkActive,RouterModule,RouterOutlet,RoutesRecognized,RuntimeError,SESSION_STORAGE,STORAGE_KEY_CBC_CONFIG_VALUES,STORAGE_KEY_CBC_INGRESS,STORAGE_KEY_CBC_INGRESS_URL,STORAGE_KEY_CBC_PUBLIC_ID,ScannedActionsSubject,SecurityContext,SelectControlValueAccessor,SettingsModule,SharedModule,StateObservable,StorageEventContext,StorageModule,StorageService,Store,StoreModule,Subject,Subscriber,Subscription,TemplateRef,Title,TitleCasePipe,TranslateDirective,TranslateLoader,TranslateModule,TranslatePipe,TranslateService,UPDATE,USER_PROVIDED_EFFECTS,Validators,ViewContainerRef,ViewportRuler,WINDOW,add,addFailure,addSuccess,appConfigFactory,arrowRotateFactory,booleanAttribute,buffer,buildFields,catchError,combineLatest,compactFields,computed,concatMap,createAction,createEffect,createEntityAdapter,createFeature,createFeatureSelector,createReducer,createResourceAdapter,createResourceSelectorFactory,createSelector,debounceTime,decryptValue,defaultOptions,defer,delay,delayWhen,didAdd,didAddList,didRemove,didRemoveList,didUpdate,didUpdateList,distinctUntilChanged,effect,ensureAll,ensureMany,ensureOne,environment,expandCollapse,filter,first,firstValueFrom,forkJoin,forwardRef,from,fromEvent,getLinkMap,getLinkUrl,getMissingFields,getPageParams,hasFields,hasNonPublicIdFields,haveFields,inject,input,isDevMode,isNgrxMockEnvironment,isObservable,isPlatformBrowser,isPlatformServer,last,lastValueFrom,loadAllForIntentSuccess,loadAllSuccess,loadAppConfig,loadHost,loadHostFailure,loadHostSuccess,loadManySuccess,makeEnvironmentProviders,map,mapPageComponentTemplateManifestToDefaultInputs,mapPageComponentTemplateToCustomElementName,mapPageComponentTemplateToTemplateBaseUrl,mapPageComponentTemplateToTemplateUrl,mapResourceToSubResourceList,mapTemplateUrlToMainPath,mapTemplateUrlToManifestUrl,mapTemplateUrlToPublicId,merge,mergeFields,mergeLoadedFields,mergeMap,moveItemInArray,mustache_default,observeOn,of,ofStatus,ofType,omitLoadedFields,omitSubresources,on,output,pairwise,parseBody,platformBrowser,props,provideEnvironmentInitializer,provideHttpClient,queueScheduler,remove,removeFailure,removeSuccess,require_crypto_js,reset,reset2,reset3,resetPendingUpdates,retryBackoff,scan,select,selectAll,selectEntities,selectEntities2,selectEntity,selectEntity2,sequence,share,shareReplay,signal,skip,sortByNameAndPublicIdComparer,startWith,style,switchMap,take,takeUntil,takeUntilDestroyed,tap,throwError,throwNotFoundError,timeout,timer,toObservable,toSignal,update,updateFailure,updateMany,updateManyFailure,updateManySuccess,updateResource,updateSuccess,validateOptions,viewChild,whileMoreAfter,withInterceptorsFromDi,withLatestFrom,ɵNgNoValidate,ɵNgSelectMultipleOption,ɵPRE_STYLE,ɵɵInheritDefinitionFeature,ɵɵNgOnChangesFeature,ɵɵProvidersFeature,ɵɵadvance,ɵɵattribute,ɵɵclassMap,ɵɵclassMapInterpolate1,ɵɵclassProp,ɵɵconditional,ɵɵcontentQuery,ɵɵdeclareLet,ɵɵdefineComponent,ɵɵdefineDirective,ɵɵdefineInjectable,ɵɵdefineInjector,ɵɵdefineNgModule,ɵɵdefinePipe,ɵɵdirectiveInject,ɵɵelement,ɵɵelementContainer,ɵɵelementContainerEnd,ɵɵelementContainerStart,ɵɵelementEnd,ɵɵelementStart,ɵɵgetCurrentView,ɵɵgetInheritedFactory,ɵɵinject,ɵɵlistener,ɵɵloadQuery,ɵɵnamespaceSVG,ɵɵnextContext,ɵɵpipe,ɵɵpipeBind1,ɵɵpipeBind2,ɵɵpipeBind3,ɵɵprojection,ɵɵprojectionDef,ɵɵproperty,ɵɵpropertyInterpolate,ɵɵpureFunction0,ɵɵpureFunction1,ɵɵpureFunction2,ɵɵpureFunction4,ɵɵpureFunction7,ɵɵqueryAdvance,ɵɵqueryRefresh,ɵɵreadContextLet,ɵɵreference,ɵɵrepeater,ɵɵrepeaterCreate,ɵɵrepeaterTrackByIdentity,ɵɵrepeaterTrackByIndex,ɵɵresetView,ɵɵresolveDocument,ɵɵrestoreView,ɵɵsanitizeHtml,ɵɵsanitizeUrl,ɵɵstoreLet,ɵɵstyleMap,ɵɵstyleProp,ɵɵtemplate,ɵɵtemplateRefExtractor,ɵɵtext,ɵɵtextInterpolate,ɵɵtextInterpolate1,ɵɵtextInterpolate2,ɵɵtextInterpolate3,ɵɵtwoWayBindingSet,ɵɵtwoWayListener,ɵɵtwoWayProperty,ɵɵviewQuery,ɵɵviewQuerySignal}from"./chunk-TWBKJRIF.js";import"./chunk-H2MDWMMO.js";import{camelCase_default,capitalize_default,cloneDeep_default,compact_default,deburr_default,escape_default,flatMap_default,flatten_default,get_default,groupBy_default,has_default,isArray_default,isEmpty_default,isEqual_default,isNil_default,isObject_default,isString_default,isUndefined_default,kebabCase_default,memoize_default,merge_default,omitBy_default,omit_default,orderBy_default,pick_default,range_default,set_default,snakeCase_default,sortBy_default,startCase_default,template_default,uniqBy_default,uniq_default,upperCase_default,upperFirst_default}from"./chunk-N5TLZNK7.js";import{__async,__commonJS,__esm,__export,__objRest,__require,__spreadProps,__spreadValues,__superGet,__toCommonJS,__toESM,__yieldStar}from"./chunk-IHZVASS3.js";var require_FileSaver_min=__commonJS({"node_modules/file-saver/dist/FileSaver.min.js"(exports,module){(function(a,b){typeof define=="function"&&define.amd?define([],b):typeof exports<"u"?b():(b(),a.FileSaver={})})(exports,function(){"use strict";function b(a2,b2){return typeof b2>"u"?b2={autoBom:!1}:typeof b2!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),b2={autoBom:!b2}),b2.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a2.type)?new Blob(["\uFEFF",a2],{type:a2.type}):a2}function c(a2,b2,c2){var d2=new XMLHttpRequest;d2.open("GET",a2),d2.responseType="blob",d2.onload=function(){g(d2.response,b2,c2)},d2.onerror=function(){console.error("could not download file")},d2.send()}function d(a2){var b2=new XMLHttpRequest;b2.open("HEAD",a2,!1);try{b2.send()}catch{}return 200<=b2.status&&299>=b2.status}function e(a2){try{a2.dispatchEvent(new MouseEvent("click"))}catch{var b2=document.createEvent("MouseEvents");b2.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a2.dispatchEvent(b2)}}var f=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||(typeof window!="object"||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b2,g2,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g2=g2||b2.name||"download",j.download=g2,j.rel="noopener",typeof b2=="string"?(j.href=b2,j.origin===location.origin?e(j):d(j.href)?c(b2,g2,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b2),setTimeout(function(){i.revokeObjectURL(j.href)},4e4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f2,g2,h){if(g2=g2||f2.name||"download",typeof f2!="string")navigator.msSaveOrOpenBlob(b(f2,h),g2);else if(d(f2))c(f2,g2,h);else{var i=document.createElement("a");i.href=f2,i.target="_blank",setTimeout(function(){e(i)})}}:function(b2,d2,e2,g2){if(g2=g2||open("","_blank"),g2&&(g2.document.title=g2.document.body.innerText="downloading..."),typeof b2=="string")return c(b2,d2,e2);var h=b2.type==="application/octet-stream",i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&typeof FileReader<"u"){var k=new FileReader;k.onloadend=function(){var a2=k.result;a2=j?a2:a2.replace(/^data:[^;]*;/,"data:attachment/file;"),g2?g2.location.href=a2:location=a2,g2=null},k.readAsDataURL(b2)}else{var l2=f.URL||f.webkitURL,m=l2.createObjectURL(b2);g2?g2.location=m:location.href=m,g2=null,setTimeout(function(){l2.revokeObjectURL(m)},4e4)}});f.saveAs=g.saveAs=g,typeof module<"u"&&(module.exports=g)})}});var require_ua_parser=__commonJS({"node_modules/ua-parser-js/src/ua-parser.js"(exports,module){(function(window2,undefined2){"use strict";var LIBVERSION="1.0.37",EMPTY2="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION2="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded",UA_MAX_LENGTH=500,AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",BROWSER="Browser",CHROME="Chrome",EDGE="Edge",FIREFOX="Firefox",GOOGLE="Google",HUAWEI="Huawei",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",OPERA="Opera",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",FACEBOOK="Facebook",CHROMIUM_OS="Chromium OS",MAC_OS="Mac OS",extend3=function(regexes2,extensions){var mergedRegexes={};for(var i in regexes2)extensions[i]&&extensions[i].length%2===0?mergedRegexes[i]=extensions[i].concat(regexes2[i]):mergedRegexes[i]=regexes2[i];return mergedRegexes},enumerize=function(arr){for(var enums={},i=0;i<arr.length;i++)enums[arr[i].toUpperCase()]=arr[i];return enums},has=function(str1,str2){return typeof str1===STR_TYPE?lowerize(str2).indexOf(lowerize(str1))!==-1:!1},lowerize=function(str){return str.toLowerCase()},majorize=function(version2){return typeof version2===STR_TYPE?version2.replace(/[^\d\.]/g,EMPTY2).split(".")[0]:undefined2},trim=function(str,len){if(typeof str===STR_TYPE)return str=str.replace(/^\s\s*/,EMPTY2),typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)},rgxMapper=function(ua,arrays){for(var i=0,j,k,p,q,matches,match2;i<arrays.length&&!matches;){var regex=arrays[i],props2=arrays[i+1];for(j=k=0;j<regex.length&&!matches&&regex[j];)if(matches=regex[j++].exec(ua),matches)for(p=0;p<props2.length;p++)match2=matches[++k],q=props2[p],typeof q===OBJ_TYPE&&q.length>0?q.length===2?typeof q[1]==FUNC_TYPE?this[q[0]]=q[1].call(this,match2):this[q[0]]=q[1]:q.length===3?typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)?this[q[0]]=match2?q[1].call(this,match2,q[2]):undefined2:this[q[0]]=match2?match2.replace(q[1],q[2]):undefined2:q.length===4&&(this[q[0]]=match2?q[3].call(this,match2.replace(q[1],q[2])):undefined2):this[q]=match2||undefined2;i+=2}},strMapper=function(str,map4){for(var i in map4)if(typeof map4[i]===OBJ_TYPE&&map4[i].length>0){for(var j=0;j<map4[i].length;j++)if(has(map4[i][j],str))return i===UNKNOWN?undefined2:i}else if(has(map4[i],str))return i===UNKNOWN?undefined2:i;return str},oldSafariMap={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},windowsVersionMap={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},regexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION2,[NAME,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION2,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION2],[/opios[\/ ]+([\w\.]+)/i],[VERSION2,[NAME,OPERA+" Mini"]],[/\bopr\/([\w\.]+)/i],[VERSION2,[NAME,OPERA]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[VERSION2,[NAME,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[NAME,VERSION2],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION2,[NAME,"UC"+BROWSER]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[VERSION2,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION2,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION2,[NAME,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[VERSION2,[NAME,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[VERSION2,[NAME,"Smart Lenovo "+BROWSER]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure "+BROWSER],VERSION2],[/\bfocus\/([\w\.]+)/i],[VERSION2,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION2,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION2,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION2,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION2,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION2,[NAME,"MIUI "+BROWSER]],[/fxios\/([-\w\.]+)/i],[VERSION2,[NAME,FIREFOX]],[/\bqihu|(qi?ho?o?|360)browser/i],[[NAME,"360 "+BROWSER]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 "+BROWSER],VERSION2],[/samsungbrowser\/([\w\.]+)/i],[VERSION2,[NAME,SAMSUNG+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[NAME,/_/g," "],VERSION2],[/metasr[\/ ]?([\d\.]+)/i],[VERSION2,[NAME,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[NAME,"Sogou Mobile"],VERSION2],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[NAME,VERSION2],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION2],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[NAME,VERSION2],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION2,[NAME,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[VERSION2,[NAME,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION2,[NAME,CHROME+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION2],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION2,[NAME,"Android "+BROWSER]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION2],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[VERSION2,[NAME,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[VERSION2,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION2,strMapper,oldSafariMap]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION2],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION2],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION2,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[NAME,VERSION2],[/(cobalt)\/([\w\.]+)/i],[NAME,[VERSION2,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i],[[ARCHITECTURE,lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/windows (ce|mobile); ppc;/i],[[ARCHITECTURE,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[ARCHITECTURE,/ower/,EMPTY2,lowerize]],[/(sun4\w)[;\)]/i],[[ARCHITECTURE,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[ARCHITECTURE,lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/(macintosh);/i],[MODEL,[VENDOR,APPLE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,"OPPO"],[TYPE,MOBILE]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[MODEL,[VENDOR,"Lenovo"],[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[MODEL,/_/g," "],[VENDOR,"Nokia"],[TYPE,MOBILE]],[/(pixel c)\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,"OnePlus"],[TYPE,MOBILE]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[MODEL,[VENDOR,"Ulefone"],[TYPE,MOBILE]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/(u304aa)/i],[MODEL,[VENDOR,"AT&T"],[TYPE,MOBILE]],[/\bsie-(\w*)/i],[MODEL,[VENDOR,"Siemens"],[TYPE,MOBILE]],[/\b(rct\w+) b/i],[MODEL,[VENDOR,"RCA"],[TYPE,TABLET]],[/\b(venue[\d ]{2,7}) b/i],[MODEL,[VENDOR,"Dell"],[TYPE,TABLET]],[/\b(q(?:mv|ta)\w+) b/i],[MODEL,[VENDOR,"Verizon"],[TYPE,TABLET]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[MODEL,[VENDOR,"Barnes & Noble"],[TYPE,TABLET]],[/\b(tm\d{3}\w+) b/i],[MODEL,[VENDOR,"NuVision"],[TYPE,TABLET]],[/\b(k88) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,TABLET]],[/\b(nx\d{3}j) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,MOBILE]],[/\b(gen\d{3}) b.+49h/i],[MODEL,[VENDOR,"Swiss"],[TYPE,MOBILE]],[/\b(zur\d{3}) b/i],[MODEL,[VENDOR,"Swiss"],[TYPE,TABLET]],[/\b((zeki)?tb.*\b) b/i],[MODEL,[VENDOR,"Zeki"],[TYPE,TABLET]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[VENDOR,"Dragon Touch"],MODEL,[TYPE,TABLET]],[/\b(ns-?\w{0,9}) b/i],[MODEL,[VENDOR,"Insignia"],[TYPE,TABLET]],[/\b((nxa|next)-?\w{0,9}) b/i],[MODEL,[VENDOR,"NextBook"],[TYPE,TABLET]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[VENDOR,"Voice"],MODEL,[TYPE,MOBILE]],[/\b(lvtel\-)?(v1[12]) b/i],[[VENDOR,"LvTel"],MODEL,[TYPE,MOBILE]],[/\b(ph-1) /i],[MODEL,[VENDOR,"Essential"],[TYPE,MOBILE]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[MODEL,[VENDOR,"Envizen"],[TYPE,TABLET]],[/\b(trio[-\w\. ]+) b/i],[MODEL,[VENDOR,"MachSpeed"],[TYPE,TABLET]],[/\btu_(1491) b/i],[MODEL,[VENDOR,"Rotor"],[TYPE,TABLET]],[/(shield[\w ]+) b/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROME+"cast"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/droid.+aft(\w+)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mitv-\w{5}) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/Hbbtv.*(technisat) (.*);/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[VENDOR,trim],[MODEL,trim],[TYPE,SMARTTV]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[TYPE,SMARTTV]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[VENDOR,MODEL,[TYPE,CONSOLE]],[/droid.+; (shield) bui/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,CONSOLE]],[/(playstation [345portablevi]+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/((pebble))app/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[MODEL,[VENDOR,APPLE],[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/(quest( 2| pro)?)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,WEARABLE]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/(aeobc)\b/i],[MODEL,[VENDOR,AMAZON],[TYPE,EMBEDDED]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[MODEL,[TYPE,MOBILE]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[MODEL,[TYPE,TABLET]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/(android[-\w\. ]{0,9});.+buil/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION2,[NAME,EDGE+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION2,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[NAME,VERSION2],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION2,NAME]],os:[[/microsoft (windows) (vista|xp)/i],[NAME,VERSION2],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[NAME,[VERSION2,strMapper,windowsVersionMap]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[VERSION2,strMapper,windowsVersionMap],[NAME,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[VERSION2,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[NAME,MAC_OS],[VERSION2,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[VERSION2,NAME],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[NAME,VERSION2],[/\(bb(10);/i],[VERSION2,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[VERSION2,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION2,[NAME,FIREFOX+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[VERSION2,[NAME,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[VERSION2,[NAME,"watchOS"]],[/crkey\/([\d\.]+)/i],[VERSION2,[NAME,CHROME+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[NAME,CHROMIUM_OS],VERSION2],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[NAME,VERSION2],[/(sunos) ?([\w\.\d]*)/i],[[NAME,"Solaris"],VERSION2],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION2]]},UAParser2=function(ua,extensions){if(typeof ua===OBJ_TYPE&&(extensions=ua,ua=undefined2),!(this instanceof UAParser2))return new UAParser2(ua,extensions).getResult();var _navigator=typeof window2!==UNDEF_TYPE&&window2.navigator?window2.navigator:undefined2,_ua=ua||(_navigator&&_navigator.userAgent?_navigator.userAgent:EMPTY2),_uach=_navigator&&_navigator.userAgentData?_navigator.userAgentData:undefined2,_rgxmap=extensions?extend3(regexes,extensions):regexes,_isSelfNav=_navigator&&_navigator.userAgent==_ua;return this.getBrowser=function(){var _browser={};return _browser[NAME]=undefined2,_browser[VERSION2]=undefined2,rgxMapper.call(_browser,_ua,_rgxmap.browser),_browser[MAJOR]=majorize(_browser[VERSION2]),_isSelfNav&&_navigator&&_navigator.brave&&typeof _navigator.brave.isBrave==FUNC_TYPE&&(_browser[NAME]="Brave"),_browser},this.getCPU=function(){var _cpu={};return _cpu[ARCHITECTURE]=undefined2,rgxMapper.call(_cpu,_ua,_rgxmap.cpu),_cpu},this.getDevice=function(){var _device={};return _device[VENDOR]=undefined2,_device[MODEL]=undefined2,_device[TYPE]=undefined2,rgxMapper.call(_device,_ua,_rgxmap.device),_isSelfNav&&!_device[TYPE]&&_uach&&_uach.mobile&&(_device[TYPE]=MOBILE),_isSelfNav&&_device[MODEL]=="Macintosh"&&_navigator&&typeof _navigator.standalone!==UNDEF_TYPE&&_navigator.maxTouchPoints&&_navigator.maxTouchPoints>2&&(_device[MODEL]="iPad",_device[TYPE]=TABLET),_device},this.getEngine=function(){var _engine={};return _engine[NAME]=undefined2,_engine[VERSION2]=undefined2,rgxMapper.call(_engine,_ua,_rgxmap.engine),_engine},this.getOS=function(){var _os={};return _os[NAME]=undefined2,_os[VERSION2]=undefined2,rgxMapper.call(_os,_ua,_rgxmap.os),_isSelfNav&&!_os[NAME]&&_uach&&_uach.platform!="Unknown"&&(_os[NAME]=_uach.platform.replace(/chrome os/i,CHROMIUM_OS).replace(/macos/i,MAC_OS)),_os},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return _ua},this.setUA=function(ua2){return _ua=typeof ua2===STR_TYPE&&ua2.length>UA_MAX_LENGTH?trim(ua2,UA_MAX_LENGTH):ua2,this},this.setUA(_ua),this};UAParser2.VERSION=LIBVERSION,UAParser2.BROWSER=enumerize([NAME,VERSION2,MAJOR]),UAParser2.CPU=enumerize([ARCHITECTURE]),UAParser2.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]),UAParser2.ENGINE=UAParser2.OS=enumerize([NAME,VERSION2]),typeof exports!==UNDEF_TYPE?(typeof module!==UNDEF_TYPE&&module.exports&&(exports=module.exports=UAParser2),exports.UAParser=UAParser2):typeof define===FUNC_TYPE&&define.amd?define(function(){return UAParser2}):typeof window2!==UNDEF_TYPE&&(window2.UAParser=UAParser2);var $=typeof window2!==UNDEF_TYPE&&(window2.jQuery||window2.Zepto);if($&&!$.ua){var parser=new UAParser2;$.ua=parser.getResult(),$.ua.get=function(){return parser.getUA()},$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result)$.ua[prop]=result[prop]}}})(typeof window=="object"?window:exports)}});var require_dayjs_min=__commonJS({"node_modules/dayjs/dayjs.min.js"(exports,module){(function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(exports,function(){"use strict";var t=1e3,e=6e4,n2=36e5,r="millisecond",i="second",s2="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l2="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t2){var e2=["th","st","nd","rd"],n3=t2%100;return"["+t2+(e2[(n3-20)%10]||e2[n3]||e2[0])+"]"}},m=function(t2,e2,n3){var r2=String(t2);return!r2||r2.length>=e2?t2:""+Array(e2+1-r2.length).join(n3)+t2},v={s:m,z:function(t2){var e2=-t2.utcOffset(),n3=Math.abs(e2),r2=Math.floor(n3/60),i2=n3%60;return(e2<=0?"+":"-")+m(r2,2,"0")+":"+m(i2,2,"0")},m:function t2(e2,n3){if(e2.date()<n3.date())return-t2(n3,e2);var r2=12*(n3.year()-e2.year())+(n3.month()-e2.month()),i2=e2.clone().add(r2,c),s3=n3-i2<0,u2=e2.clone().add(r2+(s3?-1:1),c);return+(-(r2+(n3-i2)/(s3?i2-u2:u2-i2))||0)},a:function(t2){return t2<0?Math.ceil(t2)||0:Math.floor(t2)},p:function(t2){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s2,s:i,ms:r,Q:f}[t2]||String(t2||"").toLowerCase().replace(/s$/,"")},u:function(t2){return t2===void 0}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t2){return t2 instanceof _||!(!t2||!t2[p])},w=function t2(e2,n3,r2){var i2;if(!e2)return g;if(typeof e2=="string"){var s3=e2.toLowerCase();D[s3]&&(i2=s3),n3&&(D[s3]=n3,i2=s3);var u2=e2.split("-");if(!i2&&u2.length>1)return t2(u2[0])}else{var a2=e2.name;D[a2]=e2,i2=a2}return!r2&&i2&&(g=i2),i2||!r2&&g},O=function(t2,e2){if(S(t2))return t2.clone();var n3=typeof e2=="object"?e2:{};return n3.date=t2,n3.args=arguments,new _(n3)},b=v;b.l=w,b.i=S,b.w=function(t2,e2){return O(t2,{locale:e2.$L,utc:e2.$u,x:e2.$x,$offset:e2.$offset})};var _=function(){function M2(t2){this.$L=w(t2.locale,null,!0),this.parse(t2),this.$x=this.$x||t2.x||{},this[p]=!0}var m2=M2.prototype;return m2.parse=function(t2){this.$d=function(t3){var e2=t3.date,n3=t3.utc;if(e2===null)return new Date(NaN);if(b.u(e2))return new Date;if(e2 instanceof Date)return new Date(e2);if(typeof e2=="string"&&!/Z$/i.test(e2)){var r2=e2.match($);if(r2){var i2=r2[2]-1||0,s3=(r2[7]||"0").substring(0,3);return n3?new Date(Date.UTC(r2[1],i2,r2[3]||1,r2[4]||0,r2[5]||0,r2[6]||0,s3)):new Date(r2[1],i2,r2[3]||1,r2[4]||0,r2[5]||0,r2[6]||0,s3)}}return new Date(e2)}(t2),this.init()},m2.init=function(){var t2=this.$d;this.$y=t2.getFullYear(),this.$M=t2.getMonth(),this.$D=t2.getDate(),this.$W=t2.getDay(),this.$H=t2.getHours(),this.$m=t2.getMinutes(),this.$s=t2.getSeconds(),this.$ms=t2.getMilliseconds()},m2.$utils=function(){return b},m2.isValid=function(){return this.$d.toString()!==l2},m2.isSame=function(t2,e2){var n3=O(t2);return this.startOf(e2)<=n3&&n3<=this.endOf(e2)},m2.isAfter=function(t2,e2){return O(t2)<this.startOf(e2)},m2.isBefore=function(t2,e2){return this.endOf(e2)<O(t2)},m2.$g=function(t2,e2,n3){return b.u(t2)?this[e2]:this.set(n3,t2)},m2.unix=function(){return Math.floor(this.valueOf()/1e3)},m2.valueOf=function(){return this.$d.getTime()},m2.startOf=function(t2,e2){var n3=this,r2=!!b.u(e2)||e2,f2=b.p(t2),l3=function(t3,e3){var i2=b.w(n3.$u?Date.UTC(n3.$y,e3,t3):new Date(n3.$y,e3,t3),n3);return r2?i2:i2.endOf(a)},$2=function(t3,e3){return b.w(n3.toDate()[t3].apply(n3.toDate("s"),(r2?[0,0,0,0]:[23,59,59,999]).slice(e3)),n3)},y2=this.$W,M3=this.$M,m3=this.$D,v2="set"+(this.$u?"UTC":"");switch(f2){case h:return r2?l3(1,0):l3(31,11);case c:return r2?l3(1,M3):l3(0,M3+1);case o:var g2=this.$locale().weekStart||0,D2=(y2<g2?y2+7:y2)-g2;return l3(r2?m3-D2:m3+(6-D2),M3);case a:case d:return $2(v2+"Hours",0);case u:return $2(v2+"Minutes",1);case s2:return $2(v2+"Seconds",2);case i:return $2(v2+"Milliseconds",3);default:return this.clone()}},m2.endOf=function(t2){return this.startOf(t2,!1)},m2.$set=function(t2,e2){var n3,o2=b.p(t2),f2="set"+(this.$u?"UTC":""),l3=(n3={},n3[a]=f2+"Date",n3[d]=f2+"Date",n3[c]=f2+"Month",n3[h]=f2+"FullYear",n3[u]=f2+"Hours",n3[s2]=f2+"Minutes",n3[i]=f2+"Seconds",n3[r]=f2+"Milliseconds",n3)[o2],$2=o2===a?this.$D+(e2-this.$W):e2;if(o2===c||o2===h){var y2=this.clone().set(d,1);y2.$d[l3]($2),y2.init(),this.$d=y2.set(d,Math.min(this.$D,y2.daysInMonth())).$d}else l3&&this.$d[l3]($2);return this.init(),this},m2.set=function(t2,e2){return this.clone().$set(t2,e2)},m2.get=function(t2){return this[b.p(t2)]()},m2.add=function(r2,f2){var d2,l3=this;r2=Number(r2);var $2=b.p(f2),y2=function(t2){var e2=O(l3);return b.w(e2.date(e2.date()+Math.round(t2*r2)),l3)};if($2===c)return this.set(c,this.$M+r2);if($2===h)return this.set(h,this.$y+r2);if($2===a)return y2(1);if($2===o)return y2(7);var M3=(d2={},d2[s2]=e,d2[u]=n2,d2[i]=t,d2)[$2]||1,m3=this.$d.getTime()+r2*M3;return b.w(m3,this)},m2.subtract=function(t2,e2){return this.add(-1*t2,e2)},m2.format=function(t2){var e2=this,n3=this.$locale();if(!this.isValid())return n3.invalidDate||l2;var r2=t2||"YYYY-MM-DDTHH:mm:ssZ",i2=b.z(this),s3=this.$H,u2=this.$m,a2=this.$M,o2=n3.weekdays,c2=n3.months,f2=n3.meridiem,h2=function(t3,n4,i3,s4){return t3&&(t3[n4]||t3(e2,r2))||i3[n4].slice(0,s4)},d2=function(t3){return b.s(s3%12||12,t3,"0")},$2=f2||function(t3,e3,n4){var r3=t3<12?"AM":"PM";return n4?r3.toLowerCase():r3};return r2.replace(y,function(t3,r3){return r3||function(t4){switch(t4){case"YY":return String(e2.$y).slice(-2);case"YYYY":return b.s(e2.$y,4,"0");case"M":return a2+1;case"MM":return b.s(a2+1,2,"0");case"MMM":return h2(n3.monthsShort,a2,c2,3);case"MMMM":return h2(c2,a2);case"D":return e2.$D;case"DD":return b.s(e2.$D,2,"0");case"d":return String(e2.$W);case"dd":return h2(n3.weekdaysMin,e2.$W,o2,2);case"ddd":return h2(n3.weekdaysShort,e2.$W,o2,3);case"dddd":return o2[e2.$W];case"H":return String(s3);case"HH":return b.s(s3,2,"0");case"h":return d2(1);case"hh":return d2(2);case"a":return $2(s3,u2,!0);case"A":return $2(s3,u2,!1);case"m":return String(u2);case"mm":return b.s(u2,2,"0");case"s":return String(e2.$s);case"ss":return b.s(e2.$s,2,"0");case"SSS":return b.s(e2.$ms,3,"0");case"Z":return i2}return null}(t3)||i2.replace(":","")})},m2.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m2.diff=function(r2,d2,l3){var $2,y2=this,M3=b.p(d2),m3=O(r2),v2=(m3.utcOffset()-this.utcOffset())*e,g2=this-m3,D2=function(){return b.m(y2,m3)};switch(M3){case h:$2=D2()/12;break;case c:$2=D2();break;case f:$2=D2()/3;break;case o:$2=(g2-v2)/6048e5;break;case a:$2=(g2-v2)/864e5;break;case u:$2=g2/n2;break;case s2:$2=g2/e;break;case i:$2=g2/t;break;default:$2=g2}return l3?$2:b.a($2)},m2.daysInMonth=function(){return this.endOf(c).$D},m2.$locale=function(){return D[this.$L]},m2.locale=function(t2,e2){if(!t2)return this.$L;var n3=this.clone(),r2=w(t2,e2,!0);return r2&&(n3.$L=r2),n3},m2.clone=function(){return b.w(this.$d,this)},m2.toDate=function(){return new Date(this.valueOf())},m2.toJSON=function(){return this.isValid()?this.toISOString():null},m2.toISOString=function(){return this.$d.toISOString()},m2.toString=function(){return this.$d.toUTCString()},M2}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s2],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach(function(t2){k[t2[1]]=function(e2){return this.$g(e2,t2[0],t2[1])}}),O.extend=function(t2,e2){return t2.$i||(t2(e2,_,O),t2.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t2){return O(1e3*t2)},O.en=D[g],O.Ls=D,O.p={},O})}});var require_localeData=__commonJS({"node_modules/dayjs/plugin/localeData.js"(exports,module){(function(n2,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(n2=typeof globalThis<"u"?globalThis:n2||self).dayjs_plugin_localeData=e()})(exports,function(){"use strict";return function(n2,e,t){var r=e.prototype,o=function(n3){return n3&&(n3.indexOf?n3:n3.s)},u=function(n3,e2,t2,r2,u2){var i2=n3.name?n3:n3.$locale(),a2=o(i2[e2]),s3=o(i2[t2]),f=a2||s3.map(function(n4){return n4.slice(0,r2)});if(!u2)return f;var d=i2.weekStart;return f.map(function(n4,e3){return f[(e3+(d||0))%7]})},i=function(){return t.Ls[t.locale()]},a=function(n3,e2){return n3.formats[e2]||function(n4){return n4.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(n5,e3,t2){return e3||t2.slice(1)})}(n3.formats[e2.toUpperCase()])},s2=function(){var n3=this;return{months:function(e2){return e2?e2.format("MMMM"):u(n3,"months")},monthsShort:function(e2){return e2?e2.format("MMM"):u(n3,"monthsShort","months",3)},firstDayOfWeek:function(){return n3.$locale().weekStart||0},weekdays:function(e2){return e2?e2.format("dddd"):u(n3,"weekdays")},weekdaysMin:function(e2){return e2?e2.format("dd"):u(n3,"weekdaysMin","weekdays",2)},weekdaysShort:function(e2){return e2?e2.format("ddd"):u(n3,"weekdaysShort","weekdays",3)},longDateFormat:function(e2){return a(n3.$locale(),e2)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s2.bind(this)()},t.localeData=function(){var n3=i();return{firstDayOfWeek:function(){return n3.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e2){return a(n3,e2)},meridiem:n3.meridiem,ordinal:n3.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n3){return u(i(),"weekdays",null,null,n3)},t.weekdaysShort=function(n3){return u(i(),"weekdaysShort","weekdays",3,n3)},t.weekdaysMin=function(n3){return u(i(),"weekdaysMin","weekdays",2,n3)}}})}});var require_localizedFormat=__commonJS({"node_modules/dayjs/plugin/localizedFormat.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_localizedFormat=t()})(exports,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,o,n2){var r=o.prototype,i=r.format;n2.en.formats=e,r.format=function(t2){t2===void 0&&(t2="YYYY-MM-DDTHH:mm:ssZ");var o2=this.$locale().formats,n3=function(t3,o3){return t3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t4,n4,r2){var i2=r2&&r2.toUpperCase();return n4||o3[r2]||e[r2]||o3[i2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e2,t5,o4){return t5||o4.slice(1)})})}(t2,o2===void 0?{}:o2);return i.call(this,n3)}}})}});var require_isoWeek=__commonJS({"node_modules/dayjs/plugin/isoWeek.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_isoWeek=t()})(exports,function(){"use strict";var e="day";return function(t,i,s2){var a=function(t2){return t2.add(4-t2.isoWeekday(),e)},d=i.prototype;d.isoWeekYear=function(){return a(this).year()},d.isoWeek=function(t2){if(!this.$utils().u(t2))return this.add(7*(t2-this.isoWeek()),e);var i2,d2,n3,o,r=a(this),u=(i2=this.isoWeekYear(),d2=this.$u,n3=(d2?s2.utc:s2)().year(i2).startOf("year"),o=4-n3.isoWeekday(),n3.isoWeekday()>4&&(o+=7),n3.add(o,e));return r.diff(u,"week")+1},d.isoWeekday=function(e2){return this.$utils().u(e2)?this.day()||7:this.day(this.day()%7?e2:e2-7)};var n2=d.startOf;d.startOf=function(e2,t2){var i2=this.$utils(),s3=!!i2.u(t2)||t2;return i2.p(e2)==="isoweek"?s3?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n2.bind(this)(e2,t2)}}})}});var require_weekOfYear=__commonJS({"node_modules/dayjs/plugin/weekOfYear.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_weekOfYear=t()})(exports,function(){"use strict";var e="week",t="year";return function(i,n2,r){var f=n2.prototype;f.week=function(i2){if(i2===void 0&&(i2=null),i2!==null)return this.add(7*(i2-this.week()),"day");var n3=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var f2=r(this).startOf(t).add(1,t).date(n3),s2=r(this).endOf(e);if(f2.isBefore(s2))return 1}var a=r(this).startOf(t).date(n3).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e2){return e2===void 0&&(e2=null),this.week(e2)}}})}});var require_customParseFormat=__commonJS({"node_modules/dayjs/plugin/customParseFormat.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_customParseFormat=t()})(exports,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n2=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s2=function(e2){return(e2=+e2)+(e2>68?1900:2e3)},a=function(e2){return function(t2){this[e2]=+t2}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(e2){(this.zone||(this.zone={})).offset=function(e3){if(!e3||e3==="Z")return 0;var t2=e3.match(/([+-]|\d\d)/g),n3=60*t2[1]+(+t2[2]||0);return n3===0?0:t2[0]==="+"?-n3:n3}(e2)}],h=function(e2){var t2=o[e2];return t2&&(t2.indexOf?t2:t2.s.concat(t2.f))},u=function(e2,t2){var n3,r2=o.meridiem;if(r2){for(var i2=1;i2<=24;i2+=1)if(e2.indexOf(r2(i2,0,t2))>-1){n3=i2>12;break}}else n3=e2===(t2?"pm":"PM");return n3},d={A:[i,function(e2){this.afternoon=u(e2,!1)}],a:[i,function(e2){this.afternoon=u(e2,!0)}],S:[/\d/,function(e2){this.milliseconds=100*+e2}],SS:[n2,function(e2){this.milliseconds=10*+e2}],SSS:[/\d{3}/,function(e2){this.milliseconds=+e2}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n2,a("day")],Do:[i,function(e2){var t2=o.ordinal,n3=e2.match(/\d+/);if(this.day=n3[0],t2)for(var r2=1;r2<=31;r2+=1)t2(r2).replace(/\[|\]/g,"")===e2&&(this.day=r2)}],M:[r,a("month")],MM:[n2,a("month")],MMM:[i,function(e2){var t2=h("months"),n3=(h("monthsShort")||t2.map(function(e3){return e3.slice(0,3)})).indexOf(e2)+1;if(n3<1)throw new Error;this.month=n3%12||n3}],MMMM:[i,function(e2){var t2=h("months").indexOf(e2)+1;if(t2<1)throw new Error;this.month=t2%12||t2}],Y:[/[+-]?\d+/,a("year")],YY:[n2,function(e2){this.year=s2(e2)}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n3){var r2,i2;r2=n3,i2=o&&o.formats;for(var s3=(n3=r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t2,n4,r3){var o2=r3&&r3.toUpperCase();return n4||i2[r3]||e[r3]||i2[o2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e2,t3,n5){return t3||n5.slice(1)})})).match(t),a2=s3.length,f2=0;f2<a2;f2+=1){var h2=s3[f2],u2=d[h2],c2=u2&&u2[0],l2=u2&&u2[1];s3[f2]=l2?{regex:c2,parser:l2}:h2.replace(/^\[|\]$/g,"")}return function(e2){for(var t2={},n4=0,r3=0;n4<a2;n4+=1){var i3=s3[n4];if(typeof i3=="string")r3+=i3.length;else{var o2=i3.regex,f3=i3.parser,h3=e2.slice(r3),u3=o2.exec(h3)[0];f3.call(t2,u3),e2=e2.replace(u3,"")}}return function(e3){var t3=e3.afternoon;if(t3!==void 0){var n5=e3.hours;t3?n5<12&&(e3.hours+=12):n5===12&&(e3.hours=0),delete e3.afternoon}}(t2),t2}}return function(e2,t2,n3){n3.p.customParseFormat=!0,e2&&e2.parseTwoDigitYear&&(s2=e2.parseTwoDigitYear);var r2=t2.prototype,i2=r2.parse;r2.parse=function(e3){var t3=e3.date,r3=e3.utc,s3=e3.args;this.$u=r3;var a2=s3[1];if(typeof a2=="string"){var f2=s3[2]===!0,h2=s3[3]===!0,u2=f2||h2,d2=s3[2];h2&&(d2=s3[2]),o=this.$locale(),!f2&&d2&&(o=n3.Ls[d2]),this.$d=function(e4,t4,n4){try{if(["x","X"].indexOf(t4)>-1)return new Date((t4==="X"?1e3:1)*e4);var r4=c(t4)(e4),i3=r4.year,o2=r4.month,s4=r4.day,a3=r4.hours,f3=r4.minutes,h3=r4.seconds,u3=r4.milliseconds,d3=r4.zone,l3=new Date,m2=s4||(i3||o2?1:l3.getDate()),M2=i3||l3.getFullYear(),Y=0;i3&&!o2||(Y=o2>0?o2-1:l3.getMonth());var p=a3||0,v=f3||0,D=h3||0,g=u3||0;return d3?new Date(Date.UTC(M2,Y,m2,p,v,D,g+60*d3.offset*1e3)):n4?new Date(Date.UTC(M2,Y,m2,p,v,D,g)):new Date(M2,Y,m2,p,v,D,g)}catch{return new Date("")}}(t3,a2,r3),this.init(),d2&&d2!==!0&&(this.$L=this.locale(d2).$L),u2&&t3!=this.format(a2)&&(this.$d=new Date("")),o={}}else if(a2 instanceof Array)for(var l2=a2.length,m=1;m<=l2;m+=1){s3[1]=a2[m-1];var M=n3.apply(this,s3);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l2&&(this.$d=new Date(""))}else i2.call(this,e3)}}})}});var require_papaparse_min=__commonJS({"node_modules/papaparse/papaparse.min.js"(exports,module){(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof module=="object"&&typeof exports<"u"?module.exports=t():e.Papa=t()})(exports,function s2(){"use strict";var f=typeof self<"u"?self:typeof window<"u"?window:f!==void 0?f:{},n2=!f.document&&!!f.postMessage,o=f.IS_PAPA_WORKER||!1,a={},u=0,b={parse:function(e,t){var r2=(t=t||{}).dynamicTyping||!1;if(J(r2)&&(t.dynamicTypingFunction=r2,r2={}),t.dynamicTyping=r2,t.transform=!!J(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var i=function(){if(!b.WORKERS_SUPPORTED)return!1;var e2=(r3=f.URL||f.webkitURL||null,i2=s2.toString(),b.BLOB_URL||(b.BLOB_URL=r3.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",i2,")();"],{type:"text/javascript"})))),t2=new f.Worker(e2),r3,i2;return t2.onmessage=_,t2.id=u++,a[t2.id]=t2}();return i.userStep=t.step,i.userChunk=t.chunk,i.userComplete=t.complete,i.userError=t.error,t.step=J(t.step),t.chunk=J(t.chunk),t.complete=J(t.complete),t.error=J(t.error),delete t.worker,void i.postMessage({input:e,config:t,workerId:i.id})}var n3=null;return b.NODE_STREAM_INPUT,typeof e=="string"?(e=function(e2){return e2.charCodeAt(0)===65279?e2.slice(1):e2}(e),n3=t.download?new l2(t):new p(t)):e.readable===!0&&J(e.read)&&J(e.on)?n3=new g(t):(f.File&&e instanceof File||e instanceof Object)&&(n3=new c(t)),n3.stream(e)},unparse:function(e,t){var n3=!1,_2=!0,m2=",",y2=`\r
1
+ import{require_jszip_min}from"./chunk-4R2H3OTM.js";import{quill_default}from"./chunk-KMUH6KCJ.js";import{A11yModule,ACTIVE_RUNTIME_CHECKS,ANIMATION_MODULE_TYPE,APP_CONFIG,APP_INITIALIZER,AUTO_STYLE,Actions,ActionsSubject,ActivatedRoute,AnimationGroupPlayer,AnimationMetadataType,AnonymousSubject,ApplicationRef,AsyncPipe,BackendComponentCallerService,BackendComponentCallerServiceFactory,BackendComponentClient,BackendComponentClientProxyService,BehaviorSubject,BreakpointObserver,Breakpoints,BrowserModule,CdkDrag,CdkDragPlaceholder,CdkDragPreview,CdkDropList,CdkPortalOutlet,CdkScrollable,CdkTextareaAutosize,CdkTrapFocus,ChangeDetectorRef,Clipboard,ClipboardModule,CommonModule,ComponentFactoryResolver$1,ComponentPortal,ComponentTemplateValidatorService,DEFAULT_CARD_DIMENSIONS,DEFAULT_CBC_INGRESS_URL,DEFAULT_REPORT_DIMENSIONS,DEFAULT_SHEET_DIMENSIONS,DOCUMENT,DateAdapter,DefaultClassDirective,DefaultFlexDirective,DefaultLayoutAlignDirective,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultShowHideDirective,DefaultValueAccessor,DestroyRef,DomRendererFactory2,DomSanitizer,DragDropModule,EMPTY,EffectsModule,ElementRef,ErrorHandler,EventEmitter,FlexLayoutModule,FlexModule,FormArray,FormBuilder,FormControl,FormControlDirective,FormControlName,FormGroup,FormGroupDirective,FormGroupName,FormsModule,HTTP_INTERCEPTORS,HttpClient,HttpContext,HttpErrorResponse,HttpHeaders,HttpParams,HttpResponse,INIT,INITIAL_STATE,IXAPI_OPTIONS,InjectionToken,Injector,IxApi2RequestErrorMessages,IxApiErrorMessages,IxApiErrors,IxApiHeaderKeys,IxApiModule,IxApiRequestErrorMessages,IxApiRequestErrors,IxApiService,LayoutModule,Location,LowerCasePipe,MAT_BOTTOM_SHEET_DATA,MAT_DATE_FORMATS,MAT_DATE_LOCALE,MAT_DIALOG_DATA,MatActionList,MatBadge,MatBadgeModule,MatBottomSheet,MatBottomSheetRef,MatButton,MatButtonModule,MatCard,MatCardActions,MatCardHeader,MatCardModule,MatCardSubtitle,MatCardTitle,MatCheckbox,MatCheckboxModule,MatDatepicker,MatDatepickerInput,MatDatepickerToggle,MatDialog,MatDialogActions,MatDialogClose,MatDialogContainer,MatDialogContent,MatDialogModule,MatDialogRef,MatDialogTitle,MatDivider,MatDividerModule,MatDrawer,MatDrawerContainer,MatDrawerContent,MatError,MatExpansionPanel,MatFormField,MatFormFieldModule,MatHint,MatIcon,MatIconAnchor,MatIconButton,MatIconModule,MatIconRegistry,MatInput,MatInputModule,MatLabel,MatList,MatListItem,MatListItemIcon,MatListItemLine,MatListItemMeta,MatListItemTitle,MatListModule,MatListOption,MatListSubheaderCssMatStyler,MatMenu,MatMenuContent,MatMenuItem,MatMenuModule,MatMenuTrigger,MatNavList,MatOptgroup,MatOption,MatPaginatorModule,MatPrefix,MatProgressSpinner,MatProgressSpinnerModule,MatSelect,MatSelectModule,MatSelectTrigger,MatSelectionList,MatSidenav,MatSidenavContainer,MatSidenavModule,MatSnackBar,MatSnackBarModule,MatSuffix,MatTab,MatTabGroup,MatToolbar,MatToolbarModule,MatTooltip,MatTooltipModule,MediaObserver,Meta,MinValidator,NG_VALIDATORS,NG_VALUE_ACCESSOR,NavigationCancel,NavigationEnd,NavigationError,NavigationStart,NgClass,NgControl,NgControlStatus,NgControlStatusGroup,NgForOf,NgForm,NgIf,NgModel,NgSelectOption,NgStyle,NgTemplateOutlet,NgZone,NoopAnimationPlayer,NumberValueAccessor,ONE_WEEK,OTP_SMS_REQUIRED_PATTERN,Observable,Overlay,OverlayConfig,PAGE_COMPONENT,PLATFORM_ID,PageComponentTemplateManifestModule,PageComponentTemplateModule,PageComponentTemplateService,Platform,PortalInjector,PortalModule,REQUIRES_BRANDING,REQUIRES_COMPANY,ReactiveFormsModule,ReducerManagerDispatcher,ReducerObservable,Renderer2,RendererFactory2,ReplaySubject,RequiredValidator,ResourceDataClient,ResourceDataClientProxyService,ResourceDataServiceFactory,Router,RouterLink,RouterLinkActive,RouterModule,RouterOutlet,RoutesRecognized,RuntimeError,SESSION_STORAGE,STORAGE_KEY_CBC_CONFIG_VALUES,STORAGE_KEY_CBC_INGRESS,STORAGE_KEY_CBC_INGRESS_URL,STORAGE_KEY_CBC_PUBLIC_ID,ScannedActionsSubject,SecurityContext,SelectControlValueAccessor,SettingsModule,SharedModule,StateObservable,StorageEventContext,StorageModule,StorageService,Store,StoreModule,Subject,Subscriber,Subscription,TemplateRef,Title,TitleCasePipe,TranslateDirective,TranslateLoader,TranslateModule,TranslatePipe,TranslateService,UPDATE,USER_PROVIDED_EFFECTS,Validators,ViewContainerRef,ViewportRuler,WINDOW,add,addFailure,addSuccess,appConfigFactory,arrowRotateFactory,booleanAttribute,buffer,buildFields,catchError,combineLatest,compactFields,computed,concatMap,createAction,createEffect,createEntityAdapter,createFeature,createFeatureSelector,createReducer,createResourceAdapter,createResourceSelectorFactory,createSelector,debounceTime,decryptValue,defaultOptions,defer,delay,delayWhen,didAdd,didAddList,didRemove,didRemoveList,didUpdate,didUpdateList,distinctUntilChanged,effect,ensureAll,ensureMany,ensureOne,environment,expandCollapse,filter,first,firstValueFrom,forkJoin,forwardRef,from,fromEvent,getLinkMap,getLinkUrl,getMissingFields,getPageParams,hasFields,hasNonPublicIdFields,haveFields,inject,input,isDevMode,isNgrxMockEnvironment,isObservable,isPlatformBrowser,isPlatformServer,last,lastValueFrom,loadAllForIntentSuccess,loadAllSuccess,loadAppConfig,loadHost,loadHostFailure,loadHostSuccess,loadManySuccess,makeEnvironmentProviders,map,mapPageComponentTemplateManifestToDefaultInputs,mapPageComponentTemplateToCustomElementName,mapPageComponentTemplateToTemplateBaseUrl,mapPageComponentTemplateToTemplateUrl,mapResourceToSubResourceList,mapTemplateUrlToMainPath,mapTemplateUrlToManifestUrl,mapTemplateUrlToPublicId,merge,mergeFields,mergeLoadedFields,mergeMap,moveItemInArray,mustache_default,observeOn,of,ofStatus,ofType,omitLoadedFields,omitSubresources,on,output,pairwise,parseBody,platformBrowser,props,provideEnvironmentInitializer,provideHttpClient,queueScheduler,remove,removeFailure,removeSuccess,require_crypto_js,reset,reset2,reset3,resetPendingUpdates,retryBackoff,scan,select,selectAll,selectEntities,selectEntities2,selectEntity,selectEntity2,sequence,share,shareReplay,signal,skip,sortByNameAndPublicIdComparer,startWith,style,switchMap,take,takeUntil,takeUntilDestroyed,tap,throwError,throwNotFoundError,timeout,timer,toObservable,toSignal,update,updateFailure,updateMany,updateManyFailure,updateManySuccess,updateResource,updateSuccess,validateOptions,viewChild,whileMoreAfter,withInterceptorsFromDi,withLatestFrom,ɵNgNoValidate,ɵNgSelectMultipleOption,ɵPRE_STYLE,ɵɵInheritDefinitionFeature,ɵɵNgOnChangesFeature,ɵɵProvidersFeature,ɵɵadvance,ɵɵattribute,ɵɵclassMap,ɵɵclassMapInterpolate1,ɵɵclassProp,ɵɵconditional,ɵɵcontentQuery,ɵɵdeclareLet,ɵɵdefineComponent,ɵɵdefineDirective,ɵɵdefineInjectable,ɵɵdefineInjector,ɵɵdefineNgModule,ɵɵdefinePipe,ɵɵdirectiveInject,ɵɵelement,ɵɵelementContainer,ɵɵelementContainerEnd,ɵɵelementContainerStart,ɵɵelementEnd,ɵɵelementStart,ɵɵgetCurrentView,ɵɵgetInheritedFactory,ɵɵinject,ɵɵlistener,ɵɵloadQuery,ɵɵnamespaceSVG,ɵɵnextContext,ɵɵpipe,ɵɵpipeBind1,ɵɵpipeBind2,ɵɵpipeBind3,ɵɵprojection,ɵɵprojectionDef,ɵɵproperty,ɵɵpropertyInterpolate,ɵɵpureFunction0,ɵɵpureFunction1,ɵɵpureFunction2,ɵɵpureFunction4,ɵɵpureFunction7,ɵɵqueryAdvance,ɵɵqueryRefresh,ɵɵreadContextLet,ɵɵreference,ɵɵrepeater,ɵɵrepeaterCreate,ɵɵrepeaterTrackByIdentity,ɵɵrepeaterTrackByIndex,ɵɵresetView,ɵɵresolveDocument,ɵɵrestoreView,ɵɵsanitizeHtml,ɵɵsanitizeUrl,ɵɵstoreLet,ɵɵstyleMap,ɵɵstyleProp,ɵɵtemplate,ɵɵtemplateRefExtractor,ɵɵtext,ɵɵtextInterpolate,ɵɵtextInterpolate1,ɵɵtextInterpolate2,ɵɵtextInterpolate3,ɵɵtwoWayBindingSet,ɵɵtwoWayListener,ɵɵtwoWayProperty,ɵɵviewQuery,ɵɵviewQuerySignal}from"./chunk-Y5VM2RT5.js";import"./chunk-H2MDWMMO.js";import{camelCase_default,capitalize_default,cloneDeep_default,compact_default,deburr_default,escape_default,flatMap_default,flatten_default,get_default,groupBy_default,has_default,isArray_default,isEmpty_default,isEqual_default,isNil_default,isObject_default,isString_default,isUndefined_default,kebabCase_default,memoize_default,merge_default,omitBy_default,omit_default,orderBy_default,pick_default,range_default,set_default,snakeCase_default,sortBy_default,startCase_default,template_default,uniqBy_default,uniq_default,upperCase_default,upperFirst_default}from"./chunk-N5TLZNK7.js";import{__async,__commonJS,__esm,__export,__objRest,__require,__spreadProps,__spreadValues,__superGet,__toCommonJS,__toESM,__yieldStar}from"./chunk-IHZVASS3.js";var require_FileSaver_min=__commonJS({"node_modules/file-saver/dist/FileSaver.min.js"(exports,module){(function(a,b){typeof define=="function"&&define.amd?define([],b):typeof exports<"u"?b():(b(),a.FileSaver={})})(exports,function(){"use strict";function b(a2,b2){return typeof b2>"u"?b2={autoBom:!1}:typeof b2!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),b2={autoBom:!b2}),b2.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a2.type)?new Blob(["\uFEFF",a2],{type:a2.type}):a2}function c(a2,b2,c2){var d2=new XMLHttpRequest;d2.open("GET",a2),d2.responseType="blob",d2.onload=function(){g(d2.response,b2,c2)},d2.onerror=function(){console.error("could not download file")},d2.send()}function d(a2){var b2=new XMLHttpRequest;b2.open("HEAD",a2,!1);try{b2.send()}catch{}return 200<=b2.status&&299>=b2.status}function e(a2){try{a2.dispatchEvent(new MouseEvent("click"))}catch{var b2=document.createEvent("MouseEvents");b2.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a2.dispatchEvent(b2)}}var f=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,a=f.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),g=f.saveAs||(typeof window!="object"||window!==f?function(){}:"download"in HTMLAnchorElement.prototype&&!a?function(b2,g2,h){var i=f.URL||f.webkitURL,j=document.createElement("a");g2=g2||b2.name||"download",j.download=g2,j.rel="noopener",typeof b2=="string"?(j.href=b2,j.origin===location.origin?e(j):d(j.href)?c(b2,g2,h):e(j,j.target="_blank")):(j.href=i.createObjectURL(b2),setTimeout(function(){i.revokeObjectURL(j.href)},4e4),setTimeout(function(){e(j)},0))}:"msSaveOrOpenBlob"in navigator?function(f2,g2,h){if(g2=g2||f2.name||"download",typeof f2!="string")navigator.msSaveOrOpenBlob(b(f2,h),g2);else if(d(f2))c(f2,g2,h);else{var i=document.createElement("a");i.href=f2,i.target="_blank",setTimeout(function(){e(i)})}}:function(b2,d2,e2,g2){if(g2=g2||open("","_blank"),g2&&(g2.document.title=g2.document.body.innerText="downloading..."),typeof b2=="string")return c(b2,d2,e2);var h=b2.type==="application/octet-stream",i=/constructor/i.test(f.HTMLElement)||f.safari,j=/CriOS\/[\d]+/.test(navigator.userAgent);if((j||h&&i||a)&&typeof FileReader<"u"){var k=new FileReader;k.onloadend=function(){var a2=k.result;a2=j?a2:a2.replace(/^data:[^;]*;/,"data:attachment/file;"),g2?g2.location.href=a2:location=a2,g2=null},k.readAsDataURL(b2)}else{var l2=f.URL||f.webkitURL,m=l2.createObjectURL(b2);g2?g2.location=m:location.href=m,g2=null,setTimeout(function(){l2.revokeObjectURL(m)},4e4)}});f.saveAs=g.saveAs=g,typeof module<"u"&&(module.exports=g)})}});var require_ua_parser=__commonJS({"node_modules/ua-parser-js/src/ua-parser.js"(exports,module){(function(window2,undefined2){"use strict";var LIBVERSION="1.0.37",EMPTY2="",UNKNOWN="?",FUNC_TYPE="function",UNDEF_TYPE="undefined",OBJ_TYPE="object",STR_TYPE="string",MAJOR="major",MODEL="model",NAME="name",TYPE="type",VENDOR="vendor",VERSION2="version",ARCHITECTURE="architecture",CONSOLE="console",MOBILE="mobile",TABLET="tablet",SMARTTV="smarttv",WEARABLE="wearable",EMBEDDED="embedded",UA_MAX_LENGTH=500,AMAZON="Amazon",APPLE="Apple",ASUS="ASUS",BLACKBERRY="BlackBerry",BROWSER="Browser",CHROME="Chrome",EDGE="Edge",FIREFOX="Firefox",GOOGLE="Google",HUAWEI="Huawei",LG="LG",MICROSOFT="Microsoft",MOTOROLA="Motorola",OPERA="Opera",SAMSUNG="Samsung",SHARP="Sharp",SONY="Sony",XIAOMI="Xiaomi",ZEBRA="Zebra",FACEBOOK="Facebook",CHROMIUM_OS="Chromium OS",MAC_OS="Mac OS",extend3=function(regexes2,extensions){var mergedRegexes={};for(var i in regexes2)extensions[i]&&extensions[i].length%2===0?mergedRegexes[i]=extensions[i].concat(regexes2[i]):mergedRegexes[i]=regexes2[i];return mergedRegexes},enumerize=function(arr){for(var enums={},i=0;i<arr.length;i++)enums[arr[i].toUpperCase()]=arr[i];return enums},has=function(str1,str2){return typeof str1===STR_TYPE?lowerize(str2).indexOf(lowerize(str1))!==-1:!1},lowerize=function(str){return str.toLowerCase()},majorize=function(version2){return typeof version2===STR_TYPE?version2.replace(/[^\d\.]/g,EMPTY2).split(".")[0]:undefined2},trim=function(str,len){if(typeof str===STR_TYPE)return str=str.replace(/^\s\s*/,EMPTY2),typeof len===UNDEF_TYPE?str:str.substring(0,UA_MAX_LENGTH)},rgxMapper=function(ua,arrays){for(var i=0,j,k,p,q,matches,match2;i<arrays.length&&!matches;){var regex=arrays[i],props2=arrays[i+1];for(j=k=0;j<regex.length&&!matches&&regex[j];)if(matches=regex[j++].exec(ua),matches)for(p=0;p<props2.length;p++)match2=matches[++k],q=props2[p],typeof q===OBJ_TYPE&&q.length>0?q.length===2?typeof q[1]==FUNC_TYPE?this[q[0]]=q[1].call(this,match2):this[q[0]]=q[1]:q.length===3?typeof q[1]===FUNC_TYPE&&!(q[1].exec&&q[1].test)?this[q[0]]=match2?q[1].call(this,match2,q[2]):undefined2:this[q[0]]=match2?match2.replace(q[1],q[2]):undefined2:q.length===4&&(this[q[0]]=match2?q[3].call(this,match2.replace(q[1],q[2])):undefined2):this[q]=match2||undefined2;i+=2}},strMapper=function(str,map4){for(var i in map4)if(typeof map4[i]===OBJ_TYPE&&map4[i].length>0){for(var j=0;j<map4[i].length;j++)if(has(map4[i][j],str))return i===UNKNOWN?undefined2:i}else if(has(map4[i],str))return i===UNKNOWN?undefined2:i;return str},oldSafariMap={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},windowsVersionMap={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},regexes={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[VERSION2,[NAME,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[VERSION2,[NAME,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[NAME,VERSION2],[/opios[\/ ]+([\w\.]+)/i],[VERSION2,[NAME,OPERA+" Mini"]],[/\bopr\/([\w\.]+)/i],[VERSION2,[NAME,OPERA]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[VERSION2,[NAME,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|qq|duckduckgo)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[NAME,VERSION2],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[VERSION2,[NAME,"UC"+BROWSER]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[VERSION2,[NAME,"WeChat"]],[/konqueror\/([\w\.]+)/i],[VERSION2,[NAME,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[VERSION2,[NAME,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[VERSION2,[NAME,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[VERSION2,[NAME,"Smart Lenovo "+BROWSER]],[/(avast|avg)\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 Secure "+BROWSER],VERSION2],[/\bfocus\/([\w\.]+)/i],[VERSION2,[NAME,FIREFOX+" Focus"]],[/\bopt\/([\w\.]+)/i],[VERSION2,[NAME,OPERA+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[VERSION2,[NAME,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[VERSION2,[NAME,"Dolphin"]],[/coast\/([\w\.]+)/i],[VERSION2,[NAME,OPERA+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[VERSION2,[NAME,"MIUI "+BROWSER]],[/fxios\/([-\w\.]+)/i],[VERSION2,[NAME,FIREFOX]],[/\bqihu|(qi?ho?o?|360)browser/i],[[NAME,"360 "+BROWSER]],[/(oculus|sailfish|huawei|vivo)browser\/([\w\.]+)/i],[[NAME,/(.+)/,"$1 "+BROWSER],VERSION2],[/samsungbrowser\/([\w\.]+)/i],[VERSION2,[NAME,SAMSUNG+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[NAME,/_/g," "],VERSION2],[/metasr[\/ ]?([\d\.]+)/i],[VERSION2,[NAME,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[NAME,"Sogou Mobile"],VERSION2],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[NAME,VERSION2],[/(lbbrowser)/i,/\[(linkedin)app\]/i],[NAME],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[NAME,FACEBOOK],VERSION2],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[NAME,VERSION2],[/\bgsa\/([\w\.]+) .*safari\//i],[VERSION2,[NAME,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[VERSION2,[NAME,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[VERSION2,[NAME,CHROME+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[NAME,CHROME+" WebView"],VERSION2],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[VERSION2,[NAME,"Android "+BROWSER]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[NAME,VERSION2],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[VERSION2,[NAME,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[VERSION2,NAME],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[NAME,[VERSION2,strMapper,oldSafariMap]],[/(webkit|khtml)\/([\w\.]+)/i],[NAME,VERSION2],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[NAME,"Netscape"],VERSION2],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[VERSION2,[NAME,FIREFOX+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i,/panasonic;(viera)/i],[NAME,VERSION2],[/(cobalt)\/([\w\.]+)/i],[NAME,[VERSION2,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[ARCHITECTURE,"amd64"]],[/(ia32(?=;))/i],[[ARCHITECTURE,lowerize]],[/((?:i[346]|x)86)[;\)]/i],[[ARCHITECTURE,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[ARCHITECTURE,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[ARCHITECTURE,"armhf"]],[/windows (ce|mobile); ppc;/i],[[ARCHITECTURE,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[ARCHITECTURE,/ower/,EMPTY2,lowerize]],[/(sun4\w)[;\)]/i],[[ARCHITECTURE,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[ARCHITECTURE,lowerize]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,TABLET]],[/\b((?:s[cgp]h|gt|sm)-\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[MODEL,[VENDOR,SAMSUNG],[TYPE,MOBILE]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[MODEL,[VENDOR,APPLE],[TYPE,MOBILE]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[MODEL,[VENDOR,APPLE],[TYPE,TABLET]],[/(macintosh);/i],[MODEL,[VENDOR,APPLE]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[MODEL,[VENDOR,SHARP],[TYPE,MOBILE]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,TABLET]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[MODEL,[VENDOR,HUAWEI],[TYPE,MOBILE]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,MOBILE]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[MODEL,/_/g," "],[VENDOR,XIAOMI],[TYPE,TABLET]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[MODEL,[VENDOR,"OPPO"],[TYPE,MOBILE]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[MODEL,[VENDOR,"Vivo"],[TYPE,MOBILE]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[MODEL,[VENDOR,"Realme"],[TYPE,MOBILE]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[MODEL,[VENDOR,MOTOROLA],[TYPE,MOBILE]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[MODEL,[VENDOR,MOTOROLA],[TYPE,TABLET]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[MODEL,[VENDOR,LG],[TYPE,TABLET]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[MODEL,[VENDOR,LG],[TYPE,MOBILE]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[MODEL,[VENDOR,"Lenovo"],[TYPE,TABLET]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[MODEL,/_/g," "],[VENDOR,"Nokia"],[TYPE,MOBILE]],[/(pixel c)\b/i],[MODEL,[VENDOR,GOOGLE],[TYPE,TABLET]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[MODEL,[VENDOR,GOOGLE],[TYPE,MOBILE]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[MODEL,[VENDOR,SONY],[TYPE,MOBILE]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[MODEL,"Xperia Tablet"],[VENDOR,SONY],[TYPE,TABLET]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[MODEL,[VENDOR,"OnePlus"],[TYPE,MOBILE]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[MODEL,[VENDOR,AMAZON],[TYPE,TABLET]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[MODEL,/(.+)/g,"Fire Phone $1"],[VENDOR,AMAZON],[TYPE,MOBILE]],[/(playbook);[-\w\),; ]+(rim)/i],[MODEL,VENDOR,[TYPE,TABLET]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[MODEL,[VENDOR,BLACKBERRY],[TYPE,MOBILE]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[MODEL,[VENDOR,ASUS],[TYPE,TABLET]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[MODEL,[VENDOR,ASUS],[TYPE,MOBILE]],[/(nexus 9)/i],[MODEL,[VENDOR,"HTC"],[TYPE,TABLET]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[VENDOR,[MODEL,/_/g," "],[TYPE,MOBILE]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[MODEL,[VENDOR,"Acer"],[TYPE,TABLET]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[MODEL,[VENDOR,"Meizu"],[TYPE,MOBILE]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[MODEL,[VENDOR,"Ulefone"],[TYPE,MOBILE]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[VENDOR,MODEL,[TYPE,TABLET]],[/(surface duo)/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,TABLET]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[MODEL,[VENDOR,"Fairphone"],[TYPE,MOBILE]],[/(u304aa)/i],[MODEL,[VENDOR,"AT&T"],[TYPE,MOBILE]],[/\bsie-(\w*)/i],[MODEL,[VENDOR,"Siemens"],[TYPE,MOBILE]],[/\b(rct\w+) b/i],[MODEL,[VENDOR,"RCA"],[TYPE,TABLET]],[/\b(venue[\d ]{2,7}) b/i],[MODEL,[VENDOR,"Dell"],[TYPE,TABLET]],[/\b(q(?:mv|ta)\w+) b/i],[MODEL,[VENDOR,"Verizon"],[TYPE,TABLET]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[MODEL,[VENDOR,"Barnes & Noble"],[TYPE,TABLET]],[/\b(tm\d{3}\w+) b/i],[MODEL,[VENDOR,"NuVision"],[TYPE,TABLET]],[/\b(k88) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,TABLET]],[/\b(nx\d{3}j) b/i],[MODEL,[VENDOR,"ZTE"],[TYPE,MOBILE]],[/\b(gen\d{3}) b.+49h/i],[MODEL,[VENDOR,"Swiss"],[TYPE,MOBILE]],[/\b(zur\d{3}) b/i],[MODEL,[VENDOR,"Swiss"],[TYPE,TABLET]],[/\b((zeki)?tb.*\b) b/i],[MODEL,[VENDOR,"Zeki"],[TYPE,TABLET]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[VENDOR,"Dragon Touch"],MODEL,[TYPE,TABLET]],[/\b(ns-?\w{0,9}) b/i],[MODEL,[VENDOR,"Insignia"],[TYPE,TABLET]],[/\b((nxa|next)-?\w{0,9}) b/i],[MODEL,[VENDOR,"NextBook"],[TYPE,TABLET]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[VENDOR,"Voice"],MODEL,[TYPE,MOBILE]],[/\b(lvtel\-)?(v1[12]) b/i],[[VENDOR,"LvTel"],MODEL,[TYPE,MOBILE]],[/\b(ph-1) /i],[MODEL,[VENDOR,"Essential"],[TYPE,MOBILE]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[MODEL,[VENDOR,"Envizen"],[TYPE,TABLET]],[/\b(trio[-\w\. ]+) b/i],[MODEL,[VENDOR,"MachSpeed"],[TYPE,TABLET]],[/\btu_(1491) b/i],[MODEL,[VENDOR,"Rotor"],[TYPE,TABLET]],[/(shield[\w ]+) b/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,TABLET]],[/(sprint) (\w+)/i],[VENDOR,MODEL,[TYPE,MOBILE]],[/(kin\.[onetw]{3})/i],[[MODEL,/\./g," "],[VENDOR,MICROSOFT],[TYPE,MOBILE]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,TABLET]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,MOBILE]],[/smart-tv.+(samsung)/i],[VENDOR,[TYPE,SMARTTV]],[/hbbtv.+maple;(\d+)/i],[[MODEL,/^/,"SmartTV"],[VENDOR,SAMSUNG],[TYPE,SMARTTV]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[VENDOR,LG],[TYPE,SMARTTV]],[/(apple) ?tv/i],[VENDOR,[MODEL,APPLE+" TV"],[TYPE,SMARTTV]],[/crkey/i],[[MODEL,CHROME+"cast"],[VENDOR,GOOGLE],[TYPE,SMARTTV]],[/droid.+aft(\w+)( bui|\))/i],[MODEL,[VENDOR,AMAZON],[TYPE,SMARTTV]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[MODEL,[VENDOR,SHARP],[TYPE,SMARTTV]],[/(bravia[\w ]+)( bui|\))/i],[MODEL,[VENDOR,SONY],[TYPE,SMARTTV]],[/(mitv-\w{5}) bui/i],[MODEL,[VENDOR,XIAOMI],[TYPE,SMARTTV]],[/Hbbtv.*(technisat) (.*);/i],[VENDOR,MODEL,[TYPE,SMARTTV]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[VENDOR,trim],[MODEL,trim],[TYPE,SMARTTV]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[TYPE,SMARTTV]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[VENDOR,MODEL,[TYPE,CONSOLE]],[/droid.+; (shield) bui/i],[MODEL,[VENDOR,"Nvidia"],[TYPE,CONSOLE]],[/(playstation [345portablevi]+)/i],[MODEL,[VENDOR,SONY],[TYPE,CONSOLE]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[MODEL,[VENDOR,MICROSOFT],[TYPE,CONSOLE]],[/((pebble))app/i],[VENDOR,MODEL,[TYPE,WEARABLE]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[MODEL,[VENDOR,APPLE],[TYPE,WEARABLE]],[/droid.+; (glass) \d/i],[MODEL,[VENDOR,GOOGLE],[TYPE,WEARABLE]],[/droid.+; (wt63?0{2,3})\)/i],[MODEL,[VENDOR,ZEBRA],[TYPE,WEARABLE]],[/(quest( 2| pro)?)/i],[MODEL,[VENDOR,FACEBOOK],[TYPE,WEARABLE]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[VENDOR,[TYPE,EMBEDDED]],[/(aeobc)\b/i],[MODEL,[VENDOR,AMAZON],[TYPE,EMBEDDED]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[MODEL,[TYPE,MOBILE]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[MODEL,[TYPE,TABLET]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[TYPE,TABLET]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[TYPE,MOBILE]],[/(android[-\w\. ]{0,9});.+buil/i],[MODEL,[VENDOR,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[VERSION2,[NAME,EDGE+"HTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[VERSION2,[NAME,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[NAME,VERSION2],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[VERSION2,NAME]],os:[[/microsoft (windows) (vista|xp)/i],[NAME,VERSION2],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[NAME,[VERSION2,strMapper,windowsVersionMap]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[VERSION2,strMapper,windowsVersionMap],[NAME,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[VERSION2,/_/g,"."],[NAME,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[NAME,MAC_OS],[VERSION2,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[VERSION2,NAME],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[NAME,VERSION2],[/\(bb(10);/i],[VERSION2,[NAME,BLACKBERRY]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[VERSION2,[NAME,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[VERSION2,[NAME,FIREFOX+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[VERSION2,[NAME,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[VERSION2,[NAME,"watchOS"]],[/crkey\/([\d\.]+)/i],[VERSION2,[NAME,CHROME+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[NAME,CHROMIUM_OS],VERSION2],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[NAME,VERSION2],[/(sunos) ?([\w\.\d]*)/i],[[NAME,"Solaris"],VERSION2],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[NAME,VERSION2]]},UAParser2=function(ua,extensions){if(typeof ua===OBJ_TYPE&&(extensions=ua,ua=undefined2),!(this instanceof UAParser2))return new UAParser2(ua,extensions).getResult();var _navigator=typeof window2!==UNDEF_TYPE&&window2.navigator?window2.navigator:undefined2,_ua=ua||(_navigator&&_navigator.userAgent?_navigator.userAgent:EMPTY2),_uach=_navigator&&_navigator.userAgentData?_navigator.userAgentData:undefined2,_rgxmap=extensions?extend3(regexes,extensions):regexes,_isSelfNav=_navigator&&_navigator.userAgent==_ua;return this.getBrowser=function(){var _browser={};return _browser[NAME]=undefined2,_browser[VERSION2]=undefined2,rgxMapper.call(_browser,_ua,_rgxmap.browser),_browser[MAJOR]=majorize(_browser[VERSION2]),_isSelfNav&&_navigator&&_navigator.brave&&typeof _navigator.brave.isBrave==FUNC_TYPE&&(_browser[NAME]="Brave"),_browser},this.getCPU=function(){var _cpu={};return _cpu[ARCHITECTURE]=undefined2,rgxMapper.call(_cpu,_ua,_rgxmap.cpu),_cpu},this.getDevice=function(){var _device={};return _device[VENDOR]=undefined2,_device[MODEL]=undefined2,_device[TYPE]=undefined2,rgxMapper.call(_device,_ua,_rgxmap.device),_isSelfNav&&!_device[TYPE]&&_uach&&_uach.mobile&&(_device[TYPE]=MOBILE),_isSelfNav&&_device[MODEL]=="Macintosh"&&_navigator&&typeof _navigator.standalone!==UNDEF_TYPE&&_navigator.maxTouchPoints&&_navigator.maxTouchPoints>2&&(_device[MODEL]="iPad",_device[TYPE]=TABLET),_device},this.getEngine=function(){var _engine={};return _engine[NAME]=undefined2,_engine[VERSION2]=undefined2,rgxMapper.call(_engine,_ua,_rgxmap.engine),_engine},this.getOS=function(){var _os={};return _os[NAME]=undefined2,_os[VERSION2]=undefined2,rgxMapper.call(_os,_ua,_rgxmap.os),_isSelfNav&&!_os[NAME]&&_uach&&_uach.platform!="Unknown"&&(_os[NAME]=_uach.platform.replace(/chrome os/i,CHROMIUM_OS).replace(/macos/i,MAC_OS)),_os},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return _ua},this.setUA=function(ua2){return _ua=typeof ua2===STR_TYPE&&ua2.length>UA_MAX_LENGTH?trim(ua2,UA_MAX_LENGTH):ua2,this},this.setUA(_ua),this};UAParser2.VERSION=LIBVERSION,UAParser2.BROWSER=enumerize([NAME,VERSION2,MAJOR]),UAParser2.CPU=enumerize([ARCHITECTURE]),UAParser2.DEVICE=enumerize([MODEL,VENDOR,TYPE,CONSOLE,MOBILE,SMARTTV,TABLET,WEARABLE,EMBEDDED]),UAParser2.ENGINE=UAParser2.OS=enumerize([NAME,VERSION2]),typeof exports!==UNDEF_TYPE?(typeof module!==UNDEF_TYPE&&module.exports&&(exports=module.exports=UAParser2),exports.UAParser=UAParser2):typeof define===FUNC_TYPE&&define.amd?define(function(){return UAParser2}):typeof window2!==UNDEF_TYPE&&(window2.UAParser=UAParser2);var $=typeof window2!==UNDEF_TYPE&&(window2.jQuery||window2.Zepto);if($&&!$.ua){var parser=new UAParser2;$.ua=parser.getResult(),$.ua.get=function(){return parser.getUA()},$.ua.set=function(ua){parser.setUA(ua);var result=parser.getResult();for(var prop in result)$.ua[prop]=result[prop]}}})(typeof window=="object"?window:exports)}});var require_dayjs_min=__commonJS({"node_modules/dayjs/dayjs.min.js"(exports,module){(function(t,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self).dayjs=e()})(exports,function(){"use strict";var t=1e3,e=6e4,n2=36e5,r="millisecond",i="second",s2="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l2="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t2){var e2=["th","st","nd","rd"],n3=t2%100;return"["+t2+(e2[(n3-20)%10]||e2[n3]||e2[0])+"]"}},m=function(t2,e2,n3){var r2=String(t2);return!r2||r2.length>=e2?t2:""+Array(e2+1-r2.length).join(n3)+t2},v={s:m,z:function(t2){var e2=-t2.utcOffset(),n3=Math.abs(e2),r2=Math.floor(n3/60),i2=n3%60;return(e2<=0?"+":"-")+m(r2,2,"0")+":"+m(i2,2,"0")},m:function t2(e2,n3){if(e2.date()<n3.date())return-t2(n3,e2);var r2=12*(n3.year()-e2.year())+(n3.month()-e2.month()),i2=e2.clone().add(r2,c),s3=n3-i2<0,u2=e2.clone().add(r2+(s3?-1:1),c);return+(-(r2+(n3-i2)/(s3?i2-u2:u2-i2))||0)},a:function(t2){return t2<0?Math.ceil(t2)||0:Math.floor(t2)},p:function(t2){return{M:c,y:h,w:o,d:a,D:d,h:u,m:s2,s:i,ms:r,Q:f}[t2]||String(t2||"").toLowerCase().replace(/s$/,"")},u:function(t2){return t2===void 0}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t2){return t2 instanceof _||!(!t2||!t2[p])},w=function t2(e2,n3,r2){var i2;if(!e2)return g;if(typeof e2=="string"){var s3=e2.toLowerCase();D[s3]&&(i2=s3),n3&&(D[s3]=n3,i2=s3);var u2=e2.split("-");if(!i2&&u2.length>1)return t2(u2[0])}else{var a2=e2.name;D[a2]=e2,i2=a2}return!r2&&i2&&(g=i2),i2||!r2&&g},O=function(t2,e2){if(S(t2))return t2.clone();var n3=typeof e2=="object"?e2:{};return n3.date=t2,n3.args=arguments,new _(n3)},b=v;b.l=w,b.i=S,b.w=function(t2,e2){return O(t2,{locale:e2.$L,utc:e2.$u,x:e2.$x,$offset:e2.$offset})};var _=function(){function M2(t2){this.$L=w(t2.locale,null,!0),this.parse(t2),this.$x=this.$x||t2.x||{},this[p]=!0}var m2=M2.prototype;return m2.parse=function(t2){this.$d=function(t3){var e2=t3.date,n3=t3.utc;if(e2===null)return new Date(NaN);if(b.u(e2))return new Date;if(e2 instanceof Date)return new Date(e2);if(typeof e2=="string"&&!/Z$/i.test(e2)){var r2=e2.match($);if(r2){var i2=r2[2]-1||0,s3=(r2[7]||"0").substring(0,3);return n3?new Date(Date.UTC(r2[1],i2,r2[3]||1,r2[4]||0,r2[5]||0,r2[6]||0,s3)):new Date(r2[1],i2,r2[3]||1,r2[4]||0,r2[5]||0,r2[6]||0,s3)}}return new Date(e2)}(t2),this.init()},m2.init=function(){var t2=this.$d;this.$y=t2.getFullYear(),this.$M=t2.getMonth(),this.$D=t2.getDate(),this.$W=t2.getDay(),this.$H=t2.getHours(),this.$m=t2.getMinutes(),this.$s=t2.getSeconds(),this.$ms=t2.getMilliseconds()},m2.$utils=function(){return b},m2.isValid=function(){return this.$d.toString()!==l2},m2.isSame=function(t2,e2){var n3=O(t2);return this.startOf(e2)<=n3&&n3<=this.endOf(e2)},m2.isAfter=function(t2,e2){return O(t2)<this.startOf(e2)},m2.isBefore=function(t2,e2){return this.endOf(e2)<O(t2)},m2.$g=function(t2,e2,n3){return b.u(t2)?this[e2]:this.set(n3,t2)},m2.unix=function(){return Math.floor(this.valueOf()/1e3)},m2.valueOf=function(){return this.$d.getTime()},m2.startOf=function(t2,e2){var n3=this,r2=!!b.u(e2)||e2,f2=b.p(t2),l3=function(t3,e3){var i2=b.w(n3.$u?Date.UTC(n3.$y,e3,t3):new Date(n3.$y,e3,t3),n3);return r2?i2:i2.endOf(a)},$2=function(t3,e3){return b.w(n3.toDate()[t3].apply(n3.toDate("s"),(r2?[0,0,0,0]:[23,59,59,999]).slice(e3)),n3)},y2=this.$W,M3=this.$M,m3=this.$D,v2="set"+(this.$u?"UTC":"");switch(f2){case h:return r2?l3(1,0):l3(31,11);case c:return r2?l3(1,M3):l3(0,M3+1);case o:var g2=this.$locale().weekStart||0,D2=(y2<g2?y2+7:y2)-g2;return l3(r2?m3-D2:m3+(6-D2),M3);case a:case d:return $2(v2+"Hours",0);case u:return $2(v2+"Minutes",1);case s2:return $2(v2+"Seconds",2);case i:return $2(v2+"Milliseconds",3);default:return this.clone()}},m2.endOf=function(t2){return this.startOf(t2,!1)},m2.$set=function(t2,e2){var n3,o2=b.p(t2),f2="set"+(this.$u?"UTC":""),l3=(n3={},n3[a]=f2+"Date",n3[d]=f2+"Date",n3[c]=f2+"Month",n3[h]=f2+"FullYear",n3[u]=f2+"Hours",n3[s2]=f2+"Minutes",n3[i]=f2+"Seconds",n3[r]=f2+"Milliseconds",n3)[o2],$2=o2===a?this.$D+(e2-this.$W):e2;if(o2===c||o2===h){var y2=this.clone().set(d,1);y2.$d[l3]($2),y2.init(),this.$d=y2.set(d,Math.min(this.$D,y2.daysInMonth())).$d}else l3&&this.$d[l3]($2);return this.init(),this},m2.set=function(t2,e2){return this.clone().$set(t2,e2)},m2.get=function(t2){return this[b.p(t2)]()},m2.add=function(r2,f2){var d2,l3=this;r2=Number(r2);var $2=b.p(f2),y2=function(t2){var e2=O(l3);return b.w(e2.date(e2.date()+Math.round(t2*r2)),l3)};if($2===c)return this.set(c,this.$M+r2);if($2===h)return this.set(h,this.$y+r2);if($2===a)return y2(1);if($2===o)return y2(7);var M3=(d2={},d2[s2]=e,d2[u]=n2,d2[i]=t,d2)[$2]||1,m3=this.$d.getTime()+r2*M3;return b.w(m3,this)},m2.subtract=function(t2,e2){return this.add(-1*t2,e2)},m2.format=function(t2){var e2=this,n3=this.$locale();if(!this.isValid())return n3.invalidDate||l2;var r2=t2||"YYYY-MM-DDTHH:mm:ssZ",i2=b.z(this),s3=this.$H,u2=this.$m,a2=this.$M,o2=n3.weekdays,c2=n3.months,f2=n3.meridiem,h2=function(t3,n4,i3,s4){return t3&&(t3[n4]||t3(e2,r2))||i3[n4].slice(0,s4)},d2=function(t3){return b.s(s3%12||12,t3,"0")},$2=f2||function(t3,e3,n4){var r3=t3<12?"AM":"PM";return n4?r3.toLowerCase():r3};return r2.replace(y,function(t3,r3){return r3||function(t4){switch(t4){case"YY":return String(e2.$y).slice(-2);case"YYYY":return b.s(e2.$y,4,"0");case"M":return a2+1;case"MM":return b.s(a2+1,2,"0");case"MMM":return h2(n3.monthsShort,a2,c2,3);case"MMMM":return h2(c2,a2);case"D":return e2.$D;case"DD":return b.s(e2.$D,2,"0");case"d":return String(e2.$W);case"dd":return h2(n3.weekdaysMin,e2.$W,o2,2);case"ddd":return h2(n3.weekdaysShort,e2.$W,o2,3);case"dddd":return o2[e2.$W];case"H":return String(s3);case"HH":return b.s(s3,2,"0");case"h":return d2(1);case"hh":return d2(2);case"a":return $2(s3,u2,!0);case"A":return $2(s3,u2,!1);case"m":return String(u2);case"mm":return b.s(u2,2,"0");case"s":return String(e2.$s);case"ss":return b.s(e2.$s,2,"0");case"SSS":return b.s(e2.$ms,3,"0");case"Z":return i2}return null}(t3)||i2.replace(":","")})},m2.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m2.diff=function(r2,d2,l3){var $2,y2=this,M3=b.p(d2),m3=O(r2),v2=(m3.utcOffset()-this.utcOffset())*e,g2=this-m3,D2=function(){return b.m(y2,m3)};switch(M3){case h:$2=D2()/12;break;case c:$2=D2();break;case f:$2=D2()/3;break;case o:$2=(g2-v2)/6048e5;break;case a:$2=(g2-v2)/864e5;break;case u:$2=g2/n2;break;case s2:$2=g2/e;break;case i:$2=g2/t;break;default:$2=g2}return l3?$2:b.a($2)},m2.daysInMonth=function(){return this.endOf(c).$D},m2.$locale=function(){return D[this.$L]},m2.locale=function(t2,e2){if(!t2)return this.$L;var n3=this.clone(),r2=w(t2,e2,!0);return r2&&(n3.$L=r2),n3},m2.clone=function(){return b.w(this.$d,this)},m2.toDate=function(){return new Date(this.valueOf())},m2.toJSON=function(){return this.isValid()?this.toISOString():null},m2.toISOString=function(){return this.$d.toISOString()},m2.toString=function(){return this.$d.toUTCString()},M2}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s2],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach(function(t2){k[t2[1]]=function(e2){return this.$g(e2,t2[0],t2[1])}}),O.extend=function(t2,e2){return t2.$i||(t2(e2,_,O),t2.$i=!0),O},O.locale=w,O.isDayjs=S,O.unix=function(t2){return O(1e3*t2)},O.en=D[g],O.Ls=D,O.p={},O})}});var require_localeData=__commonJS({"node_modules/dayjs/plugin/localeData.js"(exports,module){(function(n2,e){typeof exports=="object"&&typeof module<"u"?module.exports=e():typeof define=="function"&&define.amd?define(e):(n2=typeof globalThis<"u"?globalThis:n2||self).dayjs_plugin_localeData=e()})(exports,function(){"use strict";return function(n2,e,t){var r=e.prototype,o=function(n3){return n3&&(n3.indexOf?n3:n3.s)},u=function(n3,e2,t2,r2,u2){var i2=n3.name?n3:n3.$locale(),a2=o(i2[e2]),s3=o(i2[t2]),f=a2||s3.map(function(n4){return n4.slice(0,r2)});if(!u2)return f;var d=i2.weekStart;return f.map(function(n4,e3){return f[(e3+(d||0))%7]})},i=function(){return t.Ls[t.locale()]},a=function(n3,e2){return n3.formats[e2]||function(n4){return n4.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(n5,e3,t2){return e3||t2.slice(1)})}(n3.formats[e2.toUpperCase()])},s2=function(){var n3=this;return{months:function(e2){return e2?e2.format("MMMM"):u(n3,"months")},monthsShort:function(e2){return e2?e2.format("MMM"):u(n3,"monthsShort","months",3)},firstDayOfWeek:function(){return n3.$locale().weekStart||0},weekdays:function(e2){return e2?e2.format("dddd"):u(n3,"weekdays")},weekdaysMin:function(e2){return e2?e2.format("dd"):u(n3,"weekdaysMin","weekdays",2)},weekdaysShort:function(e2){return e2?e2.format("ddd"):u(n3,"weekdaysShort","weekdays",3)},longDateFormat:function(e2){return a(n3.$locale(),e2)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};r.localeData=function(){return s2.bind(this)()},t.localeData=function(){var n3=i();return{firstDayOfWeek:function(){return n3.weekStart||0},weekdays:function(){return t.weekdays()},weekdaysShort:function(){return t.weekdaysShort()},weekdaysMin:function(){return t.weekdaysMin()},months:function(){return t.months()},monthsShort:function(){return t.monthsShort()},longDateFormat:function(e2){return a(n3,e2)},meridiem:n3.meridiem,ordinal:n3.ordinal}},t.months=function(){return u(i(),"months")},t.monthsShort=function(){return u(i(),"monthsShort","months",3)},t.weekdays=function(n3){return u(i(),"weekdays",null,null,n3)},t.weekdaysShort=function(n3){return u(i(),"weekdaysShort","weekdays",3,n3)},t.weekdaysMin=function(n3){return u(i(),"weekdaysMin","weekdays",2,n3)}}})}});var require_localizedFormat=__commonJS({"node_modules/dayjs/plugin/localizedFormat.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_localizedFormat=t()})(exports,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(t,o,n2){var r=o.prototype,i=r.format;n2.en.formats=e,r.format=function(t2){t2===void 0&&(t2="YYYY-MM-DDTHH:mm:ssZ");var o2=this.$locale().formats,n3=function(t3,o3){return t3.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t4,n4,r2){var i2=r2&&r2.toUpperCase();return n4||o3[r2]||e[r2]||o3[i2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e2,t5,o4){return t5||o4.slice(1)})})}(t2,o2===void 0?{}:o2);return i.call(this,n3)}}})}});var require_isoWeek=__commonJS({"node_modules/dayjs/plugin/isoWeek.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_isoWeek=t()})(exports,function(){"use strict";var e="day";return function(t,i,s2){var a=function(t2){return t2.add(4-t2.isoWeekday(),e)},d=i.prototype;d.isoWeekYear=function(){return a(this).year()},d.isoWeek=function(t2){if(!this.$utils().u(t2))return this.add(7*(t2-this.isoWeek()),e);var i2,d2,n3,o,r=a(this),u=(i2=this.isoWeekYear(),d2=this.$u,n3=(d2?s2.utc:s2)().year(i2).startOf("year"),o=4-n3.isoWeekday(),n3.isoWeekday()>4&&(o+=7),n3.add(o,e));return r.diff(u,"week")+1},d.isoWeekday=function(e2){return this.$utils().u(e2)?this.day()||7:this.day(this.day()%7?e2:e2-7)};var n2=d.startOf;d.startOf=function(e2,t2){var i2=this.$utils(),s3=!!i2.u(t2)||t2;return i2.p(e2)==="isoweek"?s3?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):n2.bind(this)(e2,t2)}}})}});var require_weekOfYear=__commonJS({"node_modules/dayjs/plugin/weekOfYear.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_weekOfYear=t()})(exports,function(){"use strict";var e="week",t="year";return function(i,n2,r){var f=n2.prototype;f.week=function(i2){if(i2===void 0&&(i2=null),i2!==null)return this.add(7*(i2-this.week()),"day");var n3=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var f2=r(this).startOf(t).add(1,t).date(n3),s2=r(this).endOf(e);if(f2.isBefore(s2))return 1}var a=r(this).startOf(t).date(n3).startOf(e).subtract(1,"millisecond"),o=this.diff(a,e,!0);return o<0?r(this).startOf("week").week():Math.ceil(o)},f.weeks=function(e2){return e2===void 0&&(e2=null),this.week(e2)}}})}});var require_customParseFormat=__commonJS({"node_modules/dayjs/plugin/customParseFormat.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define(t):(e=typeof globalThis<"u"?globalThis:e||self).dayjs_plugin_customParseFormat=t()})(exports,function(){"use strict";var e={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},t=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n2=/\d\d/,r=/\d\d?/,i=/\d*[^-_:/,()\s\d]+/,o={},s2=function(e2){return(e2=+e2)+(e2>68?1900:2e3)},a=function(e2){return function(t2){this[e2]=+t2}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(e2){(this.zone||(this.zone={})).offset=function(e3){if(!e3||e3==="Z")return 0;var t2=e3.match(/([+-]|\d\d)/g),n3=60*t2[1]+(+t2[2]||0);return n3===0?0:t2[0]==="+"?-n3:n3}(e2)}],h=function(e2){var t2=o[e2];return t2&&(t2.indexOf?t2:t2.s.concat(t2.f))},u=function(e2,t2){var n3,r2=o.meridiem;if(r2){for(var i2=1;i2<=24;i2+=1)if(e2.indexOf(r2(i2,0,t2))>-1){n3=i2>12;break}}else n3=e2===(t2?"pm":"PM");return n3},d={A:[i,function(e2){this.afternoon=u(e2,!1)}],a:[i,function(e2){this.afternoon=u(e2,!0)}],S:[/\d/,function(e2){this.milliseconds=100*+e2}],SS:[n2,function(e2){this.milliseconds=10*+e2}],SSS:[/\d{3}/,function(e2){this.milliseconds=+e2}],s:[r,a("seconds")],ss:[r,a("seconds")],m:[r,a("minutes")],mm:[r,a("minutes")],H:[r,a("hours")],h:[r,a("hours")],HH:[r,a("hours")],hh:[r,a("hours")],D:[r,a("day")],DD:[n2,a("day")],Do:[i,function(e2){var t2=o.ordinal,n3=e2.match(/\d+/);if(this.day=n3[0],t2)for(var r2=1;r2<=31;r2+=1)t2(r2).replace(/\[|\]/g,"")===e2&&(this.day=r2)}],M:[r,a("month")],MM:[n2,a("month")],MMM:[i,function(e2){var t2=h("months"),n3=(h("monthsShort")||t2.map(function(e3){return e3.slice(0,3)})).indexOf(e2)+1;if(n3<1)throw new Error;this.month=n3%12||n3}],MMMM:[i,function(e2){var t2=h("months").indexOf(e2)+1;if(t2<1)throw new Error;this.month=t2%12||t2}],Y:[/[+-]?\d+/,a("year")],YY:[n2,function(e2){this.year=s2(e2)}],YYYY:[/\d{4}/,a("year")],Z:f,ZZ:f};function c(n3){var r2,i2;r2=n3,i2=o&&o.formats;for(var s3=(n3=r2.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(t2,n4,r3){var o2=r3&&r3.toUpperCase();return n4||i2[r3]||e[r3]||i2[o2].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(e2,t3,n5){return t3||n5.slice(1)})})).match(t),a2=s3.length,f2=0;f2<a2;f2+=1){var h2=s3[f2],u2=d[h2],c2=u2&&u2[0],l2=u2&&u2[1];s3[f2]=l2?{regex:c2,parser:l2}:h2.replace(/^\[|\]$/g,"")}return function(e2){for(var t2={},n4=0,r3=0;n4<a2;n4+=1){var i3=s3[n4];if(typeof i3=="string")r3+=i3.length;else{var o2=i3.regex,f3=i3.parser,h3=e2.slice(r3),u3=o2.exec(h3)[0];f3.call(t2,u3),e2=e2.replace(u3,"")}}return function(e3){var t3=e3.afternoon;if(t3!==void 0){var n5=e3.hours;t3?n5<12&&(e3.hours+=12):n5===12&&(e3.hours=0),delete e3.afternoon}}(t2),t2}}return function(e2,t2,n3){n3.p.customParseFormat=!0,e2&&e2.parseTwoDigitYear&&(s2=e2.parseTwoDigitYear);var r2=t2.prototype,i2=r2.parse;r2.parse=function(e3){var t3=e3.date,r3=e3.utc,s3=e3.args;this.$u=r3;var a2=s3[1];if(typeof a2=="string"){var f2=s3[2]===!0,h2=s3[3]===!0,u2=f2||h2,d2=s3[2];h2&&(d2=s3[2]),o=this.$locale(),!f2&&d2&&(o=n3.Ls[d2]),this.$d=function(e4,t4,n4){try{if(["x","X"].indexOf(t4)>-1)return new Date((t4==="X"?1e3:1)*e4);var r4=c(t4)(e4),i3=r4.year,o2=r4.month,s4=r4.day,a3=r4.hours,f3=r4.minutes,h3=r4.seconds,u3=r4.milliseconds,d3=r4.zone,l3=new Date,m2=s4||(i3||o2?1:l3.getDate()),M2=i3||l3.getFullYear(),Y=0;i3&&!o2||(Y=o2>0?o2-1:l3.getMonth());var p=a3||0,v=f3||0,D=h3||0,g=u3||0;return d3?new Date(Date.UTC(M2,Y,m2,p,v,D,g+60*d3.offset*1e3)):n4?new Date(Date.UTC(M2,Y,m2,p,v,D,g)):new Date(M2,Y,m2,p,v,D,g)}catch{return new Date("")}}(t3,a2,r3),this.init(),d2&&d2!==!0&&(this.$L=this.locale(d2).$L),u2&&t3!=this.format(a2)&&(this.$d=new Date("")),o={}}else if(a2 instanceof Array)for(var l2=a2.length,m=1;m<=l2;m+=1){s3[1]=a2[m-1];var M=n3.apply(this,s3);if(M.isValid()){this.$d=M.$d,this.$L=M.$L,this.init();break}m===l2&&(this.$d=new Date(""))}else i2.call(this,e3)}}})}});var require_papaparse_min=__commonJS({"node_modules/papaparse/papaparse.min.js"(exports,module){(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof module=="object"&&typeof exports<"u"?module.exports=t():e.Papa=t()})(exports,function s2(){"use strict";var f=typeof self<"u"?self:typeof window<"u"?window:f!==void 0?f:{},n2=!f.document&&!!f.postMessage,o=f.IS_PAPA_WORKER||!1,a={},u=0,b={parse:function(e,t){var r2=(t=t||{}).dynamicTyping||!1;if(J(r2)&&(t.dynamicTypingFunction=r2,r2={}),t.dynamicTyping=r2,t.transform=!!J(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var i=function(){if(!b.WORKERS_SUPPORTED)return!1;var e2=(r3=f.URL||f.webkitURL||null,i2=s2.toString(),b.BLOB_URL||(b.BLOB_URL=r3.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",i2,")();"],{type:"text/javascript"})))),t2=new f.Worker(e2),r3,i2;return t2.onmessage=_,t2.id=u++,a[t2.id]=t2}();return i.userStep=t.step,i.userChunk=t.chunk,i.userComplete=t.complete,i.userError=t.error,t.step=J(t.step),t.chunk=J(t.chunk),t.complete=J(t.complete),t.error=J(t.error),delete t.worker,void i.postMessage({input:e,config:t,workerId:i.id})}var n3=null;return b.NODE_STREAM_INPUT,typeof e=="string"?(e=function(e2){return e2.charCodeAt(0)===65279?e2.slice(1):e2}(e),n3=t.download?new l2(t):new p(t)):e.readable===!0&&J(e.read)&&J(e.on)?n3=new g(t):(f.File&&e instanceof File||e instanceof Object)&&(n3=new c(t)),n3.stream(e)},unparse:function(e,t){var n3=!1,_2=!0,m2=",",y2=`\r
2
2
  `,s3='"',a2=s3+s3,r2=!1,i=null,o2=!1;(function(){if(typeof t=="object"){if(typeof t.delimiter!="string"||b.BAD_DELIMITERS.filter(function(e2){return t.delimiter.indexOf(e2)!==-1}).length||(m2=t.delimiter),(typeof t.quotes=="boolean"||typeof t.quotes=="function"||Array.isArray(t.quotes))&&(n3=t.quotes),typeof t.skipEmptyLines!="boolean"&&typeof t.skipEmptyLines!="string"||(r2=t.skipEmptyLines),typeof t.newline=="string"&&(y2=t.newline),typeof t.quoteChar=="string"&&(s3=t.quoteChar),typeof t.header=="boolean"&&(_2=t.header),Array.isArray(t.columns)){if(t.columns.length===0)throw new Error("Option columns is empty");i=t.columns}t.escapeChar!==void 0&&(a2=t.escapeChar+s3),(typeof t.escapeFormulae=="boolean"||t.escapeFormulae instanceof RegExp)&&(o2=t.escapeFormulae instanceof RegExp?t.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var u2=new RegExp(Q(s3),"g");if(typeof e=="string"&&(e=JSON.parse(e)),Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return h2(null,e,r2);if(typeof e[0]=="object")return h2(i||Object.keys(e[0]),e,r2)}else if(typeof e=="object")return typeof e.data=="string"&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||i),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:typeof e.data[0]=="object"?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||typeof e.data[0]=="object"||(e.data=[e.data])),h2(e.fields||[],e.data||[],r2);throw new Error("Unable to serialize unrecognized input");function h2(e2,t2,r3){var i2="";typeof e2=="string"&&(e2=JSON.parse(e2)),typeof t2=="string"&&(t2=JSON.parse(t2));var n4=Array.isArray(e2)&&0<e2.length,s4=!Array.isArray(t2[0]);if(n4&&_2){for(var a3=0;a3<e2.length;a3++)0<a3&&(i2+=m2),i2+=v2(e2[a3],a3);0<t2.length&&(i2+=y2)}for(var o3=0;o3<t2.length;o3++){var u3=n4?e2.length:t2[o3].length,h3=!1,f2=n4?Object.keys(t2[o3]).length===0:t2[o3].length===0;if(r3&&!n4&&(h3=r3==="greedy"?t2[o3].join("").trim()==="":t2[o3].length===1&&t2[o3][0].length===0),r3==="greedy"&&n4){for(var d2=[],l3=0;l3<u3;l3++){var c2=s4?e2[l3]:l3;d2.push(t2[o3][c2])}h3=d2.join("").trim()===""}if(!h3){for(var p2=0;p2<u3;p2++){0<p2&&!f2&&(i2+=m2);var g2=n4&&s4?e2[p2]:p2;i2+=v2(t2[o3][g2],p2)}o3<t2.length-1&&(!r3||0<u3&&!f2)&&(i2+=y2)}}return i2}function v2(e2,t2){if(e2==null)return"";if(e2.constructor===Date)return JSON.stringify(e2).slice(1,25);var r3=!1;o2&&typeof e2=="string"&&o2.test(e2)&&(e2="'"+e2,r3=!0);var i2=e2.toString().replace(u2,a2);return(r3=r3||n3===!0||typeof n3=="function"&&n3(e2,t2)||Array.isArray(n3)&&n3[t2]||function(e3,t3){for(var r4=0;r4<t3.length;r4++)if(-1<e3.indexOf(t3[r4]))return!0;return!1}(i2,b.BAD_DELIMITERS)||-1<i2.indexOf(m2)||i2.charAt(0)===" "||i2.charAt(i2.length-1)===" ")?s3+i2+s3:i2}}};if(b.RECORD_SEP="",b.UNIT_SEP="",b.BYTE_ORDER_MARK="\uFEFF",b.BAD_DELIMITERS=["\r",`
3
3
  `,'"',b.BYTE_ORDER_MARK],b.WORKERS_SUPPORTED=!n2&&!!f.Worker,b.NODE_STREAM_INPUT=1,b.LocalChunkSize=10485760,b.RemoteChunkSize=5242880,b.DefaultDelimiter=",",b.Parser=E,b.ParserHandle=r,b.NetworkStreamer=l2,b.FileStreamer=c,b.StringStreamer=p,b.ReadableStreamStreamer=g,f.jQuery){var d=f.jQuery;d.fn.parse=function(o2){var r2=o2.config||{},u2=[];return this.each(function(e2){if(!(d(this).prop("tagName").toUpperCase()==="INPUT"&&d(this).attr("type").toLowerCase()==="file"&&f.FileReader)||!this.files||this.files.length===0)return!0;for(var t=0;t<this.files.length;t++)u2.push({file:this.files[t],inputElem:this,instanceConfig:d.extend({},r2)})}),e(),this;function e(){if(u2.length!==0){var e2,t,r3,i,n3=u2[0];if(J(o2.before)){var s3=o2.before(n3.file,n3.inputElem);if(typeof s3=="object"){if(s3.action==="abort")return e2="AbortError",t=n3.file,r3=n3.inputElem,i=s3.reason,void(J(o2.error)&&o2.error({name:e2},t,r3,i));if(s3.action==="skip")return void h2();typeof s3.config=="object"&&(n3.instanceConfig=d.extend(n3.instanceConfig,s3.config))}else if(s3==="skip")return void h2()}var a2=n3.instanceConfig.complete;n3.instanceConfig.complete=function(e3){J(a2)&&a2(e3,n3.file,n3.inputElem),h2()},b.parse(n3.file,n3.instanceConfig)}else J(o2.complete)&&o2.complete()}function h2(){u2.splice(0,1),e()}}}function h(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e2){var t=w(e2);t.chunkSize=parseInt(t.chunkSize),e2.step||e2.chunk||(t.chunkSize=null),this._handle=new r(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e2,t){if(this.isFirstChunk&&J(this._config.beforeFirstChunk)){var r2=this._config.beforeFirstChunk(e2);r2!==void 0&&(e2=r2)}this.isFirstChunk=!1,this._halted=!1;var i=this._partialLine+e2;this._partialLine="";var n3=this._handle.parse(i,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var s3=n3.meta.cursor;this._finished||(this._partialLine=i.substring(s3-this._baseIndex),this._baseIndex=s3),n3&&n3.data&&(this._rowCount+=n3.data.length);var a2=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(o)f.postMessage({results:n3,workerId:b.WORKER_ID,finished:a2});else if(J(this._config.chunk)&&!t){if(this._config.chunk(n3,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);n3=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n3.data),this._completeResults.errors=this._completeResults.errors.concat(n3.errors),this._completeResults.meta=n3.meta),this._completed||!a2||!J(this._config.complete)||n3&&n3.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a2||n3&&n3.meta.paused||this._nextChunk(),n3}this._halted=!0},this._sendError=function(e2){J(this._config.error)?this._config.error(e2):o&&this._config.error&&f.postMessage({workerId:b.WORKER_ID,error:e2,finished:!1})}}function l2(e){var i;(e=e||{}).chunkSize||(e.chunkSize=b.RemoteChunkSize),h.call(this,e),this._nextChunk=n2?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e2){this._input=e2,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(i=new XMLHttpRequest,this._config.withCredentials&&(i.withCredentials=this._config.withCredentials),n2||(i.onload=v(this._chunkLoaded,this),i.onerror=v(this._chunkError,this)),i.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n2),this._config.downloadRequestHeaders){var e2=this._config.downloadRequestHeaders;for(var t in e2)i.setRequestHeader(t,e2[t])}if(this._config.chunkSize){var r2=this._start+this._config.chunkSize-1;i.setRequestHeader("Range","bytes="+this._start+"-"+r2)}try{i.send(this._config.downloadRequestBody)}catch(e3){this._chunkError(e3.message)}n2&&i.status===0&&this._chunkError()}},this._chunkLoaded=function(){i.readyState===4&&(i.status<200||400<=i.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:i.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e2){var t=e2.getResponseHeader("Content-Range");return t===null?-1:parseInt(t.substring(t.lastIndexOf("/")+1))}(i),this.parseChunk(i.responseText)))},this._chunkError=function(e2){var t=i.statusText||e2;this._sendError(new Error(t))}}function c(e){var i,n3;(e=e||{}).chunkSize||(e.chunkSize=b.LocalChunkSize),h.call(this,e);var s3=typeof FileReader<"u";this.stream=function(e2){this._input=e2,n3=e2.slice||e2.webkitSlice||e2.mozSlice,s3?((i=new FileReader).onload=v(this._chunkLoaded,this),i.onerror=v(this._chunkError,this)):i=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e2=this._input;if(this._config.chunkSize){var t=Math.min(this._start+this._config.chunkSize,this._input.size);e2=n3.call(e2,this._start,t)}var r2=i.readAsText(e2,this._config.encoding);s3||this._chunkLoaded({target:{result:r2}})},this._chunkLoaded=function(e2){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e2.target.result)},this._chunkError=function(){this._sendError(i.error)}}function p(e){var r2;h.call(this,e=e||{}),this.stream=function(e2){return r2=e2,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e2,t=this._config.chunkSize;return t?(e2=r2.substring(0,t),r2=r2.substring(t)):(e2=r2,r2=""),this._finished=!r2,this.parseChunk(e2)}}}function g(e){h.call(this,e=e||{});var t=[],r2=!0,i=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e2){this._input=e2,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){i&&t.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):r2=!0},this._streamData=v(function(e2){try{t.push(typeof e2=="string"?e2:e2.toString(this._config.encoding)),r2&&(r2=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e3){this._streamError(e3)}},this),this._streamError=v(function(e2){this._streamCleanUp(),this._sendError(e2)},this),this._streamEnd=v(function(){this._streamCleanUp(),i=!0,this._streamData("")},this),this._streamCleanUp=v(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function r(m2){var a2,o2,u2,i=Math.pow(2,53),n3=-i,s3=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,h2=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,t=this,r2=0,f2=0,d2=!1,e=!1,l3=[],c2={data:[],errors:[],meta:{}};if(J(m2.step)){var p2=m2.step;m2.step=function(e2){if(c2=e2,_2())g2();else{if(g2(),c2.data.length===0)return;r2+=e2.data.length,m2.preview&&r2>m2.preview?o2.abort():(c2.data=c2.data[0],p2(c2,t))}}}function y2(e2){return m2.skipEmptyLines==="greedy"?e2.join("").trim()==="":e2.length===1&&e2[0].length===0}function g2(){return c2&&u2&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+b.DefaultDelimiter+"'"),u2=!1),m2.skipEmptyLines&&(c2.data=c2.data.filter(function(e2){return!y2(e2)})),_2()&&function(){if(!c2)return;function e2(e3,t3){J(m2.transformHeader)&&(e3=m2.transformHeader(e3,t3)),l3.push(e3)}if(Array.isArray(c2.data[0])){for(var t2=0;_2()&&t2<c2.data.length;t2++)c2.data[t2].forEach(e2);c2.data.splice(0,1)}else c2.data.forEach(e2)}(),function(){if(!c2||!m2.header&&!m2.dynamicTyping&&!m2.transform)return c2;function e2(e3,t3){var r3,i2=m2.header?{}:[];for(r3=0;r3<e3.length;r3++){var n4=r3,s4=e3[r3];m2.header&&(n4=r3>=l3.length?"__parsed_extra":l3[r3]),m2.transform&&(s4=m2.transform(s4,n4)),s4=v2(n4,s4),n4==="__parsed_extra"?(i2[n4]=i2[n4]||[],i2[n4].push(s4)):i2[n4]=s4}return m2.header&&(r3>l3.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+l3.length+" fields but parsed "+r3,f2+t3):r3<l3.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+l3.length+" fields but parsed "+r3,f2+t3)),i2}var t2=1;return!c2.data.length||Array.isArray(c2.data[0])?(c2.data=c2.data.map(e2),t2=c2.data.length):c2.data=e2(c2.data,0),m2.header&&c2.meta&&(c2.meta.fields=l3),f2+=t2,c2}()}function _2(){return m2.header&&l3.length===0}function v2(e2,t2){return r3=e2,m2.dynamicTypingFunction&&m2.dynamicTyping[r3]===void 0&&(m2.dynamicTyping[r3]=m2.dynamicTypingFunction(r3)),(m2.dynamicTyping[r3]||m2.dynamicTyping)===!0?t2==="true"||t2==="TRUE"||t2!=="false"&&t2!=="FALSE"&&(function(e3){if(s3.test(e3)){var t3=parseFloat(e3);if(n3<t3&&t3<i)return!0}return!1}(t2)?parseFloat(t2):h2.test(t2)?new Date(t2):t2===""?null:t2):t2;var r3}function k(e2,t2,r3,i2){var n4={type:e2,code:t2,message:r3};i2!==void 0&&(n4.row=i2),c2.errors.push(n4)}this.parse=function(e2,t2,r3){var i2=m2.quoteChar||'"';if(m2.newline||(m2.newline=function(e3,t3){e3=e3.substring(0,1048576);var r4=new RegExp(Q(t3)+"([^]*?)"+Q(t3),"gm"),i3=(e3=e3.replace(r4,"")).split("\r"),n5=e3.split(`
4
4
  `),s5=1<n5.length&&n5[0].length<i3[0].length;if(i3.length===1||s5)return`
@@ -743,7 +743,7 @@ ${end2.comment}`:end2.comment}this.doc.range[2]=end2.offset;break}default:this.e
743
743
  template
744
744
  `);var adapter43=createResourceAdapter({sortComparer:sortByNameAndPublicIdComparer}),initialState48=adapter43.getInitialState({persistentIds:[]}),reducer42=createReducer(initialState48,on(reset67,state=>{let persistentVersions=state.persistentIds.map(id=>state.entities[id]).filter(version2=>!!version2),persistentIds=persistentVersions.map(version2=>version2.publicId);return adapter43.setAll(persistentVersions,__spreadProps(__spreadValues({},initialState48),{persistentIds}))}),on(addSuccess40,didAdd59,(state,{data})=>adapter43.upsertOne(data,state)),on(loadAll48,state=>__spreadProps(__spreadValues({},state),{allLoading:!0})),on(loadAllFailure47,state=>__spreadProps(__spreadValues({},state),{allLoading:!1})),on(loadAllSuccess49,(state,{data})=>adapter43.setAll(data,__spreadProps(__spreadValues({},state),{allLoading:!1,allLoaded:!0}))),on(removeSuccess41,didRemove55,(state,{publicId})=>adapter43.removeOne(publicId,state)),on(updateSuccess40,didUpdate55,(state,{data,publicId})=>adapter43.updateOne({id:publicId,changes:data},state)),on(loadAllSuccess,loadAllForIntentSuccess,(state,{data})=>{let versions=uniqBy_default(data.map(template=>template.configuredVersion).filter(version2=>!!version2),configuredVersion=>configuredVersion.publicId);return adapter43.upsertMany(versions,state)}),on(loadHostSuccess,(state,{data})=>{let version2=data.landingPageComponentTemplate?.configuredVersion;if(version2){let persistentIds=uniq_default([...state.persistentIds,version2.publicId]);return adapter43.upsertOne(version2,__spreadProps(__spreadValues({},state),{persistentIds}))}return state})),feature42=createFeature({name:FEATURE_NAME48,reducer:reducer42});var selectAll42=createSelector(feature42.selectPageComponentTemplateVersionState,adapter43.getSelectors().selectAll),{selectAllLoading:selectAllLoading31,selectAllLoaded:selectAllLoaded31,selectEntities:selectEntities36}=feature42;var PageComponentTemplateVersionService=(()=>{let _PageComponentTemplateVersionService=class _PageComponentTemplateVersionService{constructor(){this.api=inject(IxApiService),this.http=inject(HttpClient)}add(body){let url=this.api.url("PageComponentTemplateVersionList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.post(url,body,options)}getAll(fields){return whileMoreAfter(moreAfter=>this.getList(fields,moreAfter))}getList(fields,pageAfter,pageSize){let url=this.api.url("PageComponentTemplateVersionList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,params=new HttpParams({fromObject:__spreadValues({fields:fields.join(",")},getPageParams(pageAfter,pageSize))}),options={context:context3,headers,params};return this.http.get(url,options)}removeByPublicId(publicId){let url=this.api.url("PageComponentTemplateVersion",{publicId}),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.delete(url,options)}updateByPublicId(publicId,body){let url=this.api.url("PageComponentTemplateVersion",{publicId}),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.patch(url,body,options)}};_PageComponentTemplateVersionService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PageComponentTemplateVersionService)},_PageComponentTemplateVersionService.\u0275prov=\u0275\u0275defineInjectable({token:_PageComponentTemplateVersionService,factory:_PageComponentTemplateVersionService.\u0275fac,providedIn:"root"});let PageComponentTemplateVersionService2=_PageComponentTemplateVersionService;return PageComponentTemplateVersionService2})();var PageComponentTemplateVersionEffects=(()=>{let _PageComponentTemplateVersionEffects=class _PageComponentTemplateVersionEffects{constructor(){this.actions$=inject(Actions),this.store=inject(Store),this.service=inject(PageComponentTemplateVersionService),this.add$=createEffect(()=>this.actions$.pipe(ofType(add40),mergeMap(({data})=>this.service.add(data).pipe(map(response=>addSuccess40({publicId:response.data.publicId,data:__spreadValues(__spreadValues({},data),response.data)})),catchError(errorResponse=>of(addFailure40({errors:errorResponse.error?.data??[]}))))))),this.ensureAll$=createEffect(()=>this.actions$.pipe(ofType(ensureAll41),mergeMap(()=>combineLatest([this.store.select(selectAllLoading31),this.store.select(selectAllLoaded31)]).pipe(take(1),mergeMap(([loading,loaded])=>!loading&&!loaded?of(loadAll48()):EMPTY))))),this.loadAll$=createEffect(()=>this.actions$.pipe(ofType(loadAll48),switchMap(()=>this.service.getAll(FIELDS4).pipe(map(({data})=>loadAllSuccess49({data})),catchError(errorResponse=>of(loadAllFailure47({errors:errorResponse.error?.data??[]}))))))),this.remove$=createEffect(()=>this.actions$.pipe(ofType(remove42),mergeMap(({publicId})=>this.service.removeByPublicId(publicId).pipe(map(()=>removeSuccess41({publicId})),catchError(errorResponse=>of(removeFailure40({errors:errorResponse.error?.data??[]}))))))),this.update$=createEffect(()=>this.actions$.pipe(ofType(update40),mergeMap(({data,publicId})=>this.service.updateByPublicId(publicId,data).pipe(map(()=>updateSuccess40({data:__spreadProps(__spreadValues({},data),{publicId}),publicId})),catchError(errorResponse=>of(updateFailure40({errors:errorResponse.error?.data??[]})))))))}};_PageComponentTemplateVersionEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PageComponentTemplateVersionEffects)},_PageComponentTemplateVersionEffects.\u0275prov=\u0275\u0275defineInjectable({token:_PageComponentTemplateVersionEffects,factory:_PageComponentTemplateVersionEffects.\u0275fac,providedIn:"root"});let PageComponentTemplateVersionEffects2=_PageComponentTemplateVersionEffects;return PageComponentTemplateVersionEffects2})();var PageComponentTemplateVersionModule=(()=>{let _PageComponentTemplateVersionModule=class _PageComponentTemplateVersionModule{};_PageComponentTemplateVersionModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PageComponentTemplateVersionModule)},_PageComponentTemplateVersionModule.\u0275mod=\u0275\u0275defineNgModule({type:_PageComponentTemplateVersionModule}),_PageComponentTemplateVersionModule.\u0275inj=\u0275\u0275defineInjector({providers:[provideHttpClient(withInterceptorsFromDi())],imports:[IxApiModule,EffectsModule.forFeature([PageComponentTemplateVersionEffects]),StoreModule.forFeature(feature42)]});let PageComponentTemplateVersionModule2=_PageComponentTemplateVersionModule;return PageComponentTemplateVersionModule2})();var PagePageService=(()=>{let _PagePageService=class _PagePageService{constructor(api,http){this.api=api,this.http=http}add(pagePage){let url=this.api.url("PagePageList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.post(url,pagePage,options)}getAll(fields){return whileMoreAfter(moreAfter=>this.getList(fields,moreAfter))}getByPublicId(publicId,fields){let url=this.api.url("PagePage",{publicId}),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,params=new HttpParams({fromObject:{fields:fields.join(",")}}),options={context:context3,headers,params};return this.http.get(url,options)}getList(fields,PagePageAfter,PagePageSize){let url=this.api.url("PagePageList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,params=new HttpParams({fromObject:__spreadValues({fields:fields.join(",")},getPageParams(PagePageAfter,PagePageSize))}),options={context:context3,headers,params};return this.http.get(url,options)}removeByPublicId(publicId){let url=this.api.url("PagePage",{publicId}),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.delete(url,options)}};_PagePageService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PagePageService)(\u0275\u0275inject(IxApiService),\u0275\u0275inject(HttpClient))},_PagePageService.\u0275prov=\u0275\u0275defineInjectable({token:_PagePageService,factory:_PagePageService.\u0275fac,providedIn:"root"});let PagePageService2=_PagePageService;return PagePageService2})();var PagePageEffects=(()=>{let _PagePageEffects=class _PagePageEffects{constructor(actions$,store,service){this.actions$=actions$,this.store=store,this.service=service,this.add$=createEffect(()=>this.actions$.pipe(ofType(add46),switchMap(({data})=>this.service.add(data).pipe(map(resp=>addSuccess46({data:__spreadValues(__spreadValues({},data),resp.data),publicId:resp.data.publicId})),catchError(errorResponse=>of(addFailure45({errors:errorResponse.error?.data??[]}))))))),this.ensureAll$=createEffect(()=>this.actions$.pipe(ofType(ensureAll48),mergeMap(({fields})=>combineLatest([this.store.select(selectAllLoading27),this.store.select(selectAllLoaded27)]).pipe(take(1),mergeMap(([loading,loaded])=>!loading&&!loaded?of(loadAll55({fields})):EMPTY))))),this.loadAll$=createEffect(()=>this.actions$.pipe(ofType(loadAll55),switchMap(({fields})=>this.service.getAll(fields).pipe(map(({data})=>loadAllSuccess56({data})),catchError(errorResponse=>of(loadAllFailure53({errors:errorResponse.error?.data??[]}))))))),this.loadDetails$=createEffect(()=>this.actions$.pipe(ofType(loadDetails5),concatMap(({publicId,fields})=>this.service.getByPublicId(publicId,fields).pipe(map(({data})=>loadDetailsSuccess5({publicId,data})),catchError(errorResponse=>of(loadDetailsFailure5({errors:errorResponse.error?.data??[]}))))))),this.remove$=createEffect(()=>this.actions$.pipe(ofType(remove48),switchMap(({publicId})=>this.service.removeByPublicId(publicId).pipe(map(()=>removeSuccess47({publicId})),catchError(errorResponse=>of(removeFailure45({errors:errorResponse.error?.data??[]})))))))}};_PagePageEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PagePageEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(Store),\u0275\u0275inject(PagePageService))},_PagePageEffects.\u0275prov=\u0275\u0275defineInjectable({token:_PagePageEffects,factory:_PagePageEffects.\u0275fac,providedIn:"root"});let PagePageEffects2=_PagePageEffects;return PagePageEffects2})();var PagePageModule=(()=>{let _PagePageModule=class _PagePageModule{};_PagePageModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PagePageModule)},_PagePageModule.\u0275mod=\u0275\u0275defineNgModule({type:_PagePageModule}),_PagePageModule.\u0275inj=\u0275\u0275defineInjector({providers:[provideHttpClient(withInterceptorsFromDi())],imports:[IxApiModule,StoreModule.forFeature(feature36),EffectsModule.forFeature([PagePageEffects])]});let PagePageModule2=_PagePageModule;return PagePageModule2})();var FEATURE_NAME49="platformServer";function mapAgentToPlatformServerList(agent){let servers=[];return agent.activeVpnSession?.rscServer&&servers.push(agent.activeVpnSession.rscServer),agent.mdrServer&&servers.push(agent.mdrServer),agent.loggingMdrServer&&servers.push(agent.loggingMdrServer),servers}function mapAgentListToPlatformServerList(agents){return uniqBy_default(flatten_default(agents.map(agent=>mapAgentToPlatformServerList(agent))),server=>server.publicId)}var adapter44=createResourceAdapter({sortComparer:sortByNameAndPublicIdComparer}),initialState49=adapter44.getInitialState(),reducer43=createReducer(initialState49,on(loadAll52,state=>__spreadProps(__spreadValues({},state),{allLoading:!0})),on(loadAllFailure50,state=>__spreadProps(__spreadValues({},state),{allLoading:!1})),on(loadAllSuccess53,(state,{data})=>adapter44.setAll(data,__spreadProps(__spreadValues({},state),{allLoading:!1,allLoaded:!0}))),on(reset72,()=>__spreadValues({},initialState49)),on(loadOneSuccess,(state,{data})=>{let servers=mapAgentToPlatformServerList(data);return servers.length?adapter44.upsertMany(servers,state):state}),on(loadAllSuccess2,loadAllActiveSuccess,(state,{data})=>{let servers=mapAgentListToPlatformServerList(data);return servers.length?adapter44.upsertMany(servers,state):state})),feature43=createFeature({name:FEATURE_NAME49,reducer:reducer43});var selectFeatureState9=createFeatureSelector(FEATURE_NAME49),selectors9=adapter44.getSelectors(),selectEntities37=createSelector(selectFeatureState9,selectors9.selectEntities),selectAll43=createSelector(selectFeatureState9,selectors9.selectAll),selectAllLoaded32=createSelector(selectFeatureState9,selectors9.selectAllLoaded),selectAllLoading32=createSelector(selectFeatureState9,selectors9.selectAllLoading);var PlatformServerService=(()=>{let _PlatformServerService=class _PlatformServerService{constructor(api,http){this.api=api,this.http=http}getAll(){return whileMoreAfter(moreAfter=>this.getList(moreAfter))}getList(pageAfter,pageSize){let url=this.api.url("MyCompanyPlatformServerList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,params=new HttpParams({fromObject:__spreadValues({fields:"location,name,type,vpnRange",filters:'in(type,"mdr","rsc")'},getPageParams(pageAfter,pageSize))}),options={context:context3,headers,params};return this.http.get(url,options)}};_PlatformServerService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PlatformServerService)(\u0275\u0275inject(IxApiService),\u0275\u0275inject(HttpClient))},_PlatformServerService.\u0275prov=\u0275\u0275defineInjectable({token:_PlatformServerService,factory:_PlatformServerService.\u0275fac,providedIn:"root"});let PlatformServerService2=_PlatformServerService;return PlatformServerService2})();var PlatformServerEffects=(()=>{let _PlatformServerEffects=class _PlatformServerEffects{constructor(actions$,store,service){this.actions$=actions$,this.store=store,this.service=service,this.ensureAll$=createEffect(()=>this.actions$.pipe(ofType(ensureAll45),mergeMap(()=>combineLatest([this.store.select(selectAllLoading32),this.store.select(selectAllLoaded32)]).pipe(take(1),mergeMap(([loading,loaded])=>!loading&&!loaded?of(loadAll52()):EMPTY))))),this.loadAll$=createEffect(()=>this.actions$.pipe(ofType(loadAll52),switchMap(()=>this.service.getAll().pipe(map(({data})=>loadAllSuccess53({data})),catchError(errorResponse=>of(loadAllFailure50({errors:errorResponse.error?.data??[]})))))))}};_PlatformServerEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PlatformServerEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(Store),\u0275\u0275inject(PlatformServerService))},_PlatformServerEffects.\u0275prov=\u0275\u0275defineInjectable({token:_PlatformServerEffects,factory:_PlatformServerEffects.\u0275fac,providedIn:"root"});let PlatformServerEffects2=_PlatformServerEffects;return PlatformServerEffects2})();var PlatformServerModule=(()=>{let _PlatformServerModule=class _PlatformServerModule{};_PlatformServerModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PlatformServerModule)},_PlatformServerModule.\u0275mod=\u0275\u0275defineNgModule({type:_PlatformServerModule}),_PlatformServerModule.\u0275inj=\u0275\u0275defineInjector({providers:[provideHttpClient(withInterceptorsFromDi())],imports:[IxApiModule,StoreModule.forFeature(feature43),EffectsModule.forFeature([PlatformServerEffects])]});let PlatformServerModule2=_PlatformServerModule;return PlatformServerModule2})();var PublicFileService=(()=>{let _PublicFileService=class _PublicFileService{constructor(api,http){this.api=api,this.http=http}upload(file){let url=this.api.url("PublicFileUpload"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.post(url,file,options)}};_PublicFileService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PublicFileService)(\u0275\u0275inject(IxApiService),\u0275\u0275inject(HttpClient))},_PublicFileService.\u0275prov=\u0275\u0275defineInjectable({token:_PublicFileService,factory:_PublicFileService.\u0275fac,providedIn:"root"});let PublicFileService2=_PublicFileService;return PublicFileService2})();var SectorService=(()=>{let _SectorService=class _SectorService{constructor(api,http){this.api=api,this.http=http}getMe(){let url=this.api.url("MySector"),params=new HttpParams({fromObject:{fields:MY_SECTOR_FIELDS.join(",")}}),options={headers:this.api.headers,params};return this.http.get(url,options)}};_SectorService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SectorService)(\u0275\u0275inject(IxApiService),\u0275\u0275inject(HttpClient))},_SectorService.\u0275prov=\u0275\u0275defineInjectable({token:_SectorService,factory:_SectorService.\u0275fac,providedIn:"root"});let SectorService2=_SectorService;return SectorService2})();var SectorEffects=(()=>{let _SectorEffects=class _SectorEffects{constructor(actions$,service){this.actions$=actions$,this.service=service,this.loadMe$=createEffect(()=>this.actions$.pipe(ofType(loadMe),switchMap(()=>this.service.getMe().pipe(map(({data})=>loadMeSuccess({data})),catchError(errorResponse=>of(loadMeFailure({errors:errorResponse.error?.data??[]})))))))}};_SectorEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SectorEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(SectorService))},_SectorEffects.\u0275prov=\u0275\u0275defineInjectable({token:_SectorEffects,factory:_SectorEffects.\u0275fac,providedIn:"root"});let SectorEffects2=_SectorEffects;return SectorEffects2})();var SectorModule=(()=>{let _SectorModule=class _SectorModule{};_SectorModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SectorModule)},_SectorModule.\u0275mod=\u0275\u0275defineNgModule({type:_SectorModule}),_SectorModule.\u0275inj=\u0275\u0275defineInjector({providers:[provideHttpClient(withInterceptorsFromDi())],imports:[IxApiModule,StoreModule.forFeature(feature18),EffectsModule.forFeature([SectorEffects])]});let SectorModule2=_SectorModule;return SectorModule2})();var FEATURE_NAME50="translation",TRANSLATION_KEY_PATTERN2=/^[A-Z0-9_.!?]+$/;function sortByKey(a,b){return a.key&&b.key?a.key.localeCompare(b.key):0}var adapter45=createResourceAdapter({sortComparer:sortByKey}),initialState50=adapter45.getInitialState(),reducer44=createReducer(initialState50,on(didAdd64,(state,{data})=>adapter45.upsertOne(data,state)),on(didUpdate60,(state,{data,publicId})=>adapter45.updateOne({id:publicId,changes:data},state)),on(loadAll54,state=>__spreadProps(__spreadValues({},state),{allLoading:!0})),on(loadAllFailure52,state=>__spreadProps(__spreadValues({},state),{allLoading:!1})),on(loadAllSuccess55,(state,{data})=>adapter45.setAll(data,__spreadProps(__spreadValues({},state),{allLoading:!1,allLoaded:!0}))),on(addManySuccess,upsertManySuccess2,didAddList7,(state,{data})=>adapter45.upsertMany(data,state)),on(updateManySuccess6,didUpdateList6,(state,{data})=>adapter45.updateMany(data.map(translation=>({id:translation.publicId,changes:translation})),state)),on(removeSuccess45,didRemove60,(state,{publicId})=>adapter45.removeOne(publicId,state)),on(didRemoveList8,(state,{publicIdList})=>adapter45.removeMany(publicIdList,state)),on(reset74,()=>__spreadValues({},initialState50))),feature44=createFeature({name:FEATURE_NAME50,reducer:reducer44});var selectAll44=createSelector(feature44.selectTranslationState,adapter45.getSelectors().selectAll),{selectAllLoading:selectAllLoading33,selectAllLoaded:selectAllLoaded33}=feature44;function validateBody(body){let requiredPropertyErrors=body.reduce((errors2,translation,i)=>typeof translation.key>"u"?[...errors2,{message:"Required property",propertyName:"key",listIndex:i}]:typeof translation.languages>"u"?[...errors2,{message:"Required property",propertyName:"languages",listIndex:i}]:translation.languages.en?errors2:[...errors2,{message:"Required language missing: en",propertyName:"languages",listIndex:i}],[]);if(requiredPropertyErrors.length)return new HttpErrorResponse({status:400,statusText:"BAD REQUEST",error:{data:requiredPropertyErrors,moreAfter:null,status:"error",type:"Error"}});let invalidKeyErrors=body.reduce((errors2,translation,i)=>typeof translation.key=="string"&&!TRANSLATION_KEY_PATTERN2.test(translation.key)?[...errors2,{message:"Value does not match regex expression",propertyName:"key",listIndex:i}]:errors2,[]);if(invalidKeyErrors.length)return new HttpErrorResponse({status:400,statusText:"BAD REQUEST",error:{data:invalidKeyErrors,moreAfter:null,status:"error",type:"Error"}});let duplicateKeyErrors=body.reduce((errors2,translation,i,all)=>{if(translation.key){let allWithKey=all.filter(t=>t.key===translation.key);if(allWithKey.length>1&&i===all.indexOf(allWithKey[1]))return[...errors2,{message:"Duplicate",propertyName:"key",listIndex:i}]}return errors2},[]);if(duplicateKeyErrors.length)return new HttpErrorResponse({status:409,statusText:"CONFLICT",error:{data:duplicateKeyErrors,moreAfter:null,status:"error",type:"Error"}})}var TranslationService=(()=>{let _TranslationService=class _TranslationService{constructor(api,http){this.api=api,this.http=http}addMany(body){let url=this.api.url("TranslationList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.post(url,body,options)}getAll(){return whileMoreAfter(moreAfter=>this.getList(moreAfter))}getList(pageAfter,pageSize){let url=this.api.url("TranslationList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,params=new HttpParams({fromObject:__spreadValues({fields:"*,languages(*)"},getPageParams(pageAfter,pageSize))}),options={context:context3,headers,params};return this.http.get(url,options)}updateMany(body){let url=this.api.url("TranslationList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.patch(url,body,options)}upsertMany(body){let errRes=validateBody(body);return errRes?throwError(()=>errRes):this.getAll().pipe(mergeMap(getRes=>{let addData=[],updateData=[],usedTranslationKeys=getRes.data.map(translation=>translation.key);return body.forEach(translation=>{if(!usedTranslationKeys.includes(translation.key))addData.push(translation);else{let found=getRes.data.find(t=>t.key===translation.key);found&&(isEqual_default(found.languages,translation.languages)||updateData.push(__spreadValues(__spreadValues({},found),translation)))}}),forkJoin([addData.length?this.addMany(addData).pipe(map(res=>res.data.map(({publicId},i)=>__spreadProps(__spreadValues({},addData[i]),{publicId}))),catchError(()=>of([]))):of([]),updateData.length?this.updateMany(updateData).pipe(map(()=>updateData),catchError(()=>of([]))):of([])]).pipe(map(([addedData,updatedData])=>({data:[...addedData,...updatedData],status:"success",type:"Translation"})))}))}removeByPublicId(publicId){let url=this.api.url("TranslationList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers,body:[{publicId}]};return this.http.delete(url,options)}};_TranslationService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationService)(\u0275\u0275inject(IxApiService),\u0275\u0275inject(HttpClient))},_TranslationService.\u0275prov=\u0275\u0275defineInjectable({token:_TranslationService,factory:_TranslationService.\u0275fac,providedIn:"root"});let TranslationService2=_TranslationService;return TranslationService2})();var TranslationEffects=(()=>{let _TranslationEffects=class _TranslationEffects{constructor(actions$,service,store){this.actions$=actions$,this.service=service,this.store=store,this.addMany$=createEffect(()=>this.actions$.pipe(ofType(addMany),switchMap(({data})=>this.service.addMany(data).pipe(map(response=>addManySuccess({data:response?.data?.map((translation,index)=>__spreadValues(__spreadValues({},translation),data&&data[index]?data[index]:{}))})),catchError(errorResponse=>of(addManyFailure({errors:errorResponse.error?.data??[]}))))))),this.ensureAll$=createEffect(()=>this.actions$.pipe(ofType(ensureAll47),switchMap(()=>combineLatest([this.store.select(selectAllLoading33),this.store.select(selectAllLoaded33)]).pipe(take(1),switchMap(([loading,loaded])=>!loading&&!loaded?of(loadAll54()):EMPTY))))),this.loadAll$=createEffect(()=>this.actions$.pipe(ofType(loadAll54),switchMap(()=>this.service.getAll().pipe(map(({data})=>loadAllSuccess55({data})),catchError(errorResponse=>of(loadAllFailure52({errors:errorResponse.error?.data??[]}))))))),this.updateMany$=createEffect(()=>this.actions$.pipe(ofType(updateMany6),switchMap(({data})=>this.service.updateMany(data).pipe(map(()=>updateManySuccess6({data})),catchError(errorResponse=>of(updateManyFailure6({errors:errorResponse.error?.data??[]}))))))),this.upsertMany$=createEffect(()=>this.actions$.pipe(ofType(upsertMany2),switchMap(({data})=>this.service.upsertMany(data).pipe(map(response=>upsertManySuccess2({data:response.data})),catchError(errorResponse=>of(upsertManyFailure2({errors:errorResponse.error?.data??[]}))))))),this.remove$=createEffect(()=>this.actions$.pipe(ofType(remove46),switchMap(({publicId})=>this.service.removeByPublicId(publicId).pipe(map(()=>removeSuccess45({publicId})),catchError(errorResponse=>of(removeFailure43({errors:errorResponse.error?.data??[]})))))))}};_TranslationEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(TranslationService),\u0275\u0275inject(Store))},_TranslationEffects.\u0275prov=\u0275\u0275defineInjectable({token:_TranslationEffects,factory:_TranslationEffects.\u0275fac,providedIn:"root"});let TranslationEffects3=_TranslationEffects;return TranslationEffects3})();var TranslationModule=(()=>{let _TranslationModule=class _TranslationModule{};_TranslationModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationModule)},_TranslationModule.\u0275mod=\u0275\u0275defineNgModule({type:_TranslationModule}),_TranslationModule.\u0275inj=\u0275\u0275defineInjector({providers:[provideHttpClient(withInterceptorsFromDi())],imports:[IxApiModule,StoreModule.forFeature(feature44),EffectsModule.forFeature([TranslationEffects])]});let TranslationModule3=_TranslationModule;return TranslationModule3})();var UserMembershipService=(()=>{let _UserMembershipService=class _UserMembershipService{constructor(api,http){this.api=api,this.http=http}create(body){let url=this.api.url("UserMembershipList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.post(url,body,options)}removeByPublicIdList(publicIdList){let url=this.api.url("UserMembershipList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers,body:publicIdList.map(publicId=>({publicId}))};return this.http.delete(url,options)}update(body){let url=this.api.url("UserMembershipList"),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.patch(url,body,options)}replaceUserMembershipsByUserId(userId,body){let url=this.api.url("UserMembershipUserList",{publicId:userId}),context3=new HttpContext().set(REQUIRES_COMPANY,!0),headers=this.api.headers,options={context:context3,headers};return this.http.put(url,body,options)}};_UserMembershipService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_UserMembershipService)(\u0275\u0275inject(IxApiService),\u0275\u0275inject(HttpClient))},_UserMembershipService.\u0275prov=\u0275\u0275defineInjectable({token:_UserMembershipService,factory:_UserMembershipService.\u0275fac,providedIn:"root"});let UserMembershipService2=_UserMembershipService;return UserMembershipService2})();var UserMembershipEffects=(()=>{let _UserMembershipEffects=class _UserMembershipEffects{constructor(actions$,service,snackBar){this.actions$=actions$,this.service=service,this.snackBar=snackBar,this.addList$=createEffect(()=>this.actions$.pipe(ofType(addList3),mergeMap(({data})=>this.service.create(data).pipe(map(response=>addListSuccess3({data:response.data.map((_data,i)=>__spreadValues(__spreadValues({},_data),data[i]))})),catchError(errorResponse=>of(addListFailure3({errors:errorResponse.error?.data??[]}))))))),this.removeList$=createEffect(()=>this.actions$.pipe(ofType(removeList2),mergeMap(({publicIdList})=>this.service.removeByPublicIdList(publicIdList).pipe(map(()=>removeListSuccess2({publicIdList})),catchError(errorResponse=>of(removeListFailure2({errors:errorResponse.error?.data??[]}))))))),this.updateList$=createEffect(()=>this.actions$.pipe(ofType(updateList),mergeMap(({data})=>this.service.update(data).pipe(map(()=>updateListSuccess({data})),catchError(errorResponse=>of(updateListFailure({errors:errorResponse.error?.data??[]}))))))),this.editCompanyMembership$=createEffect(()=>this.actions$.pipe(ofType(updateListFailure),tap(({errors:errors2})=>{errors2[0].message&&this.snackBar.open(errors2[0].message,void 0,{duration:3e3})})),{dispatch:!1}),this.updateUser$=createEffect(()=>this.actions$.pipe(ofType(updateUser),mergeMap(({userId,data})=>this.service.replaceUserMembershipsByUserId(userId,data).pipe(map(response=>updateUserSuccess({userId,data:data.map((_data,i)=>__spreadValues(__spreadValues({},_data),response.data[i]))})),catchError(errorResponse=>of(updateUserFailure({errors:errorResponse.error?.data??[]}))))))),this.updateUserFailure$=createEffect(()=>this.actions$.pipe(ofType(updateUserFailure),tap(({errors:errors2})=>{errors2[0].message&&this.snackBar.open(errors2[0].message,void 0,{duration:3e3})})),{dispatch:!1})}};_UserMembershipEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_UserMembershipEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(UserMembershipService),\u0275\u0275inject(MatSnackBar))},_UserMembershipEffects.\u0275prov=\u0275\u0275defineInjectable({token:_UserMembershipEffects,factory:_UserMembershipEffects.\u0275fac,providedIn:"root"});let UserMembershipEffects2=_UserMembershipEffects;return UserMembershipEffects2})();var UserMembershipModule=(()=>{let _UserMembershipModule=class _UserMembershipModule{};_UserMembershipModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_UserMembershipModule)},_UserMembershipModule.\u0275mod=\u0275\u0275defineNgModule({type:_UserMembershipModule}),_UserMembershipModule.\u0275inj=\u0275\u0275defineInjector({providers:[provideHttpClient(withInterceptorsFromDi())],imports:[IxApiModule,StoreModule.forFeature(feature19),EffectsModule.forFeature([UserMembershipEffects])]});let UserMembershipModule2=_UserMembershipModule;return UserMembershipModule2})();var import_papaparse=__toESM(require_papaparse_min());function stringify4(headerKeys,rows){return(0,import_papaparse.unparse)([headerKeys,...rows],{delimiter:",",newline:`
745
745
  `})}function toBlob(csvContent){return new Blob([csvContent],{type:"text/csv;charset=utf-8"})}var BooleanGenerator=class{update(){return Math.round(Math.random())==1}};var CombinerGenerator=class{constructor(generators,min2=0,max2=100){this.min=min2,this.max=max2,this.generators=generators}update(){let total=this.min;for(let g of this.generators)total+=g.update(),total%=this.max,total+=this.min;return total}};var LinearGenerator=class{constructor(min2=0,max2=100,deltaY=1){this.min=min2,this.max=max2,this.deltaY=deltaY,this.counter=0}update(){this.counter+=this.deltaY;let diff=this.max-this.min;return this.counter<this.min?this.counter=this.max-(this.min-this.counter%diff):this.counter>this.max&&(this.counter%=diff,this.counter+=this.min),this.counter}};var RandomGenerator=class{constructor(min2=0,max2=100){this.min=min2,this.max=max2}update(){return this.min+Math.round(Math.random()*this.max)}};var SinusoidGenerator=class{constructor(min2=0,max2=100,step=.1){this.min=min2,this.max=max2,this.step=step,this.x=0,this.codomain=(max2-min2)/2}update(){let middle=this.min+.5*this.max,sine=Math.sin(this.x);this.x+=this.step;let result=sine*this.codomain;return Math.round(middle+result)}};var import_lorem_ipsum=__toESM(require_dist()),StringGenerator=class{constructor(maxLength=32){this.maxLength=maxLength,this.lorem=new import_lorem_ipsum.LoremIpsum}update(){return this.lorem.generateSentences(1)}};var AGENT_DATA_VARIABLE_LIST=[{source:{publicId:"source",reference:{name:"AgentDataSource"}},publicId:"var1",variableId:1,name:"Bruised Wave",address:"12",slug:"ii",type:"int",signed:!1,width:"16",factor:null,unit:"%",maxStringLength:null,forAlarming:!0,forLogging:!0,internalUse:!1,updateable:!0},{source:{publicId:"source",reference:{name:"AgentDataSource"}},publicId:"var2",variableId:2,name:"Rising Integer",address:"12",slug:"ri",type:"int",signed:!1,width:"16",factor:null,unit:"%",maxStringLength:null,forAlarming:!0,forLogging:!0,internalUse:!1,updateable:!0},{source:{publicId:"source",reference:{name:"AgentDataSource"}},publicId:"var3",variableId:3,name:"Falling Integer",address:"12",slug:"di",type:"int",signed:!1,width:"16",factor:null,unit:"%",maxStringLength:null,forAlarming:!0,forLogging:!0,internalUse:!1,updateable:!0},{source:{publicId:"source",reference:{name:"AgentDataSource"}},publicId:"var4",variableId:4,name:"White Noise",address:"12",slug:"si",type:"int",signed:!1,width:"16",factor:null,unit:"%",maxStringLength:null,forAlarming:!0,forLogging:!0,internalUse:!1,updateable:!0},{source:{publicId:"source",reference:{name:"AgentDataSource"}},publicId:"var5",variableId:5,name:"Boolean",address:"12",slug:"bo",type:"bool",forAlarming:!0,forLogging:!0,internalUse:!1,updateable:!0},{source:{publicId:"source",reference:{name:"AgentDataSource"}},publicId:"var6",variableId:6,name:"Noisy String",address:"12",slug:"st",type:"str",maxStringLength:40,forAlarming:!0,forLogging:!0,internalUse:!1,updateable:!0}];var AGENT_DATA_TAG_LIST=[{source:{publicId:"source",reference:{name:"AgentDataSource"}},variable:AGENT_DATA_VARIABLE_LIST[0],publicId:"tag-1",tagId:1,name:"Bruised Wave",slug:"bw",aggregators:[],logEvent:"interval",loggingInterval:"30s"},{source:{publicId:"source",reference:{name:"AgentDataSource"}},variable:AGENT_DATA_VARIABLE_LIST[1],publicId:"tag-2",tagId:2,name:"Rising Value",slug:"rv",aggregators:[],logEvent:"interval",loggingInterval:"30s"},{source:{publicId:"source",reference:{name:"AgentDataSource"}},variable:AGENT_DATA_VARIABLE_LIST[2],publicId:"tag-3",tagId:3,name:"Falling Value",slug:"fv",aggregators:[],logEvent:"interval",loggingInterval:"30s"},{source:{publicId:"source",reference:{name:"AgentDataSource"}},variable:AGENT_DATA_VARIABLE_LIST[3],publicId:"tag-4",tagId:4,name:"Noise",slug:"wn",aggregators:[],logEvent:"interval",loggingInterval:"30s"}];var HistoricDataService=(()=>{let _HistoricDataService=class _HistoricDataService{constructor(){this.generators={1:new CombinerGenerator([new SinusoidGenerator,new RandomGenerator(0,10)],0,200),2:new LinearGenerator(0,500,4),3:new LinearGenerator(0,500,-4),4:new RandomGenerator(0,200),5:new BooleanGenerator,6:new StringGenerator}}getTags(){return AGENT_DATA_TAG_LIST}getGeneratorByTagId(tagId){return this.generators[tagId]}};_HistoricDataService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_HistoricDataService)},_HistoricDataService.\u0275prov=\u0275\u0275defineInjectable({token:_HistoricDataService,factory:_HistoricDataService.\u0275fac,providedIn:"root"});let HistoricDataService2=_HistoricDataService;return HistoricDataService2})();var AggregationService=(()=>{let _AggregationService=class _AggregationService{aggregate(tag,points){let aggregatedPoints=tag.queries.map(query=>{let pointsWithRef=this.filterDataPointsWithReference(points,query.ref),limit=query.limit?query.limit:pointsWithRef.length,chunkedPoints=this.splitToChunks(pointsWithRef,limit);return chunkedPoints.map((chunk,index)=>{let values=chunk.map(point=>point.values[query.ref]),result=values[0];switch(query.postAggr){case"first":result=values[0];break;case"last":result=values[values.length-1];break;case"mode":result=this.modus(values)||0;break;case"max":result=Math.max(...values);break;case"min":result=Math.min(...values);break;case"mean":result=values.reduce((previous,current)=>previous+current)/values.length;break;case"median":result=this.median(values)||0;break;case"sum":result=values.reduce((previous,current)=>previous+current);break;case"count":result=values.length;break;case"spread":result=Math.max(...values)-Math.min(...values);break}return{time:chunkedPoints[index][0].time,values:{[query.ref]:result}}})}).reduce((prev,curr)=>(curr.forEach(point=>{prev[point.time]?prev[point.time]=__spreadValues(__spreadValues({},point.values),prev[point.time]):prev[point.time]=point.values}),prev),{});return Object.entries(aggregatedPoints).map(value=>({time:value[0],values:value[1]}))}filterDataPointsWithReference(points,reference2){return points.filter(point=>Object.keys(point.values).includes(reference2))}splitToChunks(array,parts){if(parts>=array.length)return array.map(a=>[a]);let result=[];for(let i=parts;i>0;i--)result.push(array.splice(0,Math.ceil(array.length/i)));return result}modus(array){let count=new Map;array.forEach(number=>{number in count||(count[number]=0),count[number]++});let bestElement,bestCount=0;return Object.entries(count).forEach(([number,count2])=>{count2>bestCount&&(bestElement=parseFloat(number),bestCount=count2)}),bestElement}median(array){let middle=Math.floor(array.length/2);return array=[...array].sort((a,b)=>a-b),array.length%2!==0?array[middle]:(array[middle-1]+array[middle])/2}};_AggregationService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AggregationService)},_AggregationService.\u0275prov=\u0275\u0275defineInjectable({token:_AggregationService,factory:_AggregationService.\u0275fac,providedIn:"root"});let AggregationService2=_AggregationService;return AggregationService2})();var HistoricDataBuilderService=(()=>{let _HistoricDataBuilderService=class _HistoricDataBuilderService{constructor(historicDataService,aggregationService){this.historicDataService=historicDataService,this.aggregationService=aggregationService,this.STEP=30}generate(request,dataPointCount=4e3,startTime=DateTime.now()){return request.map(source=>this.generateData(source,dataPointCount,startTime))}generateData(dataSource,dataPointCount,startTime){let dataPoints=dataSource.tags.map(tag=>{let data=this.generateTagData(tag,dataPointCount,startTime),points2=Object.entries(data).reverse().map(point=>{let points3={};return tag.queries.map(q=>q.ref).forEach(ref=>{points3[ref]=point[1]}),{time:point[0],values:points3}});return this.aggregationService.aggregate(tag,points2)}),points=Object.entries(groupBy_default(flatten_default(dataPoints),point=>point.time)).map(point=>point[1].reduce((previous,current)=>({time:previous.time,values:__spreadValues(__spreadValues({},previous.values),current.values)}))),start3=dataSource.start||new Date().toISOString(),end2=dataSource.end||new Date(Date.parse(start3)-30).toISOString();return{start:start3,end:end2,timeZone:"UTC",source:dataSource.source,points}}generateTagData(tag,dataPointCount,startTime){let intermediateDateTimePoint=startTime,generator=this.historicDataService.getGeneratorByTagId(tag.id),dataPoints={};for(let i=0;i<dataPointCount;i+=1){let point=generator.update(),time=intermediateDateTimePoint.toUTC().toISO();dataPoints[time]=point,intermediateDateTimePoint=intermediateDateTimePoint.minus({seconds:this.STEP})}return dataPoints}};_HistoricDataBuilderService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_HistoricDataBuilderService)(\u0275\u0275inject(HistoricDataService),\u0275\u0275inject(AggregationService))},_HistoricDataBuilderService.\u0275prov=\u0275\u0275defineInjectable({token:_HistoricDataBuilderService,factory:_HistoricDataBuilderService.\u0275fac,providedIn:"root"});let HistoricDataBuilderService2=_HistoricDataBuilderService;return HistoricDataBuilderService2})();var DataExportInterceptor=(()=>{let _DataExportInterceptor=class _DataExportInterceptor{constructor(options,historicDataBuilderService){this.historicDataBuilderService=historicDataBuilderService,this.generateHistoricDataMemoized=memoize_default(this.historicDataBuilderService.generate.bind(this.historicDataBuilderService),request=>JSON.stringify(request)),this.options=__spreadValues(__spreadValues({},defaultOptions),options),this.url=`${this.options.baseUrl}/data-export`}blobToString(blob){return new Promise((resolve,reject2)=>{let reader=new FileReader;reader.onload=()=>resolve(reader.result),reader.onerror=()=>reject2(new Error("Error reading Blob")),reader.readAsText(blob)})}intercept(request,delegate){return request.method==="POST"&&request.url===this.url&&this.options.baseUrl?this.createCSVFile(request.body??new Blob):delegate.handle(request)}createCSVFile(body){return from(this.blobToString(body)).pipe(mergeMap(res=>{let sources=JSON.parse(res),data=this.generateHistoricDataMemoized(sources),headerKeys=this.extractHeaders(sources),rows=this.extractRows(data,headerKeys),csvBlob=this.createCSVBlob(headerKeys,rows);return of(new HttpResponse({body:csvBlob,url:this.url})).pipe(delay(100))}))}extractHeaders(sources){return sources[0].tags.map(tag=>tag.queries[0].ref)}extractRows(data,headerKeys){return data[0].points.map(row=>{let formattedRow=headerKeys.reduce((acc,key)=>(acc[key]=row.values[key],acc),{time:row.time});return Object.values(formattedRow).map(value=>`${value}`)})}createCSVBlob(headerKeys,rows){let csvContent=stringify4(["time",...headerKeys],[...rows]);return toBlob(csvContent)}};_DataExportInterceptor.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_DataExportInterceptor)(\u0275\u0275inject(IXAPI_OPTIONS),\u0275\u0275inject(HistoricDataBuilderService))},_DataExportInterceptor.\u0275prov=\u0275\u0275defineInjectable({token:_DataExportInterceptor,factory:_DataExportInterceptor.\u0275fac,providedIn:"root"});let DataExportInterceptor2=_DataExportInterceptor;return DataExportInterceptor2})();var HistoricDataInterceptor=(()=>{let _HistoricDataInterceptor=class _HistoricDataInterceptor{constructor(options,historicDataBuilderService){this.historicDataBuilderService=historicDataBuilderService,this.generateHistoricDataMemoized=memoize_default(this.historicDataBuilderService.generate.bind(this.historicDataBuilderService),request=>JSON.stringify(request)),this.options=__spreadValues(__spreadValues({},defaultOptions),options),this.url="https://api.ayayot.com/data"}intercept(request,delegate){if(request.method==="POST"&&request.url===this.url&&this.options.baseUrl){let result={type:"Data",data:this.generateHistoricDataMemoized(request.body),moreAfter:null,status:"success"},response=new HttpResponse({body:result,url:this.url});return of(response).pipe(delay(100))}return delegate.handle(request)}};_HistoricDataInterceptor.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_HistoricDataInterceptor)(\u0275\u0275inject(IXAPI_OPTIONS),\u0275\u0275inject(HistoricDataBuilderService))},_HistoricDataInterceptor.\u0275prov=\u0275\u0275defineInjectable({token:_HistoricDataInterceptor,factory:_HistoricDataInterceptor.\u0275fac});let HistoricDataInterceptor2=_HistoricDataInterceptor;return HistoricDataInterceptor2})();var AGENT={activationLicence:null,activeStatus:"active",activeVpnSession:{vpnAddress:"0.0.0.0",rscServer:{publicId:"rsc-server",name:"RSC server 1"}},alarmingApp:{enabled:!1,licence:null},company:{publicId:"company",reference:{name:"Company "}},connectedUsers:[{name:"John Doe",publicId:"conn-user"}],custom:{},demoDevice:null,deviceId:null,dataSources:[{agent:{publicId:"agent",reference:{name:"Agent"}},name:"Data source",publicId:"source",slug:"source"}],description:null,fixedVpnAddress:null,geoLocation:null,lastSeenAgentUserAgent:{publicId:"user-agent",firmwareVersion:"0.0.0",hardware:"Preview",hardwareVersion:"1"},location:{name:"Overloon, Netherlands",latitude:"",longitude:""},loggingMdrServer:{name:"MDR server",publicId:"mdr-server"},loggingMqttChangedOn:null,macAddress:"8d:d3:b2:b3:7d:53",mdrServer:{name:"MDR server",publicId:"mdr-server"},memberships:[{publicId:"agentMembership007",group:{publicId:"group007"}},{publicId:"agentMembership008",group:{publicId:"group008"}}],mqttChangedOn:null,name:"Example device",preferLocationOverGeoip:!0,pullCodeGeneratedOn:null,publicId:"agent",rateLimiting:{configMqttCommandCounter:0,configMqttCommandLastHit:"",configMqttCommandLimit:null,configMqttDataCounter:0,configMqttDataLastHit:"",configMqttDataLimit:null,configOpenvpnCounter:0,configOpenvpnLastHit:"",configOpenvpnLimit:null},replaceMacAddress:null,replaceRegistration:!1,reRegistration:!1,scheduledAccessRequests:[],serialNumber:"1",servers:[{custom:{},publicId:"vnc-server",name:"Control panel",serviceGroup:null,type:"vnc",requireAccessApproval:!1,visibleInMobileApp:!0}],timeZone:"Europe/Amsterdam",type:{name:"Preview",publicId:"type"},useStunnel:!1,valuesPerHour:0,vpnAudience:{publicId:"audience"},vpnChangedOn:null,vpnProtocol:"tcp",vpnRequireAccessApproval:!1,vpnVisibleInMobileApp:!1};var AgentMockService=(()=>{let _AgentMockService=class _AgentMockService{getAll(){return of({data:[AGENT],moreAfter:null,status:"success",type:"Agent"})}getAllActive(){return this.getAll()}getAllActiveAndInactive(){return this.getAll()}getByPublicId(){return of({data:AGENT,status:"success",type:"Agent"})}};_AgentMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AgentMockService)},_AgentMockService.\u0275prov=\u0275\u0275defineInjectable({token:_AgentMockService,factory:_AgentMockService.\u0275fac,providedIn:"root"});let AgentMockService2=_AgentMockService;return AgentMockService2})();var AgentMembershipMockService=(()=>{let _AgentMembershipMockService=class _AgentMembershipMockService{getAll(){return of({data:[{publicId:"agentMembership007",agent:{publicId:"agent"},group:{publicId:"group007"}},{publicId:"agentMembership008",agent:{publicId:"agent"},group:{publicId:"group008"}}]})}};_AgentMembershipMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AgentMembershipMockService)},_AgentMembershipMockService.\u0275prov=\u0275\u0275defineInjectable({token:_AgentMembershipMockService,factory:_AgentMembershipMockService.\u0275fac,providedIn:"root"});let AgentMembershipMockService2=_AgentMembershipMockService;return AgentMembershipMockService2})();var ASSET={custom:{},description:null,name:"Example asset",order:0,parent:null,publicId:"asset",resourceVariant:{name:"AssetType",order:0,publicId:"type"}};var AssetMockService=(()=>{let _AssetMockService=class _AssetMockService{getAll(){return of({data:[ASSET],moreAfter:null,status:"success",type:"Asset"})}getAllRoots(){return this.getAll()}getByPublicId(){return of({data:ASSET,status:"success",type:"Asset"})}};_AssetMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AssetMockService)},_AssetMockService.\u0275prov=\u0275\u0275defineInjectable({token:_AssetMockService,factory:_AssetMockService.\u0275fac,providedIn:"root"});let AssetMockService2=_AssetMockService;return AssetMockService2})();var AssetMembershipMockService=(()=>{let _AssetMembershipMockService=class _AssetMembershipMockService{getAll(){return of({data:[{publicId:"assetMembership007",asset:{publicId:"asset"},group:{publicId:"group007"}},{publicId:"assetMembership008",asset:{publicId:"asset"},group:{publicId:"group008"}}]})}};_AssetMembershipMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AssetMembershipMockService)},_AssetMembershipMockService.\u0275prov=\u0275\u0275defineInjectable({token:_AssetMembershipMockService,factory:_AssetMembershipMockService.\u0275fac,providedIn:"root"});let AssetMembershipMockService2=_AssetMembershipMockService;return AssetMembershipMockService2})();var AuthTokenMockService=(()=>{let _AuthTokenMockService=class _AuthTokenMockService{getForData(body){return of({data:{expiresOn:new Date(new Date().getTime()+body.expiresIn).toISOString(),publicId:"auth-token",secretId:"secret-id"},status:"success",type:"AuthToken"})}};_AuthTokenMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AuthTokenMockService)},_AuthTokenMockService.\u0275prov=\u0275\u0275defineInjectable({token:_AuthTokenMockService,factory:_AuthTokenMockService.\u0275fac,providedIn:"root"});let AuthTokenMockService2=_AuthTokenMockService;return AuthTokenMockService2})();var BackendComponentConfigMockService=(()=>{let _BackendComponentConfigMockService=class _BackendComponentConfigMockService{constructor(){this.storage=inject(StorageService)}getByBackendComponentTemplateId(backendComponentTemplateId){let pageComponentTemplateId=mapTemplateUrlToPublicId(sessionStorage.getItem("pct-url")),configValues=this.storage.get(`${STORAGE_KEY_CBC_CONFIG_VALUES}:${pageComponentTemplateId}`,void 0);return of({data:{publicId:"bctc",template:{publicId:backendComponentTemplateId},values:configValues},status:"success",type:"BackendComponentTemplateConfig"})}};_BackendComponentConfigMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BackendComponentConfigMockService)},_BackendComponentConfigMockService.\u0275prov=\u0275\u0275defineInjectable({token:_BackendComponentConfigMockService,factory:_BackendComponentConfigMockService.\u0275fac,providedIn:"root"});let BackendComponentConfigMockService2=_BackendComponentConfigMockService;return BackendComponentConfigMockService2})();var BRANDING={custom:{},favicon:null,fqdn:null,logo:null,logoDark:null,name:"Indigo & Pink",publicId:"branding",theme:{accentColor:"#ff4081",accentTextColor:"#ffffff",cardColor:null,headerColor:"#ffffff",headerLineColor:"#ffffff",logoHasBackgroundColor:!1,logoOnHeaderColorSpec:null,menuColor:null,pageColor:null,primaryColor:"#3f51b5",primaryTextColor:"#ffffff"}};var BrandingMockService=(()=>{let _BrandingMockService=class _BrandingMockService{getHost(){return of({data:BRANDING,status:"success",type:"Branding"})}};_BrandingMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BrandingMockService)},_BrandingMockService.\u0275prov=\u0275\u0275defineInjectable({token:_BrandingMockService,factory:_BrandingMockService.\u0275fac,providedIn:"root"});let BrandingMockService2=_BrandingMockService;return BrandingMockService2})();var CompanyMockService=(()=>{let _CompanyMockService=class _CompanyMockService{getMe(){return of({data:{publicId:"companyId",name:"Simulated Company"}})}updateMe(){return of({data:{}})}};_CompanyMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CompanyMockService)},_CompanyMockService.\u0275prov=\u0275\u0275defineInjectable({token:_CompanyMockService,factory:_CompanyMockService.\u0275fac,providedIn:"root"});let CompanyMockService2=_CompanyMockService;return CompanyMockService2})();var CustomPropertyMockService=(()=>{let _CustomPropertyMockService=class _CustomPropertyMockService{getAll(){return of({data:[],status:"success",type:"CustomProperty"})}};_CustomPropertyMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomPropertyMockService)},_CustomPropertyMockService.\u0275prov=\u0275\u0275defineInjectable({token:_CustomPropertyMockService,factory:_CustomPropertyMockService.\u0275fac,providedIn:"root"});let CustomPropertyMockService2=_CustomPropertyMockService;return CustomPropertyMockService2})();var GroupMockService=(()=>{let _GroupMockService=class _GroupMockService{getAll(){return of({data:[{publicId:"group007",name:"Agent Group",agent:{publicId:"agent"},type:{publicId:"groupType001",name:"Agent Group Type",order:1}},{publicId:"group008",name:"Company-wide Group",type:{publicId:"groupType002",name:"Company-wide Group Type",order:2}}],status:"success",type:"Group"})}};_GroupMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_GroupMockService)},_GroupMockService.\u0275prov=\u0275\u0275defineInjectable({token:_GroupMockService,factory:_GroupMockService.\u0275fac,providedIn:"root"});let GroupMockService2=_GroupMockService;return GroupMockService2})();var RoleMockService=(()=>{let _RoleMockService=class _RoleMockService{constructor(){this.storage=inject(StorageService)}getAll(){let agentPermissions=[],companyPermissions=[{publicId:"COMPANY_WIDE_ROLE"}],templateId=mapTemplateUrlToPublicId(sessionStorage.getItem("pct-url"));if(templateId){let permissions=this.storage.get(`permissions:${templateId}`);permissions&&(agentPermissions.push(...Object.keys(permissions).filter(p=>permissions[p].agent).map(p=>({publicId:p}))),companyPermissions.push(...Object.keys(permissions).filter(p=>permissions[p].company).map(p=>({publicId:p}))))}return of({data:[{publicId:"role007",permissions:agentPermissions,audiences:[{publicId:"audience",name:"VPN Audience"}]},{publicId:"role008",permissions:companyPermissions,audiences:[]}],status:"success",type:"Role"})}};_RoleMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_RoleMockService)},_RoleMockService.\u0275prov=\u0275\u0275defineInjectable({token:_RoleMockService,factory:_RoleMockService.\u0275fac,providedIn:"root"});let RoleMockService2=_RoleMockService;return RoleMockService2})();var GroupTypeMockService=(()=>{let _GroupTypeMockService=class _GroupTypeMockService{getAll(){return of({data:[],moreAfter:null,status:"success",type:"GroupType"})}};_GroupTypeMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_GroupTypeMockService)},_GroupTypeMockService.\u0275prov=\u0275\u0275defineInjectable({token:_GroupTypeMockService,factory:_GroupTypeMockService.\u0275fac,providedIn:"root"});let GroupTypeMockService2=_GroupTypeMockService;return GroupTypeMockService2})();var LicenceMockService=(()=>{let _LicenceMockService=class _LicenceMockService{getAll(){return of({data:[],status:"success",type:"Licence"})}};_LicenceMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LicenceMockService)},_LicenceMockService.\u0275prov=\u0275\u0275defineInjectable({token:_LicenceMockService,factory:_LicenceMockService.\u0275fac,providedIn:"root"});let LicenceMockService2=_LicenceMockService;return LicenceMockService2})();var LicenceTypeMockService=(()=>{let _LicenceTypeMockService=class _LicenceTypeMockService{getAll(){return of({data:[],status:"success",type:"LicenceType"})}};_LicenceTypeMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LicenceTypeMockService)},_LicenceTypeMockService.\u0275prov=\u0275\u0275defineInjectable({token:_LicenceTypeMockService,factory:_LicenceTypeMockService.\u0275fac,providedIn:"root"});let LicenceTypeMockService2=_LicenceTypeMockService;return LicenceTypeMockService2})();var DB_NAME="simulator",OBJ_STORE_NAME="images";function _getIndextedDB(){return window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB}function storeDataUrl(dataUrl){return new Promise(resolve=>{let open2=_getIndextedDB().open(DB_NAME,1);open2.onupgradeneeded=function(){open2.result.createObjectStore(OBJ_STORE_NAME,{keyPath:"id"})},open2.onsuccess=function(){let db=open2.result,tx=db.transaction(OBJ_STORE_NAME,"readwrite"),store=tx.objectStore(OBJ_STORE_NAME),id=UUID.v4();store.put({id,url:dataUrl}),resolve(id),tx.oncomplete=()=>{db.close()}}})}function getDataUrlById(id){return new Promise((resolve,reject2)=>{let open2=_getIndextedDB().open(DB_NAME,1);open2.onupgradeneeded=function(){open2.result.createObjectStore(OBJ_STORE_NAME,{keyPath:"id"})},open2.onsuccess=function(){let db=open2.result,tx=db.transaction(OBJ_STORE_NAME,"readwrite"),getImage=tx.objectStore(OBJ_STORE_NAME).get(id);getImage.onsuccess=()=>{getImage.result?resolve(getImage.result.url):reject2()},tx.oncomplete=()=>{db.close()}}})}var PageComponentMockService=(()=>{let _PageComponentMockService=class _PageComponentMockService{constructor(storage){this.storage=storage}add(body){return of({data:__spreadProps(__spreadValues({},body),{publicId:"new-component"})})}removeByPublicId(){return of({data:null})}updateByPublicId(publicId,body){return this._remember(body).pipe(map(()=>({data:null})))}updateMany(updates){return forkJoin(updates.map(update47=>this._remember(update47))).pipe(map(()=>({data:null})))}_remember(update47){let component=cloneDeep_default(update47);if(!component.template){let templateId=mapTemplateUrlToPublicId(sessionStorage.getItem("pct-url"));templateId&&(component.template={publicId:templateId})}return component.inputs&&component.template?this._upsertInputs(component):component.dimensions&&component.template?this._upsertDimensions(component.dimensions,component.template):of()}_upsertInputs(component){let id=component.template?.publicId,matches=component.inputs?component.inputs.match(/data:image\/\S+?"/g):null;if(matches?.length){let inputs=component.inputs,dataUrls=matches.map(match2=>match2.slice(0,-1));return forkJoin(dataUrls.map(url=>defer(()=>storeDataUrl(url)))).pipe(mergeMap(ids=>{let _inputs=ids.reduce((acc,id2,i)=>acc.replace(dataUrls[i],`__DATA_URL_PLACEHOLDER__${id2}`),inputs);return of(this._saveInputs({id,inputs:_inputs}))}))}return of(this._saveInputs({id,inputs:component.inputs}))}_upsertDimensions(dimensions,template){let id=template?.publicId;return of(this._saveDimensions({id,dimensions}))}_saveDimensions(item){let type=item.dimensions.type,items=this.storage.get(`pc-dimensions:${type}`,[]),foundIndex=items.findIndex(_item=>_item.id===item.id);foundIndex===-1?items.push(item):items[foundIndex]=merge_default(items[foundIndex],item),this.storage.set(`pc-dimensions:${type}`,items,ONE_WEEK)}_saveInputs(item){let items=this.storage.get("pc-inputs",[]),foundIndex=items.findIndex(_item=>_item.id===item.id);foundIndex===-1?items.push(item):items[foundIndex]=__spreadValues(__spreadValues({},items[foundIndex]),item),this.storage.set("pc-inputs",items,ONE_WEEK)}};_PageComponentMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PageComponentMockService)(\u0275\u0275inject(StorageService))},_PageComponentMockService.\u0275prov=\u0275\u0275defineInjectable({token:_PageComponentMockService,factory:_PageComponentMockService.\u0275fac,providedIn:"root"});let PageComponentMockService2=_PageComponentMockService;return PageComponentMockService2})();var PageComponentTemplateMockService=(()=>{let _PageComponentTemplateMockService=class _PageComponentTemplateMockService{constructor(){this.sessionStorage=inject(SESSION_STORAGE),this.storage=inject(StorageService)}getAll(){let url=this.sessionStorage.getItem("pct-url");if(!url)return of({data:[],moreAfter:null,status:"success",type:"PageComponentTemplate"});let publicId=mapTemplateUrlToPublicId(url),mainPath=mapTemplateUrlToMainPath(url),backendComponentIngress=this.storage.get(`${STORAGE_KEY_CBC_INGRESS}:${publicId}`),backendComponentTemplateId,backendComponentTemplateIdKey=`${STORAGE_KEY_CBC_PUBLIC_ID}:${publicId}`;return backendComponentIngress==="platform"&&this.storage.has(backendComponentTemplateIdKey)?backendComponentTemplateId=this.storage.get(backendComponentTemplateIdKey,null):backendComponentTemplateId=this.sessionStorage.getItem("pct-backend-component-id"),of({data:[{backendComponent:backendComponentTemplateId?{publicId:backendComponentTemplateId}:null,configuredVersion:{publicId,template:{publicId},mainPath},name:"Component",publicId,url}],moreAfter:null,status:"success",type:"PageComponentTemplate"})}};_PageComponentTemplateMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PageComponentTemplateMockService)},_PageComponentTemplateMockService.\u0275prov=\u0275\u0275defineInjectable({token:_PageComponentTemplateMockService,factory:_PageComponentTemplateMockService.\u0275fac,providedIn:"root"});let PageComponentTemplateMockService2=_PageComponentTemplateMockService;return PageComponentTemplateMockService2})();var PAGE_PAGE={order:0,publicId:"pagepage"};var PAGE_VERSION={components:[],createdBy:null,createdOn:"",defaultRefreshRate:null,page:{publicId:"page",reference:{name:"Page"}},pagePages:[PAGE_PAGE],periodSelectorEnabled:!0,periodSpec:"today",previewAgent:sessionStorage.getItem("pv-preview-asset-id")?null:sessionStorage.getItem("pv-preview-agent-id")?{publicId:sessionStorage.getItem("pv-preview-agent-id"),reference:{name:"Agent"}}:__use_api_mocks__?{publicId:"agent",reference:{name:"Agent"}}:null,previewAsset:sessionStorage.getItem("pv-preview-asset-id")?{publicId:sessionStorage.getItem("pv-preview-asset-id"),reference:{name:"Asset"}}:null,publicId:"version",title:"Page version",updatedBy:null,updatedOn:null};var PAGE={applicationType:"sheet",publicId:"page",name:"Page",draft:PAGE_VERSION,published:null};var PageMockService=(()=>{let _PageMockService=class _PageMockService{constructor(http,storage){this.http=http,this.storage=storage}getByPublicId(){let templateUrl=sessionStorage.getItem("pct-url"),applicationType=sessionStorage.getItem("application-type")||"sheet";return templateUrl?this.http.get(mapTemplateUrlToManifestUrl(templateUrl)).pipe(mergeMap(manifest=>{let templateId=mapTemplateUrlToPublicId(templateUrl),components=[__spreadProps(__spreadValues({},PAGE_COMPONENT),{inputs:mapPageComponentTemplateManifestToDefaultInputs(manifest),template:__spreadProps(__spreadValues({},PAGE_COMPONENT.template),{publicId:templateId})})],dimensions=this.storage.get(`pc-dimensions:${applicationType}`,[]).find(item=>item.id===components[0].template?.publicId)?.dimensions;dimensions&&(components[0].dimensions=dimensions);let inputs=this.storage.get("pc-inputs",[]).find(e=>e.id===components[0].template?.publicId)?.inputs;if(inputs){let matches=inputs.match(/__DATA_URL_PLACEHOLDER__\S+?"/g);if(matches?.length){let id=matches[0].trim().slice(24,-1);return from(getDataUrlById(id)).pipe(map(url=>(components[0].inputs=inputs.replace(matches[0],`${url}"`),{data:__spreadProps(__spreadValues({},PAGE),{draft:__spreadProps(__spreadValues({},PAGE_VERSION),{components})})})),catchError(()=>of({data:__spreadProps(__spreadValues({},PAGE),{draft:__spreadProps(__spreadValues({},PAGE_VERSION),{components})})})))}components[0].inputs=inputs}return of({data:__spreadProps(__spreadValues({},PAGE),{draft:__spreadProps(__spreadValues({},PAGE_VERSION),{components})})})})):of({data:PAGE})}};_PageMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PageMockService)(\u0275\u0275inject(HttpClient),\u0275\u0275inject(StorageService))},_PageMockService.\u0275prov=\u0275\u0275defineInjectable({token:_PageMockService,factory:_PageMockService.\u0275fac,providedIn:"root"});let PageMockService2=_PageMockService;return PageMockService2})();var PagePageMockService=(()=>{let _PagePageMockService=class _PagePageMockService{getByPublicId(){return of({data:PAGE_PAGE})}};_PagePageMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PagePageMockService)},_PagePageMockService.\u0275prov=\u0275\u0275defineInjectable({token:_PagePageMockService,factory:_PagePageMockService.\u0275fac,providedIn:"root"});let PagePageMockService2=_PagePageMockService;return PagePageMockService2})();var PageVersionMockService=(()=>{let _PageVersionMockService=class _PageVersionMockService{getByPublicId(){let components=sessionStorage.getItem("pct-url")?[PAGE_COMPONENT]:[];return of({data:__spreadProps(__spreadValues({},PAGE_VERSION),{components})})}updateByPublicId(publicId,body){return body.previewAgent&&(sessionStorage.setItem("pv-preview-agent-id",body.previewAgent.publicId),sessionStorage.removeItem("pv-preview-asset-id")),body.previewAsset&&(sessionStorage.setItem("pv-preview-asset-id",body.previewAsset.publicId),sessionStorage.removeItem("pv-preview-agent-id")),body.previewAgent===null&&sessionStorage.removeItem("pv-preview-agent-id"),body.previewAsset===null&&sessionStorage.removeItem("pv-preview-asset-id"),of({data:__spreadValues({publicId},body)})}};_PageVersionMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PageVersionMockService)},_PageVersionMockService.\u0275prov=\u0275\u0275defineInjectable({token:_PageVersionMockService,factory:_PageVersionMockService.\u0275fac,providedIn:"root"});let PageVersionMockService2=_PageVersionMockService;return PageVersionMockService2})();var PublicFileMockService=(()=>{let _PublicFileMockService=class _PublicFileMockService{getLogoUploadPath(){return this.getUploadPath("company-logo")}getFaviconUploadPath(){return this.getUploadPath("company-favicon")}getImageWidgetUploadPath(){return this.getUploadPath("image-widget")}getUploadPath(fileType){return of({data:{url:`https://fakecdn.ayayot.com/public/${fileType}/00/00/uuid.jpg?Authorization=token`},status:"success",type:"PublicFileResponse"})}};_PublicFileMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PublicFileMockService)},_PublicFileMockService.\u0275prov=\u0275\u0275defineInjectable({token:_PublicFileMockService,factory:_PublicFileMockService.\u0275fac,providedIn:"root"});let PublicFileMockService2=_PublicFileMockService;return PublicFileMockService2})();var TranslationMockService=(()=>{let _TranslationMockService=class _TranslationMockService{getAll(){return of({data:[],status:"success",type:"Translation"})}};_TranslationMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationMockService)},_TranslationMockService.\u0275prov=\u0275\u0275defineInjectable({token:_TranslationMockService,factory:_TranslationMockService.\u0275fac,providedIn:"root"});let TranslationMockService2=_TranslationMockService;return TranslationMockService2})();var MY_USER={custom:{},name:"Simulated User",publicId:"userId",unreadMessagesCount:0},USER={memberships:[{publicId:"membership007",group:{publicId:"group007"},role:{publicId:"role007"}},{publicId:"membership008",group:{publicId:"group008"},role:{publicId:"role008"}}],name:"Simulated User",publicId:"userId"};var UserMockService=(()=>{let _UserMockService=class _UserMockService{getByPublicId(){return of({data:USER})}getAll(){return of({data:[USER]})}getMe(){return of({data:MY_USER})}updateMe(){return of({data:{}})}};_UserMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_UserMockService)},_UserMockService.\u0275prov=\u0275\u0275defineInjectable({token:_UserMockService,factory:_UserMockService.\u0275fac,providedIn:"root"});let UserMockService2=_UserMockService;return UserMockService2})();var ComponentLoaderMockService=(()=>{let _ComponentLoaderMockService=class _ComponentLoaderMockService{constructor(document2,http){this.document=document2,this.http=http,this.customElementNameAttr="data-custom-element-name",this.loadedAttr="data-loaded"}loadCustomElement(template){return from(this.findOrLoadScript(template)).pipe(mergeMap(name=>name?of(name):EMPTY))}findOrLoadScript(template){let found=this.document.getElementById(this.getScriptId(template));return found?Promise.resolve(found.getAttribute(this.customElementNameAttr)):this.loadScript(template)}getScriptId(template){return`pct-${template.publicId}`}loadScript(template){return new Promise((resolve,reject2)=>{if(!template.url){reject2(new Error(`No url found for "${template.name}"`));return}let url=template.url;this.http.get(url,{responseType:"text"}).subscribe({next:body=>{let parsed=parseBody(body);if(parsed?.selector){let name=parsed.selector,script=this.document.createElement("script");script.type="module",script.id=this.getScriptId(template),script.src=url,script.setAttribute(this.customElementNameAttr,name),this.onLoad(script).then(()=>{script.setAttribute(this.loadedAttr,"loaded"),resolve(name||null)},reject2),this.document.body.appendChild(script);return}reject2(new Error("Couldn't find a custom-element definition"))},error:()=>{reject2(new Error("Request failed"))}})})}onLoad(script){return new Promise((resolve,reject2)=>{script.addEventListener("load",loadHandler),script.addEventListener("error",errorHandler);function loadHandler(){resolve(),unlisten()}function errorHandler(err){reject2(err),unlisten()}function unlisten(){script.removeEventListener("load",loadHandler),script.removeEventListener("error",errorHandler)}})}};_ComponentLoaderMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentLoaderMockService)(\u0275\u0275inject(DOCUMENT),\u0275\u0275inject(HttpClient))},_ComponentLoaderMockService.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentLoaderMockService,factory:_ComponentLoaderMockService.\u0275fac,providedIn:"root"});let ComponentLoaderMockService2=_ComponentLoaderMockService;return ComponentLoaderMockService2})();var AssetsMockGuard=(()=>{let _AssetsMockGuard=class _AssetsMockGuard{canUse(){return!0}};_AssetsMockGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AssetsMockGuard)},_AssetsMockGuard.\u0275prov=\u0275\u0275defineInjectable({token:_AssetsMockGuard,factory:_AssetsMockGuard.\u0275fac,providedIn:"root"});let AssetsMockGuard2=_AssetsMockGuard;return AssetsMockGuard2})(),ObjectStorageMockGuard=(()=>{let _ObjectStorageMockGuard=class _ObjectStorageMockGuard{canUse(){return!0}};_ObjectStorageMockGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ObjectStorageMockGuard)},_ObjectStorageMockGuard.\u0275prov=\u0275\u0275defineInjectable({token:_ObjectStorageMockGuard,factory:_ObjectStorageMockGuard.\u0275fac,providedIn:"root"});let ObjectStorageMockGuard2=_ObjectStorageMockGuard;return ObjectStorageMockGuard2})(),HistoricalDataMockGuard=(()=>{let _HistoricalDataMockGuard=class _HistoricalDataMockGuard{canUse(){return!0}canInput(){return!0}};_HistoricalDataMockGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_HistoricalDataMockGuard)},_HistoricalDataMockGuard.\u0275prov=\u0275\u0275defineInjectable({token:_HistoricalDataMockGuard,factory:_HistoricalDataMockGuard.\u0275fac,providedIn:"root"});let HistoricalDataMockGuard2=_HistoricalDataMockGuard;return HistoricalDataMockGuard2})(),LiveDataMockGuard=(()=>{let _LiveDataMockGuard=class _LiveDataMockGuard{canUse(){return!0}canInput(){return!0}};_LiveDataMockGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LiveDataMockGuard)},_LiveDataMockGuard.\u0275prov=\u0275\u0275defineInjectable({token:_LiveDataMockGuard,factory:_LiveDataMockGuard.\u0275fac,providedIn:"root"});let LiveDataMockGuard2=_LiveDataMockGuard;return LiveDataMockGuard2})();var LocalCloudFunctionCallerService=(()=>{let _LocalCloudFunctionCallerService=class _LocalCloudFunctionCallerService{constructor(){this.api=inject(IxApiService),this.http=inject(HttpClient),this.resourceDataProviderFacade=inject(ResourceDataProviderFacade),this.storage=inject(StorageService),this.store=inject(Store),this.sessionStorage=inject(SESSION_STORAGE)}call(call,param){return typeof param=="string"?this.callWithId(call,param):this.callWithConfig(call,param)}callWithId(call,agentOrAssetId){return combineLatest([this.store.select(selectEntity3(agentOrAssetId)),this.store.select(selectEntity5(agentOrAssetId)),this.store.select(selectMe),this.store.select(selectMe2)]).pipe(filter(([,,myCompany,myUser])=>!!myCompany&&!!myUser),map(([agent,asset,myCompany,myUser])=>({agent,asset,myCompany,myUser})),take(1),switchMap(config3=>this.callWithConfig(call,config3)))}callWithConfig(call,config3){let pageComponentTemplateId=mapTemplateUrlToPublicId(this.sessionStorage.getItem("pct-url")),url=this.storage.get(`${STORAGE_KEY_CBC_INGRESS_URL}:${pageComponentTemplateId}`,DEFAULT_CBC_INGRESS_URL),configValues=this.sessionStorage.getItem(`${STORAGE_KEY_CBC_CONFIG_VALUES}:${pageComponentTemplateId}`),apiApplication=this.api.options.appId?{publicId:this.api.options.appId,name:"Api Application",custom:{}}:null,headerValue=this.api.headers.get("Authorization"),accessToken=headerValue?{headerValue}:null,agent=this._asResource(config3.agent,!0,toValue(this.resourceDataProviderFacade.getUniqPermissionIds(config3.agent?.publicId,"Agent"))),asset=this._asResource(config3.asset,!0,toValue(this.resourceDataProviderFacade.getUniqPermissionIds(config3.asset?.publicId,"Asset"))),company=this._asResource(config3.myCompany,!0,toValue(this.resourceDataProviderFacade.getUniqPermissionIds())),user=this._asResource(config3.myUser);if(!company||!user)throw new Error("wrong");let body=__spreadValues({name:call.functionName,arguments:call.functionArguments,context:__spreadValues(__spreadValues(__spreadValues(__spreadValues({company,user},agent?{agent}:{}),asset?{asset}:{}),apiApplication?{apiApplication}:{}),accessToken?{accessToken}:{})},configValues?{config:JSON.parse(configValues)}:{});return this.http.post(url,body).pipe(map(value=>({value})))}_asResource(obj,addPermissions=!1,permissions=null){if(!obj)return null;let resource={publicId:obj.publicId,name:obj.name||"",custom:obj.custom||{}};return addPermissions&&(resource.permissions=permissions??[]),resource}};_LocalCloudFunctionCallerService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LocalCloudFunctionCallerService)},_LocalCloudFunctionCallerService.\u0275prov=\u0275\u0275defineInjectable({token:_LocalCloudFunctionCallerService,factory:_LocalCloudFunctionCallerService.\u0275fac,providedIn:"root"});let LocalCloudFunctionCallerService2=_LocalCloudFunctionCallerService;return LocalCloudFunctionCallerService2})();var BackendComponentCallerLocalService=class{constructor(caller,config3){this.caller=caller,this.config=config3}call(call){return this.caller.call(call.call,this.config)}};var BackendComponentCallerMockService=class extends BackendComponentCallerService{constructor(storage,http,api,config3){super(http,api,config3),this.storage=storage}call(call){let pageComponentTemplateId=mapTemplateUrlToPublicId(sessionStorage.getItem("pct-url")),templateId=this.storage.get(`${STORAGE_KEY_CBC_PUBLIC_ID}:${pageComponentTemplateId}`);return super.call({call:call.call,template:{publicId:templateId}})}};var BackendComponentCallerNoopService=class{constructor(snackbar){this.snackbar=snackbar}call(){return this.snackbar.open("Cloud Function is disabled",void 0,{duration:4e3}),throwError(()=>new Error("Cloud Function is disabled"))}};var BackendComponentCallerMockServiceFactory=(()=>{let _BackendComponentCallerMockServiceFactory=class _BackendComponentCallerMockServiceFactory{constructor(){this.api=inject(IxApiService),this.http=inject(HttpClient),this.localCloudFunctionCallerService=inject(LocalCloudFunctionCallerService),this.snackbar=inject(MatSnackBar),this.storage=inject(StorageService)}create(config3){let pageComponentTemplateId=mapTemplateUrlToPublicId(sessionStorage.getItem("pct-url")),ingress=this.storage.get(`${STORAGE_KEY_CBC_INGRESS}:${pageComponentTemplateId}`);return!__use_api_mocks__&&ingress==="platform"?new BackendComponentCallerMockService(this.storage,this.http,this.api,config3):ingress=="local"?new BackendComponentCallerLocalService(this.localCloudFunctionCallerService,config3):new BackendComponentCallerNoopService(this.snackbar)}};_BackendComponentCallerMockServiceFactory.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BackendComponentCallerMockServiceFactory)},_BackendComponentCallerMockServiceFactory.\u0275prov=\u0275\u0275defineInjectable({token:_BackendComponentCallerMockServiceFactory,factory:_BackendComponentCallerMockServiceFactory.\u0275fac,providedIn:"root"});let BackendComponentCallerMockServiceFactory2=_BackendComponentCallerMockServiceFactory;return BackendComponentCallerMockServiceFactory2})();var LINKS=[{rel:"Agent",href:"https://api.ayayot.com/agents/{publicId}"},{rel:"AgentAuditLogList",href:"https://api.ayayot.com/agent/{agentId}/audit-logs"},{rel:"AgentVpnUsage",href:"https://api.ayayot.com/agent/{agentId}/vpn-usage"},{rel:"DataList",href:"https://api.ayayot.com/data"},{rel:"DataExport",href:"https://api.ayayot.com/data-export"},{rel:"GroupList",href:"https://api.ayayot.com/groups"},{rel:"AgentDataRealTimeWebSocket",href:"wss://wse.mdr.ams.dkn.ayayot.com/agents/{publicIdList}/data-realtime"},{rel:"AgentDataTagList",href:"https://api.ayayot.com/data-tags"}];var IxApiServiceMock=(()=>{let _IxApiServiceMock=class _IxApiServiceMock{constructor(options,errors$){this.errors$=errors$,this.links$=new BehaviorSubject(null),this.headers=new HttpHeaders,this.isDiscovered=this.links$.pipe(map(links=>!!links)),this.options=__spreadValues(__spreadValues({},defaultOptions),options),validateOptions(this.options,this.errors$),this.options.appId&&(this.headers=this.headers.set(IxApiHeaderKeys.Application,"[api-application]")),this.options.version&&(this.headers=this.headers.set(IxApiHeaderKeys.Version,"2"))}get links(){return this.links$.getValue()}discover(){let linkMap=getLinkMap(LINKS);return this.links$.next(linkMap),of(linkMap)}url(rel,params){if(this.links){let link=this.links.get(rel);if(link)return getLinkUrl(link,params);{let error2=new Error(IxApiErrorMessages.ENTRY_NOT_FOUND);throw this.errors$.next(error2),error2}}else{let error2=new Error(IxApiErrorMessages.NOT_DISCOVERED);throw this.errors$.next(error2),error2}}};_IxApiServiceMock.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_IxApiServiceMock)(\u0275\u0275inject(IXAPI_OPTIONS),\u0275\u0275inject(IxApiErrors))},_IxApiServiceMock.\u0275prov=\u0275\u0275defineInjectable({token:_IxApiServiceMock,factory:_IxApiServiceMock.\u0275fac,providedIn:"root"});let IxApiServiceMock2=_IxApiServiceMock;return IxApiServiceMock2})();var AgentDataTagMockService=(()=>{let _AgentDataTagMockService=class _AgentDataTagMockService{constructor(historicDataService){this.historicDataService=historicDataService}getAll(){let tags=this.historicDataService.getTags();return of({type:"AgentDataTag",data:tags,moreAfter:null,status:"success"}).pipe(delay(10))}};_AgentDataTagMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AgentDataTagMockService)(\u0275\u0275inject(HistoricDataService))},_AgentDataTagMockService.\u0275prov=\u0275\u0275defineInjectable({token:_AgentDataTagMockService,factory:_AgentDataTagMockService.\u0275fac,providedIn:"root"});let AgentDataTagMockService2=_AgentDataTagMockService;return AgentDataTagMockService2})();var AgentDataVariableMockService=(()=>{let _AgentDataVariableMockService=class _AgentDataVariableMockService{getAll(){return of({type:"AgentDataVariable",data:AGENT_DATA_VARIABLE_LIST,moreAfter:null,status:"success"}).pipe(delay(10))}};_AgentDataVariableMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AgentDataVariableMockService)},_AgentDataVariableMockService.\u0275prov=\u0275\u0275defineInjectable({token:_AgentDataVariableMockService,factory:_AgentDataVariableMockService.\u0275fac,providedIn:"root"});let AgentDataVariableMockService2=_AgentDataVariableMockService;return AgentDataVariableMockService2})();var URL_PATTERN=/wss:\/\/wse.mdr.[a-z]{3}.dkn.ayayot.com\/agents\/(\S+)\/data-realtime/;function parseUrl(url){let matches=url.match(URL_PATTERN);return matches&&matches.length>1?matches[1].split(",").filter(agentId=>!!agentId):[]}function webSocketMockFactory(injector){let store=injector.get(Store);return function(urlConfigOrSource){let isRealTimeData=!1,agentIds=[],intervalId;if(typeof urlConfigOrSource=="string"&&URL_PATTERN.test(urlConfigOrSource)?(isRealTimeData=!0,agentIds=parseUrl(urlConfigOrSource)):typeof urlConfigOrSource=="object"&&URL_PATTERN.test(urlConfigOrSource.url)&&(isRealTimeData=!0,agentIds=parseUrl(urlConfigOrSource.url)),isRealTimeData&&agentIds.length){let agentId=agentIds[0],variables=[];store.select(selectAllForAgent2(agentId)).subscribe(_variables=>{variables=sortBy_default(_variables,["variableId"])});class WebSocketMockSubject extends Subject{complete(){intervalId&&(clearInterval(intervalId),intervalId=null),super.complete()}next(value){typeof value!="string"&&super.next(value)}}let wsSubject=new WebSocketMockSubject,bruisedWave=new CombinerGenerator([new SinusoidGenerator,new RandomGenerator(0,10)],0,200),rising=new LinearGenerator,falling=new LinearGenerator(0,500,-4),noise=new RandomGenerator(0,200),bools=new BooleanGenerator,lorem=new StringGenerator;return intervalId=setInterval(()=>{let time=new Date().getTime(),points=generatePoints(time,[bruisedWave.update(),rising.update(),falling.update(),noise.update(),bools.update(),lorem.update()],variables);wsSubject.next({message:{points,sentTime:time},agent:{publicId:agentId},device:{publicId:"source"}})},500),wsSubject}return webSocket(urlConfigOrSource)}}function generatePoints(time,inputs,variables){let point=variables.reduce((pt,variable)=>{if(variable.variableId){pt.tags||(pt.tags=[]),pt.tags.push(variable.variableId);let code=getTypeCode(variable);code&&(pt[code]||(pt[code]=[]),pt[code].push(inputs[variable.variableId-1]))}return pt},{});return[__spreadProps(__spreadValues({},point),{time})]}var ObjectStorageAuthorizationLocalService=(()=>{let _ObjectStorageAuthorizationLocalService=class _ObjectStorageAuthorizationLocalService{constructor(){this.caller=inject(LocalCloudFunctionCallerService)}authorizeUpload(agentOrAssetId){return this.authorizeSingleObjectOperation(agentOrAssetId,"upload")}authorizeList(agentOrAssetId){return __async(this,null,function*(){let response=this.caller.call({functionName:"ayayot.objectstorage_v1.authorize_list"},agentOrAssetId).pipe(map(result=>result.value)),value;try{value=yield firstValueFrom(response)}catch{throw new Error("Invalid response")}if(!("data"in value)||!isArray_default(value.data)||value.data.length==0)throw new Error("Invalid response");for(let row of value.data){if(!("publicId"in row)||typeof row?.publicId!="string"||!("path"in row)||typeof row?.path!="string"||!("type"in row)||typeof row?.type!="string")throw new Error("Invalid response");if(!this.validateObjectPath(row.path))throw new Error("Path is not valid")}return value})}authorizeDownload(agentOrAssetId){return this.authorizeSingleObjectOperation(agentOrAssetId,"download")}authorizeDelete(agentOrAssetId){return this.authorizeSingleObjectOperation(agentOrAssetId,"delete")}authorizeUpdate(agentOrAssetId){return this.authorizeSingleObjectOperation(agentOrAssetId,"upload")}authorizeSingleObjectOperation(agentOrAssetId,operation){return __async(this,null,function*(){let response=this.caller.call({functionName:`ayayot.objectstorage_v1.authorize_${operation}`},agentOrAssetId).pipe(map(result=>result.value)),value;try{value=yield firstValueFrom(response)}catch{throw new Error("Invalid response")}if(!("data"in value)||!("path"in(value?.data??{}))||typeof value?.data?.path!="string")throw new Error("Invalid response");if(!this.validateObjectPath(value.data.path))throw new Error("Path is not valid");return value})}validateObjectPath(path){return![`
746
- `,"\r","#","[","]","*","?",":",";","'",'"',"<",">","{","}","|","%",".."].map(i=>path.includes(i)).includes(!0)}};_ObjectStorageAuthorizationLocalService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ObjectStorageAuthorizationLocalService)},_ObjectStorageAuthorizationLocalService.\u0275prov=\u0275\u0275defineInjectable({token:_ObjectStorageAuthorizationLocalService,factory:_ObjectStorageAuthorizationLocalService.\u0275fac,providedIn:"root"});let ObjectStorageAuthorizationLocalService2=_ObjectStorageAuthorizationLocalService;return ObjectStorageAuthorizationLocalService2})();var ObjectStorageAuthorizationMockService=(()=>{let _ObjectStorageAuthorizationMockService=class _ObjectStorageAuthorizationMockService{authorizeUpload(){return Promise.resolve({result:"success",data:{path:""}})}authorizeList(agentOrAssetId){return Promise.resolve({result:"success",data:[{publicId:agentOrAssetId,path:"",type:"Agent"},{publicId:agentOrAssetId,path:"",type:"Asset"}]})}authorizeDownload(){return Promise.resolve({result:"success",data:{path:""}})}authorizeDelete(){return Promise.resolve({result:"success",data:{path:""}})}authorizeUpdate(){return Promise.resolve({result:"success",data:{path:""}})}};_ObjectStorageAuthorizationMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ObjectStorageAuthorizationMockService)},_ObjectStorageAuthorizationMockService.\u0275prov=\u0275\u0275defineInjectable({token:_ObjectStorageAuthorizationMockService,factory:_ObjectStorageAuthorizationMockService.\u0275fac,providedIn:"root"});let ObjectStorageAuthorizationMockService2=_ObjectStorageAuthorizationMockService;return ObjectStorageAuthorizationMockService2})();var import_jszip=__toESM(require_jszip_min());var ObjectStorageServiceFactory2=(()=>{let _ObjectStorageServiceFactory=class _ObjectStorageServiceFactory{constructor(){this.objects=[],this.authorizationLocalService=inject(ObjectStorageAuthorizationLocalService),this.authorizationMockService=inject(ObjectStorageAuthorizationMockService),this.storage=inject(StorageService)}createService(agentOrAssetId){let pageComponentTemplateId=mapTemplateUrlToPublicId(sessionStorage.getItem("pct-url")),authorizationService=this.storage.get(`${STORAGE_KEY_CBC_INGRESS}:${pageComponentTemplateId}`)=="local"?this.authorizationLocalService:this.authorizationMockService;return agentOrAssetId?new ObjectStorageMockService(authorizationService,this.objects,agentOrAssetId?.publicId):new NoopObjectStorageService}};_ObjectStorageServiceFactory.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ObjectStorageServiceFactory)},_ObjectStorageServiceFactory.\u0275prov=\u0275\u0275defineInjectable({token:_ObjectStorageServiceFactory,factory:_ObjectStorageServiceFactory.\u0275fac,providedIn:"root"});let ObjectStorageServiceFactory3=_ObjectStorageServiceFactory;return ObjectStorageServiceFactory3})();function forSameObject(objectMeta){return({meta})=>meta.uuid===objectMeta.uuid&&(!meta.agent||meta.agent?.publicId===objectMeta.agent?.publicId)&&(!meta.asset||meta.asset?.publicId===objectMeta.asset?.publicId)}var ObjectStorageMockService=class{constructor(authService,objects,agentOrAssetId){this.authService=authService,this.objects=objects,this.agentOrAssetId=agentOrAssetId}getList(){return __async(this,null,function*(){let paths;try{paths=(yield this.authService.authorizeList(this.agentOrAssetId)).data.map(d=>d.path)}catch{return Promise.reject("authorization failed")}return Promise.resolve({entries:this.objects.filter(o=>paths.map(p=>p.startsWith(o.path)).includes(!0)).map(o=>o.meta)})})}getBlob(identifier){return __async(this,null,function*(){if(Array.isArray(identifier)){let zip=new import_jszip.default,promises=identifier.map(meta=>__async(this,null,function*(){let blob=yield this.getBlob(meta);if(meta.outputDir){let folder=zip.folder(meta.outputDir);if(!folder)return Promise.reject(new Error("Could not create folder"));folder.file(meta.tags.name,blob);return}zip.file(meta.tags.name,blob)}));return Promise.all(promises).then(()=>zip.generateAsync({type:"blob"}))}let path;try{path=(yield this.authService.authorizeDownload(this.agentOrAssetId)).data.path}catch{return Promise.reject("authorization failed")}let obj=this.findById(path,identifier);return obj?Promise.resolve(obj.blob):Promise.reject(new Error("Object not found"))})}store(object,options){return __async(this,null,function*(){let path;try{path=(yield this.authService.authorizeUpload(this.agentOrAssetId)).data.path}catch{return Promise.reject("authorization failed")}let uuid=crypto.randomUUID(),meta={uuid,tags:options?.tags??{},size:object.size};return this.objects.push({blob:object,meta,path}),{identifier:uuid}})}delete(objectMeta){return __async(this,null,function*(){let path;try{path=(yield this.authService.authorizeDelete(this.agentOrAssetId)).data.path}catch{return Promise.reject("authorization failed")}let index=this.findIndexById(path,objectMeta);return index<0?Promise.reject(new Error("Object not found")):(this.objects.splice(index,1),Promise.resolve())})}update(objectMeta,options){return __async(this,null,function*(){let path;try{path=(yield this.authService.authorizeUpdate(this.agentOrAssetId)).data.path}catch{return Promise.reject("authorization failed")}let index=this.findIndexById(path,objectMeta);return index<0?Promise.reject(new Error("Object not found")):(this.objects[index].meta.tags=options.tags??{},Promise.resolve())})}destroy(){}findById(path,id){return this.objects.filter(o=>o.path.startsWith(path)).find(forSameObject(id))}findIndexById(path,id){return this.objects.filter(o=>o.path.startsWith(path)).findIndex(forSameObject(id))}};var BackendComponentBrokerMockFacade=(()=>{let _BackendComponentBrokerMockFacade=class _BackendComponentBrokerMockFacade extends BackendComponentBrokerFacade{constructor(store,storage){super(store),this.storage=storage}resolveTemplateFromPageComponent(){let pageComponentTemplateId=mapTemplateUrlToPublicId(sessionStorage.getItem("pct-url")),templateId=this.storage.get(`${STORAGE_KEY_CBC_PUBLIC_ID}:${pageComponentTemplateId}`);return of(templateId)}};_BackendComponentBrokerMockFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BackendComponentBrokerMockFacade)(\u0275\u0275inject(Store),\u0275\u0275inject(StorageService))},_BackendComponentBrokerMockFacade.\u0275prov=\u0275\u0275defineInjectable({token:_BackendComponentBrokerMockFacade,factory:_BackendComponentBrokerMockFacade.\u0275fac,providedIn:"root"});let BackendComponentBrokerMockFacade2=_BackendComponentBrokerMockFacade;return BackendComponentBrokerMockFacade2})();var AppCoreModule=(()=>{let _AppCoreModule=class _AppCoreModule{};_AppCoreModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppCoreModule)},_AppCoreModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppCoreModule}),_AppCoreModule.\u0275inj=\u0275\u0275defineInjector({providers:[ObjectStorageAuthorizationLocalService,...__use_api_mocks__?[{provide:HTTP_INTERCEPTORS,useClass:HistoricDataInterceptor,multi:!0},{provide:HTTP_INTERCEPTORS,useClass:DataExportInterceptor,multi:!0},{provide:AgentService,useClass:AgentMockService},{provide:AgentDataTagService,useClass:AgentDataTagMockService},{provide:AgentDataVariableService,useClass:AgentDataVariableMockService},{provide:AgentMembershipService,useClass:AgentMembershipMockService},{provide:AssetService,useClass:AssetMockService},{provide:AssetMembershipService,useClass:AssetMembershipMockService},{provide:AuthTokenService,useClass:AuthTokenMockService},{provide:BackendComponentTemplateConfigService,useClass:BackendComponentConfigMockService},{provide:CompanyService,useClass:CompanyMockService},{provide:CustomPropertyService,useClass:CustomPropertyMockService},{provide:GroupService,useClass:GroupMockService},{provide:GroupTypeService,useClass:GroupTypeMockService},{provide:LicenceService,useClass:LicenceMockService},{provide:LicenceTypeService,useClass:LicenceTypeMockService},{provide:ObjectStorageServiceFactory,useClass:ObjectStorageServiceFactory2},{provide:RoleService,useClass:RoleMockService},{provide:TranslationService,useClass:TranslationMockService},{provide:UserService,useClass:UserMockService},{provide:IxApiService,useClass:IxApiServiceMock}]:[],{provide:BackendComponentCallerServiceFactory,useClass:BackendComponentCallerMockServiceFactory},{provide:BackendComponentBrokerFacade,useClass:BackendComponentBrokerMockFacade},{provide:BrandingService,useClass:BrandingMockService},{provide:PageService,useClass:PageMockService},{provide:PageComponentService,useClass:PageComponentMockService},{provide:PageComponentTemplateService,useClass:PageComponentTemplateMockService},{provide:PageVersionService,useClass:PageVersionMockService},{provide:PagePageService,useClass:PagePageMockService},{provide:PublicFileService,useClass:PublicFileMockService}],imports:[AgentModule,AgentAccessRequestModule,AgentDataSourceModule,AgentDataTagModule,AgentDataVariableModule,AgentMembershipModule,AgentServerModule,AgentTypeModule,AssetAppConfigModule,AssetAppConfigResourceModule,AssetLibraryVersionModule,AssetMembershipModule,AssetModule,AssetTypeModule,AudienceModule,BackendComponentTemplateConfigModule,BrandingModule,CompanyModule,CustomPropertyModule,GroupModule,GroupTypeModule,LicenceModule,LicenceTypeModule,PageModule,PageComponentModule,PageComponentTemplateModule,PageComponentTemplateCategoryModule,PageComponentTemplateManifestModule,PageComponentTemplateVersionModule,PagePageModule,PageVersionModule,PlatformServerModule,RoleModule,SectorModule,TranslationModule,UserModule,UserMembershipModule]});let AppCoreModule2=_AppCoreModule;return AppCoreModule2})();var AppGuard2=(()=>{let _AppGuard=class _AppGuard{constructor(api,store,router,templateValidator){this.api=api,this.store=store,this.router=router,this.templateValidator=templateValidator}canActivate(route){return this.bootstrapIxApi().pipe(switchMap(()=>forkJoin([this.getHostBranding(),this.setComponentUrl(route)]))).pipe(map(()=>!0),take(1))}bootstrapIxApi(){return of(!!this.api.links).pipe(switchMap(discovered=>discovered?of(this.api.links):this.api.discover()),take(1),map(()=>!0))}getHostBranding(){return this.store.select(selectHostLoaded).pipe(tap(loaded=>{loaded||this.store.dispatch(loadHost())}),filter(loaded=>loaded),take(1))}setComponentUrl(route){let templateUrl=route.queryParamMap.get("pct-url");return templateUrl?this.templateValidator.validateByUrl(templateUrl).pipe(mergeMap(errors2=>Object.keys(errors2).length?from(this.router.navigate(["/manifest-invalid"],{replaceUrl:!1,skipLocationChange:!0})):(sessionStorage.setItem("pct-url",templateUrl),from(this.router.navigateByUrl("/"))))):of(!0)}};_AppGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppGuard)(\u0275\u0275inject(IxApiService),\u0275\u0275inject(Store),\u0275\u0275inject(Router),\u0275\u0275inject(ComponentTemplateValidatorService))},_AppGuard.\u0275prov=\u0275\u0275defineInjectable({token:_AppGuard,factory:_AppGuard.\u0275fac});let AppGuard3=_AppGuard;return AppGuard3})();function getPageComponentConfig(template,manifest){return template&&("manifest"in template?template.manifest?.main?template.manifest:template:manifest?.main?manifest:template)}var import_object_hash=__toESM(require_object_hash());function mmToPx(mm){return mm/25.4*96}var COLS=12,COL_WIDTH_REPORT_MM=21.666,COL_WIDTH_REPORT_PX=mmToPx(COL_WIDTH_REPORT_MM),COL_WIDTH_REPORT_LANDSCAPE_MM=24.625,COL_WIDTH_REPORT_LANDSCAPE_PX=mmToPx(COL_WIDTH_REPORT_LANDSCAPE_MM),GUTTER_SIZE_PX=16,GUTTER_SIZE_REPORT_MM=10,GUTTER_SIZE_REPORT_PX=mmToPx(GUTTER_SIZE_REPORT_MM),OUTER_MARGIN_REPORT_MM=15,OUTER_MARGIN_REPORT_PX=mmToPx(OUTER_MARGIN_REPORT_MM);var MAX_ROWS=72;var MIN_ROWS=12,MOBILE_BREAKPOINT_PX=960,MOBILE_ROW_HEIGHT_PX=15,ROW_HEIGHT_PX=45,ROW_HEIGHT_REPORT_MM=7.312,ROW_HEIGHT_REPORT_PX=mmToPx(ROW_HEIGHT_REPORT_MM),ROW_HEIGHT_REPORT_LANDSCAPE_MM=7.272727273,ROW_HEIGHT_REPORT_LANDSCAPE_PX=mmToPx(ROW_HEIGHT_REPORT_LANDSCAPE_MM);function colsToMobileCols(cols){return cols*2}function getMobileCols(component){return component.dimensions?.type==="sheet"?component.dimensions.mobileCols||12-getMobileLeft(component):12}function getMobileLeft(component){return component.dimensions?.type==="sheet"&&component.dimensions.mobileLeft||0}function getMobileRows(component){if(component.dimensions?.type==="sheet"){if(component.dimensions.mobileHeight)return _heightToMobileRows(component.dimensions.mobileHeight);if(component.dimensions.rows)return _heightToMobileRows(component.dimensions.rows*(ROW_HEIGHT_PX+GUTTER_SIZE_PX)-GUTTER_SIZE_PX)}return 1}function getMobileTop(component,before){let colTops=range_default(0,12).map(()=>0);before.forEach(c=>{let l2=getMobileLeft(c),colIndexes=range_default(l2,l2+getMobileCols(c)),maxTop=Math.max(...colIndexes.map(i=>colTops[i]));colIndexes.forEach(i=>colTops[i]=maxTop+getMobileRows(c))});let left2=getMobileLeft(component);return Math.max(...colTops.slice(left2,left2+getMobileCols(component)))}function mobileRowsToHeight(mobileRows){return mobileRows>1?mobileRows*(MOBILE_ROW_HEIGHT_PX+GUTTER_SIZE_PX)-GUTTER_SIZE_PX:MOBILE_ROW_HEIGHT_PX}function rowsToMobileRows(rows){return _heightToMobileRows(rowsToHeight(rows))}function _heightToMobileRows(height){return height>MOBILE_ROW_HEIGHT_PX?Math.ceil((height+GUTTER_SIZE_PX)/(MOBILE_ROW_HEIGHT_PX+GUTTER_SIZE_PX)):1}function rowsToHeight(rows){return rows>1?rows*(ROW_HEIGHT_PX+GUTTER_SIZE_PX)-GUTTER_SIZE_PX:ROW_HEIGHT_PX}function getMobileGridsterItems(components,templates,manifests){return sortBy_default(components.filter(component=>component.dimensions?.type==="sheet"),["dimensions.mobileOrder","dimensions.top","dimensions.left"]).map((component,i,sheetComponents)=>{let template=component.template?.publicId?templates[component.template.publicId]:void 0,manifest=_getManifestByTemplateId(manifests,component.template?.publicId),sheetSettings=manifest?.sheetSettings||template?.sheetSettings;return{get pageComponent(){return __spreadProps(__spreadValues({},component),{dimensions:__spreadProps(__spreadValues({},component.dimensions),{type:"sheet",mobileCols:this.cols,mobileHeight:mobileRowsToHeight(this.rows),mobileLeft:this.x})})},x:getMobileLeft(component),y:getMobileTop(component,sheetComponents.slice(0,i)),rows:getMobileRows(component),cols:getMobileCols(component),minItemCols:itemHasValidMobileMinCols(component,template,manifest)?colsToMobileCols(sheetSettings&&sheetSettings?.minCols>6?6:sheetSettings?.minCols||1):1,minItemRows:itemHasValidMobileMinRows(component,template,manifest)?rowsToMobileRows(sheetSettings?.minRows||1):1}})}function getGridsterItems(components,templates,manifests,applicationType){return components.filter(component=>component.dimensions?.type===applicationType).map(component=>{let dims=component.dimensions,template=component.template?.publicId?templates[component.template.publicId]:void 0,manifest=_getManifestByTemplateId(manifests,component.template?.publicId),settings=_getSheetOrReportSettings(applicationType,template,manifest);return{get pageComponent(){return __spreadProps(__spreadValues({},component),{dimensions:__spreadProps(__spreadValues({},component.dimensions),{type:applicationType,cols:this.cols,left:this.x,rows:this.rows,top:this.y})})},x:dims.left??0,y:dims.top??0,rows:dims.rows??1,cols:dims.cols??1,minItemCols:_getItemProperty("minCols",component,template,manifest,settings),minItemRows:_getItemProperty("minRows",component,template,manifest,settings)}})}function _getItemProperty(dimension,component,template,manifest,settings){return itemHasValidMinCols(component,template,manifest)&&settings&&dimension in settings&&settings[dimension]||1}function _getSheetOrReportSettings(applicationType,template,manifest){switch(applicationType){case"sheet":return getPageComponentConfig(template,manifest)?.sheetSettings;case"report":return manifest?.reportSettings}}function _getManifestByTemplateId(manifests,templateId){return Object.keys(manifests).map(id=>manifests[id]).find(manifest=>manifest?.template.publicId===templateId)}function validateDimensions(dimensions,template,manifest){if(dimensions.type==="card"){let minHeight=itemHasValid("min","height",dimensions,template,manifest),maxHeight=itemHasValid("max","height",dimensions,template,manifest);return{valid:minHeight&&maxHeight,height:minHeight&&maxHeight,min:minHeight,max:maxHeight,minHeight,maxHeight}}else if(dimensions.type==="report"||dimensions.type==="sheet"){let minRows=itemHasValid("min","rows",dimensions,template,manifest),minCols=itemHasValid("min","cols",dimensions,template,manifest),maxRows=itemHasValid("max","rows",dimensions,template,manifest),maxCols=itemHasValid("max","cols",dimensions,template,manifest);return{valid:minRows&&maxRows&&minCols&&maxCols,rows:minRows&&maxRows,cols:minCols&&maxCols,min:minCols&&minRows,max:maxCols&&maxRows,minRows,minCols,maxRows,maxCols}}return{valid:!1}}function itemHasValid(minMax,field,dimensions,template,manifest){let minMaxField=`${minMax}${capitalize_default(field)}`,unsupportedFieldError=()=>new Error(`Unsupported field '${field}' for type '${dimensions?.type}'`);switch(dimensions?.type){case"card":{let resolved=resolveCardSettings(template,manifest);if(field!=="height")throw unsupportedFieldError();return minMax==="min"?(dimensions?.[field]||1)>=resolved[minMaxField]:resolved[minMaxField]?(dimensions?.[field]||1)<=resolved[minMaxField]:!0}case"sheet":{let resolved=resolveSheetSettings(template,manifest);if(field==="height")throw unsupportedFieldError();return minMax==="min"?(dimensions?.[field]||1)>=resolved[minMaxField]:resolved[minMaxField]?(dimensions?.[field]||1)<=resolved[minMaxField]:!0}case"report":{let resolved=resolveReportSettings(manifest);if(field==="height")throw unsupportedFieldError();return minMax==="min"?(dimensions?.[field]||1)>=resolved[minMaxField]:resolved[minMaxField]?(dimensions?.[field]||1)<=resolved[minMaxField]:!0}default:throw new Error(`Invalid dimension type: ${dimensions?.type}`)}}function itemHasValidMinCols(item,template,manifest){return(item.dimensions?.cols||1)>=_getMinCols(template,manifest)}function itemHasValidMobileMinRows(item,template,manifest){return getMobileRows(item)>=rowsToMobileRows(_getMinRows(template,manifest))}function itemHasValidMobileMinCols(item,template,manifest){return getMobileCols(item)>=colsToMobileCols(_getMinCols(template,manifest))}function reduceComponentChanges(changes,gridItems,isMobile){let _changes=changes.reduceRight((acc,curr)=>acc.find(c=>c.publicId===curr.publicId)?acc:[...acc,curr],[]);return isMobile?sortBy_default(gridItems,["y","x"]).reduce((mobileOrderChanges,item,index)=>{let mobileOrder=(index+1)*10,found=_changes.find(change=>change.publicId===item.pageComponent.publicId);if(found){let change=__spreadProps(__spreadValues({},found),{dimensions:__spreadProps(__spreadValues({},found.dimensions),{type:"sheet",mobileOrder})});return[...mobileOrderChanges,change]}if(item.pageComponent.dimensions?.type==="sheet"&&item.pageComponent.dimensions.mobileOrder!==mobileOrder){let change=__spreadProps(__spreadValues({},item.pageComponent),{dimensions:__spreadProps(__spreadValues({},item.pageComponent.dimensions),{type:"sheet",mobileOrder})});return[...mobileOrderChanges,change]}return mobileOrderChanges},[]):_changes}function _getMinCols(template,manifest){let minCols=getPageComponentConfig(template,manifest)?.sheetSettings?.minCols;return minCols&&minCols>=6?6:minCols??1}function _getMinRows(template,manifest){return getPageComponentConfig(template,manifest)?.sheetSettings?.minRows||1}function resolveTemplateSettings(dimensions,template,manifest){switch(dimensions.type){case"card":return resolveCardSettings(template,manifest);case"report":return resolveReportSettings(manifest);case"sheet":return resolveSheetSettings(template,manifest);default:throw new Error(`unsupported dimension type: ${dimensions.type}`)}}function resolveCardSettings(template,manifest){let cardSettings=getPageComponentConfig(template,manifest)?.cardSettings;return{defaultHeight:cardSettings?.defaultHeight||null,maxHeight:cardSettings?.maxHeight||null,minHeight:cardSettings?.minHeight||1}}function resolveReportSettings(manifest){return{defaultCols:manifest?.reportSettings?.defaultCols||null,defaultRows:manifest?.reportSettings?.defaultRows||null,maxCols:manifest?.reportSettings?.maxCols||null,maxRows:manifest?.reportSettings?.maxRows||null,minCols:manifest?.reportSettings?.minCols||1,minRows:manifest?.reportSettings?.minRows||1}}function resolveSheetSettings(template,manifest){let sheetSettings=getPageComponentConfig(template,manifest)?.sheetSettings;return{defaultCols:sheetSettings?.defaultCols||1,defaultRows:sheetSettings?.defaultRows||1,maxCols:sheetSettings?.maxCols||null,maxRows:sheetSettings?.maxRows||null,minCols:sheetSettings?.minCols||1,minRows:sheetSettings?.minRows||1}}var ComponentTemplatesFacade=(()=>{let _ComponentTemplatesFacade=class _ComponentTemplatesFacade{constructor(store){this.store=store,this.manifests$=this.store.select(selectEntities2),this.templates$=combineLatest([this.store.select(selectAll),this.store.select(selectEntities2)]).pipe(map(([templates,manifests])=>templates.map(t=>manifests[t.publicId]?__spreadProps(__spreadValues({},t),{manifest:manifests[t.publicId]}):t)),tap(templates=>{let templatesWithoutManifest=templates.filter(template=>template.configuredVersion&&!("manifest"in template));templatesWithoutManifest.length&&this.store.dispatch(ensureMany({templates:templatesWithoutManifest}))}))}};_ComponentTemplatesFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentTemplatesFacade)(\u0275\u0275inject(Store))},_ComponentTemplatesFacade.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentTemplatesFacade,factory:_ComponentTemplatesFacade.\u0275fac,providedIn:"root"});let ComponentTemplatesFacade2=_ComponentTemplatesFacade;return ComponentTemplatesFacade2})();var ComponentGridFacade=(()=>{let _ComponentGridFacade=class _ComponentGridFacade{constructor(store,facade){this.store=store,this.facade=facade,this.templates$=this.facade.templates$,this.manifests$=this.facade.manifests$,this.templateEntities$=this.store.select(selectEntities)}pageComponents(pageVersionId,pagePageId=null){return combineLatest([this.store.select(selectEntity10(pageVersionId)).pipe(mergeMap(pageVersion=>pageVersion?.components?of(pageVersion.components):EMPTY),distinctUntilChanged(isEqual_default)),this.store.select(selectEntities33),this.store.select(selectEntities)]).pipe(mergeMap(([components,componentEntities,templateEntities])=>{let pageComponents=components.map(c=>componentEntities[c.publicId]||c).filter(c=>c.dimensions?.type!=="report"||(pagePageId?c.pagePage?.publicId===pagePageId:!0));return pageComponents.every(c=>c.template===null||c.template&&templateEntities[c.template.publicId]?.url)?of(pageComponents):EMPTY}))}};_ComponentGridFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentGridFacade)(\u0275\u0275inject(Store),\u0275\u0275inject(ComponentTemplatesFacade))},_ComponentGridFacade.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentGridFacade,factory:_ComponentGridFacade.\u0275fac,providedIn:"root"});let ComponentGridFacade2=_ComponentGridFacade;return ComponentGridFacade2})();var ComponentGridFocusService=(()=>{let _ComponentGridFocusService=class _ComponentGridFocusService extends Subject{};_ComponentGridFocusService.\u0275fac=(()=>{let \u0275ComponentGridFocusService_BaseFactory;return function(__ngFactoryType__){return(\u0275ComponentGridFocusService_BaseFactory||(\u0275ComponentGridFocusService_BaseFactory=\u0275\u0275getInheritedFactory(_ComponentGridFocusService)))(__ngFactoryType__||_ComponentGridFocusService)}})(),_ComponentGridFocusService.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentGridFocusService,factory:_ComponentGridFocusService.\u0275fac,providedIn:"root"});let ComponentGridFocusService2=_ComponentGridFocusService;return ComponentGridFocusService2})();function InvalidComponentPlaceholderComponent_Conditional_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span"),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r0.errorSubText)}}var InvalidComponentPlaceholderComponent=(()=>{let _InvalidComponentPlaceholderComponent=class _InvalidComponentPlaceholderComponent{constructor(){this.svgIcon="no_plugin"}};_InvalidComponentPlaceholderComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_InvalidComponentPlaceholderComponent)},_InvalidComponentPlaceholderComponent.\u0275cmp=\u0275\u0275defineComponent({type:_InvalidComponentPlaceholderComponent,selectors:[["ix-invalid-component-placeholder"]],inputs:{errorSubText:"errorSubText",errorText:"errorText",svgIcon:"svgIcon"},decls:5,vars:3,consts:[["fxLayout","column","fxLayoutAlign","center center",1,"placeholder"],[3,"svgIcon"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275element(1,"mat-icon",1),\u0275\u0275elementStart(2,"span"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275template(4,InvalidComponentPlaceholderComponent_Conditional_4_Template,2,1,"span"),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275advance(),\u0275\u0275property("svgIcon",ctx.svgIcon),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx.errorText),\u0275\u0275advance(),\u0275\u0275conditional(ctx.errorSubText?4:-1))},dependencies:[FlexLayoutModule,DefaultLayoutDirective,DefaultLayoutAlignDirective,MatIconModule,MatIcon],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%]{display:block;width:100%;height:100%;background:#d8d8d8}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{fill:#fff;font-size:32px;width:32px;height:32px}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#00000080;word-break:break-all;text-align:center;font-size:14px;line-height:20px;display:none;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%]:hover{background:#ebebeb;transition:background .2s ease-out}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%]:hover .mat-icon[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%]{display:block}"],changeDetection:0});let InvalidComponentPlaceholderComponent2=_InvalidComponentPlaceholderComponent;return InvalidComponentPlaceholderComponent2})();function ComponentGridComponent_gridster_item_2_Conditional_1_Conditional_0_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",4),rf&2){let item_r2=\u0275\u0275nextContext(2).$implicit;\u0275\u0275property("component",item_r2.pageComponent)}}function ComponentGridComponent_gridster_item_2_Conditional_1_Conditional_1_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-invalid-component-placeholder",5),rf&2){let item_r2=\u0275\u0275nextContext(2).$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275property("errorText",ctx_r2.getPlaceHolderErrorText(item_r2.pageComponent))("errorSubText",ctx_r2.getPlaceHolderErrorSubText(item_r2.pageComponent))("svgIcon",item_r2.pageComponent.template?"aspect_ratio":"no_plugin")}}function ComponentGridComponent_gridster_item_2_Conditional_1_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,ComponentGridComponent_gridster_item_2_Conditional_1_Conditional_0_Template,1,1,"ix-component-loader",4)(1,ComponentGridComponent_gridster_item_2_Conditional_1_Conditional_1_Template,1,3,"ix-invalid-component-placeholder",5),rf&2){let item_r2=\u0275\u0275nextContext().$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275conditional(ctx_r2.itemHasValidDimensionsAndTemplate(item_r2.pageComponent)?0:1)}}function ComponentGridComponent_gridster_item_2_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"gridster-item",3),\u0275\u0275listener("contextmenu",function($event){let item_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemContextMenu($event,item_r2))})("mousedown",function($event){let item_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemClick($event,item_r2))}),\u0275\u0275template(1,ComponentGridComponent_gridster_item_2_Conditional_1_Template,2,1),\u0275\u0275elementEnd()}if(rf&2){let item_r2=ctx.$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275classProp("selected",ctx_r2.isSelectedItem(item_r2)),\u0275\u0275property("item",item_r2),\u0275\u0275advance(),\u0275\u0275conditional(item_r2?1:-1)}}var ComponentGridComponent=(()=>{let _ComponentGridComponent=class _ComponentGridComponent{set pagePageId(pagePageId){this.pagePageId$.next(pagePageId)}set pageVersionId(pageVersionId){this.pageVersionId$.next(pageVersionId)}constructor(cdRef,facade,translate,focusService){this.cdRef=cdRef,this.facade=facade,this.translate=translate,this.focusService=focusService,this.orientation="portrait",this.applicationType="sheet",this.componentChanges=new EventEmitter,this.componentMobileReorder=new EventEmitter,this.componentContextMenu=new EventEmitter,this.gridContextMenu=new EventEmitter,this.selectionChange=new EventEmitter,this.movingGridItem=new EventEmitter,this.gridItems=[],this.ready=!1,this.agentOrAssetId$=new ReplaySubject(1),this.componentChange$=new Subject,this.gridInteraction$=new Subject,this.mobile$=new ReplaySubject(1),this.pagePageId$=new BehaviorSubject(null),this.pageVersionId$=new ReplaySubject(1),this.destroy=inject(DestroyRef)}ngOnInit(){this.focusService.pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>this.select(null)),this.options=this.getGridsterOptions(this.orientation),combineLatest([this.mobile$.pipe(distinctUntilChanged()),this.agentOrAssetId$.pipe(distinctUntilChanged()),combineLatest([this.pageVersionId$,this.pagePageId$]).pipe(switchMap(([pageVersionId,pagePageId])=>this.facade.pageComponents(pageVersionId,pagePageId)),debounceTime(100),distinctUntilChanged(isEqual_default),mergeMap(components=>{let props2=["dimensions.top","dimensions.left","dimensions.cols","dimensions.rows","dimensions.mobileOrder","dimensions.mobileLeft","dimensions.mobileCols","dimensions.mobileHeight","inputs","publicId"],curr=this.gridster?.grid.map(component=>pick_default(component.item.pageComponent,props2)),next=components.map(component=>pick_default(component,props2));return isEqual_default(sortBy_default(curr,"publicId"),sortBy_default(next,"publicId"))?EMPTY:of(cloneDeep_default(components))})),this.facade.templateEntities$,this.facade.manifests$]).pipe(withLatestFrom(combineLatest([this.pageVersionId$,this.pagePageId$]).pipe(switchMap(([pageVersionId,pagePageId])=>this.facade.pageComponents(pageVersionId,pagePageId)))),map(([[mobile,_,__,templates,manifests],components])=>mobile?getMobileGridsterItems(components,templates,manifests):getGridsterItems(components,templates,manifests,this.applicationType)),takeUntilDestroyed(this.destroy)).subscribe(items=>{this.gridItems=items,this.cdRef.markForCheck()}),this.componentChange$.pipe(bufferDebounceTime(100),map(changes=>reduceComponentChanges(changes,this.gridItems,this.mobile)),takeUntilDestroyed(this.destroy)).subscribe(changes=>{this.componentChanges.emit(changes)}),this.facade.templates$.pipe(takeUntilDestroyed(this.destroy)).subscribe(templates=>{this.templates=templates}),this.facade.manifests$.pipe(takeUntilDestroyed(this.destroy)).subscribe(manifests=>{this.manifests=manifests}),this.gridInteraction$.pipe(distinctUntilChanged(),switchMap(({type,value})=>type==="drag"&&value?of(!0).pipe(delay(250)):of(value)),takeUntilDestroyed(this.destroy)).subscribe(interaction=>this.movingGridItem.emit(interaction))}ngOnChanges(changes){changes.agentOrAssetId&&this.agentOrAssetId$.next(this.agentOrAssetId),changes.mobile&&(this.mobile$.next(this.mobile),this.options=this.getGridsterOptions()),changes.orientation&&(this.options=this.getGridsterOptions(this.orientation),this.componentResize())}ngAfterViewInit(){this.componentResize()}componentResize(){setTimeout(()=>{this.gridster?.options.api?.resize?.(),setTimeout(()=>{this.ready=!0,this.cdRef.markForCheck()},150)})}checkCollision(item){return!!this.gridster.checkCollision(item)}getFirstPossiblePosition(item){if(this.options?.api?.getFirstPossiblePosition&&this.options.api.getNextPossiblePosition){if(this.options.api.getNextPossiblePosition(item))return this.options.api.getFirstPossiblePosition(item);if(this.applicationType==="report")return}let y=this.gridItems.reduce((acc,item2)=>Math.max(acc,item2.y+item2.rows),0);if(y+item.rows<=MAX_ROWS)return __spreadProps(__spreadValues({},item),{x:0,y})}handleItemClick(event2,item){event2.stopPropagation(),this.select(item.pageComponent.publicId)}handleItemContextMenu(event2,item){event2.stopPropagation(),this.componentContextMenu.emit({component:item.pageComponent,event:event2})}handleItemDragStart(){this._patchGridster(),this.gridInteraction$.next({type:"drag",value:!0})}handleItemDragStop(){this.gridInteraction$.next({type:"drag",value:!1})}handleItemResizeStart(){this.gridInteraction$.next({type:"resize",value:!0})}handleItemResizeStop(){this.gridInteraction$.next({type:"resize",value:!1})}select(componentId){this.selectionChange.emit(componentId)}isSelectedItem(item){return this.selectedComponentId===item.pageComponent.publicId}getGridsterOptions(orientation=null){return this.applicationType==="report"?__spreadValues({displayGrid:"always",draggable:{enabled:!0,start:()=>this.handleItemDragStart(),stop:()=>this.handleItemDragStop()},gridType:"fixed",fixedColWidth:orientation==="landscape"?COL_WIDTH_REPORT_LANDSCAPE_PX:COL_WIDTH_REPORT_PX,fixedRowHeight:orientation==="landscape"?ROW_HEIGHT_REPORT_LANDSCAPE_PX:ROW_HEIGHT_REPORT_PX,itemChangeCallback:item=>{this.componentChange$.next(item.pageComponent)},setGridSize:!0,margin:GUTTER_SIZE_REPORT_PX,mobileBreakpoint:0,outerMargin:!0,outerMarginTop:OUTER_MARGIN_REPORT_PX,outerMarginRight:OUTER_MARGIN_REPORT_PX,outerMarginBottom:OUTER_MARGIN_REPORT_PX,outerMarginLeft:OUTER_MARGIN_REPORT_PX,resizable:{enabled:!0,start:()=>this.handleItemResizeStart(),stop:()=>this.handleItemResizeStop()},scrollToNewItems:!0,pushDirections:{north:!1,east:!1,south:this.mobile,west:!1},pushItems:this.mobile},orientation==="landscape"?{maxCols:8,maxRows:11,minCols:8,minRows:11}:{maxCols:6,maxRows:16,minCols:6,minRows:16}):{addEmptyRowsCount:this.mobile?8:0,disableScrollHorizontal:!0,displayGrid:"always",draggable:{enabled:!0,start:()=>this.handleItemDragStart(),stop:()=>this.handleItemDragStop()},fixedRowHeight:this.mobile?MOBILE_ROW_HEIGHT_PX:ROW_HEIGHT_PX,gridType:"verticalFixed",itemChangeCallback:item=>{this.componentChange$.next(item.pageComponent)},margin:GUTTER_SIZE_PX,maxCols:COLS,maxRows:this.mobile?1e3:MAX_ROWS,minCols:COLS,minRows:this.mobile?1:MIN_ROWS,maxItemRows:this.mobile?100:50,compactType:this.mobile?"compactUp":void 0,mobileBreakpoint:0,outerMargin:!0,resizable:{enabled:!0,start:()=>this.handleItemResizeStart(),stop:()=>this.handleItemResizeStop()},scrollToNewItems:!0,pushDirections:{north:!1,east:!1,south:this.mobile,west:!1},pushItems:this.mobile,scrollSensitivity:40}}itemHasValidDimensionsAndTemplate(item,template,manifest){return!template&&(template=this.getTemplate(item),!template)?!1:(manifest||(manifest=this.getManifest(template)),this.mobile?itemHasValidMobileMinRows(item,template,manifest)&&itemHasValidMobileMinCols(item,template,manifest):item.dimensions?validateDimensions(item.dimensions,template,manifest).valid:!1)}getPlaceHolderErrorText(item){return this.getTemplate(item)?this.translate.instant("__MESSAGE__.INVALID_COMPONENT_SIZE"):this.translate.instant("SOMETHING_WENT_WRONG")}getPlaceHolderErrorSubText(item){if(!this.getTemplate(item))return this.translate.instant("COMPONENT_FAILED_TO_LOAD");if(this.mobile){let validDimensions=this.getValidDimensions(item,this.mobile),columns=validDimensions.cols,rows=validDimensions.rows;return`Resize to >= ${columns} x ${rows}`}let template=this.getTemplate(item),manifest=this.getManifest(template);if(item.dimensions){let validation=validateDimensions(item.dimensions,template,manifest),settings=resolveTemplateSettings(item.dimensions,template,manifest);return this._getPlaceHolderErrorSubText(validation,settings)}}_getPlaceHolderErrorSubText(validation,settings){let errors2=[];return validation.minCols||errors2.push(this.translate.instant("__MESSAGE__.COMPONENT_SIZE_COL_GE",{minCols:settings.minCols})),validation.maxCols||errors2.push(this.translate.instant("__MESSAGE__.COMPONENT_SIZE_COL_LE",{maxCols:settings.maxCols})),validation.minRows||errors2.push(this.translate.instant("__MESSAGE__.COMPONENT_SIZE_ROW_GE",{minRows:settings.minRows})),validation.maxRows||errors2.push(this.translate.instant("__MESSAGE__.COMPONENT_SIZE_ROW_LE",{maxRows:settings.maxRows})),errors2.join(". ")}selectUniqueHash(_index,item){return(0,import_object_hash.default)({agentOrAssetId:this.agentOrAssetId,component:pick_default(item.pageComponent,["inputs","publicId"])})}getTemplate(component){return this.templates?.find(template=>template.publicId===component.template?.publicId)}getManifest(template){return template?this.manifests?.[template.publicId]:void 0}getValidDimensions(item,isMobile){let template=this.getTemplate(item),manifest=this.getManifest(template),sheetSettings=getPageComponentConfig(template,manifest)?.sheetSettings,rows=sheetSettings?.minRows||1,cols=sheetSettings?.minCols||1;return{rows:isMobile?rowsToMobileRows(rows):rows,cols:isMobile?colsToMobileCols(cols):cols}}_patchGridster(){if(this.gridster){let _ogGrid=this.gridster?.grid;this.gridster.grid=_ogGrid?.map(gridsterItem=>{if(gridsterItem&&!gridsterItem.__patched){let _ogDrag=gridsterItem.drag,_ogDragMove=_ogDrag.dragMove,_ogDragStop=_ogDrag.dragStop;gridsterItem.drag.dragMove=(...args)=>{try{_ogDragMove.apply(_ogDrag,args)}catch(error2){if(error2.name==="TypeError"&&error2.message.includes("(reading 'options')"))console.error(error2);else throw error2}},gridsterItem.drag.dragStop=(...args)=>{try{_ogDragStop.apply(_ogDrag,args)}catch(error2){if(error2.name==="TypeError"&&error2.message.includes("(reading 'renderer')"))console.error(error2),this.gridster.el.querySelector(".gridster-preview")?.removeAttribute("style");else throw error2}},gridsterItem.__patched=!0}return gridsterItem})}}};_ComponentGridComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentGridComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ComponentGridFacade),\u0275\u0275directiveInject(TranslateService),\u0275\u0275directiveInject(ComponentGridFocusService))},_ComponentGridComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ComponentGridComponent,selectors:[["ix-component-grid"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(GridsterComponent,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.gridster=_t.first)}},inputs:{agentOrAssetId:"agentOrAssetId",pagePageId:"pagePageId",pageVersionId:"pageVersionId",orientation:"orientation",mobile:"mobile",applicationType:"applicationType",selectedComponentId:"selectedComponentId"},outputs:{componentChanges:"componentChanges",componentMobileReorder:"componentMobileReorder",componentContextMenu:"componentContextMenu",gridContextMenu:"gridContextMenu",selectionChange:"selectionChange",movingGridItem:"movingGridItem"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:3,vars:7,consts:[[1,"canvas",3,"contextmenu"],[3,"options"],["class","item",3,"item","selected","contextmenu","mousedown",4,"ngFor","ngForOf","ngForTrackBy"],[1,"item",3,"contextmenu","mousedown","item"],[3,"component"],[3,"errorText","errorSubText","svgIcon"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275listener("contextmenu",function($event){return ctx.gridContextMenu.emit({event:$event})}),\u0275\u0275elementStart(1,"gridster",1),\u0275\u0275template(2,ComponentGridComponent_gridster_item_2_Template,2,4,"gridster-item",2),\u0275\u0275elementEnd()()),rf&2&&(\u0275\u0275classProp("mobile",ctx.mobile),\u0275\u0275advance(),\u0275\u0275classProp("ready",ctx.ready),\u0275\u0275property("options",ctx.options),\u0275\u0275advance(),\u0275\u0275property("ngForOf",ctx.gridItems)("ngForTrackBy",ctx.selectUniqueHash.bind(ctx)))},dependencies:[GridsterComponent,GridsterItemComponent,NgForOf,ComponentLoaderComponent,InvalidComponentPlaceholderComponent],styles:['[_nghost-%COMP%]{--card-bg: #fff;--card-border-color: rgb(0 0 0 / 12%);--card-border-width: 1px;--card-color: rgb(0 0 0 / 87%);--card-color-scheme: "light";display:block;height:100%;width:100%;overflow:hidden}[_nghost-%COMP%] .canvas[_ngcontent-%COMP%]{height:100%;width:100%}[_nghost-%COMP%] .item[_ngcontent-%COMP%]{background-color:var(--card-bg);border:var(--card-border-width) solid var(--card-border-color);color:var(--card-color);color-scheme:var(--card-color-scheme);box-shadow:0 1px 2px #0000001f;border-radius:8px!important;overflow:hidden}[_nghost-%COMP%] .item.selected[_ngcontent-%COMP%]{z-index:2!important;border-color:var(--mat-sys-primary);border-width:1px}[_nghost-%COMP%] .item.selected[_ngcontent-%COMP%]:last-child{margin-bottom:40px}[_nghost-%COMP%] .canvas[_ngcontent-%COMP%]:not(.mobile) gridster[_ngcontent-%COMP%] >div:nth-child(84)~div{visibility:hidden}[_nghost-%COMP%] gridster[_ngcontent-%COMP%]{background-color:transparent}[_nghost-%COMP%] gridster[_ngcontent-%COMP%]:not(.ready){visibility:hidden}[_nghost-%COMP%] gridster[_ngcontent-%COMP%]:not(.ready) .gridster-column, [_nghost-%COMP%] gridster[_ngcontent-%COMP%]:not(.ready) .gridster-row{transition:none!important}[_nghost-%COMP%] gridster[_ngcontent-%COMP%] .gridster-column, [_nghost-%COMP%] gridster[_ngcontent-%COMP%] .gridster-row{border-color:#00000014}[_nghost-%COMP%] gridster[_ngcontent-%COMP%] .gridster-column:after{content:" ";display:block;width:100%;height:calc(100% + 16px)}[_nghost-%COMP%] gridster[_ngcontent-%COMP%] .gridster-row{width:calc(100% - 32px)!important}[_nghost-%COMP%] gridster[_ngcontent-%COMP%] >div:last-of-type{border-bottom-color:#00000014!important}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%]{transition-property:transform!important}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .placeholder[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:100%}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .placeholder[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{padding:8px}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-nw, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-sw, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-ne, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-se{box-sizing:border-box;width:10px;height:10px;border:1px solid var(--primary);background-color:var(--body-bg)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-ne{transform:translate(5px,-5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-nw{transform:translate(-5px,-5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-se{transform:translate(5px,5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-sw{transform:translate(-5px,5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-n:after, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-e:after, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-s:after, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-w:after{content:"";display:block;position:absolute;box-sizing:border-box;width:10px;height:10px;border:1px solid var(--primary);background-color:var(--body-bg)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-n:after{left:50%;transform:translate(-5px,-5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-e:after{top:50%;transform:translate(5px,-5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-s:after{left:50%;transform:translate(-5px,5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-w:after{top:50%;transform:translate(-5px,-5px)}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-ne, [_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-sw{cursor:nesw-resize}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-nw, [_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-se{cursor:nwse-resize}.resize-handle[_ngcontent-%COMP%]{height:10px;width:100%;position:absolute;inset:auto 0 -6px;cursor:ns-resize}.resize-handle[_ngcontent-%COMP%]:after{content:"";display:block;box-sizing:border-box;height:10px;width:10px;position:absolute;bottom:0;left:calc(50% - 5px);background-color:var(--basic);border:1px solid var(--primary)}.height-badge-container[_ngcontent-%COMP%]{position:absolute;inset:auto 0 -26px;z-index:10;display:flex;flex-direction:row;place-content:center;pointer-events:none}.height-badge-container[_ngcontent-%COMP%] .height-badge[_ngcontent-%COMP%]{display:inline-block;margin:0 auto;padding:2px 6px;border-radius:3px;background:var(--ix-blue);font-size:11px;list-style:1;color:#fff;-webkit-user-select:none;user-select:none}.list.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.list-item-placeholder[_ngcontent-%COMP%]{box-sizing:border-box;background-color:rgba(var(--body-color-rgb),.04);border:1px dashed rgba(var(--body-color-rgb),.12);border-radius:8px}.preview[_ngcontent-%COMP%]{box-sizing:border-box;width:340px!important;max-width:calc(100vw - 32px);background-color:#fff;border-radius:8px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}']});let ComponentGridComponent3=_ComponentGridComponent;return ComponentGridComponent3})();var AppearSchedulerDirective=(()=>{let _AppearSchedulerDirective=class _AppearSchedulerDirective{constructor(){this.cdRef=inject(ChangeDetectorRef),this.scheduler=new Subject,this.destroy=inject(DestroyRef)}ngOnInit(){this.scheduler.pipe(debounceTime(0),takeUntilDestroyed(this.destroy)).subscribe(()=>{this.cdRef.markForCheck()})}ngOnDestroy(){this.scheduler.complete()}schedule(){this.scheduler.next()}};_AppearSchedulerDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppearSchedulerDirective)},_AppearSchedulerDirective.\u0275dir=\u0275\u0275defineDirective({type:_AppearSchedulerDirective,selectors:[["","ixAppearScheduler",""]]});let AppearSchedulerDirective3=_AppearSchedulerDirective;return AppearSchedulerDirective3})();var AppearDirective=(()=>{let _AppearDirective=class _AppearDirective{constructor(cdRef,elementRef){this.cdRef=cdRef,this.elementRef=elementRef,this.disabled=!1,this.appeared=!1,this.scheduler=inject(AppearSchedulerDirective,{optional:!0,skipSelf:!0,host:!0})}ngOnInit(){this.run()}ngOnChanges(changes){changes.disabled&&this.run()}ngOnDestroy(){this.stop()}run(){this.disabled?this.stop():this.start()}start(){this.observer||(this.observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{(entry.isIntersecting||entry.intersectionRatio>0)&&(this.stop(),this.appeared=!0)}),this.appeared&&(this.scheduler?this.scheduler.schedule():this.cdRef.markForCheck())},{rootMargin:"50% 0px",threshold:0}),this.observer.observe(this.elementRef.nativeElement))}stop(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}};_AppearDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppearDirective)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ElementRef))},_AppearDirective.\u0275dir=\u0275\u0275defineDirective({type:_AppearDirective,selectors:[["","ixAppear",""]],inputs:{disabled:[0,"ixAppearDisabled","disabled"]},exportAs:["ixAppear"],features:[\u0275\u0275NgOnChangesFeature]});let AppearDirective3=_AppearDirective;return AppearDirective3})();var import_object_hash2=__toESM(require_object_hash());function resizeComponent(component,template,manifest,origin,destination){if(origin){let height=calcNewComponentHeight(component,template,manifest,origin,destination),dimensions=__spreadProps(__spreadValues({},component.dimensions),{height});return __spreadProps(__spreadValues({},component),{dimensions})}return component}function calcNewComponentHeight(component,template,manifest,origin,destination){if(origin){let componentConfig=getPageComponentConfig(template,manifest),height=component.dimensions?.type==="card"?component.dimensions.height??0:0,offset3=destination.clientY-origin.clientY;return height=height+offset3>=0?height+offset3:0,typeof componentConfig?.cardSettings?.minHeight=="number"&&(height=Math.max(componentConfig.cardSettings.minHeight,height)),typeof componentConfig?.cardSettings?.maxHeight=="number"&&(height=Math.min(componentConfig.cardSettings.maxHeight,height)),height}return component.dimensions?.type==="card"?component.dimensions.height??0:0}function calcTotalCardHeight(components){return components.reduce((accHeight,component)=>accHeight+(component.dimensions?.type==="card"&&component.dimensions.height||0),0)}function calcTotalCardGridHeight(components){return components.map(c=>c.dimensions).reduce((acc,dim,i)=>dim?.type==="card"?acc+(dim.height??0)+(i>0?GUTTER_SIZE_PX:0):acc,0)}function generateCardGridItems(components){return sortBy_default(components,["dimensions.order"]).map((component,i)=>{let dims=component.dimensions,height=dims?.type==="card"?`${dims.height}px`:"auto";return{component,styles:{height,maxHeight:height,width:"100%",marginBottom:i===components.length-1?"0px":`${GUTTER_SIZE_PX}px`}}})}var _c011=a0=>({n:a0});function CardComponentGridComponent_div_2_Conditional_1_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",5),rf&2){let item_r2=\u0275\u0275nextContext().$implicit;\u0275\u0275property("component",item_r2.component)}}function CardComponentGridComponent_div_2_Conditional_2_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-invalid-component-placeholder",6),rf&2){let item_r2=\u0275\u0275nextContext().$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275property("errorText",ctx_r2.getPlaceHolderErrorText(item_r2.component))("errorSubText",ctx_r2.getPlaceHolderErrorSubText(item_r2.component))("svgIcon",item_r2.component.template?"aspect_ratio":"no_plugin")}}function CardComponentGridComponent_div_2_div_3_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"div",12),rf&2){let item_r2=\u0275\u0275nextContext().$implicit;\u0275\u0275styleMap(item_r2.styles)}}function CardComponentGridComponent_div_2_div_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",13),\u0275\u0275element(1,"div",14),\u0275\u0275elementEnd()),rf&2){let item_r2=\u0275\u0275nextContext().$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275styleMap(ctx_r2.getPreviewStyles(item_r2.styles))}}function CardComponentGridComponent_div_2_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",4),\u0275\u0275listener("contextmenu",function($event){let item_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemContextMenu($event,item_r2))})("mousedown",function($event){let item_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemClick($event,item_r2))}),\u0275\u0275template(1,CardComponentGridComponent_div_2_Conditional_1_Template,1,1,"ix-component-loader",5)(2,CardComponentGridComponent_div_2_Conditional_2_Template,1,3,"ix-invalid-component-placeholder",6)(3,CardComponentGridComponent_div_2_div_3_Template,1,2,"div",7)(4,CardComponentGridComponent_div_2_div_4_Template,2,2,"div",8),\u0275\u0275elementStart(5,"div",9),\u0275\u0275listener("mousedown",function($event){\u0275\u0275restoreView(_r1);let ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemResizeStart($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(6,"div",10)(7,"div",11),\u0275\u0275text(8),\u0275\u0275elementEnd()()()}if(rf&2){let item_r2=ctx.$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275styleMap(item_r2.styles),\u0275\u0275classProp("selected",ctx_r2.isSelectedItem(item_r2)),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r2.itemHasValidDimensionsAndTemplate(item_r2.component)?1:2),\u0275\u0275advance(4),\u0275\u0275property("hidden",!ctx_r2.isSelectedItem(item_r2)),\u0275\u0275advance(),\u0275\u0275property("hidden",!ctx_r2.isSelectedItem(item_r2)),\u0275\u0275advance(2),\u0275\u0275textInterpolate(item_r2.styles.height)}}function CardComponentGridComponent_Conditional_3_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span",3),\u0275\u0275text(1," TOTAL_HEIGHT_OF_CARD_N_PX "),\u0275\u0275elementEnd()),rf&2){let ctx_r2=\u0275\u0275nextContext();\u0275\u0275property("translateParams",\u0275\u0275pureFunction1(1,_c011,ctx_r2.cardHeight))}}var CardComponentGridComponent=(()=>{let _CardComponentGridComponent=class _CardComponentGridComponent{constructor(document2,cdRef,facade,translate,focusService){this.document=document2,this.cdRef=cdRef,this.facade=facade,this.translate=translate,this.focusService=focusService,this.componentContextMenu=new EventEmitter,this.componentReorder=new EventEmitter,this.componentResize=new EventEmitter,this.gridContextMenu=new EventEmitter,this.selectionChange=new EventEmitter,this.resizing=!1,this.agentOrAssetId$=new ReplaySubject(1),this.pageVersionId$=new ReplaySubject(1),this.manifests={},this.destroy=inject(DestroyRef)}ngOnInit(){this.facade.templates$.pipe(takeUntilDestroyed(this.destroy)).subscribe(templates=>{this.templates=templates}),this.facade.manifests$.pipe(takeUntilDestroyed(this.destroy)).subscribe(manifests=>{this.manifests=manifests,this.cdRef.markForCheck()}),this.focusService.pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>this.selectItem(null)),fromEvent(this.document,"mousemove").pipe(takeUntilDestroyed(this.destroy)).subscribe(e=>this.handleMouseMove(e)),fromEvent(this.document,"mouseup").pipe(takeUntilDestroyed(this.destroy)).subscribe(e=>this.handleMouseUp(e)),combineLatest([this.agentOrAssetId$.pipe(distinctUntilChanged()),this.pageVersionId$.pipe(switchMap(pageVersionId=>this.facade.pageComponents(pageVersionId)),distinctUntilChanged(isEqual_default))]).pipe(map(([,components])=>components),takeUntilDestroyed(this.destroy)).subscribe(components=>{this.components=sortBy_default(cloneDeep_default(components),"dimensions.order"),this.gridHeight=calcTotalCardGridHeight(this.components),this.cardHeight=calcTotalCardHeight(this.components),this.items=generateCardGridItems(this.components),this.cdRef.markForCheck()})}ngOnChanges(changes){changes.agentOrAssetId&&this.agentOrAssetId$.next(this.agentOrAssetId),changes.pageVersionId&&this.pageVersionId$.next(this.pageVersionId)}getPlaceHolderErrorText(item){return this.getTemplate(item)?this.translate.instant("__MESSAGE__.INVALID_COMPONENT_SIZE"):this.translate.instant("SOMETHING_WENT_WRONG")}getPlaceHolderErrorSubText(item){if(!this.getTemplate(item))return this.translate.instant("COMPONENT_FAILED_TO_LOAD");let{minHeight,maxHeight}=this.getValidDimensions(item);return maxHeight!==null?`Resize to >= ${minHeight}px and <= ${maxHeight}px`:`Resize to >= ${minHeight}px`}getPreviewStyles(styles){if(this.dragOrigin){let transform=`translate3d(-${this.dragOrigin.offsetX}px,-${this.dragOrigin.offsetY}px,0)`;return __spreadProps(__spreadValues({},styles),{transform})}return styles}getTemplate(component){return this.templates?.find(template=>template.publicId===component.template?.publicId)}getManifest(template){return template?this.manifests?.[template.publicId]:void 0}getValidDimensions(item){let template=this.getTemplate(item),manifest=this.getManifest(template),cardSettings=getPageComponentConfig(template,manifest)?.cardSettings,minHeight=cardSettings?.minHeight||1,maxHeight=cardSettings?.maxHeight||null;return{minHeight,maxHeight}}handleDrop(event2){moveItemInArray(this.components,event2.previousIndex,event2.currentIndex),this.components=this.components.map((c,i)=>__spreadProps(__spreadValues({},c),{dimensions:__spreadProps(__spreadValues({},c.dimensions),{order:(i+1)*10})})),this.items=generateCardGridItems(this.components),this.componentReorder.emit(this.components.map(c=>c.publicId)),this.dragOrigin=null}handleCanvasMouseDown(){this.selectItem(null),this.resizeOrigin=null,this.resizing=!1}handleItemClick(event2,item){event2.stopPropagation(),this.dragOrigin=event2,this.selectItem(item.component.publicId)}handleItemContextMenu(event2,item){event2.stopPropagation(),this.componentContextMenu.emit({component:item.component,event:event2})}handleItemResizeStart(event2){event2.stopPropagation(),this.resizeOrigin=event2,this.resizing=!0}handleMouseMove(event2){let selectedComponent=this.components?.find(c=>c.publicId===this.selectedComponentId),selectedComponentTemplate=this.templates?.find(t=>t.publicId===selectedComponent?.template?.publicId),selectedComponentTemplateManifest=selectedComponentTemplate?.publicId?this.manifests[selectedComponentTemplate.publicId]:void 0;if(selectedComponent&&selectedComponentTemplate&&this.resizeOrigin){let components=this.components.map(component=>component.publicId===selectedComponent.publicId?resizeComponent(component,selectedComponentTemplate,selectedComponentTemplateManifest,this.resizeOrigin,event2):component);this.cardHeight=calcTotalCardHeight(components),this.gridHeight=calcTotalCardGridHeight(components),this.items=generateCardGridItems(components),this.cdRef.markForCheck()}}handleMouseUp(event2){let selectedComponent=this.components?.find(c=>c.publicId===this.selectedComponentId),selectedComponentTemplate=this.templates?.find(t=>t.publicId===selectedComponent?.template?.publicId),selectedComponentTemplateManifest=selectedComponentTemplate?.publicId?this.manifests[selectedComponentTemplate.publicId]:void 0;selectedComponent&&selectedComponentTemplate&&this.resizeOrigin&&(this.components=this.components.map(component=>component.publicId===selectedComponent.publicId?resizeComponent(component,selectedComponentTemplate,selectedComponentTemplateManifest,this.resizeOrigin,event2):component),this.cardHeight=calcTotalCardHeight(this.components),this.gridHeight=calcTotalCardGridHeight(this.components),this.items=generateCardGridItems(this.components),this.componentResize.emit({componentId:selectedComponent.publicId,height:calcNewComponentHeight(selectedComponent,selectedComponentTemplate,selectedComponentTemplateManifest,this.resizeOrigin,event2)})),this.resizeOrigin=null,this.resizing=!1,this.cdRef.markForCheck()}itemHasValidDimensionsAndTemplate(item){let template=this.getTemplate(item);return template&&item.dimensions?validateDimensions(item.dimensions,template,this.getManifest(template)).valid:!1}isSelectedItem(item){return this.selectedComponentId===item.component.publicId}selectItem(componentId){this.selectionChange.emit(componentId)}selectUniqueHash(index,item){return(0,import_object_hash2.default)({agentOrAssetId:this.agentOrAssetId,component:pick_default(item.component,["inputs","publicId"])})}};_CardComponentGridComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CardComponentGridComponent)(\u0275\u0275directiveInject(DOCUMENT),\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ComponentGridFacade),\u0275\u0275directiveInject(TranslateService),\u0275\u0275directiveInject(ComponentGridFocusService))},_CardComponentGridComponent.\u0275cmp=\u0275\u0275defineComponent({type:_CardComponentGridComponent,selectors:[["ix-card-component-grid"]],inputs:{agentOrAssetId:"agentOrAssetId",pageVersionId:"pageVersionId",selectedComponentId:"selectedComponentId"},outputs:{componentContextMenu:"componentContextMenu",componentReorder:"componentReorder",componentResize:"componentResize",gridContextMenu:"gridContextMenu",selectionChange:"selectionChange"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:4,vars:7,consts:[[1,"canvas",3,"mousedown","contextmenu"],["cdkDropList","",1,"grid",3,"cdkDropListDropped"],["class","item","cdkDrag","",3,"style","selected","contextmenu","mousedown",4,"ngFor","ngForOf","ngForTrackBy"],["translate","",1,"total-height",3,"translateParams"],["cdkDrag","",1,"item",3,"contextmenu","mousedown"],[3,"component"],[3,"errorText","errorSubText","svgIcon"],["class","grid-item-placeholder",3,"style",4,"cdkDragPlaceholder"],["class","grid-item-preview",4,"cdkDragPreview"],[1,"resize-handle",3,"mousedown","hidden"],[1,"height-badge-container",3,"hidden"],[1,"height-badge"],[1,"grid-item-placeholder"],[1,"grid-item-preview"],[1,"preview"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275listener("mousedown",function(){return ctx.handleCanvasMouseDown()})("contextmenu",function($event){return ctx.gridContextMenu.emit({event:$event})}),\u0275\u0275elementStart(1,"div",1),\u0275\u0275listener("cdkDropListDropped",function($event){return ctx.handleDrop($event)}),\u0275\u0275template(2,CardComponentGridComponent_div_2_Template,9,8,"div",2)(3,CardComponentGridComponent_Conditional_3_Template,2,3,"span",3),\u0275\u0275elementEnd()()),rf&2&&(\u0275\u0275classProp("resizing",ctx.resizing),\u0275\u0275advance(),\u0275\u0275styleProp("height",ctx.gridHeight,"px"),\u0275\u0275advance(),\u0275\u0275property("ngForOf",ctx.items)("ngForTrackBy",ctx.selectUniqueHash.bind(ctx)),\u0275\u0275advance(),\u0275\u0275conditional(ctx.cardHeight?3:-1))},dependencies:[NgForOf,CdkDropList,CdkDrag,CdkDragPreview,CdkDragPlaceholder,ComponentLoaderComponent,TranslateDirective,InvalidComponentPlaceholderComponent],styles:['[_nghost-%COMP%]{display:block;height:100%}[_nghost-%COMP%] .canvas[_ngcontent-%COMP%]{box-sizing:border-box;display:flex;flex-direction:column;height:100%;padding:16px}[_nghost-%COMP%] .canvas.resizing[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;cursor:ns-resize}[_nghost-%COMP%] .grid[_ngcontent-%COMP%]{position:relative;width:100%;max-width:300px;margin:auto}[_nghost-%COMP%] .grid[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{position:relative;box-sizing:border-box;border:1px dashed rgba(var(--body-color-rgb),.18)}[_nghost-%COMP%] .grid[_ngcontent-%COMP%] .item.selected[_ngcontent-%COMP%]{border-style:solid;border-color:var(--primary);background-color:var(--basic)}[_nghost-%COMP%] .total-height[_ngcontent-%COMP%]{margin-top:40px;margin-bottom:-40px;padding-bottom:8px;display:block;text-align:center;font-size:12px}.resize-handle[_ngcontent-%COMP%]{height:10px;width:100%;position:absolute;inset:auto 0 -6px;cursor:ns-resize}.resize-handle[_ngcontent-%COMP%]:after{content:"";display:block;box-sizing:border-box;height:10px;width:10px;position:absolute;bottom:0;left:calc(50% - 5px);background-color:#fff;border:1px solid var(--ix-blue)}.height-badge-container[_ngcontent-%COMP%]{position:absolute;inset:auto 0 -26px;z-index:10;display:flex;flex-direction:row;place-content:center;pointer-events:none}.height-badge-container[_ngcontent-%COMP%] .height-badge[_ngcontent-%COMP%]{display:inline-block;margin:0 auto;padding:2px 6px;border-radius:3px;background:var(--ix-blue);font-size:11px;list-style:1;color:#fff;-webkit-user-select:none;user-select:none}.grid.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.grid-item-placeholder[_ngcontent-%COMP%]{box-sizing:border-box;background-color:rgba(var(--body-color-rgb),.04);border:1px dashed rgba(var(--body-color-rgb),.12)}.preview[_ngcontent-%COMP%]{box-sizing:border-box;width:300px!important;background-color:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}'],changeDetection:0});let CardComponentGridComponent3=_CardComponentGridComponent;return CardComponentGridComponent3})();var ReportCalculationsStrategy=class{calcGridWidth(components,orientation="portrait"){let colWidth=orientation==="portrait"?COL_WIDTH_REPORT_MM:ROW_HEIGHT_REPORT_MM;if(components){let gridCols=components.reduce((max2,curr)=>{let sum=(curr.dimensions?.left??0)+(curr.dimensions.cols??0);return sum>max2?sum:max2},0),maxWidth=gridCols*colWidth+Math.max(gridCols-1,0)*GUTTER_SIZE_REPORT_MM;return maxWidth!==0?maxWidth+"mm":null}return null}calcGridHeightFactory(){return function(){return"100%"}}generateItemsFactory(isMobile,orientation="portrait"){let[rowHeight,colWidth]=orientation==="portrait"?[ROW_HEIGHT_REPORT_MM,COL_WIDTH_REPORT_MM]:[ROW_HEIGHT_REPORT_LANDSCAPE_MM,COL_WIDTH_REPORT_LANDSCAPE_MM];return function(components){return components?.map(c=>{let dims=c.dimensions||{},rows=dims.rows??0,cols=dims.cols??0,left2=dims.left??0,top2=dims.top??0;return{component:c,styles:{position:"absolute",height:`${rows*rowHeight+Math.max(rows-1,0)*GUTTER_SIZE_REPORT_MM}mm`,width:`${cols*colWidth+Math.max(cols-1,0)*GUTTER_SIZE_REPORT_MM}mm`,left:`${left2*colWidth+left2*GUTTER_SIZE_REPORT_MM}mm`,top:`${top2*rowHeight+top2*GUTTER_SIZE_REPORT_MM}mm`}}})??[]}}};var SheetCalculationsStrategy=class{calcGridWidth(){return null}calcGridHeightFactory(isMobile){let gutter=GUTTER_SIZE_PX,rowHeight=isMobile?MOBILE_ROW_HEIGHT_PX:ROW_HEIGHT_PX;return function(components){if(components.every(c=>c.dimensions?.type==="card"))return`${components.map(c=>c.dimensions).reduce((acc,dim,i)=>dim?.type==="card"?acc+(dim.height??0)+(i>0?gutter:0):acc,0)}px`;let gridRows=(isMobile?sortBy_default(components,["dimensions.mobileOrder","dimensions.top","dimensions.left"]):components).reduce((max2,curr,i,all)=>{if(curr?.dimensions?.type==="sheet"){let sum=isMobile?getMobileTop(curr,all.slice(0,i))+getMobileRows(curr):(curr?.dimensions?.top??0)+(curr?.dimensions?.rows??0);return sum>max2?sum:max2}return max2},0);return`${gridRows*rowHeight+(gridRows>0?gridRows-1:0)*gutter}px`}}generateItemsFactory(isMobile){let gutter=GUTTER_SIZE_PX,rowHeight=isMobile?MOBILE_ROW_HEIGHT_PX:ROW_HEIGHT_PX,totalCols=COLS;return function(components){let colGap=Math.round(gutter/totalCols*(totalCols-1)*1e4)/1e4,colWidth=Math.round(100/totalCols*1e5)/1e5;return(isMobile?sortBy_default(components,["dimensions.mobileOrder","dimensions.top","dimensions.left"]):components).filter(component=>component.dimensions?.type==="sheet").map((component,i,all)=>{let dims=component.dimensions,rows=isMobile?getMobileRows(component):dims?.rows??0,cols=isMobile?getMobileCols(component):dims?.cols??0,left2=isMobile?getMobileLeft(component):dims?.left??0,top2=isMobile?getMobileTop(component,all.slice(0,i)):dims?.top??0;return{component,styles:{position:"absolute",height:`${rows*rowHeight+(rows>0?rows-1:0)*gutter}px`,width:`calc((${colWidth}% - ${colGap}px) * ${cols} + ${(cols>0?cols-1:0)*gutter}px)`,left:`calc((${colWidth}% - ${colGap}px + ${gutter}px) * ${left2})`,top:`${top2*rowHeight+top2*gutter}px`}}})}}};function getCalculationsStrategy(applicationType){switch(applicationType){case"sheet":return sheet();case"report":return report();case"card":return sheet();default:throw new Error("Unknown application type")}}function sheet(){return new SheetCalculationsStrategy}function report(){return new ReportCalculationsStrategy}function SimpleComponentGridComponent_For_2_Conditional_2_Conditional_0_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",5),rf&2){let item_r1=\u0275\u0275nextContext(2).$implicit;\u0275\u0275property("component",item_r1.component)}}function SimpleComponentGridComponent_For_2_Conditional_2_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,SimpleComponentGridComponent_For_2_Conditional_2_Conditional_0_Template,1,1,"ix-component-loader",5),rf&2){let item_r1=\u0275\u0275nextContext().$implicit,appearance_r2=\u0275\u0275reference(1);\u0275\u0275conditional((item_r1.component.dimensions==null?null:item_r1.component.dimensions.type)==="report"||appearance_r2.appeared?0:-1)}}function SimpleComponentGridComponent_For_2_Conditional_3_Template(rf,ctx){rf&1&&(\u0275\u0275element(0,"ix-invalid-component-placeholder",4),\u0275\u0275pipe(1,"translate"),\u0275\u0275pipe(2,"translate")),rf&2&&\u0275\u0275property("errorText",\u0275\u0275pipeBind1(1,2,"SOMETHING_WENT_WRONG"))("errorSubText",\u0275\u0275pipeBind1(2,4,"COMPONENT_FAILED_TO_LOAD"))}function SimpleComponentGridComponent_For_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",3,0),\u0275\u0275template(2,SimpleComponentGridComponent_For_2_Conditional_2_Template,1,1)(3,SimpleComponentGridComponent_For_2_Conditional_3_Template,3,6,"ix-invalid-component-placeholder",4),\u0275\u0275elementEnd()),rf&2){let item_r1=ctx.$implicit;\u0275\u0275styleMap(item_r1.styles),\u0275\u0275advance(2),\u0275\u0275conditional(item_r1.component.template?2:3)}}var SimpleComponentGridComponent=(()=>{let _SimpleComponentGridComponent=class _SimpleComponentGridComponent{set agentOrAssetId(agentOrAssetId){this.agentOrAssetId$.next(agentOrAssetId)}set pageVersionId(pageVersionId){this.pageVersionId$.next(pageVersionId)}constructor(cdRef,observer,facade){this.cdRef=cdRef,this.observer=observer,this.facade=facade,this.orientation="portrait",this.applicationType="sheet",this.agentOrAssetId$=new ReplaySubject(1),this.destroy=inject(DestroyRef),this.pageVersionId$=new ReplaySubject(1)}ngOnInit(){this.strategy=getCalculationsStrategy(this.applicationType),combineLatest([this.agentOrAssetId$.pipe(distinctUntilChanged()),this.observer.observe(`(max-width: ${MOBILE_BREAKPOINT_PX-1}px)`).pipe(map(breakpoint=>this.mobile??breakpoint.matches)),this.pageVersionId$.pipe(switchMap(pageVersionId=>this.facade.pageComponents(pageVersionId,this.pagePageId)),distinctUntilChanged(isEqual_default))]).pipe(takeUntilDestroyed(this.destroy)).subscribe(([,isMobile,components])=>{this.components=components,this.gridHeight=this.strategy.calcGridHeightFactory(isMobile)(this.components),this.gridWidth=this.strategy.calcGridWidth(this.components,this.orientation),this.items=this.strategy.generateItemsFactory(isMobile,this.orientation)(this.components),this.cdRef.markForCheck()})}ngOnChanges(changes){changes.mobile&&this.components&&(this.gridHeight=this.strategy.calcGridHeightFactory(this.mobile)(this.components),this.items=this.strategy.generateItemsFactory(this.mobile)(this.components)),changes.orientation&&this.strategy&&(this.gridWidth=this.strategy.calcGridWidth(this.components,this.orientation),this.items=this.strategy.generateItemsFactory(this.mobile,this.orientation)(this.components))}};_SimpleComponentGridComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SimpleComponentGridComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(BreakpointObserver),\u0275\u0275directiveInject(ComponentGridFacade))},_SimpleComponentGridComponent.\u0275cmp=\u0275\u0275defineComponent({type:_SimpleComponentGridComponent,selectors:[["ix-simple-component-grid"]],inputs:{agentOrAssetId:"agentOrAssetId",pageVersionId:"pageVersionId",orientation:"orientation",applicationType:"applicationType",pagePageId:"pagePageId",mobile:"mobile"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:3,vars:4,consts:[["appearance","ixAppear"],["ixAppearScheduler","",1,"grid"],["ixAppear","",1,"item",3,"style"],["ixAppear","",1,"item"],[3,"errorText","errorSubText"],[3,"component"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",1),\u0275\u0275repeaterCreate(1,SimpleComponentGridComponent_For_2_Template,4,3,"div",2,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275styleProp("height",ctx.gridHeight)("max-width",ctx.gridWidth),\u0275\u0275advance(),\u0275\u0275repeater(ctx.items))},dependencies:[ComponentLoaderComponent,AppearDirective,AppearSchedulerDirective,InvalidComponentPlaceholderComponent,TranslatePipe],styles:["[_nghost-%COMP%]{display:block;padding:16px}[_nghost-%COMP%] .grid[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .grid[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{position:relative;box-sizing:border-box;background-color:var(--card-bg);border:var(--card-border-width) solid var(--card-border-color);color:var(--card-color);color-scheme:var(--card-color-scheme);border-radius:8px;overflow:hidden;z-index:100}"],changeDetection:0});let SimpleComponentGridComponent3=_SimpleComponentGridComponent;return SimpleComponentGridComponent3})();function calcGridHeight(components){return components.reduce((acc,component)=>component.dimensions?.type==="card"?acc+(component.dimensions.height??0):acc,0)}function generateItems(components){return sortBy_default(components,["dimensions.order"]).map(component=>{let height=component.dimensions?.type==="card"?`${component.dimensions.height}px`:"auto";return{component,styles:{height,maxHeight:height,width:"100%"}}})}function SimpleCardComponentGridComponent_For_2_Conditional_1_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",3),rf&2){let item_r1=\u0275\u0275nextContext().$implicit;\u0275\u0275property("component",item_r1.component)}}function SimpleCardComponentGridComponent_For_2_Conditional_2_Template(rf,ctx){rf&1&&(\u0275\u0275element(0,"ix-invalid-component-placeholder",4),\u0275\u0275pipe(1,"translate"),\u0275\u0275pipe(2,"translate")),rf&2&&\u0275\u0275property("errorText",\u0275\u0275pipeBind1(1,2,"SOMETHING_WENT_WRONG"))("errorSubText",\u0275\u0275pipeBind1(2,4,"COMPONENT_FAILED_TO_LOAD"))}function SimpleCardComponentGridComponent_For_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",2),\u0275\u0275template(1,SimpleCardComponentGridComponent_For_2_Conditional_1_Template,1,1,"ix-component-loader",3)(2,SimpleCardComponentGridComponent_For_2_Conditional_2_Template,3,6,"ix-invalid-component-placeholder",4),\u0275\u0275elementEnd()),rf&2){let item_r1=ctx.$implicit;\u0275\u0275styleMap(item_r1.styles),\u0275\u0275advance(),\u0275\u0275conditional(item_r1.component.template?1:2)}}var SimpleCardComponentGridComponent=(()=>{let _SimpleCardComponentGridComponent=class _SimpleCardComponentGridComponent{set pageVersionId(pageVersionId){this.pageVersionId$.next(pageVersionId)}constructor(cdRef,facade){this.cdRef=cdRef,this.facade=facade,this.pageVersionId$=new ReplaySubject(1),this.destroy=inject(DestroyRef)}ngOnInit(){this.pageVersionId$.pipe(switchMap(pageVersionId=>this.facade.pageComponents(pageVersionId)),distinctUntilChanged(isEqual_default),takeUntilDestroyed(this.destroy)).subscribe(components=>{this.gridHeight=calcGridHeight(components),this.items=generateItems(components),this.cdRef.markForCheck()})}};_SimpleCardComponentGridComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SimpleCardComponentGridComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ComponentGridFacade))},_SimpleCardComponentGridComponent.\u0275cmp=\u0275\u0275defineComponent({type:_SimpleCardComponentGridComponent,selectors:[["ix-simple-card-component-grid"]],inputs:{agentOrAssetId:"agentOrAssetId",pageVersionId:"pageVersionId"},standalone:!1,decls:3,vars:2,consts:[[1,"grid"],[1,"item",3,"style"],[1,"item"],[3,"component"],[3,"errorText","errorSubText"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275repeaterCreate(1,SimpleCardComponentGridComponent_For_2_Template,3,3,"div",1,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275styleProp("height",ctx.gridHeight,"px"),\u0275\u0275advance(),\u0275\u0275repeater(ctx.items))},dependencies:[ComponentLoaderComponent,InvalidComponentPlaceholderComponent,TranslatePipe],styles:["[_nghost-%COMP%]{display:block;padding:16px}[_nghost-%COMP%] .grid[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .grid[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{position:relative;box-sizing:border-box}"],changeDetection:0});let SimpleCardComponentGridComponent3=_SimpleCardComponentGridComponent;return SimpleCardComponentGridComponent3})();var ComponentGridModule=(()=>{let _ComponentGridModule=class _ComponentGridModule{};_ComponentGridModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentGridModule)},_ComponentGridModule.\u0275mod=\u0275\u0275defineNgModule({type:_ComponentGridModule}),_ComponentGridModule.\u0275inj=\u0275\u0275defineInjector({providers:[ComponentGridFacade],imports:[GridsterModule,CommonModule,LayoutModule,DragDropModule,ComponentLoaderModule,TranslateModule,InvalidComponentPlaceholderComponent]});let ComponentGridModule2=_ComponentGridModule;return ComponentGridModule2})();var AGENT_LIST_FIELDS=buildFields(`
746
+ `,"\r","#","[","]","*","?",":",";","'",'"',"<",">","{","}","|","%",".."].map(i=>path.includes(i)).includes(!0)}};_ObjectStorageAuthorizationLocalService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ObjectStorageAuthorizationLocalService)},_ObjectStorageAuthorizationLocalService.\u0275prov=\u0275\u0275defineInjectable({token:_ObjectStorageAuthorizationLocalService,factory:_ObjectStorageAuthorizationLocalService.\u0275fac,providedIn:"root"});let ObjectStorageAuthorizationLocalService2=_ObjectStorageAuthorizationLocalService;return ObjectStorageAuthorizationLocalService2})();var ObjectStorageAuthorizationMockService=(()=>{let _ObjectStorageAuthorizationMockService=class _ObjectStorageAuthorizationMockService{authorizeUpload(){return Promise.resolve({result:"success",data:{path:""}})}authorizeList(agentOrAssetId){return Promise.resolve({result:"success",data:[{publicId:agentOrAssetId,path:"",type:"Agent"},{publicId:agentOrAssetId,path:"",type:"Asset"}]})}authorizeDownload(){return Promise.resolve({result:"success",data:{path:""}})}authorizeDelete(){return Promise.resolve({result:"success",data:{path:""}})}authorizeUpdate(){return Promise.resolve({result:"success",data:{path:""}})}};_ObjectStorageAuthorizationMockService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ObjectStorageAuthorizationMockService)},_ObjectStorageAuthorizationMockService.\u0275prov=\u0275\u0275defineInjectable({token:_ObjectStorageAuthorizationMockService,factory:_ObjectStorageAuthorizationMockService.\u0275fac,providedIn:"root"});let ObjectStorageAuthorizationMockService2=_ObjectStorageAuthorizationMockService;return ObjectStorageAuthorizationMockService2})();var import_jszip=__toESM(require_jszip_min());var ObjectStorageServiceFactory2=(()=>{let _ObjectStorageServiceFactory=class _ObjectStorageServiceFactory{constructor(){this.objects=[],this.authorizationLocalService=inject(ObjectStorageAuthorizationLocalService),this.authorizationMockService=inject(ObjectStorageAuthorizationMockService),this.storage=inject(StorageService)}createService(agentOrAssetId){let pageComponentTemplateId=mapTemplateUrlToPublicId(sessionStorage.getItem("pct-url")),authorizationService=this.storage.get(`${STORAGE_KEY_CBC_INGRESS}:${pageComponentTemplateId}`)=="local"?this.authorizationLocalService:this.authorizationMockService;return agentOrAssetId?new ObjectStorageMockService(authorizationService,this.objects,agentOrAssetId?.publicId):new NoopObjectStorageService}};_ObjectStorageServiceFactory.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ObjectStorageServiceFactory)},_ObjectStorageServiceFactory.\u0275prov=\u0275\u0275defineInjectable({token:_ObjectStorageServiceFactory,factory:_ObjectStorageServiceFactory.\u0275fac,providedIn:"root"});let ObjectStorageServiceFactory3=_ObjectStorageServiceFactory;return ObjectStorageServiceFactory3})();function forSameObject(objectMeta){return({meta})=>meta.uuid===objectMeta.uuid&&(!meta.agent||meta.agent?.publicId===objectMeta.agent?.publicId)&&(!meta.asset||meta.asset?.publicId===objectMeta.asset?.publicId)}var ObjectStorageMockService=class{constructor(authService,objects,agentOrAssetId){this.authService=authService,this.objects=objects,this.agentOrAssetId=agentOrAssetId}getList(){return __async(this,null,function*(){let paths;try{paths=(yield this.authService.authorizeList(this.agentOrAssetId)).data.map(d=>d.path)}catch{return Promise.reject("authorization failed")}return Promise.resolve({entries:this.objects.filter(o=>paths.map(p=>p.startsWith(o.path)).includes(!0)).map(o=>o.meta)})})}getBlob(identifier){return __async(this,null,function*(){if(Array.isArray(identifier)){let zip=new import_jszip.default,promises=identifier.map(meta=>__async(this,null,function*(){let blob=yield this.getBlob(meta);if(meta.outputDir){let folder=zip.folder(meta.outputDir);if(!folder)return Promise.reject(new Error("Could not create folder"));folder.file(meta.tags.name,blob);return}zip.file(meta.tags.name,blob)}));return Promise.all(promises).then(()=>zip.generateAsync({type:"blob"}))}let path;try{path=(yield this.authService.authorizeDownload(this.agentOrAssetId)).data.path}catch{return Promise.reject("authorization failed")}let obj=this.findById(path,identifier);return obj?Promise.resolve(obj.blob):Promise.reject(new Error("Object not found"))})}store(object,options){return __async(this,null,function*(){let path;try{path=(yield this.authService.authorizeUpload(this.agentOrAssetId)).data.path}catch{return Promise.reject("authorization failed")}let uuid=crypto.randomUUID(),meta={uuid,tags:options?.tags??{},size:object.size};return this.objects.push({blob:object,meta,path}),{identifier:uuid}})}delete(objectMeta){return __async(this,null,function*(){let path;try{path=(yield this.authService.authorizeDelete(this.agentOrAssetId)).data.path}catch{return Promise.reject("authorization failed")}let index=this.findIndexById(path,objectMeta);return index<0?Promise.reject(new Error("Object not found")):(this.objects.splice(index,1),Promise.resolve())})}update(objectMeta,options){return __async(this,null,function*(){let path;try{path=(yield this.authService.authorizeUpdate(this.agentOrAssetId)).data.path}catch{return Promise.reject("authorization failed")}let index=this.findIndexById(path,objectMeta);return index<0?Promise.reject(new Error("Object not found")):(this.objects[index].meta.tags=options.tags??{},Promise.resolve())})}destroy(){}findById(path,id){return this.objects.filter(o=>o.path.startsWith(path)).find(forSameObject(id))}findIndexById(path,id){return this.objects.filter(o=>o.path.startsWith(path)).findIndex(forSameObject(id))}};var BackendComponentBrokerMockFacade=(()=>{let _BackendComponentBrokerMockFacade=class _BackendComponentBrokerMockFacade extends BackendComponentBrokerFacade{constructor(store,storage){super(store),this.storage=storage}resolveTemplateFromPageComponent(){let pageComponentTemplateId=mapTemplateUrlToPublicId(sessionStorage.getItem("pct-url")),templateId=this.storage.get(`${STORAGE_KEY_CBC_PUBLIC_ID}:${pageComponentTemplateId}`);return of(templateId)}};_BackendComponentBrokerMockFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BackendComponentBrokerMockFacade)(\u0275\u0275inject(Store),\u0275\u0275inject(StorageService))},_BackendComponentBrokerMockFacade.\u0275prov=\u0275\u0275defineInjectable({token:_BackendComponentBrokerMockFacade,factory:_BackendComponentBrokerMockFacade.\u0275fac,providedIn:"root"});let BackendComponentBrokerMockFacade2=_BackendComponentBrokerMockFacade;return BackendComponentBrokerMockFacade2})();var AppCoreModule=(()=>{let _AppCoreModule=class _AppCoreModule{};_AppCoreModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppCoreModule)},_AppCoreModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppCoreModule}),_AppCoreModule.\u0275inj=\u0275\u0275defineInjector({providers:[ObjectStorageAuthorizationLocalService,...__use_api_mocks__?[{provide:HTTP_INTERCEPTORS,useClass:HistoricDataInterceptor,multi:!0},{provide:HTTP_INTERCEPTORS,useClass:DataExportInterceptor,multi:!0},{provide:AgentService,useClass:AgentMockService},{provide:AgentDataTagService,useClass:AgentDataTagMockService},{provide:AgentDataVariableService,useClass:AgentDataVariableMockService},{provide:AgentMembershipService,useClass:AgentMembershipMockService},{provide:AssetService,useClass:AssetMockService},{provide:AssetMembershipService,useClass:AssetMembershipMockService},{provide:AuthTokenService,useClass:AuthTokenMockService},{provide:BackendComponentTemplateConfigService,useClass:BackendComponentConfigMockService},{provide:CompanyService,useClass:CompanyMockService},{provide:CustomPropertyService,useClass:CustomPropertyMockService},{provide:GroupService,useClass:GroupMockService},{provide:GroupTypeService,useClass:GroupTypeMockService},{provide:LicenceService,useClass:LicenceMockService},{provide:LicenceTypeService,useClass:LicenceTypeMockService},{provide:ObjectStorageServiceFactory,useClass:ObjectStorageServiceFactory2},{provide:RoleService,useClass:RoleMockService},{provide:TranslationService,useClass:TranslationMockService},{provide:UserService,useClass:UserMockService},{provide:IxApiService,useClass:IxApiServiceMock}]:[],{provide:BackendComponentCallerServiceFactory,useClass:BackendComponentCallerMockServiceFactory},{provide:BackendComponentBrokerFacade,useClass:BackendComponentBrokerMockFacade},{provide:BrandingService,useClass:BrandingMockService},{provide:PageService,useClass:PageMockService},{provide:PageComponentService,useClass:PageComponentMockService},{provide:PageComponentTemplateService,useClass:PageComponentTemplateMockService},{provide:PageVersionService,useClass:PageVersionMockService},{provide:PagePageService,useClass:PagePageMockService},{provide:PublicFileService,useClass:PublicFileMockService}],imports:[AgentModule,AgentAccessRequestModule,AgentDataSourceModule,AgentDataTagModule,AgentDataVariableModule,AgentMembershipModule,AgentServerModule,AgentTypeModule,AssetAppConfigModule,AssetAppConfigResourceModule,AssetLibraryVersionModule,AssetMembershipModule,AssetModule,AssetTypeModule,AudienceModule,BackendComponentTemplateConfigModule,BrandingModule,CompanyModule,CustomPropertyModule,GroupModule,GroupTypeModule,LicenceModule,LicenceTypeModule,PageModule,PageComponentModule,PageComponentTemplateModule,PageComponentTemplateCategoryModule,PageComponentTemplateManifestModule,PageComponentTemplateVersionModule,PagePageModule,PageVersionModule,PlatformServerModule,RoleModule,SectorModule,TranslationModule,UserModule,UserMembershipModule]});let AppCoreModule2=_AppCoreModule;return AppCoreModule2})();var AppGuard2=(()=>{let _AppGuard=class _AppGuard{constructor(api,store,router,templateValidator){this.api=api,this.store=store,this.router=router,this.templateValidator=templateValidator}canActivate(route){return this.bootstrapIxApi().pipe(switchMap(()=>forkJoin([this.getHostBranding(),this.setComponentUrl(route)]))).pipe(map(()=>!0),take(1))}bootstrapIxApi(){return of(!!this.api.links).pipe(switchMap(discovered=>discovered?of(this.api.links):this.api.discover()),take(1),map(()=>!0))}getHostBranding(){return this.store.select(selectHostLoaded).pipe(tap(loaded=>{loaded||this.store.dispatch(loadHost())}),filter(loaded=>loaded),take(1))}setComponentUrl(route){let templateUrl=route.queryParamMap.get("pct-url");return templateUrl?this.templateValidator.validateByUrl(templateUrl).pipe(mergeMap(errors2=>Object.keys(errors2).length?from(this.router.navigate(["/manifest-invalid"],{replaceUrl:!1,skipLocationChange:!0})):(sessionStorage.setItem("pct-url",templateUrl),from(this.router.navigateByUrl("/"))))):of(!0)}};_AppGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppGuard)(\u0275\u0275inject(IxApiService),\u0275\u0275inject(Store),\u0275\u0275inject(Router),\u0275\u0275inject(ComponentTemplateValidatorService))},_AppGuard.\u0275prov=\u0275\u0275defineInjectable({token:_AppGuard,factory:_AppGuard.\u0275fac});let AppGuard3=_AppGuard;return AppGuard3})();function getPageComponentConfig(template,manifest){return template&&("manifest"in template?template.manifest?.main?template.manifest:template:manifest?.main?manifest:template)}var import_object_hash=__toESM(require_object_hash());function mmToPx(mm){return mm/25.4*96}var COLS=12,COL_WIDTH_REPORT_MM=21.666,COL_WIDTH_REPORT_PX=mmToPx(COL_WIDTH_REPORT_MM),COL_WIDTH_REPORT_LANDSCAPE_MM=24.625,COL_WIDTH_REPORT_LANDSCAPE_PX=mmToPx(COL_WIDTH_REPORT_LANDSCAPE_MM),GUTTER_SIZE_PX=16,GUTTER_SIZE_REPORT_MM=10,GUTTER_SIZE_REPORT_PX=mmToPx(GUTTER_SIZE_REPORT_MM),OUTER_MARGIN_REPORT_MM=15,OUTER_MARGIN_REPORT_PX=mmToPx(OUTER_MARGIN_REPORT_MM);var MAX_ROWS=72;var MIN_ROWS=12,MOBILE_BREAKPOINT_PX=960,MOBILE_ROW_HEIGHT_PX=15,ROW_HEIGHT_PX=45,ROW_HEIGHT_REPORT_MM=7.312,ROW_HEIGHT_REPORT_PX=mmToPx(ROW_HEIGHT_REPORT_MM),ROW_HEIGHT_REPORT_LANDSCAPE_MM=7.272727273,ROW_HEIGHT_REPORT_LANDSCAPE_PX=mmToPx(ROW_HEIGHT_REPORT_LANDSCAPE_MM);function colsToMobileCols(cols){return cols*2}function getMobileCols(component){return component.dimensions?.type==="sheet"?component.dimensions.mobileCols||12-getMobileLeft(component):12}function getMobileLeft(component){return component.dimensions?.type==="sheet"&&component.dimensions.mobileLeft||0}function getMobileRows(component){if(component.dimensions?.type==="sheet"){if(component.dimensions.mobileHeight)return _heightToMobileRows(component.dimensions.mobileHeight);if(component.dimensions.rows)return _heightToMobileRows(component.dimensions.rows*(ROW_HEIGHT_PX+GUTTER_SIZE_PX)-GUTTER_SIZE_PX)}return 1}function getMobileTop(component,before){let colTops=range_default(0,12).map(()=>0);before.forEach(c=>{let l2=getMobileLeft(c),colIndexes=range_default(l2,l2+getMobileCols(c)),maxTop=Math.max(...colIndexes.map(i=>colTops[i]));colIndexes.forEach(i=>colTops[i]=maxTop+getMobileRows(c))});let left2=getMobileLeft(component);return Math.max(...colTops.slice(left2,left2+getMobileCols(component)))}function mobileRowsToHeight(mobileRows){return mobileRows>1?mobileRows*(MOBILE_ROW_HEIGHT_PX+GUTTER_SIZE_PX)-GUTTER_SIZE_PX:MOBILE_ROW_HEIGHT_PX}function rowsToMobileRows(rows){return _heightToMobileRows(rowsToHeight(rows))}function _heightToMobileRows(height){return height>MOBILE_ROW_HEIGHT_PX?Math.ceil((height+GUTTER_SIZE_PX)/(MOBILE_ROW_HEIGHT_PX+GUTTER_SIZE_PX)):1}function rowsToHeight(rows){return rows>1?rows*(ROW_HEIGHT_PX+GUTTER_SIZE_PX)-GUTTER_SIZE_PX:ROW_HEIGHT_PX}function getMobileGridsterItems(components,templates,manifests){return sortBy_default(components.filter(component=>component.dimensions?.type==="sheet"),["dimensions.mobileOrder","dimensions.top","dimensions.left"]).map((component,i,sheetComponents)=>{let template=component.template?.publicId?templates[component.template.publicId]:void 0,manifest=_getManifestByTemplateId(manifests,component.template?.publicId),sheetSettings=manifest?.sheetSettings||template?.sheetSettings;return{get pageComponent(){return __spreadProps(__spreadValues({},component),{dimensions:__spreadProps(__spreadValues({},component.dimensions),{type:"sheet",mobileCols:this.cols,mobileHeight:mobileRowsToHeight(this.rows),mobileLeft:this.x})})},x:getMobileLeft(component),y:getMobileTop(component,sheetComponents.slice(0,i)),rows:getMobileRows(component),cols:getMobileCols(component),minItemCols:itemHasValidMobileMinCols(component,template,manifest)?colsToMobileCols(sheetSettings&&sheetSettings?.minCols>6?6:sheetSettings?.minCols||1):1,minItemRows:itemHasValidMobileMinRows(component,template,manifest)?rowsToMobileRows(sheetSettings?.minRows||1):1}})}function getGridsterItems(components,templates,manifests,applicationType){return components.filter(component=>component.dimensions?.type===applicationType).map(component=>{let dims=component.dimensions,template=component.template?.publicId?templates[component.template.publicId]:void 0,manifest=_getManifestByTemplateId(manifests,component.template?.publicId),settings=_getSheetOrReportSettings(applicationType,template,manifest);return{get pageComponent(){return __spreadProps(__spreadValues({},component),{dimensions:__spreadProps(__spreadValues({},component.dimensions),{type:applicationType,cols:this.cols,left:this.x,rows:this.rows,top:this.y})})},x:dims.left??0,y:dims.top??0,rows:dims.rows??1,cols:dims.cols??1,minItemCols:_getItemProperty("minCols",component,template,manifest,settings),minItemRows:_getItemProperty("minRows",component,template,manifest,settings)}})}function _getItemProperty(dimension,component,template,manifest,settings){return itemHasValidMinCols(component,template,manifest)&&settings&&dimension in settings&&settings[dimension]||1}function _getSheetOrReportSettings(applicationType,template,manifest){switch(applicationType){case"sheet":return getPageComponentConfig(template,manifest)?.sheetSettings;case"report":return manifest?.reportSettings}}function _getManifestByTemplateId(manifests,templateId){return Object.keys(manifests).map(id=>manifests[id]).find(manifest=>manifest?.template.publicId===templateId)}function validateDimensions(dimensions,template,manifest){if(dimensions.type==="card"){let minHeight=itemHasValid("min","height",dimensions,template,manifest),maxHeight=itemHasValid("max","height",dimensions,template,manifest);return{valid:minHeight&&maxHeight,height:minHeight&&maxHeight,min:minHeight,max:maxHeight,minHeight,maxHeight}}else if(dimensions.type==="report"||dimensions.type==="sheet"){let minRows=itemHasValid("min","rows",dimensions,template,manifest),minCols=itemHasValid("min","cols",dimensions,template,manifest),maxRows=itemHasValid("max","rows",dimensions,template,manifest),maxCols=itemHasValid("max","cols",dimensions,template,manifest);return{valid:minRows&&maxRows&&minCols&&maxCols,rows:minRows&&maxRows,cols:minCols&&maxCols,min:minCols&&minRows,max:maxCols&&maxRows,minRows,minCols,maxRows,maxCols}}return{valid:!1}}function itemHasValid(minMax,field,dimensions,template,manifest){let minMaxField=`${minMax}${capitalize_default(field)}`,unsupportedFieldError=()=>new Error(`Unsupported field '${field}' for type '${dimensions?.type}'`);switch(dimensions?.type){case"card":{let resolved=resolveCardSettings(template,manifest);if(field!=="height")throw unsupportedFieldError();return minMax==="min"?(dimensions?.[field]||1)>=resolved[minMaxField]:resolved[minMaxField]?(dimensions?.[field]||1)<=resolved[minMaxField]:!0}case"sheet":{let resolved=resolveSheetSettings(template,manifest);if(field==="height")throw unsupportedFieldError();return minMax==="min"?(dimensions?.[field]||1)>=resolved[minMaxField]:resolved[minMaxField]?(dimensions?.[field]||1)<=resolved[minMaxField]:!0}case"report":{let resolved=resolveReportSettings(manifest);if(field==="height")throw unsupportedFieldError();return minMax==="min"?(dimensions?.[field]||1)>=resolved[minMaxField]:resolved[minMaxField]?(dimensions?.[field]||1)<=resolved[minMaxField]:!0}default:throw new Error(`Invalid dimension type: ${dimensions?.type}`)}}function itemHasValidMinCols(item,template,manifest){return(item.dimensions?.cols||1)>=_getMinCols(template,manifest)}function itemHasValidMobileMinRows(item,template,manifest){return getMobileRows(item)>=rowsToMobileRows(_getMinRows(template,manifest))}function itemHasValidMobileMinCols(item,template,manifest){return getMobileCols(item)>=colsToMobileCols(_getMinCols(template,manifest))}function reduceComponentChanges(changes,gridItems,isMobile){let _changes=changes.reduceRight((acc,curr)=>acc.find(c=>c.publicId===curr.publicId)?acc:[...acc,curr],[]);return isMobile?sortBy_default(gridItems,["y","x"]).reduce((mobileOrderChanges,item,index)=>{let mobileOrder=(index+1)*10,found=_changes.find(change=>change.publicId===item.pageComponent.publicId);if(found){let change=__spreadProps(__spreadValues({},found),{dimensions:__spreadProps(__spreadValues({},found.dimensions),{type:"sheet",mobileOrder})});return[...mobileOrderChanges,change]}if(item.pageComponent.dimensions?.type==="sheet"&&item.pageComponent.dimensions.mobileOrder!==mobileOrder){let change=__spreadProps(__spreadValues({},item.pageComponent),{dimensions:__spreadProps(__spreadValues({},item.pageComponent.dimensions),{type:"sheet",mobileOrder})});return[...mobileOrderChanges,change]}return mobileOrderChanges},[]):_changes}function _getMinCols(template,manifest){let minCols=getPageComponentConfig(template,manifest)?.sheetSettings?.minCols;return minCols&&minCols>=6?6:minCols??1}function _getMinRows(template,manifest){return getPageComponentConfig(template,manifest)?.sheetSettings?.minRows||1}function resolveTemplateSettings(dimensions,template,manifest){switch(dimensions.type){case"card":return resolveCardSettings(template,manifest);case"report":return resolveReportSettings(manifest);case"sheet":return resolveSheetSettings(template,manifest);default:throw new Error(`unsupported dimension type: ${dimensions.type}`)}}function resolveCardSettings(template,manifest){let cardSettings=getPageComponentConfig(template,manifest)?.cardSettings;return{defaultHeight:cardSettings?.defaultHeight||null,maxHeight:cardSettings?.maxHeight||null,minHeight:cardSettings?.minHeight||1}}function resolveReportSettings(manifest){return{defaultCols:manifest?.reportSettings?.defaultCols||null,defaultRows:manifest?.reportSettings?.defaultRows||null,maxCols:manifest?.reportSettings?.maxCols||null,maxRows:manifest?.reportSettings?.maxRows||null,minCols:manifest?.reportSettings?.minCols||1,minRows:manifest?.reportSettings?.minRows||1}}function resolveSheetSettings(template,manifest){let sheetSettings=getPageComponentConfig(template,manifest)?.sheetSettings;return{defaultCols:sheetSettings?.defaultCols||1,defaultRows:sheetSettings?.defaultRows||1,maxCols:sheetSettings?.maxCols||null,maxRows:sheetSettings?.maxRows||null,minCols:sheetSettings?.minCols||1,minRows:sheetSettings?.minRows||1}}var ComponentTemplatesFacade=(()=>{let _ComponentTemplatesFacade=class _ComponentTemplatesFacade{constructor(store){this.store=store,this.manifests$=this.store.select(selectEntities2),this.templates$=combineLatest([this.store.select(selectAll),this.store.select(selectEntities2)]).pipe(map(([templates,manifests])=>templates.map(t=>manifests[t.publicId]?__spreadProps(__spreadValues({},t),{manifest:manifests[t.publicId]}):t)),tap(templates=>{let templatesWithoutManifest=templates.filter(template=>template.configuredVersion&&!("manifest"in template));templatesWithoutManifest.length&&this.store.dispatch(ensureMany({templates:templatesWithoutManifest}))}))}};_ComponentTemplatesFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentTemplatesFacade)(\u0275\u0275inject(Store))},_ComponentTemplatesFacade.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentTemplatesFacade,factory:_ComponentTemplatesFacade.\u0275fac,providedIn:"root"});let ComponentTemplatesFacade2=_ComponentTemplatesFacade;return ComponentTemplatesFacade2})();var ComponentGridFacade=(()=>{let _ComponentGridFacade=class _ComponentGridFacade{constructor(store,facade){this.store=store,this.facade=facade,this.templates$=this.facade.templates$,this.manifests$=this.facade.manifests$,this.templateEntities$=this.store.select(selectEntities)}pageComponents(pageVersionId,pagePageId=null){return combineLatest([this.store.select(selectEntity10(pageVersionId)).pipe(mergeMap(pageVersion=>pageVersion?.components?of(pageVersion.components):EMPTY),distinctUntilChanged(isEqual_default)),this.store.select(selectEntities33),this.store.select(selectEntities)]).pipe(mergeMap(([components,componentEntities,templateEntities])=>{let pageComponents=components.map(c=>componentEntities[c.publicId]||c).filter(c=>c.dimensions?.type!=="report"||(pagePageId?c.pagePage?.publicId===pagePageId:!0));return pageComponents.every(c=>c.template===null||c.template&&templateEntities[c.template.publicId]?.url)?of(pageComponents):EMPTY}))}};_ComponentGridFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentGridFacade)(\u0275\u0275inject(Store),\u0275\u0275inject(ComponentTemplatesFacade))},_ComponentGridFacade.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentGridFacade,factory:_ComponentGridFacade.\u0275fac,providedIn:"root"});let ComponentGridFacade2=_ComponentGridFacade;return ComponentGridFacade2})();var ComponentGridFocusService=(()=>{let _ComponentGridFocusService=class _ComponentGridFocusService extends Subject{};_ComponentGridFocusService.\u0275fac=(()=>{let \u0275ComponentGridFocusService_BaseFactory;return function(__ngFactoryType__){return(\u0275ComponentGridFocusService_BaseFactory||(\u0275ComponentGridFocusService_BaseFactory=\u0275\u0275getInheritedFactory(_ComponentGridFocusService)))(__ngFactoryType__||_ComponentGridFocusService)}})(),_ComponentGridFocusService.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentGridFocusService,factory:_ComponentGridFocusService.\u0275fac,providedIn:"root"});let ComponentGridFocusService2=_ComponentGridFocusService;return ComponentGridFocusService2})();function InvalidComponentPlaceholderComponent_Conditional_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span"),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r0.errorSubText)}}var InvalidComponentPlaceholderComponent=(()=>{let _InvalidComponentPlaceholderComponent=class _InvalidComponentPlaceholderComponent{constructor(){this.svgIcon="no_plugin"}};_InvalidComponentPlaceholderComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_InvalidComponentPlaceholderComponent)},_InvalidComponentPlaceholderComponent.\u0275cmp=\u0275\u0275defineComponent({type:_InvalidComponentPlaceholderComponent,selectors:[["ix-invalid-component-placeholder"]],inputs:{errorSubText:"errorSubText",errorText:"errorText",svgIcon:"svgIcon"},decls:5,vars:3,consts:[["fxLayout","column","fxLayoutAlign","center center",1,"placeholder"],[3,"svgIcon"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275element(1,"mat-icon",1),\u0275\u0275elementStart(2,"span"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275template(4,InvalidComponentPlaceholderComponent_Conditional_4_Template,2,1,"span"),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275advance(),\u0275\u0275property("svgIcon",ctx.svgIcon),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx.errorText),\u0275\u0275advance(),\u0275\u0275conditional(ctx.errorSubText?4:-1))},dependencies:[FlexLayoutModule,DefaultLayoutDirective,DefaultLayoutAlignDirective,MatIconModule,MatIcon],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow:hidden}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%]{display:block;width:100%;height:100%;background:#d8d8d8}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{fill:#fff;font-size:32px;width:32px;height:32px}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#00000080;word-break:break-all;text-align:center;font-size:14px;line-height:20px;display:none;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%]:hover{background:#ebebeb;transition:background .2s ease-out}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%]:hover .mat-icon[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .placeholder[_ngcontent-%COMP%]:hover span[_ngcontent-%COMP%]{display:block}"],changeDetection:0});let InvalidComponentPlaceholderComponent2=_InvalidComponentPlaceholderComponent;return InvalidComponentPlaceholderComponent2})();function ComponentGridComponent_gridster_item_2_Conditional_1_Conditional_0_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",4),rf&2){let item_r2=\u0275\u0275nextContext(2).$implicit;\u0275\u0275property("component",item_r2.pageComponent)}}function ComponentGridComponent_gridster_item_2_Conditional_1_Conditional_1_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-invalid-component-placeholder",5),rf&2){let item_r2=\u0275\u0275nextContext(2).$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275property("errorText",ctx_r2.getPlaceHolderErrorText(item_r2.pageComponent))("errorSubText",ctx_r2.getPlaceHolderErrorSubText(item_r2.pageComponent))("svgIcon",item_r2.pageComponent.template?"aspect_ratio":"no_plugin")}}function ComponentGridComponent_gridster_item_2_Conditional_1_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,ComponentGridComponent_gridster_item_2_Conditional_1_Conditional_0_Template,1,1,"ix-component-loader",4)(1,ComponentGridComponent_gridster_item_2_Conditional_1_Conditional_1_Template,1,3,"ix-invalid-component-placeholder",5),rf&2){let item_r2=\u0275\u0275nextContext().$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275conditional(ctx_r2.itemHasValidDimensionsAndTemplate(item_r2.pageComponent)?0:1)}}function ComponentGridComponent_gridster_item_2_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"gridster-item",3),\u0275\u0275listener("contextmenu",function($event){let item_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemContextMenu($event,item_r2))})("mousedown",function($event){let item_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemClick($event,item_r2))}),\u0275\u0275template(1,ComponentGridComponent_gridster_item_2_Conditional_1_Template,2,1),\u0275\u0275elementEnd()}if(rf&2){let item_r2=ctx.$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275classProp("selected",ctx_r2.isSelectedItem(item_r2)),\u0275\u0275property("item",item_r2),\u0275\u0275advance(),\u0275\u0275conditional(item_r2?1:-1)}}var ComponentGridComponent=(()=>{let _ComponentGridComponent=class _ComponentGridComponent{set pagePageId(pagePageId){this.pagePageId$.next(pagePageId)}set pageVersionId(pageVersionId){this.pageVersionId$.next(pageVersionId)}constructor(cdRef,facade,translate,focusService){this.cdRef=cdRef,this.facade=facade,this.translate=translate,this.focusService=focusService,this.orientation="portrait",this.applicationType="sheet",this.componentChanges=new EventEmitter,this.componentMobileReorder=new EventEmitter,this.componentContextMenu=new EventEmitter,this.gridContextMenu=new EventEmitter,this.selectionChange=new EventEmitter,this.movingGridItem=new EventEmitter,this.gridItems=[],this.ready=!1,this.agentOrAssetId$=new ReplaySubject(1),this.componentChange$=new Subject,this.gridInteraction$=new Subject,this.mobile$=new ReplaySubject(1),this.pagePageId$=new BehaviorSubject(null),this.pageVersionId$=new ReplaySubject(1),this.destroy=inject(DestroyRef)}ngOnInit(){this.focusService.pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>this.select(null)),this.options=this.getGridsterOptions(this.orientation),combineLatest([this.mobile$.pipe(distinctUntilChanged()),this.agentOrAssetId$.pipe(distinctUntilChanged()),combineLatest([this.pageVersionId$,this.pagePageId$]).pipe(switchMap(([pageVersionId,pagePageId])=>this.facade.pageComponents(pageVersionId,pagePageId)),debounceTime(100),distinctUntilChanged(isEqual_default),mergeMap(components=>{let props2=["dimensions.top","dimensions.left","dimensions.cols","dimensions.rows","dimensions.mobileOrder","dimensions.mobileLeft","dimensions.mobileCols","dimensions.mobileHeight","inputs","publicId"],curr=this.gridster?.grid.map(component=>pick_default(component.item.pageComponent,props2)),next=components.map(component=>pick_default(component,props2));return isEqual_default(sortBy_default(curr,"publicId"),sortBy_default(next,"publicId"))?EMPTY:of(cloneDeep_default(components))})),this.facade.templateEntities$,this.facade.manifests$]).pipe(withLatestFrom(combineLatest([this.pageVersionId$,this.pagePageId$]).pipe(switchMap(([pageVersionId,pagePageId])=>this.facade.pageComponents(pageVersionId,pagePageId)))),map(([[mobile,_,__,templates,manifests],components])=>mobile?getMobileGridsterItems(components,templates,manifests):getGridsterItems(components,templates,manifests,this.applicationType)),takeUntilDestroyed(this.destroy)).subscribe(items=>{this.gridItems=items,this.cdRef.markForCheck()}),this.componentChange$.pipe(bufferDebounceTime(100),map(changes=>reduceComponentChanges(changes,this.gridItems,this.mobile)),takeUntilDestroyed(this.destroy)).subscribe(changes=>{this.componentChanges.emit(changes)}),this.facade.templates$.pipe(takeUntilDestroyed(this.destroy)).subscribe(templates=>{this.templates=templates}),this.facade.manifests$.pipe(takeUntilDestroyed(this.destroy)).subscribe(manifests=>{this.manifests=manifests}),this.gridInteraction$.pipe(distinctUntilChanged(),switchMap(({type,value})=>type==="drag"&&value?of(!0).pipe(delay(250)):of(value)),takeUntilDestroyed(this.destroy)).subscribe(interaction=>this.movingGridItem.emit(interaction))}ngOnChanges(changes){changes.agentOrAssetId&&this.agentOrAssetId$.next(this.agentOrAssetId),changes.mobile&&(this.mobile$.next(this.mobile),this.options=this.getGridsterOptions()),changes.orientation&&(this.options=this.getGridsterOptions(this.orientation),this.componentResize())}ngAfterViewInit(){this.componentResize()}componentResize(){setTimeout(()=>{this.gridster?.options.api?.resize?.(),setTimeout(()=>{this.ready=!0,this.cdRef.markForCheck()},150)})}checkCollision(item){return!!this.gridster.checkCollision(item)}getFirstPossiblePosition(item){if(this.options?.api?.getFirstPossiblePosition&&this.options.api.getNextPossiblePosition){if(this.options.api.getNextPossiblePosition(item))return this.options.api.getFirstPossiblePosition(item);if(this.applicationType==="report")return}let y=this.gridItems.reduce((acc,item2)=>Math.max(acc,item2.y+item2.rows),0);if(y+item.rows<=MAX_ROWS)return __spreadProps(__spreadValues({},item),{x:0,y})}handleItemClick(event2,item){event2.stopPropagation(),this.select(item.pageComponent.publicId)}handleItemContextMenu(event2,item){event2.stopPropagation(),this.componentContextMenu.emit({component:item.pageComponent,event:event2})}handleItemDragStart(){this._patchGridster(),this.gridInteraction$.next({type:"drag",value:!0})}handleItemDragStop(){this.gridInteraction$.next({type:"drag",value:!1})}handleItemResizeStart(){this.gridInteraction$.next({type:"resize",value:!0})}handleItemResizeStop(){this.gridInteraction$.next({type:"resize",value:!1})}select(componentId){this.selectionChange.emit(componentId)}isSelectedItem(item){return this.selectedComponentId===item.pageComponent.publicId}getGridsterOptions(orientation=null){return this.applicationType==="report"?__spreadValues({displayGrid:"always",draggable:{enabled:!0,start:()=>this.handleItemDragStart(),stop:()=>this.handleItemDragStop()},gridType:"fixed",fixedColWidth:orientation==="landscape"?COL_WIDTH_REPORT_LANDSCAPE_PX:COL_WIDTH_REPORT_PX,fixedRowHeight:orientation==="landscape"?ROW_HEIGHT_REPORT_LANDSCAPE_PX:ROW_HEIGHT_REPORT_PX,itemChangeCallback:item=>{this.componentChange$.next(item.pageComponent)},setGridSize:!0,margin:GUTTER_SIZE_REPORT_PX,mobileBreakpoint:0,outerMargin:!0,outerMarginTop:OUTER_MARGIN_REPORT_PX,outerMarginRight:OUTER_MARGIN_REPORT_PX,outerMarginBottom:OUTER_MARGIN_REPORT_PX,outerMarginLeft:OUTER_MARGIN_REPORT_PX,resizable:{enabled:!0,start:()=>this.handleItemResizeStart(),stop:()=>this.handleItemResizeStop()},scrollToNewItems:!0,pushDirections:{north:!1,east:!1,south:this.mobile,west:!1},pushItems:this.mobile},orientation==="landscape"?{maxCols:8,maxRows:11,minCols:8,minRows:11}:{maxCols:6,maxRows:16,minCols:6,minRows:16}):{addEmptyRowsCount:this.mobile?8:0,disableScrollHorizontal:!0,displayGrid:"always",draggable:{enabled:!0,start:()=>this.handleItemDragStart(),stop:()=>this.handleItemDragStop()},fixedRowHeight:this.mobile?MOBILE_ROW_HEIGHT_PX:ROW_HEIGHT_PX,gridType:"verticalFixed",itemChangeCallback:item=>{this.componentChange$.next(item.pageComponent)},margin:GUTTER_SIZE_PX,maxCols:COLS,maxRows:this.mobile?1e3:MAX_ROWS,minCols:COLS,minRows:this.mobile?1:MIN_ROWS,maxItemRows:this.mobile?100:50,compactType:this.mobile?"compactUp":void 0,mobileBreakpoint:0,outerMargin:!0,resizable:{enabled:!0,start:()=>this.handleItemResizeStart(),stop:()=>this.handleItemResizeStop()},scrollToNewItems:!0,pushDirections:{north:!1,east:!1,south:this.mobile,west:!1},pushItems:this.mobile,scrollSensitivity:40}}itemHasValidDimensionsAndTemplate(item,template,manifest){return!template&&(template=this.getTemplate(item),!template)?!1:(manifest||(manifest=this.getManifest(template)),this.mobile?itemHasValidMobileMinRows(item,template,manifest)&&itemHasValidMobileMinCols(item,template,manifest):item.dimensions?validateDimensions(item.dimensions,template,manifest).valid:!1)}getPlaceHolderErrorText(item){return this.getTemplate(item)?this.translate.instant("__MESSAGE__.INVALID_COMPONENT_SIZE"):this.translate.instant("SOMETHING_WENT_WRONG")}getPlaceHolderErrorSubText(item){if(!this.getTemplate(item))return this.translate.instant("COMPONENT_FAILED_TO_LOAD");if(this.mobile){let validDimensions=this.getValidDimensions(item,this.mobile),columns=validDimensions.cols,rows=validDimensions.rows;return`Resize to >= ${columns} x ${rows}`}let template=this.getTemplate(item),manifest=this.getManifest(template);if(item.dimensions){let validation=validateDimensions(item.dimensions,template,manifest),settings=resolveTemplateSettings(item.dimensions,template,manifest);return this._getPlaceHolderErrorSubText(validation,settings)}}_getPlaceHolderErrorSubText(validation,settings){let errors2=[];return validation.minCols||errors2.push(this.translate.instant("__MESSAGE__.COMPONENT_SIZE_COL_GE",{minCols:settings.minCols})),validation.maxCols||errors2.push(this.translate.instant("__MESSAGE__.COMPONENT_SIZE_COL_LE",{maxCols:settings.maxCols})),validation.minRows||errors2.push(this.translate.instant("__MESSAGE__.COMPONENT_SIZE_ROW_GE",{minRows:settings.minRows})),validation.maxRows||errors2.push(this.translate.instant("__MESSAGE__.COMPONENT_SIZE_ROW_LE",{maxRows:settings.maxRows})),errors2.join(". ")}selectUniqueHash(_index,item){return(0,import_object_hash.default)({agentOrAssetId:this.agentOrAssetId,component:pick_default(item.pageComponent,["inputs","publicId"])})}getTemplate(component){return this.templates?.find(template=>template.publicId===component.template?.publicId)}getManifest(template){return template?this.manifests?.[template.publicId]:void 0}getValidDimensions(item,isMobile){let template=this.getTemplate(item),manifest=this.getManifest(template),sheetSettings=getPageComponentConfig(template,manifest)?.sheetSettings,rows=sheetSettings?.minRows||1,cols=sheetSettings?.minCols||1;return{rows:isMobile?rowsToMobileRows(rows):rows,cols:isMobile?colsToMobileCols(cols):cols}}_patchGridster(){if(this.gridster){let _ogGrid=this.gridster?.grid;this.gridster.grid=_ogGrid?.map(gridsterItem=>{if(gridsterItem&&!gridsterItem.__patched){let _ogDrag=gridsterItem.drag,_ogDragMove=_ogDrag.dragMove,_ogDragStop=_ogDrag.dragStop;gridsterItem.drag.dragMove=(...args)=>{try{_ogDragMove.apply(_ogDrag,args)}catch(error2){if(error2.name==="TypeError"&&error2.message.includes("(reading 'options')"))console.error(error2);else throw error2}},gridsterItem.drag.dragStop=(...args)=>{try{_ogDragStop.apply(_ogDrag,args)}catch(error2){if(error2.name==="TypeError"&&error2.message.includes("(reading 'renderer')"))console.error(error2),this.gridster.el.querySelector(".gridster-preview")?.removeAttribute("style");else throw error2}},gridsterItem.__patched=!0}return gridsterItem})}}};_ComponentGridComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentGridComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ComponentGridFacade),\u0275\u0275directiveInject(TranslateService),\u0275\u0275directiveInject(ComponentGridFocusService))},_ComponentGridComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ComponentGridComponent,selectors:[["ix-component-grid"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(GridsterComponent,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.gridster=_t.first)}},inputs:{agentOrAssetId:"agentOrAssetId",pagePageId:"pagePageId",pageVersionId:"pageVersionId",orientation:"orientation",mobile:"mobile",applicationType:"applicationType",selectedComponentId:"selectedComponentId"},outputs:{componentChanges:"componentChanges",componentMobileReorder:"componentMobileReorder",componentContextMenu:"componentContextMenu",gridContextMenu:"gridContextMenu",selectionChange:"selectionChange",movingGridItem:"movingGridItem"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:3,vars:7,consts:[[1,"canvas",3,"contextmenu"],[3,"options"],["class","item",3,"item","selected","contextmenu","mousedown",4,"ngFor","ngForOf","ngForTrackBy"],[1,"item",3,"contextmenu","mousedown","item"],[3,"component"],[3,"errorText","errorSubText","svgIcon"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275listener("contextmenu",function($event){return ctx.gridContextMenu.emit({event:$event})}),\u0275\u0275elementStart(1,"gridster",1),\u0275\u0275template(2,ComponentGridComponent_gridster_item_2_Template,2,4,"gridster-item",2),\u0275\u0275elementEnd()()),rf&2&&(\u0275\u0275classProp("mobile",ctx.mobile),\u0275\u0275advance(),\u0275\u0275classProp("ready",ctx.ready),\u0275\u0275property("options",ctx.options),\u0275\u0275advance(),\u0275\u0275property("ngForOf",ctx.gridItems)("ngForTrackBy",ctx.selectUniqueHash.bind(ctx)))},dependencies:[GridsterComponent,GridsterItemComponent,NgForOf,ComponentLoaderComponent,InvalidComponentPlaceholderComponent],styles:['[_nghost-%COMP%]{--card-bg: #fff;--card-border-color: rgb(0 0 0 / 12%);--card-border-width: 1px;--card-color: rgb(0 0 0 / 87%);--card-color-scheme: "light";display:block;height:100%;width:100%;overflow:hidden}[_nghost-%COMP%] .canvas[_ngcontent-%COMP%]{height:100%;width:100%}[_nghost-%COMP%] .item[_ngcontent-%COMP%]{background-color:var(--card-bg);border:var(--card-border-width) solid var(--card-border-color);color:var(--card-color);color-scheme:var(--card-color-scheme);box-shadow:0 1px 2px #0000001f;border-radius:8px!important;overflow:hidden}[_nghost-%COMP%] .item.selected[_ngcontent-%COMP%]{z-index:2!important;border-color:var(--mat-sys-primary);border-width:1px}[_nghost-%COMP%] .item.selected[_ngcontent-%COMP%]:last-child{margin-bottom:40px}[_nghost-%COMP%] .canvas[_ngcontent-%COMP%]:not(.mobile) gridster[_ngcontent-%COMP%] >div:nth-child(84)~div{visibility:hidden}[_nghost-%COMP%] gridster[_ngcontent-%COMP%]{background-color:transparent}[_nghost-%COMP%] gridster[_ngcontent-%COMP%]:not(.ready){visibility:hidden}[_nghost-%COMP%] gridster[_ngcontent-%COMP%]:not(.ready) .gridster-column, [_nghost-%COMP%] gridster[_ngcontent-%COMP%]:not(.ready) .gridster-row{transition:none!important}[_nghost-%COMP%] gridster[_ngcontent-%COMP%] .gridster-column, [_nghost-%COMP%] gridster[_ngcontent-%COMP%] .gridster-row{border-color:#00000014}[_nghost-%COMP%] gridster[_ngcontent-%COMP%] .gridster-column:after{content:" ";display:block;width:100%;height:calc(100% + 16px)}[_nghost-%COMP%] gridster[_ngcontent-%COMP%] .gridster-row{width:calc(100% - 32px)!important}[_nghost-%COMP%] gridster[_ngcontent-%COMP%] >div:last-of-type{border-bottom-color:#00000014!important}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%]{transition-property:transform!important}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .placeholder[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;height:100%}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .placeholder[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{padding:8px}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%]{overflow:visible}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-nw, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-sw, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-ne, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-se{box-sizing:border-box;width:10px;height:10px;border:1px solid var(--primary);background-color:var(--body-bg)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-ne{transform:translate(5px,-5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-nw{transform:translate(-5px,-5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-se{transform:translate(5px,5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-sw{transform:translate(-5px,5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-n:after, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-e:after, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-s:after, [_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-w:after{content:"";display:block;position:absolute;box-sizing:border-box;width:10px;height:10px;border:1px solid var(--primary);background-color:var(--body-bg)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-n:after{left:50%;transform:translate(-5px,-5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-e:after{top:50%;transform:translate(5px,-5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-s:after{left:50%;transform:translate(-5px,5px)}[_nghost-%COMP%] gridster-item.selected[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-w:after{top:50%;transform:translate(-5px,-5px)}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-ne, [_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-sw{cursor:nesw-resize}[_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-nw, [_nghost-%COMP%] gridster-item[_ngcontent-%COMP%] .gridster-item-resizable-handler.handle-se{cursor:nwse-resize}.resize-handle[_ngcontent-%COMP%]{height:10px;width:100%;position:absolute;inset:auto 0 -6px;cursor:ns-resize}.resize-handle[_ngcontent-%COMP%]:after{content:"";display:block;box-sizing:border-box;height:10px;width:10px;position:absolute;bottom:0;left:calc(50% - 5px);background-color:var(--mat-sys-surface);border:1px solid var(--primary)}.height-badge-container[_ngcontent-%COMP%]{position:absolute;inset:auto 0 -26px;z-index:10;display:flex;flex-direction:row;place-content:center;pointer-events:none}.height-badge-container[_ngcontent-%COMP%] .height-badge[_ngcontent-%COMP%]{display:inline-block;margin:0 auto;padding:2px 6px;border-radius:3px;background:var(--ix-blue);font-size:11px;list-style:1;color:#fff;-webkit-user-select:none;user-select:none}.list.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.list-item-placeholder[_ngcontent-%COMP%]{box-sizing:border-box;background-color:rgba(var(--body-color-rgb),.04);border:1px dashed rgba(var(--body-color-rgb),.12);border-radius:8px}.preview[_ngcontent-%COMP%]{box-sizing:border-box;width:340px!important;max-width:calc(100vw - 32px);background-color:#fff;border-radius:8px;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}']});let ComponentGridComponent3=_ComponentGridComponent;return ComponentGridComponent3})();var AppearSchedulerDirective=(()=>{let _AppearSchedulerDirective=class _AppearSchedulerDirective{constructor(){this.cdRef=inject(ChangeDetectorRef),this.scheduler=new Subject,this.destroy=inject(DestroyRef)}ngOnInit(){this.scheduler.pipe(debounceTime(0),takeUntilDestroyed(this.destroy)).subscribe(()=>{this.cdRef.markForCheck()})}ngOnDestroy(){this.scheduler.complete()}schedule(){this.scheduler.next()}};_AppearSchedulerDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppearSchedulerDirective)},_AppearSchedulerDirective.\u0275dir=\u0275\u0275defineDirective({type:_AppearSchedulerDirective,selectors:[["","ixAppearScheduler",""]]});let AppearSchedulerDirective3=_AppearSchedulerDirective;return AppearSchedulerDirective3})();var AppearDirective=(()=>{let _AppearDirective=class _AppearDirective{constructor(cdRef,elementRef){this.cdRef=cdRef,this.elementRef=elementRef,this.disabled=!1,this.appeared=!1,this.scheduler=inject(AppearSchedulerDirective,{optional:!0,skipSelf:!0,host:!0})}ngOnInit(){this.run()}ngOnChanges(changes){changes.disabled&&this.run()}ngOnDestroy(){this.stop()}run(){this.disabled?this.stop():this.start()}start(){this.observer||(this.observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{(entry.isIntersecting||entry.intersectionRatio>0)&&(this.stop(),this.appeared=!0)}),this.appeared&&(this.scheduler?this.scheduler.schedule():this.cdRef.markForCheck())},{rootMargin:"50% 0px",threshold:0}),this.observer.observe(this.elementRef.nativeElement))}stop(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}};_AppearDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppearDirective)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ElementRef))},_AppearDirective.\u0275dir=\u0275\u0275defineDirective({type:_AppearDirective,selectors:[["","ixAppear",""]],inputs:{disabled:[0,"ixAppearDisabled","disabled"]},exportAs:["ixAppear"],features:[\u0275\u0275NgOnChangesFeature]});let AppearDirective3=_AppearDirective;return AppearDirective3})();var import_object_hash2=__toESM(require_object_hash());function resizeComponent(component,template,manifest,origin,destination){if(origin){let height=calcNewComponentHeight(component,template,manifest,origin,destination),dimensions=__spreadProps(__spreadValues({},component.dimensions),{height});return __spreadProps(__spreadValues({},component),{dimensions})}return component}function calcNewComponentHeight(component,template,manifest,origin,destination){if(origin){let componentConfig=getPageComponentConfig(template,manifest),height=component.dimensions?.type==="card"?component.dimensions.height??0:0,offset3=destination.clientY-origin.clientY;return height=height+offset3>=0?height+offset3:0,typeof componentConfig?.cardSettings?.minHeight=="number"&&(height=Math.max(componentConfig.cardSettings.minHeight,height)),typeof componentConfig?.cardSettings?.maxHeight=="number"&&(height=Math.min(componentConfig.cardSettings.maxHeight,height)),height}return component.dimensions?.type==="card"?component.dimensions.height??0:0}function calcTotalCardHeight(components){return components.reduce((accHeight,component)=>accHeight+(component.dimensions?.type==="card"&&component.dimensions.height||0),0)}function calcTotalCardGridHeight(components){return components.map(c=>c.dimensions).reduce((acc,dim,i)=>dim?.type==="card"?acc+(dim.height??0)+(i>0?GUTTER_SIZE_PX:0):acc,0)}function generateCardGridItems(components){return sortBy_default(components,["dimensions.order"]).map((component,i)=>{let dims=component.dimensions,height=dims?.type==="card"?`${dims.height}px`:"auto";return{component,styles:{height,maxHeight:height,width:"100%",marginBottom:i===components.length-1?"0px":`${GUTTER_SIZE_PX}px`}}})}var _c011=a0=>({n:a0});function CardComponentGridComponent_div_2_Conditional_1_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",5),rf&2){let item_r2=\u0275\u0275nextContext().$implicit;\u0275\u0275property("component",item_r2.component)}}function CardComponentGridComponent_div_2_Conditional_2_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-invalid-component-placeholder",6),rf&2){let item_r2=\u0275\u0275nextContext().$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275property("errorText",ctx_r2.getPlaceHolderErrorText(item_r2.component))("errorSubText",ctx_r2.getPlaceHolderErrorSubText(item_r2.component))("svgIcon",item_r2.component.template?"aspect_ratio":"no_plugin")}}function CardComponentGridComponent_div_2_div_3_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"div",12),rf&2){let item_r2=\u0275\u0275nextContext().$implicit;\u0275\u0275styleMap(item_r2.styles)}}function CardComponentGridComponent_div_2_div_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",13),\u0275\u0275element(1,"div",14),\u0275\u0275elementEnd()),rf&2){let item_r2=\u0275\u0275nextContext().$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275styleMap(ctx_r2.getPreviewStyles(item_r2.styles))}}function CardComponentGridComponent_div_2_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",4),\u0275\u0275listener("contextmenu",function($event){let item_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemContextMenu($event,item_r2))})("mousedown",function($event){let item_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemClick($event,item_r2))}),\u0275\u0275template(1,CardComponentGridComponent_div_2_Conditional_1_Template,1,1,"ix-component-loader",5)(2,CardComponentGridComponent_div_2_Conditional_2_Template,1,3,"ix-invalid-component-placeholder",6)(3,CardComponentGridComponent_div_2_div_3_Template,1,2,"div",7)(4,CardComponentGridComponent_div_2_div_4_Template,2,2,"div",8),\u0275\u0275elementStart(5,"div",9),\u0275\u0275listener("mousedown",function($event){\u0275\u0275restoreView(_r1);let ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.handleItemResizeStart($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(6,"div",10)(7,"div",11),\u0275\u0275text(8),\u0275\u0275elementEnd()()()}if(rf&2){let item_r2=ctx.$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275styleMap(item_r2.styles),\u0275\u0275classProp("selected",ctx_r2.isSelectedItem(item_r2)),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r2.itemHasValidDimensionsAndTemplate(item_r2.component)?1:2),\u0275\u0275advance(4),\u0275\u0275property("hidden",!ctx_r2.isSelectedItem(item_r2)),\u0275\u0275advance(),\u0275\u0275property("hidden",!ctx_r2.isSelectedItem(item_r2)),\u0275\u0275advance(2),\u0275\u0275textInterpolate(item_r2.styles.height)}}function CardComponentGridComponent_Conditional_3_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span",3),\u0275\u0275text(1," TOTAL_HEIGHT_OF_CARD_N_PX "),\u0275\u0275elementEnd()),rf&2){let ctx_r2=\u0275\u0275nextContext();\u0275\u0275property("translateParams",\u0275\u0275pureFunction1(1,_c011,ctx_r2.cardHeight))}}var CardComponentGridComponent=(()=>{let _CardComponentGridComponent=class _CardComponentGridComponent{constructor(document2,cdRef,facade,translate,focusService){this.document=document2,this.cdRef=cdRef,this.facade=facade,this.translate=translate,this.focusService=focusService,this.componentContextMenu=new EventEmitter,this.componentReorder=new EventEmitter,this.componentResize=new EventEmitter,this.gridContextMenu=new EventEmitter,this.selectionChange=new EventEmitter,this.resizing=!1,this.agentOrAssetId$=new ReplaySubject(1),this.pageVersionId$=new ReplaySubject(1),this.manifests={},this.destroy=inject(DestroyRef)}ngOnInit(){this.facade.templates$.pipe(takeUntilDestroyed(this.destroy)).subscribe(templates=>{this.templates=templates}),this.facade.manifests$.pipe(takeUntilDestroyed(this.destroy)).subscribe(manifests=>{this.manifests=manifests,this.cdRef.markForCheck()}),this.focusService.pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>this.selectItem(null)),fromEvent(this.document,"mousemove").pipe(takeUntilDestroyed(this.destroy)).subscribe(e=>this.handleMouseMove(e)),fromEvent(this.document,"mouseup").pipe(takeUntilDestroyed(this.destroy)).subscribe(e=>this.handleMouseUp(e)),combineLatest([this.agentOrAssetId$.pipe(distinctUntilChanged()),this.pageVersionId$.pipe(switchMap(pageVersionId=>this.facade.pageComponents(pageVersionId)),distinctUntilChanged(isEqual_default))]).pipe(map(([,components])=>components),takeUntilDestroyed(this.destroy)).subscribe(components=>{this.components=sortBy_default(cloneDeep_default(components),"dimensions.order"),this.gridHeight=calcTotalCardGridHeight(this.components),this.cardHeight=calcTotalCardHeight(this.components),this.items=generateCardGridItems(this.components),this.cdRef.markForCheck()})}ngOnChanges(changes){changes.agentOrAssetId&&this.agentOrAssetId$.next(this.agentOrAssetId),changes.pageVersionId&&this.pageVersionId$.next(this.pageVersionId)}getPlaceHolderErrorText(item){return this.getTemplate(item)?this.translate.instant("__MESSAGE__.INVALID_COMPONENT_SIZE"):this.translate.instant("SOMETHING_WENT_WRONG")}getPlaceHolderErrorSubText(item){if(!this.getTemplate(item))return this.translate.instant("COMPONENT_FAILED_TO_LOAD");let{minHeight,maxHeight}=this.getValidDimensions(item);return maxHeight!==null?`Resize to >= ${minHeight}px and <= ${maxHeight}px`:`Resize to >= ${minHeight}px`}getPreviewStyles(styles){if(this.dragOrigin){let transform=`translate3d(-${this.dragOrigin.offsetX}px,-${this.dragOrigin.offsetY}px,0)`;return __spreadProps(__spreadValues({},styles),{transform})}return styles}getTemplate(component){return this.templates?.find(template=>template.publicId===component.template?.publicId)}getManifest(template){return template?this.manifests?.[template.publicId]:void 0}getValidDimensions(item){let template=this.getTemplate(item),manifest=this.getManifest(template),cardSettings=getPageComponentConfig(template,manifest)?.cardSettings,minHeight=cardSettings?.minHeight||1,maxHeight=cardSettings?.maxHeight||null;return{minHeight,maxHeight}}handleDrop(event2){moveItemInArray(this.components,event2.previousIndex,event2.currentIndex),this.components=this.components.map((c,i)=>__spreadProps(__spreadValues({},c),{dimensions:__spreadProps(__spreadValues({},c.dimensions),{order:(i+1)*10})})),this.items=generateCardGridItems(this.components),this.componentReorder.emit(this.components.map(c=>c.publicId)),this.dragOrigin=null}handleCanvasMouseDown(){this.selectItem(null),this.resizeOrigin=null,this.resizing=!1}handleItemClick(event2,item){event2.stopPropagation(),this.dragOrigin=event2,this.selectItem(item.component.publicId)}handleItemContextMenu(event2,item){event2.stopPropagation(),this.componentContextMenu.emit({component:item.component,event:event2})}handleItemResizeStart(event2){event2.stopPropagation(),this.resizeOrigin=event2,this.resizing=!0}handleMouseMove(event2){let selectedComponent=this.components?.find(c=>c.publicId===this.selectedComponentId),selectedComponentTemplate=this.templates?.find(t=>t.publicId===selectedComponent?.template?.publicId),selectedComponentTemplateManifest=selectedComponentTemplate?.publicId?this.manifests[selectedComponentTemplate.publicId]:void 0;if(selectedComponent&&selectedComponentTemplate&&this.resizeOrigin){let components=this.components.map(component=>component.publicId===selectedComponent.publicId?resizeComponent(component,selectedComponentTemplate,selectedComponentTemplateManifest,this.resizeOrigin,event2):component);this.cardHeight=calcTotalCardHeight(components),this.gridHeight=calcTotalCardGridHeight(components),this.items=generateCardGridItems(components),this.cdRef.markForCheck()}}handleMouseUp(event2){let selectedComponent=this.components?.find(c=>c.publicId===this.selectedComponentId),selectedComponentTemplate=this.templates?.find(t=>t.publicId===selectedComponent?.template?.publicId),selectedComponentTemplateManifest=selectedComponentTemplate?.publicId?this.manifests[selectedComponentTemplate.publicId]:void 0;selectedComponent&&selectedComponentTemplate&&this.resizeOrigin&&(this.components=this.components.map(component=>component.publicId===selectedComponent.publicId?resizeComponent(component,selectedComponentTemplate,selectedComponentTemplateManifest,this.resizeOrigin,event2):component),this.cardHeight=calcTotalCardHeight(this.components),this.gridHeight=calcTotalCardGridHeight(this.components),this.items=generateCardGridItems(this.components),this.componentResize.emit({componentId:selectedComponent.publicId,height:calcNewComponentHeight(selectedComponent,selectedComponentTemplate,selectedComponentTemplateManifest,this.resizeOrigin,event2)})),this.resizeOrigin=null,this.resizing=!1,this.cdRef.markForCheck()}itemHasValidDimensionsAndTemplate(item){let template=this.getTemplate(item);return template&&item.dimensions?validateDimensions(item.dimensions,template,this.getManifest(template)).valid:!1}isSelectedItem(item){return this.selectedComponentId===item.component.publicId}selectItem(componentId){this.selectionChange.emit(componentId)}selectUniqueHash(index,item){return(0,import_object_hash2.default)({agentOrAssetId:this.agentOrAssetId,component:pick_default(item.component,["inputs","publicId"])})}};_CardComponentGridComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CardComponentGridComponent)(\u0275\u0275directiveInject(DOCUMENT),\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ComponentGridFacade),\u0275\u0275directiveInject(TranslateService),\u0275\u0275directiveInject(ComponentGridFocusService))},_CardComponentGridComponent.\u0275cmp=\u0275\u0275defineComponent({type:_CardComponentGridComponent,selectors:[["ix-card-component-grid"]],inputs:{agentOrAssetId:"agentOrAssetId",pageVersionId:"pageVersionId",selectedComponentId:"selectedComponentId"},outputs:{componentContextMenu:"componentContextMenu",componentReorder:"componentReorder",componentResize:"componentResize",gridContextMenu:"gridContextMenu",selectionChange:"selectionChange"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:4,vars:7,consts:[[1,"canvas",3,"mousedown","contextmenu"],["cdkDropList","",1,"grid",3,"cdkDropListDropped"],["class","item","cdkDrag","",3,"style","selected","contextmenu","mousedown",4,"ngFor","ngForOf","ngForTrackBy"],["translate","",1,"total-height",3,"translateParams"],["cdkDrag","",1,"item",3,"contextmenu","mousedown"],[3,"component"],[3,"errorText","errorSubText","svgIcon"],["class","grid-item-placeholder",3,"style",4,"cdkDragPlaceholder"],["class","grid-item-preview",4,"cdkDragPreview"],[1,"resize-handle",3,"mousedown","hidden"],[1,"height-badge-container",3,"hidden"],[1,"height-badge"],[1,"grid-item-placeholder"],[1,"grid-item-preview"],[1,"preview"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275listener("mousedown",function(){return ctx.handleCanvasMouseDown()})("contextmenu",function($event){return ctx.gridContextMenu.emit({event:$event})}),\u0275\u0275elementStart(1,"div",1),\u0275\u0275listener("cdkDropListDropped",function($event){return ctx.handleDrop($event)}),\u0275\u0275template(2,CardComponentGridComponent_div_2_Template,9,8,"div",2)(3,CardComponentGridComponent_Conditional_3_Template,2,3,"span",3),\u0275\u0275elementEnd()()),rf&2&&(\u0275\u0275classProp("resizing",ctx.resizing),\u0275\u0275advance(),\u0275\u0275styleProp("height",ctx.gridHeight,"px"),\u0275\u0275advance(),\u0275\u0275property("ngForOf",ctx.items)("ngForTrackBy",ctx.selectUniqueHash.bind(ctx)),\u0275\u0275advance(),\u0275\u0275conditional(ctx.cardHeight?3:-1))},dependencies:[NgForOf,CdkDropList,CdkDrag,CdkDragPreview,CdkDragPlaceholder,ComponentLoaderComponent,TranslateDirective,InvalidComponentPlaceholderComponent],styles:['[_nghost-%COMP%]{display:block;height:100%}[_nghost-%COMP%] .canvas[_ngcontent-%COMP%]{box-sizing:border-box;display:flex;flex-direction:column;height:100%;padding:16px}[_nghost-%COMP%] .canvas.resizing[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none;cursor:ns-resize}[_nghost-%COMP%] .grid[_ngcontent-%COMP%]{position:relative;width:100%;max-width:300px;margin:auto}[_nghost-%COMP%] .grid[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{position:relative;box-sizing:border-box;border:1px dashed rgba(var(--body-color-rgb),.18)}[_nghost-%COMP%] .grid[_ngcontent-%COMP%] .item.selected[_ngcontent-%COMP%]{border-style:solid;border-color:var(--primary);background-color:var(--mat-sys-surface)}[_nghost-%COMP%] .total-height[_ngcontent-%COMP%]{margin-top:40px;margin-bottom:-40px;padding-bottom:8px;display:block;text-align:center;font-size:12px}.resize-handle[_ngcontent-%COMP%]{height:10px;width:100%;position:absolute;inset:auto 0 -6px;cursor:ns-resize}.resize-handle[_ngcontent-%COMP%]:after{content:"";display:block;box-sizing:border-box;height:10px;width:10px;position:absolute;bottom:0;left:calc(50% - 5px);background-color:#fff;border:1px solid var(--ix-blue)}.height-badge-container[_ngcontent-%COMP%]{position:absolute;inset:auto 0 -26px;z-index:10;display:flex;flex-direction:row;place-content:center;pointer-events:none}.height-badge-container[_ngcontent-%COMP%] .height-badge[_ngcontent-%COMP%]{display:inline-block;margin:0 auto;padding:2px 6px;border-radius:3px;background:var(--ix-blue);font-size:11px;list-style:1;color:#fff;-webkit-user-select:none;user-select:none}.grid.cdk-drop-list-dragging[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}.grid-item-placeholder[_ngcontent-%COMP%]{box-sizing:border-box;background-color:rgba(var(--body-color-rgb),.04);border:1px dashed rgba(var(--body-color-rgb),.12)}.preview[_ngcontent-%COMP%]{box-sizing:border-box;width:300px!important;background-color:#fff;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}'],changeDetection:0});let CardComponentGridComponent3=_CardComponentGridComponent;return CardComponentGridComponent3})();var ReportCalculationsStrategy=class{calcGridWidth(components,orientation="portrait"){let colWidth=orientation==="portrait"?COL_WIDTH_REPORT_MM:ROW_HEIGHT_REPORT_MM;if(components){let gridCols=components.reduce((max2,curr)=>{let sum=(curr.dimensions?.left??0)+(curr.dimensions.cols??0);return sum>max2?sum:max2},0),maxWidth=gridCols*colWidth+Math.max(gridCols-1,0)*GUTTER_SIZE_REPORT_MM;return maxWidth!==0?maxWidth+"mm":null}return null}calcGridHeightFactory(){return function(){return"100%"}}generateItemsFactory(isMobile,orientation="portrait"){let[rowHeight,colWidth]=orientation==="portrait"?[ROW_HEIGHT_REPORT_MM,COL_WIDTH_REPORT_MM]:[ROW_HEIGHT_REPORT_LANDSCAPE_MM,COL_WIDTH_REPORT_LANDSCAPE_MM];return function(components){return components?.map(c=>{let dims=c.dimensions||{},rows=dims.rows??0,cols=dims.cols??0,left2=dims.left??0,top2=dims.top??0;return{component:c,styles:{position:"absolute",height:`${rows*rowHeight+Math.max(rows-1,0)*GUTTER_SIZE_REPORT_MM}mm`,width:`${cols*colWidth+Math.max(cols-1,0)*GUTTER_SIZE_REPORT_MM}mm`,left:`${left2*colWidth+left2*GUTTER_SIZE_REPORT_MM}mm`,top:`${top2*rowHeight+top2*GUTTER_SIZE_REPORT_MM}mm`}}})??[]}}};var SheetCalculationsStrategy=class{calcGridWidth(){return null}calcGridHeightFactory(isMobile){let gutter=GUTTER_SIZE_PX,rowHeight=isMobile?MOBILE_ROW_HEIGHT_PX:ROW_HEIGHT_PX;return function(components){if(components.every(c=>c.dimensions?.type==="card"))return`${components.map(c=>c.dimensions).reduce((acc,dim,i)=>dim?.type==="card"?acc+(dim.height??0)+(i>0?gutter:0):acc,0)}px`;let gridRows=(isMobile?sortBy_default(components,["dimensions.mobileOrder","dimensions.top","dimensions.left"]):components).reduce((max2,curr,i,all)=>{if(curr?.dimensions?.type==="sheet"){let sum=isMobile?getMobileTop(curr,all.slice(0,i))+getMobileRows(curr):(curr?.dimensions?.top??0)+(curr?.dimensions?.rows??0);return sum>max2?sum:max2}return max2},0);return`${gridRows*rowHeight+(gridRows>0?gridRows-1:0)*gutter}px`}}generateItemsFactory(isMobile){let gutter=GUTTER_SIZE_PX,rowHeight=isMobile?MOBILE_ROW_HEIGHT_PX:ROW_HEIGHT_PX,totalCols=COLS;return function(components){let colGap=Math.round(gutter/totalCols*(totalCols-1)*1e4)/1e4,colWidth=Math.round(100/totalCols*1e5)/1e5;return(isMobile?sortBy_default(components,["dimensions.mobileOrder","dimensions.top","dimensions.left"]):components).filter(component=>component.dimensions?.type==="sheet").map((component,i,all)=>{let dims=component.dimensions,rows=isMobile?getMobileRows(component):dims?.rows??0,cols=isMobile?getMobileCols(component):dims?.cols??0,left2=isMobile?getMobileLeft(component):dims?.left??0,top2=isMobile?getMobileTop(component,all.slice(0,i)):dims?.top??0;return{component,styles:{position:"absolute",height:`${rows*rowHeight+(rows>0?rows-1:0)*gutter}px`,width:`calc((${colWidth}% - ${colGap}px) * ${cols} + ${(cols>0?cols-1:0)*gutter}px)`,left:`calc((${colWidth}% - ${colGap}px + ${gutter}px) * ${left2})`,top:`${top2*rowHeight+top2*gutter}px`}}})}}};function getCalculationsStrategy(applicationType){switch(applicationType){case"sheet":return sheet();case"report":return report();case"card":return sheet();default:throw new Error("Unknown application type")}}function sheet(){return new SheetCalculationsStrategy}function report(){return new ReportCalculationsStrategy}function SimpleComponentGridComponent_For_2_Conditional_2_Conditional_0_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",5),rf&2){let item_r1=\u0275\u0275nextContext(2).$implicit;\u0275\u0275property("component",item_r1.component)}}function SimpleComponentGridComponent_For_2_Conditional_2_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,SimpleComponentGridComponent_For_2_Conditional_2_Conditional_0_Template,1,1,"ix-component-loader",5),rf&2){let item_r1=\u0275\u0275nextContext().$implicit,appearance_r2=\u0275\u0275reference(1);\u0275\u0275conditional((item_r1.component.dimensions==null?null:item_r1.component.dimensions.type)==="report"||appearance_r2.appeared?0:-1)}}function SimpleComponentGridComponent_For_2_Conditional_3_Template(rf,ctx){rf&1&&(\u0275\u0275element(0,"ix-invalid-component-placeholder",4),\u0275\u0275pipe(1,"translate"),\u0275\u0275pipe(2,"translate")),rf&2&&\u0275\u0275property("errorText",\u0275\u0275pipeBind1(1,2,"SOMETHING_WENT_WRONG"))("errorSubText",\u0275\u0275pipeBind1(2,4,"COMPONENT_FAILED_TO_LOAD"))}function SimpleComponentGridComponent_For_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",3,0),\u0275\u0275template(2,SimpleComponentGridComponent_For_2_Conditional_2_Template,1,1)(3,SimpleComponentGridComponent_For_2_Conditional_3_Template,3,6,"ix-invalid-component-placeholder",4),\u0275\u0275elementEnd()),rf&2){let item_r1=ctx.$implicit;\u0275\u0275styleMap(item_r1.styles),\u0275\u0275advance(2),\u0275\u0275conditional(item_r1.component.template?2:3)}}var SimpleComponentGridComponent=(()=>{let _SimpleComponentGridComponent=class _SimpleComponentGridComponent{set agentOrAssetId(agentOrAssetId){this.agentOrAssetId$.next(agentOrAssetId)}set pageVersionId(pageVersionId){this.pageVersionId$.next(pageVersionId)}constructor(cdRef,observer,facade){this.cdRef=cdRef,this.observer=observer,this.facade=facade,this.orientation="portrait",this.applicationType="sheet",this.agentOrAssetId$=new ReplaySubject(1),this.destroy=inject(DestroyRef),this.pageVersionId$=new ReplaySubject(1)}ngOnInit(){this.strategy=getCalculationsStrategy(this.applicationType),combineLatest([this.agentOrAssetId$.pipe(distinctUntilChanged()),this.observer.observe(`(max-width: ${MOBILE_BREAKPOINT_PX-1}px)`).pipe(map(breakpoint=>this.mobile??breakpoint.matches)),this.pageVersionId$.pipe(switchMap(pageVersionId=>this.facade.pageComponents(pageVersionId,this.pagePageId)),distinctUntilChanged(isEqual_default))]).pipe(takeUntilDestroyed(this.destroy)).subscribe(([,isMobile,components])=>{this.components=components,this.gridHeight=this.strategy.calcGridHeightFactory(isMobile)(this.components),this.gridWidth=this.strategy.calcGridWidth(this.components,this.orientation),this.items=this.strategy.generateItemsFactory(isMobile,this.orientation)(this.components),this.cdRef.markForCheck()})}ngOnChanges(changes){changes.mobile&&this.components&&(this.gridHeight=this.strategy.calcGridHeightFactory(this.mobile)(this.components),this.items=this.strategy.generateItemsFactory(this.mobile)(this.components)),changes.orientation&&this.strategy&&(this.gridWidth=this.strategy.calcGridWidth(this.components,this.orientation),this.items=this.strategy.generateItemsFactory(this.mobile,this.orientation)(this.components))}};_SimpleComponentGridComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SimpleComponentGridComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(BreakpointObserver),\u0275\u0275directiveInject(ComponentGridFacade))},_SimpleComponentGridComponent.\u0275cmp=\u0275\u0275defineComponent({type:_SimpleComponentGridComponent,selectors:[["ix-simple-component-grid"]],inputs:{agentOrAssetId:"agentOrAssetId",pageVersionId:"pageVersionId",orientation:"orientation",applicationType:"applicationType",pagePageId:"pagePageId",mobile:"mobile"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:3,vars:4,consts:[["appearance","ixAppear"],["ixAppearScheduler","",1,"grid"],["ixAppear","",1,"item",3,"style"],["ixAppear","",1,"item"],[3,"errorText","errorSubText"],[3,"component"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",1),\u0275\u0275repeaterCreate(1,SimpleComponentGridComponent_For_2_Template,4,3,"div",2,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275styleProp("height",ctx.gridHeight)("max-width",ctx.gridWidth),\u0275\u0275advance(),\u0275\u0275repeater(ctx.items))},dependencies:[ComponentLoaderComponent,AppearDirective,AppearSchedulerDirective,InvalidComponentPlaceholderComponent,TranslatePipe],styles:["[_nghost-%COMP%]{display:block;padding:16px}[_nghost-%COMP%] .grid[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .grid[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{position:relative;box-sizing:border-box;background-color:var(--card-bg);border:var(--card-border-width) solid var(--card-border-color);color:var(--card-color);color-scheme:var(--card-color-scheme);border-radius:8px;overflow:hidden;z-index:100}"],changeDetection:0});let SimpleComponentGridComponent3=_SimpleComponentGridComponent;return SimpleComponentGridComponent3})();function calcGridHeight(components){return components.reduce((acc,component)=>component.dimensions?.type==="card"?acc+(component.dimensions.height??0):acc,0)}function generateItems(components){return sortBy_default(components,["dimensions.order"]).map(component=>{let height=component.dimensions?.type==="card"?`${component.dimensions.height}px`:"auto";return{component,styles:{height,maxHeight:height,width:"100%"}}})}function SimpleCardComponentGridComponent_For_2_Conditional_1_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",3),rf&2){let item_r1=\u0275\u0275nextContext().$implicit;\u0275\u0275property("component",item_r1.component)}}function SimpleCardComponentGridComponent_For_2_Conditional_2_Template(rf,ctx){rf&1&&(\u0275\u0275element(0,"ix-invalid-component-placeholder",4),\u0275\u0275pipe(1,"translate"),\u0275\u0275pipe(2,"translate")),rf&2&&\u0275\u0275property("errorText",\u0275\u0275pipeBind1(1,2,"SOMETHING_WENT_WRONG"))("errorSubText",\u0275\u0275pipeBind1(2,4,"COMPONENT_FAILED_TO_LOAD"))}function SimpleCardComponentGridComponent_For_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",2),\u0275\u0275template(1,SimpleCardComponentGridComponent_For_2_Conditional_1_Template,1,1,"ix-component-loader",3)(2,SimpleCardComponentGridComponent_For_2_Conditional_2_Template,3,6,"ix-invalid-component-placeholder",4),\u0275\u0275elementEnd()),rf&2){let item_r1=ctx.$implicit;\u0275\u0275styleMap(item_r1.styles),\u0275\u0275advance(),\u0275\u0275conditional(item_r1.component.template?1:2)}}var SimpleCardComponentGridComponent=(()=>{let _SimpleCardComponentGridComponent=class _SimpleCardComponentGridComponent{set pageVersionId(pageVersionId){this.pageVersionId$.next(pageVersionId)}constructor(cdRef,facade){this.cdRef=cdRef,this.facade=facade,this.pageVersionId$=new ReplaySubject(1),this.destroy=inject(DestroyRef)}ngOnInit(){this.pageVersionId$.pipe(switchMap(pageVersionId=>this.facade.pageComponents(pageVersionId)),distinctUntilChanged(isEqual_default),takeUntilDestroyed(this.destroy)).subscribe(components=>{this.gridHeight=calcGridHeight(components),this.items=generateItems(components),this.cdRef.markForCheck()})}};_SimpleCardComponentGridComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SimpleCardComponentGridComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ComponentGridFacade))},_SimpleCardComponentGridComponent.\u0275cmp=\u0275\u0275defineComponent({type:_SimpleCardComponentGridComponent,selectors:[["ix-simple-card-component-grid"]],inputs:{agentOrAssetId:"agentOrAssetId",pageVersionId:"pageVersionId"},standalone:!1,decls:3,vars:2,consts:[[1,"grid"],[1,"item",3,"style"],[1,"item"],[3,"component"],[3,"errorText","errorSubText"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275repeaterCreate(1,SimpleCardComponentGridComponent_For_2_Template,3,3,"div",1,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275styleProp("height",ctx.gridHeight,"px"),\u0275\u0275advance(),\u0275\u0275repeater(ctx.items))},dependencies:[ComponentLoaderComponent,InvalidComponentPlaceholderComponent,TranslatePipe],styles:["[_nghost-%COMP%]{display:block;padding:16px}[_nghost-%COMP%] .grid[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .grid[_ngcontent-%COMP%] .item[_ngcontent-%COMP%]{position:relative;box-sizing:border-box}"],changeDetection:0});let SimpleCardComponentGridComponent3=_SimpleCardComponentGridComponent;return SimpleCardComponentGridComponent3})();var ComponentGridModule=(()=>{let _ComponentGridModule=class _ComponentGridModule{};_ComponentGridModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentGridModule)},_ComponentGridModule.\u0275mod=\u0275\u0275defineNgModule({type:_ComponentGridModule}),_ComponentGridModule.\u0275inj=\u0275\u0275defineInjector({providers:[ComponentGridFacade],imports:[GridsterModule,CommonModule,LayoutModule,DragDropModule,ComponentLoaderModule,TranslateModule,InvalidComponentPlaceholderComponent]});let ComponentGridModule2=_ComponentGridModule;return ComponentGridModule2})();var AGENT_LIST_FIELDS=buildFields(`
747
747
  {
748
748
  activeStatus
749
749
  assets { publicId reference { name } }
@@ -832,9 +832,9 @@ ${end2.comment}`:end2.comment}this.doc.range[2]=end2.offset;break}default:this.e
832
832
  }
833
833
  `);var FEATURE_NAME51="label";var adapter46=createResourceAdapter({sortComparer:sortByNameAndPublicIdComparer}),initialState51=adapter46.getInitialState(),reducer45=createReducer(initialState51,on(reset62,()=>__spreadValues({},initialState51)),on(addSuccess38,didAdd55,(state,{data})=>adapter46.upsertOne(data,state)),on(loadAll44,state=>__spreadProps(__spreadValues({},state),{allLoading:!0})),on(loadAllFailure44,state=>__spreadProps(__spreadValues({},state),{allLoading:!1})),on(loadAllSuccess45,(state,{data})=>adapter46.setAll(data,__spreadProps(__spreadValues({},state),{allLoading:!1,allLoaded:!0}))),on(removeSuccess39,didRemove51,(state,{publicId})=>adapter46.removeOne(publicId,state)),on(updateSuccess38,didUpdate51,(state,{data,publicId})=>adapter46.updateOne({id:publicId,changes:data},state))),feature45=createFeature({name:FEATURE_NAME51,reducer:reducer45});var selectAll45=createSelector(feature45.selectLabelState,adapter46.getSelectors().selectAll),{selectAllLoading:selectAllLoading34,selectAllLoaded:selectAllLoaded34,selectEntities:selectEntities38}=feature45;var FEATURE_NAME52="pageBuilderIsUpdating";var initialState52={isUpdating:!1},reducer46=createReducer(initialState52,on(update,update42,add,remove,state=>__spreadProps(__spreadValues({},state),{isUpdating:!0})),on(updateSuccess,updateSuccess42,addSuccess,removeSuccess,state=>__spreadProps(__spreadValues({},state),{isUpdating:!1}))),feature46=createFeature({name:FEATURE_NAME52,reducer:reducer46});var{selectIsUpdating}=feature46;var FEATURE_NAME53="pageBuilderErrors";var initialState53={manifests:[],templates:[],componentErrors:[]},reducer47=createReducer(initialState53,on(loadAllSuccess,(state,props2)=>{let templates=props2.data.map(template=>({publicId:template.publicId,sheetSettings:template.sheetSettings})),stateWithTemplates=__spreadProps(__spreadValues({},state),{templates});return state.componentErrors.length===0?stateWithTemplates:checkComponentsForErrors(stateWithTemplates)}),on(loadManySuccess,(state,{data})=>checkComponentsForErrors(__spreadProps(__spreadValues({},state),{manifests:data}))),on(loadDetailsSuccess3,(state,{data})=>addNewComponentErrors(__spreadProps(__spreadValues({},state),{componentErrors:[]}),data.draft?.components||[],data.draft?.publicId)),on(add,didAdd,(state,{data})=>addNewComponentErrors(state,[data])),on(didAddList,(state,{data})=>addNewComponentErrors(state,data)),on(remove,didRemove,(state,{publicId})=>removeComponentError(state,publicId)),on(didRemoveList,(state,{publicIdList})=>removeManyComponentErrors(state,publicIdList)),on(update,didUpdate,(state,{data})=>updateManyComponentErrors(state,[data])),on(updateMany,didUpdateList,(state,{data})=>updateManyComponentErrors(state,data)),on(discardDraft,resetPendingUpdates,state=>__spreadProps(__spreadValues({},state),{componentErrors:[]}))),feature47=createFeature({name:FEATURE_NAME53,reducer:reducer47});function dimensionErrors(component,template,manifest){if(component.dimensions?.type)switch(component.dimensions.type){case"card":return{type:"card",invalidMinHeight:!itemHasValid("min","height",component.dimensions,template,manifest),invalidMaxHeight:!itemHasValid("max","height",component.dimensions,template,manifest)};case"report":return{type:"report",invalidMinRows:!itemHasValid("min","rows",component.dimensions,template,manifest),invalidMinCols:!itemHasValid("min","cols",component.dimensions,template,manifest),invalidMaxRows:!itemHasValid("max","rows",component.dimensions,template,manifest),invalidMaxCols:!itemHasValid("max","cols",component.dimensions,template,manifest)};case"sheet":return{type:"sheet",invalidMinRows:!itemHasValid("min","rows",component.dimensions,template,manifest),invalidMinCols:!itemHasValid("min","cols",component.dimensions,template,manifest),invalidMaxRows:!itemHasValid("max","rows",component.dimensions,template,manifest),invalidMaxCols:!itemHasValid("max","cols",component.dimensions,template,manifest),invalidMobileMinRows:!itemHasValidMobileMinRows(component,template,manifest),invalidMobileMinCols:!itemHasValidMobileMinCols(component,template,manifest)}}}function checkComponentsForErrors(state){let componentErrors=state.componentErrors.map(componentError=>{let template=state.templates.find(template2=>template2.publicId===componentError.templateId),manifest=state.manifests.find(manifest2=>manifest2.template.publicId===componentError.templateId);return __spreadProps(__spreadValues({},componentError),{dimensionErrors:template?dimensionErrors(componentError.component,template,manifest):void 0,templateId:template?.publicId||null})});return __spreadProps(__spreadValues({},state),{componentErrors})}function updateManyComponentErrors(state,components){let componentErrors=state.componentErrors.map(componentError=>{let newValues=components.find(x=>x.publicId===componentError.component.publicId);if(newValues?.dimensions){let template=state.templates.find(template2=>template2.publicId===componentError.templateId),manifest=state.manifests.find(manifest2=>manifest2.template.publicId===componentError.templateId);return __spreadProps(__spreadValues({},componentError),{dimensionErrors:template?dimensionErrors(newValues,template,manifest):void 0})}return componentError});return __spreadProps(__spreadValues({},state),{componentErrors})}function addNewComponentErrors(state,components,providedPageVersionId){let alreadyCreatedComponents=state.componentErrors.map(a=>a.component.publicId),newComponentErrors=components.filter(component=>component.publicId&&!alreadyCreatedComponents.includes(component.publicId)).map(component=>{let templateId=component.template?.publicId||null,template=state.templates.find(template2=>template2.publicId===templateId),manifest=state.manifests.find(manifest2=>manifest2.template.publicId===templateId),pageVersionId=component.pageVersion?.publicId||providedPageVersionId||null;return template?{pageVersionId,component,templateId,dimensionErrors:dimensionErrors(component,template,manifest)}:{pageVersionId,component,templateId,dimensionErrors:void 0}}),componentErrors=[...state.componentErrors,...newComponentErrors];return __spreadProps(__spreadValues({},state),{componentErrors})}function removeComponentError(state,componentId){return __spreadProps(__spreadValues({},state),{componentErrors:state?.componentErrors?.filter(componentError=>componentError.component.publicId!==componentId)})}function removeManyComponentErrors(state,componentIdList){return __spreadProps(__spreadValues({},state),{componentErrors:state?.componentErrors?.filter(componentError=>!componentIdList.includes(componentError.component.publicId))})}var selectComponentErrorsForPageVersion=versionId=>createSelector(feature47.selectComponentErrors,errors2=>errors2.filter(error2=>error2.pageVersionId===versionId));var AbstractBuilderFacade=class{constructor(actions$,store,componentTemplatesFacade){this.actions$=actions$,this.store=store,this.componentTemplatesFacade=componentTemplatesFacade,this.busyUpdating$=this.store.select(selectIsUpdating).pipe(switchMap(isUpdating=>isUpdating?of(!0):timer(500).pipe(map(()=>!1))),distinctUntilChanged()),this.pageComponentAddSuccess$=this.actions$.pipe(ofType(addSuccess)),this.pageComponentRemoveSuccess$=this.actions$.pipe(ofType(removeSuccess))}componentTemplates(pageId){let templates$=this.componentTemplatesFacade?.templates$;return templates$?combineLatest([this.page(pageId),templates$]).pipe(map(([page,templates])=>orderBy_default(templates.filter(t=>this.isTemplateForBuilder(page,t,t.manifest)),"name"))):EMPTY}draftVersionComponentErrors(publicId){return this.store.select(selectComponentErrorsForPageVersion(publicId))}componentTemplate(component$){return component$.pipe(switchMap(component=>component?.template?.publicId?this.store.select(selectEntity(component.template.publicId)).pipe(map(template=>template||null)):of(null)))}defaultRefreshRate(pageId){return this.draftVersionByPageId(pageId).pipe(map(draft=>draft.defaultRefreshRate||0),distinctUntilChanged())}draftVersionByPageId(publicId){return combineLatest([this.store.select(selectEntity9(publicId)),this.store.select(selectEntities26),this.store.select(selectEntities33)]).pipe(mergeMap(([page,versionEntities,componentEntities])=>{if(page?.draft){let pageVersion=versionEntities[page.draft.publicId];if(pageVersion)return of(__spreadProps(__spreadValues({},pageVersion),{components:pageVersion.components?.map(c=>componentEntities[c.publicId]||c)}))}return EMPTY}))}page(publicId){return this.store.select(selectEntity9(publicId)).pipe(mergeMap(page=>page?of(page):EMPTY))}pageComponent(publicId){return this.store.select(selectEntity16(publicId))}pageComponentTemplate(componentId){return componentId?combineLatest([this.store.select(selectEntity16(componentId)),this.store.select(selectAll)]).pipe(map(([component,templates])=>templates.find(t=>t.publicId===component?.template?.publicId)||null),distinctUntilChanged((t1,t2)=>t1?.publicId===t2?.publicId)):of(null)}pageComponentTemplateManifest(componentId){return componentId?this.store.select(selectEntity16(componentId)).pipe(switchMap(pageComponent=>{let templateId=pageComponent?.template?.publicId;return templateId?this.store.select(selectEntity2(templateId)).pipe(map(m=>m??null)):of(null)})):of(null)}pageComponentTemplateWithManifest(pageComponentTemplatedId){return pageComponentTemplatedId?combineLatest([this.store.select(selectEntity(pageComponentTemplatedId)),this.store.select(selectEntities2)]).pipe(map(([template,manifests])=>template?manifests[template.publicId]?__spreadProps(__spreadValues({},template),{manifest:manifests[template.publicId]}):template:null),distinctUntilChanged((t1,t2)=>t1?.publicId===t2?.publicId)):of(null)}pageComponents(pageId){return combineLatest([this.draftVersionByPageId(pageId),this.store.select(selectAll)]).pipe(map(([pageVersion,templates])=>(pageVersion.components||[]).map(component=>component.template?__spreadProps(__spreadValues({},component),{pageVersion,template:templates.find(t=>t.publicId===component?.template?.publicId)||component.template}):component)))}pageLabels(pageId){return combineLatest([this.store.select(selectEntity9(pageId)),this.store.select(selectEntities38)]).pipe(map(([page,labelEntities])=>compact_default(page?.labels?.map(label=>labelEntities[label.publicId])).sort(sortByNameAndPublicIdComparer)))}periodSelectorEnabled(pageId){return this.draftVersionByPageId(pageId).pipe(map(draft=>!!draft.periodSelectorEnabled),distinctUntilChanged())}periodSpec(pageId){return this.draftVersionByPageId(pageId).pipe(map(draft=>draft.periodSpec||DEFAULT_PERIOD_SPEC),distinctUntilChanged())}loadAgents(){this.store.dispatch(ensureAllActive({fields:AGENT_LIST_FIELDS}))}loadAgentTemplates(){this.store.dispatch(ensureAll29({fields:AGENT_TEMPLATE_LIST_FIELDS}))}loadCustomProperties(){this.store.dispatch(ensureAll36())}loadGroups(){this.store.dispatch(ensureAll9())}loadLabels(){this.store.dispatch(ensureAll38())}loadPage(publicId){this.store.dispatch(loadDetails3({publicId,fields:PAGE_DETAILS_FIELDS2}))}loadPageComponentTemplates(){this.store.dispatch(ensureAll())}loadPageComponentTemplateCategories(){this.store.dispatch(ensureAll49())}addComponent(component){this.store.dispatch(add({data:component}))}removeComponent(publicId){this.store.dispatch(remove({publicId}))}updateComponent(publicId,update47){this.store.dispatch(update({publicId,data:update47}))}updateComponentList(updates){this.store.dispatch(updateMany({data:updates}))}reset(){this.store.dispatch(resetPendingUpdates())}updatePageVersion(publicId,data){this.store.dispatch(update42({publicId,data}))}updatePage(publicId,data){this.store.dispatch(update39({publicId,data}))}pageVersionTitleTranslationKey(pageId){return this.draftVersionByPageId(pageId).pipe(switchMap(version2=>this.store.select(selectTitleTranslationKey(version2.publicId))))}};var PagePreviewDeviceFacade=(()=>{let _PagePreviewDeviceFacade=class _PagePreviewDeviceFacade{constructor(){this.store=inject(Store),this.features=inject(PlatformFeaturesService),this.options$=combineLatest([this.store.select(selectAllActive),this.store.select(selectAllRoots),this.store.select(selectEntities4),this.store.select(selectEntities14)]).pipe(map(([agents,assets,agentMembershipsDict,assetMembershipsDict])=>[...agents.filter(isNotLinkedToAsset),...assets].sort(sortByNameAndPublicIdComparer).map(a=>__spreadProps(__spreadValues({},a),{memberships:a.memberships?.map(m=>agentMembershipsDict[m.publicId]||assetMembershipsDict[m.publicId]||m)}))))}option(pageVersion$){return combineLatest([pageVersion$,this.options$]).pipe(map(([page,options])=>options.find(option=>option.publicId===(page?.previewAgent?.publicId||page?.previewAsset?.publicId))||null))}loadAssets(){this.features.instantCanUse("assets")&&this.store.dispatch(ensureAll5())}updatePreviewDevice(versionId,publicId){publicId?this.store.select(selectEntity5(publicId)).pipe(take(1),map(asset=>asset?["Asset","Agent"]:["Agent","Asset"])).subscribe(([setType,unsetType])=>{let data={[`preview${setType}`]:{publicId},[`preview${unsetType}`]:null};this.store.dispatch(update42({publicId:versionId,data}))}):this.store.dispatch(update42({publicId:versionId,data:{previewAsset:null,previewAgent:null}}))}};_PagePreviewDeviceFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PagePreviewDeviceFacade)},_PagePreviewDeviceFacade.\u0275prov=\u0275\u0275defineInjectable({token:_PagePreviewDeviceFacade,factory:_PagePreviewDeviceFacade.\u0275fac,providedIn:"root"});let PagePreviewDeviceFacade2=_PagePreviewDeviceFacade;return PagePreviewDeviceFacade2})();var BuilderFacade=(()=>{let _BuilderFacade=class _BuilderFacade extends AbstractBuilderFacade{constructor(){super(inject(Actions),inject(Store)),this.previewDeviceFacade=inject(PagePreviewDeviceFacade),this.storage=inject(StorageService),this.selectedPeriodSpec$=new BehaviorSubject(null),this.previewAgentsOrAssets$=this.previewDeviceFacade.options$}isTemplateForBuilder(){throw"Not implemented in Simulator"}linkedDevicesCount(){return of(0)}linkedDeviceTemplatesCount(){return of(0)}reloadDimensions(pageId,applicationType){this.pageComponents(pageId).pipe(take(1)).subscribe(components=>{components.forEach(component=>{let publicId=component.publicId,dimensions=this.storage.get(`pc-dimensions:${applicationType}`,[]).find(item=>item.id===component.template?.publicId)?.dimensions;if(!dimensions)switch(applicationType){case"card":dimensions=DEFAULT_CARD_DIMENSIONS;break;case"report":dimensions=DEFAULT_REPORT_DIMENSIONS;break;case"sheet":dimensions=DEFAULT_SHEET_DIMENSIONS;break}this.updateComponent(publicId,{dimensions})})})}selectedPeriodSpec(pageId$){return combineLatest([pageId$.pipe(mergeMap(id=>id?this.periodSpec(id):EMPTY)),this.selectedPeriodSpec$]).pipe(map(([pageVersionPeriodSpec,selectedPeriodSpec])=>selectedPeriodSpec||pageVersionPeriodSpec||DEFAULT_PERIOD_SPEC))}updateSelectedPeriodSpec(periodSpec){this.selectedPeriodSpec$.next(periodSpec)}getComponent(pageId){return this.pageComponents(pageId).pipe(map(pageComponents=>pageComponents[0]))}getComponentName(pageId){return this.pageComponents(pageId).pipe(map(pageComponents=>{let url=pageComponents[0]?.template?.url?.split("/");if(url)return url[url.length-2]}))}loadAssets(){this.previewDeviceFacade.loadAssets()}loadCustomProperties(){this.store.dispatch(ensureAll36())}loadRoles(){this.store.dispatch(loadAll8())}updatePreviewAgentOrAsset(versionId,publicId){this.previewDeviceFacade.updatePreviewDevice(versionId,publicId)}previewAgentOrAsset(pageVersion$){return this.previewDeviceFacade.option(pageVersion$)}};_BuilderFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BuilderFacade)},_BuilderFacade.\u0275prov=\u0275\u0275defineInjectable({token:_BuilderFacade,factory:_BuilderFacade.\u0275fac,providedIn:"root"});let BuilderFacade2=_BuilderFacade;return BuilderFacade2})();function getLicenceTitle(usageType,licenceModel,sectorId){switch(usageType){case"agent-registration-profile":return"Device Registration Profiles";case"alarming":return licenceModel==="modules"?"Alarming":"Cloud Notify";case"api-integrations":return"API Integrations";case"app-engine-level-1":return"App Engine UI Components";case"app-engine-level-2":return"App Engine Cloud Functions";case"advanced-user-management":case"asset-management":case"card-view":case"connection-monitoring":case"controlled-devices":case"custom-domain":case"custom-fields":case"landing-page":case"live-data":case"main-pages":case"remote-access":case"request-access":case"subgroups":case"temporary-access":return startCase_default(usageType);case"custom-branding":return"White-Labelling";case"custom-legal":return"Legal";case"custom-sso":return"Custom SSO";case"ixagent":return"Device Activation";case"logging":return licenceModel==="modules"&&sectorId!=="wYWd69AiJakk"?"Data Studio":"Cloud Logging";case"m2m-cloud-cluster":return"M2M Cloud Cluster";case"mobile-app":return licenceModel==="modules"?"White-Labelled Smartphone App":"White Label App maintenance";case"mqtt-device":return"MQTT device";case"object-storage":return"File Storage";case"premium-branding":return"White Label Premium";case"reporting":return"Report Generator";case"sla":return"Service Level Agreement";case"vpn-access-rule":return"LAN Access Management";case"vpn-usage":return"VPN Usage";default:return usageType}}var ObjectStorageBrokerDirective=(()=>{let _ObjectStorageBrokerDirective=class _ObjectStorageBrokerDirective{constructor(){this.scopeRef=inject(ComponentGridScopeDirective,{optional:!0}),this.storageProxy=inject(ObjectStorageProxyService),this.serviceFactory=inject(ObjectStorageServiceFactory),this.facade=inject(BackendComponentBrokerFacade),this.features=inject(PlatformFeaturesService),this.snackbar=inject(MatSnackBar),this.translate=inject(TranslateService),this.destroyRef=inject(DestroyRef)}get scope(){return this.scopeRef?.value}ngOnInit(){this.storageProxy.onGetList(this.scope).pipe(switchMap(e=>this.callService(e,s2=>s2.getList(e.detail.options))),takeUntilDestroyed(this.destroyRef)).subscribe(([detail,result])=>{this.storageProxy.emitResult(result,ObjectStorageClientProxyEventType.GetListResult,detail.clientRef,this.scope)}),this.storageProxy.onGetBlob(this.scope).pipe(switchMap(e=>this.callService(e,s2=>(Array.isArray(e.detail.objectMeta),s2.getBlob(e.detail.objectMeta,e.detail.options)))),takeUntilDestroyed(this.destroyRef)).subscribe(([detail,result])=>{this.storageProxy.emitResult(result,ObjectStorageClientProxyEventType.GetBlobResult,detail.clientRef,this.scope)}),this.storageProxy.onDelete(this.scope).pipe(switchMap(e=>this.callService(e,s2=>s2.delete(e.detail.objectMeta,e.detail.options))),takeUntilDestroyed(this.destroyRef)).subscribe(([detail,result])=>{this.storageProxy.emitResult(result,ObjectStorageClientProxyEventType.DeleteResult,detail.clientRef,this.scope)}),this.storageProxy.onStore(this.scope).pipe(switchMap(e=>{if(!this.features.instantCanUse("object-storage")){let message=this.translate.instant("__TEXT__.LICENSE_REQUIRED",{name:getLicenceTitle("object-storage")});return this.snackbar.open(message,void 0,{duration:4e3}),this.storageProxy.emitResult(message,ObjectStorageClientProxyEventType.Error,e.detail.clientRef,this.scope),EMPTY}return this.callService(e,s2=>s2.store(e.detail.object,e.detail.options))}),takeUntilDestroyed(this.destroyRef)).subscribe(([detail,result])=>{this.storageProxy.emitResult(result,ObjectStorageClientProxyEventType.StoreResult,detail.clientRef,this.scope)}),this.storageProxy.onUpdate(this.scope).pipe(switchMap(e=>this.callService(e,s2=>s2.update(e.detail.objectMeta,e.detail.options??{}))),takeUntilDestroyed(this.destroyRef)).subscribe(([detail,result])=>{this.storageProxy.emitResult(result,ObjectStorageClientProxyEventType.UpdateResult,detail.clientRef,this.scope)})}callService(event2,func){return combineLatest([this.facade.resolveTemplateFromPageComponent(event2.detail.pageComponentId),this._agentOrAssetResLink()]).pipe(take(1),switchMap(([templateId,agentOrAssetResLink])=>from(func(this.serviceFactory.createService(agentOrAssetResLink,templateId)))),catchError(err=>(this.storageProxy.emitResult(err,ObjectStorageClientProxyEventType.Error,event2.detail.clientRef,this.scope),EMPTY)),map(result=>[event2.detail,result]))}_agentOrAssetResLink(){return this.facade.findAgentAndAsset(of(this.agentOrAssetId||null)).pipe(map(value=>value[0]?{publicId:value[0]?.publicId,reference:{name:"Agent"}}:value[1]?{publicId:value[1]?.publicId,reference:{name:"Asset"}}:null))}};_ObjectStorageBrokerDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ObjectStorageBrokerDirective)},_ObjectStorageBrokerDirective.\u0275dir=\u0275\u0275defineDirective({type:_ObjectStorageBrokerDirective,selectors:[["","ixObjectStorageBroker",""]],inputs:{agentOrAssetId:"agentOrAssetId"},standalone:!1});let ObjectStorageBrokerDirective3=_ObjectStorageBrokerDirective;return ObjectStorageBrokerDirective3})();var InputControlFormDirective=(()=>{let _InputControlFormDirective=class _InputControlFormDirective{constructor(viewContainerRef){this.viewContainerRef=viewContainerRef}};_InputControlFormDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_InputControlFormDirective)(\u0275\u0275directiveInject(ViewContainerRef))},_InputControlFormDirective.\u0275dir=\u0275\u0275defineDirective({type:_InputControlFormDirective,selectors:[["","ixInputControlForm",""]],standalone:!1});let InputControlFormDirective3=_InputControlFormDirective;return InputControlFormDirective3})();var RawMetricInputFacade=(()=>{let _RawMetricInputFacade=class _RawMetricInputFacade{constructor(){this.store=inject(Store)}static groupAndSort(slugs,allowedTypes){let typeAllowed=allowedTypes?.length?type=>allowedTypes.some(t=>t===type):()=>!0;return orderBy_default(flatMap_default(groupBy_default(slugs,item=>item.groupSlug),(items,groupSlug)=>({items:orderBy_default(items,["label","asc"]).filter(item=>typeAllowed(item.variable?.type)),groupName:items[0]?.group||"",groupSlug})),["groupName","asc"])}selectorDataIsLoaded(field){return this._selectorDataIsLoaded(field,selectAllLoadedForAgent3)}selectors(target$,field){let allowedTypes=field.inputDescription.allowedTypes;return target$.pipe(withLatestFrom(this.store.select(selectEntity10(field.context.component.pageVersion?.publicId||null))),mergeMap(([target,version2])=>{if(target){if(target==="Agent#selected")return version2?.previewAgent?.publicId?this.selectorsForAgent(version2.previewAgent.publicId,target):version2?.previewAsset?.publicId?this.selectorsForAsset(version2.previewAsset.publicId,target):(console.error(new Error(`PageVersion${version2?"#"+version2.publicId:""} has no preview agent`)),of([]));{let agentId=target.slice(target.indexOf("#")+1);return this.selectorsForAgent(agentId,target)}}else return EMPTY}),map(slugs=>_RawMetricInputFacade.groupAndSort(slugs,allowedTypes)))}_selectorDataIsLoaded(field,isLoadedSelector){return this.store.select(selectEntity10(field.context.component.pageVersion?.publicId??null)).pipe(take(1),mergeMap(version2=>version2?.previewAgent?.publicId?this.store.select(isLoadedSelector(version2.previewAgent.publicId)):version2?.previewAsset?.publicId?this.store.select(selectEntity5(version2.previewAsset.publicId)).pipe(switchMap(asset=>asset?.agent?.publicId?this.store.select(isLoadedSelector(asset.agent.publicId)):of(!0))):of(!0)))}loadAgentDataTags(agentId){this.store.dispatch(ensureAll23({agentId,fields:AGENT_DATA_TAG_WITH_VARIABLE_LIST_FIELDS}))}selectorsForAgent(agentId,target){return this.loadAgentDataTags(agentId),this._selectorsForAgent(agentId,target,selectAllForAgent3(agentId),{name:"tags",slug:"tag"})}selectorsForAsset(assetId,target){return this.store.select(selectEntity5(assetId)).pipe(switchMap(asset=>asset?.agent?.publicId?this.selectorsForAgent(asset.agent.publicId,target):(console.error(new Error(`Asset#${assetId} has no linked agent`)),of([]))))}_selectorsForAgent(agentId,target,selectAll46,logType){return combineLatest([this.store.select(selectAll46).pipe(mergeMap(log=>log?of(log):EMPTY)),this.store.select(selectEntities21),this.store.select(selectAllForAgent(agentId)).pipe(mergeMap(sources=>sources?of(sources):EMPTY))]).pipe(map(([logs,variableEntities,dataSources])=>logs.map(log=>{let variableId="variable"in log?log.variable?.publicId:log.publicId,variable=variableId?variableEntities[variableId]:void 0;return{log,variable}}).filter(({variable})=>!variable?.internalUse&&!!variable?.forLogging).map(({log,variable})=>{let _escape=slug=>slug.replace(/[[\]]/g,"\\$&"),dataSource=dataSources.find(s2=>s2.publicId===log.source?.publicId),pattern=new RegExp(_escape(dataSource?.slug||"")+"."+(logType.slug==="variable"?"(var|variable)":logType.slug)+"."+_escape(log.slug??"")+"$");return{group:dataSource?.name||"",groupSlug:dataSource?.slug||"",label:log.name||"",slug:log.slug||"",value:target+":"+(dataSource?.slug||"")+"."+logType.slug+"."+log.slug,pattern,variable}})))}};_RawMetricInputFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_RawMetricInputFacade)},_RawMetricInputFacade.\u0275prov=\u0275\u0275defineInjectable({token:_RawMetricInputFacade,factory:_RawMetricInputFacade.\u0275fac,providedIn:"root"});let RawMetricInputFacade2=_RawMetricInputFacade;return RawMetricInputFacade2})();var NumberInputValidatorDirective=(()=>{let _NumberInputValidatorDirective=class _NumberInputValidatorDirective{constructor(element){this.element=element}validate(){return this.element.nativeElement.validity.badInput?{number:!0,required:!1}:null}};_NumberInputValidatorDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_NumberInputValidatorDirective)(\u0275\u0275directiveInject(ElementRef))},_NumberInputValidatorDirective.\u0275dir=\u0275\u0275defineDirective({type:_NumberInputValidatorDirective,selectors:[["input","type","number"]],standalone:!1,features:[\u0275\u0275ProvidersFeature([{provide:NG_VALIDATORS,useExisting:forwardRef(()=>_NumberInputValidatorDirective),multi:!0}])]});let NumberInputValidatorDirective3=_NumberInputValidatorDirective;return NumberInputValidatorDirective3})();var SelectorDialogFacade=(()=>{let _SelectorDialogFacade=class _SelectorDialogFacade{constructor(){this.store=inject(Store)}hasPreviewAgent(pageVersionId){return this.store.select(selectEntity10(pageVersionId)).pipe(switchMap(pageVersion=>pageVersion?.previewAgent?of(!0):pageVersion?.previewAsset?this.store.select(selectEntity5(pageVersion.previewAsset.publicId)).pipe(map(asset=>!!asset?.agent)):of(!1)),distinctUntilChanged())}};_SelectorDialogFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectorDialogFacade)},_SelectorDialogFacade.\u0275prov=\u0275\u0275defineInjectable({token:_SelectorDialogFacade,factory:_SelectorDialogFacade.\u0275fac,providedIn:"root"});let SelectorDialogFacade2=_SelectorDialogFacade;return SelectorDialogFacade2})();var _c012=["searchSelectInput"],_c14=["innerSelectSearch"],_c23=[[["",8,"mat-select-search-custom-header-content"]],[["","ngxMatSelectSearchClear",""]],[["","ngxMatSelectNoEntriesFound",""]]],_c32=[".mat-select-search-custom-header-content","[ngxMatSelectSearchClear]","[ngxMatSelectNoEntriesFound]"],_c4=(a0,a1)=>({"mat-select-search-inner-multiple":a0,"mat-select-search-inner-toggle-all":a1});function MatSelectSearchComponent_mat_checkbox_4_Template(rf,ctx){if(rf&1){let _r2=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-checkbox",12),\u0275\u0275listener("change",function($event){\u0275\u0275restoreView(_r2);let ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2._emitSelectAllBooleanToParent($event.checked))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r2=\u0275\u0275nextContext();\u0275\u0275property("color",ctx_r2.matFormField==null?null:ctx_r2.matFormField.color)("checked",ctx_r2.toggleAllCheckboxChecked)("indeterminate",ctx_r2.toggleAllCheckboxIndeterminate)("matTooltip",ctx_r2.toggleAllCheckboxTooltipMessage)("matTooltipPosition",ctx_r2.toggleAllCheckboxTooltipPosition)}}function MatSelectSearchComponent_mat_spinner_7_Template(rf,ctx){rf&1&&\u0275\u0275element(0,"mat-spinner",13)}function MatSelectSearchComponent_button_8_ng_content_1_Template(rf,ctx){rf&1&&\u0275\u0275projection(0,1,["*ngIf","clearIcon; else defaultIcon"])}function MatSelectSearchComponent_button_8_ng_template_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-icon",16),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r2=\u0275\u0275nextContext(2);\u0275\u0275property("svgIcon",ctx_r2.closeSvgIcon),\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",ctx_r2.closeSvgIcon?null:ctx_r2.closeIcon," ")}}function MatSelectSearchComponent_button_8_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",14),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r4);let ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2._reset(!0))}),\u0275\u0275template(1,MatSelectSearchComponent_button_8_ng_content_1_Template,1,0,"ng-content",15)(2,MatSelectSearchComponent_button_8_ng_template_2_Template,2,2,"ng-template",null,2,\u0275\u0275templateRefExtractor),\u0275\u0275elementEnd()}if(rf&2){let defaultIcon_r5=\u0275\u0275reference(3),ctx_r2=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r2.clearIcon)("ngIfElse",defaultIcon_r5)}}function MatSelectSearchComponent_div_11_ng_content_1_Template(rf,ctx){rf&1&&\u0275\u0275projection(0,2,["*ngIf","noEntriesFound; else defaultNoEntriesFound"])}function MatSelectSearchComponent_div_11_ng_template_2_Template(rf,ctx){if(rf&1&&\u0275\u0275text(0),rf&2){let ctx_r2=\u0275\u0275nextContext(2);\u0275\u0275textInterpolate(ctx_r2.noEntriesFoundLabel)}}function MatSelectSearchComponent_div_11_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",17),\u0275\u0275template(1,MatSelectSearchComponent_div_11_ng_content_1_Template,1,0,"ng-content",15)(2,MatSelectSearchComponent_div_11_ng_template_2_Template,1,1,"ng-template",null,3,\u0275\u0275templateRefExtractor),\u0275\u0275elementEnd()),rf&2){let defaultNoEntriesFound_r6=\u0275\u0275reference(3),ctx_r2=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r2.noEntriesFound)("ngIfElse",defaultNoEntriesFound_r6)}}var MatSelectSearchClearDirective=(()=>{class MatSelectSearchClearDirective2{static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||MatSelectSearchClearDirective2)};static \u0275dir=\u0275\u0275defineDirective({type:MatSelectSearchClearDirective2,selectors:[["","ngxMatSelectSearchClear",""]],standalone:!1})}return MatSelectSearchClearDirective2})(),configurableDefaultOptions=["ariaLabel","clearSearchInput","closeIcon","closeSvgIcon","disableInitialFocus","disableScrollToActiveOnOptionsChanged","enableClearOnEscapePressed","hideClearSearchButton","noEntriesFoundLabel","placeholderLabel","preventHomeEndKeyPropagation","searching"],MAT_SELECTSEARCH_DEFAULT_OPTIONS=new InjectionToken("mat-selectsearch-default-options"),MatSelectNoEntriesFoundDirective=(()=>{class MatSelectNoEntriesFoundDirective2{static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||MatSelectNoEntriesFoundDirective2)};static \u0275dir=\u0275\u0275defineDirective({type:MatSelectNoEntriesFoundDirective2,selectors:[["","ngxMatSelectNoEntriesFound",""]],standalone:!1})}return MatSelectNoEntriesFoundDirective2})(),MatSelectSearchComponent=(()=>{class MatSelectSearchComponent2{matSelect;changeDetectorRef;_viewportRuler;matOption;matFormField;placeholderLabel="Suche";type="text";closeIcon="close";closeSvgIcon;noEntriesFoundLabel="Keine Optionen gefunden";clearSearchInput=!0;searching=!1;disableInitialFocus=!1;enableClearOnEscapePressed=!1;preventHomeEndKeyPropagation=!1;disableScrollToActiveOnOptionsChanged=!1;ariaLabel="dropdown search";showToggleAllCheckbox=!1;toggleAllCheckboxChecked=!1;toggleAllCheckboxIndeterminate=!1;toggleAllCheckboxTooltipMessage="";toggleAllCheckboxTooltipPosition="below";hideClearSearchButton=!1;alwaysRestoreSelectedOptionsMulti=!1;recreateValuesArray=!1;toggleAll=new EventEmitter;searchSelectInput;innerSelectSearch;clearIcon;noEntriesFound;get value(){return this._formControl.value}_lastExternalInputValue;onTouched=_=>{};set _options(_options){this._options$.next(_options)}get _options(){return this._options$.getValue()}_options$=new BehaviorSubject(null);optionsList$=this._options$.pipe(switchMap(_options=>_options?_options.changes.pipe(map(options=>options.toArray()),startWith(_options.toArray())):of(null)));optionsLength$=this.optionsList$.pipe(map(options=>options?options.length:0));previousSelectedValues;_formControl=new FormControl("",{nonNullable:!0});_showNoEntriesFound$=combineLatest([this._formControl.valueChanges,this.optionsLength$]).pipe(map(([value,optionsLength])=>!!(this.noEntriesFoundLabel&&value&&optionsLength===this.getOptionsLengthOffset())));_onDestroy=new Subject;activeDescendant;constructor(matSelect,changeDetectorRef,_viewportRuler,matOption,matFormField,defaultOptions2){this.matSelect=matSelect,this.changeDetectorRef=changeDetectorRef,this._viewportRuler=_viewportRuler,this.matOption=matOption,this.matFormField=matFormField,this.applyDefaultOptions(defaultOptions2)}applyDefaultOptions(defaultOptions2){if(defaultOptions2)for(let key of configurableDefaultOptions)defaultOptions2.hasOwnProperty(key)&&(this[key]=defaultOptions2[key])}ngOnInit(){this.matOption?(this.matOption.disabled=!0,this.matOption._getHostElement().classList.add("contains-mat-select-search"),this.matOption._getHostElement().setAttribute("role","presentation")):console.error("<ngx-mat-select-search> must be placed inside a <mat-option> element"),this.matSelect.openedChange.pipe(delay(1),takeUntil(this._onDestroy)).subscribe(opened=>{opened?(this.updateInputWidth(),this.disableInitialFocus||this._focus()):this.clearSearchInput&&this._reset()}),this.matSelect.openedChange.pipe(take(1),switchMap(_=>{this._options=this.matSelect.options;let previousFirstOption=this._options.toArray()[this.getOptionsLengthOffset()];return this._options.changes.pipe(tap(()=>{setTimeout(()=>{let options=this._options.toArray(),currentFirstOption=options[this.getOptionsLengthOffset()],keyManager=this.matSelect._keyManager;keyManager&&this.matSelect.panelOpen&&currentFirstOption&&((!previousFirstOption||!this.matSelect.compareWith(previousFirstOption.value,currentFirstOption.value)||!keyManager.activeItem||!options.find(option=>this.matSelect.compareWith(option.value,keyManager.activeItem?.value)))&&keyManager.setActiveItem(this.getOptionsLengthOffset()),setTimeout(()=>{this.updateInputWidth()})),previousFirstOption=currentFirstOption})}))})).pipe(takeUntil(this._onDestroy)).subscribe(),this._showNoEntriesFound$.pipe(takeUntil(this._onDestroy)).subscribe(showNoEntriesFound=>{this.matOption&&(showNoEntriesFound?this.matOption._getHostElement().classList.add("mat-select-search-no-entries-found"):this.matOption._getHostElement().classList.remove("mat-select-search-no-entries-found"))}),this._viewportRuler.change().pipe(takeUntil(this._onDestroy)).subscribe(()=>{this.matSelect.panelOpen&&this.updateInputWidth()}),this.initMultipleHandling(),this.optionsList$.pipe(takeUntil(this._onDestroy)).subscribe(()=>{this.changeDetectorRef.markForCheck()})}_emitSelectAllBooleanToParent(state){this.toggleAll.emit(state)}ngOnDestroy(){this._onDestroy.next(),this._onDestroy.complete()}_isToggleAllCheckboxVisible(){return this.matSelect.multiple&&this.showToggleAllCheckbox}_handleKeydown(event2){(event2.key&&event2.key.length===1||this.preventHomeEndKeyPropagation&&(event2.key==="Home"||event2.key==="End"))&&event2.stopPropagation(),this.matSelect.multiple&&event2.key&&event2.key==="Enter"&&setTimeout(()=>this._focus()),this.enableClearOnEscapePressed&&event2.key==="Escape"&&this.value&&(this._reset(!0),event2.stopPropagation())}_handleKeyup(event2){if(event2.key==="ArrowUp"||event2.key==="ArrowDown"){let ariaActiveDescendantId=this.matSelect._getAriaActiveDescendant(),index=this._options.toArray().findIndex(item=>item.id===ariaActiveDescendantId);index!==-1&&(this.unselectActiveDescendant(),this.activeDescendant=this._options.toArray()[index]._getHostElement(),this.activeDescendant.setAttribute("aria-selected","true"),this.searchSelectInput.nativeElement.setAttribute("aria-activedescendant",ariaActiveDescendantId))}}writeValue(value){this._lastExternalInputValue=value,this._formControl.setValue(value),this.changeDetectorRef.markForCheck()}onBlur(){this.unselectActiveDescendant(),this.onTouched()}registerOnChange(fn2){this._formControl.valueChanges.pipe(filter(value=>value!==this._lastExternalInputValue),tap(()=>this._lastExternalInputValue=void 0),takeUntil(this._onDestroy)).subscribe(fn2)}registerOnTouched(fn2){this.onTouched=fn2}_focus(){if(!this.searchSelectInput||!this.matSelect.panel)return;let panel=this.matSelect.panel.nativeElement,scrollTop=panel.scrollTop;this.searchSelectInput.nativeElement.focus(),panel.scrollTop=scrollTop}_reset(focus){this._formControl.setValue(""),focus&&this._focus()}initMultipleHandling(){if(!this.matSelect.ngControl){this.matSelect.multiple&&console.error("the mat-select containing ngx-mat-select-search must have a ngModel or formControl directive when multiple=true");return}this.previousSelectedValues=this.matSelect.ngControl.value,this.matSelect.ngControl.valueChanges&&this.matSelect.ngControl.valueChanges.pipe(takeUntil(this._onDestroy)).subscribe(values=>{let restoreSelectedValues=!1;if(this.matSelect.multiple&&(this.alwaysRestoreSelectedOptionsMulti||this._formControl.value&&this._formControl.value.length)&&this.previousSelectedValues&&Array.isArray(this.previousSelectedValues)){(!values||!Array.isArray(values))&&(values=[]);let optionValues=this.matSelect.options.map(option=>option.value);this.previousSelectedValues.forEach(previousValue=>{!values.some(v=>this.matSelect.compareWith(v,previousValue))&&!optionValues.some(v=>this.matSelect.compareWith(v,previousValue))&&(this.recreateValuesArray?values=[...values,previousValue]:values.push(previousValue),restoreSelectedValues=!0)})}this.previousSelectedValues=values,restoreSelectedValues&&this.matSelect._onChange(values)})}updateInputWidth(){if(!this.innerSelectSearch||!this.innerSelectSearch.nativeElement)return;let element=this.innerSelectSearch.nativeElement,panelElement=null;for(;element&&element.parentElement;)if(element=element.parentElement,element.classList.contains("mat-select-panel")){panelElement=element;break}panelElement&&(this.innerSelectSearch.nativeElement.style.width=panelElement.clientWidth+"px")}getOptionsLengthOffset(){return this.matOption?1:0}unselectActiveDescendant(){this.activeDescendant?.removeAttribute("aria-selected"),this.searchSelectInput.nativeElement.removeAttribute("aria-activedescendant")}static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||MatSelectSearchComponent2)(\u0275\u0275directiveInject(MatSelect),\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ViewportRuler),\u0275\u0275directiveInject(MatOption,8),\u0275\u0275directiveInject(MatFormField,8),\u0275\u0275directiveInject(MAT_SELECTSEARCH_DEFAULT_OPTIONS,8))};static \u0275cmp=\u0275\u0275defineComponent({type:MatSelectSearchComponent2,selectors:[["ngx-mat-select-search"]],contentQueries:function(rf,ctx,dirIndex){if(rf&1&&(\u0275\u0275contentQuery(dirIndex,MatSelectSearchClearDirective,5),\u0275\u0275contentQuery(dirIndex,MatSelectNoEntriesFoundDirective,5)),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.clearIcon=_t.first),\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.noEntriesFound=_t.first)}},viewQuery:function(rf,ctx){if(rf&1&&(\u0275\u0275viewQuery(_c012,7,ElementRef),\u0275\u0275viewQuery(_c14,7,ElementRef)),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.searchSelectInput=_t.first),\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.innerSelectSearch=_t.first)}},inputs:{placeholderLabel:"placeholderLabel",type:"type",closeIcon:"closeIcon",closeSvgIcon:"closeSvgIcon",noEntriesFoundLabel:"noEntriesFoundLabel",clearSearchInput:"clearSearchInput",searching:"searching",disableInitialFocus:"disableInitialFocus",enableClearOnEscapePressed:"enableClearOnEscapePressed",preventHomeEndKeyPropagation:"preventHomeEndKeyPropagation",disableScrollToActiveOnOptionsChanged:"disableScrollToActiveOnOptionsChanged",ariaLabel:"ariaLabel",showToggleAllCheckbox:"showToggleAllCheckbox",toggleAllCheckboxChecked:"toggleAllCheckboxChecked",toggleAllCheckboxIndeterminate:"toggleAllCheckboxIndeterminate",toggleAllCheckboxTooltipMessage:"toggleAllCheckboxTooltipMessage",toggleAllCheckboxTooltipPosition:"toggleAllCheckboxTooltipPosition",hideClearSearchButton:"hideClearSearchButton",alwaysRestoreSelectedOptionsMulti:"alwaysRestoreSelectedOptionsMulti",recreateValuesArray:"recreateValuesArray"},outputs:{toggleAll:"toggleAll"},standalone:!1,features:[\u0275\u0275ProvidersFeature([{provide:NG_VALUE_ACCESSOR,useExisting:forwardRef(()=>MatSelectSearchComponent2),multi:!0}])],ngContentSelectors:_c32,decls:13,vars:14,consts:[["innerSelectSearch",""],["searchSelectInput",""],["defaultIcon",""],["defaultNoEntriesFound",""],["matInput","",1,"mat-select-search-input","mat-select-search-hidden"],[1,"mat-select-search-inner","mat-typography","mat-datepicker-content","mat-tab-header",3,"ngClass"],[1,"mat-select-search-inner-row"],["class","mat-select-search-toggle-all-checkbox","matTooltipClass","ngx-mat-select-search-toggle-all-tooltip",3,"color","checked","indeterminate","matTooltip","matTooltipPosition","change",4,"ngIf"],["autocomplete","off",1,"mat-select-search-input",3,"keydown","keyup","blur","type","formControl","placeholder"],["class","mat-select-search-spinner","diameter","16",4,"ngIf"],["mat-icon-button","","aria-label","Clear","class","mat-select-search-clear",3,"click",4,"ngIf"],["class","mat-select-search-no-entries-found",4,"ngIf"],["matTooltipClass","ngx-mat-select-search-toggle-all-tooltip",1,"mat-select-search-toggle-all-checkbox",3,"change","color","checked","indeterminate","matTooltip","matTooltipPosition"],["diameter","16",1,"mat-select-search-spinner"],["mat-icon-button","","aria-label","Clear",1,"mat-select-search-clear",3,"click"],[4,"ngIf","ngIfElse"],[3,"svgIcon"],[1,"mat-select-search-no-entries-found"]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275projectionDef(_c23),\u0275\u0275element(0,"input",4),\u0275\u0275elementStart(1,"div",5,0)(3,"div",6),\u0275\u0275template(4,MatSelectSearchComponent_mat_checkbox_4_Template,1,5,"mat-checkbox",7),\u0275\u0275elementStart(5,"input",8,1),\u0275\u0275listener("keydown",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx._handleKeydown($event))})("keyup",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx._handleKeyup($event))})("blur",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onBlur())}),\u0275\u0275elementEnd(),\u0275\u0275template(7,MatSelectSearchComponent_mat_spinner_7_Template,1,0,"mat-spinner",9)(8,MatSelectSearchComponent_button_8_Template,4,2,"button",10),\u0275\u0275projection(9),\u0275\u0275elementEnd(),\u0275\u0275element(10,"mat-divider"),\u0275\u0275elementEnd(),\u0275\u0275template(11,MatSelectSearchComponent_div_11_Template,4,2,"div",11),\u0275\u0275pipe(12,"async")}rf&2&&(\u0275\u0275advance(),\u0275\u0275property("ngClass",\u0275\u0275pureFunction2(11,_c4,ctx.matSelect.multiple,ctx._isToggleAllCheckboxVisible())),\u0275\u0275advance(3),\u0275\u0275property("ngIf",ctx._isToggleAllCheckboxVisible()),\u0275\u0275advance(),\u0275\u0275property("type",ctx.type)("formControl",ctx._formControl)("placeholder",ctx.placeholderLabel),\u0275\u0275attribute("aria-label",ctx.ariaLabel),\u0275\u0275advance(2),\u0275\u0275property("ngIf",ctx.searching),\u0275\u0275advance(),\u0275\u0275property("ngIf",!ctx.hideClearSearchButton&&ctx.value&&!ctx.searching),\u0275\u0275advance(3),\u0275\u0275property("ngIf",\u0275\u0275pipeBind1(12,9,ctx._showNoEntriesFound$)))},dependencies:[NgClass,NgIf,DefaultValueAccessor,NgControlStatus,FormControlDirective,MatIconButton,MatCheckbox,MatIcon,MatProgressSpinner,MatTooltip,MatDivider,AsyncPipe],styles:[".mat-select-search-hidden[_ngcontent-%COMP%]{visibility:hidden}.mat-select-search-inner[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;z-index:100;font-size:inherit;box-shadow:none;background-color:var(--mat-select-panel-background-color)}.mat-select-search-inner.mat-select-search-inner-multiple.mat-select-search-inner-toggle-all[_ngcontent-%COMP%] .mat-select-search-inner-row[_ngcontent-%COMP%]{display:flex;align-items:center}.mat-select-search-input[_ngcontent-%COMP%]{box-sizing:border-box;width:100%;border:none;font-family:inherit;font-size:inherit;color:currentColor;outline:none;background-color:var(--mat-select-panel-background-color);padding:0 44px 0 16px;height:calc(3em - 1px);line-height:calc(3em - 1px)}[dir=rtl][_nghost-%COMP%] .mat-select-search-input[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .mat-select-search-input[_ngcontent-%COMP%]{padding-right:16px;padding-left:44px}.mat-select-search-input[_ngcontent-%COMP%]::placeholder{color:var(--mdc-filled-text-field-input-text-placeholder-color)}.mat-select-search-inner-toggle-all[_ngcontent-%COMP%] .mat-select-search-input[_ngcontent-%COMP%]{padding-left:5px}.mat-select-search-no-entries-found[_ngcontent-%COMP%]{padding-top:8px}.mat-select-search-clear[_ngcontent-%COMP%]{position:absolute;right:4px;top:0}[dir=rtl][_nghost-%COMP%] .mat-select-search-clear[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .mat-select-search-clear[_ngcontent-%COMP%]{right:auto;left:4px}.mat-select-search-spinner[_ngcontent-%COMP%]{position:absolute;right:16px;top:calc(50% - 8px)}[dir=rtl][_nghost-%COMP%] .mat-select-search-spinner[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .mat-select-search-spinner[_ngcontent-%COMP%]{right:auto;left:16px} .mat-mdc-option[aria-disabled=true].contains-mat-select-search{position:sticky;top:-8px;z-index:1;opacity:1;margin-top:-8px;pointer-events:all} .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mat-icon{margin-right:0;margin-left:0} .mat-mdc-option[aria-disabled=true].contains-mat-select-search mat-pseudo-checkbox{display:none} .mat-mdc-option[aria-disabled=true].contains-mat-select-search .mdc-list-item__primary-text{opacity:1}.mat-select-search-toggle-all-checkbox[_ngcontent-%COMP%]{padding-left:5px}[dir=rtl][_nghost-%COMP%] .mat-select-search-toggle-all-checkbox[_ngcontent-%COMP%], [dir=rtl] [_nghost-%COMP%] .mat-select-search-toggle-all-checkbox[_ngcontent-%COMP%]{padding-left:0;padding-right:5px}"],changeDetection:0})}return MatSelectSearchComponent2})();var NgxMatSelectSearchModule=(()=>{class NgxMatSelectSearchModule2{static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||NgxMatSelectSearchModule2)};static \u0275mod=\u0275\u0275defineNgModule({type:NgxMatSelectSearchModule2});static \u0275inj=\u0275\u0275defineInjector({imports:[CommonModule,ReactiveFormsModule,MatButtonModule,MatCheckboxModule,MatIconModule,MatProgressSpinnerModule,MatTooltipModule,MatDividerModule]})}return NgxMatSelectSearchModule2})();function SelectorDialogComponent_Conditional_3_For_10_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-option",10)(1,"span",1)(2,"span"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"span",12),\u0275\u0275text(5),\u0275\u0275elementEnd()()()),rf&2){let selector_r1=ctx.$implicit;\u0275\u0275property("value",selector_r1.groupSlug),\u0275\u0275advance(3),\u0275\u0275textInterpolate(selector_r1.groupName),\u0275\u0275advance(2),\u0275\u0275textInterpolate(selector_r1.groupSlug)}}function SelectorDialogComponent_Conditional_3_Conditional_11_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function SelectorDialogComponent_Conditional_3_For_22_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-option",10)(1,"span",1)(2,"span"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"span",12),\u0275\u0275text(5),\u0275\u0275elementEnd()()()),rf&2){let metricSelector_r2=ctx.$implicit;\u0275\u0275property("value",metricSelector_r2.slug),\u0275\u0275advance(3),\u0275\u0275textInterpolate(metricSelector_r2.label),\u0275\u0275advance(2),\u0275\u0275textInterpolate(metricSelector_r2.slug)}}function SelectorDialogComponent_Conditional_3_Conditional_23_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function SelectorDialogComponent_Conditional_3_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-form-field",3),\u0275\u0275element(1,"span",7),\u0275\u0275elementStart(2,"mat-label",5),\u0275\u0275text(3,"DATA_SOURCE"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"mat-select",8)(5,"mat-option"),\u0275\u0275element(6,"ngx-mat-select-search",9),\u0275\u0275pipe(7,"translate"),\u0275\u0275pipe(8,"translate"),\u0275\u0275elementEnd(),\u0275\u0275repeaterCreate(9,SelectorDialogComponent_Conditional_3_For_10_Template,6,3,"mat-option",10,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd(),\u0275\u0275template(11,SelectorDialogComponent_Conditional_3_Conditional_11_Template,2,0,"mat-error",5),\u0275\u0275elementEnd(),\u0275\u0275elementStart(12,"mat-form-field",3),\u0275\u0275element(13,"span",7),\u0275\u0275elementStart(14,"mat-label",5),\u0275\u0275text(15),\u0275\u0275elementEnd(),\u0275\u0275elementStart(16,"mat-select",11)(17,"mat-option"),\u0275\u0275element(18,"ngx-mat-select-search",9),\u0275\u0275pipe(19,"translate"),\u0275\u0275pipe(20,"translate"),\u0275\u0275elementEnd(),\u0275\u0275repeaterCreate(21,SelectorDialogComponent_Conditional_3_For_22_Template,6,3,"mat-option",10,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd(),\u0275\u0275template(23,SelectorDialogComponent_Conditional_3_Conditional_23_Template,2,0,"mat-error",5),\u0275\u0275elementEnd()),rf&2){let ctx_r2=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("innerHTML",ctx_r2.dataSourceInputMock,\u0275\u0275sanitizeHtml),\u0275\u0275advance(5),\u0275\u0275property("formControl",ctx_r2.dataSourceQueryFormControl)("placeholderLabel",\u0275\u0275pipeBind1(7,11,"SEARCH"))("noEntriesFoundLabel",\u0275\u0275pipeBind1(8,13,"NO_RESULTS_FOUND")),\u0275\u0275advance(3),\u0275\u0275repeater(ctx_r2.filteredDataSources),\u0275\u0275advance(2),\u0275\u0275conditional(ctx_r2.form.controls.dataSource.hasError("required")?11:-1),\u0275\u0275advance(2),\u0275\u0275property("innerHTML",ctx_r2.itemInputMock,\u0275\u0275sanitizeHtml),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r2.data.label),\u0275\u0275advance(3),\u0275\u0275property("formControl",ctx_r2.itemQueryFormControl)("placeholderLabel",\u0275\u0275pipeBind1(19,15,"SEARCH"))("noEntriesFoundLabel",\u0275\u0275pipeBind1(20,17,"NO_RESULTS_FOUND")),\u0275\u0275advance(3),\u0275\u0275repeater(ctx_r2.filteredItems),\u0275\u0275advance(2),\u0275\u0275conditional(ctx_r2.form.controls.item.hasError("required")?23:-1)}}function SelectorDialogComponent_Conditional_4_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",2)(1,"span",5),\u0275\u0275text(2,"NO_PREVIEW_DEVICE_SELECTED"),\u0275\u0275elementEnd()())}var SelectorDialogComponent=(()=>{let _SelectorDialogComponent=class _SelectorDialogComponent{constructor(){this.cdRef=inject(ChangeDetectorRef),this.destroy=inject(DestroyRef),this.dialogRef=inject(MatDialogRef),this.facade=inject(SelectorDialogFacade),this.data=inject(MAT_DIALOG_DATA),this.form=new FormGroup({dataSource:new FormControl("",{validators:[Validators.required],nonNullable:!0}),item:new FormControl({value:"",disabled:!0},{validators:[Validators.required],nonNullable:!0})}),this.dataSourceInputMock="",this.dataSourceQueryFormControl=new FormControl("",{nonNullable:!0}),this.filteredDataSources=[],this.filteredItems=[],this.itemInputMock="",this.itemQueryFormControl=new FormControl("",{nonNullable:!0})}ngOnInit(){this.facade.hasPreviewAgent(this.data.pageVersionId).pipe(takeUntilDestroyed(this.destroy)).subscribe(previewAgentSelected=>{this.previewAgentSelected=previewAgentSelected}),this.form.controls.dataSource.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>{this.setDatasourceInputMock(value)}),this.form.controls.item.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>{this.setItemInputMock(value)}),this.dataSourceQueryFormControl.valueChanges.pipe(debounceTime(100),takeUntilDestroyed(this.destroy)).subscribe(value=>{this.filteredDataSources=this.getFilteredDataSources(value),this.cdRef.markForCheck()}),this.itemQueryFormControl.valueChanges.pipe(debounceTime(100),takeUntilDestroyed(this.destroy)).subscribe(value=>{this.filteredItems=this.getFilteredItems(value),this.cdRef.markForCheck()}),this.setInitialFormValue(),this.filteredDataSources=this.data.selectors,this.filteredItems=this.data.selectors.find(selector3=>selector3.groupSlug===this.form.value.dataSource)?.items||[]}getFilteredDataSources(query){return query?this.data.selectors.filter(selector3=>{let lowerCaseQuery=query.toLowerCase(),label=deburr_default(selector3.groupName.toLowerCase()),slug=selector3.groupSlug.toLowerCase();if(label.includes(lowerCaseQuery)||slug.includes(lowerCaseQuery))return!0}):this.data.selectors}getFilteredItems(query){let items=this.data.selectors.find(selector3=>selector3.groupSlug===this.form.value.dataSource)?.items||[];return query?items.filter(item=>{let lowerCaseQuery=query.toLowerCase(),label=deburr_default(item.label.toLowerCase()),slug=item.slug.toLowerCase();if(label.includes(lowerCaseQuery)||slug.includes(lowerCaseQuery))return!0}):items}setDatasourceInputMock(value){this.dataSourceInputMock="";let datasource=this.data.selectors.find(selector3=>selector3.groupSlug===value);datasource&&(this.form.controls.item.enable(),this.dataSourceInputMock=`<span>${datasource.groupName}</span><span class="orange extra-margin-left">${datasource.groupSlug}</span>`,datasource?.items.find(item2=>item2.slug===this.form.value.item)||(this.itemInputMock="",this.form.controls.item.setValue(""),this.filteredItems=this.getFilteredItems(this.itemQueryFormControl.value))),this.cdRef.markForCheck()}setInitialFormValue(){let metric=this.data.formControl?.value?.split(".");metric[0]&&this.data.selectors.find(selector3=>selector3.groupSlug===metric[0])&&this.form.controls.dataSource.setValue(metric[0]),metric[2]&&this.data.selectors.find(selector3=>selector3.groupSlug===this.form.value.dataSource)?.items.find(item2=>item2.slug===metric[2])&&this.form.controls.item.setValue(metric[2])}setItemInputMock(value){this.itemInputMock="";let item=this.data.selectors.find(selector3=>selector3.groupSlug===this.form.value.dataSource)?.items.find(item2=>item2.slug===value);item&&(this.itemInputMock=`<span>${item.label}</span><span class="blue extra-margin-left">${item.slug}</span>`),this.cdRef.markForCheck()}submit(){let formValue=this.form.value,selectorType=this.data.label==="TAG"?"tag":"var";this.data.formControl.setValue(formValue.dataSource+`.${selectorType}.`+formValue.item),this.dialogRef.close()}};_SelectorDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectorDialogComponent)},_SelectorDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_SelectorDialogComponent,selectors:[["ix-selector-dialog"]],standalone:!1,decls:13,vars:3,consts:[["autocomplete","off","fxLayout","column","fxFlex","",3,"ngSubmit","formGroup"],["fxLayout","column"],["fxFlex","","fxLayoutAlign","center center",1,"no-device-selected"],["fxFlex",""],["type","button","mat-button","","mat-dialog-close",""],["translate",""],["type","submit","mat-button","","color","primary",3,"disabled"],[1,"input-mock",3,"innerHTML"],["formControlName","dataSource","panelClass","select-datasource-selector-panel"],[3,"formControl","placeholderLabel","noEntriesFoundLabel"],[3,"value"],["formControlName","item","panelClass","select-datasource-selector-panel"],[1,"slug-label"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"form",0),\u0275\u0275listener("ngSubmit",function(){return ctx.submit()}),\u0275\u0275elementStart(1,"mat-dialog-content")(2,"div",1),\u0275\u0275template(3,SelectorDialogComponent_Conditional_3_Template,24,19)(4,SelectorDialogComponent_Conditional_4_Template,3,0,"div",2),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"mat-dialog-actions"),\u0275\u0275element(6,"span",3),\u0275\u0275elementStart(7,"button",4)(8,"span",5),\u0275\u0275text(9,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(10,"button",6)(11,"span",5),\u0275\u0275text(12,"OK"),\u0275\u0275elementEnd()()()()),rf&2&&(\u0275\u0275property("formGroup",ctx.form),\u0275\u0275advance(3),\u0275\u0275conditional(ctx.previewAgentSelected?3:4),\u0275\u0275advance(7),\u0275\u0275property("disabled",ctx.form.pristine&&!ctx.form.valid))},dependencies:[DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,\u0275NgNoValidate,NgControlStatus,NgControlStatusGroup,FormControlDirective,FormGroupDirective,FormControlName,TranslateDirective,MatOption,MatButton,MatDialogClose,MatDialogActions,MatDialogContent,MatFormField,MatLabel,MatError,MatSelect,MatSelectSearchComponent,TranslatePipe],styles:["[_nghost-%COMP%]{display:block;min-width:448px;max-width:448px;min-height:170px}[_nghost-%COMP%] .mat-mdc-select[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%] .mat-mdc-select[_ngcontent-%COMP%] .mat-mdc-select-value{visibility:hidden}[_nghost-%COMP%] .input-mock{width:100%;position:absolute;top:23px;left:0}[_nghost-%COMP%] .input-mock span{max-width:48%;display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .input-mock .extra-margin-left{margin-left:8px}[_nghost-%COMP%] .input-mock .blue{color:#00569d}[_nghost-%COMP%] .input-mock .orange{color:#eb9b01}[_nghost-%COMP%] .no-device-selected[_ngcontent-%COMP%]{margin-top:25px} .mat-mdc-select-panel.select-datasource-selector-panel mat-option.mat-mdc-option{line-height:1em} .mat-mdc-select-panel.select-datasource-selector-panel mat-option.mat-mdc-option .slug-label{font-size:13px;color:#0000008a}"],changeDetection:0});let SelectorDialogComponent3=_SelectorDialogComponent;return SelectorDialogComponent3})();var TAG_SELECTOR_REGEX=/^([^\s]+)[.](tag)[.]([^\s]+)$/,VARIABLE_SELECTOR_REGEX=/^([^\s]+)[.](var|variable)[.]([^\s]+)$/;function createColoredInputMockSelector(value){let numberOfDots=value?.split(".").length,selectorInputMock="",[partOne,rest]=splitByFirstDot(value),[partTwo,partThree]=splitByFirstDot(rest);return partOne&&(selectorInputMock+=`<span class="orange">${partOne}</span>`),numberOfDots>1&&(selectorInputMock+="<span>.</span>"),partTwo&&(selectorInputMock+=`<span>${partTwo}</span>`),numberOfDots>2&&(selectorInputMock+="<span>.</span>"),partThree&&(selectorInputMock+=`<span class="blue">${partThree}</span>`),selectorInputMock}function splitByFirstDot(label){return label?.indexOf(".")>-1?[label.substring(0,label.indexOf(".")),label.substring(label.indexOf(".")+1)]:[label,""]}function createSelectorValidator(pattern){return control=>{let required=control.hasValidator(Validators.required),validator=Validators.pattern(pattern)(control);return required||control.value&&control.value!=="Agent#selected:"?validator:null}}var TagSelectorValidator=createSelectorValidator(TAG_SELECTOR_REGEX),VariableSelectorValidator=createSelectorValidator(VARIABLE_SELECTOR_REGEX);function SelectorInputComponent_Conditional_9_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",2),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}var SelectorInputComponent=(()=>{let _SelectorInputComponent=class _SelectorInputComponent{constructor(){this.dialog=inject(MatDialog),this.destroy=inject(DestroyRef),this.formControl=new FormControl("",{nonNullable:!0}),this.selectorInputFocused=!1,this.selectorInputMock=""}ngOnInit(){this.formControl.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>{this.selectorInputMock=createColoredInputMockSelector(value),this.selectorControl?.setValue("Agent#selected:"+value)});let validators=[];this.required&&validators.push(Validators.required),validators.push(this.label==="TAG"?TagSelectorValidator:VariableSelectorValidator),this.formControl?.setValidators(validators),this.selectorControl?.setValidators(validators),this.formControl.setValue(this.selectorControl?.value?.split(":")?.[1]||"")}ngOnChanges(changes){changes.disabled&&this.formControl[this.disabled?"disable":"enable"]()}openSelectorDialog(event2){event2.stopPropagation(),this.dialog.open(SelectorDialogComponent,{data:{formControl:this.formControl,label:this.label,pageVersionId:this.pageVersionId,selectors:this.selectors}})}};_SelectorInputComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectorInputComponent)},_SelectorInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_SelectorInputComponent,selectors:[["ix-selector-input"]],inputs:{label:"label",disabled:"disabled",required:"required",pageVersionId:"pageVersionId",selectorControl:"selectorControl",selectors:"selectors"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:10,vars:9,consts:[["fxFlex",""],[1,"selector-input-mock",3,"innerHTML"],["translate",""],["matInput","","autocomplete","off","spellcheck","false",1,"selector-input",3,"blur","focus","formControl"],["type","button","matIconSuffix","","mat-icon-button","",3,"click","disabled"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div")(1,"mat-form-field",0),\u0275\u0275element(2,"span",1),\u0275\u0275elementStart(3,"mat-label",2),\u0275\u0275text(4),\u0275\u0275elementEnd(),\u0275\u0275elementStart(5,"input",3),\u0275\u0275listener("blur",function(){return ctx.selectorInputFocused=!1})("focus",function(){return ctx.selectorInputFocused=!0}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(6,"button",4),\u0275\u0275listener("click",function($event){return ctx.openSelectorDialog($event)}),\u0275\u0275elementStart(7,"mat-icon"),\u0275\u0275text(8,"folder_open"),\u0275\u0275elementEnd()(),\u0275\u0275template(9,SelectorInputComponent_Conditional_9_Template,2,0,"mat-error",2),\u0275\u0275elementEnd()()),rf&2&&(\u0275\u0275advance(2),\u0275\u0275classProp("hidden",ctx.selectorInputFocused),\u0275\u0275property("innerHTML",ctx.selectorInputMock,\u0275\u0275sanitizeHtml),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx.label),\u0275\u0275advance(),\u0275\u0275classProp("hidden",!ctx.selectorInputFocused),\u0275\u0275property("formControl",ctx.formControl),\u0275\u0275advance(),\u0275\u0275property("disabled",ctx.disabled),\u0275\u0275advance(3),\u0275\u0275conditional(ctx.formControl.hasError("required")?9:-1))},dependencies:[DefaultFlexDirective,DefaultValueAccessor,NgControlStatus,FormControlDirective,TranslateDirective,MatIconButton,MatFormField,MatLabel,MatError,MatSuffix,MatIcon,MatInput],styles:["[_nghost-%COMP%] .selector-input[_ngcontent-%COMP%]{opacity:1}[_nghost-%COMP%] .selector-input.hidden[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{padding:0 4px}[_nghost-%COMP%] .selector-input-mock{max-width:100%;opacity:1;overflow:hidden;pointer-events:none;position:absolute;text-overflow:ellipsis;white-space:nowrap}[_nghost-%COMP%] .selector-input-mock.hidden{opacity:0}[_nghost-%COMP%] .selector-input-mock .blue{color:#00569d}[_nghost-%COMP%] .selector-input-mock .orange{color:#eb9b01}"],changeDetection:0});let SelectorInputComponent3=_SelectorInputComponent;return SelectorInputComponent3})();var FormatConstantCaseDirective=(()=>{let _FormatConstantCaseDirective=class _FormatConstantCaseDirective{constructor(formControl){this.formControl=formControl,this.destroy=inject(DestroyRef)}ngOnInit(){this.formControl.control?.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>{let formattedValue=value?.toUpperCase().replace(/ /g,"_");this.formControl?.control&&formattedValue!==value&&this.formControl.control.patchValue(formattedValue,{emitEvent:!1})})}};_FormatConstantCaseDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_FormatConstantCaseDirective)(\u0275\u0275directiveInject(NgControl))},_FormatConstantCaseDirective.\u0275dir=\u0275\u0275defineDirective({type:_FormatConstantCaseDirective,selectors:[["","ixFormatConstantCase",""]],standalone:!1});let FormatConstantCaseDirective3=_FormatConstantCaseDirective;return FormatConstantCaseDirective3})();var FormatConstantCaseModule=(()=>{let _FormatConstantCaseModule=class _FormatConstantCaseModule{};_FormatConstantCaseModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_FormatConstantCaseModule)},_FormatConstantCaseModule.\u0275mod=\u0275\u0275defineNgModule({type:_FormatConstantCaseModule}),_FormatConstantCaseModule.\u0275inj=\u0275\u0275defineInjector({});let FormatConstantCaseModule2=_FormatConstantCaseModule;return FormatConstantCaseModule2})();var _forTrack03=($index,$item)=>$item.code;function TranslationFieldsetComponent_Conditional_5_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",2),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function TranslationFieldsetComponent_Conditional_6_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",2),\u0275\u0275text(1,"__MESSAGE__.INVALID_TRANSLATION_KEY"),\u0275\u0275elementEnd())}function TranslationFieldsetComponent_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",2),\u0275\u0275text(1,"__MESSAGE__.TRANSLATION_KEY_ALREADY_IN_USE"),\u0275\u0275elementEnd())}function TranslationFieldsetComponent_For_9_Conditional_1_Conditional_4_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",2),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function TranslationFieldsetComponent_For_9_Conditional_1_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-form-field",1)(1,"mat-label"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275element(3,"textarea",4),\u0275\u0275template(4,TranslationFieldsetComponent_For_9_Conditional_1_Conditional_4_Template,2,0,"mat-error",2),\u0275\u0275elementEnd()),rf&2){let languageControl_r1=ctx,language_r2=\u0275\u0275nextContext().$implicit;\u0275\u0275advance(2),\u0275\u0275textInterpolate(language_r2.native),\u0275\u0275advance(),\u0275\u0275property("formControl",languageControl_r1),\u0275\u0275advance(),\u0275\u0275conditional(languageControl_r1.hasError("required")?4:-1)}}function TranslationFieldsetComponent_For_9_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div"),\u0275\u0275template(1,TranslationFieldsetComponent_For_9_Conditional_1_Template,5,3,"mat-form-field",1),\u0275\u0275elementEnd()),rf&2){let tmp_10_0,language_r2=ctx.$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275conditional((tmp_10_0=ctx_r2.form.controls.languages.controls[language_r2.code])?1:-1,tmp_10_0)}}var TranslationFieldsetComponent=(()=>{let _TranslationFieldsetComponent=class _TranslationFieldsetComponent{};_TranslationFieldsetComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationFieldsetComponent)},_TranslationFieldsetComponent.\u0275cmp=\u0275\u0275defineComponent({type:_TranslationFieldsetComponent,selectors:[["ix-translation-fieldset"]],inputs:{form:"form",languages:"languages"},decls:10,vars:4,consts:[["fxLayout","column","fxLayoutGap","16px"],["floatLabel","always","fxFlex","","appearance","fill"],["translate",""],["matInput","","cdkFocusInitial","","data-lpignore","true","ixFormatConstantCase","",3,"formControl"],["matInput","","data-lpignore","true","cdkTextareaAutosize","true","cdkAutosizeMinRows","1","cdkAutosizeMaxRows","15",3,"formControl"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"mat-form-field",1)(2,"mat-label",2),\u0275\u0275text(3,"TRANSLATION_KEY"),\u0275\u0275elementEnd(),\u0275\u0275element(4,"input",3),\u0275\u0275template(5,TranslationFieldsetComponent_Conditional_5_Template,2,0,"mat-error",2)(6,TranslationFieldsetComponent_Conditional_6_Template,2,0,"mat-error",2)(7,TranslationFieldsetComponent_Conditional_7_Template,2,0,"mat-error",2),\u0275\u0275elementEnd(),\u0275\u0275repeaterCreate(8,TranslationFieldsetComponent_For_9_Template,2,1,"div",null,_forTrack03),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275advance(4),\u0275\u0275property("formControl",ctx.form.controls.key),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.key.hasError("required")?5:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.key.hasError("pattern")?6:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.key.hasError("keyInUse")?7:-1),\u0275\u0275advance(),\u0275\u0275repeater(ctx.languages))},dependencies:[A11yModule,FlexModule,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultFlexDirective,FormatConstantCaseModule,FormatConstantCaseDirective,MatFormFieldModule,MatFormField,MatLabel,MatError,MatInputModule,MatInput,CdkTextareaAutosize,ReactiveFormsModule,DefaultValueAccessor,NgControlStatus,FormControlDirective,TranslateModule,TranslateDirective],encapsulation:2,changeDetection:0});let TranslationFieldsetComponent2=_TranslationFieldsetComponent;return TranslationFieldsetComponent2})();var LOADER_PATH=new InjectionToken("systems.translation.loader-path"),TranslationLoaderService=(()=>{let _TranslationLoaderService=class _TranslationLoaderService{constructor(loaderPath,http){this.loaderPath=loaderPath,this.http=http}getTranslation(lang){return this.http.get(`${this.loaderPath}${lang}.json`).pipe(catchError(()=>of({})))}};_TranslationLoaderService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationLoaderService)(\u0275\u0275inject(LOADER_PATH),\u0275\u0275inject(HttpClient))},_TranslationLoaderService.\u0275prov=\u0275\u0275defineInjectable({token:_TranslationLoaderService,factory:_TranslationLoaderService.\u0275fac,providedIn:"root"});let TranslationLoaderService2=_TranslationLoaderService;return TranslationLoaderService2})();var setLanguage=createAction("[Translation] Set Language",props());var FALLBACK_LANG="en",LANG_STORAGE_KEY="lang",LANGUAGES=[{code:"de",name:"German",native:"Deutsch"},{code:"en",name:"English",native:"English"},{code:"es",name:"Spanish",native:"Espa\xF1ol"},{code:"fr",name:"French",native:"Fran\xE7ais"},{code:"it",name:"Italian",native:"Italiano"},{code:"nl",name:"Dutch",native:"Nederlands"},{code:"pl",name:"Polish",native:"Polski"}];var TranslationEffects2=(()=>{let _TranslationEffects=class _TranslationEffects{constructor(actions$,storage,translate){this.actions$=actions$,this.storage=storage,this.translate=translate,this.setLanguage$=createEffect(()=>this.actions$.pipe(ofType(setLanguage),tap(({lang})=>this.translate.use(lang))),{dispatch:!1}),this.remember$=createEffect(()=>this.translate.onLangChange.pipe(tap(()=>this.storage.set(LANG_STORAGE_KEY,this.translate.currentLang))),{dispatch:!1}),this.userPreference$=createEffect(()=>this.actions$.pipe(ofType(logInSuccess,loadMeSuccess2,didUpdateMe),map(({data})=>get_default(data,"language",get_default(data,"user.language",void 0))),filter(lang=>lang!==void 0),distinctUntilChanged(),map(lang=>setLanguage({lang}))))}};_TranslationEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(StorageService),\u0275\u0275inject(TranslateService))},_TranslationEffects.\u0275prov=\u0275\u0275defineInjectable({token:_TranslationEffects,factory:_TranslationEffects.\u0275fac});let TranslationEffects3=_TranslationEffects;return TranslationEffects3})();function initializerFactory(location2,translate,storage){return()=>{let queryString=location2.path().split("?").pop(),queryParams=new URLSearchParams(queryString),queryLang=validate(queryParams.get("lang"));queryLang&&storage.set(LANG_STORAGE_KEY,queryLang);let defaultLang=validate(navigator.language)||FALLBACK_LANG;return translate.setDefaultLang(FALLBACK_LANG),translate.use(storage.get(LANG_STORAGE_KEY,defaultLang))};function validate(lang){if(lang){lang=lang.slice(0,2);let found=LANGUAGES.find(language=>language.code===lang);if(found)return found.code}return null}}function loaderFactory(capacitorPlatform){let isWeb=capacitorPlatform==="web",isSimulator=environment.appName==="Simulator";return environment.production&&environment.build!=="production"&&isWeb&&!isSimulator?`../i18n/${environment.build}/`:"../i18n/local/"}var TranslationRootModule=(()=>{let _TranslationRootModule=class _TranslationRootModule{};_TranslationRootModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationRootModule)},_TranslationRootModule.\u0275mod=\u0275\u0275defineNgModule({type:_TranslationRootModule}),_TranslationRootModule.\u0275inj=\u0275\u0275defineInjector({providers:[{provide:APP_INITIALIZER,multi:!0,useFactory:initializerFactory,deps:[Location,TranslateService,StorageService]},{provide:LOADER_PATH,useFactory:loaderFactory,deps:[CAPACITOR_PLATFORM]}],imports:[SharedModule,EffectsModule.forFeature([TranslationEffects2]),TranslateModule.forRoot({loader:{provide:TranslateLoader,useClass:TranslationLoaderService}})]});let TranslationRootModule2=_TranslationRootModule;return TranslationRootModule2})(),TranslationModule2=(()=>{let _TranslationModule=class _TranslationModule{static forRoot(){return{ngModule:TranslationRootModule,providers:[]}}};_TranslationModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationModule)},_TranslationModule.\u0275mod=\u0275\u0275defineNgModule({type:_TranslationModule}),_TranslationModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule,TranslateModule]});let TranslationModule3=_TranslationModule;return TranslationModule3})();var LinkTranslationDialogFacadeBase=class{constructor(){this.store=inject(Store),this.languages$=of([LANGUAGES.find(language=>language.code==="en"),...LANGUAGES.filter(language=>language.code!=="en")]),this.translations$=this.store.select(selectAll44)}};var UnlinkTranslationDialogFacade=(()=>{let _UnlinkTranslationDialogFacade=class _UnlinkTranslationDialogFacade extends LinkTranslationDialogFacadeBase{getTranslation(translationKey){return this.translations$.pipe(map(translations=>translations.find(translation=>`__TRANSLATION__.${translation.key}`===translationKey)))}};_UnlinkTranslationDialogFacade.\u0275fac=(()=>{let \u0275UnlinkTranslationDialogFacade_BaseFactory;return function(__ngFactoryType__){return(\u0275UnlinkTranslationDialogFacade_BaseFactory||(\u0275UnlinkTranslationDialogFacade_BaseFactory=\u0275\u0275getInheritedFactory(_UnlinkTranslationDialogFacade)))(__ngFactoryType__||_UnlinkTranslationDialogFacade)}})(),_UnlinkTranslationDialogFacade.\u0275prov=\u0275\u0275defineInjectable({token:_UnlinkTranslationDialogFacade,factory:_UnlinkTranslationDialogFacade.\u0275fac,providedIn:"root"});let UnlinkTranslationDialogFacade2=_UnlinkTranslationDialogFacade;return UnlinkTranslationDialogFacade2})();var UnlinkTranslationDialogComponent=(()=>{let _UnlinkTranslationDialogComponent=class _UnlinkTranslationDialogComponent{constructor(){this.data=inject(MAT_DIALOG_DATA),this.destroy=inject(DestroyRef),this.facade=inject(UnlinkTranslationDialogFacade),this.fb=inject(FormBuilder),this.form=this.fb.nonNullable.group({key:[{value:"",disabled:!0}],languages:this.fb.nonNullable.group({})}),this.languages=[]}ngOnInit(){combineLatest([this.facade.getTranslation(this.data.translationKey),this.facade.languages$]).pipe(takeUntilDestroyed(this.destroy)).subscribe(([translation,languages])=>{this.form.controls.key.setValue(translation?.key||trimNamespace(this.data.translationKey),{emitEvent:!1}),this.languages=languages,this.languages.forEach(language=>this.form.controls.languages.addControl(language.code,this.fb.nonNullable.control({value:translation?.languages?.[language.code]||"",disabled:!0}),{emitEvent:!1}))}),this.form.disable()}};_UnlinkTranslationDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_UnlinkTranslationDialogComponent)},_UnlinkTranslationDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_UnlinkTranslationDialogComponent,selectors:[["ix-unlink-translation-dialog"]],decls:13,vars:6,consts:[["fxLayout","row"],["fxFlex","","mat-dialog-title","","translate",""],["type","button","mat-icon-button","","mat-dialog-close","",3,"matTooltip"],[3,"form","languages"],["type","button","mat-button","","color","warn",3,"mat-dialog-close"],["translate",""]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"header",0)(1,"h1",1),\u0275\u0275text(2,"LINKED_TRANSLATION"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"button",2),\u0275\u0275pipe(4,"translate"),\u0275\u0275elementStart(5,"mat-icon"),\u0275\u0275text(6,"close"),\u0275\u0275elementEnd()()(),\u0275\u0275elementStart(7,"mat-dialog-content"),\u0275\u0275element(8,"ix-translation-fieldset",3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"mat-dialog-actions")(10,"button",4)(11,"span",5),\u0275\u0275text(12,"UNLINK"),\u0275\u0275elementEnd()()()),rf&2&&(\u0275\u0275advance(3),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(4,4,"CLOSE")),\u0275\u0275advance(5),\u0275\u0275property("form",ctx.form)("languages",ctx.languages),\u0275\u0275advance(2),\u0275\u0275property("mat-dialog-close",!0))},dependencies:[FlexModule,DefaultLayoutDirective,DefaultFlexDirective,MatButtonModule,MatButton,MatIconButton,MatDialogModule,MatDialogClose,MatDialogTitle,MatDialogActions,MatDialogContent,MatIconModule,MatIcon,MatTooltipModule,MatTooltip,TranslateModule,TranslatePipe,TranslateDirective,TranslationFieldsetComponent],styles:["[_nghost-%COMP%]{width:100dvw;height:100dvh;display:flex;flex-direction:column;flex:1}@media (min-width: 960px){[_nghost-%COMP%]{height:auto;width:auto;min-width:528px;max-width:528px}}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%]{padding:calc(env(safe-area-inset-top,0) + 16px) 24px 16px}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar{height:48px;padding-left:0;padding-right:0}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title{--mat-dialog-headline-padding: 0;color:inherit}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title:before{display:none}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .mdc-dialog__content[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] .mdc-dialog__title[_ngcontent-%COMP%]:before{height:calc(env(safe-area-inset-top,0) + 40px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]{padding:20px 24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .ix-list[_ngcontent-%COMP%]{margin-left:-24px;margin-right:-24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch;flex:1 1 auto;max-height:none;overflow:auto;-webkit-overflow-scrolling:touch}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%]{margin-left:0;margin-right:0}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 140px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions), [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions){padding-bottom:0}}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__banner[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 225px)}}@media (max-width: 959.9px){[_nghost-%COMP%] .mdc-dialog__actions[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.12);padding-bottom:calc(16px + env(safe-area-inset-bottom,0))}}[_nghost-%COMP%] form[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 auto;height:inherit}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:1rem}[_nghost-%COMP%] header[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin:14px 14px 0 0}[_nghost-%COMP%] ix-translation-fieldset .mat-mdc-form-field .mat-mdc-form-field-subscript-wrapper{display:none}"],changeDetection:0});let UnlinkTranslationDialogComponent2=_UnlinkTranslationDialogComponent;return UnlinkTranslationDialogComponent2})();function translationKeyInUseValidator(control){return this.data.usedTranslationKeys?.includes(control.value)?{keyInUse:!0}:null}var AddTranslationDialogComponent=(()=>{let _AddTranslationDialogComponent=class _AddTranslationDialogComponent{constructor(){this.dialogRef=inject(MatDialogRef),this.fb=inject(FormBuilder),this.data=inject(MAT_DIALOG_DATA),this.form=this.fb.nonNullable.group({key:["",[Validators.pattern(/^[A-Z0-9_?.!]+$/),Validators.required,translationKeyInUseValidator.bind(this)]],languages:this.fb.nonNullable.group(this.data.languages.reduce((controls,language)=>__spreadProps(__spreadValues({},controls),{[language.code]:["",language.code==="en"?[Validators.required]:[]]}),{}))})}submit(){this.dialogRef.close(__spreadProps(__spreadValues({},this.form.value),{languages:omitBy_default(this.form.value.languages,isEmpty_default)}))}};_AddTranslationDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AddTranslationDialogComponent)},_AddTranslationDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_AddTranslationDialogComponent,selectors:[["ix-add-translation-dialog"]],decls:13,vars:4,consts:[["autocomplete","off",3,"ngSubmit","formGroup"],["mat-dialog-title","","translate",""],[3,"form","languages"],["fxFlex",""],["mat-button","","mat-dialog-close",""],["translate",""],["type","submit","mat-button","","mat-button","","color","primary",3,"disabled"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"form",0),\u0275\u0275listener("ngSubmit",function(){return ctx.submit()}),\u0275\u0275elementStart(1,"h1",1),\u0275\u0275text(2,"ADD_NEW_TRANSLATION"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"mat-dialog-content"),\u0275\u0275element(4,"ix-translation-fieldset",2),\u0275\u0275elementEnd(),\u0275\u0275elementStart(5,"mat-dialog-actions"),\u0275\u0275element(6,"span",3),\u0275\u0275elementStart(7,"button",4)(8,"span",5),\u0275\u0275text(9,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(10,"button",6)(11,"span",5),\u0275\u0275text(12,"ADD"),\u0275\u0275elementEnd()()()()),rf&2&&(\u0275\u0275property("formGroup",ctx.form),\u0275\u0275advance(4),\u0275\u0275property("form",ctx.form)("languages",ctx.data.languages),\u0275\u0275advance(6),\u0275\u0275property("disabled",ctx.form.pristine||ctx.form.invalid))},dependencies:[ReactiveFormsModule,\u0275NgNoValidate,NgControlStatusGroup,FormGroupDirective,MatButtonModule,MatButton,MatDialogModule,MatDialogClose,MatDialogTitle,MatDialogActions,MatDialogContent,FlexModule,DefaultFlexDirective,TranslateModule,TranslateDirective,TranslationFieldsetComponent],styles:["[_nghost-%COMP%]{width:100dvw;height:100dvh;display:flex;flex-direction:column;flex:1}@media (min-width: 960px){[_nghost-%COMP%]{height:auto;width:auto;min-width:528px;max-width:528px}}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%]{padding:calc(env(safe-area-inset-top,0) + 16px) 24px 16px}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar{height:48px;padding-left:0;padding-right:0}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title{--mat-dialog-headline-padding: 0;color:inherit}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title:before{display:none}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .mdc-dialog__content[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] .mdc-dialog__title[_ngcontent-%COMP%]:before{height:calc(env(safe-area-inset-top,0) + 40px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]{padding:20px 24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .ix-list[_ngcontent-%COMP%]{margin-left:-24px;margin-right:-24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch;flex:1 1 auto;max-height:none;overflow:auto;-webkit-overflow-scrolling:touch}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%]{margin-left:0;margin-right:0}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 140px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions), [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions){padding-bottom:0}}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__banner[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 225px)}}@media (max-width: 959.9px){[_nghost-%COMP%] .mdc-dialog__actions[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.12);padding-bottom:calc(16px + env(safe-area-inset-bottom,0))}}[_nghost-%COMP%] form[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 auto;height:inherit}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:1rem}"],changeDetection:0});let AddTranslationDialogComponent2=_AddTranslationDialogComponent;return AddTranslationDialogComponent2})();var EditTranslationDialogComponent=(()=>{let _EditTranslationDialogComponent=class _EditTranslationDialogComponent{constructor(){this.fb=inject(FormBuilder),this.dialogRef=inject(MatDialogRef),this.data=inject(MAT_DIALOG_DATA),this.form=this.fb.nonNullable.group({key:[{value:this.data.translation.key??"",disabled:!0},[Validators.required]],languages:this.fb.nonNullable.group(this.data.languages.reduce((controls,language)=>__spreadProps(__spreadValues({},controls),{[language.code]:[this.data.translation.languages?.[language.code]||"",language.code==="en"?[Validators.required]:[]]}),{}))})}submit(){this.dialogRef.close(__spreadProps(__spreadValues({},this.data.translation),{languages:omitBy_default(this.form.controls.languages.value,isEmpty_default)}))}};_EditTranslationDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_EditTranslationDialogComponent)},_EditTranslationDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_EditTranslationDialogComponent,selectors:[["ix-edit-translation-dialog"]],decls:13,vars:4,consts:[["autocomplete","off",3,"ngSubmit","formGroup"],["mat-dialog-title","","translate",""],[3,"form","languages"],["fxFlex",""],["mat-button","","mat-dialog-close",""],["translate",""],["type","submit","mat-button","","mat-button","","color","primary",3,"disabled"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"form",0),\u0275\u0275listener("ngSubmit",function(){return ctx.submit()}),\u0275\u0275elementStart(1,"h1",1),\u0275\u0275text(2,"EDIT_TRANSLATION"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"mat-dialog-content"),\u0275\u0275element(4,"ix-translation-fieldset",2),\u0275\u0275elementEnd(),\u0275\u0275elementStart(5,"mat-dialog-actions"),\u0275\u0275element(6,"span",3),\u0275\u0275elementStart(7,"button",4)(8,"span",5),\u0275\u0275text(9,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(10,"button",6)(11,"span",5),\u0275\u0275text(12,"SAVE"),\u0275\u0275elementEnd()()()()),rf&2&&(\u0275\u0275property("formGroup",ctx.form),\u0275\u0275advance(4),\u0275\u0275property("form",ctx.form)("languages",ctx.data.languages),\u0275\u0275advance(6),\u0275\u0275property("disabled",ctx.form.pristine||ctx.form.invalid))},dependencies:[ReactiveFormsModule,\u0275NgNoValidate,NgControlStatusGroup,FormGroupDirective,MatButtonModule,MatButton,MatDialogModule,MatDialogClose,MatDialogTitle,MatDialogActions,MatDialogContent,FlexModule,DefaultFlexDirective,TranslateModule,TranslateDirective,TranslationFieldsetComponent],styles:["[_nghost-%COMP%]{width:100dvw;height:100dvh;display:flex;flex-direction:column;flex:1}@media (min-width: 960px){[_nghost-%COMP%]{height:auto;width:auto;min-width:528px;max-width:528px}}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%]{padding:calc(env(safe-area-inset-top,0) + 16px) 24px 16px}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar{height:48px;padding-left:0;padding-right:0}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title{--mat-dialog-headline-padding: 0;color:inherit}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title:before{display:none}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .mdc-dialog__content[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] .mdc-dialog__title[_ngcontent-%COMP%]:before{height:calc(env(safe-area-inset-top,0) + 40px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]{padding:20px 24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .ix-list[_ngcontent-%COMP%]{margin-left:-24px;margin-right:-24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch;flex:1 1 auto;max-height:none;overflow:auto;-webkit-overflow-scrolling:touch}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%]{margin-left:0;margin-right:0}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 140px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions), [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions){padding-bottom:0}}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__banner[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 225px)}}@media (max-width: 959.9px){[_nghost-%COMP%] .mdc-dialog__actions[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.12);padding-bottom:calc(16px + env(safe-area-inset-bottom,0))}}[_nghost-%COMP%] form[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 auto;height:inherit}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:1rem}"],changeDetection:0});let EditTranslationDialogComponent2=_EditTranslationDialogComponent;return EditTranslationDialogComponent2})();function FlatSearchInputComponent_Conditional_5_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",3),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.clear())}),\u0275\u0275elementStart(1,"mat-icon"),\u0275\u0275text(2,"close"),\u0275\u0275elementEnd()()}}var FlatSearchInputComponent=(()=>{let _FlatSearchInputComponent=class _FlatSearchInputComponent{constructor(){this.showClearButtonWhenEmpty=!1,this.afterQueryChange=new EventEmitter,this.afterQueryClear=new EventEmitter,this.destroy=inject(DestroyRef)}ngOnInit(){this.query?.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>{this.afterQueryChange&&this.afterQueryChange.emit()})}clear(){this.query?.setValue(""),this.afterQueryClear&&this.afterQueryClear.emit()}};_FlatSearchInputComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_FlatSearchInputComponent)},_FlatSearchInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_FlatSearchInputComponent,selectors:[["ix-flat-search-input"]],inputs:{query:"query",showClearButtonWhenEmpty:[2,"showClearButtonWhenEmpty","showClearButtonWhenEmpty",booleanAttribute]},outputs:{afterQueryChange:"afterQueryChange",afterQueryClear:"afterQueryClear"},decls:6,vars:5,consts:[["matIconPrefix",""],["id","flat-search-mat-input","matInput","","type","search",3,"formControl","placeholder"],["matIconSuffix","","type","button","mat-icon-button","",1,"close-icon"],["matIconSuffix","","type","button","mat-icon-button","",1,"close-icon",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-icon",0),\u0275\u0275text(2,"search"),\u0275\u0275elementEnd(),\u0275\u0275element(3,"input",1),\u0275\u0275pipe(4,"translate"),\u0275\u0275template(5,FlatSearchInputComponent_Conditional_5_Template,3,0,"button",2),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275advance(3),\u0275\u0275property("formControl",ctx.query)("placeholder",\u0275\u0275pipeBind1(4,3,"SEARCH")),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.showClearButtonWhenEmpty||ctx.query.value?5:-1))},dependencies:[ReactiveFormsModule,DefaultValueAccessor,NgControlStatus,FormControlDirective,MatButtonModule,MatIconButton,MatFormFieldModule,MatFormField,MatPrefix,MatSuffix,MatIconModule,MatIcon,MatInputModule,MatInput,TranslateModule,TranslatePipe],styles:["[_nghost-%COMP%]{--ix-flat-search-input-width: 200px;--ix-flat-search-input-height: 32px;display:block}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{--mdc-filled-text-field-container-color: color-mix( in srgb, transparent, currentcolor 4% );--mat-form-field-container-text-size: 14px;width:var(--ix-flat-search-input-width);height:var(--ix-flat-search-input-height)}[_nghost-%COMP%] .mat-mdc-form-field.mat-focused[_ngcontent-%COMP%] .mat-mdc-form-field-focus-overlay{opacity:.04}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mdc-text-field--filled{--mdc-filled-text-field-active-indicator-height: 0;--mdc-filled-text-field-focus-active-indicator-height: 0;--mdc-filled-text-field-input-text-color: color-mix( in srgb, transparent, currentcolor 67% );border-radius:calc(var(--ix-flat-search-input-height) * .5)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-flex{max-height:var(--ix-flat-search-input-height)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-icon-prefix>.mat-icon{padding:calc((var(--ix-flat-search-input-height) - 20px) * .5)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-infix{width:auto;min-height:var(--ix-flat-search-input-height);padding:0!important}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-infix input{height:var(--ix-flat-search-input-height)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-infix input::placeholder{color:color-mix(in srgb,transparent,currentcolor 34%)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-infix input[type=search]::-webkit-search-decoration, [_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-infix input[type=search]::-webkit-search-cancel-button{appearance:none}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-icon-prefix{padding-right:max(36px - var(--ix-flat-search-input-height),0px)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix{padding-left:max(36px - var(--ix-flat-search-input-height),0px)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-icon-suffix .mat-mdc-icon-button{--mdc-icon-button-state-layer-size: var( --ix-flat-search-input-height );--mdc-icon-button-icon-size: min( calc(var(--ix-flat-search-input-height) - 12px), 20px );width:var(--ix-flat-search-input-height);height:var(--ix-flat-search-input-height)}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .mat-mdc-form-field-subscript-wrapper{display:none}"],changeDetection:0});let FlatSearchInputComponent2=_FlatSearchInputComponent;return FlatSearchInputComponent2})();var LinkTranslationDialogFacade=(()=>{let _LinkTranslationDialogFacade=class _LinkTranslationDialogFacade extends LinkTranslationDialogFacadeBase{addTranslation(translation){this.store.dispatch(addMany({data:[translation]}))}editTranslation(translation){this.store.dispatch(updateMany6({data:[translation]}))}};_LinkTranslationDialogFacade.\u0275fac=(()=>{let \u0275LinkTranslationDialogFacade_BaseFactory;return function(__ngFactoryType__){return(\u0275LinkTranslationDialogFacade_BaseFactory||(\u0275LinkTranslationDialogFacade_BaseFactory=\u0275\u0275getInheritedFactory(_LinkTranslationDialogFacade)))(__ngFactoryType__||_LinkTranslationDialogFacade)}})(),_LinkTranslationDialogFacade.\u0275prov=\u0275\u0275defineInjectable({token:_LinkTranslationDialogFacade,factory:_LinkTranslationDialogFacade.\u0275fac,providedIn:"root"});let LinkTranslationDialogFacade2=_LinkTranslationDialogFacade;return LinkTranslationDialogFacade2})();function LinkTranslationDialogComponent_For_13_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-list-option",8)(1,"div",16),\u0275\u0275element(2,"span",17),\u0275\u0275pipe(3,"highlightText"),\u0275\u0275elementStart(4,"button",18),\u0275\u0275pipe(5,"translate"),\u0275\u0275listener("click",function($event){let translation_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return $event.stopPropagation(),\u0275\u0275resetView(ctx_r2.openEditTranslationDialog(translation_r2))}),\u0275\u0275elementStart(6,"mat-icon"),\u0275\u0275text(7,"edit"),\u0275\u0275elementEnd()()()()}if(rf&2){let translation_r2=ctx.$implicit,ctx_r2=\u0275\u0275nextContext();\u0275\u0275property("value",translation_r2)("selected",translation_r2.key===(ctx_r2.selectedTranslation==null?null:ctx_r2.selectedTranslation.key)),\u0275\u0275advance(2),\u0275\u0275property("innerHTML",\u0275\u0275pipeBind3(3,4,ctx_r2.getTranslationLabel(translation_r2),ctx_r2.query.value,"35ch"),\u0275\u0275sanitizeHtml),\u0275\u0275advance(2),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(5,8,"EDIT_TRANSLATION"))}}function LinkTranslationDialogComponent_Conditional_15_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"p")(1,"span"),\u0275\u0275text(2),\u0275\u0275pipe(3,"translate"),\u0275\u0275elementEnd()()),rf&2){let ctx_r2=\u0275\u0275nextContext();\u0275\u0275advance(2),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(3,1,ctx_r2.query.value?"NO_MATCHING_RESULTS":"NO_TRANSLATIONS"))}}var LinkTranslationDialogComponent=(()=>{let _LinkTranslationDialogComponent=class _LinkTranslationDialogComponent{constructor(){this.cdRef=inject(ChangeDetectorRef),this.destroy=inject(DestroyRef),this.dialog=inject(MatDialog),this.facade=inject(LinkTranslationDialogFacade),this.fb=inject(FormBuilder),this.form=this.fb.nonNullable.group({key:[""],languages:this.fb.nonNullable.group({})}),this.query=this.fb.nonNullable.control(""),this.translations=[],this.languages=[],this.filteredTranslations$=this.query.valueChanges.pipe(startWith(""),map(value=>this._filter(value)),takeUntilDestroyed(this.destroy))}ngOnInit(){this.facade.translations$.pipe(takeUntilDestroyed(this.destroy)).subscribe(translations=>{this.translations=translations,this.query.setValue(this.query.value),this.selectedTranslation&&(this.selectedTranslation=this.translations.find(translation=>translation.key===this.selectedTranslation?.key),this.fillFormWithSelectedTranslation()),this.cdRef.markForCheck()}),this.facade.languages$.pipe(take(1)).subscribe(languages=>{this.languages=languages,this.languages.forEach(language=>this.form.controls.languages.addControl(language.code,this.fb.nonNullable.control(""),{emitEvent:!1})),this.form.disable()})}getTranslationLabel(translation){return translation.key+": "+Object.values(translation.languages||{}).join(", ")}selectTranslation(change){this.selectedTranslation=change.options[0].value,this.fillFormWithSelectedTranslation()}fillFormWithSelectedTranslation(){this.form.reset(),this.selectedTranslation&&this.form.patchValue(this.selectedTranslation),this.cdRef.markForCheck()}_filter(value){let filterValue=value?.toLowerCase().trim()||"";return this.translations.filter(option=>this.getTranslationLabel(option)?.toLowerCase().includes(filterValue))}openAddTranslationDialog(){this.dialog.open(AddTranslationDialogComponent,{autoFocus:!0,data:{languages:this.languages,usedTranslationKeys:this.translations.map(translation=>translation.key)},panelClass:"fullscreen"}).afterClosed().subscribe(translation=>{translation&&(this.selectedTranslation=translation,this.facade.addTranslation(translation))})}openEditTranslationDialog(translation){this.dialog.open(EditTranslationDialogComponent,{data:{languages:this.languages,translation},panelClass:"fullscreen"}).afterClosed().subscribe(updatedTranslation=>{updatedTranslation&&(this.selectedTranslation=updatedTranslation,this.facade.editTranslation(updatedTranslation))})}};_LinkTranslationDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LinkTranslationDialogComponent)},_LinkTranslationDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_LinkTranslationDialogComponent,selectors:[["ix-link-translation-dialog"]],decls:31,vars:18,consts:[["fxFlex","","fxLayout","row"],["fxFlex","40",1,"dialog-column"],[1,"header"],["fxFlex","","mat-dialog-title","","translate",""],["type","button","mat-icon-button","",3,"click","matTooltip"],[1,"ix-dialog__content"],[3,"query"],[3,"selectionChange","hideSingleSelectionIndicator","multiple"],[3,"value","selected"],["fxFlex","60","fxLayout","column",1,"dialog-column"],["fxFlex",""],["type","button","mat-icon-button","","mat-dialog-close","",3,"matTooltip"],[3,"form","languages"],["fxLayoutAlign","start end"],["mat-button","","color","primary",3,"mat-dialog-close","disabled"],["translate",""],["fxLayout","row","fxLayoutAlign","start center"],["fxFlex","",3,"innerHTML"],["mat-icon-button","",3,"click","matTooltip"]],template:function(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"div",2)(3,"h1",3),\u0275\u0275text(4,"TRANSLATIONS"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(5,"button",4),\u0275\u0275pipe(6,"translate"),\u0275\u0275listener("click",function(){return ctx.openAddTranslationDialog()}),\u0275\u0275elementStart(7,"mat-icon"),\u0275\u0275text(8,"add"),\u0275\u0275elementEnd()()(),\u0275\u0275elementStart(9,"div",5),\u0275\u0275element(10,"ix-flat-search-input",6),\u0275\u0275elementStart(11,"mat-selection-list",7),\u0275\u0275listener("selectionChange",function($event){return ctx.selectTranslation($event)}),\u0275\u0275repeaterCreate(12,LinkTranslationDialogComponent_For_13_Template,8,10,"mat-list-option",8,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275pipe(14,"async"),\u0275\u0275elementEnd(),\u0275\u0275template(15,LinkTranslationDialogComponent_Conditional_15_Template,4,3,"p"),\u0275\u0275pipe(16,"async"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(17,"div",9)(18,"div",2),\u0275\u0275element(19,"span",10),\u0275\u0275elementStart(20,"button",11),\u0275\u0275pipe(21,"translate"),\u0275\u0275elementStart(22,"mat-icon"),\u0275\u0275text(23,"close"),\u0275\u0275elementEnd()()(),\u0275\u0275elementStart(24,"div",5),\u0275\u0275element(25,"ix-translation-fieldset",12),\u0275\u0275elementEnd(),\u0275\u0275elementStart(26,"mat-dialog-actions",13),\u0275\u0275element(27,"span",10),\u0275\u0275elementStart(28,"button",14)(29,"span",15),\u0275\u0275text(30,"LINK"),\u0275\u0275elementEnd()()()()()),rf&2){let tmp_5_0;\u0275\u0275advance(5),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(6,10,"ADD_NEW_TRANSLATION")),\u0275\u0275advance(5),\u0275\u0275property("query",ctx.query),\u0275\u0275advance(),\u0275\u0275property("hideSingleSelectionIndicator",!0)("multiple",!1),\u0275\u0275advance(),\u0275\u0275repeater(\u0275\u0275pipeBind1(14,12,ctx.filteredTranslations$)),\u0275\u0275advance(3),\u0275\u0275conditional(((tmp_5_0=\u0275\u0275pipeBind1(16,14,ctx.filteredTranslations$))==null?null:tmp_5_0.length)===0?15:-1),\u0275\u0275advance(5),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(21,16,"CLOSE")),\u0275\u0275advance(5),\u0275\u0275property("form",ctx.form)("languages",ctx.languages),\u0275\u0275advance(3),\u0275\u0275property("mat-dialog-close",ctx.form.value)("disabled",!ctx.selectedTranslation)}},dependencies:[AsyncPipe,FlatSearchInputComponent,FlexModule,DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,HighlightTextPipe,MatButtonModule,MatButton,MatIconButton,MatDialogModule,MatDialogClose,MatDialogTitle,MatDialogActions,MatIconModule,MatIcon,MatListModule,MatSelectionList,MatListOption,MatTooltipModule,MatTooltip,TranslateModule,TranslatePipe,TranslateDirective,TranslationFieldsetComponent],styles:["[_nghost-%COMP%]{min-width:860px!important;max-width:860px!important;width:100dvw;height:100dvh;display:flex;flex-direction:column;flex:1}@media (min-width: 960px){[_nghost-%COMP%]{height:auto;width:auto;min-width:528px;max-width:528px}}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%]{padding:calc(env(safe-area-inset-top,0) + 16px) 24px 16px}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar{height:48px;padding-left:0;padding-right:0}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title{--mat-dialog-headline-padding: 0;color:inherit}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title:before{display:none}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .mdc-dialog__content[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] .mdc-dialog__title[_ngcontent-%COMP%]:before{height:calc(env(safe-area-inset-top,0) + 40px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]{padding:20px 24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .ix-list[_ngcontent-%COMP%]{margin-left:-24px;margin-right:-24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch;flex:1 1 auto;max-height:none;overflow:auto;-webkit-overflow-scrolling:touch}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%]{margin-left:0;margin-right:0}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 140px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions), [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions){padding-bottom:0}}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__banner[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 225px)}}@media (max-width: 959.9px){[_nghost-%COMP%] .mdc-dialog__actions[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.12);padding-bottom:calc(16px + env(safe-area-inset-bottom,0))}}[_nghost-%COMP%] form[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 auto;height:inherit}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:1rem}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]{max-height:calc(100vh - 200px)}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] ix-flat-search-input[_ngcontent-%COMP%]{--ix-flat-search-input-width: 100%;margin-bottom:16px}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .header[_ngcontent-%COMP%]{height:60px;display:flex;place-content:center flex-start;align-items:center}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .mdc-dialog__title[_ngcontent-%COMP%]{margin:0}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%]{margin-right:12px}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%]:first-of-type{border-right:1px solid rgba(0,0,0,.12)}@media (max-width: 959.9px){[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%]:first-of-type .mdc-dialog__content[_ngcontent-%COMP%]{border:0}}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .mat-mdc-selection-list[_ngcontent-%COMP%]{padding-top:0;overflow-y:auto;margin-right:-24px;margin-left:-24px}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .mat-mdc-selection-list[_ngcontent-%COMP%] .mat-mdc-list-option[_ngcontent-%COMP%]{height:40px;padding-left:24px;padding-right:12px}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .mat-mdc-selection-list[_ngcontent-%COMP%] .mat-mdc-list-option[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .mat-mdc-selection-list[_ngcontent-%COMP%] .mat-mdc-list-option[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%]{display:block}[_nghost-%COMP%] .dialog-column[_ngcontent-%COMP%] .mat-mdc-selection-list[_ngcontent-%COMP%] .mat-mdc-list-option[_ngcontent-%COMP%] .mat-mdc-list-item-unscoped-content span{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}[_nghost-%COMP%] ix-translation-fieldset .mat-mdc-form-field-subscript-wrapper{display:none}"],changeDetection:0});let LinkTranslationDialogComponent2=_LinkTranslationDialogComponent;return LinkTranslationDialogComponent2})();var TranslationIconButtonComponent=(()=>{let _TranslationIconButtonComponent=class _TranslationIconButtonComponent{constructor(){this.dialog=inject(MatDialog),this.elementRef=inject(ElementRef),this.platformId=inject(PLATFORM_ID),this.translate=inject(TranslateService),this.setTranslationKey=new EventEmitter}get active(){return this.key!==void 0}get icon(){return this.active?"translate_done":"translate"}get label(){return this.translate.instant(this.active?"EDIT_TRANSLATIONS":"TRANSLATIONS")}ngAfterViewInit(){if(isPlatformBrowser(this.platformId)){let siblings=this.elementRef.nativeElement.parentElement.children,input2=Array.from(siblings).find(elm=>elm.tagName==="INPUT"&&elm.classList.contains("mat-input-element"));input2&&input2.style.setProperty("width","calc(100% - 40px)")}}openTranslationDialog(){this.key?this.dialog.open(UnlinkTranslationDialogComponent,{data:{translationKey:this.key},panelClass:"fullscreen"}).afterClosed().subscribe(confirmUnlink=>{confirmUnlink&&this.setTranslationKey.emit()}):this.dialog.open(LinkTranslationDialogComponent,{panelClass:"fullscreen"}).afterClosed().subscribe(translation=>{translation&&this.setTranslationKey.emit("__TRANSLATION__."+translation.key)})}};_TranslationIconButtonComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TranslationIconButtonComponent)},_TranslationIconButtonComponent.\u0275cmp=\u0275\u0275defineComponent({type:_TranslationIconButtonComponent,selectors:[["ix-translation-icon-button"]],hostVars:2,hostBindings:function(rf,ctx){rf&2&&\u0275\u0275classProp("active",ctx.active)},inputs:{key:"key"},outputs:{setTranslationKey:"setTranslationKey"},decls:2,vars:4,consts:[["type","button","role","checkbox","tabindex","-1","mat-icon-button","",3,"click","matTooltip"],[3,"svgIcon"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"button",0),\u0275\u0275listener("click",function($event){return $event.stopPropagation(),ctx.openTranslationDialog()}),\u0275\u0275element(1,"mat-icon",1),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275property("matTooltip",ctx.label),\u0275\u0275attribute("aria-label",ctx.label)("aria-checked",ctx.active),\u0275\u0275advance(),\u0275\u0275property("svgIcon",ctx.icon))},dependencies:[MatButtonModule,MatIconButton,MatIconModule,MatIcon,MatTooltipModule,MatTooltip],styles:["[_nghost-%COMP%]{position:absolute;inset:8px -12px 0 auto;display:flex;align-items:flex-start;pointer-events:auto}@media (min-width: 1280px){[_nghost-%COMP%]{top:5px}}.active[_nghost-%COMP%]{--mdc-icon-button-icon-color: var(--ix-blue)}.active[_nghost-%COMP%]{--mat-icon-button-state-layer-color: var(--ix-blue)}"],changeDetection:0});let TranslationIconButtonComponent2=_TranslationIconButtonComponent;return TranslationIconButtonComponent2})();var import_markdown_it=__toESM(require_markdown_it());var RenderMarkdownPipe=(()=>{let _RenderMarkdownPipe=class _RenderMarkdownPipe{constructor(){let md=new import_markdown_it.default({typographer:!0}),defaultRender=md.renderer.rules.link_open||function(tokens,idx,options,env,self2){return self2.renderToken(tokens,idx,options)};md.renderer.rules.link_open=function(tokens,idx,options,env,self2){return tokens[idx].attrPush(["target","_blank"]),defaultRender(tokens,idx,options,env,self2)},this.markdownIt=md}transform(value){return this.markdownIt.render(value||"")}};_RenderMarkdownPipe.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_RenderMarkdownPipe)},_RenderMarkdownPipe.\u0275pipe=\u0275\u0275definePipe({name:"renderMarkdown",type:_RenderMarkdownPipe,pure:!0,standalone:!1});let RenderMarkdownPipe3=_RenderMarkdownPipe;return RenderMarkdownPipe3})();var TrimTranslationNamespacePipe=(()=>{let _TrimTranslationNamespacePipe=class _TrimTranslationNamespacePipe{transform(string2){return trimNamespace(string2)}};_TrimTranslationNamespacePipe.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TrimTranslationNamespacePipe)},_TrimTranslationNamespacePipe.\u0275pipe=\u0275\u0275definePipe({name:"trimTranslationNamespace",type:_TrimTranslationNamespacePipe,pure:!0});let TrimTranslationNamespacePipe3=_TrimTranslationNamespacePipe;return TrimTranslationNamespacePipe3})();var _c013=a0=>({min:a0});function RawMetricInputComponent_Conditional_0_Conditional_3_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",1),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_5_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-error"),\u0275\u0275text(1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementEnd()),rf&2){let tmp_3_0,ctx_r0=\u0275\u0275nextContext(3);\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind2(2,1,"__MESSAGE__.MIN",\u0275\u0275pureFunction1(4,_c013,ctx_r0.decimalsControl==null||(tmp_3_0=ctx_r0.decimalsControl.getError("min"))==null?null:tmp_3_0.min))," ")}}function RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_6_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.INTEGER"),\u0275\u0275elementEnd())}function RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.INVALID_NUMBER"),\u0275\u0275elementEnd())}function RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_8_Conditional_4_Template(rf,ctx){if(rf&1){let _r2=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-translation-icon-button",11),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r2);let ctx_r0=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r0.setUnitTranslationKey($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(4);\u0275\u0275property("key",ctx_r0.unitTranslationKey)}}function RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_8_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-form-field",5)(1,"mat-label",6),\u0275\u0275text(2,"UNIT"),\u0275\u0275elementEnd(),\u0275\u0275element(3,"input",9),\u0275\u0275template(4,RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_8_Conditional_4_Template,1,1,"ix-translation-icon-button",10),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext(3);\u0275\u0275property("formGroupName",ctx_r0.field.inputDescription.key),\u0275\u0275advance(3),\u0275\u0275property("placeholder",ctx_r0.unitPlaceholder),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.translation?4:-1)}}function RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_9_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-label",6),\u0275\u0275text(2,"UNIT"),\u0275\u0275elementEnd(),\u0275\u0275element(3,"input",12),\u0275\u0275pipe(4,"translate"),\u0275\u0275pipe(5,"trimTranslationNamespace"),\u0275\u0275elementStart(6,"ix-translation-icon-button",11),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r3);let ctx_r0=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r0.setUnitTranslationKey($event))}),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(3);\u0275\u0275advance(3),\u0275\u0275property("value",ctx_r0.unitTranslationKey?\u0275\u0275pipeBind1(5,4,\u0275\u0275pipeBind1(4,2,ctx_r0.unitTranslationKey)):""),\u0275\u0275advance(3),\u0275\u0275property("key",ctx_r0.unitTranslationKey)}}function RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_14_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.INVALID_FACTOR"),\u0275\u0275elementEnd())}function RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_15_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.INVALID_NUMBER"),\u0275\u0275elementEnd())}function RawMetricInputComponent_Conditional_0_Conditional_6_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",4)(1,"mat-form-field",5)(2,"mat-label",6),\u0275\u0275text(3,"DECIMALS"),\u0275\u0275elementEnd(),\u0275\u0275element(4,"input",7),\u0275\u0275template(5,RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_5_Template,3,6,"mat-error")(6,RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_6_Template,2,0,"mat-error",6)(7,RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_7_Template,2,0,"mat-error",6),\u0275\u0275elementEnd(),\u0275\u0275template(8,RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_8_Template,5,3,"mat-form-field",5)(9,RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_9_Template,7,6,"mat-form-field"),\u0275\u0275elementStart(10,"mat-form-field",5)(11,"mat-label",6),\u0275\u0275text(12,"FACTOR"),\u0275\u0275elementEnd(),\u0275\u0275element(13,"input",8),\u0275\u0275template(14,RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_14_Template,2,0,"mat-error",6)(15,RawMetricInputComponent_Conditional_0_Conditional_6_Conditional_15_Template,2,0,"mat-error",6),\u0275\u0275elementEnd()()),rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275advance(),\u0275\u0275property("formGroupName",ctx_r0.field.inputDescription.key),\u0275\u0275advance(4),\u0275\u0275conditional(ctx_r0.decimalsControl!=null&&ctx_r0.decimalsControl.hasError("min")?5:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.decimalsControl!=null&&ctx_r0.decimalsControl.hasError("integer")?6:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.decimalsControl!=null&&ctx_r0.decimalsControl.hasError("number")?7:-1),\u0275\u0275advance(),\u0275\u0275conditional(!ctx_r0.translation||!ctx_r0.unitTranslationKey?8:9),\u0275\u0275advance(2),\u0275\u0275property("formGroupName",ctx_r0.field.inputDescription.key),\u0275\u0275advance(3),\u0275\u0275property("placeholder",ctx_r0.factorPlaceholder||""),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.factorControl!=null&&ctx_r0.factorControl.hasError("decimals")?14:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.factorControl!=null&&ctx_r0.factorControl.hasError("number")?15:-1)}}function RawMetricInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"h3"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275template(3,RawMetricInputComponent_Conditional_0_Conditional_3_Template,2,3,"p",1),\u0275\u0275elementStart(4,"div",2),\u0275\u0275element(5,"ix-selector-input",3),\u0275\u0275elementEnd(),\u0275\u0275template(6,RawMetricInputComponent_Conditional_0_Conditional_6_Template,16,9,"div",4),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("formGroup",ctx_r0.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.field.inputDescription.description?3:-1),\u0275\u0275advance(2),\u0275\u0275property("pageVersionId",ctx_r0.field.context.component.pageVersion==null?null:ctx_r0.field.context.component.pageVersion.publicId)("selectorControl",ctx_r0.selectorControl)("selectors",ctx_r0.selectors)("disabled",!ctx_r0.selectorDataIsLoaded)("required",ctx_r0.required),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.showDecimalsUnitFactor?6:-1)}}var RawMetricInputComponent=(()=>{let _RawMetricInputComponent=class _RawMetricInputComponent extends ComponentInputComponent{constructor(){super(...arguments),this.cdRef=inject(ChangeDetectorRef),this.destroy=inject(DestroyRef),this.facade=inject(RawMetricInputFacade),this.translate=inject(TranslateService),this.translation=environment.appName!=="Simulator",this.selectorDataIsLoaded=!1}get selectorControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"selector"])}get selector(){return this.selectorControl?.value}get showDecimalsUnitFactor(){if(this.selectorDataIsLoaded&&this.selectedMetric)switch(this.selectedMetric.variable?.type){case"int":case"float":return!0;case"bool":case"str":default:return!1}return!1}get decimalsControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"decimals"])}get unitControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"unit"])}get unitPlaceholder(){return this.selectedMetric?.variable?.unit||""}get factorControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"factor"])}get factorPlaceholder(){let factor=this.selectedMetric?.variable?.factor;return factor?Number(factor).toString():void 0}get required(){return this.field.inputDescription.required||!1}ngOnInit(){this.facade.selectors(of("Agent#selected"),this.field).pipe(takeUntilDestroyed(this.destroy)).subscribe(selectors10=>{this.selectors=selectors10,this.selectedMetric=selectors10.reduce((acc,sel)=>[...acc,...sel.items],[]).find(sel=>sel.pattern.test(this.field.value?.selector))||null}),this.facade.selectorDataIsLoaded(this.field).pipe(takeUntilDestroyed(this.destroy)).subscribe(loaded=>{this.selectorDataIsLoaded=loaded,this.cdRef.markForCheck()}),this.selectorControl?.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>{this.selectedMetric=this.selectors.reduce((acc,sel)=>[...acc,...sel.items],[]).find(sel=>sel.pattern.test(value))||null,this._setCorrectValuesForSelectorType(this.selectedMetric?.variable?.type)}),this.unitTranslationKey=this.unitControl?.value?.startsWith("__TRANSLATION__.")?this.unitControl.value:void 0}setUnitTranslationKey(translationKey){this.unitTranslationKey=translationKey,translationKey?this.unitControl?.setValue(this.unitTranslationKey):this.unitControl?.setValue(this.translate.instant(this.field.value.unit??""))}_setCorrectValuesForSelectorType(variableType){(variableType==="bool"||variableType==="str"||typeof variableType>"u")&&(this.decimalsControl?.setValue(null),this.unitControl?.setValue(null),this.factorControl?.setValue(null))}};_RawMetricInputComponent.\u0275fac=(()=>{let \u0275RawMetricInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275RawMetricInputComponent_BaseFactory||(\u0275RawMetricInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_RawMetricInputComponent)))(__ngFactoryType__||_RawMetricInputComponent)}})(),_RawMetricInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_RawMetricInputComponent,selectors:[["ix-raw-metric-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:1,vars:1,consts:[[3,"formGroup"],[1,"description",3,"innerHTML"],["fxLayout","column"],["fxFlex","","label","TAG",3,"pageVersionId","selectorControl","selectors","disabled","required"],["fxLayout","row","fxLayoutGap","8px"],["fxFlex","",3,"formGroupName"],["translate",""],["formControlName","decimals","min","0","type","number","matInput",""],["formControlName","factor","type","number","matInput","",3,"placeholder"],["formControlName","unit","matInput","",3,"placeholder"],[3,"key"],[3,"setTranslationKey","key"],["matInput","","disabled","",3,"value"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,RawMetricInputComponent_Conditional_0_Template,7,9,"div",0),rf&2&&\u0275\u0275conditional(ctx.field.hidden?-1:0)},dependencies:[NumberInputValidatorDirective,SelectorInputComponent,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultFlexDirective,DefaultValueAccessor,NumberValueAccessor,NgControlStatus,NgControlStatusGroup,MinValidator,FormGroupDirective,FormControlName,FormGroupName,TranslateDirective,MatFormField,MatLabel,MatError,MatInput,TranslationIconButtonComponent,RenderMarkdownPipe,TranslatePipe,TrimTranslationNamespacePipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{font-size:11.5px!important;font-weight:500!important;text-transform:uppercase;letter-spacing:.8px;color:color-mix(in srgb,transparent,currentcolor 67%)}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{display:block}"]});let RawMetricInputComponent3=_RawMetricInputComponent;return RawMetricInputComponent3})();var AggregatedMetricInputFacade=(()=>{let _AggregatedMetricInputFacade=class _AggregatedMetricInputFacade extends RawMetricInputFacade{};_AggregatedMetricInputFacade.\u0275fac=(()=>{let \u0275AggregatedMetricInputFacade_BaseFactory;return function(__ngFactoryType__){return(\u0275AggregatedMetricInputFacade_BaseFactory||(\u0275AggregatedMetricInputFacade_BaseFactory=\u0275\u0275getInheritedFactory(_AggregatedMetricInputFacade)))(__ngFactoryType__||_AggregatedMetricInputFacade)}})(),_AggregatedMetricInputFacade.\u0275prov=\u0275\u0275defineInjectable({token:_AggregatedMetricInputFacade,factory:_AggregatedMetricInputFacade.\u0275fac,providedIn:"root"});let AggregatedMetricInputFacade2=_AggregatedMetricInputFacade;return AggregatedMetricInputFacade2})();var _c014=a0=>({min:a0});function AggregatedMetricInputComponent_Conditional_0_Conditional_3_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",1),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function AggregatedMetricInputComponent_Conditional_0_For_11_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-option",7),\u0275\u0275text(1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementEnd()),rf&2){let func_r2=ctx.$implicit,ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("value",func_r2.value),\u0275\u0275advance(),\u0275\u0275textInterpolate2(" ",\u0275\u0275pipeBind1(2,3,func_r2.label)," (",ctx_r0.displayFormula(func_r2.value),") ")}}function AggregatedMetricInputComponent_Conditional_0_Conditional_12_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_5_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-error"),\u0275\u0275text(1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementEnd()),rf&2){let tmp_3_0,ctx_r0=\u0275\u0275nextContext(3);\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind2(2,1,"__MESSAGE__.MIN",\u0275\u0275pureFunction1(4,_c014,ctx_r0.decimalsControl==null||(tmp_3_0=ctx_r0.decimalsControl.getError("min"))==null?null:tmp_3_0.min))," ")}}function AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_6_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INTEGER"),\u0275\u0275elementEnd())}function AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_NUMBER"),\u0275\u0275elementEnd())}function AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_8_Conditional_4_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-translation-icon-button",14),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r3);let ctx_r0=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r0.setUnitTranslationKey($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(4);\u0275\u0275property("key",ctx_r0.unitTranslationKey)}}function AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_8_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-form-field",9)(1,"mat-label",5),\u0275\u0275text(2,"UNIT"),\u0275\u0275elementEnd(),\u0275\u0275element(3,"input",12),\u0275\u0275template(4,AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_8_Conditional_4_Template,1,1,"ix-translation-icon-button",13),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext(3);\u0275\u0275property("formGroupName",ctx_r0.field.inputDescription.key),\u0275\u0275advance(3),\u0275\u0275property("placeholder",ctx_r0.unitPlaceholder),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.translation?4:-1)}}function AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_9_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-label",5),\u0275\u0275text(2,"UNIT"),\u0275\u0275elementEnd(),\u0275\u0275element(3,"input",15),\u0275\u0275pipe(4,"translate"),\u0275\u0275pipe(5,"trimTranslationNamespace"),\u0275\u0275elementStart(6,"ix-translation-icon-button",14),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r4);let ctx_r0=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r0.setUnitTranslationKey($event))}),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(3);\u0275\u0275advance(3),\u0275\u0275property("value",ctx_r0.unitTranslationKey?\u0275\u0275pipeBind1(5,4,\u0275\u0275pipeBind1(4,2,ctx_r0.unitTranslationKey)):""),\u0275\u0275advance(3),\u0275\u0275property("key",ctx_r0.unitTranslationKey)}}function AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_14_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_FACTOR"),\u0275\u0275elementEnd())}function AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_15_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_NUMBER"),\u0275\u0275elementEnd())}function AggregatedMetricInputComponent_Conditional_0_Conditional_13_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",8)(1,"mat-form-field",9)(2,"mat-label",5),\u0275\u0275text(3,"DECIMALS"),\u0275\u0275elementEnd(),\u0275\u0275element(4,"input",10),\u0275\u0275template(5,AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_5_Template,3,6,"mat-error")(6,AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_6_Template,2,0,"mat-error",5)(7,AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_7_Template,2,0,"mat-error",5),\u0275\u0275elementEnd(),\u0275\u0275template(8,AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_8_Template,5,3,"mat-form-field",9)(9,AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_9_Template,7,6,"mat-form-field"),\u0275\u0275elementStart(10,"mat-form-field",9)(11,"mat-label",5),\u0275\u0275text(12,"FACTOR"),\u0275\u0275elementEnd(),\u0275\u0275element(13,"input",11),\u0275\u0275template(14,AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_14_Template,2,0,"mat-error",5)(15,AggregatedMetricInputComponent_Conditional_0_Conditional_13_Conditional_15_Template,2,0,"mat-error",5),\u0275\u0275elementEnd()()),rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275advance(),\u0275\u0275property("formGroupName",ctx_r0.field.inputDescription.key),\u0275\u0275advance(4),\u0275\u0275conditional(ctx_r0.decimalsControl!=null&&ctx_r0.decimalsControl.hasError("min")?5:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.decimalsControl!=null&&ctx_r0.decimalsControl.hasError("integer")?6:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.decimalsControl!=null&&ctx_r0.decimalsControl.hasError("number")?7:-1),\u0275\u0275advance(),\u0275\u0275conditional(!ctx_r0.translation||!ctx_r0.unitTranslationKey?8:9),\u0275\u0275advance(2),\u0275\u0275property("formGroupName",ctx_r0.field.inputDescription.key),\u0275\u0275advance(3),\u0275\u0275property("placeholder",ctx_r0.factorPlaceholder||""),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.factorControl!=null&&ctx_r0.factorControl.hasError("decimals")?14:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.factorControl!=null&&ctx_r0.factorControl.hasError("number")?15:-1)}}function AggregatedMetricInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"h3"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275template(3,AggregatedMetricInputComponent_Conditional_0_Conditional_3_Template,2,3,"p",1),\u0275\u0275elementStart(4,"div",2),\u0275\u0275element(5,"ix-selector-input",3),\u0275\u0275elementStart(6,"mat-form-field",4)(7,"mat-label",5),\u0275\u0275text(8,"AGGREGATOR"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"mat-select",6),\u0275\u0275repeaterCreate(10,AggregatedMetricInputComponent_Conditional_0_For_11_Template,3,5,"mat-option",7,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd(),\u0275\u0275template(12,AggregatedMetricInputComponent_Conditional_0_Conditional_12_Template,2,0,"mat-error",5),\u0275\u0275elementEnd()(),\u0275\u0275template(13,AggregatedMetricInputComponent_Conditional_0_Conditional_13_Template,16,9,"div",8),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("formGroup",ctx_r0.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.field.inputDescription.description?3:-1),\u0275\u0275advance(2),\u0275\u0275property("pageVersionId",ctx_r0.field.context.component.pageVersion==null?null:ctx_r0.field.context.component.pageVersion.publicId)("selectorControl",ctx_r0.selectorControl)("selectors",ctx_r0.selectors)("disabled",!ctx_r0.selectorDataIsLoaded)("required",ctx_r0.required),\u0275\u0275advance(4),\u0275\u0275property("formControl",ctx_r0.formula)("compareWith",ctx_r0.formulaCompare)("required",!0),\u0275\u0275advance(),\u0275\u0275repeater(ctx_r0.formulae),\u0275\u0275advance(2),\u0275\u0275conditional(ctx_r0.aggregatorControl!=null&&ctx_r0.aggregatorControl.hasError("required")?12:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.showDecimalsUnitFactor?13:-1)}}var AggregatedMetricInputComponent=(()=>{let _AggregatedMetricInputComponent=class _AggregatedMetricInputComponent extends RawMetricInputComponent{constructor(){super(...arguments),this.facade=inject(AggregatedMetricInputFacade),this.formula=new FormControl,this.formulae=[{value:{aggregator:"first"},label:"FORMULA_FIRST"},{value:{aggregator:"last"},label:"FORMULA_LAST"},{value:{aggregator:"mode"},label:"FORMULA_MODE"},{value:{aggregator:"max"},label:"FORMULA_MAX"},{value:{aggregator:"min"},label:"FORMULA_MIN"},{value:{aggregator:"mean"},label:"FORMULA_MEAN"},{value:{aggregator:"median"},label:"FORMULA_MEDIAN"},{value:{aggregator:"sum"},label:"FORMULA_SUM"},{value:{aggregator:"count"},label:"FORMULA_COUNT"},{value:{aggregator:"spread"},label:"FORMULA_RANGE"},{value:{aggregator:"last",transform:"difference"},label:"FORMULA_DIFFERENCE_LAST"}]}get aggregatorControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"aggregator"])}get aggregator(){return this.aggregatorControl?.value}get transformControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"transform"])}get transform(){return this.transformControl?.value}ngOnInit(){super.ngOnInit(),this.formula.setValue({aggregator:this.aggregator,transform:this.transform}),this.formula.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>{this.aggregatorControl?.setValue(value.aggregator),this.transformControl?.setValue(value.transform)}),this.selectorControl?.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>{let selector3=this.selectors.reduce((acc,sel)=>[...acc,...sel.items],[]).find(sel=>sel.value===value)||null;this.handleTypeChange(selector3?.variable?.type)})}formulaCompare(o1,o2){return o1.transform||o2.transform?o1.aggregator===o2.aggregator&&o1.transform===o2.transform:o1.aggregator===o2.aggregator}displayFormula(value){return value.transform?`${value.transform} - ${value.aggregator}`:value.aggregator}handleTypeChange(type){type==="str"?this.formulae=[{value:{aggregator:"first"},label:"FORMULA_FIRST"},{value:{aggregator:"last"},label:"FORMULA_LAST"},{value:{aggregator:"mode"},label:"FORMULA_MODE"},{value:{aggregator:"count"},label:"FORMULA_COUNT"}]:type==="bool"?this.formulae=[{value:{aggregator:"first"},label:"FORMULA_FIRST"},{value:{aggregator:"last"},label:"FORMULA_LAST"},{value:{aggregator:"mode"},label:"FORMULA_MODE"},{value:{aggregator:"max"},label:"FORMULA_MAX"},{value:{aggregator:"min"},label:"FORMULA_MIN"},{value:{aggregator:"count"},label:"FORMULA_COUNT"}]:this.formulae=[{value:{aggregator:"first"},label:"FORMULA_FIRST"},{value:{aggregator:"last"},label:"FORMULA_LAST"},{value:{aggregator:"mode"},label:"FORMULA_MODE"},{value:{aggregator:"max"},label:"FORMULA_MAX"},{value:{aggregator:"min"},label:"FORMULA_MIN"},{value:{aggregator:"mean"},label:"FORMULA_MEAN"},{value:{aggregator:"median"},label:"FORMULA_MEDIAN"},{value:{aggregator:"sum"},label:"FORMULA_SUM"},{value:{aggregator:"count"},label:"FORMULA_COUNT"},{value:{aggregator:"spread"},label:"FORMULA_RANGE"},{value:{aggregator:"last",transform:"difference"},label:"FORMULA_DIFFERENCE_LAST"}],this.formulae.some(a=>this.formulaCompare(this,a.value))||(this.aggregatorControl?.setValue(""),this.aggregatorControl?.updateValueAndValidity(),this.transformControl?.setValue(null),this.transformControl?.updateValueAndValidity())}};_AggregatedMetricInputComponent.\u0275fac=(()=>{let \u0275AggregatedMetricInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275AggregatedMetricInputComponent_BaseFactory||(\u0275AggregatedMetricInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_AggregatedMetricInputComponent)))(__ngFactoryType__||_AggregatedMetricInputComponent)}})(),_AggregatedMetricInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_AggregatedMetricInputComponent,selectors:[["ix-aggregated-metric-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:1,vars:1,consts:[[3,"formGroup"],[1,"description",3,"innerHTML"],["fxLayout","column"],["label","TAG",3,"pageVersionId","selectorControl","selectors","disabled","required"],["fxFlex",""],["translate",""],[3,"formControl","compareWith","required"],[3,"value"],["fxLayout","row","fxLayoutGap","8px"],["fxFlex","",3,"formGroupName"],["formControlName","decimals","min","0","type","number","matInput",""],["formControlName","factor","type","number","matInput","",3,"placeholder"],["formControlName","unit","matInput","",3,"placeholder"],[3,"key"],[3,"setTranslationKey","key"],["matInput","","disabled","",3,"value"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,AggregatedMetricInputComponent_Conditional_0_Template,14,13,"div",0),rf&2&&\u0275\u0275conditional(ctx.field.hidden?-1:0)},dependencies:[NumberInputValidatorDirective,SelectorInputComponent,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultFlexDirective,DefaultValueAccessor,NumberValueAccessor,NgControlStatus,NgControlStatusGroup,RequiredValidator,MinValidator,FormControlDirective,FormGroupDirective,FormControlName,FormGroupName,TranslateDirective,MatOption,MatFormField,MatLabel,MatError,MatInput,MatSelect,TranslationIconButtonComponent,RenderMarkdownPipe,TranslatePipe,TrimTranslationNamespacePipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{font-size:11.5px!important;font-weight:500!important;text-transform:uppercase;letter-spacing:.8px;color:color-mix(in srgb,transparent,currentcolor 67%)}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{display:block}"]});let AggregatedMetricInputComponent3=_AggregatedMetricInputComponent;return AggregatedMetricInputComponent3})();var nonZero=control=>control.value!==null&&Number(control.value)===0?{nonZero:{value:control.value}}:null,integer=control=>control.value!==null&&control.value!==Math.floor(control.value)?{integer:{value:control.value}}:null;function decimal(precision,scale){if(precision<1||precision>15)throw"illegal decimal precision";if(scale<0||scale>14||scale>precision)throw"illegal decimal scale";return control=>{if(!control.value)return null;let value=numberToFloatingPointString(control.value),result=/-?(?<integer>[0-9]*)(\.(?<fraction>[0-9]*))?/.exec(value);if(result?.groups){let integer2=result.groups.integer,fraction=result.groups.fraction,valueScale=fraction?fraction.length:0,valuePrecision=integer2.length;if(precision-scale<valuePrecision||scale<valueScale)return{decimals:{scale,precision,value}}}return null}}var RawMetricInput=class extends ComponentPropertiesInput{constructor(input2,value,context3,converter,level,injector){super(input2,value,context3,converter,level),this.hidden=!injector.get(PlatformFeaturesService).instantCheck([{canInput:"historical-data"}]),this.translate=injector.get(TranslateService),this.setValue(value)}_getFormControls(){let required=this.inputDescription.required?Validators.required:null;return{selector:new FormControl(this.selector,required),decimals:new FormControl(this.decimals,[Validators.min(0),integer]),unit:new FormControl(this.unit),factor:new FormControl(this.factor,[nonZero,decimal(14,7)])}}toFormControl(){return new FormGroup(this._getFormControls())}setValue(value){super.setValue(value),this.selector=value?.selector,this.decimals=value?.decimals,this.unit=value?.unit,this.factor=value?.factor}transformValue(){return this.value?.unit?.startsWith("__TRANSLATION__.")?{[this.inputDescription.key]:__spreadProps(__spreadValues({},this.value),{unit:trimNamespace(this.translate.instant(this.value.unit))})}:super.transformValue()}};var AggregatedMetricInput=class extends RawMetricInput{constructor(input2,value,context3,converter,level,injector){super(input2,value,context3,converter,level,injector),this.setValue(value)}get formula(){return this.transform?`${this.transform} - ${this.aggregator}`:this.aggregator}_getFormControls(){let required=this.inputDescription.required?Validators.required:null;return __spreadProps(__spreadValues({},super._getFormControls()),{aggregator:new FormControl(this.aggregator,required),transform:new FormControl(this.transform)})}transformValue(){return{[this.inputDescription.key]:__spreadProps(__spreadValues({},super.transformValue()[this.inputDescription.key]),{formula:this.formula}),[`$${this.inputDescription.key}`]:{formula:this.formula}}}setValue(value){super.setValue(value),this.aggregator=value?.aggregator,this.transform=value?.transform}};function CheckboxInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}var CheckboxInputComponent=(()=>{let _CheckboxInputComponent=class _CheckboxInputComponent extends ComponentInputComponent{ngOnInit(){let value=this.componentFormGroup.get(this.field.inputName)?.value,newControl=new FormControl(value,{updateOn:"change"});this.componentFormGroup.setControl(this.field.inputName,newControl,{emitEvent:!1})}};_CheckboxInputComponent.\u0275fac=(()=>{let \u0275CheckboxInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275CheckboxInputComponent_BaseFactory||(\u0275CheckboxInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_CheckboxInputComponent)))(__ngFactoryType__||_CheckboxInputComponent)}})(),_CheckboxInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_CheckboxInputComponent,selectors:[["ix-checkbox-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:5,vars:4,consts:[[1,"description",3,"innerHTML"],[3,"formGroup"],[3,"formControlName"]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,CheckboxInputComponent_Conditional_0_Template,2,3,"p",0),\u0275\u0275elementStart(1,"div",1)(2,"mat-checkbox",2)(3,"mat-label"),\u0275\u0275text(4),\u0275\u0275elementEnd()()()),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275property("formGroup",ctx.componentFormGroup),\u0275\u0275advance(),\u0275\u0275property("formControlName",ctx.field.inputName),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx.field.inputDescription.label))},dependencies:[NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,MatCheckbox,MatLabel,RenderMarkdownPipe],styles:["[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] div[_ngcontent-%COMP%]{margin-bottom:16px}[_nghost-%COMP%]:last-of-type div[_ngcontent-%COMP%]{margin-bottom:20px}"]});let CheckboxInputComponent3=_CheckboxInputComponent;return CheckboxInputComponent3})();var import_tinycolor2=__toESM(require_tinycolor());var ColorPickerPanelRef=class{constructor(overlayRef){this.overlayRef=overlayRef,this._afterClosed=new Subject}afterClosed(){return this._afterClosed.asObservable()}close(data){this.overlayRef.dispose(),data&&(this._afterClosed.next(data),this._afterClosed.complete())}};var _c015=["dialogPopup"],_c15=["hueSlider"],_c24=["alphaSlider"];function ColorPickerComponent_div_2_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"div"),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275classMapInterpolate1("arrow arrow-",ctx_r1.cpUsePosition,""),\u0275\u0275styleProp("left",ctx_r1.cpArrowPosition)("top",ctx_r1.arrowTop,"px")}}function ColorPickerComponent_div_3_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",28),\u0275\u0275listener("newValue",function($event){\u0275\u0275restoreView(_r3);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onColorChange($event))})("dragStart",function(){\u0275\u0275restoreView(_r3);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onDragStart("saturation-lightness"))})("dragEnd",function(){\u0275\u0275restoreView(_r3);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onDragEnd("saturation-lightness"))}),\u0275\u0275element(1,"div",16),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275styleProp("background-color",ctx_r1.hueSliderColor),\u0275\u0275property("rgX",1)("rgY",1),\u0275\u0275advance(),\u0275\u0275styleProp("top",ctx_r1.slider==null?null:ctx_r1.slider.v,"px")("left",ctx_r1.slider==null?null:ctx_r1.slider.s,"px")}}function ColorPickerComponent__svg_svg_8_Template(rf,ctx){rf&1&&(\u0275\u0275namespaceSVG(),\u0275\u0275elementStart(0,"svg",29),\u0275\u0275element(1,"path",30)(2,"path",31),\u0275\u0275elementEnd())}function ColorPickerComponent_button_9_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",32),\u0275\u0275listener("click",function($event){\u0275\u0275restoreView(_r4);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAddPresetColor($event,ctx_r1.selectedColor))}),\u0275\u0275text(1),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275classMap(ctx_r1.cpAddColorButtonClass),\u0275\u0275property("disabled",ctx_r1.cpPresetColors&&ctx_r1.cpPresetColors.length>=ctx_r1.cpMaxPresetColorsLength),\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",ctx_r1.cpAddColorButtonText," ")}}function ColorPickerComponent_div_11_Template(rf,ctx){rf&1&&\u0275\u0275element(0,"div",33)}function ColorPickerComponent_div_21_input_6_Template(rf,ctx){if(rf&1){let _r6=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"input",39),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r6);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r6);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAlphaInput($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("rg",1)("value",ctx_r1.cmykText==null?null:ctx_r1.cmykText.a)}}function ColorPickerComponent_div_21_div_16_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div"),\u0275\u0275text(1,"A"),\u0275\u0275elementEnd())}function ColorPickerComponent_div_21_Template(rf,ctx){if(rf&1){let _r5=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",34)(1,"div",35)(2,"input",36),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onCyanInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"input",36),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onMagentaInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"input",36),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onYellowInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(5,"input",36),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onBlackInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275template(6,ColorPickerComponent_div_21_input_6_Template,1,2,"input",37),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"div",35)(8,"div"),\u0275\u0275text(9,"C"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(10,"div"),\u0275\u0275text(11,"M"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(12,"div"),\u0275\u0275text(13,"Y"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(14,"div"),\u0275\u0275text(15,"K"),\u0275\u0275elementEnd(),\u0275\u0275template(16,ColorPickerComponent_div_21_div_16_Template,2,0,"div",38),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275styleProp("display",ctx_r1.format!==3?"none":"block"),\u0275\u0275advance(2),\u0275\u0275property("rg",100)("value",ctx_r1.cmykText==null?null:ctx_r1.cmykText.c),\u0275\u0275advance(),\u0275\u0275property("rg",100)("value",ctx_r1.cmykText==null?null:ctx_r1.cmykText.m),\u0275\u0275advance(),\u0275\u0275property("rg",100)("value",ctx_r1.cmykText==null?null:ctx_r1.cmykText.y),\u0275\u0275advance(),\u0275\u0275property("rg",100)("value",ctx_r1.cmykText==null?null:ctx_r1.cmykText.k),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r1.cpAlphaChannel!=="disabled"),\u0275\u0275advance(10),\u0275\u0275property("ngIf",ctx_r1.cpAlphaChannel!=="disabled")}}function ColorPickerComponent_div_22_input_5_Template(rf,ctx){if(rf&1){let _r8=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"input",39),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r8);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r8);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAlphaInput($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("rg",1)("value",ctx_r1.hslaText==null?null:ctx_r1.hslaText.a)}}function ColorPickerComponent_div_22_div_13_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div"),\u0275\u0275text(1,"A"),\u0275\u0275elementEnd())}function ColorPickerComponent_div_22_Template(rf,ctx){if(rf&1){let _r7=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",40)(1,"div",35)(2,"input",41),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r7);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r7);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onHueInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"input",36),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r7);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r7);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onSaturationInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"input",36),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r7);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r7);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onLightnessInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275template(5,ColorPickerComponent_div_22_input_5_Template,1,2,"input",37),\u0275\u0275elementEnd(),\u0275\u0275elementStart(6,"div",35)(7,"div"),\u0275\u0275text(8,"H"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"div"),\u0275\u0275text(10,"S"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(11,"div"),\u0275\u0275text(12,"L"),\u0275\u0275elementEnd(),\u0275\u0275template(13,ColorPickerComponent_div_22_div_13_Template,2,0,"div",38),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275styleProp("display",ctx_r1.format!==2?"none":"block"),\u0275\u0275advance(2),\u0275\u0275property("rg",360)("value",ctx_r1.hslaText==null?null:ctx_r1.hslaText.h),\u0275\u0275advance(),\u0275\u0275property("rg",100)("value",ctx_r1.hslaText==null?null:ctx_r1.hslaText.s),\u0275\u0275advance(),\u0275\u0275property("rg",100)("value",ctx_r1.hslaText==null?null:ctx_r1.hslaText.l),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r1.cpAlphaChannel!=="disabled"),\u0275\u0275advance(8),\u0275\u0275property("ngIf",ctx_r1.cpAlphaChannel!=="disabled")}}function ColorPickerComponent_div_23_input_5_Template(rf,ctx){if(rf&1){let _r10=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"input",39),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r10);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r10);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAlphaInput($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("rg",1)("value",ctx_r1.rgbaText==null?null:ctx_r1.rgbaText.a)}}function ColorPickerComponent_div_23_div_13_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div"),\u0275\u0275text(1,"A"),\u0275\u0275elementEnd())}function ColorPickerComponent_div_23_Template(rf,ctx){if(rf&1){let _r9=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",42)(1,"div",35)(2,"input",43),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r9);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r9);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onRedInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"input",43),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r9);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r9);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onGreenInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"input",43),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r9);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r9);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onBlueInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275template(5,ColorPickerComponent_div_23_input_5_Template,1,2,"input",37),\u0275\u0275elementEnd(),\u0275\u0275elementStart(6,"div",35)(7,"div"),\u0275\u0275text(8,"R"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"div"),\u0275\u0275text(10,"G"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(11,"div"),\u0275\u0275text(12,"B"),\u0275\u0275elementEnd(),\u0275\u0275template(13,ColorPickerComponent_div_23_div_13_Template,2,0,"div",38),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275styleProp("display",ctx_r1.format!==1?"none":"block"),\u0275\u0275advance(2),\u0275\u0275property("rg",255)("value",ctx_r1.rgbaText==null?null:ctx_r1.rgbaText.r),\u0275\u0275advance(),\u0275\u0275property("rg",255)("value",ctx_r1.rgbaText==null?null:ctx_r1.rgbaText.g),\u0275\u0275advance(),\u0275\u0275property("rg",255)("value",ctx_r1.rgbaText==null?null:ctx_r1.rgbaText.b),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r1.cpAlphaChannel!=="disabled"),\u0275\u0275advance(8),\u0275\u0275property("ngIf",ctx_r1.cpAlphaChannel!=="disabled")}}function ColorPickerComponent_div_24_input_3_Template(rf,ctx){if(rf&1){let _r12=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"input",39),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r12);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r12);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAlphaInput($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("rg",1)("value",ctx_r1.hexAlpha)}}function ColorPickerComponent_div_24_div_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div"),\u0275\u0275text(1,"A"),\u0275\u0275elementEnd())}function ColorPickerComponent_div_24_Template(rf,ctx){if(rf&1){let _r11=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",44)(1,"div",35)(2,"input",45),\u0275\u0275listener("blur",function(){\u0275\u0275restoreView(_r11);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onHexInput(null))})("keyup.enter",function($event){\u0275\u0275restoreView(_r11);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r11);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onHexInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275template(3,ColorPickerComponent_div_24_input_3_Template,1,2,"input",37),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"div",35)(5,"div"),\u0275\u0275text(6,"Hex"),\u0275\u0275elementEnd(),\u0275\u0275template(7,ColorPickerComponent_div_24_div_7_Template,2,0,"div",38),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275styleProp("display",ctx_r1.format!==0?"none":"block"),\u0275\u0275classProp("hex-alpha",ctx_r1.cpAlphaChannel==="forced"),\u0275\u0275advance(2),\u0275\u0275property("value",ctx_r1.hexText),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r1.cpAlphaChannel==="forced"),\u0275\u0275advance(4),\u0275\u0275property("ngIf",ctx_r1.cpAlphaChannel==="forced")}}function ColorPickerComponent_div_25_input_3_Template(rf,ctx){if(rf&1){let _r14=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"input",39),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r14);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r14);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAlphaInput($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("rg",1)("value",ctx_r1.hslaText==null?null:ctx_r1.hslaText.a)}}function ColorPickerComponent_div_25_Template(rf,ctx){if(rf&1){let _r13=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",46)(1,"div",35)(2,"input",36),\u0275\u0275listener("keyup.enter",function($event){\u0275\u0275restoreView(_r13);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))})("newValue",function($event){\u0275\u0275restoreView(_r13);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onValueInput($event))}),\u0275\u0275elementEnd(),\u0275\u0275template(3,ColorPickerComponent_div_25_input_3_Template,1,2,"input",37),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"div",35)(5,"div"),\u0275\u0275text(6,"V"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"div"),\u0275\u0275text(8,"A"),\u0275\u0275elementEnd()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(2),\u0275\u0275property("rg",100)("value",ctx_r1.hslaText==null?null:ctx_r1.hslaText.l),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r1.cpAlphaChannel!=="disabled")}}function ColorPickerComponent_div_26_Template(rf,ctx){if(rf&1){let _r15=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",47)(1,"span",48),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r15);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onFormatToggle(-1))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(2,"span",48),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r15);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onFormatToggle(1))}),\u0275\u0275elementEnd()()}}function ColorPickerComponent_div_27_div_4_div_1_span_1_Template(rf,ctx){if(rf&1){let _r18=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"span",55),\u0275\u0275listener("click",function($event){\u0275\u0275restoreView(_r18);let color_r17=\u0275\u0275nextContext().$implicit,ctx_r1=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r1.onRemovePresetColor($event,color_r17))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(4);\u0275\u0275classMap(ctx_r1.cpRemoveColorButtonClass)}}function ColorPickerComponent_div_27_div_4_div_1_Template(rf,ctx){if(rf&1){let _r16=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",53),\u0275\u0275listener("click",function(){let color_r17=\u0275\u0275restoreView(_r16).$implicit,ctx_r1=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r1.setColorFromString(color_r17))}),\u0275\u0275template(1,ColorPickerComponent_div_27_div_4_div_1_span_1_Template,1,3,"span",54),\u0275\u0275elementEnd()}if(rf&2){let color_r17=ctx.$implicit,ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275styleProp("background-color",color_r17),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r1.cpAddColorButton)}}function ColorPickerComponent_div_27_div_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div"),\u0275\u0275template(1,ColorPickerComponent_div_27_div_4_div_1_Template,2,3,"div",52),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275classMap(ctx_r1.cpPresetColorsClass),\u0275\u0275advance(),\u0275\u0275property("ngForOf",ctx_r1.cpPresetColors)}}function ColorPickerComponent_div_27_div_5_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div"),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275classMap(ctx_r1.cpPresetEmptyMessageClass),\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r1.cpPresetEmptyMessage)}}function ColorPickerComponent_div_27_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",49),\u0275\u0275element(1,"hr"),\u0275\u0275elementStart(2,"div",50),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275template(4,ColorPickerComponent_div_27_div_4_Template,2,4,"div",51)(5,ColorPickerComponent_div_27_div_5_Template,2,4,"div",51),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(3),\u0275\u0275textInterpolate(ctx_r1.cpPresetLabel),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r1.cpPresetColors==null?null:ctx_r1.cpPresetColors.length),\u0275\u0275advance(),\u0275\u0275property("ngIf",!(ctx_r1.cpPresetColors!=null&&ctx_r1.cpPresetColors.length)&&ctx_r1.cpAddColorButton)}}function ColorPickerComponent_div_28_button_1_Template(rf,ctx){if(rf&1){let _r19=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",58),\u0275\u0275listener("click",function($event){\u0275\u0275restoreView(_r19);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onCancelColor($event))}),\u0275\u0275text(1),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275classMap(ctx_r1.cpCancelButtonClass),\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r1.cpCancelButtonText)}}function ColorPickerComponent_div_28_button_2_Template(rf,ctx){if(rf&1){let _r20=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",58),\u0275\u0275listener("click",function($event){\u0275\u0275restoreView(_r20);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.onAcceptColor($event))}),\u0275\u0275text(1),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275classMap(ctx_r1.cpOKButtonClass),\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r1.cpOKButtonText)}}function ColorPickerComponent_div_28_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",56),\u0275\u0275template(1,ColorPickerComponent_div_28_button_1_Template,2,4,"button",57)(2,ColorPickerComponent_div_28_button_2_Template,2,4,"button",57),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r1.cpCancelButton),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx_r1.cpOKButton)}}function ColorPickerComponent_div_29_ng_container_1_Template(rf,ctx){rf&1&&\u0275\u0275elementContainer(0)}function ColorPickerComponent_div_29_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",59),\u0275\u0275template(1,ColorPickerComponent_div_29_ng_container_1_Template,1,0,"ng-container",60),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("ngTemplateOutlet",ctx_r1.cpExtraTemplate)}}var ColorFormats=function(ColorFormats2){return ColorFormats2[ColorFormats2.HEX=0]="HEX",ColorFormats2[ColorFormats2.RGBA=1]="RGBA",ColorFormats2[ColorFormats2.HSLA=2]="HSLA",ColorFormats2[ColorFormats2.CMYK=3]="CMYK",ColorFormats2}(ColorFormats||{}),Rgba=class{r;g;b;a;constructor(r,g,b,a){this.r=r,this.g=g,this.b=b,this.a=a}},Hsva=class{h;s;v;a;constructor(h,s2,v,a){this.h=h,this.s=s2,this.v=v,this.a=a}},Hsla=class{h;s;l;a;constructor(h,s2,l2,a){this.h=h,this.s=s2,this.l=l2,this.a=a}},Cmyk=class{c;m;y;k;a;constructor(c,m,y,k,a=1){this.c=c,this.m=m,this.y=y,this.k=k,this.a=a}};function calculateAutoPositioning(elBounds,triggerElBounds){let usePositionX="right",usePositionY="bottom",{height,width}=elBounds,{top:top2,left:left2}=triggerElBounds,bottom2=top2+triggerElBounds.height,right2=left2+triggerElBounds.width,collisionTop=top2-height<0,collisionBottom=bottom2+height>(window.innerHeight||document.documentElement.clientHeight),collisionLeft=left2-width<0,collisionRight=right2+width>(window.innerWidth||document.documentElement.clientWidth),collisionAll=collisionTop&&collisionBottom&&collisionLeft&&collisionRight;return collisionBottom&&(usePositionY="top"),collisionTop&&(usePositionY="bottom"),collisionLeft&&(usePositionX="right"),collisionRight&&(usePositionX="left"),collisionAll?["left","right","top","bottom"].reduce((prev,next)=>elBounds[prev]>elBounds[next]?prev:next):collisionLeft&&collisionRight?collisionTop?"bottom":collisionBottom||top2>bottom2?"top":"bottom":collisionTop&&collisionBottom?collisionLeft?"right":collisionRight||left2>right2?"left":"right":`${usePositionY}-${usePositionX}`}function detectIE(){let ua="";typeof navigator<"u"&&(ua=navigator.userAgent.toLowerCase());let msie=ua.indexOf("msie ");return msie>0?parseInt(ua.substring(msie+5,ua.indexOf(".",msie)),10):!1}var TextDirective=(()=>{class TextDirective2{rg;text;newValue=new EventEmitter;inputChange(event2){let value=event2.target.value;if(this.rg===void 0)this.newValue.emit(value);else{let numeric=parseFloat(value);this.newValue.emit({v:numeric,rg:this.rg})}}static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||TextDirective2)};static \u0275dir=\u0275\u0275defineDirective({type:TextDirective2,selectors:[["","text",""]],hostBindings:function(rf,ctx){rf&1&&\u0275\u0275listener("input",function($event){return ctx.inputChange($event)})},inputs:{rg:"rg",text:"text"},outputs:{newValue:"newValue"}})}return TextDirective2})(),SliderDirective=(()=>{class SliderDirective2{elRef;listenerMove;listenerStop;rgX;rgY;slider;dragEnd=new EventEmitter;dragStart=new EventEmitter;newValue=new EventEmitter;mouseDown(event2){this.start(event2)}touchStart(event2){this.start(event2)}constructor(elRef){this.elRef=elRef,this.listenerMove=event2=>this.move(event2),this.listenerStop=()=>this.stop()}move(event2){event2.preventDefault(),this.setCursor(event2)}start(event2){this.setCursor(event2),event2.stopPropagation(),document.addEventListener("mouseup",this.listenerStop),document.addEventListener("touchend",this.listenerStop),document.addEventListener("mousemove",this.listenerMove),document.addEventListener("touchmove",this.listenerMove),this.dragStart.emit()}stop(){document.removeEventListener("mouseup",this.listenerStop),document.removeEventListener("touchend",this.listenerStop),document.removeEventListener("mousemove",this.listenerMove),document.removeEventListener("touchmove",this.listenerMove),this.dragEnd.emit()}getX(event2){let position=this.elRef.nativeElement.getBoundingClientRect();return(event2.pageX!==void 0?event2.pageX:event2.touches[0].pageX)-position.left-window.pageXOffset}getY(event2){let position=this.elRef.nativeElement.getBoundingClientRect();return(event2.pageY!==void 0?event2.pageY:event2.touches[0].pageY)-position.top-window.pageYOffset}setCursor(event2){let width=this.elRef.nativeElement.offsetWidth,height=this.elRef.nativeElement.offsetHeight,x=Math.max(0,Math.min(this.getX(event2),width)),y=Math.max(0,Math.min(this.getY(event2),height));this.rgX!==void 0&&this.rgY!==void 0?this.newValue.emit({s:x/width,v:1-y/height,rgX:this.rgX,rgY:this.rgY}):this.rgX===void 0&&this.rgY!==void 0?this.newValue.emit({v:y/height,rgY:this.rgY}):this.rgX!==void 0&&this.rgY===void 0&&this.newValue.emit({v:x/width,rgX:this.rgX})}static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||SliderDirective2)(\u0275\u0275directiveInject(ElementRef))};static \u0275dir=\u0275\u0275defineDirective({type:SliderDirective2,selectors:[["","slider",""]],hostBindings:function(rf,ctx){rf&1&&\u0275\u0275listener("mousedown",function($event){return ctx.mouseDown($event)})("touchstart",function($event){return ctx.touchStart($event)})},inputs:{rgX:"rgX",rgY:"rgY",slider:"slider"},outputs:{dragEnd:"dragEnd",dragStart:"dragStart",newValue:"newValue"}})}return SliderDirective2})(),SliderPosition=class{h;s;v;a;constructor(h,s2,v,a){this.h=h,this.s=s2,this.v=v,this.a=a}},SliderDimension=class{h;s;v;a;constructor(h,s2,v,a){this.h=h,this.s=s2,this.v=v,this.a=a}},ColorPickerService=(()=>{class ColorPickerService2{active=null;setActive(active){this.active&&this.active!==active&&this.active.cpDialogDisplay!=="inline"&&this.active.closeDialog(),this.active=active}hsva2hsla(hsva){let h=hsva.h,s2=hsva.s,v=hsva.v,a=hsva.a;if(v===0)return new Hsla(h,0,0,a);if(s2===0&&v===1)return new Hsla(h,1,1,a);{let l2=v*(2-s2)/2;return new Hsla(h,v*s2/(1-Math.abs(2*l2-1)),l2,a)}}hsla2hsva(hsla){let h=Math.min(hsla.h,1),s2=Math.min(hsla.s,1),l2=Math.min(hsla.l,1),a=Math.min(hsla.a,1);if(l2===0)return new Hsva(h,0,0,a);{let v=l2+s2*(1-Math.abs(2*l2-1))/2;return new Hsva(h,2*(v-l2)/v,v,a)}}hsvaToRgba(hsva){let r,g,b,h=hsva.h,s2=hsva.s,v=hsva.v,a=hsva.a,i=Math.floor(h*6),f=h*6-i,p=v*(1-s2),q=v*(1-f*s2),t=v*(1-(1-f)*s2);switch(i%6){case 0:r=v,g=t,b=p;break;case 1:r=q,g=v,b=p;break;case 2:r=p,g=v,b=t;break;case 3:r=p,g=q,b=v;break;case 4:r=t,g=p,b=v;break;case 5:r=v,g=p,b=q;break;default:r=0,g=0,b=0}return new Rgba(r,g,b,a)}cmykToRgb(cmyk){let r=(1-cmyk.c)*(1-cmyk.k),g=(1-cmyk.m)*(1-cmyk.k),b=(1-cmyk.y)*(1-cmyk.k);return new Rgba(r,g,b,cmyk.a)}rgbaToCmyk(rgba){let k=1-Math.max(rgba.r,rgba.g,rgba.b);if(k===1)return new Cmyk(0,0,0,1,rgba.a);{let c=(1-rgba.r-k)/(1-k),m=(1-rgba.g-k)/(1-k),y=(1-rgba.b-k)/(1-k);return new Cmyk(c,m,y,k,rgba.a)}}rgbaToHsva(rgba){let h,s2,r=Math.min(rgba.r,1),g=Math.min(rgba.g,1),b=Math.min(rgba.b,1),a=Math.min(rgba.a,1),max2=Math.max(r,g,b),min2=Math.min(r,g,b),v=max2,d=max2-min2;if(s2=max2===0?0:d/max2,max2===min2)h=0;else{switch(max2){case r:h=(g-b)/d+(g<b?6:0);break;case g:h=(b-r)/d+2;break;case b:h=(r-g)/d+4;break;default:h=0}h/=6}return new Hsva(h,s2,v,a)}rgbaToHex(rgba,allowHex8){let hex="#"+(16777216|rgba.r<<16|rgba.g<<8|rgba.b).toString(16).substr(1);return allowHex8&&(hex+=(256|Math.round(rgba.a*255)).toString(16).substr(1)),hex}normalizeCMYK(cmyk){return new Cmyk(cmyk.c/100,cmyk.m/100,cmyk.y/100,cmyk.k/100,cmyk.a)}denormalizeCMYK(cmyk){return new Cmyk(Math.floor(cmyk.c*100),Math.floor(cmyk.m*100),Math.floor(cmyk.y*100),Math.floor(cmyk.k*100),cmyk.a)}denormalizeRGBA(rgba){return new Rgba(Math.round(rgba.r*255),Math.round(rgba.g*255),Math.round(rgba.b*255),rgba.a)}stringToHsva(colorString="",allowHex8=!1){let hsva=null;colorString=(colorString||"").toLowerCase();let stringParsers=[{re:/(rgb)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*%?,\s*(\d{1,3})\s*%?(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return new Rgba(parseInt(execResult[2],10)/255,parseInt(execResult[3],10)/255,parseInt(execResult[4],10)/255,isNaN(parseFloat(execResult[5]))?1:parseFloat(execResult[5]))}},{re:/(hsl)a?\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,parse:function(execResult){return new Hsla(parseInt(execResult[2],10)/360,parseInt(execResult[3],10)/100,parseInt(execResult[4],10)/100,isNaN(parseFloat(execResult[5]))?1:parseFloat(execResult[5]))}}];allowHex8?stringParsers.push({re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})?$/,parse:function(execResult){return new Rgba(parseInt(execResult[1],16)/255,parseInt(execResult[2],16)/255,parseInt(execResult[3],16)/255,parseInt(execResult[4]||"FF",16)/255)}}):stringParsers.push({re:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})$/,parse:function(execResult){return new Rgba(parseInt(execResult[1],16)/255,parseInt(execResult[2],16)/255,parseInt(execResult[3],16)/255,1)}}),stringParsers.push({re:/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])$/,parse:function(execResult){return new Rgba(parseInt(execResult[1]+execResult[1],16)/255,parseInt(execResult[2]+execResult[2],16)/255,parseInt(execResult[3]+execResult[3],16)/255,1)}});for(let key in stringParsers)if(stringParsers.hasOwnProperty(key)){let parser=stringParsers[key],match2=parser.re.exec(colorString),color=match2&&parser.parse(match2);if(color)return color instanceof Rgba?hsva=this.rgbaToHsva(color):color instanceof Hsla&&(hsva=this.hsla2hsva(color)),hsva}return hsva}outputFormat(hsva,outputFormat,alphaChannel){switch(outputFormat==="auto"&&(outputFormat=hsva.a<1?"rgba":"hex"),outputFormat){case"hsla":let hsla=this.hsva2hsla(hsva),hslaText=new Hsla(Math.round(hsla.h*360),Math.round(hsla.s*100),Math.round(hsla.l*100),Math.round(hsla.a*100)/100);return hsva.a<1||alphaChannel==="always"?"hsla("+hslaText.h+","+hslaText.s+"%,"+hslaText.l+"%,"+hslaText.a+")":"hsl("+hslaText.h+","+hslaText.s+"%,"+hslaText.l+"%)";case"rgba":let rgba=this.denormalizeRGBA(this.hsvaToRgba(hsva));return hsva.a<1||alphaChannel==="always"?"rgba("+rgba.r+","+rgba.g+","+rgba.b+","+Math.round(rgba.a*100)/100+")":"rgb("+rgba.r+","+rgba.g+","+rgba.b+")";default:let allowHex8=alphaChannel==="always"||alphaChannel==="forced";return this.rgbaToHex(this.denormalizeRGBA(this.hsvaToRgba(hsva)),allowHex8)}}static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||ColorPickerService2)};static \u0275prov=\u0275\u0275defineInjectable({token:ColorPickerService2,factory:ColorPickerService2.\u0275fac,providedIn:"root"})}return ColorPickerService2})(),SUPPORTS_TOUCH=typeof window<"u"&&"ontouchstart"in window,ColorPickerComponent=(()=>{class ColorPickerComponent2{ngZone;elRef;cdRef;document;platformId;service;isIE10=!1;cmyk;hsva;width;height;cmykColor;outputColor;initialColor;fallbackColor;listenerResize;listenerMouseDown;directiveInstance;sliderH;sliderDimMax;directiveElementRef;dialogArrowSize=10;dialogArrowOffset=15;dialogInputFields=[ColorFormats.HEX,ColorFormats.RGBA,ColorFormats.HSLA,ColorFormats.CMYK];useRootViewContainer=!1;show;hidden;top;left;position;format;slider;hexText;hexAlpha;cmykText;hslaText;rgbaText;arrowTop;selectedColor;hueSliderColor;alphaSliderColor;cpWidth;cpHeight;cpColorMode;cpCmykEnabled;cpAlphaChannel;cpOutputFormat;cpDisableInput;cpDialogDisplay;cpIgnoredElements;cpSaveClickOutside;cpCloseClickOutside;cpPosition;cpUsePosition;cpPositionOffset;cpOKButton;cpOKButtonText;cpOKButtonClass;cpCancelButton;cpCancelButtonText;cpCancelButtonClass;cpEyeDropper;eyeDropperSupported;cpPresetLabel;cpPresetColors;cpPresetColorsClass;cpMaxPresetColorsLength;cpPresetEmptyMessage;cpPresetEmptyMessageClass;cpAddColorButton;cpAddColorButtonText;cpAddColorButtonClass;cpRemoveColorButtonClass;cpArrowPosition;cpTriggerElement;cpExtraTemplate;dialogElement;hueSlider;alphaSlider;handleEsc(event2){this.show&&this.cpDialogDisplay==="popup"&&this.onCancelColor(event2)}handleEnter(event2){this.show&&this.cpDialogDisplay==="popup"&&this.onAcceptColor(event2)}constructor(ngZone,elRef,cdRef,document2,platformId,service){this.ngZone=ngZone,this.elRef=elRef,this.cdRef=cdRef,this.document=document2,this.platformId=platformId,this.service=service,this.eyeDropperSupported=isPlatformBrowser(this.platformId)&&"EyeDropper"in this.document.defaultView}ngOnInit(){this.slider=new SliderPosition(0,0,0,0);let hueWidth=this.hueSlider.nativeElement.offsetWidth||140,alphaWidth=this.alphaSlider.nativeElement.offsetWidth||140;this.sliderDimMax=new SliderDimension(hueWidth,this.cpWidth,130,alphaWidth),this.cpCmykEnabled?this.format=ColorFormats.CMYK:this.cpOutputFormat==="rgba"?this.format=ColorFormats.RGBA:this.cpOutputFormat==="hsla"?this.format=ColorFormats.HSLA:this.format=ColorFormats.HEX,this.listenerMouseDown=event2=>{this.onMouseDown(event2)},this.listenerResize=()=>{this.onResize()},this.openDialog(this.initialColor,!1)}ngOnDestroy(){this.closeDialog()}ngAfterViewInit(){if(this.cpWidth!==230||this.cpDialogDisplay==="inline"){let hueWidth=this.hueSlider.nativeElement.offsetWidth||140,alphaWidth=this.alphaSlider.nativeElement.offsetWidth||140;this.sliderDimMax=new SliderDimension(hueWidth,this.cpWidth,130,alphaWidth),this.updateColorPicker(!1),this.cdRef.detectChanges()}}openDialog(color,emit=!0){this.service.setActive(this),this.width||(this.cpWidth=this.directiveElementRef.nativeElement.offsetWidth),this.height||(this.height=320),this.setInitialColor(color),this.setColorFromString(color,emit),this.openColorPicker()}closeDialog(){this.closeColorPicker()}setupDialog(instance,elementRef,color,cpWidth,cpHeight,cpDialogDisplay,cpFallbackColor,cpColorMode,cpCmykEnabled,cpAlphaChannel,cpOutputFormat,cpDisableInput,cpIgnoredElements,cpSaveClickOutside,cpCloseClickOutside,cpUseRootViewContainer,cpPosition,cpPositionOffset,cpPositionRelativeToArrow,cpPresetLabel,cpPresetColors,cpPresetColorsClass,cpMaxPresetColorsLength,cpPresetEmptyMessage,cpPresetEmptyMessageClass,cpOKButton,cpOKButtonClass,cpOKButtonText,cpCancelButton,cpCancelButtonClass,cpCancelButtonText,cpAddColorButton,cpAddColorButtonClass,cpAddColorButtonText,cpRemoveColorButtonClass,cpEyeDropper,cpTriggerElement,cpExtraTemplate){this.setInitialColor(color),this.setColorMode(cpColorMode),this.isIE10=detectIE()===10,this.directiveInstance=instance,this.directiveElementRef=elementRef,this.cpDisableInput=cpDisableInput,this.cpCmykEnabled=cpCmykEnabled,this.cpAlphaChannel=cpAlphaChannel,this.cpOutputFormat=cpOutputFormat,this.cpDialogDisplay=cpDialogDisplay,this.cpIgnoredElements=cpIgnoredElements,this.cpSaveClickOutside=cpSaveClickOutside,this.cpCloseClickOutside=cpCloseClickOutside,this.useRootViewContainer=cpUseRootViewContainer,this.width=this.cpWidth=parseInt(cpWidth,10),this.height=this.cpHeight=parseInt(cpHeight,10),this.cpPosition=cpPosition,this.cpPositionOffset=parseInt(cpPositionOffset,10),this.cpOKButton=cpOKButton,this.cpOKButtonText=cpOKButtonText,this.cpOKButtonClass=cpOKButtonClass,this.cpCancelButton=cpCancelButton,this.cpCancelButtonText=cpCancelButtonText,this.cpCancelButtonClass=cpCancelButtonClass,this.cpEyeDropper=cpEyeDropper,this.fallbackColor=cpFallbackColor||"#fff",this.setPresetConfig(cpPresetLabel,cpPresetColors),this.cpPresetColorsClass=cpPresetColorsClass,this.cpMaxPresetColorsLength=cpMaxPresetColorsLength,this.cpPresetEmptyMessage=cpPresetEmptyMessage,this.cpPresetEmptyMessageClass=cpPresetEmptyMessageClass,this.cpAddColorButton=cpAddColorButton,this.cpAddColorButtonText=cpAddColorButtonText,this.cpAddColorButtonClass=cpAddColorButtonClass,this.cpRemoveColorButtonClass=cpRemoveColorButtonClass,this.cpTriggerElement=cpTriggerElement,this.cpExtraTemplate=cpExtraTemplate,cpPositionRelativeToArrow||(this.dialogArrowOffset=0),cpDialogDisplay==="inline"&&(this.dialogArrowSize=0,this.dialogArrowOffset=0),cpOutputFormat==="hex"&&cpAlphaChannel!=="always"&&cpAlphaChannel!=="forced"&&(this.cpAlphaChannel="disabled")}setColorMode(mode){switch(mode.toString().toUpperCase()){case"1":case"C":case"COLOR":this.cpColorMode=1;break;case"2":case"G":case"GRAYSCALE":this.cpColorMode=2;break;case"3":case"P":case"PRESETS":this.cpColorMode=3;break;default:this.cpColorMode=1}}setInitialColor(color){this.initialColor=color}setPresetConfig(cpPresetLabel,cpPresetColors){this.cpPresetLabel=cpPresetLabel,this.cpPresetColors=cpPresetColors}setColorFromString(value,emit=!0,update47=!0){let hsva;this.cpAlphaChannel==="always"||this.cpAlphaChannel==="forced"?(hsva=this.service.stringToHsva(value,!0),!hsva&&!this.hsva&&(hsva=this.service.stringToHsva(value,!1))):hsva=this.service.stringToHsva(value,!1),!hsva&&!this.hsva&&(hsva=this.service.stringToHsva(this.fallbackColor,!1)),hsva&&(this.hsva=hsva,this.sliderH=this.hsva.h,this.cpOutputFormat==="hex"&&this.cpAlphaChannel==="disabled"&&(this.hsva.a=1),this.updateColorPicker(emit,update47))}onResize(){this.position==="fixed"?this.setDialogPosition():this.cpDialogDisplay!=="inline"&&this.closeColorPicker()}onDragEnd(slider){this.directiveInstance.sliderDragEnd({slider,color:this.outputColor})}onDragStart(slider){this.directiveInstance.sliderDragStart({slider,color:this.outputColor})}onMouseDown(event2){this.show&&!this.isIE10&&this.cpDialogDisplay==="popup"&&event2.target!==this.directiveElementRef.nativeElement&&!this.isDescendant(this.elRef.nativeElement,event2.target)&&!this.isDescendant(this.directiveElementRef.nativeElement,event2.target)&&this.cpIgnoredElements.filter(item=>item===event2.target).length===0&&this.ngZone.run(()=>{this.cpSaveClickOutside?this.directiveInstance.colorSelected(this.outputColor):(this.hsva=null,this.setColorFromString(this.initialColor,!1),this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.initialColor),this.directiveInstance.colorCanceled()),this.cpCloseClickOutside&&this.closeColorPicker()})}onAcceptColor(event2){event2.stopPropagation(),this.outputColor&&this.directiveInstance.colorSelected(this.outputColor),this.cpDialogDisplay==="popup"&&this.closeColorPicker()}onCancelColor(event2){this.hsva=null,event2.stopPropagation(),this.directiveInstance.colorCanceled(),this.setColorFromString(this.initialColor,!0),this.cpDialogDisplay==="popup"&&(this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.initialColor,!0),this.closeColorPicker())}onEyeDropper(){if(!this.eyeDropperSupported)return;new window.EyeDropper().open().then(eyeDropperResult=>{this.setColorFromString(eyeDropperResult.sRGBHex,!0)})}onFormatToggle(change){let availableFormats=this.dialogInputFields.length-(this.cpCmykEnabled?0:1),nextFormat=((this.dialogInputFields.indexOf(this.format)+change)%availableFormats+availableFormats)%availableFormats;this.format=this.dialogInputFields[nextFormat]}onColorChange(value){this.hsva.s=value.s/value.rgX,this.hsva.v=value.v/value.rgY,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"lightness",value:this.hsva.v,color:this.outputColor}),this.directiveInstance.sliderChanged({slider:"saturation",value:this.hsva.s,color:this.outputColor})}onHueChange(value){this.hsva.h=value.v/value.rgX,this.sliderH=this.hsva.h,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"hue",value:this.hsva.h,color:this.outputColor})}onValueChange(value){this.hsva.v=value.v/value.rgX,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"value",value:this.hsva.v,color:this.outputColor})}onAlphaChange(value){this.hsva.a=value.v/value.rgX,this.updateColorPicker(),this.directiveInstance.sliderChanged({slider:"alpha",value:this.hsva.a,color:this.outputColor})}onHexInput(value){if(value===null)this.updateColorPicker();else{value&&value[0]!=="#"&&(value="#"+value);let validHex=/^#([a-f0-9]{3}|[a-f0-9]{6})$/gi;this.cpAlphaChannel==="always"&&(validHex=/^#([a-f0-9]{3}|[a-f0-9]{6}|[a-f0-9]{8})$/gi);let valid=validHex.test(value);valid&&(value.length<5&&(value="#"+value.substring(1).split("").map(c=>c+c).join("")),this.cpAlphaChannel==="forced"&&(value+=Math.round(this.hsva.a*255).toString(16)),this.setColorFromString(value,!0,!1)),this.directiveInstance.inputChanged({input:"hex",valid,value,color:this.outputColor})}}onRedInput(value){let rgba=this.service.hsvaToRgba(this.hsva),valid=!isNaN(value.v)&&value.v>=0&&value.v<=value.rg;valid&&(rgba.r=value.v/value.rg,this.hsva=this.service.rgbaToHsva(rgba),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"red",valid,value:rgba.r,color:this.outputColor})}onBlueInput(value){let rgba=this.service.hsvaToRgba(this.hsva),valid=!isNaN(value.v)&&value.v>=0&&value.v<=value.rg;valid&&(rgba.b=value.v/value.rg,this.hsva=this.service.rgbaToHsva(rgba),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"blue",valid,value:rgba.b,color:this.outputColor})}onGreenInput(value){let rgba=this.service.hsvaToRgba(this.hsva),valid=!isNaN(value.v)&&value.v>=0&&value.v<=value.rg;valid&&(rgba.g=value.v/value.rg,this.hsva=this.service.rgbaToHsva(rgba),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"green",valid,value:rgba.g,color:this.outputColor})}onHueInput(value){let valid=!isNaN(value.v)&&value.v>=0&&value.v<=value.rg;valid&&(this.hsva.h=value.v/value.rg,this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"hue",valid,value:this.hsva.h,color:this.outputColor})}onValueInput(value){let valid=!isNaN(value.v)&&value.v>=0&&value.v<=value.rg;valid&&(this.hsva.v=value.v/value.rg,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"value",valid,value:this.hsva.v,color:this.outputColor})}onAlphaInput(value){let valid=!isNaN(value.v)&&value.v>=0&&value.v<=value.rg;valid&&(this.hsva.a=value.v/value.rg,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"alpha",valid,value:this.hsva.a,color:this.outputColor})}onLightnessInput(value){let hsla=this.service.hsva2hsla(this.hsva),valid=!isNaN(value.v)&&value.v>=0&&value.v<=value.rg;valid&&(hsla.l=value.v/value.rg,this.hsva=this.service.hsla2hsva(hsla),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"lightness",valid,value:hsla.l,color:this.outputColor})}onSaturationInput(value){let hsla=this.service.hsva2hsla(this.hsva),valid=!isNaN(value.v)&&value.v>=0&&value.v<=value.rg;valid&&(hsla.s=value.v/value.rg,this.hsva=this.service.hsla2hsva(hsla),this.sliderH=this.hsva.h,this.updateColorPicker()),this.directiveInstance.inputChanged({input:"saturation",valid,value:hsla.s,color:this.outputColor})}onCyanInput(value){!isNaN(value.v)&&value.v>=0&&value.v<=value.rg&&(this.cmyk.c=value.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"cyan",valid:!0,value:this.cmyk.c,color:this.outputColor})}onMagentaInput(value){!isNaN(value.v)&&value.v>=0&&value.v<=value.rg&&(this.cmyk.m=value.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"magenta",valid:!0,value:this.cmyk.m,color:this.outputColor})}onYellowInput(value){!isNaN(value.v)&&value.v>=0&&value.v<=value.rg&&(this.cmyk.y=value.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"yellow",valid:!0,value:this.cmyk.y,color:this.outputColor})}onBlackInput(value){!isNaN(value.v)&&value.v>=0&&value.v<=value.rg&&(this.cmyk.k=value.v,this.updateColorPicker(!1,!0,!0)),this.directiveInstance.inputChanged({input:"black",valid:!0,value:this.cmyk.k,color:this.outputColor})}onAddPresetColor(event2,value){event2.stopPropagation(),this.cpPresetColors.filter(color=>color===value).length||(this.cpPresetColors=this.cpPresetColors.concat(value),this.directiveInstance.presetColorsChanged(this.cpPresetColors))}onRemovePresetColor(event2,value){event2.stopPropagation(),this.cpPresetColors=this.cpPresetColors.filter(color=>color!==value),this.directiveInstance.presetColorsChanged(this.cpPresetColors)}openColorPicker(){this.show||(this.show=!0,this.hidden=!0,setTimeout(()=>{this.hidden=!1,this.setDialogPosition(),this.cdRef.detectChanges()},0),this.directiveInstance.stateChanged(!0),this.isIE10||this.ngZone.runOutsideAngular(()=>{SUPPORTS_TOUCH?document.addEventListener("touchstart",this.listenerMouseDown):document.addEventListener("mousedown",this.listenerMouseDown)}),window.addEventListener("resize",this.listenerResize))}closeColorPicker(){this.show&&(this.show=!1,this.directiveInstance.stateChanged(!1),this.isIE10||(SUPPORTS_TOUCH?document.removeEventListener("touchstart",this.listenerMouseDown):document.removeEventListener("mousedown",this.listenerMouseDown)),window.removeEventListener("resize",this.listenerResize),this.cdRef.destroyed||this.cdRef.detectChanges())}updateColorPicker(emit=!0,update47=!0,cmykInput=!1){if(this.sliderDimMax){this.cpColorMode===2&&(this.hsva.s=0);let hue,hsla,rgba,lastOutput=this.outputColor;if(hsla=this.service.hsva2hsla(this.hsva),this.cpCmykEnabled?(cmykInput?(rgba=this.service.cmykToRgb(this.service.normalizeCMYK(this.cmyk)),this.hsva=this.service.rgbaToHsva(rgba)):(rgba=this.service.hsvaToRgba(this.hsva),this.cmyk=this.service.denormalizeCMYK(this.service.rgbaToCmyk(rgba))),rgba=this.service.denormalizeRGBA(rgba),this.sliderH=this.hsva.h):rgba=this.service.denormalizeRGBA(this.service.hsvaToRgba(this.hsva)),hue=this.service.denormalizeRGBA(this.service.hsvaToRgba(new Hsva(this.sliderH||this.hsva.h,1,1,1))),update47){this.hslaText=new Hsla(Math.round(hsla.h*360),Math.round(hsla.s*100),Math.round(hsla.l*100),Math.round(hsla.a*100)/100),this.rgbaText=new Rgba(rgba.r,rgba.g,rgba.b,Math.round(rgba.a*100)/100),this.cpCmykEnabled&&(this.cmykText=new Cmyk(this.cmyk.c,this.cmyk.m,this.cmyk.y,this.cmyk.k,Math.round(this.cmyk.a*100)/100));let allowHex8=this.cpAlphaChannel==="always";this.hexText=this.service.rgbaToHex(rgba,allowHex8),this.hexAlpha=this.rgbaText.a}if(this.cpOutputFormat==="auto"&&this.format!==ColorFormats.RGBA&&this.format!==ColorFormats.CMYK&&this.format!==ColorFormats.HSLA&&this.hsva.a<1&&(this.format=this.hsva.a<1?ColorFormats.RGBA:ColorFormats.HEX),this.hueSliderColor="rgb("+hue.r+","+hue.g+","+hue.b+")",this.alphaSliderColor="rgb("+rgba.r+","+rgba.g+","+rgba.b+")",this.outputColor=this.service.outputFormat(this.hsva,this.cpOutputFormat,this.cpAlphaChannel),this.selectedColor=this.service.outputFormat(this.hsva,"rgba",null),this.format!==ColorFormats.CMYK)this.cmykColor="";else if(this.cpAlphaChannel==="always"||this.cpAlphaChannel==="enabled"||this.cpAlphaChannel==="forced"){let alpha=Math.round(this.cmyk.a*100)/100;this.cmykColor=`cmyka(${this.cmyk.c},${this.cmyk.m},${this.cmyk.y},${this.cmyk.k},${alpha})`}else this.cmykColor=`cmyk(${this.cmyk.c},${this.cmyk.m},${this.cmyk.y},${this.cmyk.k})`;this.slider=new SliderPosition((this.sliderH||this.hsva.h)*this.sliderDimMax.h-8,this.hsva.s*this.sliderDimMax.s-8,(1-this.hsva.v)*this.sliderDimMax.v-8,this.hsva.a*this.sliderDimMax.a-8),emit&&lastOutput!==this.outputColor&&(this.cpCmykEnabled&&this.directiveInstance.cmykChanged(this.cmykColor),this.directiveInstance.colorChanged(this.outputColor))}}setDialogPosition(){if(this.cpDialogDisplay==="inline")this.position="relative";else{let position="static",transform="",style2,parentNode=null,transformNode=null,node=this.directiveElementRef.nativeElement.parentNode,dialogHeight=this.dialogElement.nativeElement.offsetHeight;for(;node!==null&&node.tagName!=="HTML";){if(style2=window.getComputedStyle(node),position=style2.getPropertyValue("position"),transform=style2.getPropertyValue("transform"),position!=="static"&&parentNode===null&&(parentNode=node),transform&&transform!=="none"&&transformNode===null&&(transformNode=node),position==="fixed"){parentNode=transformNode;break}node=node.parentNode}let boxDirective=this.createDialogBox(this.directiveElementRef.nativeElement,position!=="fixed");if(this.useRootViewContainer||position==="fixed"&&(!parentNode||parentNode instanceof HTMLUnknownElement))this.top=boxDirective.top,this.left=boxDirective.left;else{parentNode===null&&(parentNode=node);let boxParent=this.createDialogBox(parentNode,position!=="fixed");this.top=boxDirective.top-boxParent.top,this.left=boxDirective.left-boxParent.left}position==="fixed"&&(this.position="fixed");let usePosition=this.cpPosition,dialogBounds=this.dialogElement.nativeElement.getBoundingClientRect();if(this.cpPosition==="auto"){let triggerBounds=this.cpTriggerElement.nativeElement.getBoundingClientRect();usePosition=calculateAutoPositioning(dialogBounds,triggerBounds)}switch(this.arrowTop=usePosition==="top"?dialogHeight-1:void 0,this.cpArrowPosition=void 0,usePosition){case"top":this.top-=dialogHeight+this.dialogArrowSize,this.left+=this.cpPositionOffset/100*boxDirective.width-this.dialogArrowOffset;break;case"bottom":this.top+=boxDirective.height+this.dialogArrowSize,this.left+=this.cpPositionOffset/100*boxDirective.width-this.dialogArrowOffset;break;case"top-left":case"left-top":this.top-=dialogHeight-boxDirective.height+boxDirective.height*this.cpPositionOffset/100,this.left-=this.cpWidth+this.dialogArrowSize-2-this.dialogArrowOffset;break;case"top-right":case"right-top":this.top-=dialogHeight-boxDirective.height+boxDirective.height*this.cpPositionOffset/100,this.left+=boxDirective.width+this.dialogArrowSize-2-this.dialogArrowOffset;break;case"left":case"bottom-left":case"left-bottom":this.top+=boxDirective.height*this.cpPositionOffset/100-this.dialogArrowOffset,this.left-=this.cpWidth+this.dialogArrowSize-2;break;case"right":case"bottom-right":case"right-bottom":default:this.top+=boxDirective.height*this.cpPositionOffset/100-this.dialogArrowOffset,this.left+=boxDirective.width+this.dialogArrowSize-2;break}let windowInnerHeight=window.innerHeight,windowInnerWidth=window.innerWidth,elRefClientRect=this.elRef.nativeElement.getBoundingClientRect();this.top+dialogBounds.height>windowInnerHeight&&(this.top=windowInnerHeight-dialogBounds.height,this.cpArrowPosition=elRefClientRect.x/2-20),this.left+dialogBounds.width>windowInnerWidth&&(this.left=windowInnerWidth-dialogBounds.width,this.cpArrowPosition=elRefClientRect.x/2-20),this.cpUsePosition=usePosition}}isDescendant(parent,child){let node=child.parentNode;for(;node!==null;){if(node===parent)return!0;node=node.parentNode}return!1}createDialogBox(element,offset3){let{top:top2,left:left2}=element.getBoundingClientRect();return{top:top2+(offset3?window.pageYOffset:0),left:left2+(offset3?window.pageXOffset:0),width:element.offsetWidth,height:element.offsetHeight}}static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||ColorPickerComponent2)(\u0275\u0275directiveInject(NgZone),\u0275\u0275directiveInject(ElementRef),\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(DOCUMENT),\u0275\u0275directiveInject(PLATFORM_ID),\u0275\u0275directiveInject(ColorPickerService))};static \u0275cmp=\u0275\u0275defineComponent({type:ColorPickerComponent2,selectors:[["color-picker"]],viewQuery:function(rf,ctx){if(rf&1&&(\u0275\u0275viewQuery(_c015,7),\u0275\u0275viewQuery(_c15,7),\u0275\u0275viewQuery(_c24,7)),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.dialogElement=_t.first),\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.hueSlider=_t.first),\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.alphaSlider=_t.first)}},hostBindings:function(rf,ctx){rf&1&&\u0275\u0275listener("keyup.esc",function($event){return ctx.handleEsc($event)},!1,\u0275\u0275resolveDocument)("keyup.enter",function($event){return ctx.handleEnter($event)},!1,\u0275\u0275resolveDocument)},decls:30,vars:51,consts:[["dialogPopup",""],["hueSlider",""],["valueSlider",""],["alphaSlider",""],[1,"color-picker",3,"click"],[3,"left","class","top",4,"ngIf"],["class","saturation-lightness",3,"slider","rgX","rgY","background-color","newValue","dragStart","dragEnd",4,"ngIf"],[1,"hue-alpha","box"],[1,"left"],[1,"selected-color-background"],[1,"selected-color",3,"click"],["class","eyedropper-icon","xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","#000000",4,"ngIf"],["type","button",3,"class","disabled","click",4,"ngIf"],[1,"right"],["style","height: 16px;",4,"ngIf"],[1,"hue",3,"newValue","dragStart","dragEnd","slider","rgX"],[1,"cursor"],[1,"value",3,"newValue","dragStart","dragEnd","slider","rgX"],[1,"alpha",3,"newValue","dragStart","dragEnd","slider","rgX"],["class","cmyk-text",3,"display",4,"ngIf"],["class","hsla-text",3,"display",4,"ngIf"],["class","rgba-text",3,"display",4,"ngIf"],["class","hex-text",3,"hex-alpha","display",4,"ngIf"],["class","value-text",4,"ngIf"],["class","type-policy",4,"ngIf"],["class","preset-area",4,"ngIf"],["class","button-area",4,"ngIf"],["class","extra-template",4,"ngIf"],[1,"saturation-lightness",3,"newValue","dragStart","dragEnd","slider","rgX","rgY"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","#000000",1,"eyedropper-icon"],["d","M0 0h24v24H0V0z","fill","none"],["d","M17.66 5.41l.92.92-2.69 2.69-.92-.92 2.69-2.69M17.67 3c-.26 0-.51.1-.71.29l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c.4-.4.4-1.03.01-1.42l-2.34-2.34c-.2-.19-.45-.29-.7-.29zM6.92 19L5 17.08l8.06-8.06 1.92 1.92L6.92 19z"],["type","button",3,"click","disabled"],[2,"height","16px"],[1,"cmyk-text"],[1,"box"],["type","number","pattern","[0-9]*","min","0","max","100",3,"keyup.enter","newValue","text","rg","value"],["type","number","pattern","[0-9]+([\\.,][0-9]{1,2})?","min","0","max","1","step","0.1",3,"text","rg","value","keyup.enter","newValue",4,"ngIf"],[4,"ngIf"],["type","number","pattern","[0-9]+([\\.,][0-9]{1,2})?","min","0","max","1","step","0.1",3,"keyup.enter","newValue","text","rg","value"],[1,"hsla-text"],["type","number","pattern","[0-9]*","min","0","max","360",3,"keyup.enter","newValue","text","rg","value"],[1,"rgba-text"],["type","number","pattern","[0-9]*","min","0","max","255",3,"keyup.enter","newValue","text","rg","value"],[1,"hex-text"],[3,"blur","keyup.enter","newValue","text","value"],[1,"value-text"],[1,"type-policy"],[1,"type-policy-arrow",3,"click"],[1,"preset-area"],[1,"preset-label"],[3,"class",4,"ngIf"],["class","preset-color",3,"backgroundColor","click",4,"ngFor","ngForOf"],[1,"preset-color",3,"click"],[3,"class","click",4,"ngIf"],[3,"click"],[1,"button-area"],["type","button",3,"class","click",4,"ngIf"],["type","button",3,"click"],[1,"extra-template"],[4,"ngTemplateOutlet"]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",4,0),\u0275\u0275listener("click",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275template(2,ColorPickerComponent_div_2_Template,1,7,"div",5)(3,ColorPickerComponent_div_3_Template,2,8,"div",6),\u0275\u0275elementStart(4,"div",7)(5,"div",8),\u0275\u0275element(6,"div",9),\u0275\u0275elementStart(7,"div",10),\u0275\u0275listener("click",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.eyeDropperSupported&&ctx.cpEyeDropper&&ctx.onEyeDropper())}),\u0275\u0275template(8,ColorPickerComponent__svg_svg_8_Template,3,0,"svg",11),\u0275\u0275elementEnd(),\u0275\u0275template(9,ColorPickerComponent_button_9_Template,2,5,"button",12),\u0275\u0275elementEnd(),\u0275\u0275elementStart(10,"div",13),\u0275\u0275template(11,ColorPickerComponent_div_11_Template,1,0,"div",14),\u0275\u0275elementStart(12,"div",15,1),\u0275\u0275listener("newValue",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onHueChange($event))})("dragStart",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onDragStart("hue"))})("dragEnd",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onDragEnd("hue"))}),\u0275\u0275element(14,"div",16),\u0275\u0275elementEnd(),\u0275\u0275elementStart(15,"div",17,2),\u0275\u0275listener("newValue",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onValueChange($event))})("dragStart",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onDragStart("value"))})("dragEnd",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onDragEnd("value"))}),\u0275\u0275element(17,"div",16),\u0275\u0275elementEnd(),\u0275\u0275elementStart(18,"div",18,3),\u0275\u0275listener("newValue",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onAlphaChange($event))})("dragStart",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onDragStart("alpha"))})("dragEnd",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.onDragEnd("alpha"))}),\u0275\u0275element(20,"div",16),\u0275\u0275elementEnd()()(),\u0275\u0275template(21,ColorPickerComponent_div_21_Template,17,12,"div",19)(22,ColorPickerComponent_div_22_Template,14,10,"div",20)(23,ColorPickerComponent_div_23_Template,14,10,"div",21)(24,ColorPickerComponent_div_24_Template,8,7,"div",22)(25,ColorPickerComponent_div_25_Template,9,3,"div",23)(26,ColorPickerComponent_div_26_Template,3,0,"div",24)(27,ColorPickerComponent_div_27_Template,6,3,"div",25)(28,ColorPickerComponent_div_28_Template,3,2,"div",26)(29,ColorPickerComponent_div_29_Template,2,1,"div",27),\u0275\u0275elementEnd()}rf&2&&(\u0275\u0275styleProp("display",ctx.show?"block":"none")("visibility",ctx.hidden?"hidden":"visible")("top",ctx.top,"px")("left",ctx.left,"px")("position",ctx.position)("height",ctx.cpHeight,"px")("width",ctx.cpWidth,"px"),\u0275\u0275classProp("open",ctx.show),\u0275\u0275advance(2),\u0275\u0275property("ngIf",ctx.cpDialogDisplay==="popup"),\u0275\u0275advance(),\u0275\u0275property("ngIf",(ctx.cpColorMode||1)===1),\u0275\u0275advance(4),\u0275\u0275styleProp("background-color",ctx.selectedColor)("cursor",ctx.eyeDropperSupported&&ctx.cpEyeDropper?"pointer":null),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx.eyeDropperSupported&&ctx.cpEyeDropper),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx.cpAddColorButton),\u0275\u0275advance(2),\u0275\u0275property("ngIf",ctx.cpAlphaChannel==="disabled"),\u0275\u0275advance(),\u0275\u0275styleProp("display",(ctx.cpColorMode||1)===1?"block":"none"),\u0275\u0275property("rgX",1),\u0275\u0275advance(2),\u0275\u0275styleProp("left",ctx.slider==null?null:ctx.slider.h,"px"),\u0275\u0275advance(),\u0275\u0275styleProp("display",(ctx.cpColorMode||1)===2?"block":"none"),\u0275\u0275property("rgX",1),\u0275\u0275advance(2),\u0275\u0275styleProp("right",ctx.slider==null?null:ctx.slider.v,"px"),\u0275\u0275advance(),\u0275\u0275styleProp("display",ctx.cpAlphaChannel==="disabled"?"none":"block")("background-color",ctx.alphaSliderColor),\u0275\u0275property("rgX",1),\u0275\u0275advance(2),\u0275\u0275styleProp("left",ctx.slider==null?null:ctx.slider.a,"px"),\u0275\u0275advance(),\u0275\u0275property("ngIf",!ctx.cpDisableInput&&(ctx.cpColorMode||1)===1),\u0275\u0275advance(),\u0275\u0275property("ngIf",!ctx.cpDisableInput&&(ctx.cpColorMode||1)===1),\u0275\u0275advance(),\u0275\u0275property("ngIf",!ctx.cpDisableInput&&(ctx.cpColorMode||1)===1),\u0275\u0275advance(),\u0275\u0275property("ngIf",!ctx.cpDisableInput&&(ctx.cpColorMode||1)===1),\u0275\u0275advance(),\u0275\u0275property("ngIf",!ctx.cpDisableInput&&(ctx.cpColorMode||1)===2),\u0275\u0275advance(),\u0275\u0275property("ngIf",!ctx.cpDisableInput&&(ctx.cpColorMode||1)===1),\u0275\u0275advance(),\u0275\u0275property("ngIf",(ctx.cpPresetColors==null?null:ctx.cpPresetColors.length)||ctx.cpAddColorButton),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx.cpOKButton||ctx.cpCancelButton),\u0275\u0275advance(),\u0275\u0275property("ngIf",ctx.cpExtraTemplate))},dependencies:[SliderDirective,TextDirective,CommonModule,NgForOf,NgIf,NgTemplateOutlet],styles:[`.color-picker{position:absolute;z-index:1000;width:230px;height:auto;border:#777 solid 1px;cursor:default;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#fff}.color-picker *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;font-size:11px}.color-picker input{width:0;height:26px;min-width:0;font-size:13px;text-align:center;color:#000}.color-picker input:invalid,.color-picker input:-moz-ui-invalid,.color-picker input:-moz-submit-invalid{box-shadow:none}.color-picker input::-webkit-inner-spin-button,.color-picker input::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.color-picker .arrow{position:absolute;z-index:999999;width:0;height:0;border-style:solid}.color-picker .arrow.arrow-top{left:8px;border-width:10px 5px;border-color:#777 rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0)}.color-picker .arrow.arrow-bottom{top:-20px;left:8px;border-width:10px 5px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) #777 rgba(0,0,0,0)}.color-picker .arrow.arrow-top-left,.color-picker .arrow.arrow-left-top{right:-21px;bottom:8px;border-width:5px 10px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #777}.color-picker .arrow.arrow-top-right,.color-picker .arrow.arrow-right-top{bottom:8px;left:-20px;border-width:5px 10px;border-color:rgba(0,0,0,0) #777 rgba(0,0,0,0) rgba(0,0,0,0)}.color-picker .arrow.arrow-left,.color-picker .arrow.arrow-left-bottom,.color-picker .arrow.arrow-bottom-left{top:8px;right:-21px;border-width:5px 10px;border-color:rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #777}.color-picker .arrow.arrow-right,.color-picker .arrow.arrow-right-bottom,.color-picker .arrow.arrow-bottom-right{top:8px;left:-20px;border-width:5px 10px;border-color:rgba(0,0,0,0) #777 rgba(0,0,0,0) rgba(0,0,0,0)}.color-picker .cursor{position:relative;width:16px;height:16px;border:#222 solid 2px;border-radius:50%;cursor:default}.color-picker .box{display:flex;padding:4px 8px}.color-picker .left{position:relative;padding:16px 8px}.color-picker .right{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;padding:12px 8px}.color-picker .button-area{padding:0 16px 16px;text-align:right}.color-picker .button-area button{margin-left:8px}.color-picker .preset-area{padding:4px 15px}.color-picker .preset-area .preset-label{overflow:hidden;width:100%;padding:4px;font-size:11px;white-space:nowrap;text-align:left;text-overflow:ellipsis;color:#555}.color-picker .preset-area .preset-color{position:relative;display:inline-block;width:18px;height:18px;margin:4px 6px 8px;border:#a9a9a9 solid 1px;border-radius:25%;cursor:pointer}.color-picker .preset-area .preset-empty-message{min-height:18px;margin-top:4px;margin-bottom:8px;font-style:italic;text-align:center}.color-picker .hex-text{width:100%;padding:4px 8px;font-size:11px}.color-picker .hex-text .box{padding:0 24px 8px 8px}.color-picker .hex-text .box div{float:left;-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;text-align:center;color:#555;clear:left}.color-picker .hex-text .box input{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;padding:1px;border:#a9a9a9 solid 1px}.color-picker .hex-alpha .box div:first-child,.color-picker .hex-alpha .box input:first-child{flex-grow:3;margin-right:8px}.color-picker .cmyk-text,.color-picker .hsla-text,.color-picker .rgba-text,.color-picker .value-text{width:100%;padding:4px 8px;font-size:11px}.color-picker .cmyk-text .box,.color-picker .hsla-text .box,.color-picker .rgba-text .box{padding:0 24px 8px 8px}.color-picker .value-text .box{padding:0 8px 8px}.color-picker .cmyk-text .box div,.color-picker .hsla-text .box div,.color-picker .rgba-text .box div,.color-picker .value-text .box div{-webkit-flex:1 1 auto;-ms-flex:1 1 auto;flex:1 1 auto;margin-right:8px;text-align:center;color:#555}.color-picker .cmyk-text .box div:last-child,.color-picker .hsla-text .box div:last-child,.color-picker .rgba-text .box div:last-child,.color-picker .value-text .box div:last-child{margin-right:0}.color-picker .cmyk-text .box input,.color-picker .hsla-text .box input,.color-picker .rgba-text .box input,.color-picker .value-text .box input{float:left;-webkit-flex:1;-ms-flex:1;flex:1;padding:1px;margin:0 8px 0 0;border:#a9a9a9 solid 1px}.color-picker .cmyk-text .box input:last-child,.color-picker .hsla-text .box input:last-child,.color-picker .rgba-text .box input:last-child,.color-picker .value-text .box input:last-child{margin-right:0}.color-picker .hue-alpha{align-items:center;margin-bottom:3px}.color-picker .hue{direction:ltr;width:100%;height:16px;margin-bottom:16px;border:none;cursor:pointer;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwkUFWbCCAAAAFxJREFUaN7t0kEKg0AQAME2x83/n2qu5qCgD1iDhCoYdpnbQC9bbY1qVO/jvc6k3ad91s7/7F1/csgPrujuQ17BDYSFsBAWwgJhISyEBcJCWAgLhIWwEBYIi2f7Ar/1TCgFH2X9AAAAAElFTkSuQmCC)}.color-picker .value{direction:rtl;width:100%;height:16px;margin-bottom:16px;border:none;cursor:pointer;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAACTklEQVR42u3SYUcrABhA4U2SkmRJMmWSJklKJiWZZpKUJJskKUmaTFImKZOUzMySpGRmliRNJilJSpKSJEtmSpIpmWmSdO736/6D+x7OP3gUCoWCv1cqlSQlJZGcnExKSgqpqamkpaWRnp5ORkYGmZmZqFQqsrKyyM7OJicnh9zcXNRqNXl5eeTn56PRaCgoKKCwsJCioiK0Wi3FxcWUlJRQWlpKWVkZ5eXlVFRUUFlZiU6no6qqiurqampqaqitraWurg69Xk99fT0GgwGj0UhDQwONjY00NTXR3NxMS0sLra2ttLW10d7ejslkwmw209HRQWdnJ11dXXR3d9PT00Nvby99fX309/czMDDA4OAgFouFoaEhrFYrw8PDjIyMMDo6ytjYGDabjfHxcSYmJpicnGRqagq73c709DQzMzPMzs4yNzfH/Pw8DocDp9OJy+XC7XazsLDA4uIiS0tLLC8vs7KywurqKmtra3g8HrxeLz6fD7/fz/r6OhsbG2xubrK1tcX29jaBQICdnR2CwSC7u7vs7e2xv7/PwcEBh4eHHB0dcXx8zMnJCaenp5ydnXF+fs7FxQWXl5dcXV1xfX3Nzc0Nt7e33N3dEQqFuL+/5+HhgXA4TCQS4fHxkaenJ56fn3l5eeH19ZVoNMrb2xvv7+98fHwQi8WIx+N8fn6SSCT4+vri+/ubn58ffn9/+VcKgSWwBJbAElgCS2AJLIElsASWwBJYAktgCSyBJbAElsASWAJLYAksgSWwBJbAElgCS2AJLIElsP4/WH8AmJ5Z6jHS4h8AAAAASUVORK5CYII=)}.color-picker .alpha{direction:ltr;width:100%;height:16px;border:none;cursor:pointer;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAQCAYAAAD06IYnAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwYQlZMa3gAAAWVJREFUaN7tmEGO6jAQRCsOArHgBpyAJYGjcGocxAm4A2IHpmoWE0eBH+ezmFlNvU06shJ3W6VEelWMUQAIIF9f6qZpimsA1LYtS2uF51/u27YVAFZVRUkEoGHdPV/sIcbIEIIkUdI/9Xa7neyv61+SWFUVAVCSct00TWn2fv6u3+Ecfd3tXzy/0+nEUu+SPjo/kqzrmiQpScN6v98XewfA8/lMkiLJ2WxGSUopcT6fM6U0NX9/frfbjev1WtfrlZfLhYfDQQHG/AIOlnGwjINlHCxjHCzjYJm/TJWdCwquJXseFFzGwDNNeiKMOJTO8xQdDQaeB29+K9efeLaBo9J7vdvtJj1RjFFjfiv7qv95tjx/7leSQgh93e1ffMeIp6O+YQjho/N791t1XVOSSI7N//K+4/GoxWLBx+PB5/Op5XLJ+/3OlJJWqxU3m83ovv5iGf8KjYNlHCxjHCzjYBkHy5gf5gusvQU7U37jTAAAAABJRU5ErkJggg==)}.color-picker .type-policy{position:absolute;top:218px;right:12px;width:16px;height:24px;background-size:8px 16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAgCAYAAAAffCjxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAACewAAAnsB01CO3AAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIASURBVEiJ7ZY9axRRFIafsxMStrLQJpAgpBFhi+C9w1YSo00I6RZ/g9vZpBf/QOr4GyRgkSKNSrAadsZqQGwCkuAWyRZJsySwvhZ7N/vhzrgbLH3Ld8597jlzz50zJokyxXH8DqDVar0qi6v8BbItqSGpEcfxdlmsFWXkvX8AfAVWg3UKPEnT9GKujMzsAFgZsVaCN1VTQd77XUnrgE1kv+6935268WRpzrnHZvYRWC7YvC3pRZZl3wozqtVqiyH9IgjAspkd1Gq1xUJQtVrdB9ZKIAOthdg/Qc65LUk7wNIMoCVJO865rYFhkqjX6/d7vV4GPJwBMqofURS5JEk6FYBer/eeYb/Mo9WwFnPOvQbeAvfuAAK4BN4sAJtAG/gJIElmNuiJyba3EGNmZiPeZuEVmVell/Y/6N+CzDn3AXhEOOo7Hv/3BeAz8IzQkMPnJbuPx1wC+yYJ7/0nYIP5S/0FHKdp+rwCEEXRS/rf5Hl1Gtb2M0iSpCOpCZzPATmX1EySpHMLAsiy7MjMDoHrGSDXZnaYZdnRwBh7J91utwmczAA6CbG3GgPleX4jqUH/a1CktqRGnuc3hSCAMB32gKspkCtgb3KCQMmkjeP4WNJThrNNZval1WptTIsv7JtQ4tmIdRa8qSoEpWl6YWZNoAN0zKxZNPehpLSBZv2t+Q0CJ9lLnARQLAAAAABJRU5ErkJggg==);background-repeat:no-repeat;background-position:center}.color-picker .type-policy .type-policy-arrow{display:block;width:100%;height:50%}.color-picker .selected-color{position:absolute;top:16px;left:8px;width:40px;height:40px;border:1px solid #a9a9a9;border-radius:50%}.color-picker .selected-color-background{width:40px;height:40px;border-radius:50%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAh0lEQVRYR+2W0QlAMQgD60zdfwOdqa8TmI/wQMr5K0I5bZLIzLOa2nt37VVVbd+dDx5obgCC3KBLwJ2ff4PnVidkf+ucIhw80HQaCLo3DMH3CRK3iFsmAWVl6hPNDwt8EvNE5q+YuEXcMgkonVM6SdyCoEvAnZ8v1Hjx817MilmxSUB5rdLJDycZgUAZUch/AAAAAElFTkSuQmCC)}.color-picker .saturation-lightness{direction:ltr;width:100%;height:130px;border:none;cursor:pointer;touch-action:manipulation;background-size:100% 100%;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAACCCAYAAABSD7T3AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4AIWDwksPWR6lgAAIABJREFUeNrtnVuT47gRrAHN+P//Or/61Y5wONZ7mZ1u3XAeLMjJZGZVgdKsfc5xR3S0RIIUW+CHzCpc2McYo7XGv3ex7UiZd57rjyzzv+v+33X/R/+3r/f7vR386Y+TvKNcf/wdhTLPcv9qU2wZd74uth0t1821jkIZLPcsI/6nWa4XvutquU0Z85mnx80S/ZzgpnLnOtHNt7/ofx1TKXcSNzN/7qbMQ3ju7rNQmMYYd/4s2j9aa+P+gGaMcZrb1M/tdrvf7/d2v99P9/t93O/3cbvdxu12G9frdVwul3E+n8c///nP+2+//Xb66aefxl//+tfx5z//2YK5Al2rgvf4UsbpdGrB52bAvArXpuzjmiqAVSGz5eDmGYXzhbAZmCrnmzddpUU+8Y1dAOYeXCtDUwVwV7YCGH6uAmyMcZ9l5vkUaBPGMUZ7/J5w/792/fvv9Xq93263dr/fTxPECeME8nK5jM/Pz/HTTz/dv337dvrll1/GP/7xj/G3v/1t/OUvfwkVswongjdOp9PzH3U3D3zmWGnZVXn4jCqs7wC2BKP4/8tAzkZsoWx6XrqeHZymvp4ABCBJhTQwKfDT8gzrZCIqi5AhiACjBfEB2rP8/X63MM7f6/V6v9/v7Xa7bYC83W7jcrlsVHIq5ffv30+//fbb+OWXX8ZPP/00/v73v4+ff/75JSvbeu+bL2WMMaFbAlpBNM85QX+ct6qoSqkPAwuQlBVKqGNFSUOAA3Bmu7gC5hNOd15nSwvAOUW7C4giUCV8Sgn5L9hNFIqTsp0GxI0ysioyjAjkY/tGJVEpz+fz+OWXX+7fv38//f777+Pbt2/j119/HT///PP49ddfx8fHRwrmTjV779EXu2px2xhjwtdJZQcAWQIPLPISsMJaSwiD8gzIKrwSyATE5j5nAbR5c1dBUwBlsEWW0h6LqiYsqFPAQxCyRZ3wOSARxmlXMX5k64pQfvv27f75+dk+Pj5OHx8f4/v37+Pbt2/jt99+G9++fRsfHx/jcrmUFLO31gYDWblxRIs/TqfT7ousxJsAxXA2Gc7TA9XdgfdoHbFsj76X2+1WArgI1ageGwA3qupqoHsmcbI6Fu93quggFa9d7LeDtgKfAFHBJ+NEByIkcJ5KervdTmhhGcgJJSZ5vn//fj+fz+18Pp8+Pz/H5+fnmGD+/vvv4/v37+Pj42N8fn6O2+1Ws7JjjP6wraMI5E4RZ8x2vV5TSwkquotV7/d7Tz6HFWsD/qNcdw0CQ3q/321c686TwDVIdbuy73zNldhSHb8I2klZznm+InBS4U6n0302aBFsLhHDAKJVJVglfI9jhvu53W53sLANYNxAiDA6MCeUHx8f9+v12i6XS7tcLqcZW57P5yeY8/fz83Ocz+fnsSmYUyknWEG85WBst9stzSLyMdfr9Qi08iY15UZ0LlDGLhR3o5zK2j7OPUTD0E+nU3tk7Xb/16NFbhloAMuY1zjLUOO3BKeIDe+Z8s3/J4gFo4TM5jPmuRg28foUKKVSwo16TgA5npywcWLHgYl/Pz8/73/605/ab7/91m63W7tcLie0sZj4mao5gTyfz88E0f1+j8EcYzwTPEG2cqjyfHNF0M8fuqEiaOVnRzZZQNh5fwQyHg/HDGfJo89Q1zb/quu5XC6773I2XKfTqd/v9+d3wuqWva/YTdUdEV3fhIv/Viyps6YE3x3r43K5bJQS66zaxVGFsvd+//j4aF+/fm3fv39vt9utff36tf3+++/tdrudvn37ZuNLBaaCMgUzC+rZRiFowxUuJI8YMqcCp9Opq5vagaYU6lGJA1XQqejchw6Cj0Gw5nYBrGw01A2O206n04BGouNNyTfp/FwElhUey6nXrIKw7QQWddxuN2ldL5fL839gSPF8ahu/JvBO48CPSuqMf8Vp9/P53L58+dLu93s7n8/tfr8/39/v9/b5+TkhPJ3P56mQ436/j+/fv+/iSgbzer0+AZx/5+88bv6OMda6S5z6kd21fYC9dxv7cIJJ2d9AOS30fPMzyHiTM8B4DF6XUlYHp4KQW3W+1t77MNB1vGHxWq7Xa7vf78+y5/N5A+H1et29xuP5dbYtyaRu4AksbPq6936fjRzXRxBbPr/b+b18+fKljTHaBBBfn8/n0/1+H1++fBnn8zm0sB8fH5u4cr5GuBhMVk0EEn9RsctgVhM+ixlJtMA23R8B6yysAstBOgFXIKKCMIgToMqNEu2fYMH7ztc732dQKkCj1ytAZtY0Kx8pIr8GGJ+AT3V+2Hirhl++fBmXy2Wz73w+b17P8p+fn8/tUwGVleVkTyUb68DkfayWY4zxNRihU4EpLJPZVrK+u7J4/mgfKqeLW9X2REWlItL1diynbDDb3+jXgYjQqn0rrxWc+NkILP7F7xIbMvx7vV53x40xnlbWJF12ZSag/N0pW6t+ZzmOMzHjajKwDfond78zYTdfq18up97zr2q8v3IioBprRtBl0EZ9og5WBRGOdOHjIjXF7UotFbgOWnXzIJyzYvjG5IYgsmMOxHkz8OsMSrVNWeq5T8DaOcbEv1Od5rbs9aO7YvMet63EkF++fMExq+MRl4/L5bLZN/+ez+fnZ6KazuMqXSQVO5spJXflHAIzes/xJseckRJiDMog9d6VfRrqXMr6KpVV27jRwJacGovOAM1zMdQMnwK1AubK63kdCChvI1C7g0z9nf/D+Xze2Vj8H7Gx4P9duQlsYCrqyN8XqG3Hm/10Oj3jw/n+crlstuM+jPmmxT2dTuPz83Pzt2pn1XsEHX/bnPaVqVmh0xwOt0o6XLLAHePUU203wHfcrspCwmV3TryB5s0Mseeg97x/BwzCjBlbB+pRAPla0BVQuT6V6QHdBlj3d0KG147b+DqxQeUymDO43W4dQar+TIjwmAd0z8/h65vf0/yLv3Pb5XLpru/ydDo9s7ET0I+Pj6dKK9VUEIeKWQWPAOrJ8LKd4vE+t91Y3e7UFlWatg2VwJnb+HPmtvm/sfK59/OaWF3x/eP1UPHvA5DDYDpYXfb0drv1V2DkBkxtw/tEWVVlXWdC9pFYs5/jfh9dS/16vW7s6lTG+TfqsxSJHxkXXq/Xdr1eu4LsfD6P3vsT3N77DkL+zPm5jSdKL4zR3AxQd6rHkLkYlSowsrq7znzu6wSwdsMJOXmA5fBcjxtgMGBYHlr5zokhtsMCTgXLQOW4XC6dEyEMprL8mAQzXRgduix2yZzorxkYsDn3hB1VeMLGsXsVtgl2pW8S3svk0vw7R4hNaHvv4cACl5HFzwIH0Kc6zu4XjDPR/jpAVxWzO1Xk2DDb3vTcxeGU1iWZHkmIDWziWKvirCJ4Dravs6IJ/GG6cTqWdXDy+fArQDVVkLqkVjAoZIITdmmIqXwqa95N3+MGYoZQdRVNO53Y1xRkhO16vY7eu507Ca9lJnbGpxOemQhSw/AQsmmp5zU9BiU8G6wvX76M6/U6Pj4+do0Bz4CpgiknTUeDqwlKBmg3u4OVjrZ1A+rAcgaejWq6eJCvCYFDONSwOgHX4EQRw8lxbzDOdEK6gZ3Hk1b+8g2o1JFtKXyv/fEdTXuWjWXdAZiBp6ADeDrCFiim7B6ZFneeI7Gvm/PMkUDX67W7xI8b0D7/v8dA9qfN5oaCf74WZjH0mf1cmfY1Y0JUFmVrTWu8uzkNcLtEj7u5FXBTkfC6GOA5q8YMxO8KVvF6sAVGdcrUbsKODcQKkLMOMdmlxum642YrPm26AlhZW1YB1R+rrGswE8TaYAWeUMxdf+WjwSvZ2Ef3ytOyfn5+PpVPAaqOn43MtNBqvmjjxbjM4lZjZY4gqNMI5ktaW/sYKNwS+9lFQzGihmMCKPa7+Z0V6Eb0GRmobtpX8JljWu5FMLN5ja6hG9kwQgZqf5+1NH5UxzkFReCdWhJ8XdlGUkxO7HRlYRm4mVO43W7ter12TPJEw/rmEN3L5SKHIWZg9mz+pUoKOYq5bJTJdX2gme1UcxMZQFaEQIlHct32M+Y1BzGkGuzfiyAN9z+ugplZ1symCrDCYYkGxDTpI9RzBy0rHyeDUC1nWaeUaD9n4xkNyYMBDZtzZ3B++fJlY21XFDOcARJlabOyiS3uCpLI9jrZjCDkaVvcCCjwognKShWdzXZWlZMvVTgD8LpqlCLrqgbcB+qYwrgKYpT0ccCqbKyCValkEabn/FynogCrPKfqf51xJ7sGB2ZXcZmxoSOztjx300DZi7a0/2AIR0UlBag9SuDw6KcAzlaB7vHZvWpjK90dyrq6bKyDUZQbR0B05biLQkHIcSUmgIK+SwuqgHCnoio2RQU1yj+BnBy9pphVKLGyC7ZzFK1pxWK+E8IhVCWLN/uLtnUU4ayoYLoaANz8FdtaSvY4pV0BEW2ls61czqllBKpTyKgMAhrZ1cdc1RROtPmvWNkdcKZ7ZKxaWjiPLJMpp7OZKxA+rqG/oJLjxf0pnJlqLoDZo3gyU0mKGys2taKecj/d1C+rJSplBqlTyAqgR+D8KjKlmRL2gtUcAdCtsL+ijCNT1oqqqkH2OHEbG5sDFnUg5Aa+yLou2VU1ptj1S2ZQqv1ORZN9IWzRfgaRBxKoBE8UWyqlJFtrIc0AxNjSjed99CTY/XDfSzCz5M0IZoVEsWnPFNTsl8ooVC1TzbGgqFZNDSgVwKK+1sGDMKqxZCWGVMDysiEr1jVSQJUYwj5iHOlThdHt44SQg9CN+nl8D90NMIgAdgr46JqRiR9I8vRdFvbr17m/yxUMKjNLMiVUADwu2CWGhhi+F55TWM9M9cogzms1dnM4uOF/LAEYWdcqnM7yFmyq3IfwmOROd7Y1iFWtOjoY8To41mTV5IysgFFuRzsbWFGbNIIJCDv1dOo4lZG7jWBwRFtVTKuWyeCByJKOan8oZ3ep9XddNl0tDuaywLz9cXPYeDAA0SpkBO9sbVcTOVWldPv4uyzEkzxHtjvonHoSkFEWNoo1d8DhcQputd2ppNon4BzoAiJ1hBFQg0dVtdbGHHDQWushmNEQukLM2QO1G2Y8bgTXqFhcBJj7EjPgcPts8US8qPpPB/dXznOh5Z438tzH5ec6QgrOKrRRfKmysBmUDB+PhYabMlVPER+GCSITTzr7am2tArH3bgcEzPJm+cr5jJ4NnHNFDVrFXcI5Le9k5Jnw+bedbV+FfRzZIHaOOaOsLY0/7UGs58DjrGwKMIMFIGzOEW1/jGsdAtCN6hEAI4hBe9YXeRROBSVPAVPAqvIM5bx5hVKWAMP6zBRy3iescridVdFBinBxXDnG2GRY2XbCvp1lhvGtO9Bxu5h908XQu42lnSArMFdizMim8uwRCxPGnnOS8lwpnbOiDqTAjsrRN/PcoAScCbaACqVM40ylnjjTBs+bwWlAG23/UKbdkiwKWIQPGzWaczpoSlxPEj822cNWkpS7FyzsDrqpfgpG3jahw2vgbaSQAxuLWZYt7JzyNe8JoZpNAcvDFOdw0wqYT9AK1rZz/DdbSlLPp0ryIxgQJlK9AZlEq7IOXpohg9PIhrCng88JsOxiV4ZWAYfg4sikx/8ky2Z9l862uqwrfscIH8+ugTmVGyiddeVYUgEMn4GZzg14EwIsh9sx2cKKiWXReuOE5gzGOQgdlRKVVdlevqb279Xq0Qnsts2VDaBO0coezsruWtHApu6sKG4IBhN0aGU2kLrMKGRTN3HmbCDwKV14zvkMEDG4QfZVspVlaNU2mhc5TEZ3N1h/zqTheuLpW05ZWTGVjb3dbnNmxKZBnN8JqidaVLKAOyARNLS+MB54Z2+VaqoMLKroVBlngefnTPAcoHNWCSvlfA8CI0HEmBNBnBlXyMrzU7A7WVm94PPqQ2gmqKx+WDGsnvilmcSOBJqOK1nYyAIzuAyesq3UdSK3KfWcYKD95HmfYOU3qser2CtYEUA+FpfqdNvgPBZUBhDrGONRVlQsh8rLcaUCykHG0OOUwTlLBrsh5soEMGezi1E4HRVt1icp5wZEFXdibCkG8Y8vX75sbO4E0iom9z+hjSiOfy3DhpXItpVhE+UGQdvoWjtChmrGHf4YAzKgBNnGtuJxFCeGdhUAfQLLK8kBYAP6gvFJZajMG3Xkycy8KuC0q4Eyymwtwdxdv2M0mIBtK0LKnf640j00Auq4gUkdWGlhs22qJc6dZCsL19oxnlTJG4SYVRIGpD8TPFBuM6OElbS1pldid4mGAyN6ZIupbC5bXJN9fdpbThSxLUaI8IG1XIYBxW3Tjs6KQosKcxfxcQmdnwRGM10GnFcCy2XYunLMyAkdgk4mePiczsLygthcBut6goOqS7YVFXADLjaosB6s6ofcZWAZSIRYqSUkizYwttYab3vUOQ9w2HRxIIg8WwRVeE68xi4UtL3zRphxplzwuZrcqYCq1I3jPI5dnJIygEohMbPqVJSzrwzxBJTs5zN+ReUSgxikPQVF3JVBeNQxbHENrEMNvEdFZVV9lH9+ORGEsNZQpyTNc4C3AG7XF4ngzq+DrO2zbuaaOXgdaFcdkEotoSFBVX2qJ0C8OWZeG4KGlpghA0XfTOPCqV2qqwQ26QWfF2PMLhI2w1lVAa2aPsYd0za25MQRwgcZN6uQDCi+ZxiD4XEM2kZxOT41FnZnaRlcpZouzlRqqdbQVWopQoSB58RV50lBNrHi/AwXS5LrwDVlpY3Fc3ByiYGc52Trist6kOXdwInAQtJpp5QchyaquYOV7Su+fxVMaV3dc0RE2S6mUY0gLt2pMcYqrKIQ9w2l1gpQUMtQYcmmbt5DTNxdhnUCjQqtbK9SUSzvrC0mmhhE1e2FS2+oxypy/ZASutkmtjx3vcBC24PX65nbqkBCRhfjS9kIYPnee8cMagVOhI/3T1fAmdtAWZsCswTJCkQVNa0qWKSKPOpHAUhD9DrbVcyoYkwqhvh17vYAayXLQyKGYdxlUDFp494rBXRjYgO17DDYetNIUj/ezp6S0lnlpEwsWmJMkOwsKXeZKEAjIHn0EQJISaRBcO6UMINz7p/bEjjnw4ft+xmDvksxX4G2rIris7qaeKwAFMP2Oi7n4criuZwtpSUwpfLxSnORSrIqusc5ZFaXysqRWjiZ2DyAWEIL35tVSoQElFACjOeGGSE7AHEQgdo/LSvCOgGBvkxsmDbvlS3Fp5vhaB2TAGqRKrKKMrhLVpaGzEVjZ0OQxDhaCTA+QyRR1d15aQzrJntL3RibsipjG6jlgL4yqbS0sNYg1e84vhbBVrElK64CUcWYXDfKxhpIuxiVJZUxsbMy/uRBKTNRQ4kQ3LdRYLS0rJjRPlTPqY6gdJsEDc+aQXAn+HgsNUCbRuF0Oj0zwnA7bWDkbhO5Ens00qeQhS1laBMl5M/cAaxsLF8rKyql+Tf7ELLEGu/ixiimdCvo0TjfpjKwaggen4eh5v7LokLKbLuyvHhcZG8dhGrEDx7Hg93ZppJF7qBqO3iVveXEDQNInzeoe8Yq6ePaZBZ2JviM3W2UAGotekRCAGq4EkF1X3DOnR11yRsBL1tRa0PVcZiNFXZ2c34FskvomInQQ6lzpJoZbJxk43NwKJFBquJSsrByHydxKOnTxQASBmS3j+JMnsHSla3Ec6K9VWoJVn9zfjwOM7hqYAAqJQwE2a3nA48J2QGegRkpZNivSY+ys3EkKd4oJIwsvIHl3cWgLt5k4NH6OmtLWdpurOkwEMupYc7eMtDRhOcI2ui5JhVIzXzLyto/GAPuZoyo8wkoduVgJglCt7OhGbgID4Mq4si+63zUS1FuFFXFlqyaj2emHlLMcBqYu0FMuR28BbB7lOxRMSiCQXFhCKuwkhZ+pYDiGSgbsKKV8MiSRsuHSIWM9rklRiIlZZuqXjsQK8ooYJMgq3JKWVkhHbhsVxFUzthOWPkYijcbx54IKsSdT+uLr3crGKyoYgFiGR9iBk4kfloUX+JIlQRQqabmpgnhqtpQpb6RVQ1WH5DnrS4hEoGZqaerQ2dhFbz8XePxShmDbo70eISjoorO2vK8SJXI4SUmEU4zWKDzUDtWTYw7xXlbSTEj4FRg7zKnKoGRALv0Gs9Tgc1BpCywGZRQAtqVz2xrBcAMzEpfZwFSa2G5W0QBFjSMapWAEFa3HcGN7CxDzECyIkJ97qwrqWNTWVo876PPsjPkj2wvgroM5lLZKMETKVql/CvnWVFiFa/SzJUQwkoZsr67Y6vlSRV3/2tmNTOY3vnaxYwMuoPKqdzR1w7IqHymlPxaAThfU7Ko2ZXYj4AYJHL+kNdKwRQYESTRa5fsUZ/rVC1TMTyWVyYoqNtuzaHsMyv2tvoarxdfqwYgU1axFo/cnql1FGsqK+uAROV8BX4GU8WcZTATi2q7Qcyi0O0V+GhWBMNRUkn8H1SsWVE5By3Gi0ECqUeJoBfAtDa4amkdXG37AGP5Ggeb84p7UazpoKRzdFzeQ8HkoHGxprKy/Hpm5t12p47J6xTYDEz7uINEXSuxYXvFskYAc+ySxH9sf5ftKzU6IbwVBcUGg5e5FMCEXSErZR0wGayV19woM9guPjTqJdVTqR4uE4nJnLldWVkECCZLd2VLF+xtamex7IpiriSDUpvrpn9lrwGMCHyppMH+ps6LILsuFGUj1XEOXiqbqSHPUKnClpWV68kqtURVNDY4TNaocykoYeTU5ngGEQa/S1DnnE4AeXMcKjHPAmFVjCBENaeyLVNHfr3px8xUstJ94hIpfH4HKE/eDaArK6lSyVVFbdt1gxTIVk3pppVlFXi4pEhVBTObquohU85MLXn1iahvUkHJjSCMc01tLFveVVBx0DodM6jftCu7DOtIzYxrc0qp1JGP2ayYFz2Gb6HvMrO8cnGtV6Gjm3uImSfD2GpWK6uowbZGMxFKQCo1pOMtcMXFpRst+hXGoAomF3sSTBGgTglbBKWwsQ3tZqaYSp0Z1CimRDWFcCJUPYJ00BI5FkKYNoifuQxmN88SWVXWLMaUqqqgC0BmQJR6sk3u9NCf6jYLXxAfqsYEgVLAhRY2AtgtflZNFmFyhxdrLkAdWlk4D88M2ixHyepIdhMHrG/iR1ZGtq0MGpbDbRPYOXeSY1M6Ny4ZstvGSktK+XbFPATj2D371saPEsAMXhXrsZ0km/XStkhhMyBfsa6uXFZe2VCe+YMr1+GKgwrQyNYq1VRrB+EizAow6NsdNKcyVEkYeM73ys6q4kAHp6BiFklTkIrVC5oYV7uzwOGCz4UJ0Stq2lWMJy4wtb+RetL6tZFicnJmBw5UjCvXXMZVJX2MQkbf+XN5EWd78Vz8/JEsMZTBiKNzsm1inLRUQ74H4NidaqI68j5sAFgxcRveC7ieLJXfQYxjZZ2CsiWFewZXJmBIlZ1tdtrX4hSuateKso/RZOtOKW2nmq1oTzeK6dRWAWu2NRVb4hq0SXm1GvtugHrbr5IXqmSktg5CuDE2MSlPwsY5kNE2Wp3AqiZbWVLAxiBF+2iBZbuNj6MB6rsMLC7FyasaYDyo7KkoPyEtw3pEMXfPvxAJi2jAQQgjrz0rLIZSWZlIoNhwd5xK4AR9mYNjWAaLrnuImJeBVN9zBORObVvbr+mTTfFSEJLSRnHo7hEJoIi8MFqjxmvgmF5URZz4zLFgZZ8Ctu2X7ggVccKm9gVxIsOHqxXgNMKnFWZYnf1dBnOhayXq17QwFlWW09eNKyVJFmXqaONGA5aCegMbJ3UUkGY1ic3nKWgjq8qfVYGQG1gRt6rs62a6HiqqUOqdesK5NmX4nGofJoiE1d0dF9lVVkvT1/kEEaaCoYOwFpcVcoLM+7669PxC9rWqktH0sWUYld0VCpuBZ/stVRcGgy9WX2+U1Qthi9SzAqSxzZsy+OiFzBYnySGV6Gku44rD8BCOZBV3BvD5+AKRHNwMEsB6EzHnJpkTAeiUlEGkcECeB6GDZTp5YEJTlvdrknxYjTllMkfNtXwDjM7uVjK5JXUUn43rrqpK2jytaxHW0M5G8DC8rtHMYs7KSgduVQMGTYFqFvVS6rkD3sDJ46afdYFwoq11AOKCBLhvwoUgc8IGANycR6knZrdJPdsuxnyjfd3FovTlRMdEdtOl5CMV5EHsXQBis7TOwvIDZaGj2Vnpbh7cpK63VwYEMLwqbjzyl699sawFFkF1yqjUU31HfC6sW1ZFVFuXVXVgz9keEaw0ys1lWfm+azQAQSWA+hKYVfsZjPncAcUB9oIayy/UZXRNckDGji77GsWbvBo6tPrWPqOyVkBUq+INeqpzNdYs/u0ifh5qmpqIW+33JVSUcwY70KL4U9lYdU6ljtSls7lmfi9g3YzeQfVkaGFaV3ODCnaD2N8wsEDFklE3RzM3ZghdYkWHsszq70FIecnKkVkt8ezMzRq9bkGuKojRLBVSod3Y1yPqKgYW7JRQTPVyy5xIYLjOgxgT52RKJUY1dOrIiRd4futQx/A5AcSmEjz0vFWrkLzvbWAu9HOWbGgxFk1VNTpnBKk6TgwisI/HcxYXP1uAWO72ULFlBTq+aSu2VTUs6hrxM2CF+hEor1VIA9ZmFUaab1lSSgZsVs4sxzHlVLoJHr9H4DhONTkI1XC0/wiY2NoWAG5RlnHFnq6oLccpQddMuJ/O17JVA5OHLi0BqCztq7Y1++ucCd98qLI8MIHBV/cKjxQTme3hFBS3MyCqnDsuym2o80HjvFFTtrURmNaGJsmVahImjTsUXKtQZTAVs7Mvv8/+fzUrZAXcLJ6M4koe6XP0b6SmWWNDzyUpQ8bl+LtWx4tuqZ36cRYV3yuVxPNwvIiqiQCSmu7srgTzR6nkyhpCarXwFy1vGd5iP2cY06lFr5Njhhg1Y6+NB28ftbK83s8rf7kLJbKwDFPbLg25a0AdZJEiqr5phixKMDlRUtcssq1hriLqGoH+zeNgVm9OemjsETV8JdF0NHnkIFxWY1OB4Yrp7rtWJ7NgAAAPXklEQVQ3oNs5nplyVf8u2FoLu1JrHveaZWQjqAkshtFa2gzsSG3Zpkbvg3HafF9slPPlldjFlK80Gysm8Mr4MPhneNWENPGjAIpmilTPATdTRTXlCBYHYAQuPwA36xIpWtGN4q3Y2MhiGsUpuSSnlEJRD8PorC7CFYVw+F51qThgabxsTxWzCGY0ZSsb3lfqAy0OPNjNy8xiQQKsHYFQ2HBZVvVbBuq3m1oWKajqaonsM6uZUr6CjXWNZ0l5E3h3jURma6kP3MJIiy1Lm+kahQq41N2iZja5sjtlLYNZHZrH6qUGm4vMbDp6Rw2CFmvuyFkrBcCyMtFqBaECmsHoK9BZ2LA/lJcRqSaDqnaWbrZdGaz3DLgIvBln4woGztbyJGqslwxkhhHrTjTYFXCtOoKS8uLdofVdAbOylGU6nlYpXWZts4nXBq6WxJitMNokHUJnbnJplQm+aGpY2a5GMV2QD1hRubBPFKdumf5OHkLHz0F9luE5kjBjRa0nFE5CUGqHw32MmjZ6xkgINVnSnZ1VZStK2qKlRaLlQgK7uTq7JFXJwM+3SOEKyhZNI+tJ0I5qMYy9k2qJD7dVWdqKXa0CKNR0Ccjg+B2IYu2fcBZJZkMFgM11r0X92wilghFGgzVnexlqB7xL9mS29SiYUVY2nXOZjNBRsyDsQPRWW5hrZ4XcdC4HVWRbjgJr4sFofK5SzjQ7rhI1UebdPdEbj6sqIvTZQZ5va08rABsAW0UxeWytAk7A2KJ9ZpxzCioB24XFtYAeXYxr6anSqhLgppEqWbGwLunTgrV+IjWlL29ljaAl4EQMGsErp4apeZiquwRXLXAqOCeru32mmydc6oWTSWpFAGdzeTB8RTHVMEtlM90CbbQCYhPjq3egYr1FGdYIQjiuDGZ5zZ/AzobKGOyLxti6c4Rwtv2anyWlLICnlLhxJRXt6A5ebDBWFNONbxWZ2d02mnu4S9YECpeppV1zSWRBWxHYzVIv1CXSouwqqX3jBBBDZdYQbpTQW4ZQlS8r5kH4suSRmg2++3JN10x1PaAmEkmtYlEdeGpJEM6kOuCqCR22oSujj5IV2HdT0zj5prLKTjXFAPjdQlyq7xIBxAQP5yMczG4VxAKw0n6ilZ2QBce2pLulkuxxqnoIzFfgqyqjil9S1VNwBrFmeyeops8yOjZUybZdfS8CuaTIJumzs5tODaNtLpFDQ/PcJGweLhmeL1nB0KqiUDScsiUVD89Di3HtrKtSULw3RLiygZD+7sF8JTObgYsrGvDNUFRGl1iy0Ll1YkUc2aJYMog920I8qW6YDCg1Mqk0JHJFKXkbgbRreI+qpYNOZHrVcDUba7pjsphSJNtK6upgRNAVoOS0mugBeN4bIZgHhuPZ/s1ENaX6KsVr+YNrh1Nb7ipR0PE5zbNRegCbrHRUw6Yf07dLBJl1f8KB9as2V1nNqAsl62LBBhehwalerkHmB1JFIEZKSEusdl5JQj1nJlHXSCF342gJ9CYGrXelknJIXqVP8sD+qtplCR3XH2qfKq0ygMp+KnVkKxNlZ8m2YkIlVMiCnXUwl7qznBKSvQz3m3Pt6oQbXO5b5FixCh/fHxUQW/AEcK6zCNqKQnL9sywqmKuwvqSYzT/aPVNNpVyhvRW21aqciCsjdWvBwILUvh5VyCzbWoC1pJjJ680CWsl+udKB6T5RwG1mlohnlpbg47iz5U9ha0FGtmRLFYBtO99y97Ap0z+ZDTAog6kSLZsMHg/IFkkgp6CpvU2U0cYVSdnmkjwBdOmXbxTWNWzuIbipMioVxEckZEoahSOiy2M3K0jcC1LhVDwaqG0ZvkcWqCnrG4GIxykrqlbWdw6LQyBaZR8HmLRIhQWsHswD42ZXVLNkf9l+FlW0HVQ2lwFsC/Z1FdzlQR0KaPfo+Fdfu+/dwVRICu1CGR7AEIiAhc+AZUF0kOBaPxmUqg4i64vQnU4nFDYJ9Nz+1fVXveH9qmr+kPILx8oKcRV/BFbxbE0JMT0kSD4w6L/lNY8ocsqagVdU3A3MjxhxcGuqzsPH4irpaow1q6OyrVjvp9Npc59E91LldboYVzJWdimWfAW2SNEKcDaX2FmBLLA/uKxlmhh613Is1URQApbKfttwxL02q6Onx5pQxSbPojAg+v5hAnN6LHVRDXIsvKtRjiS0qJUyZTAXVbAK82ElFJWaQdVoqUC1Unt7BVaTQudM6SuqexjQJN4+0icaxv/utbKv83ETbT8H8gjcOKxOJmbUa6OOVXht3dFY6rHv9XoNzFLceEA1o8+pKm0LAHPHZ2rYKjFq0hfZFixsqHJgD3eD5n+U0kb1mFjXkn2lvMSSOsNE/CdIAKF0Sytq6urOHUN5gwg4GZosgbmggM5ucra2qrS2Ig1cbiBBcxYzgzUDNLCvL8GbZXNp6ORy3LmS+Kk83zRIAK6A1ioKa2I9NapIuiUFdfC9766PFZUtqUr6KbWk+zZU1a/ZrIXEztrjTOfz7hwKziCeXIaraHtbZIMz+2pGgazCmw4qWAFvEdhodYp0Xq0pV7G1YWYWbO4qhGq42+Z8BYtrLWvluNPpZAeaFFS1vubPgbgxsqcpnAaszBovKaFoDQ8BGtjfUOl4NAG2nmQV04feJgumvX2fsrQEWZghL0JnVdYkn3DOZIeRN86RqPWCmsvGVqEMRnwxQAxwS8EMYo3IzmY2+BCcLp4MKiuyuhImamlbZFcNoNl7tp+RHd18ZjQIRKyXdFRhN98/hyKqwXWNo7O1wiaXoHN108REZZWEq6grnIfjzeg8jdRf1XEL4kkXa5bBjKxoKaljBjeHlVxQ4GaycpW4lDOAKtnTxHAtOfzOtZwHAM7sqVXkV6yu6kap1nHkXKqWF/4XHqjenNKqBjpR3l1ch3Ejg1+EsgdQhsdG0B4FM9sWAVWpuAyiwTPleZxt9VyZVS2qXfReWqTAilpr9ApoWTjxymit7NwV4JTriZyOA9B0k7HFfULourmKYHVnRQvqGL5HMHdqFcR2qWpmcK6eTwx2dipWrviDilr+fKWq3OWRWdHKwA4eu8wjchbeRzFilqjjZN3ufCpfkJ0/scVpnYk6L0PI77lxdWCZ87WiWm7B/AGquQSnujGKsB8CJmiJq8q1pKIVWyqOiTK66r18BN8r74/AE71fdC3yPS2MxdOpnE1tlVxD9JmVOoggN+r4PjAXVFPa3Eg5jVJGFVUGNolH20GVrUB7BOySWq6WqYQdWR92pcFMYMwckbSgCKCqD67DiiWu1g8MQC9ByfcFqW1L+jL714qNCuznoSxt0da2gtWN1G8F0BK0NN0nuimelUF9dIdAfjO44UT3CjQLoUeLHJFTO3gmpRuIIOvwBQCbqNeo3qtZ9iF6xVK13GRlo4zqimq+CGdTiR1uRY8oqgE02hZBa79kZXPMquxRHKla2saZWN4mRqZUj0vLCKhkjKnqOQHNuSZVJoKvAqS1wpEquvWDC1B2ypwrCPsRMEPVTODMLJMDv6qeKXwi2JYV5Sq4qKyvgGsHCLiuj2jR59V8gMqSJ2FJZRXEHVRHj3sFPrct6OpqlW1GpatQdt0GvwfM6n63InsGVFhJGaBqgqqIV6IsXllZgySPq4R3bnt3wi5cv+cN2yqQLW1T95KYVsWWtKk4cB9W53WQQflQYR6Wl4HaJZjvVE0D5yvq+RKgZCs5qdBEP5sD94cAvQLlSgNaSMAtHx88BuNQ41zdFsX30zKbcs0MLD/ihkpQzl0wiTqKLTfbKmCmyYICnK0IbaieC4CG9iSyLQ7cIMGQwau6TKoq60Apl3WN40LZpca1CKKK9VQyyIEn8w0F8F6CL2h8o3ixGwC7s7EWzCOqmcApYxYD4jsAzVS0sl2t98pA7vrKophCVSonbYpgH6mvSn24pTBV4sdtV3BtMq5k82y+IADvUJ0uAlkCVTxIaPm+UNu/qkV4F1TzHXCGrXIAqItBKypqK99VtAOVs64O4ObX7pHLVCpYHcRmwvLR7TvYAKBBN58LGVzDuFz+hQbWgncQyCZAk+VbsPSouf93261iZgmfCpwRbAvqmSqriU2PwhjaoOyYqtIegVXViTsmyta6bGySpY3gyRrpIyAeaWDDxtpsXwKyalMDKNP7YBXMqEskUsi2uC8FNAPxAKTVfT1o6VzM0E0jF+1rWcUuHvdyg7vgoFplX8HpvHpMCOMRUPHzZkInsqlFKNX/EIO52E0SxSzOwob2VmRLW5D1XIU0rbgM1AzWgyC7fe8G7xUAK/taEBat7luqtyP7EmsaJQOj5F+mrnZfCuYCfBUAWwShyd6pMY/vAHG1UqOYpbI/gy5T0CMKm+UO3gFuC85dgfDVeguPDfITrIBLsLrcgdh3CFgFZjaKJ4Iv3F8ANEqvuxR1tVKOgLoCa1jxboBAkj6v7j/icFbA7f4rfRnQDLRViG13i0vqBQrYVqBbADZT0ZpiHoSzvQpopKIFS3sE1HfBWlHXd0H7LnArqvougMtljHBgZnh3Eoz/BKjLML4Z2Aq0+hEJr9jaVUBbvNzCIUiroC7AWmmFw4o5AK3MtB5VypZMSFgs05JyGVwlwBqsEGAAa2ZU1CjUexXGsE4rKriilBvFzOKKo3AuAroE6QFQU3u8YpNXwS5k+1TZt5UrwouN4KiUEw+k3ZWDp1RXHNRqXb21Ts39945yZSg3VnZFNQ9CF3XeZyr5DgBXKiwCMa2MxeTDYXgP1Fsf9QNKZc0k81RJk3r6EQ3rCmBVyLL75EjZ1pIVDHoFtiOAHoB0BdTVylqBsKKKS+AeBXJVLY+CXASuGvO/Auq7GuEjDfGKg1oKa1z/dmmi9I9SUGNhl0AtfulHAawoYrnSkmNXAVuGEhrEVXvUF+A5Ct2PqNOjDetyna4CmeUolmeXLN4Aq7C5Sj10Q7yjgl+t6CNxSRHmI5X+CpwreYB3Qfdqna4q21KdBuc4GoZsn49ZOOiVinwHqK9WzjvgeweEh2AU5+vtxZ9Cd9Wqkh49V18E5oj6vVyn0RStAyGIO5edXRKd5B0VGVXq2yr3xYp+5Ut+C4QJ4P1N339pQMjRejj4vb/Dcr6rQc3O/0rjmtZpeYCBiCHfCemRbNhbK/pNUPc3wfKy5f2D7OlL3/uPhve/oU4T0F8f+VNM2vyoiv0jK+KHQfdHq+0bncz4oz73/+Y6LbKw1o/5B7eOf1Rl/0du9B9tn/9bvrf/j+v0h6ttn2tp/r/4819y4/zv5391uvzzfwDifz6phT1MPgAAAABJRU5ErkJggg==)}.color-picker .cp-add-color-button-class{position:absolute;display:inline;padding:0;margin:3px -3px;border:0;cursor:pointer;background:transparent}.color-picker .cp-add-color-button-class:hover{text-decoration:underline}.color-picker .cp-add-color-button-class:disabled{cursor:not-allowed;color:#999}.color-picker .cp-add-color-button-class:disabled:hover{text-decoration:none}.color-picker .cp-remove-color-button-class{position:absolute;top:-5px;right:-5px;display:block;width:10px;height:10px;border-radius:50%;cursor:pointer;text-align:center;background:#fff;box-shadow:1px 1px 5px #333}.color-picker .cp-remove-color-button-class:before{content:"x";position:relative;bottom:3.5px;display:inline-block;font-size:10px}.color-picker .eyedropper-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);fill:#fff;mix-blend-mode:exclusion}
834
834
  `],encapsulation:2})}return ColorPickerComponent2})(),NG_DEV_MODE=!1,ColorPickerDirective=(()=>{class ColorPickerDirective2{injector;appRef;vcRef;elRef;dialog;dialogCreated=!1;ignoreChanges=!1;cmpRef;viewAttachedToAppRef=!1;colorPicker;cpWidth="230px";cpHeight="auto";cpToggle=!1;cpDisabled=!1;cpIgnoredElements=[];cpFallbackColor="";cpColorMode="color";cpCmykEnabled=!1;cpOutputFormat="auto";cpAlphaChannel="enabled";cpDisableInput=!1;cpDialogDisplay="popup";cpSaveClickOutside=!0;cpCloseClickOutside=!0;cpUseRootViewContainer=!1;cpPosition="auto";cpPositionOffset="0%";cpPositionRelativeToArrow=!1;cpOKButton=!1;cpOKButtonText="OK";cpOKButtonClass="cp-ok-button-class";cpCancelButton=!1;cpCancelButtonText="Cancel";cpCancelButtonClass="cp-cancel-button-class";cpEyeDropper=!1;cpPresetLabel="Preset colors";cpPresetColors;cpPresetColorsClass="cp-preset-colors-class";cpMaxPresetColorsLength=6;cpPresetEmptyMessage="No colors added";cpPresetEmptyMessageClass="preset-empty-message";cpAddColorButton=!1;cpAddColorButtonText="Add color";cpAddColorButtonClass="cp-add-color-button-class";cpRemoveColorButtonClass="cp-remove-color-button-class";cpArrowPosition=0;cpExtraTemplate;cpInputChange=new EventEmitter(!0);cpToggleChange=new EventEmitter(!0);cpSliderChange=new EventEmitter(!0);cpSliderDragEnd=new EventEmitter(!0);cpSliderDragStart=new EventEmitter(!0);colorPickerOpen=new EventEmitter(!0);colorPickerClose=new EventEmitter(!0);colorPickerCancel=new EventEmitter(!0);colorPickerSelect=new EventEmitter(!0);colorPickerChange=new EventEmitter(!1);cpCmykColorChange=new EventEmitter(!0);cpPresetColorsChange=new EventEmitter(!0);handleClick(){this.inputFocus()}handleFocus(){this.inputFocus()}handleInput(event2){this.inputChange(event2)}constructor(injector,appRef,vcRef,elRef){this.injector=injector,this.appRef=appRef,this.vcRef=vcRef,this.elRef=elRef}ngOnDestroy(){this.cmpRef!=null&&(this.viewAttachedToAppRef&&this.appRef.detachView(this.cmpRef.hostView),this.cmpRef.destroy(),this.cmpRef=null,this.dialog=null)}ngOnChanges(changes){changes.cpToggle&&!this.cpDisabled&&(changes.cpToggle.currentValue?this.openDialog():changes.cpToggle.currentValue||this.closeDialog()),changes.colorPicker&&(this.dialog&&!this.ignoreChanges&&(this.cpDialogDisplay==="inline"&&this.dialog.setInitialColor(changes.colorPicker.currentValue),this.dialog.setColorFromString(changes.colorPicker.currentValue,!1),this.cpUseRootViewContainer&&this.cpDialogDisplay!=="inline"&&this.cmpRef.changeDetectorRef.detectChanges()),this.ignoreChanges=!1),(changes.cpPresetLabel||changes.cpPresetColors)&&this.dialog&&this.dialog.setPresetConfig(this.cpPresetLabel,this.cpPresetColors)}openDialog(){if(this.dialogCreated)this.dialog&&(this.cmpRef.instance.cpAlphaChannel=this.cpAlphaChannel,this.dialog.openDialog(this.colorPicker));else{let vcRef=this.vcRef;if(this.dialogCreated=!0,this.viewAttachedToAppRef=!1,this.cpUseRootViewContainer&&this.cpDialogDisplay!=="inline"){let classOfRootComponent=this.appRef.componentTypes[0],appInstance=this.injector.get(classOfRootComponent,Injector.NULL);appInstance!==Injector.NULL?(vcRef=appInstance.vcRef||appInstance.viewContainerRef||this.vcRef,NG_DEV_MODE&&vcRef===this.vcRef&&console.warn("You are using cpUseRootViewContainer, but the root component is not exposing viewContainerRef!Please expose it by adding 'public vcRef: ViewContainerRef' to the constructor.")):this.viewAttachedToAppRef=!0}if(this.viewAttachedToAppRef)this.cmpRef=vcRef.createComponent(ColorPickerComponent,{injector:this.injector}),this.appRef.attachView(this.cmpRef.hostView),document.body.appendChild(this.cmpRef.hostView.rootNodes[0]);else{let injector=Injector.create({providers:[],parent:vcRef.injector});this.cmpRef=vcRef.createComponent(ColorPickerComponent,{injector,index:0})}this.cmpRef.instance.setupDialog(this,this.elRef,this.colorPicker,this.cpWidth,this.cpHeight,this.cpDialogDisplay,this.cpFallbackColor,this.cpColorMode,this.cpCmykEnabled,this.cpAlphaChannel,this.cpOutputFormat,this.cpDisableInput,this.cpIgnoredElements,this.cpSaveClickOutside,this.cpCloseClickOutside,this.cpUseRootViewContainer,this.cpPosition,this.cpPositionOffset,this.cpPositionRelativeToArrow,this.cpPresetLabel,this.cpPresetColors,this.cpPresetColorsClass,this.cpMaxPresetColorsLength,this.cpPresetEmptyMessage,this.cpPresetEmptyMessageClass,this.cpOKButton,this.cpOKButtonClass,this.cpOKButtonText,this.cpCancelButton,this.cpCancelButtonClass,this.cpCancelButtonText,this.cpAddColorButton,this.cpAddColorButtonClass,this.cpAddColorButtonText,this.cpRemoveColorButtonClass,this.cpEyeDropper,this.elRef,this.cpExtraTemplate),this.dialog=this.cmpRef.instance,this.vcRef!==vcRef&&this.cmpRef.changeDetectorRef.detectChanges()}}closeDialog(){this.dialog&&this.cpDialogDisplay==="popup"&&this.dialog.closeDialog()}cmykChanged(value){this.cpCmykColorChange.emit(value)}stateChanged(state){this.cpToggleChange.emit(state),state?this.colorPickerOpen.emit(this.colorPicker):this.colorPickerClose.emit(this.colorPicker)}colorChanged(value,ignore=!0){this.ignoreChanges=ignore,this.colorPickerChange.emit(value)}colorSelected(value){this.colorPickerSelect.emit(value)}colorCanceled(){this.colorPickerCancel.emit()}inputFocus(){let element=this.elRef.nativeElement,ignored=this.cpIgnoredElements.filter(item=>item===element);!this.cpDisabled&&!ignored.length&&(typeof document<"u"&&element===document.activeElement?this.openDialog():!this.dialog||!this.dialog.show?this.openDialog():this.closeDialog())}inputChange(event2){this.dialog?this.dialog.setColorFromString(event2.target.value,!0):(this.colorPicker=event2.target.value,this.colorPickerChange.emit(this.colorPicker))}inputChanged(event2){this.cpInputChange.emit(event2)}sliderChanged(event2){this.cpSliderChange.emit(event2)}sliderDragEnd(event2){this.cpSliderDragEnd.emit(event2)}sliderDragStart(event2){this.cpSliderDragStart.emit(event2)}presetColorsChanged(value){this.cpPresetColorsChange.emit(value)}static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||ColorPickerDirective2)(\u0275\u0275directiveInject(Injector),\u0275\u0275directiveInject(ApplicationRef),\u0275\u0275directiveInject(ViewContainerRef),\u0275\u0275directiveInject(ElementRef))};static \u0275dir=\u0275\u0275defineDirective({type:ColorPickerDirective2,selectors:[["","colorPicker",""]],hostBindings:function(rf,ctx){rf&1&&\u0275\u0275listener("click",function(){return ctx.handleClick()})("focus",function(){return ctx.handleFocus()})("input",function($event){return ctx.handleInput($event)})},inputs:{colorPicker:"colorPicker",cpWidth:"cpWidth",cpHeight:"cpHeight",cpToggle:"cpToggle",cpDisabled:"cpDisabled",cpIgnoredElements:"cpIgnoredElements",cpFallbackColor:"cpFallbackColor",cpColorMode:"cpColorMode",cpCmykEnabled:"cpCmykEnabled",cpOutputFormat:"cpOutputFormat",cpAlphaChannel:"cpAlphaChannel",cpDisableInput:"cpDisableInput",cpDialogDisplay:"cpDialogDisplay",cpSaveClickOutside:"cpSaveClickOutside",cpCloseClickOutside:"cpCloseClickOutside",cpUseRootViewContainer:"cpUseRootViewContainer",cpPosition:"cpPosition",cpPositionOffset:"cpPositionOffset",cpPositionRelativeToArrow:"cpPositionRelativeToArrow",cpOKButton:"cpOKButton",cpOKButtonText:"cpOKButtonText",cpOKButtonClass:"cpOKButtonClass",cpCancelButton:"cpCancelButton",cpCancelButtonText:"cpCancelButtonText",cpCancelButtonClass:"cpCancelButtonClass",cpEyeDropper:"cpEyeDropper",cpPresetLabel:"cpPresetLabel",cpPresetColors:"cpPresetColors",cpPresetColorsClass:"cpPresetColorsClass",cpMaxPresetColorsLength:"cpMaxPresetColorsLength",cpPresetEmptyMessage:"cpPresetEmptyMessage",cpPresetEmptyMessageClass:"cpPresetEmptyMessageClass",cpAddColorButton:"cpAddColorButton",cpAddColorButtonText:"cpAddColorButtonText",cpAddColorButtonClass:"cpAddColorButtonClass",cpRemoveColorButtonClass:"cpRemoveColorButtonClass",cpArrowPosition:"cpArrowPosition",cpExtraTemplate:"cpExtraTemplate"},outputs:{cpInputChange:"cpInputChange",cpToggleChange:"cpToggleChange",cpSliderChange:"cpSliderChange",cpSliderDragEnd:"cpSliderDragEnd",cpSliderDragStart:"cpSliderDragStart",colorPickerOpen:"colorPickerOpen",colorPickerClose:"colorPickerClose",colorPickerCancel:"colorPickerCancel",colorPickerSelect:"colorPickerSelect",colorPickerChange:"colorPickerChange",cpCmykColorChange:"cpCmykColorChange",cpPresetColorsChange:"cpPresetColorsChange"},exportAs:["ngxColorPicker"],features:[\u0275\u0275NgOnChangesFeature]})}return ColorPickerDirective2})();var COLOR_PICKER_PANEL_DATA=new InjectionToken("color-picker-panel-data");var COLOR_SETS=[["#000000","#444444","#888888","#CCCCCC","#FFFFFF"],["#B5151D","#D5252C","#FB3633","#E86669","#F4B1AD"],["#FF561B","#FF6A22","#FF8B38","#FFA857","#FFC279"],["#E2A92A","#F7C333","#FFD741","#FFE95B","#FFF697"],["#2C7B30","#499C4A","#65B665","#89D388","#BFF0BE"],["#0058B8","#006BCF","#388CEB","#46AEF1","#ADDAF8"],["#5E1D8B","#83249C","#A058C2","#C38BDD","#DDB6E1"]];function ColorPickerPanelComponent_For_6_For_2_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",7),\u0275\u0275listener("click",function(){let color_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r2.applyColor(color_r2))}),\u0275\u0275element(1,"div",8),\u0275\u0275elementEnd()}if(rf&2){let color_r2=ctx.$implicit,ctx_r2=\u0275\u0275nextContext(2);\u0275\u0275classProp("selected",ctx_r2.isSelected(color_r2)),\u0275\u0275advance(),\u0275\u0275styleProp("background",color_r2),\u0275\u0275classProp("color-icon--outline",ctx_r2.hasOutline(color_r2))}}function ColorPickerPanelComponent_For_6_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",4),\u0275\u0275repeaterCreate(1,ColorPickerPanelComponent_For_6_For_2_Template,2,6,"div",6,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()),rf&2){let colorSet_r4=ctx.$implicit;\u0275\u0275advance(),\u0275\u0275repeater(colorSet_r4)}}var ColorPickerPanelComponent=(()=>{let _ColorPickerPanelComponent=class _ColorPickerPanelComponent{constructor(){this.data=inject(COLOR_PICKER_PANEL_DATA),this.ref=inject(ColorPickerPanelRef),this.colorSets=[...COLOR_SETS],this.tabIndex=0}ngOnInit(){this.selectedColor=this.data.color,this.tabIndex=this.data.color?flatten_default(this.colorSets).some(color=>this.isSelected(color))?0:1:0}ngOnDestroy(){this.ref.close(this.selectedColor)}applyColor(color){this.selectedColor=color,this.ref.close(this.selectedColor)}hasOutline(color){return color==="#FFFFFF"}isSelected(color){return this.selectedColor?.toUpperCase()===color}onEscapeHandler(event2){event2.stopPropagation(),event2.preventDefault(),this.ref.close()}};_ColorPickerPanelComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ColorPickerPanelComponent)},_ColorPickerPanelComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ColorPickerPanelComponent,selectors:[["ix-color-picker-panel"]],hostBindings:function(rf,ctx){rf&1&&\u0275\u0275listener("keydown.escape",function($event){return ctx.onEscapeHandler($event)},!1,\u0275\u0275resolveDocument)},standalone:!1,decls:11,vars:11,consts:[["mat-stretch-tabs","","dynamicHeight","",1,"example-stretched-tabs",3,"disablePagination","selectedIndex"],[3,"label"],[1,"content"],["fxLayout","column"],["fxFlex","","fxLayout","row",1,"color-set"],["cpAlphaChannel","disabled",3,"colorPickerChange","cpDialogDisplay","cpToggle","colorPicker"],[1,"color",3,"selected"],[1,"color",3,"click"],[1,"color-icon"]],template:function(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-tab-group",0)(1,"mat-tab",1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementStart(3,"div",2)(4,"div",3),\u0275\u0275repeaterCreate(5,ColorPickerPanelComponent_For_6_Template,3,0,"div",4,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()()(),\u0275\u0275elementStart(7,"mat-tab",1),\u0275\u0275pipe(8,"translate"),\u0275\u0275elementStart(9,"div",2)(10,"span",5),\u0275\u0275listener("colorPickerChange",function($event){return ctx.selectedColor=$event}),\u0275\u0275elementEnd()()()()),rf&2){let tmp_7_0;\u0275\u0275property("disablePagination",!0)("selectedIndex",ctx.tabIndex),\u0275\u0275advance(),\u0275\u0275property("label",\u0275\u0275pipeBind1(2,7,"COLORS")),\u0275\u0275advance(4),\u0275\u0275repeater(ctx.colorSets),\u0275\u0275advance(2),\u0275\u0275property("label",\u0275\u0275pipeBind1(8,9,"CUSTOM")),\u0275\u0275advance(3),\u0275\u0275property("cpDialogDisplay","inline")("cpToggle",!0)("colorPicker",(tmp_7_0=ctx.selectedColor)!==null&&tmp_7_0!==void 0?tmp_7_0:"#FFFFFF")}},dependencies:[DefaultLayoutDirective,DefaultFlexDirective,MatTab,MatTabGroup,ColorPickerDirective,TranslatePipe],styles:["@keyframes _ngcontent-%COMP%_zoom-in{0%{transform:scale(.75);opacity:.9}to{transform:scale(1);opacity:1}}[_nghost-%COMP%]{--mat-tab-header-divider-color: var(--mat-sys-outline-variant);min-width:262px;height:fit-content;background-color:var(--mat-sys-surface-container);color:var(--mat-sys-on-surface-container);animation:_ngcontent-%COMP%_zoom-in .14s cubic-bezier(0,0,.2,1) both;border-radius:8px;box-shadow:0 1px 1px #00000024,0 2px 1px -1px #0000001f,0 1px 3px #0003;transform-origin:top left}[_nghost-%COMP%] .content[_ngcontent-%COMP%]{padding:16px}[_nghost-%COMP%] .color-set[_ngcontent-%COMP%]{display:block}[_nghost-%COMP%] .color-set[_ngcontent-%COMP%] .color[_ngcontent-%COMP%]{display:block;width:20%;cursor:pointer}[_nghost-%COMP%] .color-set[_ngcontent-%COMP%] .color[_ngcontent-%COMP%] .color-icon[_ngcontent-%COMP%]{display:block;height:24px;width:24px;border-radius:12px;margin:6px auto}[_nghost-%COMP%] .color-set[_ngcontent-%COMP%] .color[_ngcontent-%COMP%] .color-icon.color-icon--outline[_ngcontent-%COMP%]{box-shadow:0 0 0 1px rgba(var(--body-color-rgb),.12)}[_nghost-%COMP%] .color-set[_ngcontent-%COMP%] .color[_ngcontent-%COMP%]:hover .color-icon[_ngcontent-%COMP%], [_nghost-%COMP%] .color-set[_ngcontent-%COMP%] .color.selected[_ngcontent-%COMP%] .color-icon[_ngcontent-%COMP%]{box-shadow:0 0 0 5px rgba(var(--body-color-rgb),.08)}[_nghost-%COMP%] .actions[_ngcontent-%COMP%]{padding:8px}[_nghost-%COMP%] .color-picker{border:none!important;background-color:transparent!important}[_nghost-%COMP%] .mat-mdc-tab-label{height:40px;min-width:130px}[_nghost-%COMP%] .mat-mdc-tab-header .mdc-tab:first-child .mdc-tab__ripple:before, [_nghost-%COMP%] .mat-mdc-tab-header .mdc-tab:first-child .mat-mdc-tab-ripple{border-top-right-radius:0}[_nghost-%COMP%] .mat-mdc-tab-header .mdc-tab:last-child .mdc-tab__ripple:before, [_nghost-%COMP%] .mat-mdc-tab-header .mdc-tab:last-child .mat-mdc-tab-ripple{border-top-left-radius:0}"]});let ColorPickerPanelComponent3=_ColorPickerPanelComponent;return ColorPickerPanelComponent3})();var ColorPickerPanelService=(()=>{let _ColorPickerPanelService=class _ColorPickerPanelService{constructor(){this.injector=inject(Injector),this.overlay=inject(Overlay)}show(origin,data){let overlayRef=this.createOverlay(origin),instance=new ColorPickerPanelRef(overlayRef);return this.attachPanelContainer(overlayRef,instance,data),instance}createOverlay(origin){let overlayRef=this.overlay.create(this.getOverlayConfig(origin));return overlayRef.backdropClick().subscribe(()=>overlayRef.dispose()),overlayRef}createInjector(panelRef,data){let injectionTokens=new WeakMap;return injectionTokens.set(ColorPickerPanelRef,panelRef),injectionTokens.set(COLOR_PICKER_PANEL_DATA,data),new PortalInjector(this.injector,injectionTokens)}attachPanelContainer(overlayRef,panelRef,data){let injector=this.createInjector(panelRef,data),containerPortal=new ComponentPortal(ColorPickerPanelComponent,null,injector);return overlayRef.attach(containerPortal).instance}getOverlayConfig(origin){let positionStrategy=this.overlay.position().flexibleConnectedTo(origin).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top",offsetY:-45},{originX:"start",originY:"top",overlayX:"start",overlayY:"bottom",offsetY:-45}]);return new OverlayConfig({hasBackdrop:!0,backdropClass:"overlay-transparent-backdrop",panelClass:"ix-color-picker-container",minWidth:240,maxWidth:240,scrollStrategy:this.overlay.scrollStrategies.noop(),positionStrategy})}};_ColorPickerPanelService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ColorPickerPanelService)},_ColorPickerPanelService.\u0275prov=\u0275\u0275defineInjectable({token:_ColorPickerPanelService,factory:_ColorPickerPanelService.\u0275fac});let ColorPickerPanelService2=_ColorPickerPanelService;return ColorPickerPanelService2})();var ColorPickerPanelModule=(()=>{let _ColorPickerPanelModule=class _ColorPickerPanelModule{};_ColorPickerPanelModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ColorPickerPanelModule)},_ColorPickerPanelModule.\u0275mod=\u0275\u0275defineNgModule({type:_ColorPickerPanelModule}),_ColorPickerPanelModule.\u0275inj=\u0275\u0275defineInjector({providers:[ColorPickerPanelService],imports:[SharedModule]});let ColorPickerPanelModule2=_ColorPickerPanelModule;return ColorPickerPanelModule2})();var _c016=["button"],_c16=a0=>({"color--error":a0}),_c25=(a0,a1)=>({"color--error":a0,"color--outline":a1});function ColorInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",1),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r1.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function ColorInputComponent_Conditional_7_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"div",11),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275styleProp("background",ctx_r1.value),\u0275\u0275property("ngClass",\u0275\u0275pureFunction2(3,_c25,ctx_r1.hasError,ctx_r1.hasOutline))}}function ColorInputComponent_Conditional_8_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"div",7),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("ngClass",\u0275\u0275pureFunction1(1,_c16,ctx_r1.hasError))}}function ColorInputComponent_Conditional_9_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",12),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r3);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.clear())}),\u0275\u0275elementStart(1,"mat-icon"),\u0275\u0275text(2,"close"),\u0275\u0275elementEnd()()}}function ColorInputComponent_Conditional_11_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",10),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}var ColorInputComponent=(()=>{let _ColorInputComponent=class _ColorInputComponent extends ComponentInputComponent{get control(){return this.componentFormGroup.controls[this.field.inputName]}get required(){return this.control?.hasValidator(Validators.required)}get value(){return this.componentFormGroup.value[this.field.inputName]||null}constructor(cdRef,colorPickerPanelService){super(),this.cdRef=cdRef,this.colorPickerPanelService=colorPickerPanelService}ngOnInit(){this.hasOutline=this.testHasOutline(this.value),this.hasError=this.testHasError(this.control.status),this.control.statusChanges.subscribe(status=>{this.hasError=this.testHasError(status),this.cdRef.markForCheck()}),this.control.valueChanges.subscribe(value=>{this.hasOutline=this.testHasOutline(value),this.cdRef.markForCheck()})}clear(){this.control.setValue(null)}testHasError(status){return status==="INVALID"}testHasOutline(color){return color?(0,import_tinycolor2.default)(this.value).getLuminance()>.85:!0}toggleSelect(){this.colorPickerPanelService.show(this.buttonRef,{color:this.value}).afterClosed().subscribe(color=>{this.control.setValue(color)})}enterKeyDownHandler(event2){event2.target.blur()}};_ColorInputComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ColorInputComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(ColorPickerPanelService))},_ColorInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ColorInputComponent,selectors:[["ix-color-input"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(_c016,5,ElementRef),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.buttonRef=_t.first)}},standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:12,vars:8,consts:[["button",""],[1,"description",3,"innerHTML"],["fxLayout","column"],[1,"label",3,"ngClass"],["fxLayout","row"],["mat-icon-button","",1,"select-trigger-button",3,"keydown.enter","click"],[1,"color",3,"ngClass","background"],[1,"color","color--empty","color--outline",3,"ngClass"],["mat-icon-button",""],[1,"errors"],["translate",""],[1,"color",3,"ngClass"],["mat-icon-button","",3,"click"]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275template(0,ColorInputComponent_Conditional_0_Template,2,3,"p",1),\u0275\u0275elementStart(1,"div",2)(2,"div",3),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"div",4)(5,"button",5,0),\u0275\u0275listener("keydown.enter",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.enterKeyDownHandler($event))})("click",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.toggleSelect())}),\u0275\u0275template(7,ColorInputComponent_Conditional_7_Template,1,6,"div",6)(8,ColorInputComponent_Conditional_8_Template,1,3,"div",7),\u0275\u0275elementEnd(),\u0275\u0275template(9,ColorInputComponent_Conditional_9_Template,3,0,"button",8),\u0275\u0275elementEnd(),\u0275\u0275elementStart(10,"div",9),\u0275\u0275template(11,ColorInputComponent_Conditional_11_Template,2,0,"mat-error",10),\u0275\u0275elementEnd()()}rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(2),\u0275\u0275property("ngClass",\u0275\u0275pureFunction1(6,_c16,ctx.hasError)),\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",ctx.field.inputDescription.label+(ctx.required?" *":"")," "),\u0275\u0275advance(4),\u0275\u0275conditional(ctx.value?7:8),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.value?9:-1),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.control.hasError("required")?11:-1))},dependencies:[NgClass,DefaultLayoutDirective,DefaultClassDirective,TranslateDirective,MatIconButton,MatError,MatIcon,RenderMarkdownPipe],styles:["[_nghost-%COMP%]{display:block;position:relative;padding-bottom:22px}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{margin-bottom:4px;transform-origin:top left;transform:scale(.75) perspective(100px) translateZ(.001px);font-size:14px;color:#0000008a}[_nghost-%COMP%] .label.color--error[_ngcontent-%COMP%]{color:var(--warn)}[_nghost-%COMP%] .errors[_ngcontent-%COMP%]{position:absolute;top:64px;left:0}[_nghost-%COMP%] .errors[_ngcontent-%COMP%] .mat-mdc-form-field-error[_ngcontent-%COMP%]{line-height:var(--mat-form-field-subscript-text-line-height);letter-spacing:var(--mat-form-field-subscript-text-tracking);font-size:11px}[_nghost-%COMP%] .mdc-icon-button[_ngcontent-%COMP%]{padding:0}[_nghost-%COMP%] .color[_ngcontent-%COMP%]{display:block;width:36px;height:36px;border-radius:18px;margin:2px}[_nghost-%COMP%] .color.color--outline[_ngcontent-%COMP%]{box-shadow:inset 0 0 0 1px rgba(var(--body-color-rgb),.16)}[_nghost-%COMP%] .color.color--empty[_ngcontent-%COMP%]{background-image:linear-gradient(45deg,#ccc 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(45deg,transparent 75%,#ccc 75%),linear-gradient(45deg,#ccc 25%,#fff 25%);background-size:16px 16px;background-position:0 0,0 0,-8px -8px,8px 8px}[_nghost-%COMP%] .color.color--empty.color--outline[_ngcontent-%COMP%]{box-shadow:inset 0 0 0 1px rgba(var(--body-color-rgb),.34)}[_nghost-%COMP%] .color.color--error[_ngcontent-%COMP%]{box-shadow:inset 0 0 0 1px var(--warn)!important}"]});let ColorInputComponent3=_ColorInputComponent;return ColorInputComponent3})();function DateInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",1),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r1.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function DateInputComponent_Conditional_10_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}var DateInputComponent=(()=>{let _DateInputComponent=class _DateInputComponent extends ComponentInputComponent{constructor(){super(...arguments),this.formControl=new FormControl(""),this.destroy=inject(DestroyRef)}ngOnInit(){this.formControl.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(date=>{this.formControl.valid&&this.control?.setValue(DateTime.fromISO(date).set({millisecond:0}).toUTC().toISO({suppressMilliseconds:!0}))}),this.formControl.setValidators(this.getValidators());let value=this.inputControl?.value||this.field.inputDescription.defaultValue;this.formControl.setValue(value?DateTime.fromISO(value):""),this.field.inputDescription.disabled&&this.formControl.disable()}get control(){return this.componentFormGroup.controls[this.field.inputName]}getValidators(){let validators=[],{required}=this.field.inputDescription;return required&&validators.push(Validators.required),validators}enterKeyDownHandler(event2){event2.target.blur()}};_DateInputComponent.\u0275fac=(()=>{let \u0275DateInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275DateInputComponent_BaseFactory||(\u0275DateInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_DateInputComponent)))(__ngFactoryType__||_DateInputComponent)}})(),_DateInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_DateInputComponent,selectors:[["ix-date-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:11,vars:8,consts:[["picker",""],[1,"description",3,"innerHTML"],[3,"formGroup"],["matInput","","data-lpignore","true","autocomplete","off",3,"keydown.enter","formControl","matDatepicker"],["matIconSuffix","",3,"for"],["translate",""]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275template(0,DateInputComponent_Conditional_0_Template,2,3,"p",1),\u0275\u0275elementStart(1,"mat-form-field",2)(2,"mat-label"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"input",3),\u0275\u0275listener("keydown.enter",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.enterKeyDownHandler($event))}),\u0275\u0275elementEnd(),\u0275\u0275element(5,"mat-datepicker-toggle",4)(6,"mat-datepicker",null,0),\u0275\u0275elementStart(8,"mat-hint"),\u0275\u0275text(9),\u0275\u0275elementEnd(),\u0275\u0275template(10,DateInputComponent_Conditional_10_Template,2,0,"mat-error",5),\u0275\u0275elementEnd()}if(rf&2){let picker_r3=\u0275\u0275reference(7);\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275property("formGroup",ctx.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("formControl",ctx.formControl)("matDatepicker",picker_r3),\u0275\u0275advance(),\u0275\u0275property("for",picker_r3),\u0275\u0275advance(4),\u0275\u0275textInterpolate(ctx.field.inputDescription.hint),\u0275\u0275advance(),\u0275\u0275conditional(ctx.inputControl!=null&&ctx.inputControl.hasError("required")?10:-1)}},dependencies:[DefaultValueAccessor,NgControlStatus,NgControlStatusGroup,FormControlDirective,FormGroupDirective,TranslateDirective,MatDatepicker,MatDatepickerInput,MatDatepickerToggle,MatFormField,MatLabel,MatHint,MatError,MatSuffix,MatInput,RenderMarkdownPipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-datepicker-toggle[_ngcontent-%COMP%]{margin-right:4px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}"]});let DateInputComponent3=_DateInputComponent;return DateInputComponent3})();var MAX_FILE_SIZE=1e7;function readFile(file,output2){return new Observable(subscriber=>{let reader=createFileReader();reader.addEventListener("abort",onAbort),reader.addEventListener("error",onError),reader.addEventListener("load",onLoad),reader.addEventListener("progress",onProgress);let method=`readAs${upperFirst_default(output2)}`;return reader[method]&&reader[method](file),()=>{reader.removeEventListener("abort",onAbort),reader.removeEventListener("error",onError),reader.removeEventListener("load",onLoad),reader.removeEventListener("progress",onProgress)};function onAbort(event2){subscriber.next({event:event2}),subscriber.complete()}function onProgress(event2){subscriber.next({event:event2})}function onError(event2){subscriber.error(event2),subscriber.complete()}function onLoad(event2){subscriber.next({event:event2,result:reader.result||void 0}),subscriber.complete()}})}function createFileReader(){let reader=new FileReader;return reader._realReader?reader._realReader:reader}function readFileAsDataURL(file){return readFile(file,"dataURL")}function getFilesFromEvent(event2){let files;return files=get_default(event2,"target.files",[]),files.length||(files=get_default(event2,"dataTransfer.files",[])),files}function mapMimeTypeToIcon(type){if(type.startsWith("image/"))return"image";if(type.startsWith("audio/"))return"audio_file";if(type.startsWith("video/"))return"video_file";switch(type){case"application/x-cdf":return"audio_file";case"application/vnd.rar":case"application/x-7z-compressed":case"application/x-bzip":case"application/x-bzip2":case"application/x-freearc":case"application/x-tar":case"application/zip":case"application/gzip":return"folder_zip";case"application/pdf":return"picture_as_pdf";default:return"insert_drive_file"}}function getHeightAndWidthFromDataUrl(dataURL){return new Promise(resolve=>{let img=new Image;img.onload=()=>{resolve({height:img.height,width:img.width})},img.src=dataURL})}var _c017=["fileInput"],_c17=["*"];function FileUploadButtonComponent_Case_2_ng_container_1_Template(rf,ctx){rf&1&&\u0275\u0275elementContainer(0)}function FileUploadButtonComponent_Case_2_Template(rf,ctx){if(rf&1){let _r2=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",8),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r2),\u0275\u0275nextContext();let fileInput_r3=\u0275\u0275reference(1);return \u0275\u0275resetView(fileInput_r3.click())}),\u0275\u0275template(1,FileUploadButtonComponent_Case_2_ng_container_1_Template,1,0,"ng-container",9),\u0275\u0275elementEnd()}if(rf&2){let ctx_r3=\u0275\u0275nextContext(),innerContent_r5=\u0275\u0275reference(8);\u0275\u0275property("color",ctx_r3.color),\u0275\u0275advance(),\u0275\u0275property("ngTemplateOutlet",innerContent_r5)}}function FileUploadButtonComponent_Case_3_ng_container_1_Template(rf,ctx){rf&1&&\u0275\u0275elementContainer(0)}function FileUploadButtonComponent_Case_3_Template(rf,ctx){if(rf&1){let _r6=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",10),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r6),\u0275\u0275nextContext();let fileInput_r3=\u0275\u0275reference(1);return \u0275\u0275resetView(fileInput_r3.click())}),\u0275\u0275template(1,FileUploadButtonComponent_Case_3_ng_container_1_Template,1,0,"ng-container",9),\u0275\u0275elementEnd()}if(rf&2){let ctx_r3=\u0275\u0275nextContext(),innerContent_r5=\u0275\u0275reference(8);\u0275\u0275property("color",ctx_r3.color),\u0275\u0275advance(),\u0275\u0275property("ngTemplateOutlet",innerContent_r5)}}function FileUploadButtonComponent_Case_4_ng_container_1_Template(rf,ctx){rf&1&&\u0275\u0275elementContainer(0)}function FileUploadButtonComponent_Case_4_Template(rf,ctx){if(rf&1){let _r7=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",11),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r7),\u0275\u0275nextContext();let fileInput_r3=\u0275\u0275reference(1);return \u0275\u0275resetView(fileInput_r3.click())}),\u0275\u0275template(1,FileUploadButtonComponent_Case_4_ng_container_1_Template,1,0,"ng-container",9),\u0275\u0275elementEnd()}if(rf&2){let ctx_r3=\u0275\u0275nextContext(),innerContent_r5=\u0275\u0275reference(8);\u0275\u0275property("color",ctx_r3.color),\u0275\u0275advance(),\u0275\u0275property("ngTemplateOutlet",innerContent_r5)}}function FileUploadButtonComponent_Case_5_ng_container_1_Template(rf,ctx){rf&1&&\u0275\u0275elementContainer(0)}function FileUploadButtonComponent_Case_5_Template(rf,ctx){if(rf&1){let _r8=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",12),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r8),\u0275\u0275nextContext();let fileInput_r3=\u0275\u0275reference(1);return \u0275\u0275resetView(fileInput_r3.click())}),\u0275\u0275template(1,FileUploadButtonComponent_Case_5_ng_container_1_Template,1,0,"ng-container",9),\u0275\u0275elementEnd()}if(rf&2){\u0275\u0275nextContext();let innerContent_r5=\u0275\u0275reference(8);\u0275\u0275advance(),\u0275\u0275property("ngTemplateOutlet",innerContent_r5)}}function FileUploadButtonComponent_Case_6_ng_container_1_Template(rf,ctx){rf&1&&\u0275\u0275elementContainer(0)}function FileUploadButtonComponent_Case_6_Template(rf,ctx){if(rf&1){let _r9=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",13),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r9),\u0275\u0275nextContext();let fileInput_r3=\u0275\u0275reference(1);return \u0275\u0275resetView(fileInput_r3.click())}),\u0275\u0275template(1,FileUploadButtonComponent_Case_6_ng_container_1_Template,1,0,"ng-container",9),\u0275\u0275elementEnd()}if(rf&2){let ctx_r3=\u0275\u0275nextContext(),innerContent_r5=\u0275\u0275reference(8);\u0275\u0275property("color",ctx_r3.color),\u0275\u0275advance(),\u0275\u0275property("ngTemplateOutlet",innerContent_r5)}}function FileUploadButtonComponent_ng_template_7_Template(rf,ctx){rf&1&&\u0275\u0275projection(0)}var FileUploadButtonComponent=(()=>{let _FileUploadButtonComponent=class _FileUploadButtonComponent{constructor(){this.multiple=!1,this.color="primary",this.fileChange=new EventEmitter,this.fileChanges=new EventEmitter,this.snackBar=inject(MatSnackBar),this.translate=inject(TranslateService)}ngOnChanges(){this.label||(this.label=this.getDefaultLabel())}change(event2){return __async(this,null,function*(){let fileObjects=getFilesFromEvent(event2);if(fileObjects.length){let files=[];for(let file of fileObjects){let{result:previewSrc}=yield firstValueFrom(readFileAsDataURL(file).pipe(filter(data=>data.event.type==="load")));if(file.type&&!this.isAllowedFileType(file.type)){let message=this.translate.instant("__MESSAGE__.INVALID_FILE_TYPE");this.snackBar.open(message,void 0,{duration:3e3}),this.clearFileInput(),files=[];break}else if(file.size!==void 0&&!this.isAllowedFileSize(file.size)){let name=file.name,size=`${this.allowMaxFileSize/1e3/1e3}MB`,message=this.translate.instant("__MESSAGE__.MAX_FILE_SIZE",{name,size});this.snackBar.open(message,void 0,{duration:3e3}),this.clearFileInput(),files=[];break}else if(this.imageSize&&this.isFileTypeImage(file)){let{height,width}=yield getHeightAndWidthFromDataUrl(previewSrc);if(this.isAllowedImageHeightAndWidth(height,width)){let actual=`${width} x ${height}px`,expected=`${this.imageSize?.width} x ${this.imageSize?.height}px`,message=this.translate.instant("__MESSAGE__.INVALID_IMAGE_SIZE",{actual,expected});this.snackBar.open(message,void 0,{duration:3e3}),this.clearFileInput(),files=[];break}else files.push({file,previewSrc})}else files.push({file,previewSrc})}this.multiple?this.fileChanges.emit(files):this.fileChange.emit(files.length?files[0]:null)}else this.multiple?this.fileChanges.emit([]):this.fileChange.emit(null)})}clearFileInput(){this.fileInputRef.nativeElement.value=null}getDefaultLabel(){return"Choose file"}isAllowedFileSize(fileSize){return fileSize<=this.allowMaxFileSize}isAllowedFileType(fileType){return this.allowedMimeTypes!==void 0?this.allowedMimeTypes.includes(fileType):!0}isAllowedImageHeightAndWidth(height,width){return this.imageSize===void 0?!0:!(this.imageSize.height===height&&this.imageSize.width===width)}isFileTypeImage(file){return file.type.includes("image")}get allowMaxFileSize(){return this.maxFileSize??MAX_FILE_SIZE}};_FileUploadButtonComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_FileUploadButtonComponent)},_FileUploadButtonComponent.\u0275cmp=\u0275\u0275defineComponent({type:_FileUploadButtonComponent,selectors:[["ix-file-upload-button"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(_c017,7),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.fileInputRef=_t.first)}},inputs:{allowedMimeTypes:"allowedMimeTypes",multiple:"multiple",matButtonType:"matButtonType",color:"color",imageSize:"imageSize",label:"label",maxFileSize:"maxFileSize"},outputs:{fileChange:"fileChange",fileChanges:"fileChanges"},features:[\u0275\u0275NgOnChangesFeature],ngContentSelectors:_c17,decls:9,vars:3,consts:[["fileInput",""],["innerContent",""],["type","file","hidden","","onclick","this.value = null",3,"change","accept","multiple"],["mat-raised-button","","type","button",3,"color"],["mat-stroked-button","","type","button",3,"color"],["mat-flat-button","","type","button",3,"color"],["mat-menu-item","","type","button"],["mat-button","","type","button",3,"color"],["mat-raised-button","","type","button",3,"click","color"],[4,"ngTemplateOutlet"],["mat-stroked-button","","type","button",3,"click","color"],["mat-flat-button","","type","button",3,"click","color"],["mat-menu-item","","type","button",3,"click"],["mat-button","","type","button",3,"click","color"]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275projectionDef(),\u0275\u0275elementStart(0,"input",2,0),\u0275\u0275listener("change",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.change($event))}),\u0275\u0275elementEnd(),\u0275\u0275template(2,FileUploadButtonComponent_Case_2_Template,2,2,"button",3)(3,FileUploadButtonComponent_Case_3_Template,2,2,"button",4)(4,FileUploadButtonComponent_Case_4_Template,2,2,"button",5)(5,FileUploadButtonComponent_Case_5_Template,2,1,"button",6)(6,FileUploadButtonComponent_Case_6_Template,2,2,"button",7)(7,FileUploadButtonComponent_ng_template_7_Template,1,0,"ng-template",null,1,\u0275\u0275templateRefExtractor)}if(rf&2){let tmp_4_0;\u0275\u0275property("accept",ctx.allowedMimeTypes)("multiple",ctx.multiple),\u0275\u0275advance(2),\u0275\u0275conditional((tmp_4_0=ctx.matButtonType)==="raised"?2:tmp_4_0==="stroked"?3:tmp_4_0==="flat"?4:tmp_4_0==="menu"?5:6)}},dependencies:[NgTemplateOutlet,MatButtonModule,MatButton,MatFormFieldModule,MatMenuModule,MatMenuItem,MatSnackBarModule],styles:["[_nghost-%COMP%]{--mdc-outlined-button-container-height: 36px}[_nghost-%COMP%] .container[_ngcontent-%COMP%]{position:relative}[_nghost-%COMP%] .content[_ngcontent-%COMP%]{display:inline-block;margin:8px}[_nghost-%COMP%] input[type=file][_ngcontent-%COMP%]{appearance:initial;background-color:initial;cursor:default;align-items:baseline;color:inherit;text-align:start!important;padding:initial;border:initial}"],changeDetection:0});let FileUploadButtonComponent3=_FileUploadButtonComponent;return FileUploadButtonComponent3})();function formatBytesValue(value,locale,decimals=2){let chars=["","k","M","G","T","P"],i=0;for(;value>=950&&i<chars.length-1;)value/=1e3,i++;return`${new Intl.NumberFormat(locale,{maximumFractionDigits:decimals}).format(value)} ${chars[i]}B`}var ByteFormatPipe=(()=>{let _ByteFormatPipe=class _ByteFormatPipe{transform(bytes){return formatBytesValue(bytes,Settings.defaultLocale)}};_ByteFormatPipe.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ByteFormatPipe)},_ByteFormatPipe.\u0275pipe=\u0275\u0275definePipe({name:"byteFormat",type:_ByteFormatPipe,pure:!0});let ByteFormatPipe3=_ByteFormatPipe;return ByteFormatPipe3})();var _c018=["*"];function FileUploadDropContainerComponent_Conditional_4_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"img",3),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("src",ctx_r1.filePreviewSrc,\u0275\u0275sanitizeUrl)}}function FileUploadDropContainerComponent_Conditional_17_For_2_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-list-item",8)(1,"mat-icon",9),\u0275\u0275text(2,"draft"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"div",10),\u0275\u0275text(4),\u0275\u0275elementEnd(),\u0275\u0275elementStart(5,"div",11),\u0275\u0275text(6),\u0275\u0275pipe(7,"byteFormat"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(8,"span",12)(9,"button",13),\u0275\u0275listener("click",function(){let \u0275$index_29_r4=\u0275\u0275restoreView(_r3).$index,ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.removeFileFromList(\u0275$index_29_r4))}),\u0275\u0275elementStart(10,"mat-icon"),\u0275\u0275text(11,"close"),\u0275\u0275elementEnd()()()()}if(rf&2){let f_r5=ctx.$implicit;\u0275\u0275advance(4),\u0275\u0275textInterpolate(f_r5.name),\u0275\u0275advance(2),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(7,2,f_r5.size))}}function FileUploadDropContainerComponent_Conditional_17_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-list"),\u0275\u0275repeaterCreate(1,FileUploadDropContainerComponent_Conditional_17_For_2_Template,12,4,"mat-list-item",8,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275repeater(ctx_r1.files)}}var FileUploadDropContainerComponent=(()=>{let _FileUploadDropContainerComponent=class _FileUploadDropContainerComponent extends FileUploadButtonComponent{constructor(){super(...arguments),this.multiple=!1,this.maxFileSize=MAX_FILE_SIZE,this.fileChange=new EventEmitter,this.fileChanges=new EventEmitter,this.fileRemove=new EventEmitter,this.cdRef=inject(ChangeDetectorRef),this.files=[]}change(event2){return __async(this,null,function*(){this.files=getFilesFromEvent(event2),this.cdRef.detectChanges(),yield __superGet(_FileUploadDropContainerComponent.prototype,this,"change").call(this,event2)})}dropHandler(event2){event2.preventDefault(),this.change(event2)}dragOverHandler(event2){event2.stopPropagation(),event2.preventDefault()}fileChangeHandler(event2){this.files=event2?.file?[event2.file]:[],this.cdRef.detectChanges(),this.fileChange.emit(event2)}fileChangesHandler(event2){this.files=[...this.files,...event2.map(event3=>event3.file)],this.cdRef.detectChanges(),this.fileChanges.emit(event2)}removeFileFromList(index){let[file]=this.files.splice(index,1);this.fileRemove.emit({file})}};_FileUploadDropContainerComponent.\u0275fac=(()=>{let \u0275FileUploadDropContainerComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275FileUploadDropContainerComponent_BaseFactory||(\u0275FileUploadDropContainerComponent_BaseFactory=\u0275\u0275getInheritedFactory(_FileUploadDropContainerComponent)))(__ngFactoryType__||_FileUploadDropContainerComponent)}})(),_FileUploadDropContainerComponent.\u0275cmp=\u0275\u0275defineComponent({type:_FileUploadDropContainerComponent,selectors:[["ix-file-upload-drop-container"]],inputs:{multiple:"multiple",filePreviewSrc:"filePreviewSrc",maxFileSize:"maxFileSize"},outputs:{fileChange:"fileChange",fileChanges:"fileChanges",fileRemove:"fileRemove"},features:[\u0275\u0275InheritDefinitionFeature],ngContentSelectors:_c018,decls:18,vars:20,consts:[["content",""],["fxLayout","column","fxLayoutAlign","center center","data-testid","drop-container",1,"drop-container",3,"drop","dragover"],["fxLayout","column","fxLayoutAlign","center center"],[1,"image",3,"src"],["fxLayout","column","fxLayoutAlign","center center",1,"ix-surface"],[1,"icon"],["translate",""],[3,"fileChange","fileChanges","multiple","allowedMimeTypes","maxFileSize","imageSize","matButtonType","color"],["fxLayoutAlign","start center"],["matListItemIcon",""],["matListItemTitle",""],["matListItemLine",""],["matListItemMeta",""],["type","button","mat-icon-button","",3,"click"]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275projectionDef(),\u0275\u0275elementStart(0,"div",1),\u0275\u0275listener("drop",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.dropHandler($event))})("dragover",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.dragOverHandler($event))}),\u0275\u0275elementStart(1,"div",2,0),\u0275\u0275projection(3),\u0275\u0275elementEnd(),\u0275\u0275template(4,FileUploadDropContainerComponent_Conditional_4_Template,1,1,"img",3),\u0275\u0275elementStart(5,"span",4)(6,"mat-icon",5),\u0275\u0275text(7,"cloud_upload"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(8,"span",6),\u0275\u0275text(9,"DRAG_AND_DROP_TO_UPLOAD"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(10,"span"),\u0275\u0275text(11),\u0275\u0275pipe(12,"translate"),\u0275\u0275pipe(13,"lowercase"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(14,"ix-file-upload-button",7),\u0275\u0275listener("fileChange",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.fileChangeHandler($event))})("fileChanges",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.fileChangesHandler($event))}),\u0275\u0275text(15),\u0275\u0275pipe(16,"translate"),\u0275\u0275elementEnd()()(),\u0275\u0275template(17,FileUploadDropContainerComponent_Conditional_17_Template,3,0,"mat-list")}if(rf&2){let content_r6=\u0275\u0275reference(2);\u0275\u0275classProp("minimize-height",ctx.multiple&&ctx.files.length),\u0275\u0275advance(4),\u0275\u0275conditional(ctx.filePreviewSrc&&!content_r6.children.length?4:-1),\u0275\u0275advance(),\u0275\u0275classProp("invisible",ctx.files.length&&!ctx.multiple),\u0275\u0275advance(6),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(13,16,\u0275\u0275pipeBind1(12,14,"OR"))),\u0275\u0275advance(3),\u0275\u0275property("multiple",ctx.multiple)("allowedMimeTypes",ctx.allowedMimeTypes)("maxFileSize",ctx.maxFileSize)("imageSize",ctx.imageSize)("matButtonType","stroked")("color",null),\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind1(16,18,ctx.multiple?"SELECT_FILES_TO_UPLOAD":"SELECT_FILE_TO_UPLOAD")," "),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.multiple&&ctx.files.length?17:-1)}},dependencies:[ByteFormatPipe,MatButtonModule,MatIconButton,MatFormFieldModule,MatIconModule,MatIcon,MatListModule,MatList,MatListItem,MatListItemIcon,MatListItemLine,MatListItemTitle,MatListItemMeta,MatSnackBarModule,FileUploadButtonComponent,FormsModule,TranslateModule,TranslatePipe,TranslateDirective,LowerCasePipe,FlexModule,DefaultLayoutDirective,DefaultLayoutAlignDirective],styles:["[_nghost-%COMP%] .drop-container[_ngcontent-%COMP%]{position:relative;min-height:300px;overflow:hidden;border-radius:6px;background:var(--mat-sys-outline-variant)}[_nghost-%COMP%] .drop-container.minimize-height[_ngcontent-%COMP%]{min-height:150px}[_nghost-%COMP%] .drop-container[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:36px;height:36px;margin:4px 0;font-size:36px;color:var(--body-color)}[_nghost-%COMP%] .drop-container[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-bottom:4px}[_nghost-%COMP%] .drop-container[_ngcontent-%COMP%] .invisible[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--mat-sys-surface-variant) 92%,transparent);opacity:0;transition:opacity .1s ease-out;will-change:opacity}[_nghost-%COMP%] .drop-container[_ngcontent-%COMP%]:hover .invisible[_ngcontent-%COMP%], [_nghost-%COMP%] .drop-container[_ngcontent-%COMP%]:focus .invisible[_ngcontent-%COMP%]{opacity:1;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}[_nghost-%COMP%] .image[_ngcontent-%COMP%]{max-height:200px;max-width:200px}[_nghost-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]{--mdc-list-list-item-leading-icon-color: var( --mdc-list-list-item-label-text-color );--mdc-list-list-item-hover-leading-icon-color: var( --mdc-list-list-item-hover-label-text-color );--mdc-list-list-item-trailing-supporting-text-color: var( --mdc-list-list-item-label-text-color );padding:0}[_nghost-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%] .mdc-list-item__content{margin-right:0!important}[_nghost-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%] .mdc-list-item__end[_ngcontent-%COMP%]{margin:15px 0 0 16px}[_nghost-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%] .mdc-list-item__start[_ngcontent-%COMP%]{margin:23px 16px 0 0}[_nghost-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%] .file-name[_ngcontent-%COMP%]{color:rgba(var(--body-color-rgb),.87);white-space:nowrap;text-overflow:ellipsis;overflow:hidden}[_nghost-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%] .file-size[_ngcontent-%COMP%]{font-size:12px}"],changeDetection:0});let FileUploadDropContainerComponent2=_FileUploadDropContainerComponent;return FileUploadDropContainerComponent2})();function FileInputComponent_Conditional_1_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-icon",1),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r0.icon)}}function FileInputComponent_Conditional_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"p",2),\u0275\u0275text(1),\u0275\u0275elementStart(2,"strong"),\u0275\u0275text(3),\u0275\u0275pipe(4,"byteFormat"),\u0275\u0275elementEnd(),\u0275\u0275text(5," ) "),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",ctx_r0.file.name," ( "),\u0275\u0275advance(2),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(4,2,ctx_r0.file.size))}}var FileInputComponent=(()=>{let _FileInputComponent=class _FileInputComponent extends ComponentInputComponent{fileChange(changes){changes&&(this.inputControl?.setValue(changes.file),this.inputControl?.markAsDirty())}fileChanges(changes){changes?.length&&(this.inputControl?.setValue([...this.inputControl.value||[],...changes.map(fileEvent=>fileEvent.file)]),this.inputControl?.markAsDirty())}fileRemove(changes){changes.file&&(this.inputControl?.setValue([...(this.inputControl.value||[]).filter(file=>file!==changes.file)]),this.inputControl?.markAsDirty())}get icon(){if(this.inputControl?.value?.type)return mapMimeTypeToIcon(this.inputControl.value.type)}get maxSize(){return this.field.inputDescription.size?.max??MAX_FILE_SIZE}get multiple(){return this.field.inputDescription.multiple??!1}get file(){return Array.isArray(this.inputControl?.value)?null:this.inputControl?.value||null}};_FileInputComponent.\u0275fac=(()=>{let \u0275FileInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275FileInputComponent_BaseFactory||(\u0275FileInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_FileInputComponent)))(__ngFactoryType__||_FileInputComponent)}})(),_FileInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_FileInputComponent,selectors:[["ix-file-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:3,vars:5,consts:[["data-testid","drop-container",3,"fileChange","fileChanges","fileRemove","filePreviewSrc","maxFileSize","multiple"],[1,"icon"],["data-testid","file-info"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"ix-file-upload-drop-container",0),\u0275\u0275listener("fileChange",function($event){return ctx.fileChange($event)})("fileChanges",function($event){return ctx.fileChanges($event)})("fileRemove",function($event){return ctx.fileRemove($event)}),\u0275\u0275template(1,FileInputComponent_Conditional_1_Template,2,1,"mat-icon",1)(2,FileInputComponent_Conditional_2_Template,6,4,"p",2),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275property("filePreviewSrc",null)("maxFileSize",ctx.maxSize)("multiple",ctx.multiple),\u0275\u0275advance(),\u0275\u0275conditional(ctx.icon?1:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.file?2:-1))},dependencies:[FileUploadDropContainerComponent,MatIcon,ByteFormatPipe],styles:["[_nghost-%COMP%] .icon[_ngcontent-%COMP%]{width:36px;height:36px;margin:4px 0;font-size:36px;color:var(--body-color)}[_nghost-%COMP%] span[_ngcontent-%COMP%]{margin-bottom:4px}"]});let FileInputComponent3=_FileInputComponent;return FileInputComponent3})();function GroupInputFormComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function GroupInputFormComponent_ng_template_1_Template(rf,ctx){}var GroupInputFormComponent=(()=>{let _GroupInputFormComponent=class _GroupInputFormComponent extends ComponentInputComponent{constructor(cdRef,inputConverter){super(),this.cdRef=cdRef,this.inputConverter=inputConverter}ngAfterViewInit(){this.formDirective.viewContainerRef.clear(),this.inputConverter.loadComponentInputs(this.field.children,this.componentFormGroup.get(this.field.inputDescription.key),this.formDirective.viewContainerRef),this.cdRef.detectChanges()}};_GroupInputFormComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_GroupInputFormComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(INPUT_CONVERTER_TOKEN))},_GroupInputFormComponent.\u0275cmp=\u0275\u0275defineComponent({type:_GroupInputFormComponent,selectors:[["ix-group-input-form"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(InputControlFormDirective,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.formDirective=_t.first)}},inputs:{field:"field",componentFormGroup:"componentFormGroup"},standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:2,vars:1,consts:[[1,"description",3,"innerHTML"],["ixInputControlForm",""]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,GroupInputFormComponent_Conditional_0_Template,2,3,"p",0)(1,GroupInputFormComponent_ng_template_1_Template,0,0,"ng-template",1),rf&2&&\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1)},dependencies:[InputControlFormDirective,RenderMarkdownPipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{font-size:11.5px!important;font-weight:500!important;text-transform:uppercase;letter-spacing:.8px;color:color-mix(in srgb,transparent,currentcolor 67%)}[_nghost-%COMP%] .mat-divider[_ngcontent-%COMP%]{margin:0 -16px 16px}[_nghost-%COMP%] .mat-divider.mat-divider-inset[_ngcontent-%COMP%]{margin-left:0}[_nghost-%COMP%] + *[_ngcontent-%COMP%]{border-top:1px solid var(--mat-sys-outline-variant)}"]});let GroupInputFormComponent3=_GroupInputFormComponent;return GroupInputFormComponent3})();var GroupInputDialogComponent=(()=>{let _GroupInputDialogComponent=class _GroupInputDialogComponent{constructor(data){this.data=data}};_GroupInputDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_GroupInputDialogComponent)(\u0275\u0275directiveInject(MAT_DIALOG_DATA))},_GroupInputDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_GroupInputDialogComponent,selectors:[["ix-group-input-dialog"]],standalone:!1,decls:11,vars:6,consts:[["mat-dialog-title",""],[3,"field","componentFormGroup"],["align","end"],["mat-button","",3,"mat-dialog-close"],["translate",""],["mat-button","",3,"mat-dialog-close","disabled"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"h1",0),\u0275\u0275text(1),\u0275\u0275elementEnd(),\u0275\u0275elementStart(2,"mat-dialog-content"),\u0275\u0275element(3,"ix-group-input-form",1),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"mat-dialog-actions",2)(5,"button",3)(6,"span",4),\u0275\u0275text(7,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(8,"button",5)(9,"span",4),\u0275\u0275text(10,"OK"),\u0275\u0275elementEnd()()()),rf&2&&(\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx.data.field.inputDescription.label),\u0275\u0275advance(2),\u0275\u0275property("field",ctx.data.field)("componentFormGroup",ctx.data.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275property("mat-dialog-close",!1),\u0275\u0275advance(3),\u0275\u0275property("mat-dialog-close",!0)("disabled",!ctx.data.componentFormGroup.valid))},dependencies:[TranslateDirective,MatButton,MatDialogClose,MatDialogTitle,MatDialogActions,MatDialogContent,GroupInputFormComponent],encapsulation:2});let GroupInputDialogComponent3=_GroupInputDialogComponent;return GroupInputDialogComponent3})();var GroupInputSummaryComponent=(()=>{let _GroupInputSummaryComponent=class _GroupInputSummaryComponent extends ComponentInputComponent{constructor(dialog,cdRef){super(),this.dialog=dialog,this.cdRef=cdRef}get fieldValue(){return this.componentFormGroup.value[this.field.inputDescription.key]}get hasValidationErrors(){let control=this.componentFormGroup.controls[this.field.inputDescription.key];return!this.isGroupValidRecursively(control)}get summary(){let labelTemplate=this.field.inputDescription?.summary?.label;if(labelTemplate)return mustache_default.render(labelTemplate,this.field.transformValue()[this.field.inputDescription.key],void 0,{escape:input2=>input2})}get summaryTooltipDisabled(){return(this.summary?.length||0)<20}get color(){let colorField=this.field.inputDescription?.summary?.colorField;if(colorField)return get_default(this.fieldValue,colorField)}openDialog(){let key=this.field.inputDescription.key,dialogForm=new FormGroup({[key]:this.field.toFormControl()});this.addDialogValuesWithoutNeedingRefreshAfterChange(dialogForm),this.dialog.open(GroupInputDialogComponent,{width:"500px",data:{field:this.field,componentFormGroup:dialogForm}}).afterClosed().subscribe(result=>{result&&(this.field.setValue(dialogForm.value[key]),this.componentFormGroup.markAsDirty(),this.componentFormGroup.setControl(key,dialogForm.controls[key]),this.cdRef.detectChanges())})}calculateStyle(){return{"background-color":this.color||"white"}}addDialogValuesWithoutNeedingRefreshAfterChange(dialogForm){dialogForm.patchValue(this.componentFormGroup.value)}isGroupValidRecursively(group){return group.valid&&Object.keys(group.controls).every(k=>{let subControl=group.controls[k];return subControl instanceof FormArray||subControl instanceof FormGroup?this.isGroupValidRecursively(subControl):subControl.valid})}};_GroupInputSummaryComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_GroupInputSummaryComponent)(\u0275\u0275directiveInject(MatDialog),\u0275\u0275directiveInject(ChangeDetectorRef))},_GroupInputSummaryComponent.\u0275cmp=\u0275\u0275defineComponent({type:_GroupInputSummaryComponent,selectors:[["ix-group-input-summary"]],hostVars:2,hostBindings:function(rf,ctx){rf&2&&\u0275\u0275classProp("has-validation-errors",ctx.hasValidationErrors)},inputs:{field:"field",componentFormGroup:"componentFormGroup"},standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:7,vars:5,consts:[["mat-icon-button","","type","button",3,"click"],[1,"color-patch"],[1,"summary-wrapper"],[1,"summary",3,"matTooltip","matTooltipDisabled"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"button",0),\u0275\u0275listener("click",function(){return ctx.openDialog()}),\u0275\u0275elementStart(1,"mat-icon"),\u0275\u0275text(2,"create"),\u0275\u0275elementEnd()(),\u0275\u0275element(3,"span",1),\u0275\u0275elementStart(4,"span",2)(5,"span",3),\u0275\u0275text(6),\u0275\u0275elementEnd()()),rf&2&&(\u0275\u0275advance(3),\u0275\u0275styleMap(ctx.calculateStyle()),\u0275\u0275advance(2),\u0275\u0275property("matTooltip",ctx.summary||"")("matTooltipDisabled",ctx.summaryTooltipDisabled),\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx.summary))},dependencies:[MatIconButton,MatIcon,MatTooltip],styles:["[_nghost-%COMP%]{display:flex;background-color:rgba(var(--body-color-rgb),.04)}.has-validation-errors[_nghost-%COMP%]{border:thin solid var(--warn);color:var(--warn)}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .color-patch[_ngcontent-%COMP%]{display:inline-block;vertical-align:top;height:40px;width:8px}[_nghost-%COMP%] .summary-wrapper[_ngcontent-%COMP%]{display:flex;align-items:center;padding:0 8px;overflow:hidden;flex:1}[_nghost-%COMP%] .summary-wrapper[_ngcontent-%COMP%] .summary[_ngcontent-%COMP%]{display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}"]});let GroupInputSummaryComponent3=_GroupInputSummaryComponent;return GroupInputSummaryComponent3})();function GroupInputComponent_Conditional_0_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"h3"),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label)}}function GroupInputComponent_Conditional_0_Conditional_1_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-group-input-summary",0),rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("field",ctx_r0.field)("componentFormGroup",ctx_r0.componentFormGroup)}}function GroupInputComponent_Conditional_0_Conditional_2_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-group-input-form",0),rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("field",ctx_r0.field)("componentFormGroup",ctx_r0.componentFormGroup)}}function GroupInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,GroupInputComponent_Conditional_0_Conditional_0_Template,2,1,"h3")(1,GroupInputComponent_Conditional_0_Conditional_1_Template,1,2,"ix-group-input-summary",0)(2,GroupInputComponent_Conditional_0_Conditional_2_Template,1,2,"ix-group-input-form",0),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275conditional(ctx_r0.field.level===0||!ctx_r0.isSummary()?0:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.isSummary()?1:2)}}var GroupInputComponent=(()=>{let _GroupInputComponent=class _GroupInputComponent extends ComponentInputComponent{isSummary(){return this.field.inputDescription.summary!==void 0}};_GroupInputComponent.\u0275fac=(()=>{let \u0275GroupInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275GroupInputComponent_BaseFactory||(\u0275GroupInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_GroupInputComponent)))(__ngFactoryType__||_GroupInputComponent)}})(),_GroupInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_GroupInputComponent,selectors:[["ix-group-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:1,vars:1,consts:[[3,"field","componentFormGroup"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,GroupInputComponent_Conditional_0_Template,3,2),rf&2&&\u0275\u0275conditional(ctx.field.hidden?-1:0)},dependencies:[GroupInputFormComponent,GroupInputSummaryComponent],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{font-size:11.5px!important;font-weight:500!important;text-transform:uppercase;letter-spacing:.8px;color:color-mix(in srgb,transparent,currentcolor 67%)}[_nghost-%COMP%] .mat-divider[_ngcontent-%COMP%]{margin:0 -16px 16px}[_nghost-%COMP%] .mat-divider.mat-divider-inset[_ngcontent-%COMP%]{margin-left:0}"]});let GroupInputComponent3=_GroupInputComponent;return GroupInputComponent3})();var GroupInput=class extends ComponentPropertiesInput{constructor(input2,value,context3,converter,level){super(input2,value,context3,converter,level),this.converter=converter,this.children=input2.children?.map(child=>converter.convertInput(child,value,context3,level+1))||[],this.hidden=this.children.some(child=>child.inputDescription.required&&child.hidden)}toFormControl(){return new FormGroup(this.converter.getFormControls(this.children))}transformValue(){return{[this.inputDescription.key]:this.children.reduce((obj,child)=>__spreadValues(__spreadValues({},obj),child.transformValue()),{})}}setValue(value){this.children.forEach(child=>child.setValue(value[child.inputDescription.key]))}};function IconInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function IconInputComponent_Conditional_13_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}var IconInputComponent=(()=>{let _IconInputComponent=class _IconInputComponent extends ComponentInputComponent{};_IconInputComponent.\u0275fac=(()=>{let \u0275IconInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275IconInputComponent_BaseFactory||(\u0275IconInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_IconInputComponent)))(__ngFactoryType__||_IconInputComponent)}})(),_IconInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_IconInputComponent,selectors:[["ix-icon-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:14,vars:7,consts:[[1,"description",3,"innerHTML"],[3,"formGroup"],[3,"formControlName","placeholder"],["value","warn"],["value","info"],["value","error"],["translate",""]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,IconInputComponent_Conditional_0_Template,2,3,"p",0),\u0275\u0275elementStart(1,"mat-form-field",1)(2,"mat-label"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"mat-select",2)(5,"mat-option",3),\u0275\u0275text(6,"Warning"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"mat-option",4),\u0275\u0275text(8,"Info"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"mat-option",5),\u0275\u0275text(10,"Error"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(11,"mat-hint"),\u0275\u0275text(12),\u0275\u0275elementEnd(),\u0275\u0275template(13,IconInputComponent_Conditional_13_Template,2,0,"mat-error",6),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275property("formGroup",ctx.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("formControlName",ctx.field.inputName)("placeholder",ctx.field.inputDescription.placeholder||""),\u0275\u0275advance(8),\u0275\u0275textInterpolate(ctx.field.inputDescription.hint),\u0275\u0275advance(),\u0275\u0275conditional(ctx.inputControl!=null&&ctx.inputControl.hasError("required")?13:-1))},dependencies:[NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,TranslateDirective,MatOption,MatFormField,MatLabel,MatHint,MatError,MatSelect,RenderMarkdownPipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}"]});let IconInputComponent3=_IconInputComponent;return IconInputComponent3})();function ImageInputDialogComponent_Conditional_11_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",12),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.clear())}),\u0275\u0275elementStart(1,"span",10),\u0275\u0275text(2,"CLEAR"),\u0275\u0275elementEnd()()}}var ImageInputDialogComponent=(()=>{let _ImageInputDialogComponent=class _ImageInputDialogComponent{constructor(){this.data=inject(MAT_DIALOG_DATA),this.dialogRef=inject(MatDialogRef),this.formBuilder=inject(FormBuilder),this.allowedMimeTypes=["image/gif","image/jpeg","image/png","image/webp"]}ngOnInit(){this.form=this.formBuilder.group({image:[this.data.image]})}clear(){this.file=null,this.form.controls.image.reset(),this.form.controls.image.markAsDirty()}fileChange(changes){changes&&(this.file=changes.file,this.form.controls.image.setValue(changes.previewSrc),this.form.controls.image.markAsDirty())}submit(){this.dialogRef.close({image:this.form.controls.image.value,file:this.file})}};_ImageInputDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ImageInputDialogComponent)},_ImageInputDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ImageInputDialogComponent,selectors:[["ix-image-input-dialog"]],standalone:!1,decls:19,vars:5,consts:[["autocomplete","off",3,"ngSubmit","formGroup"],[1,"ix-dialog__header"],["fxFlex","","mat-dialog-title",""],["mat-icon-button","","mat-dialog-close",""],["mat-dialog-content",""],[3,"fileChange","filePreviewSrc"],["mat-dialog-actions",""],["type","button","mat-button","","color","warn"],["fxFlex",""],["mat-button","","mat-dialog-close",""],["translate",""],["type","submit","mat-button","",3,"disabled"],["type","button","mat-button","","color","warn",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"form",0),\u0275\u0275listener("ngSubmit",function(){return ctx.submit()}),\u0275\u0275elementStart(1,"div",1)(2,"mat-toolbar")(3,"h1",2),\u0275\u0275text(4),\u0275\u0275elementEnd(),\u0275\u0275elementStart(5,"button",3)(6,"mat-icon"),\u0275\u0275text(7,"close"),\u0275\u0275elementEnd()()()(),\u0275\u0275elementStart(8,"div",4)(9,"ix-file-upload-drop-container",5),\u0275\u0275listener("fileChange",function($event){return ctx.fileChange($event)}),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(10,"div",6),\u0275\u0275template(11,ImageInputDialogComponent_Conditional_11_Template,3,0,"button",7),\u0275\u0275element(12,"span",8),\u0275\u0275elementStart(13,"button",9)(14,"span",10),\u0275\u0275text(15,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(16,"button",11)(17,"span",10),\u0275\u0275text(18,"CONFIRM"),\u0275\u0275elementEnd()()()()),rf&2&&(\u0275\u0275property("formGroup",ctx.form),\u0275\u0275advance(4),\u0275\u0275textInterpolate(ctx.data.title),\u0275\u0275advance(5),\u0275\u0275property("filePreviewSrc",ctx.form.value.image),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.form.value.image?11:-1),\u0275\u0275advance(5),\u0275\u0275property("disabled",ctx.form.pristine||ctx.form.invalid))},dependencies:[FileUploadDropContainerComponent,DefaultFlexDirective,\u0275NgNoValidate,NgControlStatusGroup,FormGroupDirective,TranslateDirective,MatButton,MatIconButton,MatDialogClose,MatDialogTitle,MatDialogActions,MatDialogContent,MatIcon,MatToolbar],styles:["[_nghost-%COMP%]{width:100dvw;height:100dvh;display:flex;flex-direction:column;flex:1}@media (min-width: 960px){[_nghost-%COMP%]{height:auto;width:auto;min-width:528px;max-width:528px}}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%]{padding:calc(env(safe-area-inset-top,0) + 16px) 24px 16px}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar{height:48px;padding-left:0;padding-right:0}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title{--mat-dialog-headline-padding: 0;color:inherit}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title:before{display:none}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .mdc-dialog__content[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] .mdc-dialog__title[_ngcontent-%COMP%]:before{height:calc(env(safe-area-inset-top,0) + 40px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]{padding:20px 24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .ix-list[_ngcontent-%COMP%]{margin-left:-24px;margin-right:-24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch;flex:1 1 auto;max-height:none;overflow:auto;-webkit-overflow-scrolling:touch}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%]{margin-left:0;margin-right:0}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 140px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions), [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions){padding-bottom:0}}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__banner[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 225px)}}@media (max-width: 959.9px){[_nghost-%COMP%] .mdc-dialog__actions[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.12);padding-bottom:calc(16px + env(safe-area-inset-bottom,0))}}[_nghost-%COMP%] form[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 auto;height:inherit}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:1rem}[_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{padding-bottom:24px}"]});let ImageInputDialogComponent3=_ImageInputDialogComponent;return ImageInputDialogComponent3})();function ImageInputFormComponent_Conditional_0_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"img",0),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("src",ctx_r0.value,\u0275\u0275sanitizeUrl)}}var ImageInputFormComponent=(()=>{let _ImageInputFormComponent=class _ImageInputFormComponent{constructor(dialog,publicFileService){this.dialog=dialog,this.publicFileService=publicFileService,this.onChange=()=>{},this.onTouched=()=>{}}registerOnChange(fn2){this.onChange=fn2}registerOnTouched(fn2){this.onTouched=fn2}writeValue(obj){this.value=obj,this.onChange(this.value)}openDialog(){this.dialog.open(ImageInputDialogComponent,{panelClass:"fullscreen",data:{image:this.value,title:this.dialogTitle}}).afterClosed().pipe(filter(data=>!!data),mergeMap(result=>this.uploadFile(result.file))).subscribe(url=>{this.writeValue(url),this.componentFormGroup.controls[this.field.inputName].setValue(url)})}uploadFile(file){return file?this.publicFileService.upload(file).pipe(map(response=>response.data.url)):of(null)}};_ImageInputFormComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ImageInputFormComponent)(\u0275\u0275directiveInject(MatDialog),\u0275\u0275directiveInject(PublicFileService))},_ImageInputFormComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ImageInputFormComponent,selectors:[["ix-image-input-form"]],inputs:{field:"field",componentFormGroup:"componentFormGroup",dialogTitle:"dialogTitle"},standalone:!1,features:[\u0275\u0275ProvidersFeature([{provide:NG_VALUE_ACCESSOR,useExisting:_ImageInputFormComponent,multi:!0}])],decls:4,vars:1,consts:[["alt","uploaded image",3,"src"],["mat-stroked-button","","color","primary","type","button",3,"click"],["translate",""]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,ImageInputFormComponent_Conditional_0_Template,1,1,"img",0),\u0275\u0275elementStart(1,"button",1),\u0275\u0275listener("click",function(){return ctx.openDialog()}),\u0275\u0275elementStart(2,"span",2),\u0275\u0275text(3,"UPLOAD_FILE"),\u0275\u0275elementEnd()()),rf&2&&\u0275\u0275conditional(ctx.value?0:-1)},dependencies:[TranslateDirective,MatButton],styles:["[_nghost-%COMP%]{display:flex;place-content:center left;margin-bottom:16px}[_nghost-%COMP%] img[_ngcontent-%COMP%]{flex-grow:0;padding-right:8px;width:40px;height:40px;object-fit:contain}[_nghost-%COMP%] button[_ngcontent-%COMP%]{flex-grow:1}.ng-invalid[_nghost-%COMP%] button[_ngcontent-%COMP%]{border-color:var(--warn)}"]});let ImageInputFormComponent3=_ImageInputFormComponent;return ImageInputFormComponent3})();function ImageInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}var ImageInputComponent=(()=>{let _ImageInputComponent=class _ImageInputComponent extends ComponentInputComponent{};_ImageInputComponent.\u0275fac=(()=>{let \u0275ImageInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275ImageInputComponent_BaseFactory||(\u0275ImageInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_ImageInputComponent)))(__ngFactoryType__||_ImageInputComponent)}})(),_ImageInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ImageInputComponent,selectors:[["ix-image-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:3,vars:6,consts:[[1,"description",3,"innerHTML"],[3,"formGroup"],[3,"field","componentFormGroup","formControlName","dialogTitle"]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,ImageInputComponent_Conditional_0_Template,2,3,"p",0),\u0275\u0275elementStart(1,"div",1),\u0275\u0275element(2,"ix-image-input-form",2),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275property("formGroup",ctx.componentFormGroup),\u0275\u0275advance(),\u0275\u0275property("field",ctx.field)("componentFormGroup",ctx.componentFormGroup)("formControlName",ctx.field.inputName)("dialogTitle",ctx.field.inputDescription.label||""))},dependencies:[NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,ImageInputFormComponent,RenderMarkdownPipe],styles:["[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}"]});let ImageInputComponent3=_ImageInputComponent;return ImageInputComponent3})();function moveItemInFormArray(array,fromIndex,toIndex){fromIndex=Math.max(0,Math.min(fromIndex,array.length-1)),toIndex=Math.max(0,Math.min(toIndex,array.length-1));let item=array.at(fromIndex);array.removeAt(fromIndex),array.insert(toIndex,item)}function ListItemComponent_ng_template_2_Template(rf,ctx){}var ListItemComponent=(()=>{let _ListItemComponent=class _ListItemComponent{constructor(inputConverter,cdRef){this.inputConverter=inputConverter,this.cdRef=cdRef,this.delete=new EventEmitter}ngAfterViewInit(){this.inputConverter.loadComponentInputs([this.item],this.componentFormGroup,this.formDirective.viewContainerRef),this.cdRef.detectChanges()}deleteItem(){this.delete.emit(this.index)}};_ListItemComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ListItemComponent)(\u0275\u0275directiveInject(INPUT_CONVERTER_TOKEN),\u0275\u0275directiveInject(ChangeDetectorRef))},_ListItemComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ListItemComponent,selectors:[["ix-list-item"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(InputControlFormDirective,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.formDirective=_t.first)}},inputs:{item:"item",index:"index",componentFormGroup:"componentFormGroup"},outputs:{delete:"delete"},standalone:!1,decls:9,vars:0,consts:[["fxLayout","row"],["fxFlex","",1,"list-item-content"],["ixInputControlForm",""],["mat-icon-button","","type","button","aria-label","Remove list item",1,"clear-button",3,"click"],["fxLayout","column","fxLayoutAlign","center end"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"div",1),\u0275\u0275template(2,ListItemComponent_ng_template_2_Template,0,0,"ng-template",2),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"button",3),\u0275\u0275listener("click",function(){return ctx.deleteItem()}),\u0275\u0275elementStart(4,"mat-icon"),\u0275\u0275text(5,"clear"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(6,"div",4)(7,"mat-icon"),\u0275\u0275text(8,"drag_indicator"),\u0275\u0275elementEnd()()())},dependencies:[DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatIconButton,MatIcon,InputControlFormDirective],styles:["[_nghost-%COMP%]{display:block;position:relative;font:400 14px/20px Roboto,Helvetica Neue,sans-serif;letter-spacing:normal}[_nghost-%COMP%] .clear-button[_ngcontent-%COMP%]{position:absolute;top:0;right:24px;bottom:0;opacity:0;transition:opacity .2s ease-in-out;will-change:opacity}[_nghost-%COMP%] .clear-button[_ngcontent-%COMP%]:hover{opacity:1!important}[_nghost-%COMP%] .list-item-content[_ngcontent-%COMP%]{overflow:hidden}[_nghost-%COMP%] .list-item-content[_ngcontent-%COMP%]:hover + .clear-button[_ngcontent-%COMP%]{opacity:1!important}.cdk-drag-preview[_nghost-%COMP%]{background-color:#fff}.cdk-drag-preview[_nghost-%COMP%] .clear-button[_ngcontent-%COMP%]{display:none}.cdk-drag-preview[_nghost-%COMP%] .list-item-content[_ngcontent-%COMP%]{box-sizing:border-box;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}"]});let ListItemComponent3=_ListItemComponent;return ListItemComponent3})();function ListInputComponent_Conditional_0_Conditional_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r1.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function ListInputComponent_Conditional_0_For_5_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-list-item",4),\u0275\u0275listener("delete",function(){let \u0275$index_11_r4=\u0275\u0275restoreView(_r3).$index,ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.deleteItem(\u0275$index_11_r4))}),\u0275\u0275elementEnd()}if(rf&2){let item_r5=ctx.$implicit,\u0275$index_11_r4=ctx.$index,ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("item",item_r5)("index",\u0275$index_11_r4)("componentFormGroup",ctx_r1.formGroupAt(\u0275$index_11_r4))}}function ListInputComponent_Conditional_0_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"h3"),\u0275\u0275text(1),\u0275\u0275elementEnd(),\u0275\u0275template(2,ListInputComponent_Conditional_0_Conditional_2_Template,2,3,"p",0),\u0275\u0275elementStart(3,"div",1),\u0275\u0275listener("cdkDropListDropped",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.drop($event))}),\u0275\u0275repeaterCreate(4,ListInputComponent_Conditional_0_For_5_Template,1,3,"ix-list-item",2,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd(),\u0275\u0275elementStart(6,"button",3),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.addItem())}),\u0275\u0275elementStart(7,"mat-icon"),\u0275\u0275text(8,"add"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"span"),\u0275\u0275text(10),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r1.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.field.inputDescription.description?2:-1),\u0275\u0275advance(2),\u0275\u0275repeater(ctx_r1.listInput.items),\u0275\u0275advance(6),\u0275\u0275textInterpolate(ctx_r1.addButtonText)}}var ListInputComponent=(()=>{let _ListInputComponent=class _ListInputComponent extends ComponentInputComponent{constructor(inputConverter,translate,cdRef,dialog){super(),this.inputConverter=inputConverter,this.translate=translate,this.cdRef=cdRef,this.dialog=dialog}get listInput(){return this.field}get formArray(){return this.componentFormGroup.get(this.field.inputDescription.key)}get addButtonText(){return this.field.inputDescription.itemType?.label?this.translate.instant("ADD_NAME",{name:this.field.inputDescription.itemType.label}):this.translate.instant("ADD_ANOTHER")}formGroupAt(index){return this.formArray.at(index)}addItem(){let itemType=this.listInput.inputDescription.itemType;if(itemType){let itemInput=this.inputConverter.convertInput(itemType,itemType.defaultValue,this.listInput.context,this.listInput.level+1),itemForm=new FormGroup({[itemType.key]:itemInput.toFormControl()});itemType.type==="Group"&&itemType.summary?this.dialog.open(GroupInputDialogComponent,{width:"500px",data:{field:itemInput,componentFormGroup:itemForm}}).afterClosed().subscribe(result=>{result&&(itemInput.setValue(itemForm.value[itemType.key]),this.listInput.push(itemInput),this.formArray.markAsDirty(),this.formArray.push(itemForm),this.cdRef.detectChanges())}):(this.listInput.push(itemInput),this.formArray.markAsDirty(),this.formArray.push(itemForm))}}deleteItem(index){this.listInput.removeAt(index),this.formArray.removeAt(index)}drop($event){moveItemInArray(this.listInput.items,$event.previousIndex,$event.currentIndex),moveItemInFormArray(this.formArray,$event.previousIndex,$event.currentIndex)}};_ListInputComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ListInputComponent)(\u0275\u0275directiveInject(INPUT_CONVERTER_TOKEN),\u0275\u0275directiveInject(TranslateService),\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(MatDialog))},_ListInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ListInputComponent,selectors:[["ix-list-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:1,vars:1,consts:[[1,"description",3,"innerHTML"],["cdkDropList","",3,"cdkDropListDropped"],["cdkDrag","",3,"item","index","componentFormGroup"],["type","button","mat-stroked-button","","color","primary",1,"add-button",3,"click"],["cdkDrag","",3,"delete","item","index","componentFormGroup"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,ListInputComponent_Conditional_0_Template,11,3),rf&2&&\u0275\u0275conditional(ctx.field.hidden?-1:0)},dependencies:[CdkDropList,CdkDrag,MatButton,MatIcon,ListItemComponent,RenderMarkdownPipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{font-size:11.5px!important;font-weight:500!important;text-transform:uppercase;letter-spacing:.8px;color:color-mix(in srgb,transparent,currentcolor 67%)}[_nghost-%COMP%] .add-button[_ngcontent-%COMP%]{--mdc-outlined-button-container-height: 32px;margin-top:16px}[_nghost-%COMP%] .cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}[_nghost-%COMP%] .cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}[_nghost-%COMP%] .cdk-drag[_ngcontent-%COMP%]:last-child{border:none}[_nghost-%COMP%] .cdk-drop-list-dragging[_ngcontent-%COMP%] .cdk-drag[_ngcontent-%COMP%]:not(.cdk-drag-placeholder){transition:transform .25s cubic-bezier(0,0,.2,1)}[_nghost-%COMP%] .cdk-drop-list-dragging[_ngcontent-%COMP%] .cdk-drag-placeholder[_ngcontent-%COMP%]{cursor:grabbing}[_nghost-%COMP%] .cdk-drag[_ngcontent-%COMP%]{cursor:grab}[_nghost-%COMP%] ix-list-item[_ngcontent-%COMP%] + ix-list-item[_ngcontent-%COMP%]{margin-top:8px}"]});let ListInputComponent3=_ListInputComponent;return ListInputComponent3})();var ListInput=class extends ComponentPropertiesInput{constructor(input2,value,context3,converter,level){if(super(input2,value,context3,converter,level),input2.itemType){let itemType=input2.itemType;this.items=isArray_default(value)?value.map(value2=>converter.convertInput(itemType,value2,context3,level+1)):[],this.hidden=!!itemType.children?.some(item=>{let child=converter.convertInput(item,value,context3,level+1);return child.inputDescription.required&&child.hidden})}}toFormControl(){return new FormArray(this.items.map(item=>new FormGroup({[item.inputDescription.key]:item.toFormControl()})))}transformValue(){return{[this.inputDescription.key]:this.items.map(item=>item.transformValue())}}setValue(value){value.length===this.items.length&&this.items.forEach((item,i)=>item.setValue(value[i][item.inputDescription.key]))}push(item){this.items.push(item)}removeAt(index){this.items.splice(index,1)}};var LiveMetricInputFacade=(()=>{let _LiveMetricInputFacade=class _LiveMetricInputFacade extends RawMetricInputFacade{selectorDataIsLoaded(field){return this._selectorDataIsLoaded(field,selectAllLoadedForAgent2)}loadAgentDataVariables(agentId){this.store.dispatch(ensureAll24({agentId}))}selectorsForAgent(agentId,target){return this.loadAgentDataVariables(agentId),this._selectorsForAgent(agentId,target,selectAllForAgent2(agentId),{name:"variables",slug:"variable"})}};_LiveMetricInputFacade.\u0275fac=(()=>{let \u0275LiveMetricInputFacade_BaseFactory;return function(__ngFactoryType__){return(\u0275LiveMetricInputFacade_BaseFactory||(\u0275LiveMetricInputFacade_BaseFactory=\u0275\u0275getInheritedFactory(_LiveMetricInputFacade)))(__ngFactoryType__||_LiveMetricInputFacade)}})(),_LiveMetricInputFacade.\u0275prov=\u0275\u0275defineInjectable({token:_LiveMetricInputFacade,factory:_LiveMetricInputFacade.\u0275fac,providedIn:"root"});let LiveMetricInputFacade2=_LiveMetricInputFacade;return LiveMetricInputFacade2})();var _c019=a0=>({min:a0});function LiveMetricInputComponent_Conditional_0_Conditional_3_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",1),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_5_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-error"),\u0275\u0275text(1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementEnd()),rf&2){let tmp_3_0,ctx_r0=\u0275\u0275nextContext(3);\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind2(2,1,"__MESSAGE__.MIN",\u0275\u0275pureFunction1(4,_c019,ctx_r0.decimalsControl==null||(tmp_3_0=ctx_r0.decimalsControl.getError("min"))==null?null:tmp_3_0.min))," ")}}function LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_6_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.INTEGER"),\u0275\u0275elementEnd())}function LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.INVALID_NUMBER"),\u0275\u0275elementEnd())}function LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_8_Conditional_4_Template(rf,ctx){if(rf&1){let _r2=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-translation-icon-button",11),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r2);let ctx_r0=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r0.setUnitTranslationKey($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(4);\u0275\u0275property("key",ctx_r0.unitTranslationKey)}}function LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_8_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-form-field",5)(1,"mat-label",6),\u0275\u0275text(2,"UNIT"),\u0275\u0275elementEnd(),\u0275\u0275element(3,"input",9),\u0275\u0275template(4,LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_8_Conditional_4_Template,1,1,"ix-translation-icon-button",10),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext(3);\u0275\u0275property("formGroupName",ctx_r0.field.inputDescription.key),\u0275\u0275advance(3),\u0275\u0275property("placeholder",ctx_r0.unitPlaceholder),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.translation?4:-1)}}function LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_9_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-label",6),\u0275\u0275text(2,"UNIT"),\u0275\u0275elementEnd(),\u0275\u0275element(3,"input",12),\u0275\u0275pipe(4,"translate"),\u0275\u0275pipe(5,"trimTranslationNamespace"),\u0275\u0275elementStart(6,"ix-translation-icon-button",11),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r3);let ctx_r0=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r0.setUnitTranslationKey($event))}),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(3);\u0275\u0275advance(3),\u0275\u0275property("value",ctx_r0.unitTranslationKey?\u0275\u0275pipeBind1(5,4,\u0275\u0275pipeBind1(4,2,ctx_r0.unitTranslationKey)):""),\u0275\u0275advance(3),\u0275\u0275property("key",ctx_r0.unitTranslationKey)}}function LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_14_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.INVALID_FACTOR"),\u0275\u0275elementEnd())}function LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_15_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.INVALID_NUMBER"),\u0275\u0275elementEnd())}function LiveMetricInputComponent_Conditional_0_Conditional_6_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",4)(1,"mat-form-field",5)(2,"mat-label",6),\u0275\u0275text(3,"DECIMALS"),\u0275\u0275elementEnd(),\u0275\u0275element(4,"input",7),\u0275\u0275template(5,LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_5_Template,3,6,"mat-error")(6,LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_6_Template,2,0,"mat-error",6)(7,LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_7_Template,2,0,"mat-error",6),\u0275\u0275elementEnd(),\u0275\u0275template(8,LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_8_Template,5,3,"mat-form-field",5)(9,LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_9_Template,7,6,"mat-form-field"),\u0275\u0275elementStart(10,"mat-form-field",5)(11,"mat-label",6),\u0275\u0275text(12,"FACTOR"),\u0275\u0275elementEnd(),\u0275\u0275element(13,"input",8),\u0275\u0275template(14,LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_14_Template,2,0,"mat-error",6)(15,LiveMetricInputComponent_Conditional_0_Conditional_6_Conditional_15_Template,2,0,"mat-error",6),\u0275\u0275elementEnd()()),rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275advance(),\u0275\u0275property("formGroupName",ctx_r0.field.inputDescription.key),\u0275\u0275advance(4),\u0275\u0275conditional(ctx_r0.decimalsControl!=null&&ctx_r0.decimalsControl.hasError("min")?5:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.decimalsControl!=null&&ctx_r0.decimalsControl.hasError("integer")?6:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.decimalsControl!=null&&ctx_r0.decimalsControl.hasError("number")?7:-1),\u0275\u0275advance(),\u0275\u0275conditional(!ctx_r0.translation||!ctx_r0.unitTranslationKey?8:9),\u0275\u0275advance(2),\u0275\u0275property("formGroupName",ctx_r0.field.inputDescription.key),\u0275\u0275advance(3),\u0275\u0275property("placeholder",ctx_r0.factorPlaceholder||""),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.factorControl!=null&&ctx_r0.factorControl.hasError("decimals")?14:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.factorControl!=null&&ctx_r0.factorControl.hasError("number")?15:-1)}}function LiveMetricInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"h3"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275template(3,LiveMetricInputComponent_Conditional_0_Conditional_3_Template,2,3,"p",1),\u0275\u0275elementStart(4,"div",2),\u0275\u0275element(5,"ix-selector-input",3),\u0275\u0275elementEnd(),\u0275\u0275template(6,LiveMetricInputComponent_Conditional_0_Conditional_6_Template,16,9,"div",4),\u0275\u0275elementEnd()),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("formGroup",ctx_r0.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.field.inputDescription.description?3:-1),\u0275\u0275advance(2),\u0275\u0275property("pageVersionId",ctx_r0.field.context.component.pageVersion==null?null:ctx_r0.field.context.component.pageVersion.publicId)("selectorControl",ctx_r0.selectorControl)("selectors",ctx_r0.selectors)("disabled",!ctx_r0.selectorDataIsLoaded)("required",ctx_r0.required),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.showDecimalsUnitFactor?6:-1)}}var LiveMetricInputComponent=(()=>{let _LiveMetricInputComponent=class _LiveMetricInputComponent extends RawMetricInputComponent{constructor(){super(...arguments),this.facade=inject(LiveMetricInputFacade)}};_LiveMetricInputComponent.\u0275fac=(()=>{let \u0275LiveMetricInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275LiveMetricInputComponent_BaseFactory||(\u0275LiveMetricInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_LiveMetricInputComponent)))(__ngFactoryType__||_LiveMetricInputComponent)}})(),_LiveMetricInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_LiveMetricInputComponent,selectors:[["ix-live-metric-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:1,vars:1,consts:[[3,"formGroup"],[1,"description",3,"innerHTML"],["fxLayout","column"],["fxFlex","","label","VARIABLE",3,"pageVersionId","selectorControl","selectors","disabled","required"],["fxLayout","row","fxLayoutGap","8px"],["fxFlex","",3,"formGroupName"],["translate",""],["formControlName","decimals","min","0","type","number","matInput",""],["formControlName","factor","type","number","matInput","",3,"placeholder"],["formControlName","unit","matInput","",3,"placeholder"],[3,"key"],[3,"setTranslationKey","key"],["matInput","","disabled","",3,"value"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,LiveMetricInputComponent_Conditional_0_Template,7,9,"div",0),rf&2&&\u0275\u0275conditional(ctx.field.hidden?-1:0)},dependencies:[NumberInputValidatorDirective,SelectorInputComponent,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultFlexDirective,DefaultValueAccessor,NumberValueAccessor,NgControlStatus,NgControlStatusGroup,MinValidator,FormGroupDirective,FormControlName,FormGroupName,TranslateDirective,MatFormField,MatLabel,MatError,MatInput,TranslationIconButtonComponent,RenderMarkdownPipe,TranslatePipe,TrimTranslationNamespacePipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{font-size:11.5px!important;font-weight:500!important;text-transform:uppercase;letter-spacing:.8px;color:color-mix(in srgb,transparent,currentcolor 67%)}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{display:block}"]});let LiveMetricInputComponent3=_LiveMetricInputComponent;return LiveMetricInputComponent3})();var LiveMetricInput=class extends RawMetricInput{constructor(input2,value,context3,converter,level,injector){super(input2,value,context3,converter,level,injector),this.hidden=!injector.get(PlatformFeaturesService).instantCheck([{canInput:"live-data"}])}};var MaterialIconFieldsetFacade=(()=>{let _MaterialIconFieldsetFacade=class _MaterialIconFieldsetFacade{groups(appearance){return from(import("./chunk-PLQ7EYAV.js")).pipe(map(({ICONS_METADATA})=>{let groupsDict=ICONS_METADATA.reduce((groups,icon)=>(appearance==="legacy"&&icon.unsupported_families.includes("Material Icons")||appearance==="symbols"&&icon.unsupported_families.includes("Material Symbols Outlined")||icon.categories.forEach(category=>{groups[category]||(groups[category]=[]),groups[category].push(icon)}),groups),{});return Object.keys(groupsDict).map(key=>({name:key,icons:groupsDict[key]}))}),map(groups=>groups.map(group=>__spreadProps(__spreadValues({},group),{popularity:Math.round(group.icons.reduce((acc,curr)=>acc+curr.popularity,0)/group.icons.length),icons:group.icons.sort((a,b)=>b.popularity-a.popularity)})).sort((a,b)=>b.popularity-a.popularity)))}};_MaterialIconFieldsetFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_MaterialIconFieldsetFacade)},_MaterialIconFieldsetFacade.\u0275prov=\u0275\u0275defineInjectable({token:_MaterialIconFieldsetFacade,factory:_MaterialIconFieldsetFacade.\u0275fac,providedIn:"root"});let MaterialIconFieldsetFacade2=_MaterialIconFieldsetFacade;return MaterialIconFieldsetFacade2})();var _c020=a0=>({"with-errors":a0}),_forTrack04=($index,$item)=>$item.name;function MaterialIconFieldsetComponent_For_7_For_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-option",13)(1,"mat-icon"),\u0275\u0275text(2),\u0275\u0275elementEnd()()),rf&2){let icon_r2=ctx.$implicit;\u0275\u0275property("value",icon_r2.name)("title",icon_r2.name),\u0275\u0275advance(2),\u0275\u0275textInterpolate(icon_r2.name)}}function MaterialIconFieldsetComponent_For_7_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-optgroup",4),\u0275\u0275repeaterCreate(1,MaterialIconFieldsetComponent_For_7_For_2_Template,3,3,"mat-option",13,_forTrack04),\u0275\u0275elementEnd()),rf&2){let group_r3=ctx.$implicit;\u0275\u0275property("label",group_r3.name),\u0275\u0275advance(),\u0275\u0275repeater(group_r3.icons)}}function MaterialIconFieldsetComponent_ng_container_15_Template(rf,ctx){rf&1&&\u0275\u0275elementContainer(0)}function MaterialIconFieldsetComponent_Conditional_16_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",14),\u0275\u0275pipe(1,"translate"),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r4);let ctx_r4=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r4.clear())}),\u0275\u0275elementStart(2,"mat-icon"),\u0275\u0275text(3,"close"),\u0275\u0275elementEnd()()}rf&2&&\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(1,1,"CLEAR"))}function MaterialIconFieldsetComponent_Conditional_18_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",12),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function MaterialIconFieldsetComponent_ng_template_19_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-icon",15),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r4=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r4.value)}}function MaterialIconFieldsetComponent_ng_template_21_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-icon",16),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r4=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275textInterpolate(ctx_r4.placeholderIcon)}}var MaterialIconFieldsetComponent=(()=>{let _MaterialIconFieldsetComponent=class _MaterialIconFieldsetComponent{constructor(){this.appearance="symbols",this.placeholderIcon="add_reaction",this.filteredIconGroups$=new ReplaySubject(1),this.queryFormControl=new FormControl(""),this.destroy=inject(DestroyRef),this.facade=inject(MaterialIconFieldsetFacade)}get required(){return this.form.hasValidator(Validators.required)}get value(){return this.form.value}ngOnInit(){this.facade.groups(this.appearance).pipe(takeUntilDestroyed(this.destroy)).subscribe(groups=>{this.groups=groups,this.filteredIconGroups$.next(this.copyIconGroups(this.groups))}),this.queryFormControl.valueChanges.pipe(debounceTime(100),takeUntilDestroyed(this.destroy)).subscribe(()=>{this.filterIconGroups()})}ngAfterViewInit(){this.select._calculateOverlayScroll=this._calculateOverlayScroll.bind(this)}clear(){this.form.setValue(null)}toggleSelect(){this.select.panelOpen?this.select.close():this.select.open()}filterIconGroups(){if(!this.groups)return;let query=this.queryFormControl.value||"",iconGroupsCopy=this.copyIconGroups(this.groups);if(!query){this.filteredIconGroups$.next(iconGroupsCopy);return}query=query.toLowerCase(),this.filteredIconGroups$.next(iconGroupsCopy.filter(iconGroup=>(iconGroup.name.toLowerCase().includes(query)||(iconGroup.icons=iconGroup.icons.filter(icon=>icon.name.toLowerCase().includes(query)||icon.tags.some(tag=>tag.toLowerCase().includes(query)))),iconGroup.icons.length>0)))}copyIconGroups(iconGroups){let iconGroupsCopy=[];return iconGroups.forEach(iconGroup=>{iconGroupsCopy.push({name:iconGroup.name,popularity:iconGroup.popularity,icons:iconGroup.icons.slice()})}),iconGroupsCopy}_calculateOverlayScroll(selectedIndex,scrollBuffer,maxScroll){let selectedLabel=this.select.selected?this.select.selected.group?.label:null,_selectedGroupIndex=selectedLabel?this.groups.findIndex(group=>group.name===selectedLabel):-1,_selectedIndex=selectedIndex-_selectedGroupIndex-2,itemHeight=40,optionOffsetFromScrollTop=itemHeight*Math.ceil(_selectedIndex/7)+Math.round((_selectedGroupIndex+1)*48),halfOptionHeight=itemHeight/2,optimalScrollPosition=optionOffsetFromScrollTop-scrollBuffer+halfOptionHeight;return Math.min(Math.max(0,optimalScrollPosition),maxScroll)}};_MaterialIconFieldsetComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_MaterialIconFieldsetComponent)},_MaterialIconFieldsetComponent.\u0275cmp=\u0275\u0275defineComponent({type:_MaterialIconFieldsetComponent,selectors:[["ix-material-icon-fieldset"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(MatSelect,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.select=_t.first)}},inputs:{appearance:"appearance",form:"form",label:"label",placeholderIcon:"placeholderIcon"},decls:23,vars:20,consts:[["selectedIcon",""],["defaultIcon",""],["panelClass","material-icon-select-panel",1,"select",3,"formControl"],[3,"formControl","placeholderLabel","noEntriesFoundLabel"],[1,"icon-group",3,"label"],["fxLayout","column",3,"ngClass"],["data-testid","material-icon-fieldset-label",1,"label"],["fxLayout","row","fxLayoutAlign","start center"],["type","button","mat-icon-button","",1,"select-trigger-button",3,"click","disabled"],[4,"ngTemplateOutlet"],["type","button","mat-icon-button","",1,"clear-button",3,"matTooltip"],[1,"errors"],["translate",""],[1,"icon",3,"value","title"],["type","button","mat-icon-button","",1,"clear-button",3,"click","matTooltip"],["data-testid","material-icon-fieldset-selected-icon"],["data-testid","material-icon-fieldset-placeholder-icon"]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-select",2)(2,"mat-option"),\u0275\u0275element(3,"ngx-mat-select-search",3),\u0275\u0275pipe(4,"translate"),\u0275\u0275pipe(5,"translate"),\u0275\u0275elementEnd(),\u0275\u0275repeaterCreate(6,MaterialIconFieldsetComponent_For_7_Template,3,1,"mat-optgroup",4,_forTrack04),\u0275\u0275pipe(8,"async"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(9,"div",5)(10,"div",6),\u0275\u0275text(11),\u0275\u0275pipe(12,"translate"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(13,"div",7)(14,"button",8),\u0275\u0275listener("click",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.toggleSelect())}),\u0275\u0275template(15,MaterialIconFieldsetComponent_ng_container_15_Template,1,0,"ng-container",9),\u0275\u0275elementEnd(),\u0275\u0275template(16,MaterialIconFieldsetComponent_Conditional_16_Template,4,3,"button",10),\u0275\u0275elementEnd(),\u0275\u0275elementStart(17,"div",11),\u0275\u0275template(18,MaterialIconFieldsetComponent_Conditional_18_Template,2,0,"mat-error",12),\u0275\u0275elementEnd()(),\u0275\u0275template(19,MaterialIconFieldsetComponent_ng_template_19_Template,2,1,"ng-template",null,0,\u0275\u0275templateRefExtractor)(21,MaterialIconFieldsetComponent_ng_template_21_Template,2,1,"ng-template",null,1,\u0275\u0275templateRefExtractor)}if(rf&2){let selectedIcon_r6=\u0275\u0275reference(20),defaultIcon_r7=\u0275\u0275reference(22);\u0275\u0275advance(),\u0275\u0275property("formControl",ctx.form),\u0275\u0275advance(2),\u0275\u0275property("formControl",ctx.queryFormControl)("placeholderLabel",\u0275\u0275pipeBind1(4,10,"SEARCH"))("noEntriesFoundLabel",\u0275\u0275pipeBind1(5,12,"NO_RESULTS_FOUND")),\u0275\u0275advance(3),\u0275\u0275repeater(\u0275\u0275pipeBind1(8,14,ctx.filteredIconGroups$)),\u0275\u0275advance(3),\u0275\u0275property("ngClass",\u0275\u0275pureFunction1(18,_c020,ctx.form.touched&&ctx.form.invalid)),\u0275\u0275advance(2),\u0275\u0275textInterpolate1(" ",(ctx.label||\u0275\u0275pipeBind1(12,16,"ICON"))+(ctx.required?" *":"")," "),\u0275\u0275advance(3),\u0275\u0275property("disabled",ctx.form.disabled),\u0275\u0275advance(),\u0275\u0275property("ngTemplateOutlet",ctx.value?selectedIcon_r6:defaultIcon_r7),\u0275\u0275advance(),\u0275\u0275conditional(ctx.value&&!ctx.form.disabled?16:-1),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.form.touched&&ctx.form.hasError("required")?18:-1)}},dependencies:[AsyncPipe,NgClass,NgTemplateOutlet,FormsModule,NgControlStatus,FlexLayoutModule,DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultClassDirective,ReactiveFormsModule,FormControlDirective,MatButtonModule,MatIconButton,MatFormFieldModule,MatFormField,MatError,MatIconModule,MatIcon,MatTooltipModule,MatTooltip,MatSelectModule,MatSelect,MatOption,MatOptgroup,NgxMatSelectSearchModule,MatSelectSearchComponent,TranslateModule,TranslatePipe,TranslateDirective],styles:["[_nghost-%COMP%]{display:block;position:relative;padding-bottom:1.25em}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{position:absolute;left:40px;visibility:hidden}[_nghost-%COMP%] .select-trigger-button[_ngcontent-%COMP%]{background-color:rgba(var(--body-color-rgb),.04)}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{margin-bottom:4px;transform-origin:top left;transform:scale(.75) perspective(100px) translateZ(.001px);font-size:14px;color:#0000008a}[_nghost-%COMP%] .with-errors[_ngcontent-%COMP%] .label[_ngcontent-%COMP%], [_nghost-%COMP%] .with-errors[_ngcontent-%COMP%] .select-trigger-button[_ngcontent-%COMP%]{color:var(--warn)}[_nghost-%COMP%] .errors[_ngcontent-%COMP%]{position:absolute;top:66px;left:0;font-size:10.5px}[_nghost-%COMP%] .clear-button[_ngcontent-%COMP%]{--mdc-icon-button-state-layer-size: 32px;--mdc-icon-button-icon-size: 20px;margin-left:4px}"],changeDetection:0});let MaterialIconFieldsetComponent2=_MaterialIconFieldsetComponent;return MaterialIconFieldsetComponent2})();function MaterialIconInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}var MaterialIconInputComponent=(()=>{let _MaterialIconInputComponent=class _MaterialIconInputComponent extends ComponentInputComponent{get inputControl(){return super.inputControl}};_MaterialIconInputComponent.\u0275fac=(()=>{let \u0275MaterialIconInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275MaterialIconInputComponent_BaseFactory||(\u0275MaterialIconInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_MaterialIconInputComponent)))(__ngFactoryType__||_MaterialIconInputComponent)}})(),_MaterialIconInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_MaterialIconInputComponent,selectors:[["ix-material-icon-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:2,vars:3,consts:[[1,"description",3,"innerHTML"],["appearance","legacy",3,"form","label"]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,MaterialIconInputComponent_Conditional_0_Template,2,3,"p",0),\u0275\u0275element(1,"ix-material-icon-fieldset",1)),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275property("form",ctx.inputControl)("label",ctx.field.inputDescription.label||""))},dependencies:[MaterialIconFieldsetComponent,RenderMarkdownPipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}"]});let MaterialIconInputComponent3=_MaterialIconInputComponent;return MaterialIconInputComponent3})();var _c021=a0=>({min:a0}),_c18=a0=>({max:a0});function NumberInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function NumberInputComponent_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",3),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function NumberInputComponent_Conditional_8_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",3),\u0275\u0275text(1,"__MESSAGE__.INVALID_NUMBER"),\u0275\u0275elementEnd())}function NumberInputComponent_Conditional_9_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-error",4),\u0275\u0275text(1,"__MESSAGE__.MIN"),\u0275\u0275elementEnd()),rf&2){let tmp_1_0,ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("translateParams",\u0275\u0275pureFunction1(1,_c021,ctx_r0.inputControl==null||(tmp_1_0=ctx_r0.inputControl.getError("min"))==null?null:tmp_1_0.min))}}function NumberInputComponent_Conditional_10_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-error",4),\u0275\u0275text(1,"__MESSAGE__.MAX"),\u0275\u0275elementEnd()),rf&2){let tmp_1_0,ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("translateParams",\u0275\u0275pureFunction1(1,_c18,ctx_r0.inputControl==null||(tmp_1_0=ctx_r0.inputControl.getError("max"))==null?null:tmp_1_0.max))}}var NumberInputComponent=(()=>{let _NumberInputComponent=class _NumberInputComponent extends ComponentInputComponent{enterKeyDownHandler(event2){event2.target.blur()}};_NumberInputComponent.\u0275fac=(()=>{let \u0275NumberInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275NumberInputComponent_BaseFactory||(\u0275NumberInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_NumberInputComponent)))(__ngFactoryType__||_NumberInputComponent)}})(),_NumberInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_NumberInputComponent,selectors:[["ix-number-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:11,vars:11,consts:[[1,"description",3,"innerHTML"],[3,"formGroup"],["matInput","","type","number","autocomplete","off","data-lpignore","true",3,"keydown.enter","step","formControlName","placeholder"],["translate",""],["translate","",3,"translateParams"]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,NumberInputComponent_Conditional_0_Template,2,3,"p",0),\u0275\u0275elementStart(1,"mat-form-field",1)(2,"mat-label"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"input",2),\u0275\u0275listener("keydown.enter",function($event){return ctx.enterKeyDownHandler($event)}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(5,"mat-hint"),\u0275\u0275text(6),\u0275\u0275elementEnd(),\u0275\u0275template(7,NumberInputComponent_Conditional_7_Template,2,0,"mat-error",3)(8,NumberInputComponent_Conditional_8_Template,2,0,"mat-error",3)(9,NumberInputComponent_Conditional_9_Template,2,3,"mat-error",4)(10,NumberInputComponent_Conditional_10_Template,2,3,"mat-error",4),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275property("formGroup",ctx.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("step",ctx.field.inputDescription.step)("formControlName",ctx.field.inputName)("placeholder",ctx.field.inputDescription.placeholder||""),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx.field.inputDescription.hint),\u0275\u0275advance(),\u0275\u0275conditional(ctx.inputControl!=null&&ctx.inputControl.hasError("required")?7:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.inputControl!=null&&ctx.inputControl.hasError("number")?8:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.inputControl!=null&&ctx.inputControl.hasError("min")?9:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.inputControl!=null&&ctx.inputControl.hasError("max")?10:-1))},dependencies:[NumberInputValidatorDirective,DefaultValueAccessor,NumberValueAccessor,NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,TranslateDirective,MatFormField,MatLabel,MatHint,MatError,MatInput,RenderMarkdownPipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}"]});let NumberInputComponent3=_NumberInputComponent;return NumberInputComponent3})();var NumberInput=class extends ComponentPropertiesInput{toFormControl(){let value=this.value??this.inputDescription.defaultValue,validators=this.getValidators(),formControl=new FormControl(value,validators);return this.inputDescription.disabled&&formControl.disable(),formControl}getValidators(){let validators=[],{min:min2,max:max2,required}=this.inputDescription;return required&&validators.push(Validators.required),min2!==void 0&&validators.push(Validators.min(min2)),max2!==void 0&&validators.push(Validators.max(max2)),validators}};function SelectionInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function SelectionInputComponent_For_6_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-option",3),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let option_r2=ctx.$implicit;\u0275\u0275property("value",option_r2.value),\u0275\u0275advance(),\u0275\u0275textInterpolate(option_r2.label)}}function SelectionInputComponent_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",4),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}var SelectionInputComponent=(()=>{let _SelectionInputComponent=class _SelectionInputComponent extends ComponentInputComponent{};_SelectionInputComponent.\u0275fac=(()=>{let \u0275SelectionInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275SelectionInputComponent_BaseFactory||(\u0275SelectionInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_SelectionInputComponent)))(__ngFactoryType__||_SelectionInputComponent)}})(),_SelectionInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_SelectionInputComponent,selectors:[["ix-selection-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:8,vars:5,consts:[[1,"description",3,"innerHTML"],[3,"formGroup"],[3,"formControlName"],[3,"value"],["translate",""]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,SelectionInputComponent_Conditional_0_Template,2,3,"p",0),\u0275\u0275elementStart(1,"mat-form-field",1)(2,"mat-label"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"mat-select",2),\u0275\u0275repeaterCreate(5,SelectionInputComponent_For_6_Template,2,2,"mat-option",3,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd(),\u0275\u0275template(7,SelectionInputComponent_Conditional_7_Template,2,0,"mat-error",4),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275property("formGroup",ctx.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("formControlName",ctx.field.inputName),\u0275\u0275advance(),\u0275\u0275repeater(ctx.field.inputDescription.options),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.inputControl!=null&&ctx.inputControl.hasError("required")?7:-1))},dependencies:[NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,TranslateDirective,MatOption,MatFormField,MatLabel,MatError,MatSelect,RenderMarkdownPipe],styles:["[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{display:block}"]});let SelectionInputComponent3=_SelectionInputComponent;return SelectionInputComponent3})();var SelectionInput=class extends ComponentPropertiesInput{constructor(input2,value,context3,converter,level){super(input2,value,context3,converter,level),this.setValue(value)}setValue(value){super.setValue(value)}transformValue(){let selectedOption=this.inputDescription.options?.find(v=>v.value===this.value);return selectedOption?__spreadProps(__spreadValues({},super.transformValue()),{["$"+this.inputDescription.key]:selectedOption}):super.transformValue()}};var StringInput=class extends ComponentPropertiesInput{constructor(input2,value,context3,converter,level,injector){super(input2,value,context3,converter,level),this.translate=injector.get(TranslateService),this.setValue(value)}transformValue(){return isString_default(this.value)&&this.value.startsWith("__TRANSLATION__.")?{[this.inputDescription.key]:trimNamespace(this.translate.instant(this.value))}:super.transformValue()}setValue(value){super.setValue(isNil_default(value)?value:String(value))}};function StringInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function StringInputComponent_Conditional_1_Conditional_4_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-translation-icon-button",5),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r3);let ctx_r0=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r0.setTranslationKey($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("key",ctx_r0.translationKey)}}function StringInputComponent_Conditional_1_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",4),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function StringInputComponent_Conditional_1_Template(rf,ctx){if(rf&1){let _r2=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field",1)(1,"mat-label"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"input",2),\u0275\u0275listener("keydown.enter",function($event){\u0275\u0275restoreView(_r2);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.enterKeyDownHandler($event))}),\u0275\u0275elementEnd(),\u0275\u0275template(4,StringInputComponent_Conditional_1_Conditional_4_Template,1,1,"ix-translation-icon-button",3),\u0275\u0275elementStart(5,"mat-hint"),\u0275\u0275text(6),\u0275\u0275elementEnd(),\u0275\u0275template(7,StringInputComponent_Conditional_1_Conditional_7_Template,2,0,"mat-error",4),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("formGroup",ctx_r0.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("formControlName",ctx_r0.field.inputName)("placeholder",ctx_r0.field.inputDescription.placeholder||""),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.translation?4:-1),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.hint),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.inputControl!=null&&ctx_r0.inputControl.hasError("required")?7:-1)}}function StringInputComponent_Conditional_2_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-label"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275element(3,"input",6),\u0275\u0275pipe(4,"translate"),\u0275\u0275pipe(5,"trimTranslationNamespace"),\u0275\u0275elementStart(6,"ix-translation-icon-button",5),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r4);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.setTranslationKey($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"mat-hint"),\u0275\u0275text(8),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("value",ctx_r0.translationKey?\u0275\u0275pipeBind1(5,7,\u0275\u0275pipeBind1(4,5,ctx_r0.translationKey)):"")("placeholder",ctx_r0.field.inputDescription.placeholder||""),\u0275\u0275advance(3),\u0275\u0275property("key",ctx_r0.translationKey),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.hint)}}var StringInputComponent=(()=>{let _StringInputComponent=class _StringInputComponent extends ComponentInputComponent{constructor(){super(...arguments),this.translate=inject(TranslateService)}ngOnInit(){this.translation=environment.appName!=="Simulator"&&(this.field?.inputDescription?.translate??!0),this.translationKey=this.inputControl?.value?.startsWith("__TRANSLATION__.")?this.inputControl.value:void 0}setTranslationKey(translationKey){this.translationKey=translationKey,translationKey?this.inputControl?.setValue(this.translationKey):this.inputControl?.setValue(this.translate.instant(this.field.value))}enterKeyDownHandler(event2){event2.target.blur()}};_StringInputComponent.\u0275fac=(()=>{let \u0275StringInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275StringInputComponent_BaseFactory||(\u0275StringInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_StringInputComponent)))(__ngFactoryType__||_StringInputComponent)}})(),_StringInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_StringInputComponent,selectors:[["ix-string-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:3,vars:2,consts:[[1,"description",3,"innerHTML"],[3,"formGroup"],["matInput","","autocomplete","off","data-lpignore","true",3,"keydown.enter","formControlName","placeholder"],[3,"key"],["translate",""],[3,"setTranslationKey","key"],["matInput","","disabled","","autocomplete","off","data-lpignore","true",3,"value","placeholder"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,StringInputComponent_Conditional_0_Template,2,3,"p",0)(1,StringInputComponent_Conditional_1_Template,8,7,"mat-form-field",1)(2,StringInputComponent_Conditional_2_Template,9,9,"mat-form-field"),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275conditional(!ctx.translation||!ctx.translationKey?1:2))},dependencies:[DefaultValueAccessor,NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,TranslateDirective,MatFormField,MatLabel,MatHint,MatError,MatInput,TranslationIconButtonComponent,RenderMarkdownPipe,TranslatePipe,TrimTranslationNamespacePipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}"]});let StringInputComponent3=_StringInputComponent;return StringInputComponent3})();var TextInput=class extends StringInput{};function TextInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function TextInputComponent_Conditional_1_Conditional_4_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-translation-icon-button",5),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r3);let ctx_r0=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r0.setTranslationKey($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("key",ctx_r0.translationKey)}}function TextInputComponent_Conditional_1_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",4),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function TextInputComponent_Conditional_1_Template(rf,ctx){if(rf&1){let _r2=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field",1)(1,"mat-label"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"textarea",2),\u0275\u0275listener("keydown.enter",function($event){return \u0275\u0275restoreView(_r2),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementEnd(),\u0275\u0275template(4,TextInputComponent_Conditional_1_Conditional_4_Template,1,1,"ix-translation-icon-button",3),\u0275\u0275elementStart(5,"mat-hint"),\u0275\u0275text(6),\u0275\u0275elementEnd(),\u0275\u0275template(7,TextInputComponent_Conditional_1_Conditional_7_Template,2,0,"mat-error",4),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("formGroup",ctx_r0.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("formControlName",ctx_r0.field.inputName)("placeholder",ctx_r0.field.inputDescription.placeholder||""),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.translation?4:-1),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.hint),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.inputControl!=null&&ctx_r0.inputControl.hasError("required")?7:-1)}}function TextInputComponent_Conditional_2_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-label"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275element(3,"textarea",6),\u0275\u0275pipe(4,"translate"),\u0275\u0275pipe(5,"trimTranslationNamespace"),\u0275\u0275elementStart(6,"ix-translation-icon-button",5),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r4);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.setTranslationKey($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"mat-hint"),\u0275\u0275text(8),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("value",ctx_r0.translationKey?\u0275\u0275pipeBind1(5,7,\u0275\u0275pipeBind1(4,5,ctx_r0.translationKey)):"")("placeholder",ctx_r0.field.inputDescription.placeholder||""),\u0275\u0275advance(3),\u0275\u0275property("key",ctx_r0.translationKey),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.hint)}}var TextInputComponent=(()=>{let _TextInputComponent=class _TextInputComponent extends StringInputComponent{};_TextInputComponent.\u0275fac=(()=>{let \u0275TextInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275TextInputComponent_BaseFactory||(\u0275TextInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_TextInputComponent)))(__ngFactoryType__||_TextInputComponent)}})(),_TextInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_TextInputComponent,selectors:[["ix-text-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:3,vars:2,consts:[[1,"description",3,"innerHTML"],[3,"formGroup"],["matInput","","cdkTextareaAutosize","true","cdkAutosizeMinRows","2","cdkAutosizeMaxRows","15",3,"keydown.enter","formControlName","placeholder"],[3,"key"],["translate",""],[3,"setTranslationKey","key"],["matInput","","cdkTextareaAutosize","true","cdkAutosizeMinRows","2","cdkAutosizeMaxRows","15","disabled","",3,"value","placeholder"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,TextInputComponent_Conditional_0_Template,2,3,"p",0)(1,TextInputComponent_Conditional_1_Template,8,7,"mat-form-field",1)(2,TextInputComponent_Conditional_2_Template,9,9,"mat-form-field"),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275conditional(!ctx.translation||!ctx.translationKey?1:2))},dependencies:[DefaultValueAccessor,NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,TranslateDirective,MatFormField,MatLabel,MatHint,MatError,MatInput,CdkTextareaAutosize,TranslationIconButtonComponent,RenderMarkdownPipe,TranslatePipe,TrimTranslationNamespacePipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .description[_ngcontent-%COMP%]{font-size:11px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:calc(100% - 40px)}"]});let TextInputComponent3=_TextInputComponent;return TextInputComponent3})();var RichTextInput=class extends StringInput{};var MarkdownModule=(()=>{let _MarkdownModule=class _MarkdownModule{};_MarkdownModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_MarkdownModule)},_MarkdownModule.\u0275mod=\u0275\u0275defineNgModule({type:_MarkdownModule}),_MarkdownModule.\u0275inj=\u0275\u0275defineInjector({imports:[CommonModule]});let MarkdownModule2=_MarkdownModule;return MarkdownModule2})();var defaultModules={toolbar:[["bold","italic","underline","strike"],["blockquote","code-block"],[{header:1},{header:2}],[{list:"ordered"},{list:"bullet"}],[{script:"sub"},{script:"super"}],[{indent:"-1"},{indent:"+1"}],[{direction:"rtl"}],[{size:["small",!1,"large","huge"]}],[{header:[1,2,3,4,5,6,!1]}],[{color:[]},{background:[]}],[{font:[]}],[{align:[]}],["clean"],["link","image","video"],["table"]]},QUILL_CONFIG_TOKEN=new InjectionToken("config",{providedIn:"root",factory:()=>({modules:defaultModules})});var _c022=[[["","above-quill-editor-toolbar",""]],[["","quill-editor-toolbar",""]],[["","below-quill-editor-toolbar",""]]],_c19=["[above-quill-editor-toolbar]","[quill-editor-toolbar]","[below-quill-editor-toolbar]"];function QuillEditorComponent_Conditional_0_Template(rf,ctx){rf&1&&\u0275\u0275element(0,"div",0)}function QuillEditorComponent_Conditional_4_Template(rf,ctx){rf&1&&\u0275\u0275element(0,"div",0)}var getFormat=(format2,configFormat)=>format2||configFormat||"html",raf$=()=>new Observable(subscriber=>{let rafId=requestAnimationFrame(()=>{subscriber.next(),subscriber.complete()});return()=>cancelAnimationFrame(rafId)}),QuillService=(()=>{let _QuillService=class _QuillService{constructor(){this.config=inject(QUILL_CONFIG_TOKEN)||{modules:defaultModules},this.document=inject(DOCUMENT),this.quill$=defer(()=>__async(this,null,function*(){if(!this.Quill){let maybePatchedAddEventListener=this.document.addEventListener;this.document.addEventListener=this.document.__zone_symbol__addEventListener||this.document.addEventListener;let quillImport=yield import("./chunk-U2LTKHWM.js");this.document.addEventListener=maybePatchedAddEventListener,this.Quill=quillImport.default?.default??quillImport.default??quillImport}return this.config.customOptions?.forEach(customOption=>{let newCustomOption=this.Quill.import(customOption.import);newCustomOption.whitelist=customOption.whitelist,this.Quill.register(newCustomOption,!0,this.config.suppressGlobalRegisterWarning)}),firstValueFrom(this.registerCustomModules(this.Quill,this.config.customModules,this.config.suppressGlobalRegisterWarning))})).pipe(shareReplay({bufferSize:1,refCount:!1})),this.registeredModules=new Set}getQuill(){return this.quill$}beforeRender(Quill,customModules,beforeRender=this.config.beforeRender){let sources=[this.registerCustomModules(Quill,customModules)];return beforeRender&&sources.push(from(beforeRender())),forkJoin(sources).pipe(map(()=>Quill))}registerCustomModules(Quill,customModules,suppressGlobalRegisterWarning){if(!Array.isArray(customModules))return of(Quill);let sources=[];for(let customModule of customModules){let{path,implementation:maybeImplementation}=customModule;this.registeredModules.has(path)||(this.registeredModules.add(path),isObservable(maybeImplementation)?sources.push(maybeImplementation.pipe(tap(implementation=>{Quill.register(path,implementation,suppressGlobalRegisterWarning)}))):Quill.register(path,maybeImplementation,suppressGlobalRegisterWarning))}return sources.length>0?forkJoin(sources).pipe(map(()=>Quill)):of(Quill)}};_QuillService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_QuillService)},_QuillService.\u0275prov=\u0275\u0275defineInjectable({token:_QuillService,factory:_QuillService.\u0275fac,providedIn:"root"});let QuillService2=_QuillService;return QuillService2})(),QuillEditorBase=(()=>{let _QuillEditorBase=class _QuillEditorBase{constructor(){this.format=input(void 0),this.theme=input(void 0),this.modules=input(void 0),this.debug=input(!1),this.readOnly=input(!1),this.placeholder=input(void 0),this.maxLength=input(void 0),this.minLength=input(void 0),this.required=input(!1),this.formats=input(void 0),this.customToolbarPosition=input("top"),this.sanitize=input(void 0),this.beforeRender=input(void 0),this.styles=input(null),this.registry=input(void 0),this.bounds=input(void 0),this.customOptions=input([]),this.customModules=input([]),this.trackChanges=input(void 0),this.classes=input(void 0),this.trimOnValidation=input(!1),this.linkPlaceholder=input(void 0),this.compareValues=input(!1),this.filterNull=input(!1),this.debounceTime=input(void 0),this.defaultEmptyValue=input(null),this.onEditorCreated=new EventEmitter,this.onEditorChanged=new EventEmitter,this.onContentChanged=new EventEmitter,this.onSelectionChanged=new EventEmitter,this.onFocus=new EventEmitter,this.onBlur=new EventEmitter,this.onNativeFocus=new EventEmitter,this.onNativeBlur=new EventEmitter,this.disabled=!1,this.toolbarPosition=signal("top"),this.subscription=null,this.quillSubscription=null,this.elementRef=inject(ElementRef),this.document=inject(DOCUMENT),this.cd=inject(ChangeDetectorRef),this.domSanitizer=inject(DomSanitizer),this.platformId=inject(PLATFORM_ID),this.renderer=inject(Renderer2),this.zone=inject(NgZone),this.service=inject(QuillService),this.destroyRef=inject(DestroyRef),this.valueGetter=input(quillEditor=>{let html=quillEditor.getSemanticHTML();this.isEmptyValue(html)&&(html=this.defaultEmptyValue());let modelValue=html,format2=getFormat(this.format(),this.service.config.format);if(format2==="text")modelValue=quillEditor.getText();else if(format2==="object")modelValue=quillEditor.getContents();else if(format2==="json")try{modelValue=JSON.stringify(quillEditor.getContents())}catch{modelValue=quillEditor.getText()}return modelValue}),this.valueSetter=input((quillEditor,value)=>{let format2=getFormat(this.format(),this.service.config.format);if(format2==="html")return([!0,!1].includes(this.sanitize())?this.sanitize():this.service.config.sanitize||!1)&&(value=this.domSanitizer.sanitize(SecurityContext.HTML,value)),quillEditor.clipboard.convert({html:value});if(format2==="json")try{return JSON.parse(value)}catch{return[{insert:value}]}return value}),this.selectionChangeHandler=(range2,oldRange,source)=>{let trackChanges=this.trackChanges()||this.service.config.trackChanges,shouldTriggerOnModelTouched=!range2&&!!this.onModelTouched&&(source==="user"||trackChanges&&trackChanges==="all");!this.onBlur.observed&&!this.onFocus.observed&&!this.onSelectionChanged.observed&&!shouldTriggerOnModelTouched||this.zone.run(()=>{range2===null?this.onBlur.emit({editor:this.quillEditor,source}):oldRange===null&&this.onFocus.emit({editor:this.quillEditor,source}),this.onSelectionChanged.emit({editor:this.quillEditor,oldRange,range:range2,source}),shouldTriggerOnModelTouched&&this.onModelTouched(),this.cd.markForCheck()})},this.textChangeHandler=(delta,oldDelta,source)=>{let text=this.quillEditor.getText(),content=this.quillEditor.getContents(),html=this.quillEditor.getSemanticHTML();this.isEmptyValue(html)&&(html=this.defaultEmptyValue());let trackChanges=this.trackChanges()||this.service.config.trackChanges,shouldTriggerOnModelChange=(source==="user"||trackChanges&&trackChanges==="all")&&!!this.onModelChange;!this.onContentChanged.observed&&!shouldTriggerOnModelChange||this.zone.run(()=>{if(shouldTriggerOnModelChange){let valueGetter=this.valueGetter();this.onModelChange(valueGetter(this.quillEditor))}this.onContentChanged.emit({content,delta,editor:this.quillEditor,html,oldDelta,source,text}),this.cd.markForCheck()})},this.editorChangeHandler=(event2,current,old,source)=>{if(this.onEditorChanged.observed)if(event2==="text-change"){let text=this.quillEditor.getText(),content=this.quillEditor.getContents(),html=this.quillEditor.getSemanticHTML();this.isEmptyValue(html)&&(html=this.defaultEmptyValue()),this.zone.run(()=>{this.onEditorChanged.emit({content,delta:current,editor:this.quillEditor,event:event2,html,oldDelta:old,source,text}),this.cd.markForCheck()})}else this.zone.run(()=>{this.onEditorChanged.emit({editor:this.quillEditor,event:event2,oldRange:old,range:current,source}),this.cd.markForCheck()})}}static normalizeClassNames(classes){return classes.trim().split(" ").reduce((prev,cur)=>{let trimmed=cur.trim();return trimmed&&prev.push(trimmed),prev},[])}ngOnInit(){this.toolbarPosition.set(this.customToolbarPosition())}ngAfterViewInit(){isPlatformServer(this.platformId)||(this.quillSubscription=this.service.getQuill().pipe(mergeMap(Quill=>this.service.beforeRender(Quill,this.customModules(),this.beforeRender()))).subscribe(Quill=>{this.editorElem=this.elementRef.nativeElement.querySelector("[quill-editor-element]");let toolbarElem=this.elementRef.nativeElement.querySelector("[quill-editor-toolbar]"),modules=Object.assign({},this.modules()||this.service.config.modules);toolbarElem?modules.toolbar=toolbarElem:modules.toolbar===void 0&&(modules.toolbar=defaultModules.toolbar);let placeholder=this.placeholder()!==void 0?this.placeholder():this.service.config.placeholder;placeholder===void 0&&(placeholder="Insert text here ...");let styles=this.styles();styles&&Object.keys(styles).forEach(key=>{this.renderer.setStyle(this.editorElem,key,styles[key])}),this.classes()&&this.addClasses(this.classes()),this.customOptions().forEach(customOption=>{let newCustomOption=Quill.import(customOption.import);newCustomOption.whitelist=customOption.whitelist,Quill.register(newCustomOption,!0)});let bounds=this.bounds()&&this.bounds()==="self"?this.editorElem:this.bounds();bounds||(bounds=this.service.config.bounds?this.service.config.bounds:this.document.body);let debug=this.debug();!debug&&debug!==!1&&this.service.config.debug&&(debug=this.service.config.debug);let readOnly=this.readOnly();!readOnly&&this.readOnly()!==!1&&(readOnly=this.service.config.readOnly!==void 0?this.service.config.readOnly:!1);let formats=this.formats();if(!formats&&formats===void 0&&(formats=this.service.config.formats?[...this.service.config.formats]:this.service.config.formats===null?null:void 0),this.zone.runOutsideAngular(()=>{if(this.quillEditor=new Quill(this.editorElem,{bounds,debug,formats,modules,placeholder,readOnly,registry:this.registry(),theme:this.theme()||(this.service.config.theme?this.service.config.theme:"snow")}),this.onNativeBlur.observed){fromEvent(this.quillEditor.scroll.domNode,"blur").pipe(takeUntilDestroyed(this.destroyRef)).subscribe(()=>this.onNativeBlur.next({editor:this.quillEditor,source:"dom"}));let toolbar=this.quillEditor.getModule("toolbar");toolbar.container&&fromEvent(toolbar.container,"mousedown").pipe(takeUntilDestroyed(this.destroyRef)).subscribe(e=>e.preventDefault())}if(this.onNativeFocus.observed&&fromEvent(this.quillEditor.scroll.domNode,"focus").pipe(takeUntilDestroyed(this.destroyRef)).subscribe(()=>this.onNativeFocus.next({editor:this.quillEditor,source:"dom"})),this.linkPlaceholder()){let input2=this.quillEditor?.theme?.tooltip?.root?.querySelector("input[data-link]");input2?.dataset&&(input2.dataset.link=this.linkPlaceholder())}}),this.content){if(getFormat(this.format(),this.service.config.format)==="text")this.quillEditor.setText(this.content,"silent");else{let newValue=this.valueSetter()(this.quillEditor,this.content);this.quillEditor.setContents(newValue,"silent")}this.quillEditor.getModule("history").clear()}this.setDisabledState(),this.addQuillEventListeners(),!(!this.onEditorCreated.observed&&!this.onValidatorChanged)&&raf$().pipe(takeUntilDestroyed(this.destroyRef)).subscribe(()=>{this.onValidatorChanged&&this.onValidatorChanged(),this.onEditorCreated.emit(this.quillEditor)})}))}ngOnDestroy(){this.dispose(),this.quillSubscription?.unsubscribe(),this.quillSubscription=null}ngOnChanges(changes){if(this.quillEditor){if(changes.readOnly&&this.quillEditor.enable(!changes.readOnly.currentValue),changes.placeholder&&(this.quillEditor.root.dataset.placeholder=changes.placeholder.currentValue),changes.styles){let currentStyling=changes.styles.currentValue,previousStyling=changes.styles.previousValue;previousStyling&&Object.keys(previousStyling).forEach(key=>{this.renderer.removeStyle(this.editorElem,key)}),currentStyling&&Object.keys(currentStyling).forEach(key=>{this.renderer.setStyle(this.editorElem,key,this.styles()[key])})}if(changes.classes){let currentClasses=changes.classes.currentValue,previousClasses=changes.classes.previousValue;previousClasses&&this.removeClasses(previousClasses),currentClasses&&this.addClasses(currentClasses)}changes.debounceTime&&this.addQuillEventListeners()}}addClasses(classList){_QuillEditorBase.normalizeClassNames(classList).forEach(c=>{this.renderer.addClass(this.editorElem,c)})}removeClasses(classList){_QuillEditorBase.normalizeClassNames(classList).forEach(c=>{this.renderer.removeClass(this.editorElem,c)})}writeValue(currentValue){if(this.filterNull()&&currentValue===null||(this.content=currentValue,!this.quillEditor))return;let format2=getFormat(this.format(),this.service.config.format),newValue=this.valueSetter()(this.quillEditor,currentValue);if(this.compareValues()){let currentEditorValue=this.quillEditor.getContents();if(JSON.stringify(currentEditorValue)===JSON.stringify(newValue))return}if(currentValue){format2==="text"?this.quillEditor.setText(currentValue):this.quillEditor.setContents(newValue);return}this.quillEditor.setText("")}setDisabledState(isDisabled=this.disabled){this.disabled=isDisabled,this.quillEditor&&(isDisabled?(this.quillEditor.disable(),this.renderer.setAttribute(this.elementRef.nativeElement,"disabled","disabled")):(this.readOnly()||this.quillEditor.enable(),this.renderer.removeAttribute(this.elementRef.nativeElement,"disabled")))}registerOnChange(fn2){this.onModelChange=fn2}registerOnTouched(fn2){this.onModelTouched=fn2}registerOnValidatorChange(fn2){this.onValidatorChanged=fn2}validate(){if(!this.quillEditor)return null;let err={},valid=!0,text=this.quillEditor.getText(),textLength=this.trimOnValidation()?text.trim().length:text.length===1&&text.trim().length===0?0:text.length-1,deltaOperations=this.quillEditor.getContents().ops,onlyEmptyOperation=!!deltaOperations&&deltaOperations.length===1&&[`
835
- `,""].includes(deltaOperations[0].insert?.toString());return this.minLength()&&textLength&&textLength<this.minLength()&&(err.minLengthError={given:textLength,minLength:this.minLength()},valid=!1),this.maxLength()&&textLength>this.maxLength()&&(err.maxLengthError={given:textLength,maxLength:this.maxLength()},valid=!1),this.required()&&!textLength&&onlyEmptyOperation&&(err.requiredError={empty:!0},valid=!1),valid?null:err}addQuillEventListeners(){this.dispose(),this.zone.runOutsideAngular(()=>{this.subscription=new Subscription,this.subscription.add(fromEvent(this.quillEditor,"selection-change").subscribe(([range2,oldRange,source])=>{this.selectionChangeHandler(range2,oldRange,source)}));let textChange$=fromEvent(this.quillEditor,"text-change"),editorChange$=fromEvent(this.quillEditor,"editor-change");typeof this.debounceTime()=="number"&&(textChange$=textChange$.pipe(debounceTime(this.debounceTime())),editorChange$=editorChange$.pipe(debounceTime(this.debounceTime()))),this.subscription.add(textChange$.subscribe(([delta,oldDelta,source])=>{this.textChangeHandler(delta,oldDelta,source)})),this.subscription.add(editorChange$.subscribe(([event2,current,old,source])=>{this.editorChangeHandler(event2,current,old,source)}))})}dispose(){this.subscription!==null&&(this.subscription.unsubscribe(),this.subscription=null)}isEmptyValue(html){return html==="<p></p>"||html==="<div></div>"||html==="<p><br></p>"||html==="<div><br></div>"}};_QuillEditorBase.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_QuillEditorBase)},_QuillEditorBase.\u0275dir=\u0275\u0275defineDirective({type:_QuillEditorBase,inputs:{format:[1,"format"],theme:[1,"theme"],modules:[1,"modules"],debug:[1,"debug"],readOnly:[1,"readOnly"],placeholder:[1,"placeholder"],maxLength:[1,"maxLength"],minLength:[1,"minLength"],required:[1,"required"],formats:[1,"formats"],customToolbarPosition:[1,"customToolbarPosition"],sanitize:[1,"sanitize"],beforeRender:[1,"beforeRender"],styles:[1,"styles"],registry:[1,"registry"],bounds:[1,"bounds"],customOptions:[1,"customOptions"],customModules:[1,"customModules"],trackChanges:[1,"trackChanges"],classes:[1,"classes"],trimOnValidation:[1,"trimOnValidation"],linkPlaceholder:[1,"linkPlaceholder"],compareValues:[1,"compareValues"],filterNull:[1,"filterNull"],debounceTime:[1,"debounceTime"],defaultEmptyValue:[1,"defaultEmptyValue"],valueGetter:[1,"valueGetter"],valueSetter:[1,"valueSetter"]},outputs:{onEditorCreated:"onEditorCreated",onEditorChanged:"onEditorChanged",onContentChanged:"onContentChanged",onSelectionChanged:"onSelectionChanged",onFocus:"onFocus",onBlur:"onBlur",onNativeFocus:"onNativeFocus",onNativeBlur:"onNativeBlur"},features:[\u0275\u0275NgOnChangesFeature]});let QuillEditorBase2=_QuillEditorBase;return QuillEditorBase2})(),QuillEditorComponent=(()=>{let _QuillEditorComponent=class _QuillEditorComponent extends QuillEditorBase{};_QuillEditorComponent.\u0275fac=(()=>{let \u0275QuillEditorComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275QuillEditorComponent_BaseFactory||(\u0275QuillEditorComponent_BaseFactory=\u0275\u0275getInheritedFactory(_QuillEditorComponent)))(__ngFactoryType__||_QuillEditorComponent)}})(),_QuillEditorComponent.\u0275cmp=\u0275\u0275defineComponent({type:_QuillEditorComponent,selectors:[["quill-editor"]],features:[\u0275\u0275ProvidersFeature([{multi:!0,provide:NG_VALUE_ACCESSOR,useExisting:forwardRef(()=>_QuillEditorComponent)},{multi:!0,provide:NG_VALIDATORS,useExisting:forwardRef(()=>_QuillEditorComponent)}]),\u0275\u0275InheritDefinitionFeature],ngContentSelectors:_c19,decls:5,vars:2,consts:[["quill-editor-element",""]],template:function(rf,ctx){rf&1&&(\u0275\u0275projectionDef(_c022),\u0275\u0275template(0,QuillEditorComponent_Conditional_0_Template,1,0,"div",0),\u0275\u0275projection(1),\u0275\u0275projection(2,1),\u0275\u0275projection(3,2),\u0275\u0275template(4,QuillEditorComponent_Conditional_4_Template,1,0,"div",0)),rf&2&&(\u0275\u0275conditional(ctx.toolbarPosition()!=="top"?0:-1),\u0275\u0275advance(4),\u0275\u0275conditional(ctx.toolbarPosition()==="top"?4:-1))},styles:["[_nghost-%COMP%]{display:inline-block}"]});let QuillEditorComponent2=_QuillEditorComponent;return QuillEditorComponent2})();var import_markdown_it2=__toESM(require_markdown_it());function renderMarkdownToHtml(markdown){let markdownIt=new import_markdown_it2.default({typographer:!0}),defaultRender=markdownIt.renderer.rules.link_open||function(tokens,idx,options,env,self2){return self2.renderToken(tokens,idx,options)};return markdownIt.renderer.rules.link_open=function(tokens,idx,options,env,self2){return tokens[idx].attrPush(["target","_blank"]),defaultRender(tokens,idx,options,env,self2)},markdownIt.render(markdown)}var indentRegex=/^ql-indent-([0-9]+)/;function addStylingToQuillContent(content){let htmlObject=document.createElement("div");return htmlObject.innerHTML=content,addStylingToHtmlChildNodes(htmlObject.childNodes),htmlObject.innerHTML}function addStylingToHtmlChildNodes(children){children.forEach(child=>{let element=child;setCodeBlockStyling(element),setIndentStyling(element),setListStyling(element),setQuotesStyling(element),child.childNodes.length&&addStylingToHtmlChildNodes(child.childNodes)})}function setCodeBlockStyling(element){element.tagName==="PRE"&&(element.hasAttribute("data-language")||element.classList?.contains("ql-syntax"))&&(element.style.backgroundColor="#f6f8fa",element.style.color="initial",element.style.overflow="visible",element.style.padding="5px 10px")}function setIndentStyling(element){element.classList?.forEach(className=>{let matches=className.match(indentRegex);if(matches?.[1]){let identNumber=parseInt(matches?.[1]);element.style.paddingLeft=3*identNumber+"em"}})}function setListStyling(element){element.tagName==="OL"&&(element.style.paddingLeft="1.5em"),element.tagName==="LI"&&(element.style.listStylePosition="inside")}function setQuotesStyling(element){element.tagName==="BLOCKQUOTE"&&(element.style.borderLeft="4px solid #ccc",element.style.margin="5px 0",element.style.paddingLeft="16px")}function registerQuillModules(){registerAlignStyle(),registerBlock()}function registerAlignStyle(){let alignStyle=quill_default.import("attributors/style/align");quill_default.register(alignStyle,!0)}function registerBlock(){let block=quill_default.import("blots/block");block.tagName="DIV",quill_default.register(block)}var _c023=()=>({height:"400px"});function RichTextFormFieldComponent_Conditional_0_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"form",0)(1,"quill-editor",2),\u0275\u0275listener("onEditorCreated",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onEditorCreated($event))})("keydown.backspace",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())})("keydown.delete",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(2,"div",3)(3,"span",4)(4,"select",5),\u0275\u0275element(5,"option",6)(6,"option",7)(7,"option",8)(8,"option",9)(9,"option",10)(10,"option",11),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(11,"span",4),\u0275\u0275element(12,"button",12)(13,"button",13)(14,"button",14)(15,"button",15),\u0275\u0275elementEnd(),\u0275\u0275elementStart(16,"span",4),\u0275\u0275element(17,"button",16)(18,"button",17),\u0275\u0275elementEnd(),\u0275\u0275elementStart(19,"span",4)(20,"select",18),\u0275\u0275element(21,"option",6)(22,"option",19)(23,"option",20)(24,"option",21),\u0275\u0275elementEnd(),\u0275\u0275element(25,"button",22)(26,"button",23),\u0275\u0275elementEnd(),\u0275\u0275elementStart(27,"span",4),\u0275\u0275element(28,"button",24)(29,"button",25),\u0275\u0275elementEnd(),\u0275\u0275elementStart(30,"span",4),\u0275\u0275element(31,"button",26)(32,"button",27)(33,"button",28),\u0275\u0275elementEnd()()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("formGroup",ctx_r1.form),\u0275\u0275advance(),\u0275\u0275property("styles",\u0275\u0275pureFunction0(16,_c023))("placeholder",ctx_r1.field.inputDescription.placeholder||""),\u0275\u0275advance(11),\u0275\u0275property("matTooltip","Bold"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Italic"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Underline"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Strike-through"),\u0275\u0275advance(2),\u0275\u0275property("matTooltip","Text color"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Highlight color"),\u0275\u0275advance(7),\u0275\u0275property("matTooltip","Decrease indent"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Increase indent"),\u0275\u0275advance(2),\u0275\u0275property("matTooltip","Bulleted list"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Numbered list"),\u0275\u0275advance(2),\u0275\u0275property("matTooltip","Blockquote"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Code Block"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Insert link")}}function RichTextFormFieldComponent_Conditional_1_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",1)(1,"textarea",29),\u0275\u0275listener("keydown.enter",function($event){return \u0275\u0275restoreView(_r3),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(2,"a",30),\u0275\u0275pipe(3,"translate"),\u0275\u0275elementStart(4,"mat-icon"),\u0275\u0275text(5,"markdown"),\u0275\u0275elementEnd()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("formControl",ctx_r1.form.controls.editor)("placeholder",ctx_r1.field.inputDescription.placeholder||""),\u0275\u0275advance(),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(3,4,"MARKDOWN_IS_SUPPORTED"))("matTooltipPosition","left")}}var RichTextFormFieldComponent=(()=>{let _RichTextFormFieldComponent=class _RichTextFormFieldComponent{constructor(){this.mode="rich-text",this.modeChange=new EventEmitter,this.valueChange=new EventEmitter,this.destroy=inject(DestroyRef),this.dialog=inject(MatDialog),this.formBuilder=inject(FormBuilder),this.colorPickerPanelService=inject(ColorPickerPanelService),this.ngZone=inject(NgZone),this.translate=inject(TranslateService),this.activeMode="rich-text",this.modules={toolbar:{container:"#toolbar"}},this.form=this.formBuilder.nonNullable.group({editor:[""]})}blockPaste(e){e.stopPropagation()}blockCopy(e){e.stopPropagation()}blockCut(e){e.stopPropagation()}ngOnInit(){registerQuillModules(),typeof this.field.value=="string"&&this.form.setValue({editor:this.field.value}),this.form.controls.editor.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>this.valueChange.emit(this.mode==="rich-text"?addStylingToQuillContent(value):value))}ngOnChanges(changes){changes.mode.firstChange&&(this.activeMode=this.mode),changes.mode.previousValue==="plain-text"&&changes.mode.currentValue==="rich-text"&&this.switchFromPlainTextToRichText(),changes.mode.previousValue==="rich-text"&&changes.mode.currentValue==="plain-text"&&this.mode!==this.activeMode&&(this.previousFormValue=this.form.value,this.activeMode=this.mode)}onEditorCreated(editor){this.quill=editor;let toolbar=editor.getModule("toolbar"),backgroundButton=toolbar.container?.querySelector(".ql-background"),colorButton=toolbar.container?.querySelector(".ql-color");backgroundButton&&toolbar.addHandler("background",()=>this.openColorPicker(backgroundButton,"background")),colorButton&&toolbar.addHandler("color",()=>this.openColorPicker(colorButton,"color","#000000")),editor.on("selection-change",range2=>{range2&&(this.setColorButtonColor(range2),this.setBackgroundButtonColor(range2))})}openColorPicker(element,format2,defaultColor="#FFFFFF"){this.ngZone.run(()=>{let range2=this.quill.getSelection();if(range2){let currentColor=(this.quill.getFormat(range2)[format2]??defaultColor).toUpperCase(),colorPickerColor=currentColor==="TRANSPARENT"?defaultColor:currentColor;this.colorPickerPanelService.show(element,{color:colorPickerColor}).afterClosed().subscribe(color=>{color===defaultColor?this.quill.format(format2,!1,quill_default.sources.USER):this.quill.format(format2,color,quill_default.sources.USER)})}})}setColorButtonColor(range2){let color=this.quill.getFormat(range2)?.color?.toUpperCase(),colorLabel=this.quill.getModule("toolbar").container?.querySelector(".ql-color .ql-stroke");colorLabel&&(color&&color!=="TRANSPARENT"?colorLabel.style.stroke=color==="#FFFFFF"?"#E1E1E1":color:colorLabel.style.stroke="#000000")}setBackgroundButtonColor(range2){let color=this.quill.getFormat(range2)?.background?.toUpperCase(),colorLabel=this.quill.getModule("toolbar").container?.querySelector(".ql-background .ql-fill");colorLabel&&(color&&color!=="TRANSPARENT"?colorLabel.style.fill=color:colorLabel.style.fill="#E1E1E1")}switchFromPlainTextToRichText(){let formValue=this.form.value;formValue.editor!==""&&formValue.editor!==this.previousFormValue?.editor?this.dialog.open(ConfirmDialogComponent,{data:{title:this.translate.instant("WARNING"),message:this.translate.instant("__TEXT__.MARKDOWN_FORMATTING_TO_RICH_TEXT")}}).afterClosed().subscribe(confirmed=>{if(confirmed){if(this.activeMode="rich-text",this.modeChange.emit("rich-text"),formValue.editor){let html=renderMarkdownToHtml(formValue.editor),editor=addStylingToQuillContent(html);this.form.patchValue({editor})}}else this.modeChange.emit("plain-text")}):(this.activeMode="rich-text",this.modeChange.emit("rich-text"))}};_RichTextFormFieldComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_RichTextFormFieldComponent)},_RichTextFormFieldComponent.\u0275cmp=\u0275\u0275defineComponent({type:_RichTextFormFieldComponent,selectors:[["ix-rich-text-form-field"]],hostBindings:function(rf,ctx){rf&1&&\u0275\u0275listener("paste",function($event){return ctx.blockPaste($event)})("copy",function($event){return ctx.blockCopy($event)})("cut",function($event){return ctx.blockCut($event)})},inputs:{field:"field",mode:"mode"},outputs:{modeChange:"modeChange",valueChange:"valueChange"},features:[\u0275\u0275NgOnChangesFeature],decls:2,vars:1,consts:[[3,"formGroup"],[1,"plain-text"],["bounds","self","formControlName","editor",3,"onEditorCreated","keydown.backspace","keydown.delete","styles","placeholder"],["quill-editor-toolbar","","data-testid","rich-text-toolbar"],[1,"ql-formats"],[1,"ql-header"],["selected",""],["value","1"],["value","2"],["value","3"],["value","4"],["value","5"],["matTooltipShowDelay","500",1,"ql-bold",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-italic",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-underline",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-strike",3,"matTooltip"],["matTooltipShowDelay","500","data-testid","rich-text-color-button",1,"ql-color",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-background",3,"matTooltip"],[1,"ql-align"],["value","center"],["value","right"],["value","justify"],["value","-1","matTooltipShowDelay","500",1,"ql-indent",3,"matTooltip"],["value","+1","matTooltipShowDelay","500",1,"ql-indent",3,"matTooltip"],["value","bullet","matTooltipShowDelay","500",1,"ql-list",3,"matTooltip"],["value","ordered","matTooltipShowDelay","500",1,"ql-list",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-blockquote",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-code-block",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-link",3,"matTooltip"],[3,"keydown.enter","formControl","placeholder"],["href","https://commonmark.org/help/","target","_blank","mat-icon-button","",1,"markdown-info-button",3,"matTooltip","matTooltipPosition"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,RichTextFormFieldComponent_Conditional_0_Template,34,17,"form",0)(1,RichTextFormFieldComponent_Conditional_1_Template,6,6,"div",1),rf&2&&\u0275\u0275conditional(ctx.activeMode==="rich-text"?0:1)},dependencies:[ReactiveFormsModule,\u0275NgNoValidate,NgSelectOption,\u0275NgSelectMultipleOption,DefaultValueAccessor,NgControlStatus,NgControlStatusGroup,FormControlDirective,FormGroupDirective,FormControlName,FlexLayoutModule,MatButtonModule,MatIconAnchor,MatDialogModule,MatFormFieldModule,MatIconModule,MatIcon,MatInputModule,MatTooltipModule,MatTooltip,ColorPickerPanelModule,QuillEditorComponent,TranslateModule,TranslatePipe],styles:['[_nghost-%COMP%]{display:block}[_nghost-%COMP%] quill-editor[_ngcontent-%COMP%]{width:100%;color:var(--mat-sys-on-surface)}[_nghost-%COMP%] form[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .plain-text[_ngcontent-%COMP%]{display:flex;position:relative;width:100%;font-family:Roboto,sans-serif;white-space:pre-wrap;overflow-wrap:break-word}[_nghost-%COMP%] .plain-text[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;height:441px;max-height:441px;box-sizing:border-box;padding:12px;border-radius:4px 4px 0 0;background-color:var(--mat-sys-surface-variant);border:none;border-bottom:1px solid rgba(0,0,0,.42);resize:none}[_nghost-%COMP%] .plain-text[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus-visible{outline:none}[_nghost-%COMP%] .plain-text[_ngcontent-%COMP%] .markdown-info-button[_ngcontent-%COMP%]{position:absolute;right:5px;bottom:5px}[_nghost-%COMP%] .ql-toolbar{border-radius:4px 4px 0 0}[_nghost-%COMP%] .ql-toolbar.ql-snow{display:flex;flex-flow:row wrap;row-gap:4px;background-color:var(--mat-sys-surface-variant);border:none;border-bottom:1px solid rgba(0,0,0,.12)}[_nghost-%COMP%] .ql-toolbar.ql-snow button, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item{color:var(--mat-sys-on-surface)}[_nghost-%COMP%] .ql-toolbar.ql-snow button .ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow button .ql-stroke.ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label .ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label .ql-stroke.ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item .ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item .ql-stroke.ql-fill{fill:var(--mat-sys-on-surface)}[_nghost-%COMP%] .ql-toolbar.ql-snow button .ql-stroke, [_nghost-%COMP%] .ql-toolbar.ql-snow button .ql-stroke-miter, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label .ql-stroke, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label .ql-stroke-miter, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item .ql-stroke, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item .ql-stroke-miter{stroke:var(--mat-sys-on-surface)}[_nghost-%COMP%] .ql-toolbar.ql-snow button:hover, [_nghost-%COMP%] .ql-toolbar.ql-snow button:focus, [_nghost-%COMP%] .ql-toolbar.ql-snow button.ql-active, [_nghost-%COMP%] .ql-toolbar.ql-snow button.ql-selected, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label:hover, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label:focus, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label.ql-active, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label.ql-selected, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item:hover, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item:focus, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item.ql-active, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item.ql-selected{background-color:#00000014;border-radius:4px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:transparent}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker .ql-picker-options{border-radius:8px;border:none}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label.ql-active:not(:hover,:focus){background-color:inherit}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label>svg>polygon:nth-child(1){stroke-linejoin:initial;transform:translateY(-2px)}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label>svg>polygon:nth-child(2){display:none}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-options{padding-left:0;padding-right:0}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-options .ql-picker-item{padding-left:8px;padding-right:8px;border-radius:0}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-options .ql-picker-item[data-value="1"]{padding-top:10px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-options .ql-picker-item[data-value="2"]{padding-top:8px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-align.ql-picker.ql-expanded .ql-picker-options{display:flex;padding:4px 4px 3px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-align.ql-picker.ql-expanded .ql-picker-options .ql-picker-item{padding:4px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-color .ql-color-label.ql-stroke.ql-transparent{opacity:1;stroke-linecap:square;stroke-width:4}@media (min-resolution: 2dppx){[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-color .ql-color-label.ql-stroke.ql-transparent{stroke-width:3}}[_nghost-%COMP%] .ql-snow{font-family:Roboto,sans-serif}[_nghost-%COMP%] .ql-snow a{color:var(--mat-sys-primary)}[_nghost-%COMP%] .ql-snow .ql-code-block-container{background-color:#f6f8fa!important;border:1px solid rgba(0,0,0,.12);color:initial!important}[_nghost-%COMP%] .ql-container{border-radius:0}[_nghost-%COMP%] .ql-container.ql-snow{background-color:var(--mat-sys-surface-variant);border:none;border-bottom:1px solid rgba(0,0,0,.42)}[_nghost-%COMP%] .ql-container .ql-editor.ql-blank:before{font-style:normal;color:#0000006b}']});let RichTextFormFieldComponent2=_RichTextFormFieldComponent;return RichTextFormFieldComponent2})();var RichTextDialogComponent=(()=>{let _RichTextDialogComponent=class _RichTextDialogComponent{constructor(){this.data=inject(MAT_DIALOG_DATA),this.destroy=inject(DestroyRef),this.dialog=inject(MatDialog),this.dialogRef=inject(MatDialogRef),this.modules={toolbar:{container:"#toolbar"}}}ngOnInit(){this.dialogRef.keydownEvents().pipe(takeUntilDestroyed(this.destroy)).subscribe(event2=>{event2.key==="Escape"&&this.openDiscardChangesWarningDialog()}),this.dialogRef.backdropClick().pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>this.openDiscardChangesWarningDialog())}get activeMode(){return this.formField?.activeMode??this.data.mode}submit(){let formValue=this.formField.form.value,editor=formValue.editor?addStylingToQuillContent(formValue.editor):null;this.dialogRef.close({value:editor})}toggleMode(){this.data.mode=this.data.mode==="rich-text"?"plain-text":"rich-text"}updateMode(mode){this.data.mode=mode}openDiscardChangesWarningDialog(){this.formField.form.dirty?this.dialog.open(DiscardChangesDialogComponent,{panelClass:"fullscreen"}).afterClosed().subscribe(result=>{result&&this.dialogRef.close()}):this.dialogRef.close()}};_RichTextDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_RichTextDialogComponent)},_RichTextDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_RichTextDialogComponent,selectors:[["ix-rich-text-dialog"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(RichTextFormFieldComponent,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.formField=_t.first)}},decls:16,vars:8,consts:[["mat-dialog-title","","translate","","data-testid","rich-text-dialog-title"],["mat-dialog-content",""],[3,"modeChange","field","mode"],["type","button","mat-stroked-button","","data-testid","change-mode-button",1,"change-mode-button",3,"click"],["fxFlex",""],["mat-button","","mat-dialog-close",""],["translate",""],["mat-button","","color","primary",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"h1",0),\u0275\u0275text(1),\u0275\u0275pipe(2,"titlecase"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"div",1)(4,"ix-rich-text-form-field",2),\u0275\u0275listener("modeChange",function($event){return ctx.updateMode($event)}),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"mat-dialog-actions")(6,"button",3),\u0275\u0275listener("click",function(){return ctx.toggleMode()}),\u0275\u0275text(7),\u0275\u0275pipe(8,"translate"),\u0275\u0275elementEnd(),\u0275\u0275element(9,"span",4),\u0275\u0275elementStart(10,"button",5)(11,"span",6),\u0275\u0275text(12,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(13,"button",7),\u0275\u0275listener("click",function(){return ctx.submit()}),\u0275\u0275elementStart(14,"span",6),\u0275\u0275text(15,"CONFIRM"),\u0275\u0275elementEnd()()()),rf&2&&(\u0275\u0275advance(),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(2,4,ctx.data.field.inputName)),\u0275\u0275advance(3),\u0275\u0275property("field",ctx.data.field)("mode",ctx.data.mode),\u0275\u0275advance(3),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind1(8,6,ctx.activeMode==="rich-text"?"SWITCH_TO_PLAIN_TEXT_EDITING":"SWITCH_TO_RICH_TEXT_EDITING")," "))},dependencies:[ColorPickerPanelModule,FlexLayoutModule,DefaultFlexDirective,MatButtonModule,MatButton,MatDialogModule,MatDialogClose,MatDialogTitle,MatDialogActions,MatDialogContent,MatFormFieldModule,MatIconModule,MatInputModule,MatTooltipModule,TitleCasePipe,TranslateModule,TranslatePipe,TranslateDirective,RichTextFormFieldComponent],styles:["[_nghost-%COMP%]{width:100dvw;height:100dvh;display:flex;flex-direction:column;flex:1}@media (min-width: 960px){[_nghost-%COMP%]{height:auto;width:auto;min-width:908px;max-width:908px}}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%]{padding:calc(env(safe-area-inset-top,0) + 16px) 24px 16px}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar{height:48px;padding-left:0;padding-right:0}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title{--mat-dialog-headline-padding: 0;color:inherit}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title:before{display:none}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .mdc-dialog__content[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] .mdc-dialog__title[_ngcontent-%COMP%]:before{height:calc(env(safe-area-inset-top,0) + 40px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]{padding:20px 24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .ix-list[_ngcontent-%COMP%]{margin-left:-24px;margin-right:-24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch;flex:1 1 auto;max-height:none;overflow:auto;-webkit-overflow-scrolling:touch}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%]{margin-left:0;margin-right:0}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 140px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions), [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions){padding-bottom:0}}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__banner[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 225px)}}@media (max-width: 959.9px){[_nghost-%COMP%] .mdc-dialog__actions[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.12);padding-bottom:calc(16px + env(safe-area-inset-bottom,0))}}[_nghost-%COMP%] form[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 auto;height:inherit}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:1rem}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%]{padding-bottom:8px}[_nghost-%COMP%] .mat-mdc-dialog-actions[_ngcontent-%COMP%] .change-mode-button[_ngcontent-%COMP%]{--mdc-outlined-button-container-height: 30px;--mdc-outlined-button-label-text-size: 13px}"]});let RichTextDialogComponent2=_RichTextDialogComponent;return RichTextDialogComponent2})();function RichTextInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function RichTextInputComponent_Conditional_1_Template(rf,ctx){if(rf&1){let _r2=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-rich-text-form-field",2),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r2);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.updateValue($event))})("modeChange",function($event){\u0275\u0275restoreView(_r2);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.updateMode($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(1,"button",3),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r2);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.toggleMode())}),\u0275\u0275text(2),\u0275\u0275pipe(3,"translate"),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("field",ctx_r0.field)("mode",ctx_r0.mode),\u0275\u0275advance(2),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind1(3,3,ctx_r0.activeMode==="rich-text"?"SWITCH_TO_PLAIN_TEXT_EDITING":"SWITCH_TO_RICH_TEXT_EDITING")," ")}}function RichTextInputComponent_Conditional_2_Conditional_4_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-translation-icon-button",7),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r4);let ctx_r0=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r0.setTranslationKey($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("key",ctx_r0.translationKey)}}function RichTextInputComponent_Conditional_2_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function RichTextInputComponent_Conditional_2_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field",1)(1,"mat-label"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"textarea",4),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r3);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.openEditRichTextDialog())}),\u0275\u0275elementEnd(),\u0275\u0275template(4,RichTextInputComponent_Conditional_2_Conditional_4_Template,1,1,"ix-translation-icon-button",5),\u0275\u0275elementStart(5,"mat-hint"),\u0275\u0275text(6),\u0275\u0275elementEnd(),\u0275\u0275template(7,RichTextInputComponent_Conditional_2_Conditional_7_Template,2,0,"mat-error",6),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("formGroup",ctx_r0.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("value",ctx_r0.text)("placeholder",ctx_r0.field.inputDescription.placeholder||""),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.translation?4:-1),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.hint),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.inputControl!=null&&ctx_r0.inputControl.hasError("required")?7:-1)}}function RichTextInputComponent_Conditional_3_Template(rf,ctx){if(rf&1){let _r5=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-label"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275element(3,"textarea",8),\u0275\u0275pipe(4,"translate"),\u0275\u0275pipe(5,"trimTranslationNamespace"),\u0275\u0275elementStart(6,"ix-translation-icon-button",7),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r5);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.setTranslationKey($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"mat-hint"),\u0275\u0275text(8),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("value",ctx_r0.translationKey?\u0275\u0275pipeBind1(5,7,\u0275\u0275pipeBind1(4,5,ctx_r0.translationKey)):"")("placeholder",ctx_r0.field.inputDescription.placeholder||""),\u0275\u0275advance(3),\u0275\u0275property("key",ctx_r0.translationKey),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.hint)}}var RichTextInputComponent=(()=>{let _RichTextInputComponent=class _RichTextInputComponent extends StringInputComponent{constructor(){super(...arguments),this.destroy=inject(DestroyRef),this.dialog=inject(MatDialog),this.dialogContainer=inject(MatDialogContainer,{optional:!0,skipSelf:!0}),this.domParser=new DOMParser,this.mode="rich-text"}get activeMode(){return this.formField?.activeMode??this.mode}get embedded(){return!!this.dialogContainer&&!this.translation}ngOnInit(){super.ngOnInit(),this.inputControl?.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>this.field.setValue(value));let initialValue=this.inputControl?.value;this.field.setValue(initialValue),initialValue&&!this.isHtml(initialValue)&&(this.mode="plain-text")}openEditRichTextDialog(){this.dialog.open(RichTextDialogComponent,{data:{field:this.field,mode:this.mode},autoFocus:!0,disableClose:!0,panelClass:"fullscreen"}).afterClosed().subscribe(result=>{result&&this.updateValue(result.value)})}get text(){let value=this.field.value;return value?value.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim():""}toggleMode(){this.mode=this.mode==="rich-text"?"plain-text":"rich-text"}updateMode(mode){this.mode=mode}updateValue(value){this.inputControl?.setValue(value)}isHtml(value){let doc=this.domParser.parseFromString(value,"text/html");return Array.from(doc.body.childNodes).some(node=>node.nodeType===Node.ELEMENT_NODE)}};_RichTextInputComponent.\u0275fac=(()=>{let \u0275RichTextInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275RichTextInputComponent_BaseFactory||(\u0275RichTextInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_RichTextInputComponent)))(__ngFactoryType__||_RichTextInputComponent)}})(),_RichTextInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_RichTextInputComponent,selectors:[["ix-rich-text-input"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(RichTextFormFieldComponent,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.formField=_t.first)}},features:[\u0275\u0275InheritDefinitionFeature],decls:4,vars:2,consts:[[1,"description",3,"innerHTML"],[3,"formGroup"],[3,"valueChange","modeChange","field","mode"],["type","button","mat-stroked-button","","data-testid","change-mode-button",1,"change-mode-button",3,"click"],["matInput","","cdkTextareaAutosize","true","cdkAutosizeMinRows","2","cdkAutosizeMaxRows","5","readonly","",3,"click","value","placeholder"],[3,"key"],["translate",""],[3,"setTranslationKey","key"],["matInput","","cdkTextareaAutosize","true","cdkAutosizeMinRows","2","cdkAutosizeMaxRows","15","disabled","",3,"value","placeholder"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,RichTextInputComponent_Conditional_0_Template,2,3,"p",0)(1,RichTextInputComponent_Conditional_1_Template,4,5)(2,RichTextInputComponent_Conditional_2_Template,8,7,"mat-form-field",1)(3,RichTextInputComponent_Conditional_3_Template,9,9,"mat-form-field"),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.embedded?1:!ctx.translation||!ctx.translationKey?2:3))},dependencies:[TranslateModule,TranslatePipe,TranslateDirective,ReactiveFormsModule,NgControlStatusGroup,FormGroupDirective,MatButtonModule,MatButton,MatFormFieldModule,MatFormField,MatLabel,MatHint,MatError,MatInputModule,MatInput,CdkTextareaAutosize,TranslationIconButtonComponent,MarkdownModule,RenderMarkdownPipe,RichTextFormFieldComponent,TrimTranslationNamespacePipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{overflow:hidden;width:calc(100% - 40px)}[_nghost-%COMP%] ix-rich-text-form-field[_ngcontent-%COMP%]{margin-bottom:12px}[_nghost-%COMP%] .change-mode-button[_ngcontent-%COMP%]{--mdc-outlined-button-container-height: 30px;--mdc-outlined-button-label-text-size: 13px;margin-bottom:22px}"]});let RichTextInputComponent2=_RichTextInputComponent;return RichTextInputComponent2})();var ResourceSelectionInputFacade=(()=>{let _ResourceSelectionInputFacade=class _ResourceSelectionInputFacade{constructor(){this.store=inject(Store)}getAgentId(version2){return version2?.previewAgent?.publicId?of(version2?.previewAgent?.publicId):version2?.previewAsset?.publicId?this.store.select(selectEntity5(version2?.previewAsset?.publicId)).pipe(map(asset=>asset?.agent?.publicId)):of(void 0)}options(field,query){return this.store.select(selectEntity10(field.context.component.pageVersion?.publicId||null)).pipe(switchMap(version2=>combineLatest([this.getAgentId(version2),query.valueChanges.pipe(startWith(query.value))])),switchMap(([agentId,query2])=>{if(agentId)switch(field.inputDescription.resource?.type){case"AgentDataTag":return this.store.dispatch(ensureAll23({agentId,fields:AGENT_DATA_TAG_WITH_VARIABLE_LIST_FIELDS})),this.getGroupedAgentDataTags(agentId,query2);default:return of([])}return of([])}))}getGroupedAgentDataTags(agentId,query){return combineLatest([this.store.select(selectEntities20),this.store.select(selectAllForAgent3(agentId)),this.store.select(selectEntities21)]).pipe(map(([sourceEntities,tags,variableEntities])=>{let filteredTags=tags;if(query){let q=deburr_default(query.toLowerCase());filteredTags=tags.filter(tag=>tag.name?.toLocaleLowerCase().includes(q))}let optionGroups={};for(let tag of filteredTags)tag.source?.publicId&&tag.variable?.publicId&&!variableEntities[tag.variable.publicId]?.internalUse&&(optionGroups[tag.source?.publicId]||(optionGroups[tag.source?.publicId]=[]),optionGroups[tag.source?.publicId].push({publicId:tag.publicId,label:tag.name,sublabel:tag.slug}));return Object.keys(optionGroups).map(key=>({label:sourceEntities[key]?.name,options:optionGroups[key]}))}))}};_ResourceSelectionInputFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ResourceSelectionInputFacade)},_ResourceSelectionInputFacade.\u0275prov=\u0275\u0275defineInjectable({token:_ResourceSelectionInputFacade,factory:_ResourceSelectionInputFacade.\u0275fac,providedIn:"root"});let ResourceSelectionInputFacade2=_ResourceSelectionInputFacade;return ResourceSelectionInputFacade2})();var _forTrack05=($index,$item)=>$item.publicId;function ResourceSelectionInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function ResourceSelectionInputComponent_For_12_Conditional_0_For_2_Conditional_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span",7),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let option_r2=\u0275\u0275nextContext().$implicit;\u0275\u0275advance(),\u0275\u0275textInterpolate(option_r2.sublabel)}}function ResourceSelectionInputComponent_For_12_Conditional_0_For_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-option",5)(1,"span",6)(2,"span"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275template(4,ResourceSelectionInputComponent_For_12_Conditional_0_For_2_Conditional_4_Template,2,1,"span",7),\u0275\u0275elementEnd()()),rf&2){let option_r2=ctx.$implicit;\u0275\u0275property("value",option_r2.publicId),\u0275\u0275advance(3),\u0275\u0275textInterpolate(option_r2.label),\u0275\u0275advance(),\u0275\u0275conditional(option_r2.sublabel?4:-1)}}function ResourceSelectionInputComponent_For_12_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-optgroup",4),\u0275\u0275repeaterCreate(1,ResourceSelectionInputComponent_For_12_Conditional_0_For_2_Template,5,3,"mat-option",5,_forTrack05),\u0275\u0275elementEnd()),rf&2){let groupOption_r3=\u0275\u0275nextContext().$implicit;\u0275\u0275property("label",groupOption_r3.label),\u0275\u0275advance(),\u0275\u0275repeater(groupOption_r3.options)}}function ResourceSelectionInputComponent_For_12_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,ResourceSelectionInputComponent_For_12_Conditional_0_Template,3,1,"mat-optgroup",4),rf&2){let groupOption_r3=ctx.$implicit;\u0275\u0275conditional(groupOption_r3.options.length?0:-1)}}function ResourceSelectionInputComponent_Conditional_13_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",3),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}var ResourceSelectionInputComponent=(()=>{let _ResourceSelectionInputComponent=class _ResourceSelectionInputComponent extends ComponentInputComponent{constructor(){super(...arguments),this.cdRef=inject(ChangeDetectorRef),this.destroy=inject(DestroyRef),this.facade=inject(ResourceSelectionInputFacade),this.groupedOptions=[],this.queryFormControl=new FormControl("")}ngOnInit(){this.facade.options(this.field,this.queryFormControl).pipe(takeUntilDestroyed(this.destroy)).subscribe(options=>{this.groupedOptions=options,this.cdRef.markForCheck()})}get publicIdControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"publicId"])}get nameControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"name"])}selectionChanged(value){let option=this.groupedOptions.reduce((options,groupedOption)=>options.concat(groupedOption.options),[]).find(option2=>option2.publicId===value);option&&this.nameControl?.setValue(option.label)}};_ResourceSelectionInputComponent.\u0275fac=(()=>{let \u0275ResourceSelectionInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275ResourceSelectionInputComponent_BaseFactory||(\u0275ResourceSelectionInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_ResourceSelectionInputComponent)))(__ngFactoryType__||_ResourceSelectionInputComponent)}})(),_ResourceSelectionInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ResourceSelectionInputComponent,selectors:[["ix-resource-selection-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:14,vars:12,consts:[[1,"description",3,"innerHTML"],["panelClass","select-resource-selector-panel",3,"selectionChange","formControl"],[3,"formControl","placeholderLabel","noEntriesFoundLabel"],["translate",""],[3,"label"],[3,"value"],["fxLayout","column"],[1,"sublabel"]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,ResourceSelectionInputComponent_Conditional_0_Template,2,3,"p",0),\u0275\u0275elementStart(1,"mat-form-field")(2,"mat-label"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"mat-select",1),\u0275\u0275listener("selectionChange",function($event){return ctx.selectionChanged($event.value)}),\u0275\u0275elementStart(5,"mat-select-trigger"),\u0275\u0275text(6),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"mat-option"),\u0275\u0275element(8,"ngx-mat-select-search",2),\u0275\u0275pipe(9,"translate"),\u0275\u0275pipe(10,"translate"),\u0275\u0275elementEnd(),\u0275\u0275repeaterCreate(11,ResourceSelectionInputComponent_For_12_Template,1,1,null,null,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd(),\u0275\u0275template(13,ResourceSelectionInputComponent_Conditional_13_Template,2,0,"mat-error",3),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(3),\u0275\u0275textInterpolate(ctx.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("formControl",ctx.publicIdControl),\u0275\u0275advance(2),\u0275\u0275textInterpolate1(" ",ctx.nameControl.value," "),\u0275\u0275advance(2),\u0275\u0275property("formControl",ctx.queryFormControl)("placeholderLabel",\u0275\u0275pipeBind1(9,8,"SEARCH"))("noEntriesFoundLabel",\u0275\u0275pipeBind1(10,10,"NO_RESULTS_FOUND")),\u0275\u0275advance(3),\u0275\u0275repeater(ctx.groupedOptions),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.inputControl!=null&&ctx.inputControl.hasError("required")?13:-1))},dependencies:[MatSelectSearchComponent,DefaultLayoutDirective,NgControlStatus,FormControlDirective,TranslateDirective,MatOption,MatOptgroup,MatFormField,MatLabel,MatError,MatSelect,MatSelectTrigger,RenderMarkdownPipe,TranslatePipe],styles:["[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{display:block} .mat-mdc-select-panel.select-resource-selector-panel mat-option.mat-mdc-option{line-height:1em} .mat-mdc-select-panel.select-resource-selector-panel mat-option.mat-mdc-option .sublabel{font-size:13px;color:#0000008a}"]});let ResourceSelectionInputComponent3=_ResourceSelectionInputComponent;return ResourceSelectionInputComponent3})();var ResourceSelectionInput=class extends ComponentPropertiesInput{constructor(input2,value,context3,converter,level){super(input2,value,context3,converter,level),this.setValue(value)}setValue(value){super.setValue(value),this.name=value?.name,this.publicId=value?.publicId}toFormControl(){let required=this.inputDescription.required?Validators.required:null;return new FormGroup({name:new FormControl(this.name),publicId:new FormControl(this.publicId,required)})}};function inputConstructor(input2){switch(input2.type){case"Number":return NumberInput;case"Group":return GroupInput;case"List":return ListInput;case"RichText":return RichTextInput;case"Selection":return SelectionInput;case"String":return StringInput;case"Text":return TextInput;default:return ComponentPropertiesInput}}function pageComponentInputConstructor(input2){switch(input2.type){case"AggregatedMetric":return AggregatedMetricInput;case"LiveMetric":return LiveMetricInput;case"RawMetric":return RawMetricInput;case"ResourceSelection":return ResourceSelectionInput;default:return inputConstructor(input2)}}function getComponentType(field){switch(field.inputDescription.type){case"Text":return TextInputComponent;case"Color":return ColorInputComponent;case"Date":return DateInputComponent;case"File":return FileInputComponent;case"MaterialIcon":return MaterialIconInputComponent;case"Number":return NumberInputComponent;case"Image":return ImageInputComponent;case"Checkbox":return CheckboxInputComponent;case"Selection":return SelectionInputComponent;case"RichText":return RichTextInputComponent;case"Group":return GroupInputComponent;case"List":return ListInputComponent;default:return StringInputComponent}}function getPageComponentComponentType(field){switch(field.inputDescription.type){case"Icon":return IconInputComponent;case"AggregatedMetric":return AggregatedMetricInputComponent;case"LiveMetric":return LiveMetricInputComponent;case"RawMetric":return RawMetricInputComponent;case"ResourceSelection":return ResourceSelectionInputComponent;default:return getComponentType(field)}}function getPendingFormValue(form){return Object.keys(form.controls).reduce((formValue,formControlName)=>{let _control=form.controls[formControlName];return _control instanceof FormGroup?__spreadProps(__spreadValues({},formValue),{[formControlName]:getPendingFormValue(_control)}):_control instanceof FormControl&&_control._pendingDirty?__spreadProps(__spreadValues({},formValue),{[formControlName]:_control._pendingValue}):formValue},form.value)}var ComponentPropertiesFacade=(()=>{let _ComponentPropertiesFacade=class _ComponentPropertiesFacade{constructor(store){this.store=store}manifest(template){return this.store.select(selectEntity2(template.publicId)).pipe(mergeMap(manifest=>manifest?of(manifest):(this.store.dispatch(ensureOne({template})),EMPTY)))}};_ComponentPropertiesFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentPropertiesFacade)(\u0275\u0275inject(Store))},_ComponentPropertiesFacade.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentPropertiesFacade,factory:_ComponentPropertiesFacade.\u0275fac,providedIn:"root"});let ComponentPropertiesFacade2=_ComponentPropertiesFacade;return ComponentPropertiesFacade2})();var ComponentPropertiesComponent=(()=>{let _ComponentPropertiesComponent=class _ComponentPropertiesComponent{constructor(cdRef,inputConverter,facade,contextService){this.cdRef=cdRef,this.inputConverter=inputConverter,this.facade=facade,this.contextService=contextService,this.afterViewInit$=new BehaviorSubject(!1),this.component$=new ReplaySubject(1),this.template$=new ReplaySubject(1),this.remove=new EventEmitter,this.update=new EventEmitter,this.unsavedChanges=new EventEmitter,this.form=new FormGroup({},{updateOn:"blur"}),this.destroy=inject(DestroyRef)}ngOnInit(){this.component$.pipe(distinctUntilChanged((a,b)=>a.publicId===b.publicId),pairwise(),takeUntilDestroyed(this.destroy)).subscribe(([previous])=>{this.emitPendingChanges(previous)}),combineLatest([this.component$,this.template$,this.afterViewInit$]).pipe(filter(([,,afterViewInit])=>afterViewInit),mergeMap(([component,template])=>combineLatest([of([component,template]),this.contextService.contextChanges.pipe(map(()=>this.inputConverter.hasFields({component})),distinctUntilChanged())])),filter(([,hasFields2])=>hasFields2),switchMap(([[component,template]])=>template?this.facade.manifest(template).pipe(map(manifest=>({component,manifest}))):of({component,manifest:null})),takeUntilDestroyed(this.destroy)).subscribe(({component,manifest})=>{if(this.currentComponentId===component.publicId)return;this.currentInputs=void 0,this.form.contains("inputs")&&this.form.removeControl("inputs"),this.fields=this.inputConverter.getFields({component},manifest?.inputs??null);let formControls=this.inputConverter.getFormControls(this.fields),inputs=new FormGroup(formControls);this.form.markAsPristine(),this.form.addControl("inputs",inputs),this.formDirective&&(this.formDirective.viewContainerRef.clear(),this.inputConverter.loadComponentInputs(this.fields,inputs,this.formDirective.viewContainerRef)),this.currentComponentId=component.publicId}),this.form.statusChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>{this.unsavedChanges.emit(this.form.dirty&&this.form.invalid),this.cdRef.markForCheck()}),this.form.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(data=>{let doSubmit=!1;if(!(!this.form.valid&&this.currentInputs!==void 0)){if("inputs"in data){this.fields.forEach(field=>field.setValue(data.inputs[field.inputDescription.key]));let inputsString=JSON.stringify(data.inputs);inputsString!==this.currentInputs&&(this.currentInputs!==void 0&&(doSubmit=!0),this.currentInputs=inputsString)}doSubmit&&this.submit()}})}ngOnChanges(changes){changes.template&&this.template$.next(this.template),changes.component&&this.component$.next(this.component)}ngAfterViewInit(){setTimeout(()=>{this.afterViewInit$.next(!0)},0)}ngOnDestroy(){this.emitPendingChanges(this.component),this.component$.complete(),this.template$.complete(),this.afterViewInit$.complete()}emitPendingChanges(component){if(component.inputs&&this.form.controls.inputs){let snapshot=cloneDeep_default(this.form.value);this.form.patchValue({inputs:getPendingFormValue(this.form.controls.inputs)},{emitEvent:!1}),!this.form.invalid&&!isEqual_default(snapshot,this.form.value)&&(isEqual_default(this.form.value.inputs,JSON.parse(component.inputs))||this.update.emit({publicId:component.publicId,inputs:JSON.stringify(this.form.value.inputs)}))}}submit(){let formValue=this.form.value.inputs?{inputs:JSON.stringify(this.form.value.inputs)}:{},component=__spreadValues(__spreadValues({},this.component),formValue);this.update.emit(component),this.form.markAsPristine()}};_ComponentPropertiesComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentPropertiesComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(INPUT_CONVERTER_TOKEN),\u0275\u0275directiveInject(ComponentPropertiesFacade),\u0275\u0275directiveInject(ComponentContextService))},_ComponentPropertiesComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ComponentPropertiesComponent,selectors:[["ix-page-component-properties"]],viewQuery:function(rf,ctx){if(rf&1&&(\u0275\u0275viewQuery(InputControlFormDirective,5),\u0275\u0275viewQuery(MatExpansionPanel,5)),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.formDirective=_t.first),\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.panelRefs=_t)}},inputs:{template:"template",component:"component"},outputs:{remove:"remove",update:"update",unsavedChanges:"unsavedChanges"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:3,vars:1,consts:[["autocomplete","off",3,"ngSubmit","formGroup"],["fxLayout","column",1,"more-actions"],["ixInputControlForm",""]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"form",0),\u0275\u0275listener("ngSubmit",function(){return ctx.submit()}),\u0275\u0275elementStart(1,"div",1),\u0275\u0275element(2,"div",2),\u0275\u0275elementEnd()()),rf&2&&\u0275\u0275property("formGroup",ctx.form)},dependencies:[InputControlFormDirective,\u0275NgNoValidate,NgControlStatusGroup,FormGroupDirective,DefaultLayoutDirective],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] button[type=submit][_ngcontent-%COMP%]{margin:16px}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%]{background-color:transparent;border-radius:0}[_nghost-%COMP%] .mat-expansion-panel-header-title[_ngcontent-%COMP%]{color:var(--body-color)}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%]:not(.mat-expanded){box-shadow:none!important}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%]:not(.mat-expanded) + .mat-expansion-panel.mat-expanded[_ngcontent-%COMP%]{border-top-left-radius:8px;border-top-right-radius:8px}[_nghost-%COMP%] .mat-expansion-panel.mat-expanded[_ngcontent-%COMP%]{background-color:var(--basic)}[_nghost-%COMP%] .mat-expansion-panel.mat-expanded[_ngcontent-%COMP%] + .mat-expansion-panel.mat-expanded[_ngcontent-%COMP%]{border-top:1px solid var(--mat-sys-outline-variant)}[_nghost-%COMP%] .mat-expansion-panel.border-radius-bottom[_ngcontent-%COMP%]{border-bottom-left-radius:8px!important;border-bottom-right-radius:8px!important}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%] .mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 20px 0 16px}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0 16px 16px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:8px}[_nghost-%COMP%] .more-actions[_ngcontent-%COMP%] .component-property-level-0{border-bottom:1px solid var(--mat-sys-outline-variant);padding:16px}[_nghost-%COMP%] .more-actions[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-right:4px}"]});let ComponentPropertiesComponent3=_ComponentPropertiesComponent;return ComponentPropertiesComponent3})();var MAT_LUXON_DATE_ADAPTER_OPTIONS=new InjectionToken("MAT_LUXON_DATE_ADAPTER_OPTIONS",{providedIn:"root",factory:MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY});function MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY(){return{useUtc:!1,defaultOutputCalendar:"gregory"}}function range(length,valueFunction){let valuesArray=Array(length);for(let i=0;i<length;i++)valuesArray[i]=valueFunction(i);return valuesArray}var LuxonDateAdapter=(()=>{class LuxonDateAdapter2 extends DateAdapter{_useUTC;_firstDayOfWeek;_defaultOutputCalendar;constructor(){super();let dateLocale=inject(MAT_DATE_LOCALE,{optional:!0}),options=inject(MAT_LUXON_DATE_ADAPTER_OPTIONS,{optional:!0});this._useUTC=!!options?.useUtc,this._firstDayOfWeek=options?.firstDayOfWeek,this._defaultOutputCalendar=options?.defaultOutputCalendar||"gregory",this.setLocale(dateLocale||DateTime.local().locale)}getYear(date){return date.year}getMonth(date){return date.month-1}getDate(date){return date.day}getDayOfWeek(date){return date.weekday}getMonthNames(style2){return Info.months(style2,{locale:this.locale,outputCalendar:this._defaultOutputCalendar})}getDateNames(){let dtf=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return range(31,i=>dtf.format(DateTime.utc(2017,1,i+1).toJSDate()))}getDayOfWeekNames(style2){let days=Info.weekdays(style2,{locale:this.locale});return days.unshift(days.pop()),days}getYearName(date){return date.toFormat("yyyy",this._getOptions())}getFirstDayOfWeek(){return this._firstDayOfWeek??Info.getStartOfWeek({locale:this.locale})}getNumDaysInMonth(date){return date.daysInMonth}clone(date){return DateTime.fromObject(date.toObject(),this._getOptions())}createDate(year,month,date){let options=this._getOptions();if(month<0||month>11)throw Error(`Invalid month index "${month}". Month index has to be between 0 and 11.`);if(date<1)throw Error(`Invalid date "${date}". Date has to be greater than 0.`);let result=this._useUTC?DateTime.utc(year,month+1,date,options):DateTime.local(year,month+1,date,options);if(!this.isValid(result))throw Error(`Invalid date "${date}". Reason: "${result.invalidReason}".`);return result}today(){let options=this._getOptions();return this._useUTC?DateTime.utc(options):DateTime.local(options)}parse(value,parseFormat){let options=this._getOptions();if(typeof value=="string"&&value.length>0){let iso8601Date=DateTime.fromISO(value,options);if(this.isValid(iso8601Date))return iso8601Date;let formats=Array.isArray(parseFormat)?parseFormat:[parseFormat];if(!parseFormat.length)throw Error("Formats array must not be empty.");for(let format2 of formats){let fromFormat=DateTime.fromFormat(value,format2,options);if(this.isValid(fromFormat))return fromFormat}return this.invalid()}else{if(typeof value=="number")return DateTime.fromMillis(value,options);if(value instanceof Date)return DateTime.fromJSDate(value,options);if(value instanceof DateTime)return DateTime.fromMillis(value.toMillis(),options)}return null}format(date,displayFormat){if(!this.isValid(date))throw Error("LuxonDateAdapter: Cannot format invalid date.");return this._useUTC?date.setLocale(this.locale).setZone("utc").toFormat(displayFormat):date.setLocale(this.locale).toFormat(displayFormat)}addCalendarYears(date,years){return date.reconfigure(this._getOptions()).plus({years})}addCalendarMonths(date,months2){return date.reconfigure(this._getOptions()).plus({months:months2})}addCalendarDays(date,days){return date.reconfigure(this._getOptions()).plus({days})}toIso8601(date){return date.toISO()}deserialize(value){let options=this._getOptions(),date;if(value instanceof Date&&(date=DateTime.fromJSDate(value,options)),typeof value=="string"){if(!value)return null;date=DateTime.fromISO(value,options)}return date&&this.isValid(date)?date:super.deserialize(value)}isDateInstance(obj){return obj instanceof DateTime}isValid(date){return date.isValid}invalid(){return DateTime.invalid("Invalid Luxon DateTime object.")}setTime(target,hours,minutes,seconds){return this.clone(target).set({hour:hours,minute:minutes,second:seconds,millisecond:0})}getHours(date){return date.hour}getMinutes(date){return date.minute}getSeconds(date){return date.second}parseTime(value,parseFormat){let result=this.parse(value,parseFormat);return(!result||!this.isValid(result))&&typeof value=="string"&&this.parse(value.replace(/[^0-9:(AM|PM)]/gi,""),parseFormat)||result}addSeconds(date,amount){return date.reconfigure(this._getOptions()).plus({seconds:amount})}_getOptions(){return{zone:this._useUTC?"utc":void 0,locale:this.locale,outputCalendar:this._defaultOutputCalendar}}static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||LuxonDateAdapter2)};static \u0275prov=\u0275\u0275defineInjectable({token:LuxonDateAdapter2,factory:LuxonDateAdapter2.\u0275fac})}return LuxonDateAdapter2})(),MAT_LUXON_DATE_FORMATS={parse:{dateInput:"D",timeInput:"t"},display:{dateInput:"D",timeInput:"t",monthYearLabel:"LLL yyyy",dateA11yLabel:"DD",monthYearA11yLabel:"LLLL yyyy",timeOptionLabel:"t"}};var MatLuxonDateModule=(()=>{class MatLuxonDateModule2{static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||MatLuxonDateModule2)};static \u0275mod=\u0275\u0275defineNgModule({type:MatLuxonDateModule2});static \u0275inj=\u0275\u0275defineInjector({providers:[provideLuxonDateAdapter()]})}return MatLuxonDateModule2})();function provideLuxonDateAdapter(formats=MAT_LUXON_DATE_FORMATS){return[{provide:DateAdapter,useClass:LuxonDateAdapter,deps:[MAT_DATE_LOCALE,MAT_LUXON_DATE_ADAPTER_OPTIONS]},{provide:MAT_DATE_FORMATS,useValue:formats}]}var PERIOD_SPEC_LIST=TIME_RANGE_OPTIONS.map(({code})=>code);var PeriodFieldsetModule=(()=>{let _PeriodFieldsetModule=class _PeriodFieldsetModule{};_PeriodFieldsetModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodFieldsetModule)},_PeriodFieldsetModule.\u0275mod=\u0275\u0275defineNgModule({type:_PeriodFieldsetModule}),_PeriodFieldsetModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule]});let PeriodFieldsetModule2=_PeriodFieldsetModule;return PeriodFieldsetModule2})();var SelectorDialogModule=(()=>{let _SelectorDialogModule=class _SelectorDialogModule{};_SelectorDialogModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectorDialogModule)},_SelectorDialogModule.\u0275mod=\u0275\u0275defineNgModule({type:_SelectorDialogModule}),_SelectorDialogModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule,NgxMatSelectSearchModule]});let SelectorDialogModule2=_SelectorDialogModule;return SelectorDialogModule2})();var SelectorInputModule=(()=>{let _SelectorInputModule=class _SelectorInputModule{};_SelectorInputModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectorInputModule)},_SelectorInputModule.\u0275mod=\u0275\u0275defineNgModule({type:_SelectorInputModule}),_SelectorInputModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule,SelectorDialogModule]});let SelectorInputModule2=_SelectorInputModule;return SelectorInputModule2})();var NumberInputValidatorModule=(()=>{let _NumberInputValidatorModule=class _NumberInputValidatorModule{};_NumberInputValidatorModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_NumberInputValidatorModule)},_NumberInputValidatorModule.\u0275mod=\u0275\u0275defineNgModule({type:_NumberInputValidatorModule}),_NumberInputValidatorModule.\u0275inj=\u0275\u0275defineInjector({});let NumberInputValidatorModule2=_NumberInputValidatorModule;return NumberInputValidatorModule2})();var InputConverterService=class{constructor(){this.injector=inject(Injector)}convertInput(input2,values,context3,level){let constructor=this.getInputConstructor(input2);return new constructor(input2,values?.[input2.key],context3,this,level,this.injector)}getFormControls(inputs){return inputs.reduce((acc,cur)=>__spreadProps(__spreadValues({},acc),{[cur.inputDescription.key]:cur.toFormControl()}),{})}getFields(context3,inputs){let componentInput=this.getInputs(context3);return inputs?.map(input2=>this.convertInput(input2,componentInput,context3,0))||[]}loadComponentInputs(fields,form,ref){for(let field of fields){let componentType=this.getComponentType(field),componentRef=ref.createComponent(componentType);componentRef.instance.field=field,componentRef.instance.componentFormGroup=form,componentRef.location.nativeElement.classList.add(`component-property-level-${field.level}`)}}};var PageComponentInputConverterService=(()=>{let _PageComponentInputConverterService=class _PageComponentInputConverterService extends InputConverterService{constructor(){super(...arguments),this.service=inject(ComponentContextService)}getInputs({component}){let context3=this.service.getContext(component);if(context3===void 0)throw Error(`ComponentContext could not be found for component ${component.publicId}.`);let inputs=cloneDeep_default(context3.inputs)||{};return Object.keys(context3._translationKeys).forEach(key=>set_default(inputs,key,context3._translationKeys[key])),inputs}getInputConstructor(input2){return pageComponentInputConstructor(input2)}getComponentType(field){return getPageComponentComponentType(field)}hasFields({component}){return this.service.getContext(component)!==void 0}};_PageComponentInputConverterService.\u0275fac=(()=>{let \u0275PageComponentInputConverterService_BaseFactory;return function(__ngFactoryType__){return(\u0275PageComponentInputConverterService_BaseFactory||(\u0275PageComponentInputConverterService_BaseFactory=\u0275\u0275getInheritedFactory(_PageComponentInputConverterService)))(__ngFactoryType__||_PageComponentInputConverterService)}})(),_PageComponentInputConverterService.\u0275prov=\u0275\u0275defineInjectable({token:_PageComponentInputConverterService,factory:_PageComponentInputConverterService.\u0275fac,providedIn:"root"});let PageComponentInputConverterService2=_PageComponentInputConverterService;return PageComponentInputConverterService2})();var InputControlModule=(()=>{let _InputControlModule=class _InputControlModule{};_InputControlModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_InputControlModule)},_InputControlModule.\u0275mod=\u0275\u0275defineNgModule({type:_InputControlModule}),_InputControlModule.\u0275inj=\u0275\u0275defineInjector({providers:[{provide:INPUT_CONVERTER_TOKEN,useClass:PageComponentInputConverterService}],imports:[ColorPickerPanelModule,FileUploadButtonComponent,FileUploadDropContainerComponent,MarkdownModule,MatLuxonDateModule,MaterialIconFieldsetComponent,NgxMatSelectSearchModule,NumberInputValidatorModule,PeriodFieldsetModule,SelectorInputModule,SharedModule,TranslationIconButtonComponent]});let InputControlModule2=_InputControlModule;return InputControlModule2})();var ComponentPropertiesModule=(()=>{let _ComponentPropertiesModule=class _ComponentPropertiesModule{};_ComponentPropertiesModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentPropertiesModule)},_ComponentPropertiesModule.\u0275mod=\u0275\u0275defineNgModule({type:_ComponentPropertiesModule}),_ComponentPropertiesModule.\u0275inj=\u0275\u0275defineInjector({imports:[InputControlModule,ReactiveFormsModule,FlexModule,InputControlModule]});let ComponentPropertiesModule2=_ComponentPropertiesModule;return ComponentPropertiesModule2})();var ComponentContextCleanupDirective=(()=>{let _ComponentContextCleanupDirective=class _ComponentContextCleanupDirective{set agentOrAssetId(agentOrAssetId){this.agentOrAssetId$.next(agentOrAssetId)}set pageVersionId(pageVersionId){this.pageVersionId$.next(pageVersionId)}constructor(scopeRef,contextService){this.scopeRef=scopeRef,this.contextService=contextService,this.agentOrAssetId$=new ReplaySubject(1),this.pageVersionId$=new ReplaySubject(1),this.destroy=inject(DestroyRef)}ngOnInit(){combineLatest([this.agentOrAssetId$,this.pageVersionId$]).pipe(filter(ids=>ids.every(Boolean)),distinctUntilChanged(isEqual_default),skip(1),takeUntilDestroyed(this.destroy)).subscribe(()=>{this.contextService.destroyAll(this.scopeRef?.value)})}ngOnDestroy(){this.agentOrAssetId$.complete(),this.pageVersionId$.complete()}};_ComponentContextCleanupDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentContextCleanupDirective)(\u0275\u0275directiveInject(ComponentGridScopeDirective,8),\u0275\u0275directiveInject(ComponentContextService))},_ComponentContextCleanupDirective.\u0275dir=\u0275\u0275defineDirective({type:_ComponentContextCleanupDirective,selectors:[["","ixComponentContextCleanup",""]],inputs:{agentOrAssetId:"agentOrAssetId",pageVersionId:"pageVersionId"},standalone:!1});let ComponentContextCleanupDirective3=_ComponentContextCleanupDirective;return ComponentContextCleanupDirective3})();var setLocale=createAction("[Localization] Set Locale",props()),setTimeZone=createAction("[Localization] Set Time Zone",props());var LOCALE_STORAGE_KEY="locale";var LANGUAGE_TO_LOCALES=[{code:"nl",locale:"nl-NL"},{code:"de",locale:"de-DE"},{code:"en",locale:"en-US"}],TIME_ZONE_STORAGE_KEY="timezone";function mapLangToLocale(lang){return LANGUAGE_TO_LOCALES.find(map4=>map4.code===lang)?.locale||lang}var LocalizationService=(()=>{let _LocalizationService=class _LocalizationService{constructor(storage){this.storage=storage}getLocale(){if(this.storage.has(LOCALE_STORAGE_KEY)){let locale=this.storage.get(LOCALE_STORAGE_KEY);return locale.includes("_")&&(locale=locale.replace("_","-"),this.setLocale(locale)),locale}return mapLangToLocale(Intl.DateTimeFormat().resolvedOptions().locale)}getTimeZone(){return this.storage.has(TIME_ZONE_STORAGE_KEY)?this.storage.get(TIME_ZONE_STORAGE_KEY):Intl.DateTimeFormat().resolvedOptions().timeZone}setLocale(locale){locale!==null?(this.storage.forever(LOCALE_STORAGE_KEY,locale),Settings.defaultLocale=locale):(this.storage.forget(LOCALE_STORAGE_KEY),Settings.defaultLocale=mapLangToLocale(Intl.DateTimeFormat().resolvedOptions().locale))}setTimeZone(timeZone){timeZone!==null?(this.storage.forever(TIME_ZONE_STORAGE_KEY,timeZone),Settings.defaultZone=timeZone):(this.storage.forget(TIME_ZONE_STORAGE_KEY),Settings.defaultZone=Intl.DateTimeFormat().resolvedOptions().timeZone)}};_LocalizationService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LocalizationService)(\u0275\u0275inject(StorageService))},_LocalizationService.\u0275prov=\u0275\u0275defineInjectable({token:_LocalizationService,factory:_LocalizationService.\u0275fac,providedIn:"root"});let LocalizationService2=_LocalizationService;return LocalizationService2})();var LocalizationEffects=(()=>{let _LocalizationEffects=class _LocalizationEffects{constructor(actions$,service){this.actions$=actions$,this.service=service,this.setLocale$=createEffect(()=>this.actions$.pipe(ofType(setLocale),tap(({locale})=>this.service.setLocale(locale))),{dispatch:!1}),this.setTimeZone$=createEffect(()=>this.actions$.pipe(ofType(setTimeZone),tap(({timeZone})=>this.service.setTimeZone(timeZone))),{dispatch:!1}),this.setDefaultUserPreferences$=createEffect(()=>this.actions$.pipe(ofType(logInSuccess,loadMeSuccess2),map(({data})=>({localisation:get_default(data,"localisation",get_default(data,"user.localisation")),timeZone:get_default(data,"timeZone",get_default(data,"user.timeZone"))})),filter(({localisation,timeZone})=>isNil_default(localisation)||isNil_default(timeZone)),map(({localisation,timeZone})=>updateMe({data:__spreadValues(__spreadValues({},isNil_default(localisation)?{localisation:this.service.getLocale()}:{}),isNil_default(timeZone)?{timeZone:this.service.getTimeZone()}:{})})))),this.localeUserPreference$=createEffect(()=>this.actions$.pipe(ofType(logInSuccess,loadMeSuccess2,updateMeSuccess,didUpdateMe),map(({data})=>get_default(data,"localisation",get_default(data,"user.localisation"))),filter(locale=>locale!==void 0),distinctUntilChanged(),map(locale=>setLocale({locale})))),this.timeZoneUserPreference$=createEffect(()=>this.actions$.pipe(ofType(logInSuccess,loadMeSuccess2,updateMeSuccess,didUpdateMe),map(({data})=>get_default(data,"timeZone",get_default(data,"user.timeZone"))),filter(timeZone=>timeZone!==void 0),distinctUntilChanged(),map(timeZone=>setTimeZone({timeZone}))))}};_LocalizationEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LocalizationEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(LocalizationService))},_LocalizationEffects.\u0275prov=\u0275\u0275defineInjectable({token:_LocalizationEffects,factory:_LocalizationEffects.\u0275fac});let LocalizationEffects2=_LocalizationEffects;return LocalizationEffects2})();var LocalizationModule=(()=>{let _LocalizationModule=class _LocalizationModule{constructor(storage){Settings.defaultLocale=storage.get(LOCALE_STORAGE_KEY,mapLangToLocale(Intl.DateTimeFormat().resolvedOptions().locale)),Settings.defaultZone=storage.get(TIME_ZONE_STORAGE_KEY,Intl.DateTimeFormat().resolvedOptions().timeZone)}};_LocalizationModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LocalizationModule)(\u0275\u0275inject(StorageService))},_LocalizationModule.\u0275mod=\u0275\u0275defineNgModule({type:_LocalizationModule}),_LocalizationModule.\u0275inj=\u0275\u0275defineInjector({providers:[{provide:MAT_DATE_LOCALE,useFactory:service=>service.getLocale(),deps:[LocalizationService]}],imports:[StorageModule,EffectsModule.forFeature([LocalizationEffects])]});let LocalizationModule2=_LocalizationModule;return LocalizationModule2})();var LoggingDataPrefetcher=(()=>{let _LoggingDataPrefetcher=class _LoggingDataPrefetcher{constructor(store,actions$){this.store=store,this.actions$=actions$}forQueries(agentId,queries){let parsedSelectors=queries.map(query=>query.selector?parseSelector(query.selector):{type:"",target:"",dataSource:"",logType:"",logName:""}).filter(r=>r?.type==="Agent"&&r?.target==="selected"),uniqDataSourceSlugs=compact_default(uniq_default(parsedSelectors.map(r=>r?.dataSource))),uniqDataTagSlugs=compact_default(uniq_default(parsedSelectors.filter(r=>r?.logType==="tag").map(r=>r?.logName))),uniqDataVariableSlugs=compact_default(uniq_default(parsedSelectors.filter(r=>r?.logType==="variable").map(r=>r?.logName)));return combineLatest([this.handleDataSourceSlugs(agentId,uniqDataSourceSlugs),this.handleDataTagSlugs(agentId,uniqDataTagSlugs),this.handleDataVariableSlugs(agentId,uniqDataVariableSlugs)]).pipe(mergeMap(()=>of(queries)))}handleDataSourceSlugs(agentId,slugs){return agentId&&slugs.length?combineLatest([this.store.select(selectAllLoadedForAgent(agentId)),this.store.select(selectAllForAgent(agentId))]).pipe(take(1),mergeMap(([sourcesLoaded,sources])=>{if(sourcesLoaded&&sources.length===0)return of([]);let unmatchedSlugs=slugs.filter(slug=>!sources?.find(s2=>s2?.slug===slug));if(unmatchedSlugs.length){let filters=`in(slug,"${unmatchedSlugs.join('","')}")`,queryTooLarge=("?fields="+AGENT_DATA_SOURCE_LIST_FIELDS.join(",")+"&").length+filters.length+`&page-after=publicid0000&page-size=${4e3}`.length>4096,reference2=`${agentId}_${filters}`;return this.store.dispatch(loadAll2({agentId,filters:queryTooLarge?void 0:filters})),this.actions$.pipe(ofType(loadAllSuccess3,loadAllFailure2),filter(({agentId:agentId2,filters:filters2})=>`${agentId2}_${filters2}`===reference2||queryTooLarge),take(1),map(()=>[]))}return of([])}),map(()=>[])):of([])}handleDataTagSlugs(agentId,slugs){return agentId&&slugs.length?combineLatest([this.store.select(selectAllLoadedForAgent(agentId)),this.store.select(selectAllForAgent(agentId)),this.store.select(selectAllForAgent3(agentId))]).pipe(take(1),mergeMap(([sourcesLoaded,sources,tags])=>{if(sourcesLoaded&&sources.length===0)return of([]);let unmatchedSlugs=slugs.filter(slug=>!tags?.find(t=>t?.slug===slug));if(unmatchedSlugs.length){let filters=`in(slug,"${unmatchedSlugs.join('","')}")`,queryTooLarge=("?fields="+AGENT_DATA_TAG_WITH_VARIABLE_LIST_FIELDS.join(",")+"&").length+(filters?.length||0)+`&page-after=publicid0000&page-size=${4e3}`.length>4096,reference2=`${agentId}_${filters}`;return this.store.dispatch(loadAll27({agentId,fields:AGENT_DATA_TAG_WITH_VARIABLE_LIST_FIELDS,filters:queryTooLarge?void 0:filters})),this.actions$.pipe(ofType(loadAllSuccess28,loadAllFailure27),filter(({agentId:agentId2,filters:filters2})=>`${agentId2}_${filters2}`===reference2||queryTooLarge),take(1),map(()=>[]))}return of([])}),map(()=>[])):of([])}handleDataVariableSlugs(agentId,slugs){return agentId&&slugs.length?this.store.select(selectAllLoadedForAgent2(agentId)).pipe(take(1),mergeMap(loaded=>{if(!loaded){let reference2=agentId;return this.store.dispatch(loadAll28({agentId})),this.actions$.pipe(ofType(loadAllSuccess29,loadAllFailure28),filter(({agentId:agentId2})=>agentId2===reference2),take(1),map(()=>[]))}return of([])}),map(()=>[])):of([])}};_LoggingDataPrefetcher.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoggingDataPrefetcher)(\u0275\u0275inject(Store),\u0275\u0275inject(Actions))},_LoggingDataPrefetcher.\u0275prov=\u0275\u0275defineInjectable({token:_LoggingDataPrefetcher,factory:_LoggingDataPrefetcher.\u0275fac,providedIn:"root"});let LoggingDataPrefetcher2=_LoggingDataPrefetcher;return LoggingDataPrefetcher2})();var LoggingDataBrokerDirective=(()=>{let _LoggingDataBrokerDirective=class _LoggingDataBrokerDirective{constructor(scopeRef,store,activePeriodSpec,authTokenService,localization,loggingDataClient,loggingDataFetcherFactory,loggingDataPrefetcher){this.scopeRef=scopeRef,this.store=store,this.activePeriodSpec=activePeriodSpec,this.authTokenService=authTokenService,this.localization=localization,this.loggingDataClient=loggingDataClient,this.loggingDataFetcherFactory=loggingDataFetcherFactory,this.loggingDataPrefetcher=loggingDataPrefetcher,this.agentOrAssetId$=new ReplaySubject(1),this.agentId=null,this.agentId$=this.agentOrAssetId$.pipe(switchMap(agentOrAssetId=>this.store.select(selectEntities9).pipe(map(entities=>entities[agentOrAssetId]?findClosestAgentToAsset(agentOrAssetId,entities)?.publicId??null:agentOrAssetId),distinctUntilChanged()))),this._authToken$=combineLatest([timer(0,55*60*1e3),this.agentId$]).pipe(mergeMap(([,id])=>{let canUseLiveData=this.features.instantCanUse("live-data",{agentId:id}),canUseHistoricalData=this.features.instantCanUse("historical-data",{agentId:id});return id&&(canUseLiveData||canUseHistoricalData)?this.authTokenService.getForData({agents:[{publicId:id}],expiresIn:3600}).pipe(map(response=>response.data.secretId),catchError(()=>EMPTY)):EMPTY}),share()),this.authTokenRequired$=new ReplaySubject(1),this.authToken$=new ReplaySubject(1),this.dataSources$=this.agentId$.pipe(mergeMap(id=>this.store.select(selectAllForAgent(id)))),this.tags$=this.agentId$.pipe(mergeMap(id=>this.store.select(selectAllForAgent3(id)))),this.variables$=this.agentId$.pipe(mergeMap(id=>this.store.select(selectAllForAgent2(id)))),this.features=inject(PlatformFeaturesService),this.destroy=inject(DestroyRef)}ngOnInit(){this.agentId$.pipe(distinctUntilChanged()).subscribe(agentId=>this.agentId=agentId),this.fetcher=this.loggingDataFetcherFactory.create({agentId:this.agentId$.pipe(distinctUntilChanged()),authToken:this.authToken$.asObservable(),companyId:this.store.select(selectMyCompanyId),locale:this.localization.getLocale(),timeRange:this.activePeriodSpec.asTimeRange(this.scopeRef?.value),timeZone:of(Settings.defaultZone.name),dataSources:this.dataSources$,tags:this.tags$,variables:this.variables$,availabilityStrategy:LoggingDataConfigAvailabilityStrategy.Lazy,scope:this.scopeRef?.value,beforeFetch:queries=>this.agentId?this.loggingDataPrefetcher.forQueries(this.agentId,queries).pipe(mergeMap(queries2=>queries2.some(q=>q.selector?parseSelector(q.selector).logType==="variable":!1)?(this.authTokenRequired$.next(!0),this.authToken$.pipe(take(1),map(()=>queries2))):of(queries2))):of(queries)}),this.authTokenRequired$.pipe(distinctUntilChanged(),switchMap(required=>required?this._authToken$:EMPTY),takeUntilDestroyed(this.destroy)).subscribe(this.authToken$),merge(this.loggingDataClient.onQuery(this.scopeRef?.value),this.loggingDataClient.onDestroy(this.scopeRef?.value)).pipe(bufferDebounceTime(100),mergeMap(buffer2=>{let queries=[],destroyEvents=buffer2.filter(item=>item instanceof CustomEvent);return destroyEvents.length?queries=flatten_default(buffer2.filter(item=>!(item instanceof CustomEvent))).filter(q=>!destroyEvents.some(e=>q._clientRef?.startsWith(e.detail)&&(q._timeStamp?q._timeStamp<e.timeStamp:!0))):queries=flatten_default(buffer2),queries.length?of(queries):EMPTY}),mergeMap(queries=>this.fetcher.fetch(queries)),distinctUntilChanged(),takeUntilDestroyed(this.destroy)).subscribe(metrics=>{this.loggingDataClient.emitMetrics(metrics,this.scopeRef?.value)}),this.loggingDataClient.onExport(this.scopeRef?.value).pipe(mergeMap(({queries,csvDelimiter})=>this.fetcher.export(queries,csvDelimiter)),takeUntilDestroyed(this.destroy)).subscribe(blob=>{this.loggingDataClient.emitBlob(blob,this.scopeRef?.value)})}ngOnChanges(changes){changes.agentOrAssetId&&this.agentOrAssetId&&this.agentOrAssetId$.next(this.agentOrAssetId)}ngOnDestroy(){this.agentOrAssetId$.complete(),this.authToken$.complete(),this.authTokenRequired$.complete(),this.fetcher.destroy()}};_LoggingDataBrokerDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoggingDataBrokerDirective)(\u0275\u0275directiveInject(ComponentGridScopeDirective,8),\u0275\u0275directiveInject(Store),\u0275\u0275directiveInject(ActivePeriodSpec),\u0275\u0275directiveInject(AuthTokenService),\u0275\u0275directiveInject(LocalizationService),\u0275\u0275directiveInject(LoggingDataClientProxyService),\u0275\u0275directiveInject(LoggingDataFetcherFactory),\u0275\u0275directiveInject(LoggingDataPrefetcher))},_LoggingDataBrokerDirective.\u0275dir=\u0275\u0275defineDirective({type:_LoggingDataBrokerDirective,selectors:[["","ixLoggingDataBroker",""]],inputs:{agentOrAssetId:"agentOrAssetId"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature]});let LoggingDataBrokerDirective3=_LoggingDataBrokerDirective;return LoggingDataBrokerDirective3})();var ComponentGridFocusDirective=(()=>{let _ComponentGridFocusDirective=class _ComponentGridFocusDirective{constructor(){this.elRef=inject(ElementRef),this.service=inject(ComponentGridFocusService),this.destroy=inject(DestroyRef)}ngOnInit(){fromEvent(this.elRef.nativeElement,"mousedown").pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>this.service.next())}};_ComponentGridFocusDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentGridFocusDirective)},_ComponentGridFocusDirective.\u0275dir=\u0275\u0275defineDirective({type:_ComponentGridFocusDirective,selectors:[["","ixComponentGridFocus",""]]});let ComponentGridFocusDirective3=_ComponentGridFocusDirective;return ComponentGridFocusDirective3})();function PeriodBottomSheetComponent_For_4_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-list-item",11),\u0275\u0275listener("click",function(){let range_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.applyRange(range_r2.code))}),\u0275\u0275text(1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementEnd()}if(rf&2){let range_r2=ctx.$implicit;\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind2(2,1,range_r2.translateKey,range_r2.translateParams)," ")}}function PeriodBottomSheetComponent_Conditional_12_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"FROM_MUST_BE_BEFORE_TO"),\u0275\u0275elementEnd())}function PeriodBottomSheetComponent_Conditional_13_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.MAX_DATE"),\u0275\u0275elementEnd())}function PeriodBottomSheetComponent_Conditional_18_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"TO_MUST_BE_AFTER_FROM"),\u0275\u0275elementEnd())}function PeriodBottomSheetComponent_Conditional_19_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.MAX_DATE"),\u0275\u0275elementEnd())}var PeriodBottomSheetComponent=(()=>{let _PeriodBottomSheetComponent=class _PeriodBottomSheetComponent{constructor(){this.data=inject(MAT_BOTTOM_SHEET_DATA),this.ref=inject(MatBottomSheetRef),this.ranges=TIME_RANGE_OPTIONS,this.maxDate=DateTime.now().endOf("day").toISO()}ngOnInit(){let timeRange=toTimeRange(this.data.periodSpec);this.form=new FormGroup({from:new FormControl(DateTime.fromMillis(timeRange.from).set({millisecond:0}).toISO({includeOffset:!1,suppressMilliseconds:!0}),{validators:[Validators.required,DateTimeValidators.maxDate(this.maxDate)],nonNullable:!0}),to:new FormControl(DateTime.fromMillis(timeRange.to).set({millisecond:0}).toISO({includeOffset:!1,suppressMilliseconds:!0}),{validators:[Validators.required,DateTimeValidators.maxDate(this.maxDate)],nonNullable:!0})},{validators:DateTimeValidators.fromToInverted()})}applyRange(range2){this.ref.dismiss(range2)}cancel(){this.ref.dismiss()}submit(){let periodSpec={from:DateTime.fromISO(this.form.controls.from.value).toMillis(),to:DateTime.fromISO(this.form.controls.to.value).toMillis()};this.ref.dismiss(periodSpec)}};_PeriodBottomSheetComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodBottomSheetComponent)},_PeriodBottomSheetComponent.\u0275cmp=\u0275\u0275defineComponent({type:_PeriodBottomSheetComponent,selectors:[["ix-period-bottom-sheet"]],decls:27,vars:10,consts:[["fxLayout","column"],[1,"ranges"],["autocomplete","off",3,"ngSubmit","formGroup"],["fxLayout","row","fxLayoutGap","8px"],["fxFlex","grow"],["translate",""],["type","datetime-local","matInput","","formControlName","from","step","1",3,"max"],["type","datetime-local","matInput","","formControlName","to","step","1",3,"min","max"],["fxLayout","row","fxLayoutAlign","end center",1,"actions"],["type","button","mat-button","",3,"click"],["type","submit","mat-button","","color","primary",3,"disabled"],[3,"click"]],template:function(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"mat-action-list"),\u0275\u0275repeaterCreate(3,PeriodBottomSheetComponent_For_4_Template,3,4,"mat-list-item",null,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()(),\u0275\u0275element(5,"mat-divider"),\u0275\u0275elementStart(6,"form",2),\u0275\u0275listener("ngSubmit",function(){return ctx.submit()}),\u0275\u0275elementStart(7,"fieldset",3)(8,"mat-form-field",4)(9,"mat-label",5),\u0275\u0275text(10,"FROM__DATE"),\u0275\u0275elementEnd(),\u0275\u0275element(11,"input",6),\u0275\u0275template(12,PeriodBottomSheetComponent_Conditional_12_Template,2,0,"mat-error",5)(13,PeriodBottomSheetComponent_Conditional_13_Template,2,0,"mat-error",5),\u0275\u0275elementEnd(),\u0275\u0275elementStart(14,"mat-form-field",4)(15,"mat-label",5),\u0275\u0275text(16,"TO__DATE"),\u0275\u0275elementEnd(),\u0275\u0275element(17,"input",7),\u0275\u0275template(18,PeriodBottomSheetComponent_Conditional_18_Template,2,0,"mat-error",5)(19,PeriodBottomSheetComponent_Conditional_19_Template,2,0,"mat-error",5),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(20,"div",8)(21,"button",9),\u0275\u0275listener("click",function(){return ctx.cancel()}),\u0275\u0275elementStart(22,"span",5),\u0275\u0275text(23,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(24,"button",10)(25,"span",5),\u0275\u0275text(26,"APPLY"),\u0275\u0275elementEnd()()()()()),rf&2){let tmp_2_0,tmp_6_0;\u0275\u0275advance(3),\u0275\u0275repeater(ctx.ranges),\u0275\u0275advance(3),\u0275\u0275property("formGroup",ctx.form),\u0275\u0275advance(5),\u0275\u0275property("max",(tmp_2_0=ctx.form.get("to"))==null?null:tmp_2_0.value)("max",ctx.maxDate),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("inverted")?12:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("maxDate")?13:-1),\u0275\u0275advance(4),\u0275\u0275property("min",(tmp_6_0=ctx.form.get("from"))==null?null:tmp_6_0.value)("max",ctx.maxDate),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("inverted")?18:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("maxDate")?19:-1),\u0275\u0275advance(5),\u0275\u0275property("disabled",ctx.form.invalid)}},dependencies:[FlexModule,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatButtonModule,MatButton,MatDividerModule,MatDivider,MatFormFieldModule,MatFormField,MatLabel,MatError,MatInputModule,MatInput,MatListModule,MatActionList,MatListItem,ReactiveFormsModule,\u0275NgNoValidate,DefaultValueAccessor,NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,TranslateModule,TranslatePipe,TranslateDirective],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%]{max-height:50vh;overflow-y:auto}[_nghost-%COMP%] form[_ngcontent-%COMP%]{display:block;padding-top:16px}[_nghost-%COMP%] form[_ngcontent-%COMP%] fieldset[_ngcontent-%COMP%]{margin:0;padding:0;border:none}[_nghost-%COMP%] form[_ngcontent-%COMP%] fieldset[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{max-width:calc(50vw - 24px)!important}[_nghost-%COMP%] form[_ngcontent-%COMP%] fieldset[_ngcontent-%COMP%] input[type=datetime-local][_ngcontent-%COMP%]::-webkit-inner-spin-button, [_nghost-%COMP%] form[_ngcontent-%COMP%] fieldset[_ngcontent-%COMP%] input[type=datetime-local][_ngcontent-%COMP%]::-webkit-calendar-picker-indicator{appearance:none;display:none}[_nghost-%COMP%] .actions[_ngcontent-%COMP%]{padding-bottom:8px}[_nghost-%COMP%] .actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:8px}"]});let PeriodBottomSheetComponent2=_PeriodBottomSheetComponent;return PeriodBottomSheetComponent2})();var PERIOD_PANEL_DATA=new InjectionToken("device-board-header-period-panel-data");var import_dayjs4=__toESM(require_dayjs_min()),import_utc=__toESM(require_utc()),import_timezone=__toESM(require_timezone());var PeriodPanelRef=class{constructor(overlayRef){this.overlayRef=overlayRef,this._afterClosed=new Subject}afterClosed(){return this._afterClosed.asObservable()}close(data){this.overlayRef.dispose(),data&&(this._afterClosed.next(data),this._afterClosed.complete())}};var _c024=a0=>({active:a0});function PeriodPanelComponent_Conditional_21_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"button",6)(1,"div",4)(2,"mat-icon"),\u0275\u0275text(3,"public"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"span"),\u0275\u0275text(5),\u0275\u0275pipe(6,"translate"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"span"),\u0275\u0275text(8,":\xA0"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"span"),\u0275\u0275text(10),\u0275\u0275elementEnd(),\u0275\u0275elementStart(11,"mat-icon"),\u0275\u0275text(12,"arrow_drop_down"),\u0275\u0275elementEnd()()()),rf&2){let ctx_r1=\u0275\u0275nextContext(),timeZoneMenu_r3=\u0275\u0275reference(4);\u0275\u0275property("matMenuTriggerFor",timeZoneMenu_r3),\u0275\u0275advance(5),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(6,3,ctx_r1.timeZoneSpec==="device"?"DEVICE_TIME_ZONE":"MY_TIME_ZONE")),\u0275\u0275advance(5),\u0275\u0275textInterpolate(ctx_r1.timeZoneSpec==="device"?ctx_r1.deviceTimeZone:ctx_r1.myTimeZone)}}function PeriodPanelComponent_Conditional_32_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"FROM_MUST_BE_BEFORE_TO"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_33_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.MAX_DATE"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_34_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_DATE_AND_TIME"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_35_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_DATE_AND_TIME"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_41_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"TO_MUST_BE_AFTER_FROM"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_42_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.MAX_DATE"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_43_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_DATE_AND_TIME"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_44_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_DATE_AND_TIME"),\u0275\u0275elementEnd())}function PeriodPanelComponent_For_55_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-list-item",20),\u0275\u0275listener("click",function(){let range_r5=\u0275\u0275restoreView(_r4).$implicit,ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.applyRange(range_r5.code))}),\u0275\u0275text(1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementEnd()}if(rf&2){let range_r5=ctx.$implicit;\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind2(2,1,range_r5.translateKey,range_r5.translateParams)," ")}}import_dayjs4.default.extend(import_utc.default);import_dayjs4.default.extend(import_timezone.default);var PeriodPanelComponent=(()=>{let _PeriodPanelComponent=class _PeriodPanelComponent{constructor(data,formBuilder,localizationService,ref){this.data=data,this.formBuilder=formBuilder,this.localizationService=localizationService,this.ref=ref,this.browserTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.locale={format:"YYYY-MM-DDTHH:mm:ss.SSSZ",displayFormat:"MM/DD/YYYY",direction:"ltr",weekLabel:"W",daysOfWeek:[Info.weekdays("short")[6],...Info.weekdays("short").slice(0,-1)],monthNames:Info.months("short"),firstDay:1},this.maxISO=DateTime.now().endOf("day").toISO(),this.ranges=TIME_RANGE_OPTIONS,this.myTimeZone=this.localizationService.getTimeZone()}ngOnInit(){this.deviceTimeZone=this.data.deviceTimeZone||null,this.timeZone=Settings.defaultZone.name,this.timeZoneSpec=this.data.timeZoneSpec||"user",this.processRange()}applyRange(range2){this.ref.close(range2)}cancel(){this.ref.close()}choosedDate(selection){this.form.setValue({from:DateTime.fromISO(selection.startDate.toISOString(),{zone:this.browserTimeZone}).setZone(this.timeZone,{keepLocalTime:!0}).toFormat("F"),to:DateTime.fromISO(selection.endDate.toISOString(),{zone:this.browserTimeZone}).setZone(this.timeZone,{keepLocalTime:!0}).toFormat("F")})}submit(){let periodSpec={from:DateTime.fromFormat(this.form.value.from,"F").toMillis(),to:DateTime.fromFormat(this.form.value.to,"F").toMillis()};this.ref.close(periodSpec)}setTimeZoneSpec(timeZoneSpec){this.timeZoneSpec=timeZoneSpec,this.timeZone=timeZoneSpec==="device"&&this.deviceTimeZone?this.deviceTimeZone:this.myTimeZone,this.processRange(),this.data.timeZoneSpecSelected?.emit({name:this.timeZone,spec:timeZoneSpec})}processRange(){let timeRange=toTimeRange(this.data.periodSpec||"yesterday");if(this.selected={startDate:(0,import_dayjs4.default)(DateTime.fromMillis(timeRange.from,{zone:this.timeZone}).setZone(this.browserTimeZone,{keepLocalTime:!0}).toMillis()),endDate:(0,import_dayjs4.default)(DateTime.fromMillis(timeRange.to,{zone:this.timeZone}).setZone(this.browserTimeZone,{keepLocalTime:!0}).toMillis())},this.form)this.form.setValue({from:DateTime.fromMillis(timeRange.from).toFormat("F"),to:DateTime.fromMillis(timeRange.to).toFormat("F")});else{let formatter=value=>DateTime.fromFormat(value,"F");this.form=this.formBuilder.group({from:[DateTime.fromMillis(timeRange.from).toFormat("F"),[Validators.required,DateTimeValidators.format(formatter),DateTimeValidators.maxDate(this.maxISO,formatter)]],to:[DateTime.fromMillis(timeRange.to).toFormat("F"),[Validators.required,DateTimeValidators.format(formatter),DateTimeValidators.maxDate(this.maxISO,formatter)]]},{validators:DateTimeValidators.fromToInverted(formatter)})}}onEscapeHandler(event2){event2.stopPropagation(),event2.preventDefault(),this.ref.close()}};_PeriodPanelComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodPanelComponent)(\u0275\u0275directiveInject(PERIOD_PANEL_DATA),\u0275\u0275directiveInject(FormBuilder),\u0275\u0275directiveInject(LocalizationService),\u0275\u0275directiveInject(PeriodPanelRef))},_PeriodPanelComponent.\u0275cmp=\u0275\u0275defineComponent({type:_PeriodPanelComponent,selectors:[["ix-period-panel"]],hostBindings:function(rf,ctx){rf&1&&\u0275\u0275listener("keydown.escape",function($event){return ctx.onEscapeHandler($event)},!1,\u0275\u0275resolveDocument)},decls:56,vars:31,consts:[["timeZoneMenu","matMenu"],["fxFlex","","translate",""],[1,"dense"],["mat-menu-item","",3,"click","ngClass"],["fxLayout","row","fxLayoutAlign","start center"],["translate",""],["mat-button","",1,"time-zone-select",3,"matMenuTriggerFor"],["fxLayout","row"],["fxFlex","",1,"picker"],[3,"choosedDate","autoApply","linkedCalendars","maxDate","locale","startDate","endDate"],["autocomplete","off",3,"ngSubmit","formGroup"],["fxlayout","row","fxLayoutGap","16px"],["fxFlex","grow"],["matInput","","formControlName","from",3,"placeholder"],["matInput","","formControlName","to",3,"placeholder"],["fxLayout","row","fxLayoutAlign","end center",1,"actions"],["type","button","mat-stroked-button","","color","primary",3,"click"],["type","submit","mat-flat-button","","color","primary",3,"disabled"],[1,"ranges"],["dense",""],[3,"click"]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-toolbar")(1,"span",1),\u0275\u0275text(2,"TIME_RANGE_SELECTION"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"mat-menu",2,0)(5,"button",3),\u0275\u0275listener("click",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.setTimeZoneSpec("user"))}),\u0275\u0275elementStart(6,"div",4)(7,"span",5),\u0275\u0275text(8,"MY_TIME_ZONE"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"span"),\u0275\u0275text(10,":\xA0"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(11,"span"),\u0275\u0275text(12),\u0275\u0275elementEnd()()(),\u0275\u0275elementStart(13,"button",3),\u0275\u0275listener("click",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.setTimeZoneSpec("device"))}),\u0275\u0275elementStart(14,"div",4)(15,"span",5),\u0275\u0275text(16,"DEVICE_TIME_ZONE"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(17,"span"),\u0275\u0275text(18,":\xA0"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(19,"span"),\u0275\u0275text(20),\u0275\u0275elementEnd()()()(),\u0275\u0275template(21,PeriodPanelComponent_Conditional_21_Template,13,5,"button",6),\u0275\u0275elementEnd(),\u0275\u0275elementStart(22,"div",7)(23,"div",8)(24,"ngx-daterangepicker-material",9),\u0275\u0275listener("choosedDate",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.choosedDate($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(25,"form",10),\u0275\u0275listener("ngSubmit",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.submit())}),\u0275\u0275elementStart(26,"fieldset",11)(27,"mat-form-field",12)(28,"mat-label",5),\u0275\u0275text(29,"FROM__DATE"),\u0275\u0275elementEnd(),\u0275\u0275element(30,"input",13),\u0275\u0275pipe(31,"translate"),\u0275\u0275template(32,PeriodPanelComponent_Conditional_32_Template,2,0,"mat-error",5)(33,PeriodPanelComponent_Conditional_33_Template,2,0,"mat-error",5)(34,PeriodPanelComponent_Conditional_34_Template,2,0,"mat-error",5)(35,PeriodPanelComponent_Conditional_35_Template,2,0,"mat-error",5),\u0275\u0275elementEnd(),\u0275\u0275elementStart(36,"mat-form-field",12)(37,"mat-label",5),\u0275\u0275text(38,"TO__DATE"),\u0275\u0275elementEnd(),\u0275\u0275element(39,"input",14),\u0275\u0275pipe(40,"translate"),\u0275\u0275template(41,PeriodPanelComponent_Conditional_41_Template,2,0,"mat-error",5)(42,PeriodPanelComponent_Conditional_42_Template,2,0,"mat-error",5)(43,PeriodPanelComponent_Conditional_43_Template,2,0,"mat-error",5)(44,PeriodPanelComponent_Conditional_44_Template,2,0,"mat-error",5),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(45,"div",15)(46,"button",16),\u0275\u0275listener("click",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.cancel())}),\u0275\u0275elementStart(47,"span",5),\u0275\u0275text(48,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(49,"button",17)(50,"span",5),\u0275\u0275text(51,"APPLY"),\u0275\u0275elementEnd()()()()(),\u0275\u0275elementStart(52,"div",18)(53,"mat-action-list",19),\u0275\u0275repeaterCreate(54,PeriodPanelComponent_For_55_Template,3,4,"mat-list-item",null,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()()()}rf&2&&(\u0275\u0275advance(5),\u0275\u0275property("ngClass",\u0275\u0275pureFunction1(27,_c024,ctx.timeZoneSpec==="user")),\u0275\u0275advance(7),\u0275\u0275textInterpolate(ctx.myTimeZone),\u0275\u0275advance(),\u0275\u0275property("ngClass",\u0275\u0275pureFunction1(29,_c024,ctx.timeZoneSpec==="device")),\u0275\u0275advance(7),\u0275\u0275textInterpolate(ctx.deviceTimeZone),\u0275\u0275advance(),\u0275\u0275conditional(ctx.deviceTimeZone&&ctx.deviceTimeZone!==ctx.myTimeZone?21:-1),\u0275\u0275advance(3),\u0275\u0275property("autoApply",!0)("linkedCalendars",!0)("maxDate",ctx.maxISO)("locale",ctx.locale)("startDate",ctx.selected.startDate)("endDate",ctx.selected.endDate||null),\u0275\u0275advance(),\u0275\u0275property("formGroup",ctx.form),\u0275\u0275advance(5),\u0275\u0275propertyInterpolate("placeholder",\u0275\u0275pipeBind1(31,23,"FROM__DATE")),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.form.controls.from.hasError("inverted")?32:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("maxDate")?33:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("unitOutOfRange")?34:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("unparsable")?35:-1),\u0275\u0275advance(4),\u0275\u0275propertyInterpolate("placeholder",\u0275\u0275pipeBind1(40,25,"TO__DATE")),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.form.controls.to.hasError("inverted")?41:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("maxDate")?42:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("unitOutOfRange")?43:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("unparsable")?44:-1),\u0275\u0275advance(5),\u0275\u0275property("disabled",ctx.form.invalid),\u0275\u0275advance(5),\u0275\u0275repeater(ctx.ranges))},dependencies:[FlexModule,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatButtonModule,MatButton,MatFormFieldModule,MatFormField,MatLabel,MatError,MatIconModule,MatIcon,MatInputModule,MatInput,MatListModule,MatActionList,MatListItem,MatMenuModule,MatMenu,MatMenuItem,MatMenuTrigger,MatToolbarModule,MatToolbar,NgClass,NgxDaterangepickerMd,DaterangepickerComponent,ReactiveFormsModule,\u0275NgNoValidate,DefaultValueAccessor,NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,TranslateModule,TranslatePipe,TranslateDirective],styles:['@keyframes _ngcontent-%COMP%_zoom-in{0%{transform:scale(.75);opacity:.9}to{transform:scale(1);opacity:1}}[_nghost-%COMP%]{min-width:754px;max-height:514px;background-color:var(--mat-sys-surface-container);animation:_ngcontent-%COMP%_zoom-in .14s cubic-bezier(0,0,.2,1) both;border-radius:4px;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transform-origin:top right}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-outline-variant)}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{--mat-toolbar-container-background-color: var(--mat-sys-surface-container)}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{--mat-toolbar-title-text-size: 14px}[_nghost-%COMP%] .time-zone-select[_ngcontent-%COMP%]{padding:0 4px 0 8px;font-size:12px;color:color-mix(in srgb,transparent,var(--mat-sys-on-surface) 67%)}[_nghost-%COMP%] .time-zone-select[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]:first-child{height:20px;width:20px;margin-right:4px;font-size:20px}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker{margin-top:0;background-color:var(--mat-sys-surface-container);box-shadow:none;border-radius:0}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker .calendar-table{background-color:var(--mat-sys-surface-container);border-color:var(--mat-sys-surface-container)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available:hover, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available:hover{background-color:var(--mat-sys-surface-container-highest)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td{transition-property:none;opacity:1}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off{color:color-mix(in srgb,transparent,currentcolor 16%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off.active:hover{background-color:#eee;border-radius:50%}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off.in-range, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off.start-date, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off.end-date{background-color:var(--mat-sys-surface-container)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker tbody tr td{height:32px}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.month{font-weight:500;color:color-mix(in srgb,transparent,currentcolor 77%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.next, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.prev{min-width:28px}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.prev, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.prev, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.next, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.next{background-image:none}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.prev:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.prev:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.next:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.next:after{content:"";display:block;height:2em;width:2em;background-color:var(--mat-sys-on-surface);background-image:none;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:.5em;mask-size:.5em;-webkit-mask-position:center;mask-position:center}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.prev:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.prev:after{-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K);mask-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.next:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.next:after{-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K);mask-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker tr.week-days th{font-size:11px;font-weight:400;color:color-mix(in srgb,transparent,currentcolor 38%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.in-range{background-color:color-mix(in srgb,transparent,var(--mat-sys-primary) 12%);color:color-mix(in srgb,transparent,currentcolor 87%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.today:not(.active,.in-range,.off){border:1px solid color-mix(in srgb,transparent,currentcolor 38%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off), [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off):hover{background-color:var(--mat-sys-primary);color:var(--mat-sys-on-primary);border-radius:50%;opacity:1;transition-property:border-radius}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off).start-date:not(.end-date), [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off):hover.start-date:not(.end-date){border-top-right-radius:0;border-bottom-right-radius:0}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off).end-date:not(.start-date), [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off):hover.end-date:not(.start-date){border-top-left-radius:0;border-bottom-left-radius:0}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%]{border-left:1px solid var(--mat-sys-outline-variant);height:449px;width:200px;overflow-y:auto}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%]{padding:4px 0}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]{padding-top:6px;padding-bottom:6px}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]{--mdc-list-list-item-one-line-container-height: auto}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]{--mdc-list-list-item-label-text-line-height: 14px}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]{--mdc-list-list-item-label-text-size: 12px}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%] .mdc-list-item__primary-text{white-space:normal}[_nghost-%COMP%] fieldset[_ngcontent-%COMP%]{margin:0;padding:0 16px;border:none}[_nghost-%COMP%] .actions[_ngcontent-%COMP%]{padding:12px 16px}[_nghost-%COMP%] .actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:8px}']});let PeriodPanelComponent2=_PeriodPanelComponent;return PeriodPanelComponent2})();var DEFAULT_CONNECTED_POSITIONS=[{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top",offsetX:0,offsetY:0}],PeriodPanelService=(()=>{let _PeriodPanelService=class _PeriodPanelService{constructor(injector,overlay){this.injector=injector,this.overlay=overlay}show(origin,data,positions){let overlayRef=this.createOverlay(origin,positions),instance=new PeriodPanelRef(overlayRef);return this.attachSnackBarContainer(overlayRef,instance,data,this.getTransformOrigin(positions)),instance}getTransformOrigin(positions){if(!positions)return;let positionOriginX=positions[0].originX,originX=positionOriginX==="start"?"left":positionOriginX==="end"?"right":"center",originY=positions[0].originY;return`${originX} ${originY}`}createOverlay(origin,positions){let overlayRef=this.overlay.create(this.getOverlayConfig(origin,positions));return overlayRef.backdropClick().subscribe(()=>overlayRef.dispose()),overlayRef}createInjector(snackBarRef,data){let injectionTokens=new WeakMap;return injectionTokens.set(PeriodPanelRef,snackBarRef),injectionTokens.set(PERIOD_PANEL_DATA,data),new PortalInjector(this.injector,injectionTokens)}attachSnackBarContainer(overlayRef,snackBarRef,data,transformOrigin){let injector=this.createInjector(snackBarRef,data),containerPortal=new ComponentPortal(PeriodPanelComponent,null,injector),containerRef=overlayRef.attach(containerPortal);if(transformOrigin){let panelElement=overlayRef.overlayElement.firstElementChild;panelElement.style.transformOrigin=transformOrigin}return containerRef.instance}getOverlayConfig(origin,positions){let positionStrategy=this.overlay.position().flexibleConnectedTo(origin).withPositions(positions||DEFAULT_CONNECTED_POSITIONS);return new OverlayConfig({hasBackdrop:!0,backdropClass:"overlay-transparent-backdrop",panelClass:"ix-period-panel-container",scrollStrategy:this.overlay.scrollStrategies.noop(),positionStrategy})}};_PeriodPanelService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodPanelService)(\u0275\u0275inject(Injector),\u0275\u0275inject(Overlay))},_PeriodPanelService.\u0275prov=\u0275\u0275defineInjectable({token:_PeriodPanelService,factory:_PeriodPanelService.\u0275fac,providedIn:"root"});let PeriodPanelService2=_PeriodPanelService;return PeriodPanelService2})();function PeriodControlsComponent_Conditional_0_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",2),\u0275\u0275pipe(1,"translate"),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.handleZoomOutButtonClick())}),\u0275\u0275elementStart(2,"mat-icon"),\u0275\u0275text(3,"zoom_out"),\u0275\u0275elementEnd()()}rf&2&&\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(1,1,"ZOOM_OUT"))}var PeriodControlsComponent=(()=>{let _PeriodControlsComponent=class _PeriodControlsComponent{get gtSm(){return this.bpObserver.isMatched("(min-width: 960px)")}constructor(bpObserver,bottomSheet,periodPanel,translate){this.bpObserver=bpObserver,this.bottomSheet=bottomSheet,this.periodPanel=periodPanel,this.translate=translate,this.periodSpecSelected=new EventEmitter,this.timeZoneSpecSelected=new EventEmitter}ngOnChanges(changes){changes.periodSpecs&&(this.periodButtonLabel=this.getPeriodButtonLabel(),this.zoomOutIsVisible=this.getZoomOutIsVisible())}handleZoomOutButtonClick(){this.zoomOut()}handlePeriodButtonClick(event2){return this.gtSm?this.openPeriodPanel(event2):this.openPeriodBottomSheet()}openPeriodBottomSheet(){this.periodSpecs&&this.bottomSheet.open(PeriodBottomSheetComponent,{data:{periodSpec:this.periodSpecs.active}}).afterDismissed().subscribe(periodSpec=>{periodSpec&&(this.periodSpecs=__spreadProps(__spreadValues({},this.periodSpecs),{selected:periodSpec}),this.periodSpecSelected.emit(periodSpec))})}openPeriodPanel(event2){this.periodSpecs&&this.periodPanel.show(event2.currentTarget,{periodSpec:this.periodSpecs.active||null,deviceTimeZone:this.deviceTimeZone,timeZoneSpec:this.timeZoneSpec,timeZoneSpecSelected:this.timeZoneSpecSelected}).afterClosed().subscribe(periodSpec=>{periodSpec&&(this.periodSpecs=__spreadProps(__spreadValues({},this.periodSpecs),{selected:periodSpec}),this.periodSpecSelected.emit(periodSpec))})}getPeriodButtonLabel(){return this.periodSpecs?.active?typeof this.periodSpecs.active=="string"?this.translate.instant(getTranslateKeyForPeriod(this.periodSpecs.active),getTranslateParamsForPeriod(this.periodSpecs.active)):toStringTimeRange(this.periodSpecs.active):""}getZoomOutIsVisible(){return this.periodSpecs?!isEqual_default(this.periodSpecs.active,this.periodSpecs.selected):!1}zoomOut(){this.periodSpecSelected.emit(this.periodSpecs.selected)}enterKeyDownHandler(event2){event2.target.blur()}};_PeriodControlsComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodControlsComponent)(\u0275\u0275directiveInject(BreakpointObserver),\u0275\u0275directiveInject(MatBottomSheet),\u0275\u0275directiveInject(PeriodPanelService),\u0275\u0275directiveInject(TranslateService))},_PeriodControlsComponent.\u0275cmp=\u0275\u0275defineComponent({type:_PeriodControlsComponent,selectors:[["ix-period-controls"]],inputs:{deviceTimeZone:"deviceTimeZone",periodSpecs:"periodSpecs",timeZoneSpec:"timeZoneSpec",mobile:"mobile"},outputs:{periodSpecSelected:"periodSpecSelected",timeZoneSpecSelected:"timeZoneSpecSelected"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:3,vars:2,consts:[["mat-stroked-button","",1,"zoom-out-button",3,"matTooltip"],["mat-stroked-button","",3,"keydown.enter","click"],["mat-stroked-button","",1,"zoom-out-button",3,"click","matTooltip"]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,PeriodControlsComponent_Conditional_0_Template,4,3,"button",0),\u0275\u0275elementStart(1,"button",1),\u0275\u0275listener("keydown.enter",function($event){return ctx.enterKeyDownHandler($event)})("click",function($event){return ctx.handlePeriodButtonClick($event)}),\u0275\u0275text(2),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275conditional(ctx.zoomOutIsVisible?0:-1),\u0275\u0275advance(2),\u0275\u0275textInterpolate1(" ",ctx.periodButtonLabel,`
835
+ `,""].includes(deltaOperations[0].insert?.toString());return this.minLength()&&textLength&&textLength<this.minLength()&&(err.minLengthError={given:textLength,minLength:this.minLength()},valid=!1),this.maxLength()&&textLength>this.maxLength()&&(err.maxLengthError={given:textLength,maxLength:this.maxLength()},valid=!1),this.required()&&!textLength&&onlyEmptyOperation&&(err.requiredError={empty:!0},valid=!1),valid?null:err}addQuillEventListeners(){this.dispose(),this.zone.runOutsideAngular(()=>{this.subscription=new Subscription,this.subscription.add(fromEvent(this.quillEditor,"selection-change").subscribe(([range2,oldRange,source])=>{this.selectionChangeHandler(range2,oldRange,source)}));let textChange$=fromEvent(this.quillEditor,"text-change"),editorChange$=fromEvent(this.quillEditor,"editor-change");typeof this.debounceTime()=="number"&&(textChange$=textChange$.pipe(debounceTime(this.debounceTime())),editorChange$=editorChange$.pipe(debounceTime(this.debounceTime()))),this.subscription.add(textChange$.subscribe(([delta,oldDelta,source])=>{this.textChangeHandler(delta,oldDelta,source)})),this.subscription.add(editorChange$.subscribe(([event2,current,old,source])=>{this.editorChangeHandler(event2,current,old,source)}))})}dispose(){this.subscription!==null&&(this.subscription.unsubscribe(),this.subscription=null)}isEmptyValue(html){return html==="<p></p>"||html==="<div></div>"||html==="<p><br></p>"||html==="<div><br></div>"}};_QuillEditorBase.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_QuillEditorBase)},_QuillEditorBase.\u0275dir=\u0275\u0275defineDirective({type:_QuillEditorBase,inputs:{format:[1,"format"],theme:[1,"theme"],modules:[1,"modules"],debug:[1,"debug"],readOnly:[1,"readOnly"],placeholder:[1,"placeholder"],maxLength:[1,"maxLength"],minLength:[1,"minLength"],required:[1,"required"],formats:[1,"formats"],customToolbarPosition:[1,"customToolbarPosition"],sanitize:[1,"sanitize"],beforeRender:[1,"beforeRender"],styles:[1,"styles"],registry:[1,"registry"],bounds:[1,"bounds"],customOptions:[1,"customOptions"],customModules:[1,"customModules"],trackChanges:[1,"trackChanges"],classes:[1,"classes"],trimOnValidation:[1,"trimOnValidation"],linkPlaceholder:[1,"linkPlaceholder"],compareValues:[1,"compareValues"],filterNull:[1,"filterNull"],debounceTime:[1,"debounceTime"],defaultEmptyValue:[1,"defaultEmptyValue"],valueGetter:[1,"valueGetter"],valueSetter:[1,"valueSetter"]},outputs:{onEditorCreated:"onEditorCreated",onEditorChanged:"onEditorChanged",onContentChanged:"onContentChanged",onSelectionChanged:"onSelectionChanged",onFocus:"onFocus",onBlur:"onBlur",onNativeFocus:"onNativeFocus",onNativeBlur:"onNativeBlur"},features:[\u0275\u0275NgOnChangesFeature]});let QuillEditorBase2=_QuillEditorBase;return QuillEditorBase2})(),QuillEditorComponent=(()=>{let _QuillEditorComponent=class _QuillEditorComponent extends QuillEditorBase{};_QuillEditorComponent.\u0275fac=(()=>{let \u0275QuillEditorComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275QuillEditorComponent_BaseFactory||(\u0275QuillEditorComponent_BaseFactory=\u0275\u0275getInheritedFactory(_QuillEditorComponent)))(__ngFactoryType__||_QuillEditorComponent)}})(),_QuillEditorComponent.\u0275cmp=\u0275\u0275defineComponent({type:_QuillEditorComponent,selectors:[["quill-editor"]],features:[\u0275\u0275ProvidersFeature([{multi:!0,provide:NG_VALUE_ACCESSOR,useExisting:forwardRef(()=>_QuillEditorComponent)},{multi:!0,provide:NG_VALIDATORS,useExisting:forwardRef(()=>_QuillEditorComponent)}]),\u0275\u0275InheritDefinitionFeature],ngContentSelectors:_c19,decls:5,vars:2,consts:[["quill-editor-element",""]],template:function(rf,ctx){rf&1&&(\u0275\u0275projectionDef(_c022),\u0275\u0275template(0,QuillEditorComponent_Conditional_0_Template,1,0,"div",0),\u0275\u0275projection(1),\u0275\u0275projection(2,1),\u0275\u0275projection(3,2),\u0275\u0275template(4,QuillEditorComponent_Conditional_4_Template,1,0,"div",0)),rf&2&&(\u0275\u0275conditional(ctx.toolbarPosition()!=="top"?0:-1),\u0275\u0275advance(4),\u0275\u0275conditional(ctx.toolbarPosition()==="top"?4:-1))},styles:["[_nghost-%COMP%]{display:inline-block}"]});let QuillEditorComponent2=_QuillEditorComponent;return QuillEditorComponent2})();var import_markdown_it2=__toESM(require_markdown_it());function renderMarkdownToHtml(markdown){let markdownIt=new import_markdown_it2.default({typographer:!0}),defaultRender=markdownIt.renderer.rules.link_open||function(tokens,idx,options,env,self2){return self2.renderToken(tokens,idx,options)};return markdownIt.renderer.rules.link_open=function(tokens,idx,options,env,self2){return tokens[idx].attrPush(["target","_blank"]),defaultRender(tokens,idx,options,env,self2)},markdownIt.render(markdown)}var indentRegex=/^ql-indent-([0-9]+)/;function addStylingToQuillContent(content){let htmlObject=document.createElement("div");return htmlObject.innerHTML=content,addStylingToHtmlChildNodes(htmlObject.childNodes),htmlObject.innerHTML}function addStylingToHtmlChildNodes(children){children.forEach(child=>{let element=child;setCodeBlockStyling(element),setIndentStyling(element),setListStyling(element),setQuotesStyling(element),child.childNodes.length&&addStylingToHtmlChildNodes(child.childNodes)})}function setCodeBlockStyling(element){element.tagName==="PRE"&&(element.hasAttribute("data-language")||element.classList?.contains("ql-syntax"))&&(element.style.backgroundColor="#f6f8fa",element.style.color="initial",element.style.overflow="visible",element.style.padding="5px 10px")}function setIndentStyling(element){element.classList?.forEach(className=>{let matches=className.match(indentRegex);if(matches?.[1]){let identNumber=parseInt(matches?.[1]);element.style.paddingLeft=3*identNumber+"em"}})}function setListStyling(element){element.tagName==="OL"&&(element.style.paddingLeft="1.5em"),element.tagName==="LI"&&(element.style.listStylePosition="inside")}function setQuotesStyling(element){element.tagName==="BLOCKQUOTE"&&(element.style.borderLeft="4px solid #ccc",element.style.margin="5px 0",element.style.paddingLeft="16px")}function registerQuillModules(){registerAlignStyle(),registerBlock()}function registerAlignStyle(){let alignStyle=quill_default.import("attributors/style/align");quill_default.register(alignStyle,!0)}function registerBlock(){let block=quill_default.import("blots/block");block.tagName="DIV",quill_default.register(block)}var _c023=()=>({height:"400px"});function RichTextFormFieldComponent_Conditional_0_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"form",0)(1,"quill-editor",2),\u0275\u0275listener("onEditorCreated",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.onEditorCreated($event))})("keydown.backspace",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())})("keydown.delete",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(2,"div",3)(3,"span",4)(4,"select",5),\u0275\u0275element(5,"option",6)(6,"option",7)(7,"option",8)(8,"option",9)(9,"option",10)(10,"option",11),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(11,"span",4),\u0275\u0275element(12,"button",12)(13,"button",13)(14,"button",14)(15,"button",15),\u0275\u0275elementEnd(),\u0275\u0275elementStart(16,"span",4),\u0275\u0275element(17,"button",16)(18,"button",17),\u0275\u0275elementEnd(),\u0275\u0275elementStart(19,"span",4)(20,"select",18),\u0275\u0275element(21,"option",6)(22,"option",19)(23,"option",20)(24,"option",21),\u0275\u0275elementEnd(),\u0275\u0275element(25,"button",22)(26,"button",23),\u0275\u0275elementEnd(),\u0275\u0275elementStart(27,"span",4),\u0275\u0275element(28,"button",24)(29,"button",25),\u0275\u0275elementEnd(),\u0275\u0275elementStart(30,"span",4),\u0275\u0275element(31,"button",26)(32,"button",27)(33,"button",28),\u0275\u0275elementEnd()()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("formGroup",ctx_r1.form),\u0275\u0275advance(),\u0275\u0275property("styles",\u0275\u0275pureFunction0(16,_c023))("placeholder",ctx_r1.field.inputDescription.placeholder||""),\u0275\u0275advance(11),\u0275\u0275property("matTooltip","Bold"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Italic"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Underline"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Strike-through"),\u0275\u0275advance(2),\u0275\u0275property("matTooltip","Text color"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Highlight color"),\u0275\u0275advance(7),\u0275\u0275property("matTooltip","Decrease indent"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Increase indent"),\u0275\u0275advance(2),\u0275\u0275property("matTooltip","Bulleted list"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Numbered list"),\u0275\u0275advance(2),\u0275\u0275property("matTooltip","Blockquote"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Code Block"),\u0275\u0275advance(),\u0275\u0275property("matTooltip","Insert link")}}function RichTextFormFieldComponent_Conditional_1_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",1)(1,"textarea",29),\u0275\u0275listener("keydown.enter",function($event){return \u0275\u0275restoreView(_r3),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(2,"a",30),\u0275\u0275pipe(3,"translate"),\u0275\u0275elementStart(4,"mat-icon"),\u0275\u0275text(5,"markdown"),\u0275\u0275elementEnd()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("formControl",ctx_r1.form.controls.editor)("placeholder",ctx_r1.field.inputDescription.placeholder||""),\u0275\u0275advance(),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(3,4,"MARKDOWN_IS_SUPPORTED"))("matTooltipPosition","left")}}var RichTextFormFieldComponent=(()=>{let _RichTextFormFieldComponent=class _RichTextFormFieldComponent{constructor(){this.mode="rich-text",this.modeChange=new EventEmitter,this.valueChange=new EventEmitter,this.destroy=inject(DestroyRef),this.dialog=inject(MatDialog),this.formBuilder=inject(FormBuilder),this.colorPickerPanelService=inject(ColorPickerPanelService),this.ngZone=inject(NgZone),this.translate=inject(TranslateService),this.activeMode="rich-text",this.modules={toolbar:{container:"#toolbar"}},this.form=this.formBuilder.nonNullable.group({editor:[""]})}blockPaste(e){e.stopPropagation()}blockCopy(e){e.stopPropagation()}blockCut(e){e.stopPropagation()}ngOnInit(){registerQuillModules(),typeof this.field.value=="string"&&this.form.setValue({editor:this.field.value}),this.form.controls.editor.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>this.valueChange.emit(this.mode==="rich-text"?addStylingToQuillContent(value):value))}ngOnChanges(changes){changes.mode.firstChange&&(this.activeMode=this.mode),changes.mode.previousValue==="plain-text"&&changes.mode.currentValue==="rich-text"&&this.switchFromPlainTextToRichText(),changes.mode.previousValue==="rich-text"&&changes.mode.currentValue==="plain-text"&&this.mode!==this.activeMode&&(this.previousFormValue=this.form.value,this.activeMode=this.mode)}onEditorCreated(editor){this.quill=editor;let toolbar=editor.getModule("toolbar"),backgroundButton=toolbar.container?.querySelector(".ql-background"),colorButton=toolbar.container?.querySelector(".ql-color");backgroundButton&&toolbar.addHandler("background",()=>this.openColorPicker(backgroundButton,"background")),colorButton&&toolbar.addHandler("color",()=>this.openColorPicker(colorButton,"color","#000000")),editor.on("selection-change",range2=>{range2&&(this.setColorButtonColor(range2),this.setBackgroundButtonColor(range2))})}openColorPicker(element,format2,defaultColor="#FFFFFF"){this.ngZone.run(()=>{let range2=this.quill.getSelection();if(range2){let currentColor=(this.quill.getFormat(range2)[format2]??defaultColor).toUpperCase(),colorPickerColor=currentColor==="TRANSPARENT"?defaultColor:currentColor;this.colorPickerPanelService.show(element,{color:colorPickerColor}).afterClosed().subscribe(color=>{color===defaultColor?this.quill.format(format2,!1,quill_default.sources.USER):this.quill.format(format2,color,quill_default.sources.USER)})}})}setColorButtonColor(range2){let color=this.quill.getFormat(range2)?.color?.toUpperCase(),colorLabel=this.quill.getModule("toolbar").container?.querySelector(".ql-color .ql-stroke");colorLabel&&(color&&color!=="TRANSPARENT"?colorLabel.style.stroke=color==="#FFFFFF"?"#E1E1E1":color:colorLabel.style.stroke="#000000")}setBackgroundButtonColor(range2){let color=this.quill.getFormat(range2)?.background?.toUpperCase(),colorLabel=this.quill.getModule("toolbar").container?.querySelector(".ql-background .ql-fill");colorLabel&&(color&&color!=="TRANSPARENT"?colorLabel.style.fill=color:colorLabel.style.fill="#E1E1E1")}switchFromPlainTextToRichText(){let formValue=this.form.value;formValue.editor!==""&&formValue.editor!==this.previousFormValue?.editor?this.dialog.open(ConfirmDialogComponent,{data:{title:this.translate.instant("WARNING"),message:this.translate.instant("__TEXT__.MARKDOWN_FORMATTING_TO_RICH_TEXT")}}).afterClosed().subscribe(confirmed=>{if(confirmed){if(this.activeMode="rich-text",this.modeChange.emit("rich-text"),formValue.editor){let html=renderMarkdownToHtml(formValue.editor),editor=addStylingToQuillContent(html);this.form.patchValue({editor})}}else this.modeChange.emit("plain-text")}):(this.activeMode="rich-text",this.modeChange.emit("rich-text"))}};_RichTextFormFieldComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_RichTextFormFieldComponent)},_RichTextFormFieldComponent.\u0275cmp=\u0275\u0275defineComponent({type:_RichTextFormFieldComponent,selectors:[["ix-rich-text-form-field"]],hostBindings:function(rf,ctx){rf&1&&\u0275\u0275listener("paste",function($event){return ctx.blockPaste($event)})("copy",function($event){return ctx.blockCopy($event)})("cut",function($event){return ctx.blockCut($event)})},inputs:{field:"field",mode:"mode"},outputs:{modeChange:"modeChange",valueChange:"valueChange"},features:[\u0275\u0275NgOnChangesFeature],decls:2,vars:1,consts:[[3,"formGroup"],[1,"plain-text"],["bounds","self","formControlName","editor",3,"onEditorCreated","keydown.backspace","keydown.delete","styles","placeholder"],["quill-editor-toolbar","","data-testid","rich-text-toolbar"],[1,"ql-formats"],[1,"ql-header"],["selected",""],["value","1"],["value","2"],["value","3"],["value","4"],["value","5"],["matTooltipShowDelay","500",1,"ql-bold",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-italic",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-underline",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-strike",3,"matTooltip"],["matTooltipShowDelay","500","data-testid","rich-text-color-button",1,"ql-color",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-background",3,"matTooltip"],[1,"ql-align"],["value","center"],["value","right"],["value","justify"],["value","-1","matTooltipShowDelay","500",1,"ql-indent",3,"matTooltip"],["value","+1","matTooltipShowDelay","500",1,"ql-indent",3,"matTooltip"],["value","bullet","matTooltipShowDelay","500",1,"ql-list",3,"matTooltip"],["value","ordered","matTooltipShowDelay","500",1,"ql-list",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-blockquote",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-code-block",3,"matTooltip"],["matTooltipShowDelay","500",1,"ql-link",3,"matTooltip"],[3,"keydown.enter","formControl","placeholder"],["href","https://commonmark.org/help/","target","_blank","mat-icon-button","",1,"markdown-info-button",3,"matTooltip","matTooltipPosition"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,RichTextFormFieldComponent_Conditional_0_Template,34,17,"form",0)(1,RichTextFormFieldComponent_Conditional_1_Template,6,6,"div",1),rf&2&&\u0275\u0275conditional(ctx.activeMode==="rich-text"?0:1)},dependencies:[ReactiveFormsModule,\u0275NgNoValidate,NgSelectOption,\u0275NgSelectMultipleOption,DefaultValueAccessor,NgControlStatus,NgControlStatusGroup,FormControlDirective,FormGroupDirective,FormControlName,FlexLayoutModule,MatButtonModule,MatIconAnchor,MatDialogModule,MatFormFieldModule,MatIconModule,MatIcon,MatInputModule,MatTooltipModule,MatTooltip,ColorPickerPanelModule,QuillEditorComponent,TranslateModule,TranslatePipe],styles:['[_nghost-%COMP%]{display:block}[_nghost-%COMP%] quill-editor[_ngcontent-%COMP%]{width:100%;color:var(--mat-sys-on-surface)}[_nghost-%COMP%] form[_ngcontent-%COMP%]{display:flex}[_nghost-%COMP%] .plain-text[_ngcontent-%COMP%]{display:flex;position:relative;width:100%;font-family:Roboto,sans-serif;white-space:pre-wrap;overflow-wrap:break-word}[_nghost-%COMP%] .plain-text[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;height:441px;max-height:441px;box-sizing:border-box;padding:12px;border-radius:4px 4px 0 0;background-color:var(--mat-sys-surface-variant);border:none;border-bottom:1px solid rgba(0,0,0,.42);resize:none}[_nghost-%COMP%] .plain-text[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]:focus-visible{outline:none}[_nghost-%COMP%] .plain-text[_ngcontent-%COMP%] .markdown-info-button[_ngcontent-%COMP%]{position:absolute;right:5px;bottom:5px}[_nghost-%COMP%] .ql-toolbar{border-radius:4px 4px 0 0}[_nghost-%COMP%] .ql-toolbar.ql-snow{display:flex;flex-flow:row wrap;row-gap:4px;background-color:var(--mat-sys-surface-variant);border:none;border-bottom:1px solid rgba(0,0,0,.12)}[_nghost-%COMP%] .ql-toolbar.ql-snow button, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item{color:var(--mat-sys-on-surface)}[_nghost-%COMP%] .ql-toolbar.ql-snow button .ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow button .ql-stroke.ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label .ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label .ql-stroke.ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item .ql-fill, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item .ql-stroke.ql-fill{fill:var(--mat-sys-on-surface)}[_nghost-%COMP%] .ql-toolbar.ql-snow button .ql-stroke, [_nghost-%COMP%] .ql-toolbar.ql-snow button .ql-stroke-miter, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label .ql-stroke, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label .ql-stroke-miter, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item .ql-stroke, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item .ql-stroke-miter{stroke:var(--mat-sys-on-surface)}[_nghost-%COMP%] .ql-toolbar.ql-snow button:hover, [_nghost-%COMP%] .ql-toolbar.ql-snow button:focus, [_nghost-%COMP%] .ql-toolbar.ql-snow button.ql-active, [_nghost-%COMP%] .ql-toolbar.ql-snow button.ql-selected, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label:hover, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label:focus, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label.ql-active, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-label.ql-selected, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item:hover, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item:focus, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item.ql-active, [_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker-item.ql-selected{background-color:#00000014;border-radius:4px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label{border-color:transparent}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker .ql-picker-options{border-radius:8px;border:none}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label.ql-active:not(:hover,:focus){background-color:inherit}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label>svg>polygon:nth-child(1){stroke-linejoin:initial;transform:translateY(-2px)}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-label>svg>polygon:nth-child(2){display:none}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-options{padding-left:0;padding-right:0}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-options .ql-picker-item{padding-left:8px;padding-right:8px;border-radius:0}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-options .ql-picker-item[data-value="1"]{padding-top:10px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-picker.ql-header .ql-picker-options .ql-picker-item[data-value="2"]{padding-top:8px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-align.ql-picker.ql-expanded .ql-picker-options{display:flex;padding:4px 4px 3px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-align.ql-picker.ql-expanded .ql-picker-options .ql-picker-item{padding:4px}[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-color .ql-color-label.ql-stroke.ql-transparent{opacity:1;stroke-linecap:square;stroke-width:4}@media (min-resolution: 2dppx){[_nghost-%COMP%] .ql-toolbar.ql-snow .ql-color .ql-color-label.ql-stroke.ql-transparent{stroke-width:3}}[_nghost-%COMP%] .ql-snow{font-family:Roboto,sans-serif}[_nghost-%COMP%] .ql-snow a{color:var(--mat-sys-primary)}[_nghost-%COMP%] .ql-snow .ql-code-block-container{background-color:#f6f8fa!important;border:1px solid rgba(0,0,0,.12);color:initial!important}[_nghost-%COMP%] .ql-container{border-radius:0}[_nghost-%COMP%] .ql-container.ql-snow{background-color:var(--mat-sys-surface-variant);border:none;border-bottom:1px solid color-mix(in srgb,transparent,currentcolor 42%)}[_nghost-%COMP%] .ql-container .ql-editor.ql-blank:before{font-style:normal;color:color-mix(in srgb,transparent,currentcolor 42%)}']});let RichTextFormFieldComponent2=_RichTextFormFieldComponent;return RichTextFormFieldComponent2})();var RichTextDialogComponent=(()=>{let _RichTextDialogComponent=class _RichTextDialogComponent{constructor(){this.data=inject(MAT_DIALOG_DATA),this.destroy=inject(DestroyRef),this.dialog=inject(MatDialog),this.dialogRef=inject(MatDialogRef),this.modules={toolbar:{container:"#toolbar"}}}ngOnInit(){this.dialogRef.keydownEvents().pipe(takeUntilDestroyed(this.destroy)).subscribe(event2=>{event2.key==="Escape"&&this.openDiscardChangesWarningDialog()}),this.dialogRef.backdropClick().pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>this.openDiscardChangesWarningDialog())}get activeMode(){return this.formField?.activeMode??this.data.mode}submit(){let formValue=this.formField.form.value,editor=formValue.editor?addStylingToQuillContent(formValue.editor):null;this.dialogRef.close({value:editor})}toggleMode(){this.data.mode=this.data.mode==="rich-text"?"plain-text":"rich-text"}updateMode(mode){this.data.mode=mode}openDiscardChangesWarningDialog(){this.formField.form.dirty?this.dialog.open(DiscardChangesDialogComponent,{panelClass:"fullscreen"}).afterClosed().subscribe(result=>{result&&this.dialogRef.close()}):this.dialogRef.close()}};_RichTextDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_RichTextDialogComponent)},_RichTextDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_RichTextDialogComponent,selectors:[["ix-rich-text-dialog"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(RichTextFormFieldComponent,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.formField=_t.first)}},decls:16,vars:8,consts:[["mat-dialog-title","","translate","","data-testid","rich-text-dialog-title"],["mat-dialog-content",""],[3,"modeChange","field","mode"],["type","button","mat-stroked-button","","data-testid","change-mode-button",1,"change-mode-button",3,"click"],["fxFlex",""],["mat-button","","mat-dialog-close",""],["translate",""],["mat-button","","color","primary",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"h1",0),\u0275\u0275text(1),\u0275\u0275pipe(2,"titlecase"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"div",1)(4,"ix-rich-text-form-field",2),\u0275\u0275listener("modeChange",function($event){return ctx.updateMode($event)}),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"mat-dialog-actions")(6,"button",3),\u0275\u0275listener("click",function(){return ctx.toggleMode()}),\u0275\u0275text(7),\u0275\u0275pipe(8,"translate"),\u0275\u0275elementEnd(),\u0275\u0275element(9,"span",4),\u0275\u0275elementStart(10,"button",5)(11,"span",6),\u0275\u0275text(12,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(13,"button",7),\u0275\u0275listener("click",function(){return ctx.submit()}),\u0275\u0275elementStart(14,"span",6),\u0275\u0275text(15,"CONFIRM"),\u0275\u0275elementEnd()()()),rf&2&&(\u0275\u0275advance(),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(2,4,ctx.data.field.inputName)),\u0275\u0275advance(3),\u0275\u0275property("field",ctx.data.field)("mode",ctx.data.mode),\u0275\u0275advance(3),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind1(8,6,ctx.activeMode==="rich-text"?"SWITCH_TO_PLAIN_TEXT_EDITING":"SWITCH_TO_RICH_TEXT_EDITING")," "))},dependencies:[ColorPickerPanelModule,FlexLayoutModule,DefaultFlexDirective,MatButtonModule,MatButton,MatDialogModule,MatDialogClose,MatDialogTitle,MatDialogActions,MatDialogContent,MatFormFieldModule,MatIconModule,MatInputModule,MatTooltipModule,TitleCasePipe,TranslateModule,TranslatePipe,TranslateDirective,RichTextFormFieldComponent],styles:["[_nghost-%COMP%]{width:100dvw;height:100dvh;display:flex;flex-direction:column;flex:1}@media (min-width: 960px){[_nghost-%COMP%]{height:auto;width:auto;min-width:908px;max-width:908px}}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%]{padding:calc(env(safe-area-inset-top,0) + 16px) 24px 16px}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar{height:48px;padding-left:0;padding-right:0}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title{--mat-dialog-headline-padding: 0;color:inherit}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title:before{display:none}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .mdc-dialog__content[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] .mdc-dialog__title[_ngcontent-%COMP%]:before{height:calc(env(safe-area-inset-top,0) + 40px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]{padding:20px 24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .ix-list[_ngcontent-%COMP%]{margin-left:-24px;margin-right:-24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch;flex:1 1 auto;max-height:none;overflow:auto;-webkit-overflow-scrolling:touch}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%]{margin-left:0;margin-right:0}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 140px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions), [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions){padding-bottom:0}}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__banner[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 225px)}}@media (max-width: 959.9px){[_nghost-%COMP%] .mdc-dialog__actions[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.12);padding-bottom:calc(16px + env(safe-area-inset-bottom,0))}}[_nghost-%COMP%] form[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 auto;height:inherit}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:1rem}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%]{padding-bottom:8px}[_nghost-%COMP%] .mat-mdc-dialog-actions[_ngcontent-%COMP%] .change-mode-button[_ngcontent-%COMP%]{--mdc-outlined-button-container-height: 30px;--mdc-outlined-button-label-text-size: 13px}"]});let RichTextDialogComponent2=_RichTextDialogComponent;return RichTextDialogComponent2})();function RichTextInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function RichTextInputComponent_Conditional_1_Template(rf,ctx){if(rf&1){let _r2=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-rich-text-form-field",2),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r2);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.updateValue($event))})("modeChange",function($event){\u0275\u0275restoreView(_r2);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.updateMode($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(1,"button",3),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r2);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.toggleMode())}),\u0275\u0275text(2),\u0275\u0275pipe(3,"translate"),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("field",ctx_r0.field)("mode",ctx_r0.mode),\u0275\u0275advance(2),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind1(3,3,ctx_r0.activeMode==="rich-text"?"SWITCH_TO_PLAIN_TEXT_EDITING":"SWITCH_TO_RICH_TEXT_EDITING")," ")}}function RichTextInputComponent_Conditional_2_Conditional_4_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-translation-icon-button",7),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r4);let ctx_r0=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r0.setTranslationKey($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext(2);\u0275\u0275property("key",ctx_r0.translationKey)}}function RichTextInputComponent_Conditional_2_Conditional_7_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",6),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}function RichTextInputComponent_Conditional_2_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field",1)(1,"mat-label"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"textarea",4),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r3);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.openEditRichTextDialog())}),\u0275\u0275elementEnd(),\u0275\u0275template(4,RichTextInputComponent_Conditional_2_Conditional_4_Template,1,1,"ix-translation-icon-button",5),\u0275\u0275elementStart(5,"mat-hint"),\u0275\u0275text(6),\u0275\u0275elementEnd(),\u0275\u0275template(7,RichTextInputComponent_Conditional_2_Conditional_7_Template,2,0,"mat-error",6),\u0275\u0275elementEnd()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("formGroup",ctx_r0.componentFormGroup),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("value",ctx_r0.text)("placeholder",ctx_r0.field.inputDescription.placeholder||""),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.translation?4:-1),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.hint),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r0.inputControl!=null&&ctx_r0.inputControl.hasError("required")?7:-1)}}function RichTextInputComponent_Conditional_3_Template(rf,ctx){if(rf&1){let _r5=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-form-field")(1,"mat-label"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275element(3,"textarea",8),\u0275\u0275pipe(4,"translate"),\u0275\u0275pipe(5,"trimTranslationNamespace"),\u0275\u0275elementStart(6,"ix-translation-icon-button",7),\u0275\u0275listener("setTranslationKey",function($event){\u0275\u0275restoreView(_r5);let ctx_r0=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r0.setTranslationKey($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"mat-hint"),\u0275\u0275text(8),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("value",ctx_r0.translationKey?\u0275\u0275pipeBind1(5,7,\u0275\u0275pipeBind1(4,5,ctx_r0.translationKey)):"")("placeholder",ctx_r0.field.inputDescription.placeholder||""),\u0275\u0275advance(3),\u0275\u0275property("key",ctx_r0.translationKey),\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r0.field.inputDescription.hint)}}var RichTextInputComponent=(()=>{let _RichTextInputComponent=class _RichTextInputComponent extends StringInputComponent{constructor(){super(...arguments),this.destroy=inject(DestroyRef),this.dialog=inject(MatDialog),this.dialogContainer=inject(MatDialogContainer,{optional:!0,skipSelf:!0}),this.domParser=new DOMParser,this.mode="rich-text"}get activeMode(){return this.formField?.activeMode??this.mode}get embedded(){return!!this.dialogContainer&&!this.translation}ngOnInit(){super.ngOnInit(),this.inputControl?.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(value=>this.field.setValue(value));let initialValue=this.inputControl?.value;this.field.setValue(initialValue),initialValue&&!this.isHtml(initialValue)&&(this.mode="plain-text")}openEditRichTextDialog(){this.dialog.open(RichTextDialogComponent,{data:{field:this.field,mode:this.mode},autoFocus:!0,disableClose:!0,panelClass:"fullscreen"}).afterClosed().subscribe(result=>{result&&this.updateValue(result.value)})}get text(){let value=this.field.value;return value?value.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim():""}toggleMode(){this.mode=this.mode==="rich-text"?"plain-text":"rich-text"}updateMode(mode){this.mode=mode}updateValue(value){this.inputControl?.setValue(value)}isHtml(value){let doc=this.domParser.parseFromString(value,"text/html");return Array.from(doc.body.childNodes).some(node=>node.nodeType===Node.ELEMENT_NODE)}};_RichTextInputComponent.\u0275fac=(()=>{let \u0275RichTextInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275RichTextInputComponent_BaseFactory||(\u0275RichTextInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_RichTextInputComponent)))(__ngFactoryType__||_RichTextInputComponent)}})(),_RichTextInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_RichTextInputComponent,selectors:[["ix-rich-text-input"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(RichTextFormFieldComponent,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.formField=_t.first)}},features:[\u0275\u0275InheritDefinitionFeature],decls:4,vars:2,consts:[[1,"description",3,"innerHTML"],[3,"formGroup"],[3,"valueChange","modeChange","field","mode"],["type","button","mat-stroked-button","","data-testid","change-mode-button",1,"change-mode-button",3,"click"],["matInput","","cdkTextareaAutosize","true","cdkAutosizeMinRows","2","cdkAutosizeMaxRows","5","readonly","",3,"click","value","placeholder"],[3,"key"],["translate",""],[3,"setTranslationKey","key"],["matInput","","cdkTextareaAutosize","true","cdkAutosizeMinRows","2","cdkAutosizeMaxRows","15","disabled","",3,"value","placeholder"]],template:function(rf,ctx){rf&1&&\u0275\u0275template(0,RichTextInputComponent_Conditional_0_Template,2,3,"p",0)(1,RichTextInputComponent_Conditional_1_Template,4,5)(2,RichTextInputComponent_Conditional_2_Template,8,7,"mat-form-field",1)(3,RichTextInputComponent_Conditional_3_Template,9,9,"mat-form-field"),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.embedded?1:!ctx.translation||!ctx.translationKey?2:3))},dependencies:[TranslateModule,TranslatePipe,TranslateDirective,ReactiveFormsModule,NgControlStatusGroup,FormGroupDirective,MatButtonModule,MatButton,MatFormFieldModule,MatFormField,MatLabel,MatHint,MatError,MatInputModule,MatInput,CdkTextareaAutosize,TranslationIconButtonComponent,MarkdownModule,RenderMarkdownPipe,RichTextFormFieldComponent,TrimTranslationNamespacePipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{width:100%}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{overflow:hidden;width:calc(100% - 40px)}[_nghost-%COMP%] ix-rich-text-form-field[_ngcontent-%COMP%]{margin-bottom:12px}[_nghost-%COMP%] .change-mode-button[_ngcontent-%COMP%]{--mdc-outlined-button-container-height: 30px;--mdc-outlined-button-label-text-size: 13px;margin-bottom:22px}"]});let RichTextInputComponent2=_RichTextInputComponent;return RichTextInputComponent2})();var ResourceSelectionInputFacade=(()=>{let _ResourceSelectionInputFacade=class _ResourceSelectionInputFacade{constructor(){this.store=inject(Store)}getAgentId(version2){return version2?.previewAgent?.publicId?of(version2?.previewAgent?.publicId):version2?.previewAsset?.publicId?this.store.select(selectEntity5(version2?.previewAsset?.publicId)).pipe(map(asset=>asset?.agent?.publicId)):of(void 0)}options(field,query){return this.store.select(selectEntity10(field.context.component.pageVersion?.publicId||null)).pipe(switchMap(version2=>combineLatest([this.getAgentId(version2),query.valueChanges.pipe(startWith(query.value))])),switchMap(([agentId,query2])=>{if(agentId)switch(field.inputDescription.resource?.type){case"AgentDataTag":return this.store.dispatch(ensureAll23({agentId,fields:AGENT_DATA_TAG_WITH_VARIABLE_LIST_FIELDS})),this.getGroupedAgentDataTags(agentId,query2);default:return of([])}return of([])}))}getGroupedAgentDataTags(agentId,query){return combineLatest([this.store.select(selectEntities20),this.store.select(selectAllForAgent3(agentId)),this.store.select(selectEntities21)]).pipe(map(([sourceEntities,tags,variableEntities])=>{let filteredTags=tags;if(query){let q=deburr_default(query.toLowerCase());filteredTags=tags.filter(tag=>tag.name?.toLocaleLowerCase().includes(q))}let optionGroups={};for(let tag of filteredTags)tag.source?.publicId&&tag.variable?.publicId&&!variableEntities[tag.variable.publicId]?.internalUse&&(optionGroups[tag.source?.publicId]||(optionGroups[tag.source?.publicId]=[]),optionGroups[tag.source?.publicId].push({publicId:tag.publicId,label:tag.name,sublabel:tag.slug}));return Object.keys(optionGroups).map(key=>({label:sourceEntities[key]?.name,options:optionGroups[key]}))}))}};_ResourceSelectionInputFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ResourceSelectionInputFacade)},_ResourceSelectionInputFacade.\u0275prov=\u0275\u0275defineInjectable({token:_ResourceSelectionInputFacade,factory:_ResourceSelectionInputFacade.\u0275fac,providedIn:"root"});let ResourceSelectionInputFacade2=_ResourceSelectionInputFacade;return ResourceSelectionInputFacade2})();var _forTrack05=($index,$item)=>$item.publicId;function ResourceSelectionInputComponent_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"p",0),\u0275\u0275pipe(1,"renderMarkdown")),rf&2){let ctx_r0=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind1(1,1,ctx_r0.field.inputDescription.description),\u0275\u0275sanitizeHtml)}}function ResourceSelectionInputComponent_For_12_Conditional_0_For_2_Conditional_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span",7),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let option_r2=\u0275\u0275nextContext().$implicit;\u0275\u0275advance(),\u0275\u0275textInterpolate(option_r2.sublabel)}}function ResourceSelectionInputComponent_For_12_Conditional_0_For_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-option",5)(1,"span",6)(2,"span"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275template(4,ResourceSelectionInputComponent_For_12_Conditional_0_For_2_Conditional_4_Template,2,1,"span",7),\u0275\u0275elementEnd()()),rf&2){let option_r2=ctx.$implicit;\u0275\u0275property("value",option_r2.publicId),\u0275\u0275advance(3),\u0275\u0275textInterpolate(option_r2.label),\u0275\u0275advance(),\u0275\u0275conditional(option_r2.sublabel?4:-1)}}function ResourceSelectionInputComponent_For_12_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-optgroup",4),\u0275\u0275repeaterCreate(1,ResourceSelectionInputComponent_For_12_Conditional_0_For_2_Template,5,3,"mat-option",5,_forTrack05),\u0275\u0275elementEnd()),rf&2){let groupOption_r3=\u0275\u0275nextContext().$implicit;\u0275\u0275property("label",groupOption_r3.label),\u0275\u0275advance(),\u0275\u0275repeater(groupOption_r3.options)}}function ResourceSelectionInputComponent_For_12_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,ResourceSelectionInputComponent_For_12_Conditional_0_Template,3,1,"mat-optgroup",4),rf&2){let groupOption_r3=ctx.$implicit;\u0275\u0275conditional(groupOption_r3.options.length?0:-1)}}function ResourceSelectionInputComponent_Conditional_13_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",3),\u0275\u0275text(1,"__MESSAGE__.REQUIRED"),\u0275\u0275elementEnd())}var ResourceSelectionInputComponent=(()=>{let _ResourceSelectionInputComponent=class _ResourceSelectionInputComponent extends ComponentInputComponent{constructor(){super(...arguments),this.cdRef=inject(ChangeDetectorRef),this.destroy=inject(DestroyRef),this.facade=inject(ResourceSelectionInputFacade),this.groupedOptions=[],this.queryFormControl=new FormControl("")}ngOnInit(){this.facade.options(this.field,this.queryFormControl).pipe(takeUntilDestroyed(this.destroy)).subscribe(options=>{this.groupedOptions=options,this.cdRef.markForCheck()})}get publicIdControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"publicId"])}get nameControl(){return this.componentFormGroup.get([this.field.inputDescription.key,"name"])}selectionChanged(value){let option=this.groupedOptions.reduce((options,groupedOption)=>options.concat(groupedOption.options),[]).find(option2=>option2.publicId===value);option&&this.nameControl?.setValue(option.label)}};_ResourceSelectionInputComponent.\u0275fac=(()=>{let \u0275ResourceSelectionInputComponent_BaseFactory;return function(__ngFactoryType__){return(\u0275ResourceSelectionInputComponent_BaseFactory||(\u0275ResourceSelectionInputComponent_BaseFactory=\u0275\u0275getInheritedFactory(_ResourceSelectionInputComponent)))(__ngFactoryType__||_ResourceSelectionInputComponent)}})(),_ResourceSelectionInputComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ResourceSelectionInputComponent,selectors:[["ix-resource-selection-input"]],standalone:!1,features:[\u0275\u0275InheritDefinitionFeature],decls:14,vars:12,consts:[[1,"description",3,"innerHTML"],["panelClass","select-resource-selector-panel",3,"selectionChange","formControl"],[3,"formControl","placeholderLabel","noEntriesFoundLabel"],["translate",""],[3,"label"],[3,"value"],["fxLayout","column"],[1,"sublabel"]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,ResourceSelectionInputComponent_Conditional_0_Template,2,3,"p",0),\u0275\u0275elementStart(1,"mat-form-field")(2,"mat-label"),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"mat-select",1),\u0275\u0275listener("selectionChange",function($event){return ctx.selectionChanged($event.value)}),\u0275\u0275elementStart(5,"mat-select-trigger"),\u0275\u0275text(6),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"mat-option"),\u0275\u0275element(8,"ngx-mat-select-search",2),\u0275\u0275pipe(9,"translate"),\u0275\u0275pipe(10,"translate"),\u0275\u0275elementEnd(),\u0275\u0275repeaterCreate(11,ResourceSelectionInputComponent_For_12_Template,1,1,null,null,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd(),\u0275\u0275template(13,ResourceSelectionInputComponent_Conditional_13_Template,2,0,"mat-error",3),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275conditional(ctx.field.inputDescription.description?0:-1),\u0275\u0275advance(3),\u0275\u0275textInterpolate(ctx.field.inputDescription.label),\u0275\u0275advance(),\u0275\u0275property("formControl",ctx.publicIdControl),\u0275\u0275advance(2),\u0275\u0275textInterpolate1(" ",ctx.nameControl.value," "),\u0275\u0275advance(2),\u0275\u0275property("formControl",ctx.queryFormControl)("placeholderLabel",\u0275\u0275pipeBind1(9,8,"SEARCH"))("noEntriesFoundLabel",\u0275\u0275pipeBind1(10,10,"NO_RESULTS_FOUND")),\u0275\u0275advance(3),\u0275\u0275repeater(ctx.groupedOptions),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.inputControl!=null&&ctx.inputControl.hasError("required")?13:-1))},dependencies:[MatSelectSearchComponent,DefaultLayoutDirective,NgControlStatus,FormControlDirective,TranslateDirective,MatOption,MatOptgroup,MatFormField,MatLabel,MatError,MatSelect,MatSelectTrigger,RenderMarkdownPipe,TranslatePipe],styles:["[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{display:block} .mat-mdc-select-panel.select-resource-selector-panel mat-option.mat-mdc-option{line-height:1em} .mat-mdc-select-panel.select-resource-selector-panel mat-option.mat-mdc-option .sublabel{font-size:13px;color:#0000008a}"]});let ResourceSelectionInputComponent3=_ResourceSelectionInputComponent;return ResourceSelectionInputComponent3})();var ResourceSelectionInput=class extends ComponentPropertiesInput{constructor(input2,value,context3,converter,level){super(input2,value,context3,converter,level),this.setValue(value)}setValue(value){super.setValue(value),this.name=value?.name,this.publicId=value?.publicId}toFormControl(){let required=this.inputDescription.required?Validators.required:null;return new FormGroup({name:new FormControl(this.name),publicId:new FormControl(this.publicId,required)})}};function inputConstructor(input2){switch(input2.type){case"Number":return NumberInput;case"Group":return GroupInput;case"List":return ListInput;case"RichText":return RichTextInput;case"Selection":return SelectionInput;case"String":return StringInput;case"Text":return TextInput;default:return ComponentPropertiesInput}}function pageComponentInputConstructor(input2){switch(input2.type){case"AggregatedMetric":return AggregatedMetricInput;case"LiveMetric":return LiveMetricInput;case"RawMetric":return RawMetricInput;case"ResourceSelection":return ResourceSelectionInput;default:return inputConstructor(input2)}}function getComponentType(field){switch(field.inputDescription.type){case"Text":return TextInputComponent;case"Color":return ColorInputComponent;case"Date":return DateInputComponent;case"File":return FileInputComponent;case"MaterialIcon":return MaterialIconInputComponent;case"Number":return NumberInputComponent;case"Image":return ImageInputComponent;case"Checkbox":return CheckboxInputComponent;case"Selection":return SelectionInputComponent;case"RichText":return RichTextInputComponent;case"Group":return GroupInputComponent;case"List":return ListInputComponent;default:return StringInputComponent}}function getPageComponentComponentType(field){switch(field.inputDescription.type){case"Icon":return IconInputComponent;case"AggregatedMetric":return AggregatedMetricInputComponent;case"LiveMetric":return LiveMetricInputComponent;case"RawMetric":return RawMetricInputComponent;case"ResourceSelection":return ResourceSelectionInputComponent;default:return getComponentType(field)}}function getPendingFormValue(form){return Object.keys(form.controls).reduce((formValue,formControlName)=>{let _control=form.controls[formControlName];return _control instanceof FormGroup?__spreadProps(__spreadValues({},formValue),{[formControlName]:getPendingFormValue(_control)}):_control instanceof FormControl&&_control._pendingDirty?__spreadProps(__spreadValues({},formValue),{[formControlName]:_control._pendingValue}):formValue},form.value)}var ComponentPropertiesFacade=(()=>{let _ComponentPropertiesFacade=class _ComponentPropertiesFacade{constructor(store){this.store=store}manifest(template){return this.store.select(selectEntity2(template.publicId)).pipe(mergeMap(manifest=>manifest?of(manifest):(this.store.dispatch(ensureOne({template})),EMPTY)))}};_ComponentPropertiesFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentPropertiesFacade)(\u0275\u0275inject(Store))},_ComponentPropertiesFacade.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentPropertiesFacade,factory:_ComponentPropertiesFacade.\u0275fac,providedIn:"root"});let ComponentPropertiesFacade2=_ComponentPropertiesFacade;return ComponentPropertiesFacade2})();var ComponentPropertiesComponent=(()=>{let _ComponentPropertiesComponent=class _ComponentPropertiesComponent{constructor(cdRef,inputConverter,facade,contextService){this.cdRef=cdRef,this.inputConverter=inputConverter,this.facade=facade,this.contextService=contextService,this.afterViewInit$=new BehaviorSubject(!1),this.component$=new ReplaySubject(1),this.template$=new ReplaySubject(1),this.remove=new EventEmitter,this.update=new EventEmitter,this.unsavedChanges=new EventEmitter,this.form=new FormGroup({},{updateOn:"blur"}),this.destroy=inject(DestroyRef)}ngOnInit(){this.component$.pipe(distinctUntilChanged((a,b)=>a.publicId===b.publicId),pairwise(),takeUntilDestroyed(this.destroy)).subscribe(([previous])=>{this.emitPendingChanges(previous)}),combineLatest([this.component$,this.template$,this.afterViewInit$]).pipe(filter(([,,afterViewInit])=>afterViewInit),mergeMap(([component,template])=>combineLatest([of([component,template]),this.contextService.contextChanges.pipe(map(()=>this.inputConverter.hasFields({component})),distinctUntilChanged())])),filter(([,hasFields2])=>hasFields2),switchMap(([[component,template]])=>template?this.facade.manifest(template).pipe(map(manifest=>({component,manifest}))):of({component,manifest:null})),takeUntilDestroyed(this.destroy)).subscribe(({component,manifest})=>{if(this.currentComponentId===component.publicId)return;this.currentInputs=void 0,this.form.contains("inputs")&&this.form.removeControl("inputs"),this.fields=this.inputConverter.getFields({component},manifest?.inputs??null);let formControls=this.inputConverter.getFormControls(this.fields),inputs=new FormGroup(formControls);this.form.markAsPristine(),this.form.addControl("inputs",inputs),this.formDirective&&(this.formDirective.viewContainerRef.clear(),this.inputConverter.loadComponentInputs(this.fields,inputs,this.formDirective.viewContainerRef)),this.currentComponentId=component.publicId}),this.form.statusChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>{this.unsavedChanges.emit(this.form.dirty&&this.form.invalid),this.cdRef.markForCheck()}),this.form.valueChanges.pipe(takeUntilDestroyed(this.destroy)).subscribe(data=>{let doSubmit=!1;if(!(!this.form.valid&&this.currentInputs!==void 0)){if("inputs"in data){this.fields.forEach(field=>field.setValue(data.inputs[field.inputDescription.key]));let inputsString=JSON.stringify(data.inputs);inputsString!==this.currentInputs&&(this.currentInputs!==void 0&&(doSubmit=!0),this.currentInputs=inputsString)}doSubmit&&this.submit()}})}ngOnChanges(changes){changes.template&&this.template$.next(this.template),changes.component&&this.component$.next(this.component)}ngAfterViewInit(){setTimeout(()=>{this.afterViewInit$.next(!0)},0)}ngOnDestroy(){this.emitPendingChanges(this.component),this.component$.complete(),this.template$.complete(),this.afterViewInit$.complete()}emitPendingChanges(component){if(component.inputs&&this.form.controls.inputs){let snapshot=cloneDeep_default(this.form.value);this.form.patchValue({inputs:getPendingFormValue(this.form.controls.inputs)},{emitEvent:!1}),!this.form.invalid&&!isEqual_default(snapshot,this.form.value)&&(isEqual_default(this.form.value.inputs,JSON.parse(component.inputs))||this.update.emit({publicId:component.publicId,inputs:JSON.stringify(this.form.value.inputs)}))}}submit(){let formValue=this.form.value.inputs?{inputs:JSON.stringify(this.form.value.inputs)}:{},component=__spreadValues(__spreadValues({},this.component),formValue);this.update.emit(component),this.form.markAsPristine()}};_ComponentPropertiesComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentPropertiesComponent)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(INPUT_CONVERTER_TOKEN),\u0275\u0275directiveInject(ComponentPropertiesFacade),\u0275\u0275directiveInject(ComponentContextService))},_ComponentPropertiesComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ComponentPropertiesComponent,selectors:[["ix-page-component-properties"]],viewQuery:function(rf,ctx){if(rf&1&&(\u0275\u0275viewQuery(InputControlFormDirective,5),\u0275\u0275viewQuery(MatExpansionPanel,5)),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.formDirective=_t.first),\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.panelRefs=_t)}},inputs:{template:"template",component:"component"},outputs:{remove:"remove",update:"update",unsavedChanges:"unsavedChanges"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:3,vars:1,consts:[["autocomplete","off",3,"ngSubmit","formGroup"],["fxLayout","column",1,"more-actions"],["ixInputControlForm",""]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"form",0),\u0275\u0275listener("ngSubmit",function(){return ctx.submit()}),\u0275\u0275elementStart(1,"div",1),\u0275\u0275element(2,"div",2),\u0275\u0275elementEnd()()),rf&2&&\u0275\u0275property("formGroup",ctx.form)},dependencies:[InputControlFormDirective,\u0275NgNoValidate,NgControlStatusGroup,FormGroupDirective,DefaultLayoutDirective],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column}[_nghost-%COMP%] button[type=submit][_ngcontent-%COMP%]{margin:16px}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%]{background-color:transparent;border-radius:0}[_nghost-%COMP%] .mat-expansion-panel-header-title[_ngcontent-%COMP%]{color:var(--body-color)}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%]:not(.mat-expanded){box-shadow:none!important}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%]:not(.mat-expanded) + .mat-expansion-panel.mat-expanded[_ngcontent-%COMP%]{border-top-left-radius:8px;border-top-right-radius:8px}[_nghost-%COMP%] .mat-expansion-panel.mat-expanded[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface)}[_nghost-%COMP%] .mat-expansion-panel.mat-expanded[_ngcontent-%COMP%] + .mat-expansion-panel.mat-expanded[_ngcontent-%COMP%]{border-top:1px solid var(--mat-sys-outline-variant)}[_nghost-%COMP%] .mat-expansion-panel.border-radius-bottom[_ngcontent-%COMP%]{border-bottom-left-radius:8px!important;border-bottom-right-radius:8px!important}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%] .mat-expansion-panel-header[_ngcontent-%COMP%]{padding:0 20px 0 16px}[_nghost-%COMP%] .mat-expansion-panel[_ngcontent-%COMP%] .mat-expansion-panel-body{padding:0 16px 16px}[_nghost-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:8px}[_nghost-%COMP%] .more-actions[_ngcontent-%COMP%] .component-property-level-0{border-bottom:1px solid var(--mat-sys-outline-variant);padding:16px}[_nghost-%COMP%] .more-actions[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin-right:4px}"]});let ComponentPropertiesComponent3=_ComponentPropertiesComponent;return ComponentPropertiesComponent3})();var MAT_LUXON_DATE_ADAPTER_OPTIONS=new InjectionToken("MAT_LUXON_DATE_ADAPTER_OPTIONS",{providedIn:"root",factory:MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY});function MAT_LUXON_DATE_ADAPTER_OPTIONS_FACTORY(){return{useUtc:!1,defaultOutputCalendar:"gregory"}}function range(length,valueFunction){let valuesArray=Array(length);for(let i=0;i<length;i++)valuesArray[i]=valueFunction(i);return valuesArray}var LuxonDateAdapter=(()=>{class LuxonDateAdapter2 extends DateAdapter{_useUTC;_firstDayOfWeek;_defaultOutputCalendar;constructor(){super();let dateLocale=inject(MAT_DATE_LOCALE,{optional:!0}),options=inject(MAT_LUXON_DATE_ADAPTER_OPTIONS,{optional:!0});this._useUTC=!!options?.useUtc,this._firstDayOfWeek=options?.firstDayOfWeek,this._defaultOutputCalendar=options?.defaultOutputCalendar||"gregory",this.setLocale(dateLocale||DateTime.local().locale)}getYear(date){return date.year}getMonth(date){return date.month-1}getDate(date){return date.day}getDayOfWeek(date){return date.weekday}getMonthNames(style2){return Info.months(style2,{locale:this.locale,outputCalendar:this._defaultOutputCalendar})}getDateNames(){let dtf=new Intl.DateTimeFormat(this.locale,{day:"numeric",timeZone:"utc"});return range(31,i=>dtf.format(DateTime.utc(2017,1,i+1).toJSDate()))}getDayOfWeekNames(style2){let days=Info.weekdays(style2,{locale:this.locale});return days.unshift(days.pop()),days}getYearName(date){return date.toFormat("yyyy",this._getOptions())}getFirstDayOfWeek(){return this._firstDayOfWeek??Info.getStartOfWeek({locale:this.locale})}getNumDaysInMonth(date){return date.daysInMonth}clone(date){return DateTime.fromObject(date.toObject(),this._getOptions())}createDate(year,month,date){let options=this._getOptions();if(month<0||month>11)throw Error(`Invalid month index "${month}". Month index has to be between 0 and 11.`);if(date<1)throw Error(`Invalid date "${date}". Date has to be greater than 0.`);let result=this._useUTC?DateTime.utc(year,month+1,date,options):DateTime.local(year,month+1,date,options);if(!this.isValid(result))throw Error(`Invalid date "${date}". Reason: "${result.invalidReason}".`);return result}today(){let options=this._getOptions();return this._useUTC?DateTime.utc(options):DateTime.local(options)}parse(value,parseFormat){let options=this._getOptions();if(typeof value=="string"&&value.length>0){let iso8601Date=DateTime.fromISO(value,options);if(this.isValid(iso8601Date))return iso8601Date;let formats=Array.isArray(parseFormat)?parseFormat:[parseFormat];if(!parseFormat.length)throw Error("Formats array must not be empty.");for(let format2 of formats){let fromFormat=DateTime.fromFormat(value,format2,options);if(this.isValid(fromFormat))return fromFormat}return this.invalid()}else{if(typeof value=="number")return DateTime.fromMillis(value,options);if(value instanceof Date)return DateTime.fromJSDate(value,options);if(value instanceof DateTime)return DateTime.fromMillis(value.toMillis(),options)}return null}format(date,displayFormat){if(!this.isValid(date))throw Error("LuxonDateAdapter: Cannot format invalid date.");return this._useUTC?date.setLocale(this.locale).setZone("utc").toFormat(displayFormat):date.setLocale(this.locale).toFormat(displayFormat)}addCalendarYears(date,years){return date.reconfigure(this._getOptions()).plus({years})}addCalendarMonths(date,months2){return date.reconfigure(this._getOptions()).plus({months:months2})}addCalendarDays(date,days){return date.reconfigure(this._getOptions()).plus({days})}toIso8601(date){return date.toISO()}deserialize(value){let options=this._getOptions(),date;if(value instanceof Date&&(date=DateTime.fromJSDate(value,options)),typeof value=="string"){if(!value)return null;date=DateTime.fromISO(value,options)}return date&&this.isValid(date)?date:super.deserialize(value)}isDateInstance(obj){return obj instanceof DateTime}isValid(date){return date.isValid}invalid(){return DateTime.invalid("Invalid Luxon DateTime object.")}setTime(target,hours,minutes,seconds){return this.clone(target).set({hour:hours,minute:minutes,second:seconds,millisecond:0})}getHours(date){return date.hour}getMinutes(date){return date.minute}getSeconds(date){return date.second}parseTime(value,parseFormat){let result=this.parse(value,parseFormat);return(!result||!this.isValid(result))&&typeof value=="string"&&this.parse(value.replace(/[^0-9:(AM|PM)]/gi,""),parseFormat)||result}addSeconds(date,amount){return date.reconfigure(this._getOptions()).plus({seconds:amount})}_getOptions(){return{zone:this._useUTC?"utc":void 0,locale:this.locale,outputCalendar:this._defaultOutputCalendar}}static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||LuxonDateAdapter2)};static \u0275prov=\u0275\u0275defineInjectable({token:LuxonDateAdapter2,factory:LuxonDateAdapter2.\u0275fac})}return LuxonDateAdapter2})(),MAT_LUXON_DATE_FORMATS={parse:{dateInput:"D",timeInput:"t"},display:{dateInput:"D",timeInput:"t",monthYearLabel:"LLL yyyy",dateA11yLabel:"DD",monthYearA11yLabel:"LLLL yyyy",timeOptionLabel:"t"}};var MatLuxonDateModule=(()=>{class MatLuxonDateModule2{static \u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||MatLuxonDateModule2)};static \u0275mod=\u0275\u0275defineNgModule({type:MatLuxonDateModule2});static \u0275inj=\u0275\u0275defineInjector({providers:[provideLuxonDateAdapter()]})}return MatLuxonDateModule2})();function provideLuxonDateAdapter(formats=MAT_LUXON_DATE_FORMATS){return[{provide:DateAdapter,useClass:LuxonDateAdapter,deps:[MAT_DATE_LOCALE,MAT_LUXON_DATE_ADAPTER_OPTIONS]},{provide:MAT_DATE_FORMATS,useValue:formats}]}var PERIOD_SPEC_LIST=TIME_RANGE_OPTIONS.map(({code})=>code);var PeriodFieldsetModule=(()=>{let _PeriodFieldsetModule=class _PeriodFieldsetModule{};_PeriodFieldsetModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodFieldsetModule)},_PeriodFieldsetModule.\u0275mod=\u0275\u0275defineNgModule({type:_PeriodFieldsetModule}),_PeriodFieldsetModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule]});let PeriodFieldsetModule2=_PeriodFieldsetModule;return PeriodFieldsetModule2})();var SelectorDialogModule=(()=>{let _SelectorDialogModule=class _SelectorDialogModule{};_SelectorDialogModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectorDialogModule)},_SelectorDialogModule.\u0275mod=\u0275\u0275defineNgModule({type:_SelectorDialogModule}),_SelectorDialogModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule,NgxMatSelectSearchModule]});let SelectorDialogModule2=_SelectorDialogModule;return SelectorDialogModule2})();var SelectorInputModule=(()=>{let _SelectorInputModule=class _SelectorInputModule{};_SelectorInputModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectorInputModule)},_SelectorInputModule.\u0275mod=\u0275\u0275defineNgModule({type:_SelectorInputModule}),_SelectorInputModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule,SelectorDialogModule]});let SelectorInputModule2=_SelectorInputModule;return SelectorInputModule2})();var NumberInputValidatorModule=(()=>{let _NumberInputValidatorModule=class _NumberInputValidatorModule{};_NumberInputValidatorModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_NumberInputValidatorModule)},_NumberInputValidatorModule.\u0275mod=\u0275\u0275defineNgModule({type:_NumberInputValidatorModule}),_NumberInputValidatorModule.\u0275inj=\u0275\u0275defineInjector({});let NumberInputValidatorModule2=_NumberInputValidatorModule;return NumberInputValidatorModule2})();var InputConverterService=class{constructor(){this.injector=inject(Injector)}convertInput(input2,values,context3,level){let constructor=this.getInputConstructor(input2);return new constructor(input2,values?.[input2.key],context3,this,level,this.injector)}getFormControls(inputs){return inputs.reduce((acc,cur)=>__spreadProps(__spreadValues({},acc),{[cur.inputDescription.key]:cur.toFormControl()}),{})}getFields(context3,inputs){let componentInput=this.getInputs(context3);return inputs?.map(input2=>this.convertInput(input2,componentInput,context3,0))||[]}loadComponentInputs(fields,form,ref){for(let field of fields){let componentType=this.getComponentType(field),componentRef=ref.createComponent(componentType);componentRef.instance.field=field,componentRef.instance.componentFormGroup=form,componentRef.location.nativeElement.classList.add(`component-property-level-${field.level}`)}}};var PageComponentInputConverterService=(()=>{let _PageComponentInputConverterService=class _PageComponentInputConverterService extends InputConverterService{constructor(){super(...arguments),this.service=inject(ComponentContextService)}getInputs({component}){let context3=this.service.getContext(component);if(context3===void 0)throw Error(`ComponentContext could not be found for component ${component.publicId}.`);let inputs=cloneDeep_default(context3.inputs)||{};return Object.keys(context3._translationKeys).forEach(key=>set_default(inputs,key,context3._translationKeys[key])),inputs}getInputConstructor(input2){return pageComponentInputConstructor(input2)}getComponentType(field){return getPageComponentComponentType(field)}hasFields({component}){return this.service.getContext(component)!==void 0}};_PageComponentInputConverterService.\u0275fac=(()=>{let \u0275PageComponentInputConverterService_BaseFactory;return function(__ngFactoryType__){return(\u0275PageComponentInputConverterService_BaseFactory||(\u0275PageComponentInputConverterService_BaseFactory=\u0275\u0275getInheritedFactory(_PageComponentInputConverterService)))(__ngFactoryType__||_PageComponentInputConverterService)}})(),_PageComponentInputConverterService.\u0275prov=\u0275\u0275defineInjectable({token:_PageComponentInputConverterService,factory:_PageComponentInputConverterService.\u0275fac,providedIn:"root"});let PageComponentInputConverterService2=_PageComponentInputConverterService;return PageComponentInputConverterService2})();var InputControlModule=(()=>{let _InputControlModule=class _InputControlModule{};_InputControlModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_InputControlModule)},_InputControlModule.\u0275mod=\u0275\u0275defineNgModule({type:_InputControlModule}),_InputControlModule.\u0275inj=\u0275\u0275defineInjector({providers:[{provide:INPUT_CONVERTER_TOKEN,useClass:PageComponentInputConverterService}],imports:[ColorPickerPanelModule,FileUploadButtonComponent,FileUploadDropContainerComponent,MarkdownModule,MatLuxonDateModule,MaterialIconFieldsetComponent,NgxMatSelectSearchModule,NumberInputValidatorModule,PeriodFieldsetModule,SelectorInputModule,SharedModule,TranslationIconButtonComponent]});let InputControlModule2=_InputControlModule;return InputControlModule2})();var ComponentPropertiesModule=(()=>{let _ComponentPropertiesModule=class _ComponentPropertiesModule{};_ComponentPropertiesModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentPropertiesModule)},_ComponentPropertiesModule.\u0275mod=\u0275\u0275defineNgModule({type:_ComponentPropertiesModule}),_ComponentPropertiesModule.\u0275inj=\u0275\u0275defineInjector({imports:[InputControlModule,ReactiveFormsModule,FlexModule,InputControlModule]});let ComponentPropertiesModule2=_ComponentPropertiesModule;return ComponentPropertiesModule2})();var ComponentContextCleanupDirective=(()=>{let _ComponentContextCleanupDirective=class _ComponentContextCleanupDirective{set agentOrAssetId(agentOrAssetId){this.agentOrAssetId$.next(agentOrAssetId)}set pageVersionId(pageVersionId){this.pageVersionId$.next(pageVersionId)}constructor(scopeRef,contextService){this.scopeRef=scopeRef,this.contextService=contextService,this.agentOrAssetId$=new ReplaySubject(1),this.pageVersionId$=new ReplaySubject(1),this.destroy=inject(DestroyRef)}ngOnInit(){combineLatest([this.agentOrAssetId$,this.pageVersionId$]).pipe(filter(ids=>ids.every(Boolean)),distinctUntilChanged(isEqual_default),skip(1),takeUntilDestroyed(this.destroy)).subscribe(()=>{this.contextService.destroyAll(this.scopeRef?.value)})}ngOnDestroy(){this.agentOrAssetId$.complete(),this.pageVersionId$.complete()}};_ComponentContextCleanupDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentContextCleanupDirective)(\u0275\u0275directiveInject(ComponentGridScopeDirective,8),\u0275\u0275directiveInject(ComponentContextService))},_ComponentContextCleanupDirective.\u0275dir=\u0275\u0275defineDirective({type:_ComponentContextCleanupDirective,selectors:[["","ixComponentContextCleanup",""]],inputs:{agentOrAssetId:"agentOrAssetId",pageVersionId:"pageVersionId"},standalone:!1});let ComponentContextCleanupDirective3=_ComponentContextCleanupDirective;return ComponentContextCleanupDirective3})();var setLocale=createAction("[Localization] Set Locale",props()),setTimeZone=createAction("[Localization] Set Time Zone",props());var LOCALE_STORAGE_KEY="locale";var LANGUAGE_TO_LOCALES=[{code:"nl",locale:"nl-NL"},{code:"de",locale:"de-DE"},{code:"en",locale:"en-US"}],TIME_ZONE_STORAGE_KEY="timezone";function mapLangToLocale(lang){return LANGUAGE_TO_LOCALES.find(map4=>map4.code===lang)?.locale||lang}var LocalizationService=(()=>{let _LocalizationService=class _LocalizationService{constructor(storage){this.storage=storage}getLocale(){if(this.storage.has(LOCALE_STORAGE_KEY)){let locale=this.storage.get(LOCALE_STORAGE_KEY);return locale.includes("_")&&(locale=locale.replace("_","-"),this.setLocale(locale)),locale}return mapLangToLocale(Intl.DateTimeFormat().resolvedOptions().locale)}getTimeZone(){return this.storage.has(TIME_ZONE_STORAGE_KEY)?this.storage.get(TIME_ZONE_STORAGE_KEY):Intl.DateTimeFormat().resolvedOptions().timeZone}setLocale(locale){locale!==null?(this.storage.forever(LOCALE_STORAGE_KEY,locale),Settings.defaultLocale=locale):(this.storage.forget(LOCALE_STORAGE_KEY),Settings.defaultLocale=mapLangToLocale(Intl.DateTimeFormat().resolvedOptions().locale))}setTimeZone(timeZone){timeZone!==null?(this.storage.forever(TIME_ZONE_STORAGE_KEY,timeZone),Settings.defaultZone=timeZone):(this.storage.forget(TIME_ZONE_STORAGE_KEY),Settings.defaultZone=Intl.DateTimeFormat().resolvedOptions().timeZone)}};_LocalizationService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LocalizationService)(\u0275\u0275inject(StorageService))},_LocalizationService.\u0275prov=\u0275\u0275defineInjectable({token:_LocalizationService,factory:_LocalizationService.\u0275fac,providedIn:"root"});let LocalizationService2=_LocalizationService;return LocalizationService2})();var LocalizationEffects=(()=>{let _LocalizationEffects=class _LocalizationEffects{constructor(actions$,service){this.actions$=actions$,this.service=service,this.setLocale$=createEffect(()=>this.actions$.pipe(ofType(setLocale),tap(({locale})=>this.service.setLocale(locale))),{dispatch:!1}),this.setTimeZone$=createEffect(()=>this.actions$.pipe(ofType(setTimeZone),tap(({timeZone})=>this.service.setTimeZone(timeZone))),{dispatch:!1}),this.setDefaultUserPreferences$=createEffect(()=>this.actions$.pipe(ofType(logInSuccess,loadMeSuccess2),map(({data})=>({localisation:get_default(data,"localisation",get_default(data,"user.localisation")),timeZone:get_default(data,"timeZone",get_default(data,"user.timeZone"))})),filter(({localisation,timeZone})=>isNil_default(localisation)||isNil_default(timeZone)),map(({localisation,timeZone})=>updateMe({data:__spreadValues(__spreadValues({},isNil_default(localisation)?{localisation:this.service.getLocale()}:{}),isNil_default(timeZone)?{timeZone:this.service.getTimeZone()}:{})})))),this.localeUserPreference$=createEffect(()=>this.actions$.pipe(ofType(logInSuccess,loadMeSuccess2,updateMeSuccess,didUpdateMe),map(({data})=>get_default(data,"localisation",get_default(data,"user.localisation"))),filter(locale=>locale!==void 0),distinctUntilChanged(),map(locale=>setLocale({locale})))),this.timeZoneUserPreference$=createEffect(()=>this.actions$.pipe(ofType(logInSuccess,loadMeSuccess2,updateMeSuccess,didUpdateMe),map(({data})=>get_default(data,"timeZone",get_default(data,"user.timeZone"))),filter(timeZone=>timeZone!==void 0),distinctUntilChanged(),map(timeZone=>setTimeZone({timeZone}))))}};_LocalizationEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LocalizationEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(LocalizationService))},_LocalizationEffects.\u0275prov=\u0275\u0275defineInjectable({token:_LocalizationEffects,factory:_LocalizationEffects.\u0275fac});let LocalizationEffects2=_LocalizationEffects;return LocalizationEffects2})();var LocalizationModule=(()=>{let _LocalizationModule=class _LocalizationModule{constructor(storage){Settings.defaultLocale=storage.get(LOCALE_STORAGE_KEY,mapLangToLocale(Intl.DateTimeFormat().resolvedOptions().locale)),Settings.defaultZone=storage.get(TIME_ZONE_STORAGE_KEY,Intl.DateTimeFormat().resolvedOptions().timeZone)}};_LocalizationModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LocalizationModule)(\u0275\u0275inject(StorageService))},_LocalizationModule.\u0275mod=\u0275\u0275defineNgModule({type:_LocalizationModule}),_LocalizationModule.\u0275inj=\u0275\u0275defineInjector({providers:[{provide:MAT_DATE_LOCALE,useFactory:service=>service.getLocale(),deps:[LocalizationService]}],imports:[StorageModule,EffectsModule.forFeature([LocalizationEffects])]});let LocalizationModule2=_LocalizationModule;return LocalizationModule2})();var LoggingDataPrefetcher=(()=>{let _LoggingDataPrefetcher=class _LoggingDataPrefetcher{constructor(store,actions$){this.store=store,this.actions$=actions$}forQueries(agentId,queries){let parsedSelectors=queries.map(query=>query.selector?parseSelector(query.selector):{type:"",target:"",dataSource:"",logType:"",logName:""}).filter(r=>r?.type==="Agent"&&r?.target==="selected"),uniqDataSourceSlugs=compact_default(uniq_default(parsedSelectors.map(r=>r?.dataSource))),uniqDataTagSlugs=compact_default(uniq_default(parsedSelectors.filter(r=>r?.logType==="tag").map(r=>r?.logName))),uniqDataVariableSlugs=compact_default(uniq_default(parsedSelectors.filter(r=>r?.logType==="variable").map(r=>r?.logName)));return combineLatest([this.handleDataSourceSlugs(agentId,uniqDataSourceSlugs),this.handleDataTagSlugs(agentId,uniqDataTagSlugs),this.handleDataVariableSlugs(agentId,uniqDataVariableSlugs)]).pipe(mergeMap(()=>of(queries)))}handleDataSourceSlugs(agentId,slugs){return agentId&&slugs.length?combineLatest([this.store.select(selectAllLoadedForAgent(agentId)),this.store.select(selectAllForAgent(agentId))]).pipe(take(1),mergeMap(([sourcesLoaded,sources])=>{if(sourcesLoaded&&sources.length===0)return of([]);let unmatchedSlugs=slugs.filter(slug=>!sources?.find(s2=>s2?.slug===slug));if(unmatchedSlugs.length){let filters=`in(slug,"${unmatchedSlugs.join('","')}")`,queryTooLarge=("?fields="+AGENT_DATA_SOURCE_LIST_FIELDS.join(",")+"&").length+filters.length+`&page-after=publicid0000&page-size=${4e3}`.length>4096,reference2=`${agentId}_${filters}`;return this.store.dispatch(loadAll2({agentId,filters:queryTooLarge?void 0:filters})),this.actions$.pipe(ofType(loadAllSuccess3,loadAllFailure2),filter(({agentId:agentId2,filters:filters2})=>`${agentId2}_${filters2}`===reference2||queryTooLarge),take(1),map(()=>[]))}return of([])}),map(()=>[])):of([])}handleDataTagSlugs(agentId,slugs){return agentId&&slugs.length?combineLatest([this.store.select(selectAllLoadedForAgent(agentId)),this.store.select(selectAllForAgent(agentId)),this.store.select(selectAllForAgent3(agentId))]).pipe(take(1),mergeMap(([sourcesLoaded,sources,tags])=>{if(sourcesLoaded&&sources.length===0)return of([]);let unmatchedSlugs=slugs.filter(slug=>!tags?.find(t=>t?.slug===slug));if(unmatchedSlugs.length){let filters=`in(slug,"${unmatchedSlugs.join('","')}")`,queryTooLarge=("?fields="+AGENT_DATA_TAG_WITH_VARIABLE_LIST_FIELDS.join(",")+"&").length+(filters?.length||0)+`&page-after=publicid0000&page-size=${4e3}`.length>4096,reference2=`${agentId}_${filters}`;return this.store.dispatch(loadAll27({agentId,fields:AGENT_DATA_TAG_WITH_VARIABLE_LIST_FIELDS,filters:queryTooLarge?void 0:filters})),this.actions$.pipe(ofType(loadAllSuccess28,loadAllFailure27),filter(({agentId:agentId2,filters:filters2})=>`${agentId2}_${filters2}`===reference2||queryTooLarge),take(1),map(()=>[]))}return of([])}),map(()=>[])):of([])}handleDataVariableSlugs(agentId,slugs){return agentId&&slugs.length?this.store.select(selectAllLoadedForAgent2(agentId)).pipe(take(1),mergeMap(loaded=>{if(!loaded){let reference2=agentId;return this.store.dispatch(loadAll28({agentId})),this.actions$.pipe(ofType(loadAllSuccess29,loadAllFailure28),filter(({agentId:agentId2})=>agentId2===reference2),take(1),map(()=>[]))}return of([])}),map(()=>[])):of([])}};_LoggingDataPrefetcher.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoggingDataPrefetcher)(\u0275\u0275inject(Store),\u0275\u0275inject(Actions))},_LoggingDataPrefetcher.\u0275prov=\u0275\u0275defineInjectable({token:_LoggingDataPrefetcher,factory:_LoggingDataPrefetcher.\u0275fac,providedIn:"root"});let LoggingDataPrefetcher2=_LoggingDataPrefetcher;return LoggingDataPrefetcher2})();var LoggingDataBrokerDirective=(()=>{let _LoggingDataBrokerDirective=class _LoggingDataBrokerDirective{constructor(scopeRef,store,activePeriodSpec,authTokenService,localization,loggingDataClient,loggingDataFetcherFactory,loggingDataPrefetcher){this.scopeRef=scopeRef,this.store=store,this.activePeriodSpec=activePeriodSpec,this.authTokenService=authTokenService,this.localization=localization,this.loggingDataClient=loggingDataClient,this.loggingDataFetcherFactory=loggingDataFetcherFactory,this.loggingDataPrefetcher=loggingDataPrefetcher,this.agentOrAssetId$=new ReplaySubject(1),this.agentId=null,this.agentId$=this.agentOrAssetId$.pipe(switchMap(agentOrAssetId=>this.store.select(selectEntities9).pipe(map(entities=>entities[agentOrAssetId]?findClosestAgentToAsset(agentOrAssetId,entities)?.publicId??null:agentOrAssetId),distinctUntilChanged()))),this._authToken$=combineLatest([timer(0,55*60*1e3),this.agentId$]).pipe(mergeMap(([,id])=>{let canUseLiveData=this.features.instantCanUse("live-data",{agentId:id}),canUseHistoricalData=this.features.instantCanUse("historical-data",{agentId:id});return id&&(canUseLiveData||canUseHistoricalData)?this.authTokenService.getForData({agents:[{publicId:id}],expiresIn:3600}).pipe(map(response=>response.data.secretId),catchError(()=>EMPTY)):EMPTY}),share()),this.authTokenRequired$=new ReplaySubject(1),this.authToken$=new ReplaySubject(1),this.dataSources$=this.agentId$.pipe(mergeMap(id=>this.store.select(selectAllForAgent(id)))),this.tags$=this.agentId$.pipe(mergeMap(id=>this.store.select(selectAllForAgent3(id)))),this.variables$=this.agentId$.pipe(mergeMap(id=>this.store.select(selectAllForAgent2(id)))),this.features=inject(PlatformFeaturesService),this.destroy=inject(DestroyRef)}ngOnInit(){this.agentId$.pipe(distinctUntilChanged()).subscribe(agentId=>this.agentId=agentId),this.fetcher=this.loggingDataFetcherFactory.create({agentId:this.agentId$.pipe(distinctUntilChanged()),authToken:this.authToken$.asObservable(),companyId:this.store.select(selectMyCompanyId),locale:this.localization.getLocale(),timeRange:this.activePeriodSpec.asTimeRange(this.scopeRef?.value),timeZone:of(Settings.defaultZone.name),dataSources:this.dataSources$,tags:this.tags$,variables:this.variables$,availabilityStrategy:LoggingDataConfigAvailabilityStrategy.Lazy,scope:this.scopeRef?.value,beforeFetch:queries=>this.agentId?this.loggingDataPrefetcher.forQueries(this.agentId,queries).pipe(mergeMap(queries2=>queries2.some(q=>q.selector?parseSelector(q.selector).logType==="variable":!1)?(this.authTokenRequired$.next(!0),this.authToken$.pipe(take(1),map(()=>queries2))):of(queries2))):of(queries)}),this.authTokenRequired$.pipe(distinctUntilChanged(),switchMap(required=>required?this._authToken$:EMPTY),takeUntilDestroyed(this.destroy)).subscribe(this.authToken$),merge(this.loggingDataClient.onQuery(this.scopeRef?.value),this.loggingDataClient.onDestroy(this.scopeRef?.value)).pipe(bufferDebounceTime(100),mergeMap(buffer2=>{let queries=[],destroyEvents=buffer2.filter(item=>item instanceof CustomEvent);return destroyEvents.length?queries=flatten_default(buffer2.filter(item=>!(item instanceof CustomEvent))).filter(q=>!destroyEvents.some(e=>q._clientRef?.startsWith(e.detail)&&(q._timeStamp?q._timeStamp<e.timeStamp:!0))):queries=flatten_default(buffer2),queries.length?of(queries):EMPTY}),mergeMap(queries=>this.fetcher.fetch(queries)),distinctUntilChanged(),takeUntilDestroyed(this.destroy)).subscribe(metrics=>{this.loggingDataClient.emitMetrics(metrics,this.scopeRef?.value)}),this.loggingDataClient.onExport(this.scopeRef?.value).pipe(mergeMap(({queries,csvDelimiter})=>this.fetcher.export(queries,csvDelimiter)),takeUntilDestroyed(this.destroy)).subscribe(blob=>{this.loggingDataClient.emitBlob(blob,this.scopeRef?.value)})}ngOnChanges(changes){changes.agentOrAssetId&&this.agentOrAssetId&&this.agentOrAssetId$.next(this.agentOrAssetId)}ngOnDestroy(){this.agentOrAssetId$.complete(),this.authToken$.complete(),this.authTokenRequired$.complete(),this.fetcher.destroy()}};_LoggingDataBrokerDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoggingDataBrokerDirective)(\u0275\u0275directiveInject(ComponentGridScopeDirective,8),\u0275\u0275directiveInject(Store),\u0275\u0275directiveInject(ActivePeriodSpec),\u0275\u0275directiveInject(AuthTokenService),\u0275\u0275directiveInject(LocalizationService),\u0275\u0275directiveInject(LoggingDataClientProxyService),\u0275\u0275directiveInject(LoggingDataFetcherFactory),\u0275\u0275directiveInject(LoggingDataPrefetcher))},_LoggingDataBrokerDirective.\u0275dir=\u0275\u0275defineDirective({type:_LoggingDataBrokerDirective,selectors:[["","ixLoggingDataBroker",""]],inputs:{agentOrAssetId:"agentOrAssetId"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature]});let LoggingDataBrokerDirective3=_LoggingDataBrokerDirective;return LoggingDataBrokerDirective3})();var ComponentGridFocusDirective=(()=>{let _ComponentGridFocusDirective=class _ComponentGridFocusDirective{constructor(){this.elRef=inject(ElementRef),this.service=inject(ComponentGridFocusService),this.destroy=inject(DestroyRef)}ngOnInit(){fromEvent(this.elRef.nativeElement,"mousedown").pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>this.service.next())}};_ComponentGridFocusDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentGridFocusDirective)},_ComponentGridFocusDirective.\u0275dir=\u0275\u0275defineDirective({type:_ComponentGridFocusDirective,selectors:[["","ixComponentGridFocus",""]]});let ComponentGridFocusDirective3=_ComponentGridFocusDirective;return ComponentGridFocusDirective3})();function PeriodBottomSheetComponent_For_4_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-list-item",11),\u0275\u0275listener("click",function(){let range_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.applyRange(range_r2.code))}),\u0275\u0275text(1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementEnd()}if(rf&2){let range_r2=ctx.$implicit;\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind2(2,1,range_r2.translateKey,range_r2.translateParams)," ")}}function PeriodBottomSheetComponent_Conditional_12_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"FROM_MUST_BE_BEFORE_TO"),\u0275\u0275elementEnd())}function PeriodBottomSheetComponent_Conditional_13_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.MAX_DATE"),\u0275\u0275elementEnd())}function PeriodBottomSheetComponent_Conditional_18_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"TO_MUST_BE_AFTER_FROM"),\u0275\u0275elementEnd())}function PeriodBottomSheetComponent_Conditional_19_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.MAX_DATE"),\u0275\u0275elementEnd())}var PeriodBottomSheetComponent=(()=>{let _PeriodBottomSheetComponent=class _PeriodBottomSheetComponent{constructor(){this.data=inject(MAT_BOTTOM_SHEET_DATA),this.ref=inject(MatBottomSheetRef),this.ranges=TIME_RANGE_OPTIONS,this.maxDate=DateTime.now().endOf("day").toISO()}ngOnInit(){let timeRange=toTimeRange(this.data.periodSpec);this.form=new FormGroup({from:new FormControl(DateTime.fromMillis(timeRange.from).set({millisecond:0}).toISO({includeOffset:!1,suppressMilliseconds:!0}),{validators:[Validators.required,DateTimeValidators.maxDate(this.maxDate)],nonNullable:!0}),to:new FormControl(DateTime.fromMillis(timeRange.to).set({millisecond:0}).toISO({includeOffset:!1,suppressMilliseconds:!0}),{validators:[Validators.required,DateTimeValidators.maxDate(this.maxDate)],nonNullable:!0})},{validators:DateTimeValidators.fromToInverted()})}applyRange(range2){this.ref.dismiss(range2)}cancel(){this.ref.dismiss()}submit(){let periodSpec={from:DateTime.fromISO(this.form.controls.from.value).toMillis(),to:DateTime.fromISO(this.form.controls.to.value).toMillis()};this.ref.dismiss(periodSpec)}};_PeriodBottomSheetComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodBottomSheetComponent)},_PeriodBottomSheetComponent.\u0275cmp=\u0275\u0275defineComponent({type:_PeriodBottomSheetComponent,selectors:[["ix-period-bottom-sheet"]],decls:27,vars:10,consts:[["fxLayout","column"],[1,"ranges"],["autocomplete","off",3,"ngSubmit","formGroup"],["fxLayout","row","fxLayoutGap","8px"],["fxFlex","grow"],["translate",""],["type","datetime-local","matInput","","formControlName","from","step","1",3,"max"],["type","datetime-local","matInput","","formControlName","to","step","1",3,"min","max"],["fxLayout","row","fxLayoutAlign","end center",1,"actions"],["type","button","mat-button","",3,"click"],["type","submit","mat-button","","color","primary",3,"disabled"],[3,"click"]],template:function(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"div",1)(2,"mat-action-list"),\u0275\u0275repeaterCreate(3,PeriodBottomSheetComponent_For_4_Template,3,4,"mat-list-item",null,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()(),\u0275\u0275element(5,"mat-divider"),\u0275\u0275elementStart(6,"form",2),\u0275\u0275listener("ngSubmit",function(){return ctx.submit()}),\u0275\u0275elementStart(7,"fieldset",3)(8,"mat-form-field",4)(9,"mat-label",5),\u0275\u0275text(10,"FROM__DATE"),\u0275\u0275elementEnd(),\u0275\u0275element(11,"input",6),\u0275\u0275template(12,PeriodBottomSheetComponent_Conditional_12_Template,2,0,"mat-error",5)(13,PeriodBottomSheetComponent_Conditional_13_Template,2,0,"mat-error",5),\u0275\u0275elementEnd(),\u0275\u0275elementStart(14,"mat-form-field",4)(15,"mat-label",5),\u0275\u0275text(16,"TO__DATE"),\u0275\u0275elementEnd(),\u0275\u0275element(17,"input",7),\u0275\u0275template(18,PeriodBottomSheetComponent_Conditional_18_Template,2,0,"mat-error",5)(19,PeriodBottomSheetComponent_Conditional_19_Template,2,0,"mat-error",5),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(20,"div",8)(21,"button",9),\u0275\u0275listener("click",function(){return ctx.cancel()}),\u0275\u0275elementStart(22,"span",5),\u0275\u0275text(23,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(24,"button",10)(25,"span",5),\u0275\u0275text(26,"APPLY"),\u0275\u0275elementEnd()()()()()),rf&2){let tmp_2_0,tmp_6_0;\u0275\u0275advance(3),\u0275\u0275repeater(ctx.ranges),\u0275\u0275advance(3),\u0275\u0275property("formGroup",ctx.form),\u0275\u0275advance(5),\u0275\u0275property("max",(tmp_2_0=ctx.form.get("to"))==null?null:tmp_2_0.value)("max",ctx.maxDate),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("inverted")?12:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("maxDate")?13:-1),\u0275\u0275advance(4),\u0275\u0275property("min",(tmp_6_0=ctx.form.get("from"))==null?null:tmp_6_0.value)("max",ctx.maxDate),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("inverted")?18:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("maxDate")?19:-1),\u0275\u0275advance(5),\u0275\u0275property("disabled",ctx.form.invalid)}},dependencies:[FlexModule,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatButtonModule,MatButton,MatDividerModule,MatDivider,MatFormFieldModule,MatFormField,MatLabel,MatError,MatInputModule,MatInput,MatListModule,MatActionList,MatListItem,ReactiveFormsModule,\u0275NgNoValidate,DefaultValueAccessor,NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,TranslateModule,TranslatePipe,TranslateDirective],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%]{max-height:50vh;overflow-y:auto}[_nghost-%COMP%] form[_ngcontent-%COMP%]{display:block;padding-top:16px}[_nghost-%COMP%] form[_ngcontent-%COMP%] fieldset[_ngcontent-%COMP%]{margin:0;padding:0;border:none}[_nghost-%COMP%] form[_ngcontent-%COMP%] fieldset[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{max-width:calc(50vw - 24px)!important}[_nghost-%COMP%] form[_ngcontent-%COMP%] fieldset[_ngcontent-%COMP%] input[type=datetime-local][_ngcontent-%COMP%]::-webkit-inner-spin-button, [_nghost-%COMP%] form[_ngcontent-%COMP%] fieldset[_ngcontent-%COMP%] input[type=datetime-local][_ngcontent-%COMP%]::-webkit-calendar-picker-indicator{appearance:none;display:none}[_nghost-%COMP%] .actions[_ngcontent-%COMP%]{padding-bottom:8px}[_nghost-%COMP%] .actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:8px}"]});let PeriodBottomSheetComponent2=_PeriodBottomSheetComponent;return PeriodBottomSheetComponent2})();var PERIOD_PANEL_DATA=new InjectionToken("device-board-header-period-panel-data");var import_dayjs4=__toESM(require_dayjs_min()),import_utc=__toESM(require_utc()),import_timezone=__toESM(require_timezone());var PeriodPanelRef=class{constructor(overlayRef){this.overlayRef=overlayRef,this._afterClosed=new Subject}afterClosed(){return this._afterClosed.asObservable()}close(data){this.overlayRef.dispose(),data&&(this._afterClosed.next(data),this._afterClosed.complete())}};var _c024=a0=>({active:a0});function PeriodPanelComponent_Conditional_21_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"button",6)(1,"div",4)(2,"mat-icon"),\u0275\u0275text(3,"public"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"span"),\u0275\u0275text(5),\u0275\u0275pipe(6,"translate"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"span"),\u0275\u0275text(8,":\xA0"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"span"),\u0275\u0275text(10),\u0275\u0275elementEnd(),\u0275\u0275elementStart(11,"mat-icon"),\u0275\u0275text(12,"arrow_drop_down"),\u0275\u0275elementEnd()()()),rf&2){let ctx_r1=\u0275\u0275nextContext(),timeZoneMenu_r3=\u0275\u0275reference(4);\u0275\u0275property("matMenuTriggerFor",timeZoneMenu_r3),\u0275\u0275advance(5),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(6,3,ctx_r1.timeZoneSpec==="device"?"DEVICE_TIME_ZONE":"MY_TIME_ZONE")),\u0275\u0275advance(5),\u0275\u0275textInterpolate(ctx_r1.timeZoneSpec==="device"?ctx_r1.deviceTimeZone:ctx_r1.myTimeZone)}}function PeriodPanelComponent_Conditional_32_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"FROM_MUST_BE_BEFORE_TO"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_33_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.MAX_DATE"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_34_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_DATE_AND_TIME"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_35_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_DATE_AND_TIME"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_41_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"TO_MUST_BE_AFTER_FROM"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_42_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.MAX_DATE"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_43_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_DATE_AND_TIME"),\u0275\u0275elementEnd())}function PeriodPanelComponent_Conditional_44_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-error",5),\u0275\u0275text(1,"__MESSAGE__.INVALID_DATE_AND_TIME"),\u0275\u0275elementEnd())}function PeriodPanelComponent_For_55_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-list-item",20),\u0275\u0275listener("click",function(){let range_r5=\u0275\u0275restoreView(_r4).$implicit,ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.applyRange(range_r5.code))}),\u0275\u0275text(1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementEnd()}if(rf&2){let range_r5=ctx.$implicit;\u0275\u0275advance(),\u0275\u0275textInterpolate1(" ",\u0275\u0275pipeBind2(2,1,range_r5.translateKey,range_r5.translateParams)," ")}}import_dayjs4.default.extend(import_utc.default);import_dayjs4.default.extend(import_timezone.default);var PeriodPanelComponent=(()=>{let _PeriodPanelComponent=class _PeriodPanelComponent{constructor(data,formBuilder,localizationService,ref){this.data=data,this.formBuilder=formBuilder,this.localizationService=localizationService,this.ref=ref,this.browserTimeZone=Intl.DateTimeFormat().resolvedOptions().timeZone,this.locale={format:"YYYY-MM-DDTHH:mm:ss.SSSZ",displayFormat:"MM/DD/YYYY",direction:"ltr",weekLabel:"W",daysOfWeek:[Info.weekdays("short")[6],...Info.weekdays("short").slice(0,-1)],monthNames:Info.months("short"),firstDay:1},this.maxISO=DateTime.now().endOf("day").toISO(),this.ranges=TIME_RANGE_OPTIONS,this.myTimeZone=this.localizationService.getTimeZone()}ngOnInit(){this.deviceTimeZone=this.data.deviceTimeZone||null,this.timeZone=Settings.defaultZone.name,this.timeZoneSpec=this.data.timeZoneSpec||"user",this.processRange()}applyRange(range2){this.ref.close(range2)}cancel(){this.ref.close()}choosedDate(selection){this.form.setValue({from:DateTime.fromISO(selection.startDate.toISOString(),{zone:this.browserTimeZone}).setZone(this.timeZone,{keepLocalTime:!0}).toFormat("F"),to:DateTime.fromISO(selection.endDate.toISOString(),{zone:this.browserTimeZone}).setZone(this.timeZone,{keepLocalTime:!0}).toFormat("F")})}submit(){let periodSpec={from:DateTime.fromFormat(this.form.value.from,"F").toMillis(),to:DateTime.fromFormat(this.form.value.to,"F").toMillis()};this.ref.close(periodSpec)}setTimeZoneSpec(timeZoneSpec){this.timeZoneSpec=timeZoneSpec,this.timeZone=timeZoneSpec==="device"&&this.deviceTimeZone?this.deviceTimeZone:this.myTimeZone,this.processRange(),this.data.timeZoneSpecSelected?.emit({name:this.timeZone,spec:timeZoneSpec})}processRange(){let timeRange=toTimeRange(this.data.periodSpec||"yesterday");if(this.selected={startDate:(0,import_dayjs4.default)(DateTime.fromMillis(timeRange.from,{zone:this.timeZone}).setZone(this.browserTimeZone,{keepLocalTime:!0}).toMillis()),endDate:(0,import_dayjs4.default)(DateTime.fromMillis(timeRange.to,{zone:this.timeZone}).setZone(this.browserTimeZone,{keepLocalTime:!0}).toMillis())},this.form)this.form.setValue({from:DateTime.fromMillis(timeRange.from).toFormat("F"),to:DateTime.fromMillis(timeRange.to).toFormat("F")});else{let formatter=value=>DateTime.fromFormat(value,"F");this.form=this.formBuilder.group({from:[DateTime.fromMillis(timeRange.from).toFormat("F"),[Validators.required,DateTimeValidators.format(formatter),DateTimeValidators.maxDate(this.maxISO,formatter)]],to:[DateTime.fromMillis(timeRange.to).toFormat("F"),[Validators.required,DateTimeValidators.format(formatter),DateTimeValidators.maxDate(this.maxISO,formatter)]]},{validators:DateTimeValidators.fromToInverted(formatter)})}}onEscapeHandler(event2){event2.stopPropagation(),event2.preventDefault(),this.ref.close()}};_PeriodPanelComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodPanelComponent)(\u0275\u0275directiveInject(PERIOD_PANEL_DATA),\u0275\u0275directiveInject(FormBuilder),\u0275\u0275directiveInject(LocalizationService),\u0275\u0275directiveInject(PeriodPanelRef))},_PeriodPanelComponent.\u0275cmp=\u0275\u0275defineComponent({type:_PeriodPanelComponent,selectors:[["ix-period-panel"]],hostBindings:function(rf,ctx){rf&1&&\u0275\u0275listener("keydown.escape",function($event){return ctx.onEscapeHandler($event)},!1,\u0275\u0275resolveDocument)},decls:56,vars:31,consts:[["timeZoneMenu","matMenu"],["fxFlex","","translate",""],[1,"dense"],["mat-menu-item","",3,"click","ngClass"],["fxLayout","row","fxLayoutAlign","start center"],["translate",""],["mat-button","",1,"time-zone-select",3,"matMenuTriggerFor"],["fxLayout","row"],["fxFlex","",1,"picker"],[3,"choosedDate","autoApply","linkedCalendars","maxDate","locale","startDate","endDate"],["autocomplete","off",3,"ngSubmit","formGroup"],["fxlayout","row","fxLayoutGap","16px"],["fxFlex","grow"],["matInput","","formControlName","from",3,"placeholder"],["matInput","","formControlName","to",3,"placeholder"],["fxLayout","row","fxLayoutAlign","end center",1,"actions"],["type","button","mat-stroked-button","","color","primary",3,"click"],["type","submit","mat-flat-button","","color","primary",3,"disabled"],[1,"ranges"],["dense",""],[3,"click"]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-toolbar")(1,"span",1),\u0275\u0275text(2,"TIME_RANGE_SELECTION"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"mat-menu",2,0)(5,"button",3),\u0275\u0275listener("click",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.setTimeZoneSpec("user"))}),\u0275\u0275elementStart(6,"div",4)(7,"span",5),\u0275\u0275text(8,"MY_TIME_ZONE"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(9,"span"),\u0275\u0275text(10,":\xA0"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(11,"span"),\u0275\u0275text(12),\u0275\u0275elementEnd()()(),\u0275\u0275elementStart(13,"button",3),\u0275\u0275listener("click",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.setTimeZoneSpec("device"))}),\u0275\u0275elementStart(14,"div",4)(15,"span",5),\u0275\u0275text(16,"DEVICE_TIME_ZONE"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(17,"span"),\u0275\u0275text(18,":\xA0"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(19,"span"),\u0275\u0275text(20),\u0275\u0275elementEnd()()()(),\u0275\u0275template(21,PeriodPanelComponent_Conditional_21_Template,13,5,"button",6),\u0275\u0275elementEnd(),\u0275\u0275elementStart(22,"div",7)(23,"div",8)(24,"ngx-daterangepicker-material",9),\u0275\u0275listener("choosedDate",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.choosedDate($event))}),\u0275\u0275elementEnd(),\u0275\u0275elementStart(25,"form",10),\u0275\u0275listener("ngSubmit",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.submit())}),\u0275\u0275elementStart(26,"fieldset",11)(27,"mat-form-field",12)(28,"mat-label",5),\u0275\u0275text(29,"FROM__DATE"),\u0275\u0275elementEnd(),\u0275\u0275element(30,"input",13),\u0275\u0275pipe(31,"translate"),\u0275\u0275template(32,PeriodPanelComponent_Conditional_32_Template,2,0,"mat-error",5)(33,PeriodPanelComponent_Conditional_33_Template,2,0,"mat-error",5)(34,PeriodPanelComponent_Conditional_34_Template,2,0,"mat-error",5)(35,PeriodPanelComponent_Conditional_35_Template,2,0,"mat-error",5),\u0275\u0275elementEnd(),\u0275\u0275elementStart(36,"mat-form-field",12)(37,"mat-label",5),\u0275\u0275text(38,"TO__DATE"),\u0275\u0275elementEnd(),\u0275\u0275element(39,"input",14),\u0275\u0275pipe(40,"translate"),\u0275\u0275template(41,PeriodPanelComponent_Conditional_41_Template,2,0,"mat-error",5)(42,PeriodPanelComponent_Conditional_42_Template,2,0,"mat-error",5)(43,PeriodPanelComponent_Conditional_43_Template,2,0,"mat-error",5)(44,PeriodPanelComponent_Conditional_44_Template,2,0,"mat-error",5),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(45,"div",15)(46,"button",16),\u0275\u0275listener("click",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.cancel())}),\u0275\u0275elementStart(47,"span",5),\u0275\u0275text(48,"CANCEL"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(49,"button",17)(50,"span",5),\u0275\u0275text(51,"APPLY"),\u0275\u0275elementEnd()()()()(),\u0275\u0275elementStart(52,"div",18)(53,"mat-action-list",19),\u0275\u0275repeaterCreate(54,PeriodPanelComponent_For_55_Template,3,4,"mat-list-item",null,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd()()()}rf&2&&(\u0275\u0275advance(5),\u0275\u0275property("ngClass",\u0275\u0275pureFunction1(27,_c024,ctx.timeZoneSpec==="user")),\u0275\u0275advance(7),\u0275\u0275textInterpolate(ctx.myTimeZone),\u0275\u0275advance(),\u0275\u0275property("ngClass",\u0275\u0275pureFunction1(29,_c024,ctx.timeZoneSpec==="device")),\u0275\u0275advance(7),\u0275\u0275textInterpolate(ctx.deviceTimeZone),\u0275\u0275advance(),\u0275\u0275conditional(ctx.deviceTimeZone&&ctx.deviceTimeZone!==ctx.myTimeZone?21:-1),\u0275\u0275advance(3),\u0275\u0275property("autoApply",!0)("linkedCalendars",!0)("maxDate",ctx.maxISO)("locale",ctx.locale)("startDate",ctx.selected.startDate)("endDate",ctx.selected.endDate||null),\u0275\u0275advance(),\u0275\u0275property("formGroup",ctx.form),\u0275\u0275advance(5),\u0275\u0275propertyInterpolate("placeholder",\u0275\u0275pipeBind1(31,23,"FROM__DATE")),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.form.controls.from.hasError("inverted")?32:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("maxDate")?33:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("unitOutOfRange")?34:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.from.hasError("unparsable")?35:-1),\u0275\u0275advance(4),\u0275\u0275propertyInterpolate("placeholder",\u0275\u0275pipeBind1(40,25,"TO__DATE")),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.form.controls.to.hasError("inverted")?41:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("maxDate")?42:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("unitOutOfRange")?43:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx.form.controls.to.hasError("unparsable")?44:-1),\u0275\u0275advance(5),\u0275\u0275property("disabled",ctx.form.invalid),\u0275\u0275advance(5),\u0275\u0275repeater(ctx.ranges))},dependencies:[FlexModule,DefaultLayoutDirective,DefaultLayoutGapDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatButtonModule,MatButton,MatFormFieldModule,MatFormField,MatLabel,MatError,MatIconModule,MatIcon,MatInputModule,MatInput,MatListModule,MatActionList,MatListItem,MatMenuModule,MatMenu,MatMenuItem,MatMenuTrigger,MatToolbarModule,MatToolbar,NgClass,NgxDaterangepickerMd,DaterangepickerComponent,ReactiveFormsModule,\u0275NgNoValidate,DefaultValueAccessor,NgControlStatus,NgControlStatusGroup,FormGroupDirective,FormControlName,TranslateModule,TranslatePipe,TranslateDirective],styles:['@keyframes _ngcontent-%COMP%_zoom-in{0%{transform:scale(.75);opacity:.9}to{transform:scale(1);opacity:1}}[_nghost-%COMP%]{min-width:754px;max-height:514px;background-color:var(--mat-sys-surface-container);animation:_ngcontent-%COMP%_zoom-in .14s cubic-bezier(0,0,.2,1) both;border-radius:4px;box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f;transform-origin:top right}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-outline-variant)}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{--mat-toolbar-container-background-color: var(--mat-sys-surface-container)}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{--mat-toolbar-title-text-size: 14px}[_nghost-%COMP%] .time-zone-select[_ngcontent-%COMP%]{padding:0 4px 0 8px;font-size:12px;color:color-mix(in srgb,transparent,var(--mat-sys-on-surface) 67%)}[_nghost-%COMP%] .time-zone-select[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]:first-child{height:20px;width:20px;margin-right:4px;font-size:20px}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker{margin-top:0;background-color:var(--mat-sys-surface-container);box-shadow:none;border-radius:0}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker .calendar-table{background-color:var(--mat-sys-surface-container);border-color:var(--mat-sys-surface-container)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available:hover, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available:hover{background-color:var(--mat-sys-surface-container-highest)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td{transition-property:none;opacity:1}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off{color:color-mix(in srgb,transparent,currentcolor 16%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off.active:hover{background-color:#eee;border-radius:50%}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off.in-range, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off.start-date, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.off.end-date{background-color:var(--mat-sys-surface-container)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker tbody tr td{height:32px}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.month{font-weight:500;color:color-mix(in srgb,transparent,currentcolor 77%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.next, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.prev{min-width:28px}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.prev, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.prev, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.next, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.next{background-image:none}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.prev:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.prev:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.next:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.next:after{content:"";display:block;height:2em;width:2em;background-color:var(--mat-sys-on-surface);background-image:none;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:.5em;mask-size:.5em;-webkit-mask-position:center;mask-position:center}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.prev:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.prev:after{-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K);mask-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.available.next:after, [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker th.available.next:after{-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K);mask-image:url(data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMy43IDYiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDMuNyA2IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxwYXRoIGQ9Ik0zLjcsMC43TDEuNCwzbDIuMywyLjNMMyw2TDAsM2wzLTNMMy43LDAuN3oiLz4NCjwvZz4NCjwvc3ZnPg0K)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker tr.week-days th{font-size:11px;font-weight:400;color:color-mix(in srgb,transparent,currentcolor 38%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.in-range{background-color:color-mix(in srgb,transparent,var(--mat-sys-primary) 12%);color:color-mix(in srgb,transparent,currentcolor 87%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.today:not(.active,.in-range,.off){border:1px solid color-mix(in srgb,transparent,currentcolor 38%)}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off), [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off):hover{background-color:var(--mat-sys-primary);color:var(--mat-sys-on-primary);border-radius:50%;opacity:1;transition-property:border-radius}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off).start-date:not(.end-date), [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off):hover.start-date:not(.end-date){border-top-right-radius:0;border-bottom-right-radius:0}[_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off).end-date:not(.start-date), [_nghost-%COMP%] .picker[_ngcontent-%COMP%] .md-drppicker td.active:not(.off):hover.end-date:not(.start-date){border-top-left-radius:0;border-bottom-left-radius:0}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%]{border-left:1px solid var(--mat-sys-outline-variant);height:449px;width:200px;overflow-y:auto}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%]{padding:4px 0}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]{padding-top:6px;padding-bottom:6px}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]{--mdc-list-list-item-one-line-container-height: auto}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]{--mdc-list-list-item-label-text-line-height: 14px}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%]{--mdc-list-list-item-label-text-size: 12px}[_nghost-%COMP%] .ranges[_ngcontent-%COMP%] .mat-mdc-action-list[dense][_ngcontent-%COMP%] .mat-mdc-list-item[_ngcontent-%COMP%] .mdc-list-item__primary-text{white-space:normal}[_nghost-%COMP%] fieldset[_ngcontent-%COMP%]{margin:0;padding:0 16px;border:none}[_nghost-%COMP%] .actions[_ngcontent-%COMP%]{padding:12px 16px}[_nghost-%COMP%] .actions[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:8px}']});let PeriodPanelComponent2=_PeriodPanelComponent;return PeriodPanelComponent2})();var DEFAULT_CONNECTED_POSITIONS=[{originX:"end",originY:"bottom",overlayX:"end",overlayY:"top",offsetX:0,offsetY:0}],PeriodPanelService=(()=>{let _PeriodPanelService=class _PeriodPanelService{constructor(injector,overlay){this.injector=injector,this.overlay=overlay}show(origin,data,positions){let overlayRef=this.createOverlay(origin,positions),instance=new PeriodPanelRef(overlayRef);return this.attachSnackBarContainer(overlayRef,instance,data,this.getTransformOrigin(positions)),instance}getTransformOrigin(positions){if(!positions)return;let positionOriginX=positions[0].originX,originX=positionOriginX==="start"?"left":positionOriginX==="end"?"right":"center",originY=positions[0].originY;return`${originX} ${originY}`}createOverlay(origin,positions){let overlayRef=this.overlay.create(this.getOverlayConfig(origin,positions));return overlayRef.backdropClick().subscribe(()=>overlayRef.dispose()),overlayRef}createInjector(snackBarRef,data){let injectionTokens=new WeakMap;return injectionTokens.set(PeriodPanelRef,snackBarRef),injectionTokens.set(PERIOD_PANEL_DATA,data),new PortalInjector(this.injector,injectionTokens)}attachSnackBarContainer(overlayRef,snackBarRef,data,transformOrigin){let injector=this.createInjector(snackBarRef,data),containerPortal=new ComponentPortal(PeriodPanelComponent,null,injector),containerRef=overlayRef.attach(containerPortal);if(transformOrigin){let panelElement=overlayRef.overlayElement.firstElementChild;panelElement.style.transformOrigin=transformOrigin}return containerRef.instance}getOverlayConfig(origin,positions){let positionStrategy=this.overlay.position().flexibleConnectedTo(origin).withPositions(positions||DEFAULT_CONNECTED_POSITIONS);return new OverlayConfig({hasBackdrop:!0,backdropClass:"overlay-transparent-backdrop",panelClass:"ix-period-panel-container",scrollStrategy:this.overlay.scrollStrategies.noop(),positionStrategy})}};_PeriodPanelService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodPanelService)(\u0275\u0275inject(Injector),\u0275\u0275inject(Overlay))},_PeriodPanelService.\u0275prov=\u0275\u0275defineInjectable({token:_PeriodPanelService,factory:_PeriodPanelService.\u0275fac,providedIn:"root"});let PeriodPanelService2=_PeriodPanelService;return PeriodPanelService2})();function PeriodControlsComponent_Conditional_0_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",2),\u0275\u0275pipe(1,"translate"),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.handleZoomOutButtonClick())}),\u0275\u0275elementStart(2,"mat-icon"),\u0275\u0275text(3,"zoom_out"),\u0275\u0275elementEnd()()}rf&2&&\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(1,1,"ZOOM_OUT"))}var PeriodControlsComponent=(()=>{let _PeriodControlsComponent=class _PeriodControlsComponent{get gtSm(){return this.bpObserver.isMatched("(min-width: 960px)")}constructor(bpObserver,bottomSheet,periodPanel,translate){this.bpObserver=bpObserver,this.bottomSheet=bottomSheet,this.periodPanel=periodPanel,this.translate=translate,this.periodSpecSelected=new EventEmitter,this.timeZoneSpecSelected=new EventEmitter}ngOnChanges(changes){changes.periodSpecs&&(this.periodButtonLabel=this.getPeriodButtonLabel(),this.zoomOutIsVisible=this.getZoomOutIsVisible())}handleZoomOutButtonClick(){this.zoomOut()}handlePeriodButtonClick(event2){return this.gtSm?this.openPeriodPanel(event2):this.openPeriodBottomSheet()}openPeriodBottomSheet(){this.periodSpecs&&this.bottomSheet.open(PeriodBottomSheetComponent,{data:{periodSpec:this.periodSpecs.active}}).afterDismissed().subscribe(periodSpec=>{periodSpec&&(this.periodSpecs=__spreadProps(__spreadValues({},this.periodSpecs),{selected:periodSpec}),this.periodSpecSelected.emit(periodSpec))})}openPeriodPanel(event2){this.periodSpecs&&this.periodPanel.show(event2.currentTarget,{periodSpec:this.periodSpecs.active||null,deviceTimeZone:this.deviceTimeZone,timeZoneSpec:this.timeZoneSpec,timeZoneSpecSelected:this.timeZoneSpecSelected}).afterClosed().subscribe(periodSpec=>{periodSpec&&(this.periodSpecs=__spreadProps(__spreadValues({},this.periodSpecs),{selected:periodSpec}),this.periodSpecSelected.emit(periodSpec))})}getPeriodButtonLabel(){return this.periodSpecs?.active?typeof this.periodSpecs.active=="string"?this.translate.instant(getTranslateKeyForPeriod(this.periodSpecs.active),getTranslateParamsForPeriod(this.periodSpecs.active)):toStringTimeRange(this.periodSpecs.active):""}getZoomOutIsVisible(){return this.periodSpecs?!isEqual_default(this.periodSpecs.active,this.periodSpecs.selected):!1}zoomOut(){this.periodSpecSelected.emit(this.periodSpecs.selected)}enterKeyDownHandler(event2){event2.target.blur()}};_PeriodControlsComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PeriodControlsComponent)(\u0275\u0275directiveInject(BreakpointObserver),\u0275\u0275directiveInject(MatBottomSheet),\u0275\u0275directiveInject(PeriodPanelService),\u0275\u0275directiveInject(TranslateService))},_PeriodControlsComponent.\u0275cmp=\u0275\u0275defineComponent({type:_PeriodControlsComponent,selectors:[["ix-period-controls"]],inputs:{deviceTimeZone:"deviceTimeZone",periodSpecs:"periodSpecs",timeZoneSpec:"timeZoneSpec",mobile:"mobile"},outputs:{periodSpecSelected:"periodSpecSelected",timeZoneSpecSelected:"timeZoneSpecSelected"},standalone:!1,features:[\u0275\u0275NgOnChangesFeature],decls:3,vars:2,consts:[["mat-stroked-button","",1,"zoom-out-button",3,"matTooltip"],["mat-stroked-button","",3,"keydown.enter","click"],["mat-stroked-button","",1,"zoom-out-button",3,"click","matTooltip"]],template:function(rf,ctx){rf&1&&(\u0275\u0275template(0,PeriodControlsComponent_Conditional_0_Template,4,3,"button",0),\u0275\u0275elementStart(1,"button",1),\u0275\u0275listener("keydown.enter",function($event){return ctx.enterKeyDownHandler($event)})("click",function($event){return ctx.handlePeriodButtonClick($event)}),\u0275\u0275text(2),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275conditional(ctx.zoomOutIsVisible?0:-1),\u0275\u0275advance(2),\u0275\u0275textInterpolate1(" ",ctx.periodButtonLabel,`
836
836
  `))},dependencies:[MatButton,MatIcon,MatTooltip,TranslatePipe],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .zoom-out-button[_ngcontent-%COMP%]{min-width:0;padding:0 7px;margin-right:8px}[_nghost-%COMP%] .zoom-out-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]{margin:0}"],changeDetection:0});let PeriodControlsComponent3=_PeriodControlsComponent;return PeriodControlsComponent3})();var BackendComponentBrokerDirective=(()=>{let _BackendComponentBrokerDirective=class _BackendComponentBrokerDirective{constructor(){this.scopeRef=inject(ComponentGridScopeDirective,{optional:!0}),this.callerFactory=inject(BackendComponentCallerServiceFactory),this.facade=inject(BackendComponentBrokerFacade),this.clientProxy=inject(BackendComponentClientProxyService),this.destroyRef=inject(DestroyRef),this.myCompany$=this.facade.myCompany$,this.myUser$=this.facade.myUser$,this.agentOrAssetId$=new ReplaySubject(1)}set agentOrAssetId(agentOrAssetId){this.agentOrAssetId$.next(agentOrAssetId)}ngOnInit(){combineLatest([this.facade.findAgentAndAsset(this.agentOrAssetId$),this.facade.myCompany$,this.facade.myUser$]).pipe(filter(([,myCompany,myUser])=>!!myCompany&&!!myUser),takeUntilDestroyed(this.destroyRef)).subscribe(([[agent,asset],myCompany,myUser])=>{this.caller=this.callerFactory.create({agent,asset,myCompany,myUser})}),this.clientProxy.onCall(this.scopeRef?.value).pipe(mergeMap(call=>this.facade.resolveTemplateFromPageComponent(call.pageComponentId).pipe(first(),map(result=>({call:call.call,template:{publicId:result}})))),mergeMap(call=>this.caller?this.caller.call(call).pipe(map(result=>({result,call})),catchError(()=>EMPTY)):EMPTY),takeUntilDestroyed(this.destroyRef)).subscribe(({result,call})=>{this.clientProxy.emitResult({call:call.call,data:result.value},this.scopeRef?.value)})}};_BackendComponentBrokerDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BackendComponentBrokerDirective)},_BackendComponentBrokerDirective.\u0275dir=\u0275\u0275defineDirective({type:_BackendComponentBrokerDirective,selectors:[["","ixBackendComponentBroker",""]],inputs:{agentOrAssetId:"agentOrAssetId"},standalone:!1});let BackendComponentBrokerDirective3=_BackendComponentBrokerDirective;return BackendComponentBrokerDirective3})();var PagesModule=(()=>{let _PagesModule=class _PagesModule{};_PagesModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_PagesModule)},_PagesModule.\u0275mod=\u0275\u0275defineNgModule({type:_PagesModule}),_PagesModule.\u0275inj=\u0275\u0275defineInjector({providers:[ComponentContextService],imports:[SharedModule,NgxDaterangepickerMd,ComponentGridModule,ComponentPropertiesModule,FileSaveModule,PeriodBottomSheetComponent,PeriodPanelComponent,ComponentGridModule,ComponentPropertiesModule]});let PagesModule2=_PagesModule;return PagesModule2})();function mutationObservableFactory(target,options){return new Observable(subscriber=>{let observer=new MutationObserver(records=>{subscriber.next(records)});return observer.observe(target,options),function(){observer.disconnect()}})}var _c025=["*"],ButtonToggleComponent=(()=>{let _ButtonToggleComponent=class _ButtonToggleComponent{constructor(){this.elRef=inject(ElementRef),this.disabled=!1,this.valueChange=new EventEmitter}getWidth(){return this.elRef.nativeElement.clientWidth??0}getOffset(){return this.elRef.nativeElement.offsetLeft??0}select(){this.selected=!0}unselect(){this.selected=!1}};_ButtonToggleComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ButtonToggleComponent)},_ButtonToggleComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ButtonToggleComponent,selectors:[["ix-button-toggle"]],inputs:{value:"value",disabled:"disabled"},outputs:{valueChange:"valueChange"},ngContentSelectors:_c025,decls:2,vars:4,consts:[["role","tab","tabindex","0",1,"button",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275projectionDef(),\u0275\u0275elementStart(0,"div",0),\u0275\u0275listener("click",function(){return ctx.valueChange.emit(ctx.value)}),\u0275\u0275projection(1),\u0275\u0275elementEnd()),rf&2&&\u0275\u0275classProp("disabled",ctx.disabled)("selected",ctx.selected)},styles:["[_nghost-%COMP%] .button[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;padding:0 12px;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal;cursor:pointer;font-size:14px;max-width:100%;position:relative;height:34px;color:color-mix(in srgb,currentcolor 50%,transparent);transition:box-shadow .2s cubic-bezier(.4,1,.75,.9);-webkit-user-select:none;user-select:none}[_nghost-%COMP%] .button.selected[_ngcontent-%COMP%]{color:currentcolor;font-weight:500;z-index:1}[_nghost-%COMP%] .button.disabled[_ngcontent-%COMP%]{color:color-mix(in srgb,currentcolor 25%,transparent);pointer-events:none}[_nghost-%COMP%] .button[_ngcontent-%COMP%]:focus{outline:none;outline-offset:0;-moz-outline-radius:0}[_nghost-%COMP%]:hover [_ngcontent-%COMP%]:not(.selected,.disabled){border-bottom:none;color:color-mix(in srgb,currentcolor 75%,transparent);background-color:color-mix(in srgb,currentcolor 4%,transparent)!important;border-radius:12px;box-shadow:none!important;transition:all .2s cubic-bezier(.4,1,.75,.9)}"]});let ButtonToggleComponent3=_ButtonToggleComponent;return ButtonToggleComponent3})();var _c026=["*"],ButtonToggleGroupComponent=(()=>{let _ButtonToggleGroupComponent=class _ButtonToggleGroupComponent{constructor(){this.cdRef=inject(ChangeDetectorRef),this.elRef=inject(ElementRef),this.destroy=inject(DestroyRef),this.ngZone=inject(NgZone),this.indicatorStyle=null,this._animate=!1,mutationObservableFactory(this.elRef.nativeElement,{childList:!0}).pipe(takeUntilDestroyed(this.destroy)).subscribe(()=>{this.animate(),this.cdRef.markForCheck()}),resizeObservableFactory(this.elRef.nativeElement).pipe(skip(1),takeUntilDestroyed(this.destroy)).subscribe(()=>{this.animate(),this.cdRef.markForCheck()})}ngOnChanges(changes){changes.value&&!changes.value.isFirstChange()&&this.animate()}animate(){this._active=this._buttons?.find(segment=>segment.value===this.value)??null,this._active?.select(),this._buttons?.filter(s2=>s2!==this._active).forEach(s2=>s2.unselect()),this.indicatorStyle=this._active?{width:`${this._active.getWidth()}px`,transform:`translateX(${this._active.getOffset()}px)`}:null,this._active&&!this._animate&&this.ngZone.runOutsideAngular(()=>{setTimeout(()=>{this._animate=!0,this.elRef.nativeElement.classList.add("animate")},0)})}};_ButtonToggleGroupComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ButtonToggleGroupComponent)},_ButtonToggleGroupComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ButtonToggleGroupComponent,selectors:[["ix-button-toggle-group"]],contentQueries:function(rf,ctx,dirIndex){if(rf&1&&\u0275\u0275contentQuery(dirIndex,ButtonToggleComponent,4),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx._buttons=_t)}},inputs:{value:"value"},features:[\u0275\u0275NgOnChangesFeature],ngContentSelectors:_c026,decls:3,vars:2,consts:[["role","tablist",1,"button-list"],[1,"active-indicator"]],template:function(rf,ctx){rf&1&&(\u0275\u0275projectionDef(),\u0275\u0275elementStart(0,"div",0),\u0275\u0275element(1,"div",1),\u0275\u0275projection(2),\u0275\u0275elementEnd()),rf&2&&(\u0275\u0275advance(),\u0275\u0275styleMap(ctx.indicatorStyle))},styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .button-list[_ngcontent-%COMP%]{align-items:flex-end;border:none;display:flex;flex:0 0 auto;list-style:none;margin:0;padding:0;position:relative;background-color:var(--button-toggle-bg, var(--mat-sys-background));color:var(--button-toggle-color, var(--mat-sys-on-background));box-shadow:0 0 0 1px color-mix(in srgb,transparent,var(--button-toggle-color, var(--mat-sys-on-background)) 24%);border-radius:12px}[_nghost-%COMP%] .button-list[_ngcontent-%COMP%] .active-indicator[_ngcontent-%COMP%]{left:0;pointer-events:none;position:absolute;top:0;transform:translate(0);transition:height,transform,width;transition-duration:0;transition-timing-function:cubic-bezier(.4,1,.75,.9);border-radius:12px;box-shadow:0 0 0 1px var(--button-toggle-color, var(--mat-sys-on-background)),inset 0 0 0 1px var(--button-toggle-color, var(--mat-sys-on-background));height:34px;background-color:var(--button-toggle-bg, var(--mat-sys-background));z-index:1}.animate[_nghost-%COMP%] .button-list[_ngcontent-%COMP%] .active-indicator[_ngcontent-%COMP%]{transition-duration:.2s}"],changeDetection:0});let ButtonToggleGroupComponent3=_ButtonToggleGroupComponent;return ButtonToggleGroupComponent3})();var ButtonToggleModule=(()=>{let _ButtonToggleModule=class _ButtonToggleModule{};_ButtonToggleModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ButtonToggleModule)},_ButtonToggleModule.\u0275mod=\u0275\u0275defineNgModule({type:_ButtonToggleModule}),_ButtonToggleModule.\u0275inj=\u0275\u0275defineInjector({});let ButtonToggleModule2=_ButtonToggleModule;return ButtonToggleModule2})();var ReloadOnValueChangeDirective=(()=>{let _ReloadOnValueChangeDirective=class _ReloadOnValueChangeDirective{constructor(cdRef,templateRef,viewContainer){this.cdRef=cdRef,this.templateRef=templateRef,this.viewContainer=viewContainer,this.changes=new ReplaySubject,this.destroy=inject(DestroyRef)}ngOnInit(){this.viewContainer.createEmbeddedView(this.templateRef),this.changes.pipe(distinctUntilChanged(isEqual_default),takeUntilDestroyed(this.destroy)).subscribe(()=>{this.viewContainer.clear(),this.viewContainer.createEmbeddedView(this.templateRef),this.cdRef.markForCheck()})}ngOnChanges(changes){changes.value.isFirstChange()||this.changes.next(changes.value.currentValue)}ngOnDestroy(){this.changes.complete()}};_ReloadOnValueChangeDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ReloadOnValueChangeDirective)(\u0275\u0275directiveInject(ChangeDetectorRef),\u0275\u0275directiveInject(TemplateRef),\u0275\u0275directiveInject(ViewContainerRef))},_ReloadOnValueChangeDirective.\u0275dir=\u0275\u0275defineDirective({type:_ReloadOnValueChangeDirective,selectors:[["","ixReloadOnValueChange",""]],inputs:{value:[0,"ixReloadOnValueChange","value"]},standalone:!1,features:[\u0275\u0275NgOnChangesFeature]});let ReloadOnValueChangeDirective3=_ReloadOnValueChangeDirective;return ReloadOnValueChangeDirective3})();var ReloadTriggerModule=(()=>{let _ReloadTriggerModule=class _ReloadTriggerModule{};_ReloadTriggerModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ReloadTriggerModule)},_ReloadTriggerModule.\u0275mod=\u0275\u0275defineNgModule({type:_ReloadTriggerModule}),_ReloadTriggerModule.\u0275inj=\u0275\u0275defineInjector({imports:[CommonModule]});let ReloadTriggerModule2=_ReloadTriggerModule;return ReloadTriggerModule2})();var AlertDialogModule=(()=>{let _AlertDialogModule=class _AlertDialogModule{};_AlertDialogModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AlertDialogModule)},_AlertDialogModule.\u0275mod=\u0275\u0275defineNgModule({type:_AlertDialogModule}),_AlertDialogModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule]});let AlertDialogModule2=_AlertDialogModule;return AlertDialogModule2})();function getSelectedOptions(select3){return isArray_default(select3.selected)?select3.selected:select3.selected?[select3.selected]:[]}var _c027=a0=>({$implicit:a0});function SelectDialogComponent_For_12_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",9),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let option_r2=\u0275\u0275nextContext().$implicit;\u0275\u0275advance(),\u0275\u0275textInterpolate(option_r2.group==null?null:option_r2.group.label)}}function SelectDialogComponent_For_12_Conditional_4_ng_container_1_Template(rf,ctx){rf&1&&\u0275\u0275elementContainer(0)}function SelectDialogComponent_For_12_Conditional_4_Conditional_2_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"mat-icon"),\u0275\u0275text(1,"check"),\u0275\u0275elementEnd())}function SelectDialogComponent_For_12_Conditional_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span",12),\u0275\u0275template(1,SelectDialogComponent_For_12_Conditional_4_ng_container_1_Template,1,0,"ng-container",13),\u0275\u0275elementEnd(),\u0275\u0275template(2,SelectDialogComponent_For_12_Conditional_4_Conditional_2_Template,2,0,"mat-icon")),rf&2){let tmp_13_0,option_r2=\u0275\u0275nextContext().$implicit,ctx_r2=\u0275\u0275nextContext(),defaultOptionTemplate_r4=\u0275\u0275reference(15);\u0275\u0275advance(),\u0275\u0275property("ngTemplateOutlet",(tmp_13_0=ctx_r2.customOptionTemplate)!==null&&tmp_13_0!==void 0?tmp_13_0:defaultOptionTemplate_r4)("ngTemplateOutletContext",\u0275\u0275pureFunction1(3,_c027,option_r2)),\u0275\u0275advance(),\u0275\u0275conditional(option_r2.selected?2:-1)}}function SelectDialogComponent_For_12_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275template(0,SelectDialogComponent_For_12_Conditional_0_Template,2,1,"div",9),\u0275\u0275elementStart(1,"mat-list-item",10),\u0275\u0275listener("click",function(){let option_r2=\u0275\u0275restoreView(_r1).$implicit,ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.selectOption(option_r2))}),\u0275\u0275elementStart(2,"div",11,1),\u0275\u0275template(4,SelectDialogComponent_For_12_Conditional_4_Template,3,5),\u0275\u0275elementEnd()()}if(rf&2){let option_r2=ctx.$implicit,appearance_r5=\u0275\u0275reference(3),ctx_r2=\u0275\u0275nextContext();\u0275\u0275conditional(ctx_r2.isFirstGroupOcc(option_r2)?0:-1),\u0275\u0275advance(),\u0275\u0275classProp("has-group",!!option_r2.group)("is-checked",option_r2.selected),\u0275\u0275attribute("data-value",option_r2.value),\u0275\u0275advance(3),\u0275\u0275conditional(appearance_r5.appeared?4:-1)}}function SelectDialogComponent_Conditional_13_ng_container_1_Template(rf,ctx){rf&1&&\u0275\u0275elementContainer(0)}function SelectDialogComponent_Conditional_13_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"mat-divider"),\u0275\u0275template(1,SelectDialogComponent_Conditional_13_ng_container_1_Template,1,0,"ng-container",14)),rf&2){let ctx_r2=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("ngTemplateOutlet",ctx_r2.actionTemplate)}}function SelectDialogComponent_ng_template_14_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span",15),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let option_r6=ctx.$implicit;\u0275\u0275advance(),\u0275\u0275textInterpolate(option_r6.viewValue)}}function SelectDialogComponent_Conditional_16_Template(rf,ctx){if(rf&1){let _r7=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-dialog-actions",8)(1,"button",16),\u0275\u0275text(2),\u0275\u0275pipe(3,"translate"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"button",17),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r7);let ctx_r2=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r2.applySelection())}),\u0275\u0275text(5),\u0275\u0275pipe(6,"translate"),\u0275\u0275elementEnd()()}rf&2&&(\u0275\u0275advance(),\u0275\u0275property("matDialogClose",null),\u0275\u0275advance(),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(3,3,"CANCEL")),\u0275\u0275advance(3),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(6,5,"APPLY")))}var SelectDialogComponent=(()=>{let _SelectDialogComponent=class _SelectDialogComponent{constructor(){this.cdRef=inject(ChangeDetectorRef),this.elementRef=inject(ElementRef),this.dialogRef=inject(MatDialogRef),this.data=inject(MAT_DIALOG_DATA),this.searchQueryControl=new FormControl("",{nonNullable:!0}),this.filteredOptions=this.options}get actionTemplate(){return this.data.actionTemplate}get customOptionTemplate(){return this.data.optionTemplate}get multiple(){return this.data.instance.multiple}get options(){let list=this.data.instance.options.toArray(),first2=this.data.instance.options.first;return first2&&first2.value===void 0&&first2.viewValue===""&&first2.disabled?list.slice(1):list}get firstSelected(){let{selected}=this.data.instance;return isArray_default(selected)?selected[0]:selected}get label(){return this.data.instance._parentFormField?._floatingLabel?.element.textContent??""}get searchPredicate(){return this.data.searchPredicate??((option,query)=>{let q=query.toLowerCase();return option.viewValue.toLowerCase().includes(q)})}ngOnInit(){this.searchQueryControl.valueChanges.subscribe(query=>{this.filteredOptions=this.options.filter(option=>this.searchPredicate(option,query))})}ngAfterViewInit(){this.firstSelected&&this.elementRef.nativeElement.querySelector(`[data-value="${this.firstSelected.value}"]`)?.scrollIntoView?.({behavior:"instant",block:"center"})}applySelection(selected){this.dialogRef.close(selected??this.data.instance.selected)}invalidateOptions(){let selectedValues=getSelectedOptions(this.data.instance).map(option=>option.value);this.filteredOptions=this.options.filter(option=>this.searchPredicate(option,this.searchQueryControl.value)),this.cdRef.markForCheck(),selectedValues.length&&setTimeout(()=>{selectedValues.forEach(value=>{this.filteredOptions.find(opt=>opt.value===value)?.select(!0)})})}isFirstGroupOcc(option){if(option.group){let idx=this.filteredOptions.indexOf(option),prevOption=this.filteredOptions[idx-1];return!prevOption||prevOption.group?._labelId!==option.group._labelId}return!1}selectOption(option){this.multiple?option[option.selected?"deselect":"select"](!0):this.applySelection([option])}};_SelectDialogComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectDialogComponent)},_SelectDialogComponent.\u0275cmp=\u0275\u0275defineComponent({type:_SelectDialogComponent,selectors:[["ix-select-dialog"]],decls:17,vars:5,consts:[["defaultOptionTemplate",""],["appearance","ixAppear"],[1,"ix-dialog__header"],["matDialogTitle","","fxFlex",""],["mat-icon-button","",3,"matDialogClose"],[1,"search-area"],[3,"query"],["ixAppearScheduler",""],["align","end"],["mat-subheader",""],["role","option",3,"click"],["ixAppear","",1,"option-inner"],["fxFlex","",1,"option-template"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[4,"ngTemplateOutlet"],[1,"option-label"],["type","button","mat-button","",3,"matDialogClose"],["type","button","mat-button","","color","primary",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",2)(1,"mat-toolbar")(2,"h1",3),\u0275\u0275text(3),\u0275\u0275elementEnd(),\u0275\u0275elementStart(4,"button",4)(5,"mat-icon"),\u0275\u0275text(6,"close"),\u0275\u0275elementEnd()()()(),\u0275\u0275elementStart(7,"mat-dialog-content")(8,"div",5),\u0275\u0275element(9,"ix-flat-search-input",6),\u0275\u0275elementEnd(),\u0275\u0275elementStart(10,"mat-action-list",7),\u0275\u0275repeaterCreate(11,SelectDialogComponent_For_12_Template,5,7,null,null,\u0275\u0275repeaterTrackByIdentity),\u0275\u0275elementEnd(),\u0275\u0275template(13,SelectDialogComponent_Conditional_13_Template,2,1),\u0275\u0275elementEnd(),\u0275\u0275template(14,SelectDialogComponent_ng_template_14_Template,2,1,"ng-template",null,0,\u0275\u0275templateRefExtractor)(16,SelectDialogComponent_Conditional_16_Template,7,7,"mat-dialog-actions",8)),rf&2&&(\u0275\u0275advance(3),\u0275\u0275textInterpolate(ctx.label),\u0275\u0275advance(),\u0275\u0275property("matDialogClose",null),\u0275\u0275advance(5),\u0275\u0275property("query",ctx.searchQueryControl),\u0275\u0275advance(2),\u0275\u0275repeater(ctx.filteredOptions),\u0275\u0275advance(2),\u0275\u0275conditional(ctx.actionTemplate?13:-1),\u0275\u0275advance(3),\u0275\u0275conditional(ctx.multiple?16:-1))},dependencies:[NgTemplateOutlet,MatButtonModule,MatButton,MatIconButton,MatDialogModule,MatDialogClose,MatDialogTitle,MatDialogActions,MatDialogContent,MatDividerModule,MatDivider,MatIconModule,MatIcon,MatListModule,MatActionList,MatListItem,MatListSubheaderCssMatStyler,MatToolbarModule,MatToolbar,FlexModule,DefaultFlexDirective,TranslateModule,TranslatePipe,FlatSearchInputComponent,AppearDirective,AppearSchedulerDirective],styles:["[_nghost-%COMP%]{width:100dvw;height:100dvh;display:flex;flex-direction:column;flex:1}@media (min-width: 960px){[_nghost-%COMP%]{height:auto;width:auto;min-width:528px;max-width:528px}}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%]{padding:calc(env(safe-area-inset-top,0) + 16px) 24px 16px}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar{height:48px;padding-left:0;padding-right:0}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title{--mat-dialog-headline-padding: 0;color:inherit}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] .mat-toolbar .mdc-dialog__title:before{display:none}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] + .mdc-dialog__content[_ngcontent-%COMP%]{padding-top:0}[_nghost-%COMP%] .mdc-dialog__title[_ngcontent-%COMP%]:before{height:calc(env(safe-area-inset-top,0) + 40px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]{padding:20px 24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .ix-list[_ngcontent-%COMP%]{margin-left:-24px;margin-right:-24px}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;place-content:stretch flex-start;align-items:stretch;flex:1 1 auto;max-height:none;overflow:auto;-webkit-overflow-scrolling:touch}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%] > .mat-mdc-subheader[_ngcontent-%COMP%]{margin-left:0;margin-right:0}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%], [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 140px)}[_nghost-%COMP%] .ix-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions), [_nghost-%COMP%] .mdc-dialog__content[_ngcontent-%COMP%]:has(+.mdc-dialog__actions){padding-bottom:0}}@media (min-width: 960px){[_nghost-%COMP%] .ix-dialog__banner[_ngcontent-%COMP%] + .ix-dialog__content[_ngcontent-%COMP%]{max-height:calc(90dvh - 225px)}}@media (max-width: 959.9px){[_nghost-%COMP%] .mdc-dialog__actions[_ngcontent-%COMP%]{border-top:1px solid rgba(0,0,0,.12);padding-bottom:calc(16px + env(safe-area-inset-bottom,0))}}[_nghost-%COMP%] form[_ngcontent-%COMP%]{flex-direction:column;box-sizing:border-box;display:flex;flex:1 1 auto;height:inherit}[_nghost-%COMP%] form[_ngcontent-%COMP%] .mat-mdc-form-field[_ngcontent-%COMP%]{margin-bottom:1rem}[_nghost-%COMP%] .ix-dialog__header[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{overflow:hidden;text-overflow:ellipsis}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%]{padding:0}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%] .mat-mdc-action-list[_ngcontent-%COMP%] .mdc-list-group__subheader[_ngcontent-%COMP%]{margin-left:24px}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%] .mat-mdc-action-list[_ngcontent-%COMP%] .mdc-list-item[_ngcontent-%COMP%]{height:auto;min-height:48px;padding-left:24px}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%] .mat-mdc-action-list[_ngcontent-%COMP%] .mdc-list-item.has-group[_ngcontent-%COMP%]{padding-left:40px}[_nghost-%COMP%] .mat-mdc-dialog-content[_ngcontent-%COMP%] .mat-mdc-action-list[_ngcontent-%COMP%] .mdc-list-item.is-checked[_ngcontent-%COMP%] .option-template[_ngcontent-%COMP%]{max-width:calc(100% - 24px);padding-right:8px}[_nghost-%COMP%] .search-area[_ngcontent-%COMP%]{padding:12px 24px 4px}[_nghost-%COMP%] .search-area[_ngcontent-%COMP%] ix-flat-search-input[_ngcontent-%COMP%]{--ix-flat-search-input-width: 100%}[_nghost-%COMP%] .option-inner[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:flex-start;align-items:center}[_nghost-%COMP%] .option-template[_ngcontent-%COMP%]{max-width:100%;overflow:hidden}[_nghost-%COMP%] .option-label[_ngcontent-%COMP%]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}"],changeDetection:0});let SelectDialogComponent2=_SelectDialogComponent;return SelectDialogComponent2})();var SelectDialogTriggerDirective=(()=>{let _SelectDialogTriggerDirective=class _SelectDialogTriggerDirective{constructor(){this.matSelect=inject(MatSelect),this.dialog=inject(MatDialog),this.bpObserver=inject(BreakpointObserver),this._dialogRef=null}get active(){return this.bpObserver.isMatched("(max-width: 959.98px)")&&!this.matSelect.disabled}get searchQueryControl(){return this._dialogRef?.componentInstance.searchQueryControl}ngAfterViewInit(){this._ogOnContainerClick=this.matSelect.onContainerClick.bind(this.matSelect),this.matSelect.onContainerClick=()=>{if(this.active){this.matSelect.panel?.nativeElement.setAttribute("hidden","");let selectedBeforeOpen=getSelectedOptions(this.matSelect),data={instance:this.matSelect,actionTemplate:this.ixSelectDialogActionTemplate,optionTemplate:this.ixSelectDialogOptionTemplate,searchPredicate:this.ixSelectDialogSearchPredicate};this._dialogRef=this.dialog.open(SelectDialogComponent,{data,panelClass:"fullscreen"}),this._dialogRef.afterClosed().subscribe(selected=>{if(this.matSelect.multiple){let selectOpts=selected??selectedBeforeOpen;(selected?selectedBeforeOpen:getSelectedOptions(this.matSelect)).forEach(option=>{selectOpts.includes(option)||option.deselect(!0)}),selectOpts.forEach(option=>this.matSelect.options.find(opt=>opt.value===option.value)?.select(!0))}else selected?.forEach(option=>this.matSelect.options.find(opt=>opt.value===option.value)?.select(!0));this.matSelect.close(),this._dialogRef=null})}else this._ogOnContainerClick()}}ngOnDestroy(){this._dialogRef?.close(),this._dialogRef=null}invalidate(){this._dialogRef?.componentInstance.invalidateOptions()}};_SelectDialogTriggerDirective.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectDialogTriggerDirective)},_SelectDialogTriggerDirective.\u0275dir=\u0275\u0275defineDirective({type:_SelectDialogTriggerDirective,selectors:[["","ixSelectDialogTrigger",""]],inputs:{ixSelectDialogOptionTemplate:"ixSelectDialogOptionTemplate",ixSelectDialogActionTemplate:"ixSelectDialogActionTemplate",ixSelectDialogSearchPredicate:"ixSelectDialogSearchPredicate"}});let SelectDialogTriggerDirective3=_SelectDialogTriggerDirective;return SelectDialogTriggerDirective3})();var SelectDialogModule=(()=>{let _SelectDialogModule=class _SelectDialogModule{};_SelectDialogModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_SelectDialogModule)},_SelectDialogModule.\u0275mod=\u0275\u0275defineNgModule({type:_SelectDialogModule}),_SelectDialogModule.\u0275inj=\u0275\u0275defineInjector({imports:[SelectDialogComponent]});let SelectDialogModule2=_SelectDialogModule;return SelectDialogModule2})();var DeviceSelectFacade=(()=>{let _DeviceSelectFacade=class _DeviceSelectFacade{constructor(){this.appName=inject(APP_NAME),this.store=inject(Store),this.agentsDict$=this.store.select(selectEntities3),this.customPropsDict$=this.store.select(selectAll28).pipe(map(props2=>props2.reduce((dict,p)=>(p.resourceType==="Agent"||p.resourceType==="Asset")&&p.scopeType&&p.slug?this.appName==="Portal"&&p.flags?.includes("hiddenInPortal")?dict:__spreadProps(__spreadValues({},dict),{[p.resourceType+".custom."+p.scopeType+p.slug]:p}):dict,{}))),this.groupsDict$=this.store.select(selectEntities8)}};_DeviceSelectFacade.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_DeviceSelectFacade)},_DeviceSelectFacade.\u0275prov=\u0275\u0275defineInjectable({token:_DeviceSelectFacade,factory:_DeviceSelectFacade.\u0275fac,providedIn:"root"});let DeviceSelectFacade2=_DeviceSelectFacade;return DeviceSelectFacade2})();function findAgentOrAssetMatch(a,query,customPropsDict,groupsDict,agentsDict,nullifyName=!0){let q=deburr_default(query.toLowerCase().trim());if((a.name?deburr_default(a.name.toLowerCase()):null)?.includes(q))return nullifyName?null:a.name;if(a.description?.toLowerCase().includes(q))return a.description;if("serialNumber"in a&&a.serialNumber?.toLowerCase().includes(q))return a.serialNumber;let location2="location"in a?a.location?.name||(a.geoLocation?mapGeoLocationToName(a.geoLocation):null):null;if(location2?.toLowerCase().includes(q))return location2;if(groupsDict){let groups=a.memberships?.map(m=>groupsDict[m.group?.publicId]).filter(g=>!!g?.type)??[],groupName=_findBestMatch(groups.map(g=>g.name),q);if(groupName)return groupName}if(customPropsDict){let resType="agent"in a?"Asset":"Agent",customValues=Object.keys(customPropsDict).filter(key=>key.startsWith(`${resType}.`)).map(key=>(a.custom??{})[key.replace(`${resType}.custom.`,"")]).filter(val=>!isNil_default(val)).map(String),customValue=_findBestMatch(customValues,q);if(customValue)return customValue}if(agentsDict&&"agent"in a&&a.agent?.publicId){let linkedAgent=agentsDict[a.agent.publicId];if(linkedAgent)return findAgentOrAssetMatch(linkedAgent,query,customPropsDict,groupsDict,void 0,!1)}}function _findBestMatch(values,q){return values.reduce((best,value)=>{if(!value)return best;let v=deburr_default(value.toLowerCase());if(!v.includes(q))return best;let matchRatio=q.length/v.length;return!best||matchRatio>best.matchRatio?{value,matchRatio}:best},void 0)?.value}var DeviceSelectBaseComponent=(()=>{let _DeviceSelectBaseComponent=class _DeviceSelectBaseComponent{constructor(){this.facade=inject(DeviceSelectFacade),this.agentsOrAssets=input.required(),this.control=input(new FormControl("")),this.selectDialogTrigger=viewChild(SelectDialogTriggerDirective),this.agentsDict=toSignal(this.facade.agentsDict$,{requireSync:!0}),this.customPropsDict=toSignal(this.facade.customPropsDict$,{requireSync:!0}),this.groupsDict=toSignal(this.facade.groupsDict$,{requireSync:!0}),this.options=computed(()=>{let agentsDict=this.agentsDict(),customPropsDict=this.customPropsDict(),groupsDict=this.groupsDict(),query=this.query();return query?this.agentsOrAssets().reduce((options,a)=>{let match2=findAgentOrAssetMatch(a,query,customPropsDict,groupsDict,agentsDict);return match2!==void 0?[...options,{id:a.publicId,name:a.name,match:match2}]:options},[]):this.agentsOrAssets().map(a=>({id:a.publicId,name:a.name,match:null}))}),this.queryControl=new FormControl("",{nonNullable:!0}),this.query=toSignal(this.queryControl.valueChanges,{initialValue:""}),this.searchPredicate=this._optionSearchPredicate.bind(this)}_optionSearchPredicate(option,query){if(!query)return!0;let a=this.agentsOrAssets().find(opt=>opt.publicId===option.value);return!!(a&&findAgentOrAssetMatch(a,query,this.customPropsDict(),this.groupsDict(),this.agentsDict())!==void 0)}findOptionMatch(option){let query=this.selectDialogTrigger()?.searchQueryControl?.value;if(!query)return;let a=this.agentsOrAssets().find(opt=>opt.publicId===option.value);if(a)return findAgentOrAssetMatch(a,query,this.customPropsDict(),this.groupsDict(),this.agentsDict())}findSelectTriggerLabel(){return this.agentsOrAssets().find(opt=>opt.publicId===this.control().value)?.name}};_DeviceSelectBaseComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_DeviceSelectBaseComponent)},_DeviceSelectBaseComponent.\u0275dir=\u0275\u0275defineDirective({type:_DeviceSelectBaseComponent,viewQuery:function(rf,ctx){rf&1&&\u0275\u0275viewQuerySignal(ctx.selectDialogTrigger,SelectDialogTriggerDirective,5),rf&2&&\u0275\u0275queryAdvance()},inputs:{agentsOrAssets:[1,"agentsOrAssets"],control:[1,"control"]}});let DeviceSelectBaseComponent2=_DeviceSelectBaseComponent;return DeviceSelectBaseComponent2})();var _forTrack06=($index,$item)=>$item.id;function DeviceSelectButtonComponent_Conditional_1_Template(rf,ctx){if(rf&1){let _r2=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",8),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r2),\u0275\u0275nextContext();let deviceSelect_r3=\u0275\u0275reference(4);return \u0275\u0275resetView(deviceSelect_r3.onContainerClick())}),\u0275\u0275text(1),\u0275\u0275elementEnd()}if(rf&2){\u0275\u0275nextContext();let buttonLabel_r4=\u0275\u0275readContextLet(0);\u0275\u0275advance(),\u0275\u0275textInterpolate(buttonLabel_r4)}}function DeviceSelectButtonComponent_Conditional_2_Template(rf,ctx){if(rf&1){let _r5=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",9),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r5),\u0275\u0275nextContext();let deviceSelect_r3=\u0275\u0275reference(4);return \u0275\u0275resetView(deviceSelect_r3.onContainerClick())}),\u0275\u0275text(1),\u0275\u0275elementEnd()}if(rf&2){\u0275\u0275nextContext();let buttonLabel_r4=\u0275\u0275readContextLet(0);\u0275\u0275advance(),\u0275\u0275textInterpolate(buttonLabel_r4)}}function DeviceSelectButtonComponent_Conditional_11_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-option",7),\u0275\u0275text(1),\u0275\u0275pipe(2,"translate"),\u0275\u0275elementEnd()),rf&2){let tmp_6_0,noneOpt_r6=ctx;\u0275\u0275property("value",noneOpt_r6.value),\u0275\u0275advance(),\u0275\u0275textInterpolate((tmp_6_0=noneOpt_r6.label)!==null&&tmp_6_0!==void 0?tmp_6_0:\u0275\u0275pipeBind1(2,2,"NONE"))}}function DeviceSelectButtonComponent_For_13_Conditional_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"span",11),\u0275\u0275pipe(1,"highlightText")),rf&2){let option_r7=\u0275\u0275nextContext().$implicit,ctx_r7=\u0275\u0275nextContext();\u0275\u0275property("innerHTML",\u0275\u0275pipeBind2(1,1,option_r7.match,ctx_r7.query()),\u0275\u0275sanitizeHtml)}}function DeviceSelectButtonComponent_For_13_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"mat-option",7)(1,"div"),\u0275\u0275element(2,"span",10),\u0275\u0275pipe(3,"highlightText"),\u0275\u0275template(4,DeviceSelectButtonComponent_For_13_Conditional_4_Template,2,4,"span",11),\u0275\u0275elementEnd()()),rf&2){let option_r7=ctx.$implicit,ctx_r7=\u0275\u0275nextContext();\u0275\u0275property("value",option_r7.id),\u0275\u0275advance(2),\u0275\u0275property("innerHTML",\u0275\u0275pipeBind2(3,3,option_r7.name,ctx_r7.query()),\u0275\u0275sanitizeHtml),\u0275\u0275advance(2),\u0275\u0275conditional(option_r7.match?4:-1)}}function DeviceSelectButtonComponent_ng_template_14_Conditional_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275element(0,"span",11),\u0275\u0275pipe(1,"highlightText")),rf&2){let tmp_7_0,ctx_r7=\u0275\u0275nextContext(2);\u0275\u0275property("innerHTML",\u0275\u0275pipeBind2(1,1,ctx,(tmp_7_0=(tmp_7_0=ctx_r7.selectDialogTrigger())==null||tmp_7_0.searchQueryControl==null?null:tmp_7_0.searchQueryControl.value)!==null&&tmp_7_0!==void 0?tmp_7_0:""),\u0275\u0275sanitizeHtml)}}function DeviceSelectButtonComponent_ng_template_14_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",12)(1,"div"),\u0275\u0275element(2,"span",10),\u0275\u0275pipe(3,"highlightText"),\u0275\u0275template(4,DeviceSelectButtonComponent_ng_template_14_Conditional_4_Template,2,4,"span",11),\u0275\u0275elementEnd()()),rf&2){let tmp_5_0,tmp_6_0,option_r9=ctx.$implicit,ctx_r7=\u0275\u0275nextContext();\u0275\u0275advance(2),\u0275\u0275property("innerHTML",\u0275\u0275pipeBind2(3,2,option_r9.viewValue,(tmp_5_0=(tmp_5_0=ctx_r7.selectDialogTrigger())==null||tmp_5_0.searchQueryControl==null?null:tmp_5_0.searchQueryControl.value)!==null&&tmp_5_0!==void 0?tmp_5_0:""),\u0275\u0275sanitizeHtml),\u0275\u0275advance(2),\u0275\u0275conditional((tmp_6_0=ctx_r7.findOptionMatch(option_r9))?4:-1,tmp_6_0)}}var DeviceSelectButtonComponent=(()=>{let _DeviceSelectButtonComponent=class _DeviceSelectButtonComponent extends DeviceSelectBaseComponent{constructor(){super(),this.emptyLabel=input(""),this.noneOption=input(),this.selectionChange=output(),this.stroked=input(!1),this.value=input(""),effect(()=>this.control().setValue(this.value()))}handleClosed(){let publicId=this.control().value;publicId&&this.selectionChange.emit(publicId)}};_DeviceSelectButtonComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_DeviceSelectButtonComponent)},_DeviceSelectButtonComponent.\u0275cmp=\u0275\u0275defineComponent({type:_DeviceSelectButtonComponent,selectors:[["ix-device-select-button"]],inputs:{emptyLabel:[1,"emptyLabel"],noneOption:[1,"noneOption"],stroked:[1,"stroked"],value:[1,"value"]},outputs:{selectionChange:"selectionChange"},features:[\u0275\u0275InheritDefinitionFeature],decls:16,vars:14,consts:[["deviceSelect",""],["dialogOptionTemplate",""],["mat-stroked-button",""],["mat-button",""],["data-testid","device-select","disableOptionCentering","","panelClass","device-select-button-panel","name","device","ixSelectDialogTrigger","",3,"closed","formControl","ixSelectDialogOptionTemplate","ixSelectDialogSearchPredicate"],[1,"search-option"],[3,"formControl","placeholderLabel","noEntriesFoundLabel"],[3,"value"],["mat-stroked-button","",3,"click"],["mat-button","",3,"click"],[3,"innerHTML"],[1,"match",3,"innerHTML"],[1,"ix-device-dialog-option-template"]],template:function(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275declareLet(0),\u0275\u0275template(1,DeviceSelectButtonComponent_Conditional_1_Template,2,1,"button",2)(2,DeviceSelectButtonComponent_Conditional_2_Template,2,1,"button",3),\u0275\u0275elementStart(3,"mat-select",4,0),\u0275\u0275listener("closed",function(){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView(ctx.handleClosed())}),\u0275\u0275elementStart(5,"mat-select-trigger"),\u0275\u0275text(6),\u0275\u0275elementEnd(),\u0275\u0275elementStart(7,"mat-option",5),\u0275\u0275element(8,"ngx-mat-select-search",6),\u0275\u0275pipe(9,"translate"),\u0275\u0275pipe(10,"translate"),\u0275\u0275elementEnd(),\u0275\u0275template(11,DeviceSelectButtonComponent_Conditional_11_Template,3,4,"mat-option",7),\u0275\u0275repeaterCreate(12,DeviceSelectButtonComponent_For_13_Template,5,6,"mat-option",7,_forTrack06),\u0275\u0275elementEnd(),\u0275\u0275template(14,DeviceSelectButtonComponent_ng_template_14_Template,5,5,"ng-template",null,1,\u0275\u0275templateRefExtractor)}if(rf&2){let tmp_2_0,tmp_11_0,dialogOptionTemplate_r10=\u0275\u0275reference(15);\u0275\u0275storeLet((tmp_2_0=ctx.findSelectTriggerLabel())!==null&&tmp_2_0!==void 0?tmp_2_0:ctx.emptyLabel()),\u0275\u0275advance(),\u0275\u0275conditional(ctx.stroked()?1:2),\u0275\u0275advance(2),\u0275\u0275property("formControl",ctx.control())("ixSelectDialogOptionTemplate",dialogOptionTemplate_r10)("ixSelectDialogSearchPredicate",ctx.searchPredicate),\u0275\u0275advance(3),\u0275\u0275textInterpolate(ctx.findSelectTriggerLabel()),\u0275\u0275advance(2),\u0275\u0275property("formControl",ctx.queryControl)("placeholderLabel",\u0275\u0275pipeBind1(9,10,"SEARCH"))("noEntriesFoundLabel",\u0275\u0275pipeBind1(10,12,"NO_RESULTS_FOUND")),\u0275\u0275advance(3),\u0275\u0275conditional((tmp_11_0=ctx.noneOption())?11:-1,tmp_11_0),\u0275\u0275advance(),\u0275\u0275repeater(ctx.options())}},dependencies:[ReactiveFormsModule,NgControlStatus,FormControlDirective,SelectDialogModule,SelectDialogTriggerDirective,TranslateModule,TranslatePipe,MatButtonModule,MatButton,MatSelectModule,MatSelect,MatSelectTrigger,MatOption,NgxMatSelectSearchModule,MatSelectSearchComponent,HighlightTextPipe],styles:[`ix-device-select-button{display:flex;flex-direction:column;position:relative}ix-device-select-button .mat-mdc-button-base{display:block;padding-left:8px!important;padding-right:24px!important;position:relative}ix-device-select-button .mat-mdc-button-base .mdc-button__label{display:block;overflow-x:hidden;text-overflow:ellipsis}ix-device-select-button .mat-mdc-button-base .mdc-button__label:after{content:"";position:absolute;top:50%;right:8px;margin-top:-2px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid currentcolor}ix-device-select-button .mat-mdc-select{position:absolute;visibility:hidden;top:12px;left:0;font-size:14px}@media (min-width: 960px){.mat-mdc-select-panel.device-select-button-panel{min-width:400px!important;max-width:500px!important}}.mat-mdc-select-panel.device-select-button-panel .mat-mdc-option[role=option]{min-height:32px;padding-top:4px;padding-bottom:4px}.mat-mdc-select-panel.device-select-button-panel .mat-mdc-option div,.ix-device-dialog-option-template div{display:flex;flex-direction:column}.mat-mdc-select-panel.device-select-button-panel .mat-mdc-option span:has(+.match),.ix-device-dialog-option-template span:has(+.match){margin-top:6px;margin-bottom:-2px}.mat-mdc-select-panel.device-select-button-panel .mat-mdc-option .match,.ix-device-dialog-option-template .match{font-size:12px;line-height:14px;margin-bottom:8px;text-wrap:auto}
837
- `],encapsulation:2,changeDetection:0});let DeviceSelectButtonComponent2=_DeviceSelectButtonComponent;return DeviceSelectButtonComponent2})();var _c028=()=>({value:"none"}),_c110=()=>[],_c26=(a0,a1)=>({"locked-drawer":a0,"open-drawer":a1}),_c33=(a0,a1)=>({desktop:a0,mobile:a1});function BuilderComponent_Conditional_0_Conditional_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span"),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275advance(),\u0275\u0275textInterpolate1(" - ",ctx_r1.componentName,"")}}function BuilderComponent_Conditional_0_Conditional_15_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-button-toggle-group",22),\u0275\u0275listener("mousedown",function($event){return \u0275\u0275restoreView(_r3),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(1,"ix-button-toggle",23),\u0275\u0275pipe(2,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r3);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.setPreviewMode($event))}),\u0275\u0275elementStart(3,"mat-icon"),\u0275\u0275text(4,"desktop_windows"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"ix-button-toggle",24),\u0275\u0275pipe(6,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r3);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.setPreviewMode($event))}),\u0275\u0275elementStart(7,"mat-icon"),\u0275\u0275text(8,"smartphone"),\u0275\u0275elementEnd()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("value",ctx_r1.previewMode),\u0275\u0275advance(),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(2,3,"DESKTOP_VIEW")),\u0275\u0275advance(4),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(6,5,"MOBILE_VIEW"))}}function BuilderComponent_Conditional_0_Conditional_16_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-button-toggle-group",25),\u0275\u0275listener("mousedown",function($event){return \u0275\u0275restoreView(_r4),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(1,"ix-button-toggle",26),\u0275\u0275pipe(2,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r4);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.setOrientation($event))}),\u0275\u0275elementStart(3,"mat-icon"),\u0275\u0275text(4,"crop_portrait"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"ix-button-toggle",27),\u0275\u0275pipe(6,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r4);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.setOrientation($event))}),\u0275\u0275elementStart(7,"mat-icon"),\u0275\u0275text(8,"crop_landscape"),\u0275\u0275elementEnd()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("value",ctx_r1.orientation),\u0275\u0275advance(),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(2,3,"PORTRAIT_ORIENTATION")),\u0275\u0275advance(4),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(6,5,"LANDSCAPE_ORIENTATION"))}}function BuilderComponent_Conditional_0_Conditional_17_Template(rf,ctx){if(rf&1){let _r5=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",28),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.toggleMode())})("mousedown",function($event){return \u0275\u0275restoreView(_r5),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(1,"mat-icon"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"span"),\u0275\u0275text(4),\u0275\u0275pipe(5,"translate"),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r1.mode==="preview"?"edit":"visibility"),\u0275\u0275advance(2),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(5,2,ctx_r1.mode==="preview"?"EDIT":"PREVIEW"))}}function BuilderComponent_Conditional_0_Conditional_37_Conditional_0_Template(rf,ctx){if(rf&1){let _r6=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-toolbar")(1,"h1"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275element(3,"span",3),\u0275\u0275elementStart(4,"button",30),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r6);let ctx_r1=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r1.toggleDrawerLock())}),\u0275\u0275elementStart(5,"mat-icon"),\u0275\u0275text(6,"keyboard_arrow_right"),\u0275\u0275elementEnd()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r1.selectedComponentTemplate==null?null:ctx_r1.selectedComponentTemplate.name)}}function BuilderComponent_Conditional_0_Conditional_37_Conditional_2_Template(rf,ctx){if(rf&1){let _r7=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-page-component-properties",31),\u0275\u0275listener("update",function($event){\u0275\u0275restoreView(_r7);let ctx_r1=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r1.updateComponent($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275property("component",ctx_r1.selectedComponent)("template",ctx_r1.selectedComponentTemplate)}}function BuilderComponent_Conditional_0_Conditional_37_Template(rf,ctx){if(rf&1&&(\u0275\u0275template(0,BuilderComponent_Conditional_0_Conditional_37_Conditional_0_Template,7,1,"mat-toolbar"),\u0275\u0275elementStart(1,"div",17),\u0275\u0275template(2,BuilderComponent_Conditional_0_Conditional_37_Conditional_2_Template,1,2,"ix-page-component-properties",29),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275conditional(ctx_r1.selectedComponentTemplate!=null&&ctx_r1.selectedComponentTemplate.name?0:-1),\u0275\u0275advance(2),\u0275\u0275conditional(ctx_r1.selectedComponent?2:-1)}}function BuilderComponent_Conditional_0_Conditional_38_Template(rf,ctx){if(rf&1){let _r8=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",30),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r8);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.toggleDrawerLock())}),\u0275\u0275elementStart(1,"mat-icon"),\u0275\u0275text(2,"keyboard_arrow_left"),\u0275\u0275elementEnd()()}}function BuilderComponent_Conditional_0_Case_40_Template(rf,ctx){if(rf&1&&\u0275\u0275elementContainer(0,21),rf&2){\u0275\u0275nextContext();let standaloneContent_r9=\u0275\u0275reference(43);\u0275\u0275property("ngTemplateOutlet",standaloneContent_r9)}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_1_Template(rf,ctx){if(rf&1){let _r10=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-component-grid",37),\u0275\u0275listener("selectionChange",function($event){\u0275\u0275restoreView(_r10);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.handleSelectionChange($event))})("componentChanges",function($event){\u0275\u0275restoreView(_r10);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.handleComponentChanges($event))})("movingGridItem",function($event){\u0275\u0275restoreView(_r10);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.setDrawerIsOpen($event))}),\u0275\u0275elementEnd()}if(rf&2){let pageVersion_r11=\u0275\u0275nextContext(3),ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(pageVersion_r11.previewAgent==null?null:pageVersion_r11.previewAgent.publicId)||(pageVersion_r11.previewAsset==null?null:pageVersion_r11.previewAsset.publicId)||null)("mobile",ctx_r1.previewMode==="mobile")("pageVersionId",pageVersion_r11.publicId)("selectedComponentId",(ctx_r1.selectedComponent==null?null:ctx_r1.selectedComponent.publicId)||null)("ngClass",\u0275\u0275pureFunction2(6,_c33,ctx_r1.previewMode!=="mobile",ctx_r1.previewMode==="mobile"))}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_2_Template(rf,ctx){if(rf&1){let _r12=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-card-component-grid",38),\u0275\u0275listener("componentResize",function($event){\u0275\u0275restoreView(_r12);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.updateComponentSize($event))})("selectionChange",function($event){\u0275\u0275restoreView(_r12);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.handleSelectionChange($event))}),\u0275\u0275elementEnd()}if(rf&2){let tmp_7_0,tmp_9_0,pageVersion_r11=\u0275\u0275nextContext(3),ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(tmp_7_0=ctx_r1.previewAgentOrAsset==null?null:ctx_r1.previewAgentOrAsset.publicId)!==null&&tmp_7_0!==void 0?tmp_7_0:null)("pageVersionId",pageVersion_r11.publicId)("selectedComponentId",(tmp_9_0=ctx_r1.selectedComponent==null?null:ctx_r1.selectedComponent.publicId)!==null&&tmp_9_0!==void 0?tmp_9_0:null)}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_3_ix_component_grid_0_Template(rf,ctx){if(rf&1){let _r13=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-component-grid",40),\u0275\u0275listener("selectionChange",function($event){\u0275\u0275restoreView(_r13);let ctx_r1=\u0275\u0275nextContext(5);return \u0275\u0275resetView(ctx_r1.handleSelectionChange($event))})("componentChanges",function($event){\u0275\u0275restoreView(_r13);let ctx_r1=\u0275\u0275nextContext(5);return \u0275\u0275resetView(ctx_r1.handleComponentChanges($event))})("movingGridItem",function($event){\u0275\u0275restoreView(_r13);let ctx_r1=\u0275\u0275nextContext(5);return \u0275\u0275resetView(ctx_r1.setDrawerIsOpen($event))}),\u0275\u0275elementEnd()}if(rf&2){let tmp_10_0,pageVersion_r11=\u0275\u0275nextContext(4),ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(pageVersion_r11.previewAgent==null?null:pageVersion_r11.previewAgent.publicId)||(pageVersion_r11.previewAsset==null?null:pageVersion_r11.previewAsset.publicId)||null)("pageVersionId",pageVersion_r11.publicId)("selectedComponentId",(tmp_10_0=ctx_r1.selectedComponent==null?null:ctx_r1.selectedComponent.publicId)!==null&&tmp_10_0!==void 0?tmp_10_0:null)("ngClass",ctx_r1.orientation)("orientation",ctx_r1.orientation)("mobile",!1)}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_3_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_3_ix_component_grid_0_Template,1,7,"ix-component-grid",39),rf&2){let ctx_r1=\u0275\u0275nextContext(4);\u0275\u0275property("ixReloadOnValueChange",ctx_r1.orientation)}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",32),\u0275\u0275template(1,BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_1_Template,1,9,"ix-component-grid",34)(2,BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_2_Template,1,4,"ix-card-component-grid",35)(3,BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_3_Template,1,1,"ix-component-grid",36),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275property("ngClass",ctx_r1.gridClasses),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="sheet"?1:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="card"?2:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="report"?3:-1)}}function BuilderComponent_Conditional_0_Case_41_Conditional_1_Conditional_1_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",41),\u0275\u0275element(1,"ix-simple-component-grid",43),\u0275\u0275elementEnd()),rf&2){let pageVersion_r11=\u0275\u0275nextContext(3),ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(pageVersion_r11.previewAgent==null?null:pageVersion_r11.previewAgent.publicId)||(pageVersion_r11.previewAsset==null?null:pageVersion_r11.previewAsset.publicId)||null)("mobile",ctx_r1.previewMode==="mobile")("pageVersionId",pageVersion_r11.publicId)("ngClass",ctx_r1.previewMode)}}function BuilderComponent_Conditional_0_Case_41_Conditional_1_Conditional_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",42),\u0275\u0275element(1,"ix-simple-card-component-grid",44),\u0275\u0275elementEnd()),rf&2){let pageVersion_r11=\u0275\u0275nextContext(3),ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(pageVersion_r11.previewAgent==null?null:pageVersion_r11.previewAgent.publicId)||(pageVersion_r11.previewAsset==null?null:pageVersion_r11.previewAsset.publicId)||null)("pageVersionId",pageVersion_r11.publicId)}}function BuilderComponent_Conditional_0_Case_41_Conditional_1_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",33),\u0275\u0275template(1,BuilderComponent_Conditional_0_Case_41_Conditional_1_Conditional_1_Template,2,5,"div",41)(2,BuilderComponent_Conditional_0_Case_41_Conditional_1_Conditional_2_Template,2,3,"div",42),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275property("ngClass",ctx_r1.applicationType),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="sheet"?1:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="card"?2:-1)}}function BuilderComponent_Conditional_0_Case_41_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,BuilderComponent_Conditional_0_Case_41_Conditional_0_Template,4,4,"div",32)(1,BuilderComponent_Conditional_0_Case_41_Conditional_1_Template,3,3,"div",33),rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275conditional(ctx_r1.mode==="edit"?0:1)}}function BuilderComponent_Conditional_0_ng_template_42_Conditional_0_ix_component_loader_2_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",48),rf&2){let component_r15=\u0275\u0275nextContext();\u0275\u0275property("component",component_r15)}}function BuilderComponent_Conditional_0_ng_template_42_Conditional_0_Template(rf,ctx){if(rf&1){let _r14=\u0275\u0275getCurrentView();\u0275\u0275elementContainerStart(0,45),\u0275\u0275elementStart(1,"div",46),\u0275\u0275listener("click",function(){let component_r15=\u0275\u0275restoreView(_r14),ctx_r1=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r1.handleSelectionChange(component_r15.publicId))}),\u0275\u0275template(2,BuilderComponent_Conditional_0_ng_template_42_Conditional_0_ix_component_loader_2_Template,1,1,"ix-component-loader",47),\u0275\u0275elementEnd(),\u0275\u0275elementContainerEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope),\u0275\u0275advance(),\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope),\u0275\u0275advance(),\u0275\u0275property("ixReloadOnValueChange",ctx)}}function BuilderComponent_Conditional_0_ng_template_42_Template(rf,ctx){if(rf&1&&(\u0275\u0275template(0,BuilderComponent_Conditional_0_ng_template_42_Conditional_0_Template,3,3,"ng-container",45),\u0275\u0275pipe(1,"async")),rf&2){let tmp_4_0,ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275conditional((tmp_4_0=\u0275\u0275pipeBind1(1,1,ctx_r1.component$))?0:-1,tmp_4_0)}}function BuilderComponent_Conditional_0_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",1)(1,"mat-toolbar",2)(2,"h1"),\u0275\u0275text(3," Simulator "),\u0275\u0275template(4,BuilderComponent_Conditional_0_Conditional_4_Template,2,1,"span"),\u0275\u0275elementEnd(),\u0275\u0275element(5,"span",3),\u0275\u0275elementStart(6,"button",4)(7,"mat-icon"),\u0275\u0275text(8,"settings"),\u0275\u0275elementEnd()()(),\u0275\u0275elementStart(9,"mat-toolbar",5)(10,"ix-device-select-button",6),\u0275\u0275pipe(11,"translate"),\u0275\u0275pipe(12,"async"),\u0275\u0275listener("selectionChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.selectPreviewAgentOrAsset($event))})("mousedown",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementEnd(),\u0275\u0275element(13,"div",3),\u0275\u0275elementStart(14,"ix-period-controls",7),\u0275\u0275listener("periodSpecSelected",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.updateSelectedPeriodSpec($event))})("mousedown",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementEnd(),\u0275\u0275template(15,BuilderComponent_Conditional_0_Conditional_15_Template,9,7,"ix-button-toggle-group",8)(16,BuilderComponent_Conditional_0_Conditional_16_Template,9,7,"ix-button-toggle-group",9)(17,BuilderComponent_Conditional_0_Conditional_17_Template,6,4,"button",10),\u0275\u0275elementStart(18,"ix-button-toggle-group",11),\u0275\u0275listener("mousedown",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(19,"ix-button-toggle",12),\u0275\u0275pipe(20,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.setApplicationType($event))}),\u0275\u0275elementStart(21,"mat-icon"),\u0275\u0275text(22,"dashboard"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(23,"ix-button-toggle",13),\u0275\u0275pipe(24,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.setApplicationType($event))}),\u0275\u0275element(25,"mat-icon",14),\u0275\u0275elementEnd(),\u0275\u0275elementStart(26,"ix-button-toggle",15),\u0275\u0275pipe(27,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.setApplicationType($event))}),\u0275\u0275elementStart(28,"mat-icon"),\u0275\u0275text(29,"draft"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(30,"ix-button-toggle",16),\u0275\u0275pipe(31,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.setApplicationType($event))}),\u0275\u0275elementStart(32,"mat-icon"),\u0275\u0275text(33,"fit_screen"),\u0275\u0275elementEnd()()()(),\u0275\u0275elementStart(34,"div",17)(35,"mat-drawer-container")(36,"mat-drawer",18),\u0275\u0275template(37,BuilderComponent_Conditional_0_Conditional_37_Template,3,2)(38,BuilderComponent_Conditional_0_Conditional_38_Template,3,0,"button",19),\u0275\u0275elementEnd(),\u0275\u0275elementStart(39,"mat-drawer-content",20),\u0275\u0275template(40,BuilderComponent_Conditional_0_Case_40_Template,1,1,"ng-container",21)(41,BuilderComponent_Conditional_0_Case_41_Template,2,1)(42,BuilderComponent_Conditional_0_ng_template_42_Template,2,3,"ng-template",null,0,\u0275\u0275templateRefExtractor),\u0275\u0275elementEnd()()()()}if(rf&2){let tmp_7_0,tmp_8_0,tmp_22_0,ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(4),\u0275\u0275conditional(ctx_r1.componentName?4:-1),\u0275\u0275advance(6),\u0275\u0275property("emptyLabel",\u0275\u0275pipeBind1(11,20,"SELECT_DEVICE_FOR_PREVIEW"))("noneOption",\u0275\u0275pureFunction0(32,_c028))("stroked",!0)("value",(tmp_7_0=ctx_r1.previewAgentOrAsset==null?null:ctx_r1.previewAgentOrAsset.publicId)!==null&&tmp_7_0!==void 0?tmp_7_0:"")("agentsOrAssets",(tmp_8_0=\u0275\u0275pipeBind1(12,22,ctx_r1.previewAgentsOrAssets$))!==null&&tmp_8_0!==void 0?tmp_8_0:\u0275\u0275pureFunction0(33,_c110)),\u0275\u0275advance(4),\u0275\u0275property("deviceTimeZone",null)("periodSpecs",ctx_r1.periodSpecs),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="sheet"?15:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="report"?16:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="sheet"||ctx_r1.applicationType==="card"?17:-1),\u0275\u0275advance(),\u0275\u0275property("value",ctx_r1.applicationType),\u0275\u0275advance(),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(20,24,"PAGE")),\u0275\u0275advance(4),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(24,26,"CARD")),\u0275\u0275advance(3),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(27,28,"REPORT")),\u0275\u0275advance(4),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(31,30,"STANDALONE")),\u0275\u0275advance(6),\u0275\u0275property("opened",ctx_r1.selectedComponent&&ctx_r1.drawerIsOpen&&ctx_r1.mode==="edit")("ngClass",\u0275\u0275pureFunction2(34,_c26,ctx_r1.drawerLockedClose,ctx_r1.selectedComponent&&!ctx_r1.drawerLockedClose)),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.selectedComponent&&!ctx_r1.drawerLockedClose?37:38),\u0275\u0275advance(3),\u0275\u0275conditional((tmp_22_0=ctx_r1.applicationType)==="standalone"?40:41)}}var BuilderComponent=(()=>{let _BuilderComponent=class _BuilderComponent{constructor(){this.activePeriodSpec=inject(ActivePeriodSpec),this.cdRef=inject(ChangeDetectorRef),this.destroy=inject(DestroyRef),this.facade=inject(BuilderFacade),this.sessionStorage=inject(SESSION_STORAGE),this.applicationType=this.sessionStorage.getItem("application-type")||"sheet",this.orientation=this.sessionStorage.getItem("orientation")||"portrait",this.drawerLockedClose=!1,this.gridScope="simulator",this.mode=this.sessionStorage.getItem("mode")||"edit",this.previewMode=this.sessionStorage.getItem("preview-mode")||"desktop",this.drawerIsOpen=!0,this.selectedComponentId$=new BehaviorSubject(null),this.busyUpdating$=this.facade.busyUpdating$,this.component$=this.facade.getComponent(this.pageId),this.pageVersion$=this.facade.draftVersionByPageId(this.pageId),this.previewAgentsOrAssets$=this.facade.previewAgentsOrAssets$,this.previewAgentOrAsset$=this.facade.previewAgentOrAsset(this.pageVersion$)}get gridClasses(){return this.previewMode==="mobile"?["mobile"]:[]}get pageId(){return"page"}ngOnInit(){this.pageVersion$.pipe(takeUntilDestroyed(this.destroy)).subscribe(pageVersion=>{this.pageVersion=pageVersion,this.pageVersionId=pageVersion.publicId}),this.facade.selectedPeriodSpec(of(this.pageId)).pipe(takeUntilDestroyed(this.destroy)).subscribe(periodSpec=>{this.periodSpecs=__spreadProps(__spreadValues({},this.periodSpecs),{selected:periodSpec}),this.activePeriodSpec.setPeriodSpec(periodSpec,this.gridScope),this.zoomOutIsVisible=this.getZoomOutIsVisible(),this.cdRef.markForCheck()}),this.activePeriodSpec.inScopeOf(this.gridScope).pipe(takeUntilDestroyed(this.destroy)).subscribe(periodSpec=>{this.periodSpecs=__spreadProps(__spreadValues({},this.periodSpecs),{active:periodSpec}),this.zoomOutIsVisible=this.getZoomOutIsVisible(),this.cdRef.markForCheck()}),this.selectedComponentId$.pipe(distinctUntilChanged(),switchMap(id=>combineLatest([this.facade.pageComponent(id),this.facade.pageComponentTemplate(id)])),takeUntilDestroyed(this.destroy)).subscribe(([component,template])=>{this.selectedComponent=component,this.selectedComponentTemplate=template,this.cdRef.markForCheck()}),this.previewAgentOrAsset$.pipe(takeUntilDestroyed(this.destroy)).subscribe(agentOrAsset=>{this.previewAgentOrAsset=agentOrAsset,this.cdRef.markForCheck()}),this.facade.getComponentName(this.pageId).pipe(takeUntilDestroyed(this.destroy)).subscribe(name=>{this.componentName=name}),this.facade.loadAgents(),this.facade.loadAssets(),this.facade.loadCustomProperties(),this.facade.loadGroups(),this.facade.loadPageComponentTemplates(),this.facade.loadPage(this.pageId),this.facade.loadRoles(),this.destroy.onDestroy(()=>{this.facade.reset()})}handleSelectionChange(componentId){this.selectedComponentId$.next(componentId)}handleComponentChanges(components){let updates=components.reduce((acc,component)=>this.previewMode==="desktop"&&component.dimensions?.type==="sheet"?[...acc,pick_default(component,["publicId","dimensions.type","dimensions.left","dimensions.top","dimensions.rows","dimensions.cols"])]:this.previewMode==="mobile"&&component.dimensions?.type==="sheet"?[...acc,pick_default(component,["publicId","dimensions.type","dimensions.mobileCols","dimensions.mobileHeight","dimensions.mobileLeft","dimensions.mobileOrder"])]:component.dimensions?.type==="report"?[...acc,pick_default(component,["publicId","dimensions.type","dimensions.left","dimensions.top","dimensions.rows","dimensions.cols"])]:acc,[]);updates.length>0&&(updates.length===1?this.facade.updateComponent(updates[0].publicId,omit_default(updates[0],["publicId"])):this.facade.updateComponentList(updates))}updateComponent(component){this.facade.updateComponent(component.publicId,omit_default(component,["publicId"]))}updateComponentSize({componentId,height}){this.facade.updateComponent(componentId,{dimensions:{type:"card",height}})}selectPreviewAgentOrAsset(publicId){this.previewAgentOrAsset?.publicId!==publicId&&this.facade.updatePreviewAgentOrAsset(this.pageVersionId,publicId==="none"?null:publicId)}setApplicationType(newApplicationType){this.applicationType=newApplicationType,this.sessionStorage.setItem("application-type",newApplicationType),this.facade.reloadDimensions(this.pageId,newApplicationType);let mode=null,remember=!0;switch(newApplicationType){case"report":mode="edit",remember=!1;break;case"standalone":mode="preview",remember=!1;break}mode||(mode=this.sessionStorage.getItem("mode")||null),mode&&this.setMode(mode,remember)}setPreviewMode(newPreviewMode){this.previewMode=newPreviewMode,this.sessionStorage.setItem("preview-mode",newPreviewMode)}setOrientation(newOrientation){this.orientation=newOrientation,this.sessionStorage.setItem("orientation",newOrientation);let component=this.pageVersion.components?.[0];component?.dimensions?.type==="report"&&this.facade.updateComponent(component.publicId,{dimensions:__spreadProps(__spreadValues({},component.dimensions),{type:"report",left:0,top:3,cols:newOrientation==="landscape"?8:6,rows:6})})}getZoomOutIsVisible(){return this.periodSpecs?!isEqual_default(this.periodSpecs.active,this.periodSpecs.selected):!1}setMode(newMode,rememberMode=!0){this.mode=newMode,rememberMode&&this.sessionStorage.setItem("mode",newMode)}setDrawerIsOpen(gridItemIsMoving){this.drawerIsOpen=!gridItemIsMoving}toggleDrawerLock(){this.drawerLockedClose=!this.drawerLockedClose}toggleMode(){this.setMode(this.mode==="preview"?"edit":"preview")}updateSelectedPeriodSpec(periodSpec){this.facade.updateSelectedPeriodSpec(periodSpec)}};_BuilderComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BuilderComponent)},_BuilderComponent.\u0275cmp=\u0275\u0275defineComponent({type:_BuilderComponent,selectors:[["ix-builder"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(ComponentGridComponent,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.componentGrid=_t.first)}},decls:2,vars:3,consts:[["standaloneContent",""],["fxFlex","","fxLayout","column",1,"ix-surface"],["ixComponentGridFocus",""],["fxFlex",""],["mat-icon-button","","routerLink","/settings","matTooltip","Settings"],["ixComponentGridFocus","",1,"second"],[3,"selectionChange","mousedown","emptyLabel","noneOption","stroked","value","agentsOrAssets"],[3,"periodSpecSelected","mousedown","deviceTimeZone","periodSpecs"],[1,"screen-toggle-group",3,"value"],[1,"orientation-toggle-group",3,"value"],["mat-stroked-button","","type","button",1,"mode-button"],[1,"application-type-toggle-group",3,"mousedown","value"],["value","sheet",3,"valueChange","matTooltip"],["value","card",3,"valueChange","matTooltip"],["svgIcon","card_outline"],["value","report",3,"valueChange","matTooltip"],["value","standalone",3,"valueChange","matTooltip"],["fxFlex","",1,"ix-content"],["mode","over","position","end",3,"opened","ngClass"],["mat-icon-button","","disableRipple","true"],["fxLayout","column"],[3,"ngTemplateOutlet"],[1,"screen-toggle-group",3,"mousedown","value"],["value","desktop",3,"valueChange","matTooltip"],["value","mobile",3,"valueChange","matTooltip"],[1,"orientation-toggle-group",3,"mousedown","value"],["value","portrait",3,"valueChange","matTooltip"],["value","landscape",3,"valueChange","matTooltip"],["mat-stroked-button","","type","button",1,"mode-button",3,"click","mousedown"],[3,"component","template"],["mat-icon-button","","disableRipple","true",3,"click"],[3,"update","component","template"],["ixComponentGridFocus","",1,"grid-container",3,"ngClass"],[1,"preview-grid-container",3,"ngClass"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage",3,"ixComponentGridScope","agentOrAssetId","mobile","pageVersionId","selectedComponentId","ngClass"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","","ixComponentGridMode","edit","pagePageId","pagepage",3,"ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage","applicationType","report",1,"report-grid","mat-elevation-z2",3,"ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId","ngClass","orientation","mobile"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage",3,"selectionChange","componentChanges","movingGridItem","ixComponentGridScope","agentOrAssetId","mobile","pageVersionId","selectedComponentId","ngClass"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","","ixComponentGridMode","edit","pagePageId","pagepage",3,"componentResize","selectionChange","ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage","class","report-grid mat-elevation-z2","applicationType","report",3,"ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId","ngClass","orientation","mobile","selectionChange","componentChanges","movingGridItem",4,"ixReloadOnValueChange"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage","applicationType","report",1,"report-grid","mat-elevation-z2",3,"selectionChange","componentChanges","movingGridItem","ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId","ngClass","orientation","mobile"],[1,"ix-large-section","preview"],[1,"preview"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","","ixComponentGridMode","view",3,"ixComponentGridScope","agentOrAssetId","mobile","pageVersionId","ngClass"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","","ixComponentGridMode","view",3,"ixComponentGridScope","agentOrAssetId","pageVersionId"],[3,"ixComponentGridScope"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","",1,"standalone",3,"click","ixComponentGridScope"],[3,"component",4,"ixReloadOnValueChange"],[3,"component"]],template:function(rf,ctx){if(rf&1&&(\u0275\u0275template(0,BuilderComponent_Conditional_0_Template,44,37,"div",1),\u0275\u0275pipe(1,"async")),rf&2){let tmp_0_0;\u0275\u0275conditional((tmp_0_0=\u0275\u0275pipeBind1(1,1,ctx.pageVersion$))?0:-1,tmp_0_0)}},dependencies:[AlertDialogModule,AsyncPipe,ButtonToggleModule,ButtonToggleComponent,ButtonToggleGroupComponent,ComponentLoaderModule,ComponentLoaderComponent,DeviceSelectButtonComponent,FlexModule,DefaultLayoutDirective,DefaultFlexDirective,MatButtonModule,MatButton,MatIconButton,MatFormFieldModule,MatIconModule,MatIcon,MatInputModule,MatSidenavModule,MatDrawer,MatDrawerContainer,MatDrawerContent,MatToolbarModule,MatToolbar,MatTooltipModule,MatTooltip,NgClass,NgTemplateOutlet,PagesModule,ComponentGridComponent,CardComponentGridComponent,SimpleComponentGridComponent,SimpleCardComponentGridComponent,ComponentPropertiesComponent,ComponentGridModeDirective,ComponentGridScopeDirective,ComponentContextCleanupDirective,BackendComponentBrokerDirective,LoggingDataBrokerDirective,ObjectStorageBrokerDirective,ResourceDataBrokerDirective,PeriodControlsComponent,ComponentGridFocusDirective,PeriodFieldsetModule,ReloadTriggerModule,ReloadOnValueChangeDirective,RouterModule,RouterLink,TranslateModule,TranslatePipe],styles:['[_nghost-%COMP%]{height:100%;width:100%}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-surface-variant)}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{padding-right:16px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] ix-device-select-button[_ngcontent-%COMP%]{margin-right:8px;max-width:calc(100% - 340px)}[_nghost-%COMP%] .mat-toolbar.second[_ngcontent-%COMP%]{--mat-toolbar-standard-height: 56px;--mdc-outlined-button-container-height: 36px;border-bottom:1px solid var(--mat-sys-surface-variant)}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer-backdrop{display:none}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%]{height:100%;width:300px;border-left:1px solid var(--mat-sys-surface-variant)}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%] .mat-drawer-inner-container{height:100%;flex-direction:column}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%] .mat-drawer-inner-container>.mat-toolbar{height:40px!important}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%] .mat-drawer-inner-container>.mat-toolbar h1{color:var(--body-color);font-size:16px;font-weight:400}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer.locked-drawer[_ngcontent-%COMP%]{--mat-sidenav-container-elevation-shadow: 0px 8px 10px -5px rgb(0 0 0 / 20%), 0px 16px 24px 2px rgb(0 0 0 / 14%), 0px 6px 30px 5px rgb(0 0 0 / 12%);width:50px;height:40px;border-top-left-radius:25px;border-bottom-left-radius:25px;border-left:none}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%] .mat-mdc-button-focus-overlay{display:none}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%]{height:100%;overflow-x:auto;background-color:#f5f5f5}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] .grid[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{margin:0 auto;height:100%}@media (min-width: 960px){[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{max-width:970px}}@media (min-width: 1280px){[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{max-width:1200px}}@media (min-width: 1920px){[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{max-width:1600px}}@media screen and (min-width: 2251px){[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{max-width:2000px}}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid.desktop[_ngcontent-%COMP%]{min-width:970px}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid.mobile[_ngcontent-%COMP%]{max-width:480px}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%]{height:100%;width:100%;box-sizing:border-box;overflow-x:auto;display:flex;flex-direction:column;background-color:var(--detail-page-bg)}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container.card[_ngcontent-%COMP%]{place-content:center}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container.card[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%]{display:flex;place-items:center}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%] ix-simple-component-grid[_ngcontent-%COMP%]{height:100%;box-sizing:border-box;margin:0 auto}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%] ix-simple-component-grid.desktop[_ngcontent-%COMP%]{min-width:970px}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%] ix-simple-component-grid.mobile[_ngcontent-%COMP%]{max-width:480px;border-left:1px solid rgba(0,0,0,.08);border-right:1px solid rgba(0,0,0,.08)}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%] ix-simple-card-component-grid[_ngcontent-%COMP%]{width:300px;padding:0;margin:0 auto;box-sizing:border-box;background-color:var(--card-bg);color:var(--card-color);color-scheme:var(--card-color-scheme);border:var(--card-border-width) solid var(--card-border-color);border-radius:8px}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .standalone[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .standalone[_ngcontent-%COMP%] ix-component-loader[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] ix-page-properties[_ngcontent-%COMP%]{padding:20px 16px}[_nghost-%COMP%] .select-button[_ngcontent-%COMP%]{padding-left:8px;padding-right:2px;margin-right:8px}[_nghost-%COMP%] .select-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]:first-child{margin-right:6px}[_nghost-%COMP%] .screen-toggle-group[_ngcontent-%COMP%], [_nghost-%COMP%] .orientation-toggle-group[_ngcontent-%COMP%], [_nghost-%COMP%] .application-type-toggle-group[_ngcontent-%COMP%]{margin-left:12px}[_nghost-%COMP%] .mode-button[_ngcontent-%COMP%]{margin-left:12px}[_nghost-%COMP%] .mode-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]:first-child{margin-right:6px}[_nghost-%COMP%] .report-grid[_ngcontent-%COMP%]{--card-bg: #fff;--card-border-color: rgb(0 0 0 / 12%);--card-border-width: 1px;--card-color: rgb(0 0 0 / 87%);--card-color-scheme: "light";margin:16px auto!important;background:#fff;height:842pt!important;width:595pt}[_nghost-%COMP%] .report-grid.landscape[_ngcontent-%COMP%]{height:595pt!important;width:842pt}[_nghost-%COMP%] .report-grid[_ngcontent-%COMP%] .canvas gridster .gridster-row{width:calc(100% - 76px)!important}[_nghost-%COMP%] .report-grid[_ngcontent-%COMP%] .gridster-column, [_nghost-%COMP%] .report-grid[_ngcontent-%COMP%] .gridster-row{border-color:#00000014}'],changeDetection:0});let BuilderComponent2=_BuilderComponent;return BuilderComponent2})();var BuilderGuard=(()=>{let _BuilderGuard=class _BuilderGuard{constructor(store){this.store=store}canActivate(){return forkJoin([this.getMyUser(),this.getMyCompany()]).pipe(map(()=>!0),take(1))}getMyUser(){return this._loadIfAbsent(selectMyUser,loadMe2())}getMyCompany(){return this._loadIfAbsent(selectMyCompany,loadMe3())}_loadIfAbsent(selector3,action){return this.store.select(selector3).pipe(tap(entity=>{entity||this.store.dispatch(action)}),first(entity=>!!entity),map(()=>!0))}};_BuilderGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BuilderGuard)(\u0275\u0275inject(Store))},_BuilderGuard.\u0275prov=\u0275\u0275defineInjectable({token:_BuilderGuard,factory:_BuilderGuard.\u0275fac,providedIn:"root"});let BuilderGuard2=_BuilderGuard;return BuilderGuard2})();var LoginExpiredComponent=(()=>{let _LoginExpiredComponent=class _LoginExpiredComponent{constructor(document2,storage){this.document=document2,this.storage=storage}useMockData(){this.storage.forget("api-data-provider"),this.storage.forget("company"),this.reload()}reload(){this.document.location.href="/"}};_LoginExpiredComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoginExpiredComponent)(\u0275\u0275directiveInject(DOCUMENT),\u0275\u0275directiveInject(StorageService))},_LoginExpiredComponent.\u0275cmp=\u0275\u0275defineComponent({type:_LoginExpiredComponent,selectors:[["ix-login-expired"]],standalone:!1,decls:18,vars:0,consts:[["fxFlex","","fxLayout","column","fxLayoutAlign","center center",1,"ix-surface"],[1,"ix-status-card"],[1,"ix-status-card__icon"],["type","button","mat-button","","color","primary",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"mat-card",1)(2,"div",2)(3,"mat-icon"),\u0275\u0275text(4,"error"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"mat-card-header")(6,"mat-card-title"),\u0275\u0275text(7,"Login expired"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(8,"mat-card-subtitle"),\u0275\u0275text(9," Please re-authenticate via the command line "),\u0275\u0275elementStart(10,"pre"),\u0275\u0275text(11,"npx cdk login"),\u0275\u0275elementEnd(),\u0275\u0275text(12," and reload or revert to using API mock data. "),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(13,"mat-card-actions")(14,"button",3),\u0275\u0275listener("click",function(){return ctx.useMockData()}),\u0275\u0275text(15,"Use mock data"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(16,"button",3),\u0275\u0275listener("click",function(){return ctx.reload()}),\u0275\u0275text(17,"Reload"),\u0275\u0275elementEnd()()()())},dependencies:[DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatButton,MatCard,MatCardActions,MatCardHeader,MatCardSubtitle,MatCardTitle,MatIcon],styles:["[_nghost-%COMP%]{width:100%;height:100%}"],changeDetection:0});let LoginExpiredComponent3=_LoginExpiredComponent;return LoginExpiredComponent3})();var LoginExpiredCanActivateGuard=(()=>{let _LoginExpiredCanActivateGuard=class _LoginExpiredCanActivateGuard{constructor(router,storage){this.router=router,this.storage=storage}canActivate(route){return this.isAuthenticated(route)}isAuthenticated(route){return of(this.storage.has("auth")).pipe(tap(authenticated=>{if(authenticated)if(route.queryParamMap.has("next")){let next=route.queryParams.next;this.router.navigateByUrl(next).then(success=>{success||this.router.navigate(["/"])})}else this.router.navigate(["/"])}),map(authenticated=>!authenticated))}};_LoginExpiredCanActivateGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoginExpiredCanActivateGuard)(\u0275\u0275inject(Router),\u0275\u0275inject(StorageService))},_LoginExpiredCanActivateGuard.\u0275prov=\u0275\u0275defineInjectable({token:_LoginExpiredCanActivateGuard,factory:_LoginExpiredCanActivateGuard.\u0275fac,providedIn:"root"});let LoginExpiredCanActivateGuard2=_LoginExpiredCanActivateGuard;return LoginExpiredCanActivateGuard2})();var LoginExpiredModule=(()=>{let _LoginExpiredModule=class _LoginExpiredModule{};_LoginExpiredModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoginExpiredModule)},_LoginExpiredModule.\u0275mod=\u0275\u0275defineNgModule({type:_LoginExpiredModule}),_LoginExpiredModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule]});let LoginExpiredModule2=_LoginExpiredModule;return LoginExpiredModule2})();var ManifestInvalidComponent=(()=>{let _ManifestInvalidComponent=class _ManifestInvalidComponent{};_ManifestInvalidComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ManifestInvalidComponent)},_ManifestInvalidComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ManifestInvalidComponent,selectors:[["ix-manifest-invalid"]],standalone:!1,decls:13,vars:0,consts:[["fxFlex","","fxLayout","column","fxLayoutAlign","center center",1,"ix-surface"],[1,"ix-status-card"],[1,"ix-status-card__icon"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"mat-card",1)(2,"div",2)(3,"mat-icon"),\u0275\u0275text(4,"error"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"mat-card-header")(6,"mat-card-title"),\u0275\u0275text(7,"Manifest invalid"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(8,"mat-card-subtitle"),\u0275\u0275text(9," Schema validation for the "),\u0275\u0275elementStart(10,"pre"),\u0275\u0275text(11,"manifest.json"),\u0275\u0275elementEnd(),\u0275\u0275text(12," file failed. "),\u0275\u0275elementEnd()()()())},dependencies:[DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatCard,MatCardHeader,MatCardSubtitle,MatCardTitle,MatIcon],styles:["[_nghost-%COMP%]{width:100%;height:100%}"],changeDetection:0});let ManifestInvalidComponent3=_ManifestInvalidComponent;return ManifestInvalidComponent3})();var TwoFactorAuthRequiredComponent=(()=>{let _TwoFactorAuthRequiredComponent=class _TwoFactorAuthRequiredComponent{constructor(document2,storage){this.document=document2,this.storage=storage}switchCompany(){this.storage.forget("api-data-provider"),this.storage.forget("company"),this.document.location.href="/settings/general"}useMockData(){this.storage.forget("api-data-provider"),this.storage.forget("company"),this.document.location.href="/"}};_TwoFactorAuthRequiredComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TwoFactorAuthRequiredComponent)(\u0275\u0275directiveInject(DOCUMENT),\u0275\u0275directiveInject(StorageService))},_TwoFactorAuthRequiredComponent.\u0275cmp=\u0275\u0275defineComponent({type:_TwoFactorAuthRequiredComponent,selectors:[["ix-two-factor-auth-required"]],decls:13,vars:0,consts:[["fxFlex","","fxLayout","column","fxLayoutAlign","center center",1,"ix-surface"],[1,"ix-status-card"],[1,"ix-status-card__icon"],["type","button","mat-button","","color","primary",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"mat-card",1)(2,"div",2)(3,"mat-icon"),\u0275\u0275text(4,"error"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"mat-card-header")(6,"mat-card-title"),\u0275\u0275text(7,"Two-factor authentication is required"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(8,"mat-card-actions")(9,"button",3),\u0275\u0275listener("click",function(){return ctx.useMockData()}),\u0275\u0275text(10,"Use mock data"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(11,"button",3),\u0275\u0275listener("click",function(){return ctx.switchCompany()}),\u0275\u0275text(12,"Switch company"),\u0275\u0275elementEnd()()()())},dependencies:[FlexModule,DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatButtonModule,MatButton,MatCardModule,MatCard,MatCardActions,MatCardHeader,MatCardTitle,MatIconModule,MatIcon],styles:["[_nghost-%COMP%]{width:100%;height:100%}"],changeDetection:0});let TwoFactorAuthRequiredComponent2=_TwoFactorAuthRequiredComponent;return TwoFactorAuthRequiredComponent2})();var routes=[{path:"",canActivate:[AppGuard2],children:[{path:"",component:BuilderComponent,canActivate:__use_api_mocks__?[BuilderGuard]:[AuthCompanyGuard,BuilderGuard]},{path:"settings",loadChildren:()=>import("./chunk-NEXA2YSR.js").then(m=>m.SettingsModule)},...__use_api_mocks__?[]:[{path:"login",component:LoginExpiredComponent,canActivate:[LoginExpiredCanActivateGuard]},{path:"my-companies",redirectTo:"settings"},{path:"two-factor-auth-required",component:TwoFactorAuthRequiredComponent}]]},{path:"manifest-invalid",component:ManifestInvalidComponent},{path:"**",redirectTo:""}];var AppRoutingConfig={routerState:RouterState?.Minimal,serializer:CustomRouterStateSerializer};var AppRoutingModule=(()=>{let _AppRoutingModule=class _AppRoutingModule{};_AppRoutingModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppRoutingModule)},_AppRoutingModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppRoutingModule}),_AppRoutingModule.\u0275inj=\u0275\u0275defineInjector({imports:[RouterModule.forRoot(routes,{onSameUrlNavigation:"reload",preloadingStrategy:CustomPreloadingStrategy}),StoreRouterConnectingModule.forRoot(AppRoutingConfig),RouterModule]});let AppRoutingModule2=_AppRoutingModule;return AppRoutingModule2})();var PERFORM_ACTION="PERFORM_ACTION",REFRESH="REFRESH",RESET="RESET",ROLLBACK="ROLLBACK",COMMIT="COMMIT",SWEEP="SWEEP",TOGGLE_ACTION="TOGGLE_ACTION",SET_ACTIONS_ACTIVE="SET_ACTIONS_ACTIVE",JUMP_TO_STATE="JUMP_TO_STATE",JUMP_TO_ACTION="JUMP_TO_ACTION",IMPORT_STATE="IMPORT_STATE",LOCK_CHANGES="LOCK_CHANGES",PAUSE_RECORDING="PAUSE_RECORDING",PerformAction=class{constructor(action,timestamp2){if(this.action=action,this.timestamp=timestamp2,this.type=PERFORM_ACTION,typeof action.type>"u")throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?')}},Refresh=class{constructor(){this.type=REFRESH}},Reset=class{constructor(timestamp2){this.timestamp=timestamp2,this.type=RESET}},Rollback=class{constructor(timestamp2){this.timestamp=timestamp2,this.type=ROLLBACK}},Commit=class{constructor(timestamp2){this.timestamp=timestamp2,this.type=COMMIT}},Sweep=class{constructor(){this.type=SWEEP}},ToggleAction=class{constructor(id){this.id=id,this.type=TOGGLE_ACTION}};var JumpToState=class{constructor(index){this.index=index,this.type=JUMP_TO_STATE}},JumpToAction=class{constructor(actionId){this.actionId=actionId,this.type=JUMP_TO_ACTION}},ImportState=class{constructor(nextLiftedState){this.nextLiftedState=nextLiftedState,this.type=IMPORT_STATE}},LockChanges=class{constructor(status){this.status=status,this.type=LOCK_CHANGES}},PauseRecording=class{constructor(status){this.status=status,this.type=PAUSE_RECORDING}};var STORE_DEVTOOLS_CONFIG=new InjectionToken("@ngrx/store-devtools Options"),INITIAL_OPTIONS=new InjectionToken("@ngrx/store-devtools Initial Config");function noMonitor(){return null}var DEFAULT_NAME="NgRx Store DevTools";function createConfig(optionsInput){let DEFAULT_OPTIONS2={maxAge:!1,monitor:noMonitor,actionSanitizer:void 0,stateSanitizer:void 0,name:DEFAULT_NAME,serialize:!1,logOnly:!1,autoPause:!1,trace:!1,traceLimit:75,features:{pause:!0,lock:!0,persist:!0,export:!0,import:"custom",jump:!0,skip:!0,reorder:!0,dispatch:!0,test:!0},connectInZone:!1},options=typeof optionsInput=="function"?optionsInput():optionsInput,logOnly=options.logOnly?{pause:!0,export:!0,test:!0}:!1,features2=options.features||logOnly||DEFAULT_OPTIONS2.features;features2.import===!0&&(features2.import="custom");let config3=Object.assign({},DEFAULT_OPTIONS2,{features:features2},options);if(config3.maxAge&&config3.maxAge<2)throw new Error(`Devtools 'maxAge' cannot be less than 2, got ${config3.maxAge}`);return config3}function difference(first2,second){return first2.filter(item=>second.indexOf(item)<0)}function unliftState(liftedState){let{computedStates,currentStateIndex}=liftedState;if(currentStateIndex>=computedStates.length){let{state:state2}=computedStates[computedStates.length-1];return state2}let{state}=computedStates[currentStateIndex];return state}function liftAction(action){return new PerformAction(action,+Date.now())}function sanitizeActions(actionSanitizer,actions){return Object.keys(actions).reduce((sanitizedActions,actionIdx)=>{let idx=Number(actionIdx);return sanitizedActions[idx]=sanitizeAction(actionSanitizer,actions[idx],idx),sanitizedActions},{})}function sanitizeAction(actionSanitizer,action,actionIdx){return __spreadProps(__spreadValues({},action),{action:actionSanitizer(action.action,actionIdx)})}function sanitizeStates(stateSanitizer,states){return states.map((computedState,idx)=>({state:sanitizeState(stateSanitizer,computedState.state,idx),error:computedState.error}))}function sanitizeState(stateSanitizer,state,stateIdx){return stateSanitizer(state,stateIdx)}function shouldFilterActions(config3){return config3.predicate||config3.actionsSafelist||config3.actionsBlocklist}function filterLiftedState(liftedState,predicate,safelist,blocklist){let filteredStagedActionIds=[],filteredActionsById={},filteredComputedStates=[];return liftedState.stagedActionIds.forEach((id,idx)=>{let liftedAction=liftedState.actionsById[id];liftedAction&&(idx&&isActionFiltered(liftedState.computedStates[idx],liftedAction,predicate,safelist,blocklist)||(filteredActionsById[id]=liftedAction,filteredStagedActionIds.push(id),filteredComputedStates.push(liftedState.computedStates[idx])))}),__spreadProps(__spreadValues({},liftedState),{stagedActionIds:filteredStagedActionIds,actionsById:filteredActionsById,computedStates:filteredComputedStates})}function isActionFiltered(state,action,predicate,safelist,blockedlist){let predicateMatch=predicate&&!predicate(state,action.action),safelistMatch=safelist&&!action.action.type.match(safelist.map(s2=>escapeRegExp(s2)).join("|")),blocklistMatch=blockedlist&&action.action.type.match(blockedlist.map(s2=>escapeRegExp(s2)).join("|"));return predicateMatch||safelistMatch||blocklistMatch}function escapeRegExp(s2){return s2.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function injectZoneConfig(connectInZone){return{ngZone:connectInZone?inject(NgZone):null,connectInZone}}var DevtoolsDispatcher=(()=>{let _DevtoolsDispatcher=class _DevtoolsDispatcher extends ActionsSubject{};_DevtoolsDispatcher.\u0275fac=(()=>{let \u0275DevtoolsDispatcher_BaseFactory;return function(__ngFactoryType__){return(\u0275DevtoolsDispatcher_BaseFactory||(\u0275DevtoolsDispatcher_BaseFactory=\u0275\u0275getInheritedFactory(_DevtoolsDispatcher)))(__ngFactoryType__||_DevtoolsDispatcher)}})(),_DevtoolsDispatcher.\u0275prov=\u0275\u0275defineInjectable({token:_DevtoolsDispatcher,factory:_DevtoolsDispatcher.\u0275fac});let DevtoolsDispatcher2=_DevtoolsDispatcher;return DevtoolsDispatcher2})(),ExtensionActionTypes={START:"START",DISPATCH:"DISPATCH",STOP:"STOP",ACTION:"ACTION"},REDUX_DEVTOOLS_EXTENSION=new InjectionToken("@ngrx/store-devtools Redux Devtools Extension"),DevtoolsExtension=(()=>{let _DevtoolsExtension=class _DevtoolsExtension{constructor(devtoolsExtension,config3,dispatcher){this.config=config3,this.dispatcher=dispatcher,this.zoneConfig=injectZoneConfig(this.config.connectInZone),this.devtoolsExtension=devtoolsExtension,this.createActionStreams()}notify(action,state){if(this.devtoolsExtension)if(action.type===PERFORM_ACTION){if(state.isLocked||state.isPaused)return;let currentState=unliftState(state);if(shouldFilterActions(this.config)&&isActionFiltered(currentState,action,this.config.predicate,this.config.actionsSafelist,this.config.actionsBlocklist))return;let sanitizedState=this.config.stateSanitizer?sanitizeState(this.config.stateSanitizer,currentState,state.currentStateIndex):currentState,sanitizedAction=this.config.actionSanitizer?sanitizeAction(this.config.actionSanitizer,action,state.nextActionId):action;this.sendToReduxDevtools(()=>this.extensionConnection.send(sanitizedAction,sanitizedState))}else{let sanitizedLiftedState=__spreadProps(__spreadValues({},state),{stagedActionIds:state.stagedActionIds,actionsById:this.config.actionSanitizer?sanitizeActions(this.config.actionSanitizer,state.actionsById):state.actionsById,computedStates:this.config.stateSanitizer?sanitizeStates(this.config.stateSanitizer,state.computedStates):state.computedStates});this.sendToReduxDevtools(()=>this.devtoolsExtension.send(null,sanitizedLiftedState,this.getExtensionConfig(this.config)))}}createChangesObservable(){return this.devtoolsExtension?new Observable(subscriber=>{let connection=this.zoneConfig.connectInZone?this.zoneConfig.ngZone.runOutsideAngular(()=>this.devtoolsExtension.connect(this.getExtensionConfig(this.config))):this.devtoolsExtension.connect(this.getExtensionConfig(this.config));return this.extensionConnection=connection,connection.init(),connection.subscribe(change=>subscriber.next(change)),connection.unsubscribe}):EMPTY}createActionStreams(){let changes$=this.createChangesObservable().pipe(share()),start$=changes$.pipe(filter(change=>change.type===ExtensionActionTypes.START)),stop$=changes$.pipe(filter(change=>change.type===ExtensionActionTypes.STOP)),liftedActions$=changes$.pipe(filter(change=>change.type===ExtensionActionTypes.DISPATCH),map(change=>this.unwrapAction(change.payload)),concatMap(action=>action.type===IMPORT_STATE?this.dispatcher.pipe(filter(action2=>action2.type===UPDATE),timeout(1e3),debounceTime(1e3),map(()=>action),catchError(()=>of(action)),take(1)):of(action))),actionsUntilStop$=changes$.pipe(filter(change=>change.type===ExtensionActionTypes.ACTION),map(change=>this.unwrapAction(change.payload))).pipe(takeUntil(stop$)),liftedUntilStop$=liftedActions$.pipe(takeUntil(stop$));this.start$=start$.pipe(takeUntil(stop$)),this.actions$=this.start$.pipe(switchMap(()=>actionsUntilStop$)),this.liftedActions$=this.start$.pipe(switchMap(()=>liftedUntilStop$))}unwrapAction(action){return typeof action=="string"?(0,eval)(`(${action})`):action}getExtensionConfig(config3){let extensionOptions={name:config3.name,features:config3.features,serialize:config3.serialize,autoPause:config3.autoPause??!1,trace:config3.trace??!1,traceLimit:config3.traceLimit??75};return config3.maxAge!==!1&&(extensionOptions.maxAge=config3.maxAge),extensionOptions}sendToReduxDevtools(send){try{send()}catch(err){console.warn("@ngrx/store-devtools: something went wrong inside the redux devtools",err)}}};_DevtoolsExtension.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_DevtoolsExtension)(\u0275\u0275inject(REDUX_DEVTOOLS_EXTENSION),\u0275\u0275inject(STORE_DEVTOOLS_CONFIG),\u0275\u0275inject(DevtoolsDispatcher))},_DevtoolsExtension.\u0275prov=\u0275\u0275defineInjectable({token:_DevtoolsExtension,factory:_DevtoolsExtension.\u0275fac});let DevtoolsExtension2=_DevtoolsExtension;return DevtoolsExtension2})(),INIT_ACTION={type:INIT},RECOMPUTE="@ngrx/store-devtools/recompute",RECOMPUTE_ACTION={type:RECOMPUTE};function computeNextEntry(reducer48,action,state,error2,errorHandler){if(error2)return{state,error:"Interrupted by an error up the chain"};let nextState=state,nextError;try{nextState=reducer48(state,action)}catch(err){nextError=err.toString(),errorHandler.handleError(err)}return{state:nextState,error:nextError}}function recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused){if(minInvalidatedStateIndex>=computedStates.length&&computedStates.length===stagedActionIds.length)return computedStates;let nextComputedStates=computedStates.slice(0,minInvalidatedStateIndex),lastIncludedActionId=stagedActionIds.length-(isPaused?1:0);for(let i=minInvalidatedStateIndex;i<lastIncludedActionId;i++){let actionId=stagedActionIds[i],action=actionsById[actionId].action,previousEntry=nextComputedStates[i-1],previousState=previousEntry?previousEntry.state:committedState,previousError=previousEntry?previousEntry.error:void 0,entry=skippedActionIds.indexOf(actionId)>-1?previousEntry:computeNextEntry(reducer48,action,previousState,previousError,errorHandler);nextComputedStates.push(entry)}return isPaused&&nextComputedStates.push(computedStates[computedStates.length-1]),nextComputedStates}function liftInitialState(initialCommittedState,monitorReducer){return{monitorState:monitorReducer(void 0,{}),nextActionId:1,actionsById:{0:liftAction(INIT_ACTION)},stagedActionIds:[0],skippedActionIds:[],committedState:initialCommittedState,currentStateIndex:0,computedStates:[],isLocked:!1,isPaused:!1}}function liftReducerWith(initialCommittedState,initialLiftedState,errorHandler,monitorReducer,options={}){return reducer48=>(liftedState,liftedAction)=>{let{monitorState,actionsById,nextActionId,stagedActionIds,skippedActionIds,committedState,currentStateIndex,computedStates,isLocked,isPaused}=liftedState||initialLiftedState;liftedState||(actionsById=Object.create(actionsById));function commitExcessActions(n2){let excess=n2,idsToDelete=stagedActionIds.slice(1,excess+1);for(let i=0;i<idsToDelete.length;i++)if(computedStates[i+1].error){excess=i,idsToDelete=stagedActionIds.slice(1,excess+1);break}else delete actionsById[idsToDelete[i]];skippedActionIds=skippedActionIds.filter(id=>idsToDelete.indexOf(id)===-1),stagedActionIds=[0,...stagedActionIds.slice(excess+1)],committedState=computedStates[excess].state,computedStates=computedStates.slice(excess),currentStateIndex=currentStateIndex>excess?currentStateIndex-excess:0}function commitChanges(){actionsById={0:liftAction(INIT_ACTION)},nextActionId=1,stagedActionIds=[0],skippedActionIds=[],committedState=computedStates[currentStateIndex].state,currentStateIndex=0,computedStates=[]}let minInvalidatedStateIndex=0;switch(liftedAction.type){case LOCK_CHANGES:{isLocked=liftedAction.status,minInvalidatedStateIndex=1/0;break}case PAUSE_RECORDING:{isPaused=liftedAction.status,isPaused?(stagedActionIds=[...stagedActionIds,nextActionId],actionsById[nextActionId]=new PerformAction({type:"@ngrx/devtools/pause"},+Date.now()),nextActionId++,minInvalidatedStateIndex=stagedActionIds.length-1,computedStates=computedStates.concat(computedStates[computedStates.length-1]),currentStateIndex===stagedActionIds.length-2&&currentStateIndex++,minInvalidatedStateIndex=1/0):commitChanges();break}case RESET:{actionsById={0:liftAction(INIT_ACTION)},nextActionId=1,stagedActionIds=[0],skippedActionIds=[],committedState=initialCommittedState,currentStateIndex=0,computedStates=[];break}case COMMIT:{commitChanges();break}case ROLLBACK:{actionsById={0:liftAction(INIT_ACTION)},nextActionId=1,stagedActionIds=[0],skippedActionIds=[],currentStateIndex=0,computedStates=[];break}case TOGGLE_ACTION:{let{id:actionId}=liftedAction;skippedActionIds.indexOf(actionId)===-1?skippedActionIds=[actionId,...skippedActionIds]:skippedActionIds=skippedActionIds.filter(id=>id!==actionId),minInvalidatedStateIndex=stagedActionIds.indexOf(actionId);break}case SET_ACTIONS_ACTIVE:{let{start:start3,end:end2,active}=liftedAction,actionIds=[];for(let i=start3;i<end2;i++)actionIds.push(i);active?skippedActionIds=difference(skippedActionIds,actionIds):skippedActionIds=[...skippedActionIds,...actionIds],minInvalidatedStateIndex=stagedActionIds.indexOf(start3);break}case JUMP_TO_STATE:{currentStateIndex=liftedAction.index,minInvalidatedStateIndex=1/0;break}case JUMP_TO_ACTION:{let index=stagedActionIds.indexOf(liftedAction.actionId);index!==-1&&(currentStateIndex=index),minInvalidatedStateIndex=1/0;break}case SWEEP:{stagedActionIds=difference(stagedActionIds,skippedActionIds),skippedActionIds=[],currentStateIndex=Math.min(currentStateIndex,stagedActionIds.length-1);break}case PERFORM_ACTION:{if(isLocked)return liftedState||initialLiftedState;if(isPaused||liftedState&&isActionFiltered(liftedState.computedStates[currentStateIndex],liftedAction,options.predicate,options.actionsSafelist,options.actionsBlocklist)){let lastState=computedStates[computedStates.length-1];computedStates=[...computedStates.slice(0,-1),computeNextEntry(reducer48,liftedAction.action,lastState.state,lastState.error,errorHandler)],minInvalidatedStateIndex=1/0;break}options.maxAge&&stagedActionIds.length===options.maxAge&&commitExcessActions(1),currentStateIndex===stagedActionIds.length-1&&currentStateIndex++;let actionId=nextActionId++;actionsById[actionId]=liftedAction,stagedActionIds=[...stagedActionIds,actionId],minInvalidatedStateIndex=stagedActionIds.length-1;break}case IMPORT_STATE:{({monitorState,actionsById,nextActionId,stagedActionIds,skippedActionIds,committedState,currentStateIndex,computedStates,isLocked,isPaused}=liftedAction.nextLiftedState);break}case INIT:{minInvalidatedStateIndex=0,options.maxAge&&stagedActionIds.length>options.maxAge&&(computedStates=recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused),commitExcessActions(stagedActionIds.length-options.maxAge),minInvalidatedStateIndex=1/0);break}case UPDATE:{if(computedStates.filter(state=>state.error).length>0)minInvalidatedStateIndex=0,options.maxAge&&stagedActionIds.length>options.maxAge&&(computedStates=recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused),commitExcessActions(stagedActionIds.length-options.maxAge),minInvalidatedStateIndex=1/0);else{if(!isPaused&&!isLocked){currentStateIndex===stagedActionIds.length-1&&currentStateIndex++;let actionId=nextActionId++;actionsById[actionId]=new PerformAction(liftedAction,+Date.now()),stagedActionIds=[...stagedActionIds,actionId],minInvalidatedStateIndex=stagedActionIds.length-1,computedStates=recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused)}computedStates=computedStates.map(cmp=>__spreadProps(__spreadValues({},cmp),{state:reducer48(cmp.state,RECOMPUTE_ACTION)})),currentStateIndex=stagedActionIds.length-1,options.maxAge&&stagedActionIds.length>options.maxAge&&commitExcessActions(stagedActionIds.length-options.maxAge),minInvalidatedStateIndex=1/0}break}default:{minInvalidatedStateIndex=1/0;break}}return computedStates=recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused),monitorState=monitorReducer(monitorState,liftedAction),{monitorState,actionsById,nextActionId,stagedActionIds,skippedActionIds,committedState,currentStateIndex,computedStates,isLocked,isPaused}}}var StoreDevtools=(()=>{let _StoreDevtools=class _StoreDevtools{constructor(dispatcher,actions$,reducers$,extension,scannedActions,errorHandler,initialState54,config3){let liftedInitialState=liftInitialState(initialState54,config3.monitor),liftReducer=liftReducerWith(initialState54,liftedInitialState,errorHandler,config3.monitor,config3),liftedAction$=merge(merge(actions$.asObservable().pipe(skip(1)),extension.actions$).pipe(map(liftAction)),dispatcher,extension.liftedActions$).pipe(observeOn(queueScheduler)),liftedReducer$=reducers$.pipe(map(liftReducer)),zoneConfig=injectZoneConfig(config3.connectInZone),liftedStateSubject=new ReplaySubject(1);this.liftedStateSubscription=liftedAction$.pipe(withLatestFrom(liftedReducer$),emitInZone(zoneConfig),scan(({state:liftedState},[action,reducer48])=>{let reducedLiftedState=reducer48(liftedState,action);return action.type!==PERFORM_ACTION&&shouldFilterActions(config3)&&(reducedLiftedState=filterLiftedState(reducedLiftedState,config3.predicate,config3.actionsSafelist,config3.actionsBlocklist)),extension.notify(action,reducedLiftedState),{state:reducedLiftedState,action}},{state:liftedInitialState,action:null})).subscribe(({state,action})=>{if(liftedStateSubject.next(state),action.type===PERFORM_ACTION){let unliftedAction=action.action;scannedActions.next(unliftedAction)}}),this.extensionStartSubscription=extension.start$.pipe(emitInZone(zoneConfig)).subscribe(()=>{this.refresh()});let liftedState$=liftedStateSubject.asObservable(),state$=liftedState$.pipe(map(unliftState));Object.defineProperty(state$,"state",{value:toSignal(state$,{manualCleanup:!0,requireSync:!0})}),this.dispatcher=dispatcher,this.liftedState=liftedState$,this.state=state$}ngOnDestroy(){this.liftedStateSubscription.unsubscribe(),this.extensionStartSubscription.unsubscribe()}dispatch(action){this.dispatcher.next(action)}next(action){this.dispatcher.next(action)}error(error2){}complete(){}performAction(action){this.dispatch(new PerformAction(action,+Date.now()))}refresh(){this.dispatch(new Refresh)}reset(){this.dispatch(new Reset(+Date.now()))}rollback(){this.dispatch(new Rollback(+Date.now()))}commit(){this.dispatch(new Commit(+Date.now()))}sweep(){this.dispatch(new Sweep)}toggleAction(id){this.dispatch(new ToggleAction(id))}jumpToAction(actionId){this.dispatch(new JumpToAction(actionId))}jumpToState(index){this.dispatch(new JumpToState(index))}importState(nextLiftedState){this.dispatch(new ImportState(nextLiftedState))}lockChanges(status){this.dispatch(new LockChanges(status))}pauseRecording(status){this.dispatch(new PauseRecording(status))}};_StoreDevtools.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_StoreDevtools)(\u0275\u0275inject(DevtoolsDispatcher),\u0275\u0275inject(ActionsSubject),\u0275\u0275inject(ReducerObservable),\u0275\u0275inject(DevtoolsExtension),\u0275\u0275inject(ScannedActionsSubject),\u0275\u0275inject(ErrorHandler),\u0275\u0275inject(INITIAL_STATE),\u0275\u0275inject(STORE_DEVTOOLS_CONFIG))},_StoreDevtools.\u0275prov=\u0275\u0275defineInjectable({token:_StoreDevtools,factory:_StoreDevtools.\u0275fac});let StoreDevtools2=_StoreDevtools;return StoreDevtools2})();function emitInZone({ngZone,connectInZone}){return source=>connectInZone?new Observable(subscriber=>source.subscribe({next:value=>ngZone.run(()=>subscriber.next(value)),error:error2=>ngZone.run(()=>subscriber.error(error2)),complete:()=>ngZone.run(()=>subscriber.complete())})):source}var IS_EXTENSION_OR_MONITOR_PRESENT=new InjectionToken("@ngrx/store-devtools Is Devtools Extension or Monitor Present");function createIsExtensionOrMonitorPresent(extension,config3){return!!extension||config3.monitor!==noMonitor}function createReduxDevtoolsExtension(){let extensionKey="__REDUX_DEVTOOLS_EXTENSION__";return typeof window=="object"&&typeof window[extensionKey]<"u"?window[extensionKey]:null}function createStateObservable(devtools){return devtools.state}function provideStoreDevtools(options={}){return makeEnvironmentProviders([DevtoolsExtension,DevtoolsDispatcher,StoreDevtools,{provide:INITIAL_OPTIONS,useValue:options},{provide:IS_EXTENSION_OR_MONITOR_PRESENT,deps:[REDUX_DEVTOOLS_EXTENSION,STORE_DEVTOOLS_CONFIG],useFactory:createIsExtensionOrMonitorPresent},{provide:REDUX_DEVTOOLS_EXTENSION,useFactory:createReduxDevtoolsExtension},{provide:STORE_DEVTOOLS_CONFIG,deps:[INITIAL_OPTIONS],useFactory:createConfig},{provide:StateObservable,deps:[StoreDevtools],useFactory:createStateObservable},{provide:ReducerManagerDispatcher,useExisting:DevtoolsDispatcher}])}var StoreDevtoolsModule=(()=>{let _StoreDevtoolsModule=class _StoreDevtoolsModule{static instrument(options={}){return{ngModule:_StoreDevtoolsModule,providers:[provideStoreDevtools(options)]}}};_StoreDevtoolsModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_StoreDevtoolsModule)},_StoreDevtoolsModule.\u0275mod=\u0275\u0275defineNgModule({type:_StoreDevtoolsModule}),_StoreDevtoolsModule.\u0275inj=\u0275\u0275defineInjector({});let StoreDevtoolsModule2=_StoreDevtoolsModule;return StoreDevtoolsModule2})();var GLOBAL_OBJ=globalThis;var DEBUG_BUILD=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var SDK_VERSION="9.12.0";function getMainCarrier(){return getSentryCarrier(GLOBAL_OBJ),GLOBAL_OBJ}function getSentryCarrier(carrier){let __SENTRY__=carrier.__SENTRY__=carrier.__SENTRY__||{};return __SENTRY__.version=__SENTRY__.version||SDK_VERSION,__SENTRY__[SDK_VERSION]=__SENTRY__[SDK_VERSION]||{}}function getGlobalSingleton(name,creator,obj=GLOBAL_OBJ){let __SENTRY__=obj.__SENTRY__=obj.__SENTRY__||{},carrier=__SENTRY__[SDK_VERSION]=__SENTRY__[SDK_VERSION]||{};return carrier[name]||(carrier[name]=creator())}var PREFIX="Sentry Logger ",CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],originalConsoleMethods={};function consoleSandbox(callback){if(!("console"in GLOBAL_OBJ))return callback();let console2=GLOBAL_OBJ.console,wrappedFuncs={},wrappedLevels=Object.keys(originalConsoleMethods);wrappedLevels.forEach(level=>{let originalConsoleMethod=originalConsoleMethods[level];wrappedFuncs[level]=console2[level],console2[level]=originalConsoleMethod});try{return callback()}finally{wrappedLevels.forEach(level=>{console2[level]=wrappedFuncs[level]})}}function makeLogger(){let enabled=!1,logger2={enable:()=>{enabled=!0},disable:()=>{enabled=!1},isEnabled:()=>enabled};return DEBUG_BUILD?CONSOLE_LEVELS.forEach(name=>{logger2[name]=(...args)=>{enabled&&consoleSandbox(()=>{GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`,...args)})}}):CONSOLE_LEVELS.forEach(name=>{logger2[name]=()=>{}}),logger2}var logger=getGlobalSingleton("logger",makeLogger);var ONE_SECOND_IN_MS=1e3;function dateTimestampInSeconds(){return Date.now()/ONE_SECOND_IN_MS}function createUnixTimestampInSecondsFunc(){let{performance:performance2}=GLOBAL_OBJ;if(!performance2?.now)return dateTimestampInSeconds;let approxStartingTimeOrigin=Date.now()-performance2.now(),timeOrigin=performance2.timeOrigin==null?approxStartingTimeOrigin:performance2.timeOrigin;return()=>(timeOrigin+performance2.now())/ONE_SECOND_IN_MS}var timestampInSeconds=createUnixTimestampInSecondsFunc();var objectToString=Object.prototype.toString;function isBuiltin(wat,className){return objectToString.call(wat)===`[object ${className}]`}function isPlainObject(wat){return isBuiltin(wat,"Object")}function isThenable(wat){return!!(wat?.then&&typeof wat.then=="function")}function truncate(str,max2=0){return typeof str!="string"||max2===0||str.length<=max2?str:`${str.slice(0,max2)}...`}function addNonEnumerableProperty(obj,name,value){try{Object.defineProperty(obj,name,{value,writable:!0,configurable:!0})}catch{DEBUG_BUILD&&logger.log(`Failed to add non-enumerable property "${name}" to object`,obj)}}function getCrypto(){let gbl=GLOBAL_OBJ;return gbl.crypto||gbl.msCrypto}function uuid4(crypto2=getCrypto()){let getRandomByte=()=>Math.random()*16;try{if(crypto2?.randomUUID)return crypto2.randomUUID().replace(/-/g,"");crypto2?.getRandomValues&&(getRandomByte=()=>{let typedArray=new Uint8Array(1);return crypto2.getRandomValues(typedArray),typedArray[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,c=>(c^(getRandomByte()&15)>>c/4).toString(16))}function updateSession(session,context3={}){if(context3.user&&(!session.ipAddress&&context3.user.ip_address&&(session.ipAddress=context3.user.ip_address),!session.did&&!context3.did&&(session.did=context3.user.id||context3.user.email||context3.user.username)),session.timestamp=context3.timestamp||timestampInSeconds(),context3.abnormal_mechanism&&(session.abnormal_mechanism=context3.abnormal_mechanism),context3.ignoreDuration&&(session.ignoreDuration=context3.ignoreDuration),context3.sid&&(session.sid=context3.sid.length===32?context3.sid:uuid4()),context3.init!==void 0&&(session.init=context3.init),!session.did&&context3.did&&(session.did=`${context3.did}`),typeof context3.started=="number"&&(session.started=context3.started),session.ignoreDuration)session.duration=void 0;else if(typeof context3.duration=="number")session.duration=context3.duration;else{let duration=session.timestamp-session.started;session.duration=duration>=0?duration:0}context3.release&&(session.release=context3.release),context3.environment&&(session.environment=context3.environment),!session.ipAddress&&context3.ipAddress&&(session.ipAddress=context3.ipAddress),!session.userAgent&&context3.userAgent&&(session.userAgent=context3.userAgent),typeof context3.errors=="number"&&(session.errors=context3.errors),context3.status&&(session.status=context3.status)}function generateTraceId(){return uuid4()}function merge3(initialObj,mergeObj,levels=2){if(!mergeObj||typeof mergeObj!="object"||levels<=0)return mergeObj;if(initialObj&&Object.keys(mergeObj).length===0)return initialObj;let output2=__spreadValues({},initialObj);for(let key in mergeObj)Object.prototype.hasOwnProperty.call(mergeObj,key)&&(output2[key]=merge3(output2[key],mergeObj[key],levels-1));return output2}var SCOPE_SPAN_FIELD="_sentrySpan";function _setSpanForScope(scope,span){span?addNonEnumerableProperty(scope,SCOPE_SPAN_FIELD,span):delete scope[SCOPE_SPAN_FIELD]}function _getSpanForScope(scope){return scope[SCOPE_SPAN_FIELD]}var DEFAULT_MAX_BREADCRUMBS=100,Scope=class _Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:generateTraceId(),sampleRand:Math.random()}}clone(){let newScope=new _Scope;return newScope._breadcrumbs=[...this._breadcrumbs],newScope._tags=__spreadValues({},this._tags),newScope._extra=__spreadValues({},this._extra),newScope._contexts=__spreadValues({},this._contexts),this._contexts.flags&&(newScope._contexts.flags={values:[...this._contexts.flags.values]}),newScope._user=this._user,newScope._level=this._level,newScope._session=this._session,newScope._transactionName=this._transactionName,newScope._fingerprint=this._fingerprint,newScope._eventProcessors=[...this._eventProcessors],newScope._attachments=[...this._attachments],newScope._sdkProcessingMetadata=__spreadValues({},this._sdkProcessingMetadata),newScope._propagationContext=__spreadValues({},this._propagationContext),newScope._client=this._client,newScope._lastEventId=this._lastEventId,_setSpanForScope(newScope,_getSpanForScope(this)),newScope}setClient(client){this._client=client}setLastEventId(lastEventId2){this._lastEventId=lastEventId2}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(callback){this._scopeListeners.push(callback)}addEventProcessor(callback){return this._eventProcessors.push(callback),this}setUser(user){return this._user=user||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession(this._session,{user}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(tags){return this._tags=__spreadValues(__spreadValues({},this._tags),tags),this._notifyScopeListeners(),this}setTag(key,value){return this._tags=__spreadProps(__spreadValues({},this._tags),{[key]:value}),this._notifyScopeListeners(),this}setExtras(extras){return this._extra=__spreadValues(__spreadValues({},this._extra),extras),this._notifyScopeListeners(),this}setExtra(key,extra){return this._extra=__spreadProps(__spreadValues({},this._extra),{[key]:extra}),this._notifyScopeListeners(),this}setFingerprint(fingerprint){return this._fingerprint=fingerprint,this._notifyScopeListeners(),this}setLevel(level){return this._level=level,this._notifyScopeListeners(),this}setTransactionName(name){return this._transactionName=name,this._notifyScopeListeners(),this}setContext(key,context3){return context3===null?delete this._contexts[key]:this._contexts[key]=context3,this._notifyScopeListeners(),this}setSession(session){return session?this._session=session:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(captureContext){if(!captureContext)return this;let scopeToMerge=typeof captureContext=="function"?captureContext(this):captureContext,scopeInstance=scopeToMerge instanceof _Scope?scopeToMerge.getScopeData():isPlainObject(scopeToMerge)?captureContext:void 0,{tags,extra,user,contexts,level,fingerprint=[],propagationContext}=scopeInstance||{};return this._tags=__spreadValues(__spreadValues({},this._tags),tags),this._extra=__spreadValues(__spreadValues({},this._extra),extra),this._contexts=__spreadValues(__spreadValues({},this._contexts),contexts),user&&Object.keys(user).length&&(this._user=user),level&&(this._level=level),fingerprint.length&&(this._fingerprint=fingerprint),propagationContext&&(this._propagationContext=propagationContext),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,_setSpanForScope(this,void 0),this._attachments=[],this.setPropagationContext({traceId:generateTraceId(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(breadcrumb,maxBreadcrumbs){let maxCrumbs=typeof maxBreadcrumbs=="number"?maxBreadcrumbs:DEFAULT_MAX_BREADCRUMBS;if(maxCrumbs<=0)return this;let mergedBreadcrumb=__spreadProps(__spreadValues({timestamp:dateTimestampInSeconds()},breadcrumb),{message:breadcrumb.message?truncate(breadcrumb.message,2048):breadcrumb.message});return this._breadcrumbs.push(mergedBreadcrumb),this._breadcrumbs.length>maxCrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(-maxCrumbs),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(attachment){return this._attachments.push(attachment),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope(this)}}setSDKProcessingMetadata(newData){return this._sdkProcessingMetadata=merge3(this._sdkProcessingMetadata,newData,2),this}setPropagationContext(context3){return this._propagationContext=context3,this}getPropagationContext(){return this._propagationContext}captureException(exception,hint){let eventId=hint?.event_id||uuid4();if(!this._client)return logger.warn("No client configured on scope - will not capture exception!"),eventId;let syntheticException=new Error("Sentry syntheticException");return this._client.captureException(exception,__spreadProps(__spreadValues({originalException:exception,syntheticException},hint),{event_id:eventId}),this),eventId}captureMessage(message,level,hint){let eventId=hint?.event_id||uuid4();if(!this._client)return logger.warn("No client configured on scope - will not capture message!"),eventId;let syntheticException=new Error(message);return this._client.captureMessage(message,level,__spreadProps(__spreadValues({originalException:message,syntheticException},hint),{event_id:eventId}),this),eventId}captureEvent(event2,hint){let eventId=hint?.event_id||uuid4();return this._client?(this._client.captureEvent(event2,__spreadProps(__spreadValues({},hint),{event_id:eventId}),this),eventId):(logger.warn("No client configured on scope - will not capture event!"),eventId)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(callback=>{callback(this)}),this._notifyingListeners=!1)}};function getDefaultCurrentScope(){return getGlobalSingleton("defaultCurrentScope",()=>new Scope)}function getDefaultIsolationScope(){return getGlobalSingleton("defaultIsolationScope",()=>new Scope)}var AsyncContextStack=class{constructor(scope,isolationScope){let assignedScope;scope?assignedScope=scope:assignedScope=new Scope;let assignedIsolationScope;isolationScope?assignedIsolationScope=isolationScope:assignedIsolationScope=new Scope,this._stack=[{scope:assignedScope}],this._isolationScope=assignedIsolationScope}withScope(callback){let scope=this._pushScope(),maybePromiseResult;try{maybePromiseResult=callback(scope)}catch(e){throw this._popScope(),e}return isThenable(maybePromiseResult)?maybePromiseResult.then(res=>(this._popScope(),res),e=>{throw this._popScope(),e}):(this._popScope(),maybePromiseResult)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let scope=this.getScope().clone();return this._stack.push({client:this.getClient(),scope}),scope}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function getAsyncContextStack(){let registry=getMainCarrier(),sentry=getSentryCarrier(registry);return sentry.stack=sentry.stack||new AsyncContextStack(getDefaultCurrentScope(),getDefaultIsolationScope())}function withScope(callback){return getAsyncContextStack().withScope(callback)}function withSetScope(scope,callback){let stack=getAsyncContextStack();return stack.withScope(()=>(stack.getStackTop().scope=scope,callback(scope)))}function withIsolationScope(callback){return getAsyncContextStack().withScope(()=>callback(getAsyncContextStack().getIsolationScope()))}function getStackAsyncContextStrategy(){return{withIsolationScope,withScope,withSetScope,withSetIsolationScope:(_isolationScope,callback)=>withIsolationScope(callback),getCurrentScope:()=>getAsyncContextStack().getScope(),getIsolationScope:()=>getAsyncContextStack().getIsolationScope()}}function getAsyncContextStrategy(carrier){let sentry=getSentryCarrier(carrier);return sentry.acs?sentry.acs:getStackAsyncContextStrategy()}function getCurrentScope(){let carrier=getMainCarrier();return getAsyncContextStrategy(carrier).getCurrentScope()}function getIsolationScope(){let carrier=getMainCarrier();return getAsyncContextStrategy(carrier).getIsolationScope()}function getClient(){return getCurrentScope().getClient()}var DEFAULT_BREADCRUMBS=100;function addBreadcrumb(breadcrumb,hint){let client=getClient(),isolationScope=getIsolationScope();if(!client)return;let{beforeBreadcrumb=null,maxBreadcrumbs=DEFAULT_BREADCRUMBS}=client.getOptions();if(maxBreadcrumbs<=0)return;let timestamp2=dateTimestampInSeconds(),mergedBreadcrumb=__spreadValues({timestamp:timestamp2},breadcrumb),finalBreadcrumb=beforeBreadcrumb?consoleSandbox(()=>beforeBreadcrumb(mergedBreadcrumb,hint)):mergedBreadcrumb;finalBreadcrumb!==null&&(client.emit&&client.emit("beforeAddBreadcrumb",finalBreadcrumb,hint),isolationScope.addBreadcrumb(finalBreadcrumb,maxBreadcrumbs))}function sentryNgrxMetaReducer(reducer48){return function(state,action){return addBreadcrumb({category:"ngrx",message:action.type,level:"info"}),reducer48(state,action)}}var reducers={router:routerReducer},metaReducers=environment.production?[sentryNgrxMetaReducer]:[];var AppEffects=(()=>{let _AppEffects=class _AppEffects{constructor(actions$,location2,router){this.actions$=actions$,this.location=location2,this.router=router,this.company2faRequired$=createEffect(()=>this.actions$.pipe(ofType(loadMeFailure3),mergeMap(({errors:errors2})=>errors2.some(error2=>error2.message===IxApiRequestErrorMessages.TWO_FACTOR_AUTH_REQUIRED)?of(redirectTo2faRequired()):EMPTY))),this.redirectTo2faRequired$=createEffect(()=>this.actions$.pipe(ofType(redirectTo2faRequired),tap(()=>{this.router.navigate(["/two-factor-auth-required"],{skipLocationChange:!0})})),{dispatch:!1})}};_AppEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(Location),\u0275\u0275inject(Router))},_AppEffects.\u0275prov=\u0275\u0275defineInjectable({token:_AppEffects,factory:_AppEffects.\u0275fac});let AppEffects2=_AppEffects;return AppEffects2})();var AppStateModule=(()=>{let _AppStateModule=class _AppStateModule{};_AppStateModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppStateModule)},_AppStateModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppStateModule}),_AppStateModule.\u0275inj=\u0275\u0275defineInjector({imports:[TranslateModule,StoreModule.forRoot(reducers,{metaReducers,runtimeChecks:{strictStateImmutability:!environment.production,strictActionImmutability:!environment.production,strictStateSerializability:!environment.production}}),environment.production?[]:[StoreDevtoolsModule.instrument({maxAge:50,connectInZone:!0})],EffectsModule.forRoot([AppEffects])]});let AppStateModule2=_AppStateModule;return AppStateModule2})();function generateBanner(metadata,translate){let header=document.createElement("div");return header.innerHTML=`
837
+ `],encapsulation:2,changeDetection:0});let DeviceSelectButtonComponent2=_DeviceSelectButtonComponent;return DeviceSelectButtonComponent2})();var _c028=()=>({value:"none"}),_c110=()=>[],_c26=(a0,a1)=>({"locked-drawer":a0,"open-drawer":a1}),_c33=(a0,a1)=>({desktop:a0,mobile:a1});function BuilderComponent_Conditional_0_Conditional_4_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"span"),\u0275\u0275text(1),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275advance(),\u0275\u0275textInterpolate1(" - ",ctx_r1.componentName,"")}}function BuilderComponent_Conditional_0_Conditional_15_Template(rf,ctx){if(rf&1){let _r3=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-button-toggle-group",22),\u0275\u0275listener("mousedown",function($event){return \u0275\u0275restoreView(_r3),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(1,"ix-button-toggle",23),\u0275\u0275pipe(2,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r3);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.setPreviewMode($event))}),\u0275\u0275elementStart(3,"mat-icon"),\u0275\u0275text(4,"desktop_windows"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"ix-button-toggle",24),\u0275\u0275pipe(6,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r3);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.setPreviewMode($event))}),\u0275\u0275elementStart(7,"mat-icon"),\u0275\u0275text(8,"smartphone"),\u0275\u0275elementEnd()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("value",ctx_r1.previewMode),\u0275\u0275advance(),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(2,3,"DESKTOP_VIEW")),\u0275\u0275advance(4),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(6,5,"MOBILE_VIEW"))}}function BuilderComponent_Conditional_0_Conditional_16_Template(rf,ctx){if(rf&1){let _r4=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-button-toggle-group",25),\u0275\u0275listener("mousedown",function($event){return \u0275\u0275restoreView(_r4),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(1,"ix-button-toggle",26),\u0275\u0275pipe(2,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r4);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.setOrientation($event))}),\u0275\u0275elementStart(3,"mat-icon"),\u0275\u0275text(4,"crop_portrait"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"ix-button-toggle",27),\u0275\u0275pipe(6,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r4);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.setOrientation($event))}),\u0275\u0275elementStart(7,"mat-icon"),\u0275\u0275text(8,"crop_landscape"),\u0275\u0275elementEnd()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275property("value",ctx_r1.orientation),\u0275\u0275advance(),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(2,3,"PORTRAIT_ORIENTATION")),\u0275\u0275advance(4),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(6,5,"LANDSCAPE_ORIENTATION"))}}function BuilderComponent_Conditional_0_Conditional_17_Template(rf,ctx){if(rf&1){let _r5=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",28),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r5);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.toggleMode())})("mousedown",function($event){return \u0275\u0275restoreView(_r5),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(1,"mat-icon"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275elementStart(3,"span"),\u0275\u0275text(4),\u0275\u0275pipe(5,"translate"),\u0275\u0275elementEnd()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r1.mode==="preview"?"edit":"visibility"),\u0275\u0275advance(2),\u0275\u0275textInterpolate(\u0275\u0275pipeBind1(5,2,ctx_r1.mode==="preview"?"EDIT":"PREVIEW"))}}function BuilderComponent_Conditional_0_Conditional_37_Conditional_0_Template(rf,ctx){if(rf&1){let _r6=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"mat-toolbar")(1,"h1"),\u0275\u0275text(2),\u0275\u0275elementEnd(),\u0275\u0275element(3,"span",3),\u0275\u0275elementStart(4,"button",30),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r6);let ctx_r1=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r1.toggleDrawerLock())}),\u0275\u0275elementStart(5,"mat-icon"),\u0275\u0275text(6,"keyboard_arrow_right"),\u0275\u0275elementEnd()()()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275advance(2),\u0275\u0275textInterpolate(ctx_r1.selectedComponentTemplate==null?null:ctx_r1.selectedComponentTemplate.name)}}function BuilderComponent_Conditional_0_Conditional_37_Conditional_2_Template(rf,ctx){if(rf&1){let _r7=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-page-component-properties",31),\u0275\u0275listener("update",function($event){\u0275\u0275restoreView(_r7);let ctx_r1=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r1.updateComponent($event))}),\u0275\u0275elementEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275property("component",ctx_r1.selectedComponent)("template",ctx_r1.selectedComponentTemplate)}}function BuilderComponent_Conditional_0_Conditional_37_Template(rf,ctx){if(rf&1&&(\u0275\u0275template(0,BuilderComponent_Conditional_0_Conditional_37_Conditional_0_Template,7,1,"mat-toolbar"),\u0275\u0275elementStart(1,"div",17),\u0275\u0275template(2,BuilderComponent_Conditional_0_Conditional_37_Conditional_2_Template,1,2,"ix-page-component-properties",29),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275conditional(ctx_r1.selectedComponentTemplate!=null&&ctx_r1.selectedComponentTemplate.name?0:-1),\u0275\u0275advance(2),\u0275\u0275conditional(ctx_r1.selectedComponent?2:-1)}}function BuilderComponent_Conditional_0_Conditional_38_Template(rf,ctx){if(rf&1){let _r8=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"button",30),\u0275\u0275listener("click",function(){\u0275\u0275restoreView(_r8);let ctx_r1=\u0275\u0275nextContext(2);return \u0275\u0275resetView(ctx_r1.toggleDrawerLock())}),\u0275\u0275elementStart(1,"mat-icon"),\u0275\u0275text(2,"keyboard_arrow_left"),\u0275\u0275elementEnd()()}}function BuilderComponent_Conditional_0_Case_40_Template(rf,ctx){if(rf&1&&\u0275\u0275elementContainer(0,21),rf&2){\u0275\u0275nextContext();let standaloneContent_r9=\u0275\u0275reference(43);\u0275\u0275property("ngTemplateOutlet",standaloneContent_r9)}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_1_Template(rf,ctx){if(rf&1){let _r10=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-component-grid",37),\u0275\u0275listener("selectionChange",function($event){\u0275\u0275restoreView(_r10);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.handleSelectionChange($event))})("componentChanges",function($event){\u0275\u0275restoreView(_r10);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.handleComponentChanges($event))})("movingGridItem",function($event){\u0275\u0275restoreView(_r10);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.setDrawerIsOpen($event))}),\u0275\u0275elementEnd()}if(rf&2){let pageVersion_r11=\u0275\u0275nextContext(3),ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(pageVersion_r11.previewAgent==null?null:pageVersion_r11.previewAgent.publicId)||(pageVersion_r11.previewAsset==null?null:pageVersion_r11.previewAsset.publicId)||null)("mobile",ctx_r1.previewMode==="mobile")("pageVersionId",pageVersion_r11.publicId)("selectedComponentId",(ctx_r1.selectedComponent==null?null:ctx_r1.selectedComponent.publicId)||null)("ngClass",\u0275\u0275pureFunction2(6,_c33,ctx_r1.previewMode!=="mobile",ctx_r1.previewMode==="mobile"))}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_2_Template(rf,ctx){if(rf&1){let _r12=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-card-component-grid",38),\u0275\u0275listener("componentResize",function($event){\u0275\u0275restoreView(_r12);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.updateComponentSize($event))})("selectionChange",function($event){\u0275\u0275restoreView(_r12);let ctx_r1=\u0275\u0275nextContext(4);return \u0275\u0275resetView(ctx_r1.handleSelectionChange($event))}),\u0275\u0275elementEnd()}if(rf&2){let tmp_7_0,tmp_9_0,pageVersion_r11=\u0275\u0275nextContext(3),ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(tmp_7_0=ctx_r1.previewAgentOrAsset==null?null:ctx_r1.previewAgentOrAsset.publicId)!==null&&tmp_7_0!==void 0?tmp_7_0:null)("pageVersionId",pageVersion_r11.publicId)("selectedComponentId",(tmp_9_0=ctx_r1.selectedComponent==null?null:ctx_r1.selectedComponent.publicId)!==null&&tmp_9_0!==void 0?tmp_9_0:null)}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_3_ix_component_grid_0_Template(rf,ctx){if(rf&1){let _r13=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"ix-component-grid",40),\u0275\u0275listener("selectionChange",function($event){\u0275\u0275restoreView(_r13);let ctx_r1=\u0275\u0275nextContext(5);return \u0275\u0275resetView(ctx_r1.handleSelectionChange($event))})("componentChanges",function($event){\u0275\u0275restoreView(_r13);let ctx_r1=\u0275\u0275nextContext(5);return \u0275\u0275resetView(ctx_r1.handleComponentChanges($event))})("movingGridItem",function($event){\u0275\u0275restoreView(_r13);let ctx_r1=\u0275\u0275nextContext(5);return \u0275\u0275resetView(ctx_r1.setDrawerIsOpen($event))}),\u0275\u0275elementEnd()}if(rf&2){let tmp_10_0,pageVersion_r11=\u0275\u0275nextContext(4),ctx_r1=\u0275\u0275nextContext();\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(pageVersion_r11.previewAgent==null?null:pageVersion_r11.previewAgent.publicId)||(pageVersion_r11.previewAsset==null?null:pageVersion_r11.previewAsset.publicId)||null)("pageVersionId",pageVersion_r11.publicId)("selectedComponentId",(tmp_10_0=ctx_r1.selectedComponent==null?null:ctx_r1.selectedComponent.publicId)!==null&&tmp_10_0!==void 0?tmp_10_0:null)("ngClass",ctx_r1.orientation)("orientation",ctx_r1.orientation)("mobile",!1)}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_3_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_3_ix_component_grid_0_Template,1,7,"ix-component-grid",39),rf&2){let ctx_r1=\u0275\u0275nextContext(4);\u0275\u0275property("ixReloadOnValueChange",ctx_r1.orientation)}}function BuilderComponent_Conditional_0_Case_41_Conditional_0_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",32),\u0275\u0275template(1,BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_1_Template,1,9,"ix-component-grid",34)(2,BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_2_Template,1,4,"ix-card-component-grid",35)(3,BuilderComponent_Conditional_0_Case_41_Conditional_0_Conditional_3_Template,1,1,"ix-component-grid",36),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275property("ngClass",ctx_r1.gridClasses),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="sheet"?1:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="card"?2:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="report"?3:-1)}}function BuilderComponent_Conditional_0_Case_41_Conditional_1_Conditional_1_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",41),\u0275\u0275element(1,"ix-simple-component-grid",43),\u0275\u0275elementEnd()),rf&2){let pageVersion_r11=\u0275\u0275nextContext(3),ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(pageVersion_r11.previewAgent==null?null:pageVersion_r11.previewAgent.publicId)||(pageVersion_r11.previewAsset==null?null:pageVersion_r11.previewAsset.publicId)||null)("mobile",ctx_r1.previewMode==="mobile")("pageVersionId",pageVersion_r11.publicId)("ngClass",ctx_r1.previewMode)}}function BuilderComponent_Conditional_0_Case_41_Conditional_1_Conditional_2_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",42),\u0275\u0275element(1,"ix-simple-card-component-grid",44),\u0275\u0275elementEnd()),rf&2){let pageVersion_r11=\u0275\u0275nextContext(3),ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(),\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope)("agentOrAssetId",(pageVersion_r11.previewAgent==null?null:pageVersion_r11.previewAgent.publicId)||(pageVersion_r11.previewAsset==null?null:pageVersion_r11.previewAsset.publicId)||null)("pageVersionId",pageVersion_r11.publicId)}}function BuilderComponent_Conditional_0_Case_41_Conditional_1_Template(rf,ctx){if(rf&1&&(\u0275\u0275elementStart(0,"div",33),\u0275\u0275template(1,BuilderComponent_Conditional_0_Case_41_Conditional_1_Conditional_1_Template,2,5,"div",41)(2,BuilderComponent_Conditional_0_Case_41_Conditional_1_Conditional_2_Template,2,3,"div",42),\u0275\u0275elementEnd()),rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275property("ngClass",ctx_r1.applicationType),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="sheet"?1:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="card"?2:-1)}}function BuilderComponent_Conditional_0_Case_41_Template(rf,ctx){if(rf&1&&\u0275\u0275template(0,BuilderComponent_Conditional_0_Case_41_Conditional_0_Template,4,4,"div",32)(1,BuilderComponent_Conditional_0_Case_41_Conditional_1_Template,3,3,"div",33),rf&2){let ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275conditional(ctx_r1.mode==="edit"?0:1)}}function BuilderComponent_Conditional_0_ng_template_42_Conditional_0_ix_component_loader_2_Template(rf,ctx){if(rf&1&&\u0275\u0275element(0,"ix-component-loader",48),rf&2){let component_r15=\u0275\u0275nextContext();\u0275\u0275property("component",component_r15)}}function BuilderComponent_Conditional_0_ng_template_42_Conditional_0_Template(rf,ctx){if(rf&1){let _r14=\u0275\u0275getCurrentView();\u0275\u0275elementContainerStart(0,45),\u0275\u0275elementStart(1,"div",46),\u0275\u0275listener("click",function(){let component_r15=\u0275\u0275restoreView(_r14),ctx_r1=\u0275\u0275nextContext(3);return \u0275\u0275resetView(ctx_r1.handleSelectionChange(component_r15.publicId))}),\u0275\u0275template(2,BuilderComponent_Conditional_0_ng_template_42_Conditional_0_ix_component_loader_2_Template,1,1,"ix-component-loader",47),\u0275\u0275elementEnd(),\u0275\u0275elementContainerEnd()}if(rf&2){let ctx_r1=\u0275\u0275nextContext(3);\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope),\u0275\u0275advance(),\u0275\u0275property("ixComponentGridScope",ctx_r1.gridScope),\u0275\u0275advance(),\u0275\u0275property("ixReloadOnValueChange",ctx)}}function BuilderComponent_Conditional_0_ng_template_42_Template(rf,ctx){if(rf&1&&(\u0275\u0275template(0,BuilderComponent_Conditional_0_ng_template_42_Conditional_0_Template,3,3,"ng-container",45),\u0275\u0275pipe(1,"async")),rf&2){let tmp_4_0,ctx_r1=\u0275\u0275nextContext(2);\u0275\u0275conditional((tmp_4_0=\u0275\u0275pipeBind1(1,1,ctx_r1.component$))?0:-1,tmp_4_0)}}function BuilderComponent_Conditional_0_Template(rf,ctx){if(rf&1){let _r1=\u0275\u0275getCurrentView();\u0275\u0275elementStart(0,"div",1)(1,"mat-toolbar",2)(2,"h1"),\u0275\u0275text(3," Simulator "),\u0275\u0275template(4,BuilderComponent_Conditional_0_Conditional_4_Template,2,1,"span"),\u0275\u0275elementEnd(),\u0275\u0275element(5,"span",3),\u0275\u0275elementStart(6,"button",4)(7,"mat-icon"),\u0275\u0275text(8,"settings"),\u0275\u0275elementEnd()()(),\u0275\u0275elementStart(9,"mat-toolbar",5)(10,"ix-device-select-button",6),\u0275\u0275pipe(11,"translate"),\u0275\u0275pipe(12,"async"),\u0275\u0275listener("selectionChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.selectPreviewAgentOrAsset($event))})("mousedown",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementEnd(),\u0275\u0275element(13,"div",3),\u0275\u0275elementStart(14,"ix-period-controls",7),\u0275\u0275listener("periodSpecSelected",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.updateSelectedPeriodSpec($event))})("mousedown",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementEnd(),\u0275\u0275template(15,BuilderComponent_Conditional_0_Conditional_15_Template,9,7,"ix-button-toggle-group",8)(16,BuilderComponent_Conditional_0_Conditional_16_Template,9,7,"ix-button-toggle-group",9)(17,BuilderComponent_Conditional_0_Conditional_17_Template,6,4,"button",10),\u0275\u0275elementStart(18,"ix-button-toggle-group",11),\u0275\u0275listener("mousedown",function($event){return \u0275\u0275restoreView(_r1),\u0275\u0275resetView($event.stopPropagation())}),\u0275\u0275elementStart(19,"ix-button-toggle",12),\u0275\u0275pipe(20,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.setApplicationType($event))}),\u0275\u0275elementStart(21,"mat-icon"),\u0275\u0275text(22,"dashboard"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(23,"ix-button-toggle",13),\u0275\u0275pipe(24,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.setApplicationType($event))}),\u0275\u0275element(25,"mat-icon",14),\u0275\u0275elementEnd(),\u0275\u0275elementStart(26,"ix-button-toggle",15),\u0275\u0275pipe(27,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.setApplicationType($event))}),\u0275\u0275elementStart(28,"mat-icon"),\u0275\u0275text(29,"draft"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(30,"ix-button-toggle",16),\u0275\u0275pipe(31,"translate"),\u0275\u0275listener("valueChange",function($event){\u0275\u0275restoreView(_r1);let ctx_r1=\u0275\u0275nextContext();return \u0275\u0275resetView(ctx_r1.setApplicationType($event))}),\u0275\u0275elementStart(32,"mat-icon"),\u0275\u0275text(33,"fit_screen"),\u0275\u0275elementEnd()()()(),\u0275\u0275elementStart(34,"div",17)(35,"mat-drawer-container")(36,"mat-drawer",18),\u0275\u0275template(37,BuilderComponent_Conditional_0_Conditional_37_Template,3,2)(38,BuilderComponent_Conditional_0_Conditional_38_Template,3,0,"button",19),\u0275\u0275elementEnd(),\u0275\u0275elementStart(39,"mat-drawer-content",20),\u0275\u0275template(40,BuilderComponent_Conditional_0_Case_40_Template,1,1,"ng-container",21)(41,BuilderComponent_Conditional_0_Case_41_Template,2,1)(42,BuilderComponent_Conditional_0_ng_template_42_Template,2,3,"ng-template",null,0,\u0275\u0275templateRefExtractor),\u0275\u0275elementEnd()()()()}if(rf&2){let tmp_7_0,tmp_8_0,tmp_22_0,ctx_r1=\u0275\u0275nextContext();\u0275\u0275advance(4),\u0275\u0275conditional(ctx_r1.componentName?4:-1),\u0275\u0275advance(6),\u0275\u0275property("emptyLabel",\u0275\u0275pipeBind1(11,20,"SELECT_DEVICE_FOR_PREVIEW"))("noneOption",\u0275\u0275pureFunction0(32,_c028))("stroked",!0)("value",(tmp_7_0=ctx_r1.previewAgentOrAsset==null?null:ctx_r1.previewAgentOrAsset.publicId)!==null&&tmp_7_0!==void 0?tmp_7_0:"")("agentsOrAssets",(tmp_8_0=\u0275\u0275pipeBind1(12,22,ctx_r1.previewAgentsOrAssets$))!==null&&tmp_8_0!==void 0?tmp_8_0:\u0275\u0275pureFunction0(33,_c110)),\u0275\u0275advance(4),\u0275\u0275property("deviceTimeZone",null)("periodSpecs",ctx_r1.periodSpecs),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="sheet"?15:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="report"?16:-1),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.applicationType==="sheet"||ctx_r1.applicationType==="card"?17:-1),\u0275\u0275advance(),\u0275\u0275property("value",ctx_r1.applicationType),\u0275\u0275advance(),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(20,24,"PAGE")),\u0275\u0275advance(4),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(24,26,"CARD")),\u0275\u0275advance(3),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(27,28,"REPORT")),\u0275\u0275advance(4),\u0275\u0275property("matTooltip",\u0275\u0275pipeBind1(31,30,"STANDALONE")),\u0275\u0275advance(6),\u0275\u0275property("opened",ctx_r1.selectedComponent&&ctx_r1.drawerIsOpen&&ctx_r1.mode==="edit")("ngClass",\u0275\u0275pureFunction2(34,_c26,ctx_r1.drawerLockedClose,ctx_r1.selectedComponent&&!ctx_r1.drawerLockedClose)),\u0275\u0275advance(),\u0275\u0275conditional(ctx_r1.selectedComponent&&!ctx_r1.drawerLockedClose?37:38),\u0275\u0275advance(3),\u0275\u0275conditional((tmp_22_0=ctx_r1.applicationType)==="standalone"?40:41)}}var BuilderComponent=(()=>{let _BuilderComponent=class _BuilderComponent{constructor(){this.activePeriodSpec=inject(ActivePeriodSpec),this.cdRef=inject(ChangeDetectorRef),this.destroy=inject(DestroyRef),this.facade=inject(BuilderFacade),this.sessionStorage=inject(SESSION_STORAGE),this.applicationType=this.sessionStorage.getItem("application-type")||"sheet",this.orientation=this.sessionStorage.getItem("orientation")||"portrait",this.drawerLockedClose=!1,this.gridScope="simulator",this.mode=this.sessionStorage.getItem("mode")||"edit",this.previewMode=this.sessionStorage.getItem("preview-mode")||"desktop",this.drawerIsOpen=!0,this.selectedComponentId$=new BehaviorSubject(null),this.busyUpdating$=this.facade.busyUpdating$,this.component$=this.facade.getComponent(this.pageId),this.pageVersion$=this.facade.draftVersionByPageId(this.pageId),this.previewAgentsOrAssets$=this.facade.previewAgentsOrAssets$,this.previewAgentOrAsset$=this.facade.previewAgentOrAsset(this.pageVersion$)}get gridClasses(){return this.previewMode==="mobile"?["mobile"]:[]}get pageId(){return"page"}ngOnInit(){this.pageVersion$.pipe(takeUntilDestroyed(this.destroy)).subscribe(pageVersion=>{this.pageVersion=pageVersion,this.pageVersionId=pageVersion.publicId}),this.facade.selectedPeriodSpec(of(this.pageId)).pipe(takeUntilDestroyed(this.destroy)).subscribe(periodSpec=>{this.periodSpecs=__spreadProps(__spreadValues({},this.periodSpecs),{selected:periodSpec}),this.activePeriodSpec.setPeriodSpec(periodSpec,this.gridScope),this.zoomOutIsVisible=this.getZoomOutIsVisible(),this.cdRef.markForCheck()}),this.activePeriodSpec.inScopeOf(this.gridScope).pipe(takeUntilDestroyed(this.destroy)).subscribe(periodSpec=>{this.periodSpecs=__spreadProps(__spreadValues({},this.periodSpecs),{active:periodSpec}),this.zoomOutIsVisible=this.getZoomOutIsVisible(),this.cdRef.markForCheck()}),this.selectedComponentId$.pipe(distinctUntilChanged(),switchMap(id=>combineLatest([this.facade.pageComponent(id),this.facade.pageComponentTemplate(id)])),takeUntilDestroyed(this.destroy)).subscribe(([component,template])=>{this.selectedComponent=component,this.selectedComponentTemplate=template,this.cdRef.markForCheck()}),this.previewAgentOrAsset$.pipe(takeUntilDestroyed(this.destroy)).subscribe(agentOrAsset=>{this.previewAgentOrAsset=agentOrAsset,this.cdRef.markForCheck()}),this.facade.getComponentName(this.pageId).pipe(takeUntilDestroyed(this.destroy)).subscribe(name=>{this.componentName=name}),this.facade.loadAgents(),this.facade.loadAssets(),this.facade.loadCustomProperties(),this.facade.loadGroups(),this.facade.loadPageComponentTemplates(),this.facade.loadPage(this.pageId),this.facade.loadRoles(),this.destroy.onDestroy(()=>{this.facade.reset()})}handleSelectionChange(componentId){this.selectedComponentId$.next(componentId)}handleComponentChanges(components){let updates=components.reduce((acc,component)=>this.previewMode==="desktop"&&component.dimensions?.type==="sheet"?[...acc,pick_default(component,["publicId","dimensions.type","dimensions.left","dimensions.top","dimensions.rows","dimensions.cols"])]:this.previewMode==="mobile"&&component.dimensions?.type==="sheet"?[...acc,pick_default(component,["publicId","dimensions.type","dimensions.mobileCols","dimensions.mobileHeight","dimensions.mobileLeft","dimensions.mobileOrder"])]:component.dimensions?.type==="report"?[...acc,pick_default(component,["publicId","dimensions.type","dimensions.left","dimensions.top","dimensions.rows","dimensions.cols"])]:acc,[]);updates.length>0&&(updates.length===1?this.facade.updateComponent(updates[0].publicId,omit_default(updates[0],["publicId"])):this.facade.updateComponentList(updates))}updateComponent(component){this.facade.updateComponent(component.publicId,omit_default(component,["publicId"]))}updateComponentSize({componentId,height}){this.facade.updateComponent(componentId,{dimensions:{type:"card",height}})}selectPreviewAgentOrAsset(publicId){this.previewAgentOrAsset?.publicId!==publicId&&this.facade.updatePreviewAgentOrAsset(this.pageVersionId,publicId==="none"?null:publicId)}setApplicationType(newApplicationType){this.applicationType=newApplicationType,this.sessionStorage.setItem("application-type",newApplicationType),this.facade.reloadDimensions(this.pageId,newApplicationType);let mode=null,remember=!0;switch(newApplicationType){case"report":mode="edit",remember=!1;break;case"standalone":mode="preview",remember=!1;break}mode||(mode=this.sessionStorage.getItem("mode")||null),mode&&this.setMode(mode,remember)}setPreviewMode(newPreviewMode){this.previewMode=newPreviewMode,this.sessionStorage.setItem("preview-mode",newPreviewMode)}setOrientation(newOrientation){this.orientation=newOrientation,this.sessionStorage.setItem("orientation",newOrientation);let component=this.pageVersion.components?.[0];component?.dimensions?.type==="report"&&this.facade.updateComponent(component.publicId,{dimensions:__spreadProps(__spreadValues({},component.dimensions),{type:"report",left:0,top:3,cols:newOrientation==="landscape"?8:6,rows:6})})}getZoomOutIsVisible(){return this.periodSpecs?!isEqual_default(this.periodSpecs.active,this.periodSpecs.selected):!1}setMode(newMode,rememberMode=!0){this.mode=newMode,rememberMode&&this.sessionStorage.setItem("mode",newMode)}setDrawerIsOpen(gridItemIsMoving){this.drawerIsOpen=!gridItemIsMoving}toggleDrawerLock(){this.drawerLockedClose=!this.drawerLockedClose}toggleMode(){this.setMode(this.mode==="preview"?"edit":"preview")}updateSelectedPeriodSpec(periodSpec){this.facade.updateSelectedPeriodSpec(periodSpec)}};_BuilderComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BuilderComponent)},_BuilderComponent.\u0275cmp=\u0275\u0275defineComponent({type:_BuilderComponent,selectors:[["ix-builder"]],viewQuery:function(rf,ctx){if(rf&1&&\u0275\u0275viewQuery(ComponentGridComponent,5),rf&2){let _t;\u0275\u0275queryRefresh(_t=\u0275\u0275loadQuery())&&(ctx.componentGrid=_t.first)}},decls:2,vars:3,consts:[["standaloneContent",""],["fxFlex","","fxLayout","column",1,"ix-surface"],["ixComponentGridFocus",""],["fxFlex",""],["mat-icon-button","","routerLink","/settings","matTooltip","Settings"],["ixComponentGridFocus","",1,"second"],[3,"selectionChange","mousedown","emptyLabel","noneOption","stroked","value","agentsOrAssets"],[3,"periodSpecSelected","mousedown","deviceTimeZone","periodSpecs"],[1,"screen-toggle-group",3,"value"],[1,"orientation-toggle-group",3,"value"],["mat-stroked-button","","type","button",1,"mode-button"],[1,"application-type-toggle-group",3,"mousedown","value"],["value","sheet",3,"valueChange","matTooltip"],["value","card",3,"valueChange","matTooltip"],["svgIcon","card_outline"],["value","report",3,"valueChange","matTooltip"],["value","standalone",3,"valueChange","matTooltip"],["fxFlex","",1,"ix-content"],["mode","over","position","end",3,"opened","ngClass"],["mat-icon-button","","disableRipple","true"],["fxLayout","column"],[3,"ngTemplateOutlet"],[1,"screen-toggle-group",3,"mousedown","value"],["value","desktop",3,"valueChange","matTooltip"],["value","mobile",3,"valueChange","matTooltip"],[1,"orientation-toggle-group",3,"mousedown","value"],["value","portrait",3,"valueChange","matTooltip"],["value","landscape",3,"valueChange","matTooltip"],["mat-stroked-button","","type","button",1,"mode-button",3,"click","mousedown"],[3,"component","template"],["mat-icon-button","","disableRipple","true",3,"click"],[3,"update","component","template"],["ixComponentGridFocus","",1,"grid-container",3,"ngClass"],[1,"preview-grid-container",3,"ngClass"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage",3,"ixComponentGridScope","agentOrAssetId","mobile","pageVersionId","selectedComponentId","ngClass"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","","ixComponentGridMode","edit","pagePageId","pagepage",3,"ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage","applicationType","report",1,"report-grid","mat-elevation-z2",3,"ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId","ngClass","orientation","mobile"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage",3,"selectionChange","componentChanges","movingGridItem","ixComponentGridScope","agentOrAssetId","mobile","pageVersionId","selectedComponentId","ngClass"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","","ixComponentGridMode","edit","pagePageId","pagepage",3,"componentResize","selectionChange","ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage","class","report-grid mat-elevation-z2","applicationType","report",3,"ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId","ngClass","orientation","mobile","selectionChange","componentChanges","movingGridItem",4,"ixReloadOnValueChange"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentGridMode","edit","ixComponentContextCleanup","","pagePageId","pagepage","applicationType","report",1,"report-grid","mat-elevation-z2",3,"selectionChange","componentChanges","movingGridItem","ixComponentGridScope","agentOrAssetId","pageVersionId","selectedComponentId","ngClass","orientation","mobile"],[1,"ix-large-section","preview"],[1,"preview"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","","ixComponentGridMode","view",3,"ixComponentGridScope","agentOrAssetId","mobile","pageVersionId","ngClass"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","","ixComponentGridMode","view",3,"ixComponentGridScope","agentOrAssetId","pageVersionId"],[3,"ixComponentGridScope"],["ixBackendComponentBroker","","ixLoggingDataBroker","","ixResourceDataBroker","","ixObjectStorageBroker","","ixComponentContextCleanup","",1,"standalone",3,"click","ixComponentGridScope"],[3,"component",4,"ixReloadOnValueChange"],[3,"component"]],template:function(rf,ctx){if(rf&1&&(\u0275\u0275template(0,BuilderComponent_Conditional_0_Template,44,37,"div",1),\u0275\u0275pipe(1,"async")),rf&2){let tmp_0_0;\u0275\u0275conditional((tmp_0_0=\u0275\u0275pipeBind1(1,1,ctx.pageVersion$))?0:-1,tmp_0_0)}},dependencies:[AlertDialogModule,AsyncPipe,ButtonToggleModule,ButtonToggleComponent,ButtonToggleGroupComponent,ComponentLoaderModule,ComponentLoaderComponent,DeviceSelectButtonComponent,FlexModule,DefaultLayoutDirective,DefaultFlexDirective,MatButtonModule,MatButton,MatIconButton,MatFormFieldModule,MatIconModule,MatIcon,MatInputModule,MatSidenavModule,MatDrawer,MatDrawerContainer,MatDrawerContent,MatToolbarModule,MatToolbar,MatTooltipModule,MatTooltip,NgClass,NgTemplateOutlet,PagesModule,ComponentGridComponent,CardComponentGridComponent,SimpleComponentGridComponent,SimpleCardComponentGridComponent,ComponentPropertiesComponent,ComponentGridModeDirective,ComponentGridScopeDirective,ComponentContextCleanupDirective,BackendComponentBrokerDirective,LoggingDataBrokerDirective,ObjectStorageBrokerDirective,ResourceDataBrokerDirective,PeriodControlsComponent,ComponentGridFocusDirective,PeriodFieldsetModule,ReloadTriggerModule,ReloadOnValueChangeDirective,RouterModule,RouterLink,TranslateModule,TranslatePipe],styles:['[_nghost-%COMP%]{height:100%;width:100%}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%]{border-bottom:1px solid var(--mat-sys-surface-variant)}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{padding-right:16px}[_nghost-%COMP%] .mat-toolbar[_ngcontent-%COMP%] ix-device-select-button[_ngcontent-%COMP%]{margin-right:8px;max-width:calc(100% - 340px)}[_nghost-%COMP%] .mat-toolbar.second[_ngcontent-%COMP%]{--mat-toolbar-standard-height: 56px;--mdc-outlined-button-container-height: 36px;border-bottom:1px solid var(--mat-sys-surface-variant)}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer-backdrop{display:none}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%]{height:100%;width:300px;border-left:1px solid var(--mat-sys-surface-variant)}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%] .mat-drawer-inner-container{height:100%;flex-direction:column}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%] .mat-drawer-inner-container>.mat-toolbar{height:40px!important}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%] .mat-drawer-inner-container>.mat-toolbar h1{color:var(--body-color);font-size:16px;font-weight:400}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer.locked-drawer[_ngcontent-%COMP%]{--mat-sidenav-container-elevation-shadow: 0px 8px 10px -5px rgb(0 0 0 / 20%), 0px 16px 24px 2px rgb(0 0 0 / 14%), 0px 6px 30px 5px rgb(0 0 0 / 12%);width:50px;height:40px;border-top-left-radius:25px;border-bottom-left-radius:25px;border-left:none}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .mat-drawer[_ngcontent-%COMP%] .mat-mdc-icon-button[_ngcontent-%COMP%] .mat-mdc-button-focus-overlay{display:none}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%]{height:100%;overflow-x:auto;background-color:#f5f5f5}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] .grid[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{margin:0 auto;height:100%}@media (min-width: 960px){[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{max-width:970px}}@media (min-width: 1280px){[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{max-width:1200px}}@media (min-width: 1920px){[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{max-width:1600px}}@media screen and (min-width: 2251px){[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid[_ngcontent-%COMP%]{max-width:2000px}}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid.desktop[_ngcontent-%COMP%]{min-width:970px}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .grid-container[_ngcontent-%COMP%] ix-component-grid.mobile[_ngcontent-%COMP%]{max-width:480px}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%]{height:100%;width:100%;box-sizing:border-box;overflow-x:auto;display:flex;flex-direction:column;background-color:var(--detail-page-bg)}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container.card[_ngcontent-%COMP%]{place-content:center}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container.card[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%]{display:flex;place-items:center}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%] ix-simple-component-grid[_ngcontent-%COMP%]{height:100%;box-sizing:border-box;margin:0 auto}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%] ix-simple-component-grid.desktop[_ngcontent-%COMP%]{min-width:970px}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%] ix-simple-component-grid.mobile[_ngcontent-%COMP%]{max-width:480px;border-left:1px solid rgba(0,0,0,.08);border-right:1px solid rgba(0,0,0,.08)}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .preview-grid-container[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%] ix-simple-card-component-grid[_ngcontent-%COMP%]{width:300px;padding:0;margin:0 auto;box-sizing:border-box;background-color:var(--card-bg);color:var(--card-color);color-scheme:var(--card-color-scheme);border:var(--card-border-width) solid var(--card-border-color);border-radius:8px}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .standalone[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] .standalone[_ngcontent-%COMP%] ix-component-loader[_ngcontent-%COMP%]{overflow:auto}[_nghost-%COMP%] .mat-drawer-container[_ngcontent-%COMP%] ix-page-properties[_ngcontent-%COMP%]{padding:20px 16px}[_nghost-%COMP%] .select-button[_ngcontent-%COMP%]{padding-left:8px;padding-right:2px;margin-right:8px}[_nghost-%COMP%] .select-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]:first-child{margin-right:6px}[_nghost-%COMP%] .screen-toggle-group[_ngcontent-%COMP%], [_nghost-%COMP%] .orientation-toggle-group[_ngcontent-%COMP%], [_nghost-%COMP%] .application-type-toggle-group[_ngcontent-%COMP%]{margin-left:12px}[_nghost-%COMP%] .mode-button[_ngcontent-%COMP%]{margin-left:12px}[_nghost-%COMP%] .mode-button[_ngcontent-%COMP%] .mat-icon[_ngcontent-%COMP%]:first-child{margin-right:6px}[_nghost-%COMP%] .report-grid[_ngcontent-%COMP%]{--card-bg: #fff;--card-border-color: rgb(0 0 0 / 12%);--card-border-width: 1px;--card-color: rgb(0 0 0 / 87%);--card-color-scheme: "light";margin:16px auto!important;background:#fff;height:842pt!important;width:595pt}[_nghost-%COMP%] .report-grid.landscape[_ngcontent-%COMP%]{height:595pt!important;width:842pt}[_nghost-%COMP%] .report-grid[_ngcontent-%COMP%] .canvas gridster .gridster-row{width:calc(100% - 76px)!important}[_nghost-%COMP%] .report-grid[_ngcontent-%COMP%] .gridster-column, [_nghost-%COMP%] .report-grid[_ngcontent-%COMP%] .gridster-row{border-color:#00000014}'],changeDetection:0});let BuilderComponent2=_BuilderComponent;return BuilderComponent2})();var BuilderGuard=(()=>{let _BuilderGuard=class _BuilderGuard{constructor(store){this.store=store}canActivate(){return forkJoin([this.getMyUser(),this.getMyCompany()]).pipe(map(()=>!0),take(1))}getMyUser(){return this._loadIfAbsent(selectMyUser,loadMe2())}getMyCompany(){return this._loadIfAbsent(selectMyCompany,loadMe3())}_loadIfAbsent(selector3,action){return this.store.select(selector3).pipe(tap(entity=>{entity||this.store.dispatch(action)}),first(entity=>!!entity),map(()=>!0))}};_BuilderGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BuilderGuard)(\u0275\u0275inject(Store))},_BuilderGuard.\u0275prov=\u0275\u0275defineInjectable({token:_BuilderGuard,factory:_BuilderGuard.\u0275fac,providedIn:"root"});let BuilderGuard2=_BuilderGuard;return BuilderGuard2})();var LoginExpiredComponent=(()=>{let _LoginExpiredComponent=class _LoginExpiredComponent{constructor(document2,storage){this.document=document2,this.storage=storage}useMockData(){this.storage.forget("api-data-provider"),this.storage.forget("company"),this.reload()}reload(){this.document.location.href="/"}};_LoginExpiredComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoginExpiredComponent)(\u0275\u0275directiveInject(DOCUMENT),\u0275\u0275directiveInject(StorageService))},_LoginExpiredComponent.\u0275cmp=\u0275\u0275defineComponent({type:_LoginExpiredComponent,selectors:[["ix-login-expired"]],standalone:!1,decls:18,vars:0,consts:[["fxFlex","","fxLayout","column","fxLayoutAlign","center center",1,"ix-surface"],[1,"ix-status-card"],[1,"ix-status-card__icon"],["type","button","mat-button","","color","primary",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"mat-card",1)(2,"div",2)(3,"mat-icon"),\u0275\u0275text(4,"error"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"mat-card-header")(6,"mat-card-title"),\u0275\u0275text(7,"Login expired"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(8,"mat-card-subtitle"),\u0275\u0275text(9," Please re-authenticate via the command line "),\u0275\u0275elementStart(10,"pre"),\u0275\u0275text(11,"npx cdk login"),\u0275\u0275elementEnd(),\u0275\u0275text(12," and reload or revert to using API mock data. "),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(13,"mat-card-actions")(14,"button",3),\u0275\u0275listener("click",function(){return ctx.useMockData()}),\u0275\u0275text(15,"Use mock data"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(16,"button",3),\u0275\u0275listener("click",function(){return ctx.reload()}),\u0275\u0275text(17,"Reload"),\u0275\u0275elementEnd()()()())},dependencies:[DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatButton,MatCard,MatCardActions,MatCardHeader,MatCardSubtitle,MatCardTitle,MatIcon],styles:["[_nghost-%COMP%]{width:100%;height:100%}"],changeDetection:0});let LoginExpiredComponent3=_LoginExpiredComponent;return LoginExpiredComponent3})();var LoginExpiredCanActivateGuard=(()=>{let _LoginExpiredCanActivateGuard=class _LoginExpiredCanActivateGuard{constructor(router,storage){this.router=router,this.storage=storage}canActivate(route){return this.isAuthenticated(route)}isAuthenticated(route){return of(this.storage.has("auth")).pipe(tap(authenticated=>{if(authenticated)if(route.queryParamMap.has("next")){let next=route.queryParams.next;this.router.navigateByUrl(next).then(success=>{success||this.router.navigate(["/"])})}else this.router.navigate(["/"])}),map(authenticated=>!authenticated))}};_LoginExpiredCanActivateGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoginExpiredCanActivateGuard)(\u0275\u0275inject(Router),\u0275\u0275inject(StorageService))},_LoginExpiredCanActivateGuard.\u0275prov=\u0275\u0275defineInjectable({token:_LoginExpiredCanActivateGuard,factory:_LoginExpiredCanActivateGuard.\u0275fac,providedIn:"root"});let LoginExpiredCanActivateGuard2=_LoginExpiredCanActivateGuard;return LoginExpiredCanActivateGuard2})();var LoginExpiredModule=(()=>{let _LoginExpiredModule=class _LoginExpiredModule{};_LoginExpiredModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_LoginExpiredModule)},_LoginExpiredModule.\u0275mod=\u0275\u0275defineNgModule({type:_LoginExpiredModule}),_LoginExpiredModule.\u0275inj=\u0275\u0275defineInjector({imports:[SharedModule]});let LoginExpiredModule2=_LoginExpiredModule;return LoginExpiredModule2})();var ManifestInvalidComponent=(()=>{let _ManifestInvalidComponent=class _ManifestInvalidComponent{};_ManifestInvalidComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ManifestInvalidComponent)},_ManifestInvalidComponent.\u0275cmp=\u0275\u0275defineComponent({type:_ManifestInvalidComponent,selectors:[["ix-manifest-invalid"]],standalone:!1,decls:13,vars:0,consts:[["fxFlex","","fxLayout","column","fxLayoutAlign","center center",1,"ix-surface"],[1,"ix-status-card"],[1,"ix-status-card__icon"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"mat-card",1)(2,"div",2)(3,"mat-icon"),\u0275\u0275text(4,"error"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"mat-card-header")(6,"mat-card-title"),\u0275\u0275text(7,"Manifest invalid"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(8,"mat-card-subtitle"),\u0275\u0275text(9," Schema validation for the "),\u0275\u0275elementStart(10,"pre"),\u0275\u0275text(11,"manifest.json"),\u0275\u0275elementEnd(),\u0275\u0275text(12," file failed. "),\u0275\u0275elementEnd()()()())},dependencies:[DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatCard,MatCardHeader,MatCardSubtitle,MatCardTitle,MatIcon],styles:["[_nghost-%COMP%]{width:100%;height:100%}"],changeDetection:0});let ManifestInvalidComponent3=_ManifestInvalidComponent;return ManifestInvalidComponent3})();var TwoFactorAuthRequiredComponent=(()=>{let _TwoFactorAuthRequiredComponent=class _TwoFactorAuthRequiredComponent{constructor(document2,storage){this.document=document2,this.storage=storage}switchCompany(){this.storage.forget("api-data-provider"),this.storage.forget("company"),this.document.location.href="/settings/general"}useMockData(){this.storage.forget("api-data-provider"),this.storage.forget("company"),this.document.location.href="/"}};_TwoFactorAuthRequiredComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_TwoFactorAuthRequiredComponent)(\u0275\u0275directiveInject(DOCUMENT),\u0275\u0275directiveInject(StorageService))},_TwoFactorAuthRequiredComponent.\u0275cmp=\u0275\u0275defineComponent({type:_TwoFactorAuthRequiredComponent,selectors:[["ix-two-factor-auth-required"]],decls:13,vars:0,consts:[["fxFlex","","fxLayout","column","fxLayoutAlign","center center",1,"ix-surface"],[1,"ix-status-card"],[1,"ix-status-card__icon"],["type","button","mat-button","","color","primary",3,"click"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0)(1,"mat-card",1)(2,"div",2)(3,"mat-icon"),\u0275\u0275text(4,"error"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(5,"mat-card-header")(6,"mat-card-title"),\u0275\u0275text(7,"Two-factor authentication is required"),\u0275\u0275elementEnd()(),\u0275\u0275elementStart(8,"mat-card-actions")(9,"button",3),\u0275\u0275listener("click",function(){return ctx.useMockData()}),\u0275\u0275text(10,"Use mock data"),\u0275\u0275elementEnd(),\u0275\u0275elementStart(11,"button",3),\u0275\u0275listener("click",function(){return ctx.switchCompany()}),\u0275\u0275text(12,"Switch company"),\u0275\u0275elementEnd()()()())},dependencies:[FlexModule,DefaultLayoutDirective,DefaultLayoutAlignDirective,DefaultFlexDirective,MatButtonModule,MatButton,MatCardModule,MatCard,MatCardActions,MatCardHeader,MatCardTitle,MatIconModule,MatIcon],styles:["[_nghost-%COMP%]{width:100%;height:100%}"],changeDetection:0});let TwoFactorAuthRequiredComponent2=_TwoFactorAuthRequiredComponent;return TwoFactorAuthRequiredComponent2})();var routes=[{path:"",canActivate:[AppGuard2],children:[{path:"",component:BuilderComponent,canActivate:__use_api_mocks__?[BuilderGuard]:[AuthCompanyGuard,BuilderGuard]},{path:"settings",loadChildren:()=>import("./chunk-ZRG35KOL.js").then(m=>m.SettingsModule)},...__use_api_mocks__?[]:[{path:"login",component:LoginExpiredComponent,canActivate:[LoginExpiredCanActivateGuard]},{path:"my-companies",redirectTo:"settings"},{path:"two-factor-auth-required",component:TwoFactorAuthRequiredComponent}]]},{path:"manifest-invalid",component:ManifestInvalidComponent},{path:"**",redirectTo:""}];var AppRoutingConfig={routerState:RouterState?.Minimal,serializer:CustomRouterStateSerializer};var AppRoutingModule=(()=>{let _AppRoutingModule=class _AppRoutingModule{};_AppRoutingModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppRoutingModule)},_AppRoutingModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppRoutingModule}),_AppRoutingModule.\u0275inj=\u0275\u0275defineInjector({imports:[RouterModule.forRoot(routes,{onSameUrlNavigation:"reload",preloadingStrategy:CustomPreloadingStrategy}),StoreRouterConnectingModule.forRoot(AppRoutingConfig),RouterModule]});let AppRoutingModule2=_AppRoutingModule;return AppRoutingModule2})();var PERFORM_ACTION="PERFORM_ACTION",REFRESH="REFRESH",RESET="RESET",ROLLBACK="ROLLBACK",COMMIT="COMMIT",SWEEP="SWEEP",TOGGLE_ACTION="TOGGLE_ACTION",SET_ACTIONS_ACTIVE="SET_ACTIONS_ACTIVE",JUMP_TO_STATE="JUMP_TO_STATE",JUMP_TO_ACTION="JUMP_TO_ACTION",IMPORT_STATE="IMPORT_STATE",LOCK_CHANGES="LOCK_CHANGES",PAUSE_RECORDING="PAUSE_RECORDING",PerformAction=class{constructor(action,timestamp2){if(this.action=action,this.timestamp=timestamp2,this.type=PERFORM_ACTION,typeof action.type>"u")throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?')}},Refresh=class{constructor(){this.type=REFRESH}},Reset=class{constructor(timestamp2){this.timestamp=timestamp2,this.type=RESET}},Rollback=class{constructor(timestamp2){this.timestamp=timestamp2,this.type=ROLLBACK}},Commit=class{constructor(timestamp2){this.timestamp=timestamp2,this.type=COMMIT}},Sweep=class{constructor(){this.type=SWEEP}},ToggleAction=class{constructor(id){this.id=id,this.type=TOGGLE_ACTION}};var JumpToState=class{constructor(index){this.index=index,this.type=JUMP_TO_STATE}},JumpToAction=class{constructor(actionId){this.actionId=actionId,this.type=JUMP_TO_ACTION}},ImportState=class{constructor(nextLiftedState){this.nextLiftedState=nextLiftedState,this.type=IMPORT_STATE}},LockChanges=class{constructor(status){this.status=status,this.type=LOCK_CHANGES}},PauseRecording=class{constructor(status){this.status=status,this.type=PAUSE_RECORDING}};var STORE_DEVTOOLS_CONFIG=new InjectionToken("@ngrx/store-devtools Options"),INITIAL_OPTIONS=new InjectionToken("@ngrx/store-devtools Initial Config");function noMonitor(){return null}var DEFAULT_NAME="NgRx Store DevTools";function createConfig(optionsInput){let DEFAULT_OPTIONS2={maxAge:!1,monitor:noMonitor,actionSanitizer:void 0,stateSanitizer:void 0,name:DEFAULT_NAME,serialize:!1,logOnly:!1,autoPause:!1,trace:!1,traceLimit:75,features:{pause:!0,lock:!0,persist:!0,export:!0,import:"custom",jump:!0,skip:!0,reorder:!0,dispatch:!0,test:!0},connectInZone:!1},options=typeof optionsInput=="function"?optionsInput():optionsInput,logOnly=options.logOnly?{pause:!0,export:!0,test:!0}:!1,features2=options.features||logOnly||DEFAULT_OPTIONS2.features;features2.import===!0&&(features2.import="custom");let config3=Object.assign({},DEFAULT_OPTIONS2,{features:features2},options);if(config3.maxAge&&config3.maxAge<2)throw new Error(`Devtools 'maxAge' cannot be less than 2, got ${config3.maxAge}`);return config3}function difference(first2,second){return first2.filter(item=>second.indexOf(item)<0)}function unliftState(liftedState){let{computedStates,currentStateIndex}=liftedState;if(currentStateIndex>=computedStates.length){let{state:state2}=computedStates[computedStates.length-1];return state2}let{state}=computedStates[currentStateIndex];return state}function liftAction(action){return new PerformAction(action,+Date.now())}function sanitizeActions(actionSanitizer,actions){return Object.keys(actions).reduce((sanitizedActions,actionIdx)=>{let idx=Number(actionIdx);return sanitizedActions[idx]=sanitizeAction(actionSanitizer,actions[idx],idx),sanitizedActions},{})}function sanitizeAction(actionSanitizer,action,actionIdx){return __spreadProps(__spreadValues({},action),{action:actionSanitizer(action.action,actionIdx)})}function sanitizeStates(stateSanitizer,states){return states.map((computedState,idx)=>({state:sanitizeState(stateSanitizer,computedState.state,idx),error:computedState.error}))}function sanitizeState(stateSanitizer,state,stateIdx){return stateSanitizer(state,stateIdx)}function shouldFilterActions(config3){return config3.predicate||config3.actionsSafelist||config3.actionsBlocklist}function filterLiftedState(liftedState,predicate,safelist,blocklist){let filteredStagedActionIds=[],filteredActionsById={},filteredComputedStates=[];return liftedState.stagedActionIds.forEach((id,idx)=>{let liftedAction=liftedState.actionsById[id];liftedAction&&(idx&&isActionFiltered(liftedState.computedStates[idx],liftedAction,predicate,safelist,blocklist)||(filteredActionsById[id]=liftedAction,filteredStagedActionIds.push(id),filteredComputedStates.push(liftedState.computedStates[idx])))}),__spreadProps(__spreadValues({},liftedState),{stagedActionIds:filteredStagedActionIds,actionsById:filteredActionsById,computedStates:filteredComputedStates})}function isActionFiltered(state,action,predicate,safelist,blockedlist){let predicateMatch=predicate&&!predicate(state,action.action),safelistMatch=safelist&&!action.action.type.match(safelist.map(s2=>escapeRegExp(s2)).join("|")),blocklistMatch=blockedlist&&action.action.type.match(blockedlist.map(s2=>escapeRegExp(s2)).join("|"));return predicateMatch||safelistMatch||blocklistMatch}function escapeRegExp(s2){return s2.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function injectZoneConfig(connectInZone){return{ngZone:connectInZone?inject(NgZone):null,connectInZone}}var DevtoolsDispatcher=(()=>{let _DevtoolsDispatcher=class _DevtoolsDispatcher extends ActionsSubject{};_DevtoolsDispatcher.\u0275fac=(()=>{let \u0275DevtoolsDispatcher_BaseFactory;return function(__ngFactoryType__){return(\u0275DevtoolsDispatcher_BaseFactory||(\u0275DevtoolsDispatcher_BaseFactory=\u0275\u0275getInheritedFactory(_DevtoolsDispatcher)))(__ngFactoryType__||_DevtoolsDispatcher)}})(),_DevtoolsDispatcher.\u0275prov=\u0275\u0275defineInjectable({token:_DevtoolsDispatcher,factory:_DevtoolsDispatcher.\u0275fac});let DevtoolsDispatcher2=_DevtoolsDispatcher;return DevtoolsDispatcher2})(),ExtensionActionTypes={START:"START",DISPATCH:"DISPATCH",STOP:"STOP",ACTION:"ACTION"},REDUX_DEVTOOLS_EXTENSION=new InjectionToken("@ngrx/store-devtools Redux Devtools Extension"),DevtoolsExtension=(()=>{let _DevtoolsExtension=class _DevtoolsExtension{constructor(devtoolsExtension,config3,dispatcher){this.config=config3,this.dispatcher=dispatcher,this.zoneConfig=injectZoneConfig(this.config.connectInZone),this.devtoolsExtension=devtoolsExtension,this.createActionStreams()}notify(action,state){if(this.devtoolsExtension)if(action.type===PERFORM_ACTION){if(state.isLocked||state.isPaused)return;let currentState=unliftState(state);if(shouldFilterActions(this.config)&&isActionFiltered(currentState,action,this.config.predicate,this.config.actionsSafelist,this.config.actionsBlocklist))return;let sanitizedState=this.config.stateSanitizer?sanitizeState(this.config.stateSanitizer,currentState,state.currentStateIndex):currentState,sanitizedAction=this.config.actionSanitizer?sanitizeAction(this.config.actionSanitizer,action,state.nextActionId):action;this.sendToReduxDevtools(()=>this.extensionConnection.send(sanitizedAction,sanitizedState))}else{let sanitizedLiftedState=__spreadProps(__spreadValues({},state),{stagedActionIds:state.stagedActionIds,actionsById:this.config.actionSanitizer?sanitizeActions(this.config.actionSanitizer,state.actionsById):state.actionsById,computedStates:this.config.stateSanitizer?sanitizeStates(this.config.stateSanitizer,state.computedStates):state.computedStates});this.sendToReduxDevtools(()=>this.devtoolsExtension.send(null,sanitizedLiftedState,this.getExtensionConfig(this.config)))}}createChangesObservable(){return this.devtoolsExtension?new Observable(subscriber=>{let connection=this.zoneConfig.connectInZone?this.zoneConfig.ngZone.runOutsideAngular(()=>this.devtoolsExtension.connect(this.getExtensionConfig(this.config))):this.devtoolsExtension.connect(this.getExtensionConfig(this.config));return this.extensionConnection=connection,connection.init(),connection.subscribe(change=>subscriber.next(change)),connection.unsubscribe}):EMPTY}createActionStreams(){let changes$=this.createChangesObservable().pipe(share()),start$=changes$.pipe(filter(change=>change.type===ExtensionActionTypes.START)),stop$=changes$.pipe(filter(change=>change.type===ExtensionActionTypes.STOP)),liftedActions$=changes$.pipe(filter(change=>change.type===ExtensionActionTypes.DISPATCH),map(change=>this.unwrapAction(change.payload)),concatMap(action=>action.type===IMPORT_STATE?this.dispatcher.pipe(filter(action2=>action2.type===UPDATE),timeout(1e3),debounceTime(1e3),map(()=>action),catchError(()=>of(action)),take(1)):of(action))),actionsUntilStop$=changes$.pipe(filter(change=>change.type===ExtensionActionTypes.ACTION),map(change=>this.unwrapAction(change.payload))).pipe(takeUntil(stop$)),liftedUntilStop$=liftedActions$.pipe(takeUntil(stop$));this.start$=start$.pipe(takeUntil(stop$)),this.actions$=this.start$.pipe(switchMap(()=>actionsUntilStop$)),this.liftedActions$=this.start$.pipe(switchMap(()=>liftedUntilStop$))}unwrapAction(action){return typeof action=="string"?(0,eval)(`(${action})`):action}getExtensionConfig(config3){let extensionOptions={name:config3.name,features:config3.features,serialize:config3.serialize,autoPause:config3.autoPause??!1,trace:config3.trace??!1,traceLimit:config3.traceLimit??75};return config3.maxAge!==!1&&(extensionOptions.maxAge=config3.maxAge),extensionOptions}sendToReduxDevtools(send){try{send()}catch(err){console.warn("@ngrx/store-devtools: something went wrong inside the redux devtools",err)}}};_DevtoolsExtension.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_DevtoolsExtension)(\u0275\u0275inject(REDUX_DEVTOOLS_EXTENSION),\u0275\u0275inject(STORE_DEVTOOLS_CONFIG),\u0275\u0275inject(DevtoolsDispatcher))},_DevtoolsExtension.\u0275prov=\u0275\u0275defineInjectable({token:_DevtoolsExtension,factory:_DevtoolsExtension.\u0275fac});let DevtoolsExtension2=_DevtoolsExtension;return DevtoolsExtension2})(),INIT_ACTION={type:INIT},RECOMPUTE="@ngrx/store-devtools/recompute",RECOMPUTE_ACTION={type:RECOMPUTE};function computeNextEntry(reducer48,action,state,error2,errorHandler){if(error2)return{state,error:"Interrupted by an error up the chain"};let nextState=state,nextError;try{nextState=reducer48(state,action)}catch(err){nextError=err.toString(),errorHandler.handleError(err)}return{state:nextState,error:nextError}}function recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused){if(minInvalidatedStateIndex>=computedStates.length&&computedStates.length===stagedActionIds.length)return computedStates;let nextComputedStates=computedStates.slice(0,minInvalidatedStateIndex),lastIncludedActionId=stagedActionIds.length-(isPaused?1:0);for(let i=minInvalidatedStateIndex;i<lastIncludedActionId;i++){let actionId=stagedActionIds[i],action=actionsById[actionId].action,previousEntry=nextComputedStates[i-1],previousState=previousEntry?previousEntry.state:committedState,previousError=previousEntry?previousEntry.error:void 0,entry=skippedActionIds.indexOf(actionId)>-1?previousEntry:computeNextEntry(reducer48,action,previousState,previousError,errorHandler);nextComputedStates.push(entry)}return isPaused&&nextComputedStates.push(computedStates[computedStates.length-1]),nextComputedStates}function liftInitialState(initialCommittedState,monitorReducer){return{monitorState:monitorReducer(void 0,{}),nextActionId:1,actionsById:{0:liftAction(INIT_ACTION)},stagedActionIds:[0],skippedActionIds:[],committedState:initialCommittedState,currentStateIndex:0,computedStates:[],isLocked:!1,isPaused:!1}}function liftReducerWith(initialCommittedState,initialLiftedState,errorHandler,monitorReducer,options={}){return reducer48=>(liftedState,liftedAction)=>{let{monitorState,actionsById,nextActionId,stagedActionIds,skippedActionIds,committedState,currentStateIndex,computedStates,isLocked,isPaused}=liftedState||initialLiftedState;liftedState||(actionsById=Object.create(actionsById));function commitExcessActions(n2){let excess=n2,idsToDelete=stagedActionIds.slice(1,excess+1);for(let i=0;i<idsToDelete.length;i++)if(computedStates[i+1].error){excess=i,idsToDelete=stagedActionIds.slice(1,excess+1);break}else delete actionsById[idsToDelete[i]];skippedActionIds=skippedActionIds.filter(id=>idsToDelete.indexOf(id)===-1),stagedActionIds=[0,...stagedActionIds.slice(excess+1)],committedState=computedStates[excess].state,computedStates=computedStates.slice(excess),currentStateIndex=currentStateIndex>excess?currentStateIndex-excess:0}function commitChanges(){actionsById={0:liftAction(INIT_ACTION)},nextActionId=1,stagedActionIds=[0],skippedActionIds=[],committedState=computedStates[currentStateIndex].state,currentStateIndex=0,computedStates=[]}let minInvalidatedStateIndex=0;switch(liftedAction.type){case LOCK_CHANGES:{isLocked=liftedAction.status,minInvalidatedStateIndex=1/0;break}case PAUSE_RECORDING:{isPaused=liftedAction.status,isPaused?(stagedActionIds=[...stagedActionIds,nextActionId],actionsById[nextActionId]=new PerformAction({type:"@ngrx/devtools/pause"},+Date.now()),nextActionId++,minInvalidatedStateIndex=stagedActionIds.length-1,computedStates=computedStates.concat(computedStates[computedStates.length-1]),currentStateIndex===stagedActionIds.length-2&&currentStateIndex++,minInvalidatedStateIndex=1/0):commitChanges();break}case RESET:{actionsById={0:liftAction(INIT_ACTION)},nextActionId=1,stagedActionIds=[0],skippedActionIds=[],committedState=initialCommittedState,currentStateIndex=0,computedStates=[];break}case COMMIT:{commitChanges();break}case ROLLBACK:{actionsById={0:liftAction(INIT_ACTION)},nextActionId=1,stagedActionIds=[0],skippedActionIds=[],currentStateIndex=0,computedStates=[];break}case TOGGLE_ACTION:{let{id:actionId}=liftedAction;skippedActionIds.indexOf(actionId)===-1?skippedActionIds=[actionId,...skippedActionIds]:skippedActionIds=skippedActionIds.filter(id=>id!==actionId),minInvalidatedStateIndex=stagedActionIds.indexOf(actionId);break}case SET_ACTIONS_ACTIVE:{let{start:start3,end:end2,active}=liftedAction,actionIds=[];for(let i=start3;i<end2;i++)actionIds.push(i);active?skippedActionIds=difference(skippedActionIds,actionIds):skippedActionIds=[...skippedActionIds,...actionIds],minInvalidatedStateIndex=stagedActionIds.indexOf(start3);break}case JUMP_TO_STATE:{currentStateIndex=liftedAction.index,minInvalidatedStateIndex=1/0;break}case JUMP_TO_ACTION:{let index=stagedActionIds.indexOf(liftedAction.actionId);index!==-1&&(currentStateIndex=index),minInvalidatedStateIndex=1/0;break}case SWEEP:{stagedActionIds=difference(stagedActionIds,skippedActionIds),skippedActionIds=[],currentStateIndex=Math.min(currentStateIndex,stagedActionIds.length-1);break}case PERFORM_ACTION:{if(isLocked)return liftedState||initialLiftedState;if(isPaused||liftedState&&isActionFiltered(liftedState.computedStates[currentStateIndex],liftedAction,options.predicate,options.actionsSafelist,options.actionsBlocklist)){let lastState=computedStates[computedStates.length-1];computedStates=[...computedStates.slice(0,-1),computeNextEntry(reducer48,liftedAction.action,lastState.state,lastState.error,errorHandler)],minInvalidatedStateIndex=1/0;break}options.maxAge&&stagedActionIds.length===options.maxAge&&commitExcessActions(1),currentStateIndex===stagedActionIds.length-1&&currentStateIndex++;let actionId=nextActionId++;actionsById[actionId]=liftedAction,stagedActionIds=[...stagedActionIds,actionId],minInvalidatedStateIndex=stagedActionIds.length-1;break}case IMPORT_STATE:{({monitorState,actionsById,nextActionId,stagedActionIds,skippedActionIds,committedState,currentStateIndex,computedStates,isLocked,isPaused}=liftedAction.nextLiftedState);break}case INIT:{minInvalidatedStateIndex=0,options.maxAge&&stagedActionIds.length>options.maxAge&&(computedStates=recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused),commitExcessActions(stagedActionIds.length-options.maxAge),minInvalidatedStateIndex=1/0);break}case UPDATE:{if(computedStates.filter(state=>state.error).length>0)minInvalidatedStateIndex=0,options.maxAge&&stagedActionIds.length>options.maxAge&&(computedStates=recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused),commitExcessActions(stagedActionIds.length-options.maxAge),minInvalidatedStateIndex=1/0);else{if(!isPaused&&!isLocked){currentStateIndex===stagedActionIds.length-1&&currentStateIndex++;let actionId=nextActionId++;actionsById[actionId]=new PerformAction(liftedAction,+Date.now()),stagedActionIds=[...stagedActionIds,actionId],minInvalidatedStateIndex=stagedActionIds.length-1,computedStates=recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused)}computedStates=computedStates.map(cmp=>__spreadProps(__spreadValues({},cmp),{state:reducer48(cmp.state,RECOMPUTE_ACTION)})),currentStateIndex=stagedActionIds.length-1,options.maxAge&&stagedActionIds.length>options.maxAge&&commitExcessActions(stagedActionIds.length-options.maxAge),minInvalidatedStateIndex=1/0}break}default:{minInvalidatedStateIndex=1/0;break}}return computedStates=recomputeStates(computedStates,minInvalidatedStateIndex,reducer48,committedState,actionsById,stagedActionIds,skippedActionIds,errorHandler,isPaused),monitorState=monitorReducer(monitorState,liftedAction),{monitorState,actionsById,nextActionId,stagedActionIds,skippedActionIds,committedState,currentStateIndex,computedStates,isLocked,isPaused}}}var StoreDevtools=(()=>{let _StoreDevtools=class _StoreDevtools{constructor(dispatcher,actions$,reducers$,extension,scannedActions,errorHandler,initialState54,config3){let liftedInitialState=liftInitialState(initialState54,config3.monitor),liftReducer=liftReducerWith(initialState54,liftedInitialState,errorHandler,config3.monitor,config3),liftedAction$=merge(merge(actions$.asObservable().pipe(skip(1)),extension.actions$).pipe(map(liftAction)),dispatcher,extension.liftedActions$).pipe(observeOn(queueScheduler)),liftedReducer$=reducers$.pipe(map(liftReducer)),zoneConfig=injectZoneConfig(config3.connectInZone),liftedStateSubject=new ReplaySubject(1);this.liftedStateSubscription=liftedAction$.pipe(withLatestFrom(liftedReducer$),emitInZone(zoneConfig),scan(({state:liftedState},[action,reducer48])=>{let reducedLiftedState=reducer48(liftedState,action);return action.type!==PERFORM_ACTION&&shouldFilterActions(config3)&&(reducedLiftedState=filterLiftedState(reducedLiftedState,config3.predicate,config3.actionsSafelist,config3.actionsBlocklist)),extension.notify(action,reducedLiftedState),{state:reducedLiftedState,action}},{state:liftedInitialState,action:null})).subscribe(({state,action})=>{if(liftedStateSubject.next(state),action.type===PERFORM_ACTION){let unliftedAction=action.action;scannedActions.next(unliftedAction)}}),this.extensionStartSubscription=extension.start$.pipe(emitInZone(zoneConfig)).subscribe(()=>{this.refresh()});let liftedState$=liftedStateSubject.asObservable(),state$=liftedState$.pipe(map(unliftState));Object.defineProperty(state$,"state",{value:toSignal(state$,{manualCleanup:!0,requireSync:!0})}),this.dispatcher=dispatcher,this.liftedState=liftedState$,this.state=state$}ngOnDestroy(){this.liftedStateSubscription.unsubscribe(),this.extensionStartSubscription.unsubscribe()}dispatch(action){this.dispatcher.next(action)}next(action){this.dispatcher.next(action)}error(error2){}complete(){}performAction(action){this.dispatch(new PerformAction(action,+Date.now()))}refresh(){this.dispatch(new Refresh)}reset(){this.dispatch(new Reset(+Date.now()))}rollback(){this.dispatch(new Rollback(+Date.now()))}commit(){this.dispatch(new Commit(+Date.now()))}sweep(){this.dispatch(new Sweep)}toggleAction(id){this.dispatch(new ToggleAction(id))}jumpToAction(actionId){this.dispatch(new JumpToAction(actionId))}jumpToState(index){this.dispatch(new JumpToState(index))}importState(nextLiftedState){this.dispatch(new ImportState(nextLiftedState))}lockChanges(status){this.dispatch(new LockChanges(status))}pauseRecording(status){this.dispatch(new PauseRecording(status))}};_StoreDevtools.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_StoreDevtools)(\u0275\u0275inject(DevtoolsDispatcher),\u0275\u0275inject(ActionsSubject),\u0275\u0275inject(ReducerObservable),\u0275\u0275inject(DevtoolsExtension),\u0275\u0275inject(ScannedActionsSubject),\u0275\u0275inject(ErrorHandler),\u0275\u0275inject(INITIAL_STATE),\u0275\u0275inject(STORE_DEVTOOLS_CONFIG))},_StoreDevtools.\u0275prov=\u0275\u0275defineInjectable({token:_StoreDevtools,factory:_StoreDevtools.\u0275fac});let StoreDevtools2=_StoreDevtools;return StoreDevtools2})();function emitInZone({ngZone,connectInZone}){return source=>connectInZone?new Observable(subscriber=>source.subscribe({next:value=>ngZone.run(()=>subscriber.next(value)),error:error2=>ngZone.run(()=>subscriber.error(error2)),complete:()=>ngZone.run(()=>subscriber.complete())})):source}var IS_EXTENSION_OR_MONITOR_PRESENT=new InjectionToken("@ngrx/store-devtools Is Devtools Extension or Monitor Present");function createIsExtensionOrMonitorPresent(extension,config3){return!!extension||config3.monitor!==noMonitor}function createReduxDevtoolsExtension(){let extensionKey="__REDUX_DEVTOOLS_EXTENSION__";return typeof window=="object"&&typeof window[extensionKey]<"u"?window[extensionKey]:null}function createStateObservable(devtools){return devtools.state}function provideStoreDevtools(options={}){return makeEnvironmentProviders([DevtoolsExtension,DevtoolsDispatcher,StoreDevtools,{provide:INITIAL_OPTIONS,useValue:options},{provide:IS_EXTENSION_OR_MONITOR_PRESENT,deps:[REDUX_DEVTOOLS_EXTENSION,STORE_DEVTOOLS_CONFIG],useFactory:createIsExtensionOrMonitorPresent},{provide:REDUX_DEVTOOLS_EXTENSION,useFactory:createReduxDevtoolsExtension},{provide:STORE_DEVTOOLS_CONFIG,deps:[INITIAL_OPTIONS],useFactory:createConfig},{provide:StateObservable,deps:[StoreDevtools],useFactory:createStateObservable},{provide:ReducerManagerDispatcher,useExisting:DevtoolsDispatcher}])}var StoreDevtoolsModule=(()=>{let _StoreDevtoolsModule=class _StoreDevtoolsModule{static instrument(options={}){return{ngModule:_StoreDevtoolsModule,providers:[provideStoreDevtools(options)]}}};_StoreDevtoolsModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_StoreDevtoolsModule)},_StoreDevtoolsModule.\u0275mod=\u0275\u0275defineNgModule({type:_StoreDevtoolsModule}),_StoreDevtoolsModule.\u0275inj=\u0275\u0275defineInjector({});let StoreDevtoolsModule2=_StoreDevtoolsModule;return StoreDevtoolsModule2})();var GLOBAL_OBJ=globalThis;var DEBUG_BUILD=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var SDK_VERSION="9.12.0";function getMainCarrier(){return getSentryCarrier(GLOBAL_OBJ),GLOBAL_OBJ}function getSentryCarrier(carrier){let __SENTRY__=carrier.__SENTRY__=carrier.__SENTRY__||{};return __SENTRY__.version=__SENTRY__.version||SDK_VERSION,__SENTRY__[SDK_VERSION]=__SENTRY__[SDK_VERSION]||{}}function getGlobalSingleton(name,creator,obj=GLOBAL_OBJ){let __SENTRY__=obj.__SENTRY__=obj.__SENTRY__||{},carrier=__SENTRY__[SDK_VERSION]=__SENTRY__[SDK_VERSION]||{};return carrier[name]||(carrier[name]=creator())}var PREFIX="Sentry Logger ",CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],originalConsoleMethods={};function consoleSandbox(callback){if(!("console"in GLOBAL_OBJ))return callback();let console2=GLOBAL_OBJ.console,wrappedFuncs={},wrappedLevels=Object.keys(originalConsoleMethods);wrappedLevels.forEach(level=>{let originalConsoleMethod=originalConsoleMethods[level];wrappedFuncs[level]=console2[level],console2[level]=originalConsoleMethod});try{return callback()}finally{wrappedLevels.forEach(level=>{console2[level]=wrappedFuncs[level]})}}function makeLogger(){let enabled=!1,logger2={enable:()=>{enabled=!0},disable:()=>{enabled=!1},isEnabled:()=>enabled};return DEBUG_BUILD?CONSOLE_LEVELS.forEach(name=>{logger2[name]=(...args)=>{enabled&&consoleSandbox(()=>{GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`,...args)})}}):CONSOLE_LEVELS.forEach(name=>{logger2[name]=()=>{}}),logger2}var logger=getGlobalSingleton("logger",makeLogger);var ONE_SECOND_IN_MS=1e3;function dateTimestampInSeconds(){return Date.now()/ONE_SECOND_IN_MS}function createUnixTimestampInSecondsFunc(){let{performance:performance2}=GLOBAL_OBJ;if(!performance2?.now)return dateTimestampInSeconds;let approxStartingTimeOrigin=Date.now()-performance2.now(),timeOrigin=performance2.timeOrigin==null?approxStartingTimeOrigin:performance2.timeOrigin;return()=>(timeOrigin+performance2.now())/ONE_SECOND_IN_MS}var timestampInSeconds=createUnixTimestampInSecondsFunc();var objectToString=Object.prototype.toString;function isBuiltin(wat,className){return objectToString.call(wat)===`[object ${className}]`}function isPlainObject(wat){return isBuiltin(wat,"Object")}function isThenable(wat){return!!(wat?.then&&typeof wat.then=="function")}function truncate(str,max2=0){return typeof str!="string"||max2===0||str.length<=max2?str:`${str.slice(0,max2)}...`}function addNonEnumerableProperty(obj,name,value){try{Object.defineProperty(obj,name,{value,writable:!0,configurable:!0})}catch{DEBUG_BUILD&&logger.log(`Failed to add non-enumerable property "${name}" to object`,obj)}}function getCrypto(){let gbl=GLOBAL_OBJ;return gbl.crypto||gbl.msCrypto}function uuid4(crypto2=getCrypto()){let getRandomByte=()=>Math.random()*16;try{if(crypto2?.randomUUID)return crypto2.randomUUID().replace(/-/g,"");crypto2?.getRandomValues&&(getRandomByte=()=>{let typedArray=new Uint8Array(1);return crypto2.getRandomValues(typedArray),typedArray[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,c=>(c^(getRandomByte()&15)>>c/4).toString(16))}function updateSession(session,context3={}){if(context3.user&&(!session.ipAddress&&context3.user.ip_address&&(session.ipAddress=context3.user.ip_address),!session.did&&!context3.did&&(session.did=context3.user.id||context3.user.email||context3.user.username)),session.timestamp=context3.timestamp||timestampInSeconds(),context3.abnormal_mechanism&&(session.abnormal_mechanism=context3.abnormal_mechanism),context3.ignoreDuration&&(session.ignoreDuration=context3.ignoreDuration),context3.sid&&(session.sid=context3.sid.length===32?context3.sid:uuid4()),context3.init!==void 0&&(session.init=context3.init),!session.did&&context3.did&&(session.did=`${context3.did}`),typeof context3.started=="number"&&(session.started=context3.started),session.ignoreDuration)session.duration=void 0;else if(typeof context3.duration=="number")session.duration=context3.duration;else{let duration=session.timestamp-session.started;session.duration=duration>=0?duration:0}context3.release&&(session.release=context3.release),context3.environment&&(session.environment=context3.environment),!session.ipAddress&&context3.ipAddress&&(session.ipAddress=context3.ipAddress),!session.userAgent&&context3.userAgent&&(session.userAgent=context3.userAgent),typeof context3.errors=="number"&&(session.errors=context3.errors),context3.status&&(session.status=context3.status)}function generateTraceId(){return uuid4()}function merge3(initialObj,mergeObj,levels=2){if(!mergeObj||typeof mergeObj!="object"||levels<=0)return mergeObj;if(initialObj&&Object.keys(mergeObj).length===0)return initialObj;let output2=__spreadValues({},initialObj);for(let key in mergeObj)Object.prototype.hasOwnProperty.call(mergeObj,key)&&(output2[key]=merge3(output2[key],mergeObj[key],levels-1));return output2}var SCOPE_SPAN_FIELD="_sentrySpan";function _setSpanForScope(scope,span){span?addNonEnumerableProperty(scope,SCOPE_SPAN_FIELD,span):delete scope[SCOPE_SPAN_FIELD]}function _getSpanForScope(scope){return scope[SCOPE_SPAN_FIELD]}var DEFAULT_MAX_BREADCRUMBS=100,Scope=class _Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:generateTraceId(),sampleRand:Math.random()}}clone(){let newScope=new _Scope;return newScope._breadcrumbs=[...this._breadcrumbs],newScope._tags=__spreadValues({},this._tags),newScope._extra=__spreadValues({},this._extra),newScope._contexts=__spreadValues({},this._contexts),this._contexts.flags&&(newScope._contexts.flags={values:[...this._contexts.flags.values]}),newScope._user=this._user,newScope._level=this._level,newScope._session=this._session,newScope._transactionName=this._transactionName,newScope._fingerprint=this._fingerprint,newScope._eventProcessors=[...this._eventProcessors],newScope._attachments=[...this._attachments],newScope._sdkProcessingMetadata=__spreadValues({},this._sdkProcessingMetadata),newScope._propagationContext=__spreadValues({},this._propagationContext),newScope._client=this._client,newScope._lastEventId=this._lastEventId,_setSpanForScope(newScope,_getSpanForScope(this)),newScope}setClient(client){this._client=client}setLastEventId(lastEventId2){this._lastEventId=lastEventId2}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(callback){this._scopeListeners.push(callback)}addEventProcessor(callback){return this._eventProcessors.push(callback),this}setUser(user){return this._user=user||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession(this._session,{user}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(tags){return this._tags=__spreadValues(__spreadValues({},this._tags),tags),this._notifyScopeListeners(),this}setTag(key,value){return this._tags=__spreadProps(__spreadValues({},this._tags),{[key]:value}),this._notifyScopeListeners(),this}setExtras(extras){return this._extra=__spreadValues(__spreadValues({},this._extra),extras),this._notifyScopeListeners(),this}setExtra(key,extra){return this._extra=__spreadProps(__spreadValues({},this._extra),{[key]:extra}),this._notifyScopeListeners(),this}setFingerprint(fingerprint){return this._fingerprint=fingerprint,this._notifyScopeListeners(),this}setLevel(level){return this._level=level,this._notifyScopeListeners(),this}setTransactionName(name){return this._transactionName=name,this._notifyScopeListeners(),this}setContext(key,context3){return context3===null?delete this._contexts[key]:this._contexts[key]=context3,this._notifyScopeListeners(),this}setSession(session){return session?this._session=session:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(captureContext){if(!captureContext)return this;let scopeToMerge=typeof captureContext=="function"?captureContext(this):captureContext,scopeInstance=scopeToMerge instanceof _Scope?scopeToMerge.getScopeData():isPlainObject(scopeToMerge)?captureContext:void 0,{tags,extra,user,contexts,level,fingerprint=[],propagationContext}=scopeInstance||{};return this._tags=__spreadValues(__spreadValues({},this._tags),tags),this._extra=__spreadValues(__spreadValues({},this._extra),extra),this._contexts=__spreadValues(__spreadValues({},this._contexts),contexts),user&&Object.keys(user).length&&(this._user=user),level&&(this._level=level),fingerprint.length&&(this._fingerprint=fingerprint),propagationContext&&(this._propagationContext=propagationContext),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,_setSpanForScope(this,void 0),this._attachments=[],this.setPropagationContext({traceId:generateTraceId(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(breadcrumb,maxBreadcrumbs){let maxCrumbs=typeof maxBreadcrumbs=="number"?maxBreadcrumbs:DEFAULT_MAX_BREADCRUMBS;if(maxCrumbs<=0)return this;let mergedBreadcrumb=__spreadProps(__spreadValues({timestamp:dateTimestampInSeconds()},breadcrumb),{message:breadcrumb.message?truncate(breadcrumb.message,2048):breadcrumb.message});return this._breadcrumbs.push(mergedBreadcrumb),this._breadcrumbs.length>maxCrumbs&&(this._breadcrumbs=this._breadcrumbs.slice(-maxCrumbs),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(attachment){return this._attachments.push(attachment),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope(this)}}setSDKProcessingMetadata(newData){return this._sdkProcessingMetadata=merge3(this._sdkProcessingMetadata,newData,2),this}setPropagationContext(context3){return this._propagationContext=context3,this}getPropagationContext(){return this._propagationContext}captureException(exception,hint){let eventId=hint?.event_id||uuid4();if(!this._client)return logger.warn("No client configured on scope - will not capture exception!"),eventId;let syntheticException=new Error("Sentry syntheticException");return this._client.captureException(exception,__spreadProps(__spreadValues({originalException:exception,syntheticException},hint),{event_id:eventId}),this),eventId}captureMessage(message,level,hint){let eventId=hint?.event_id||uuid4();if(!this._client)return logger.warn("No client configured on scope - will not capture message!"),eventId;let syntheticException=new Error(message);return this._client.captureMessage(message,level,__spreadProps(__spreadValues({originalException:message,syntheticException},hint),{event_id:eventId}),this),eventId}captureEvent(event2,hint){let eventId=hint?.event_id||uuid4();return this._client?(this._client.captureEvent(event2,__spreadProps(__spreadValues({},hint),{event_id:eventId}),this),eventId):(logger.warn("No client configured on scope - will not capture event!"),eventId)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(callback=>{callback(this)}),this._notifyingListeners=!1)}};function getDefaultCurrentScope(){return getGlobalSingleton("defaultCurrentScope",()=>new Scope)}function getDefaultIsolationScope(){return getGlobalSingleton("defaultIsolationScope",()=>new Scope)}var AsyncContextStack=class{constructor(scope,isolationScope){let assignedScope;scope?assignedScope=scope:assignedScope=new Scope;let assignedIsolationScope;isolationScope?assignedIsolationScope=isolationScope:assignedIsolationScope=new Scope,this._stack=[{scope:assignedScope}],this._isolationScope=assignedIsolationScope}withScope(callback){let scope=this._pushScope(),maybePromiseResult;try{maybePromiseResult=callback(scope)}catch(e){throw this._popScope(),e}return isThenable(maybePromiseResult)?maybePromiseResult.then(res=>(this._popScope(),res),e=>{throw this._popScope(),e}):(this._popScope(),maybePromiseResult)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let scope=this.getScope().clone();return this._stack.push({client:this.getClient(),scope}),scope}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function getAsyncContextStack(){let registry=getMainCarrier(),sentry=getSentryCarrier(registry);return sentry.stack=sentry.stack||new AsyncContextStack(getDefaultCurrentScope(),getDefaultIsolationScope())}function withScope(callback){return getAsyncContextStack().withScope(callback)}function withSetScope(scope,callback){let stack=getAsyncContextStack();return stack.withScope(()=>(stack.getStackTop().scope=scope,callback(scope)))}function withIsolationScope(callback){return getAsyncContextStack().withScope(()=>callback(getAsyncContextStack().getIsolationScope()))}function getStackAsyncContextStrategy(){return{withIsolationScope,withScope,withSetScope,withSetIsolationScope:(_isolationScope,callback)=>withIsolationScope(callback),getCurrentScope:()=>getAsyncContextStack().getScope(),getIsolationScope:()=>getAsyncContextStack().getIsolationScope()}}function getAsyncContextStrategy(carrier){let sentry=getSentryCarrier(carrier);return sentry.acs?sentry.acs:getStackAsyncContextStrategy()}function getCurrentScope(){let carrier=getMainCarrier();return getAsyncContextStrategy(carrier).getCurrentScope()}function getIsolationScope(){let carrier=getMainCarrier();return getAsyncContextStrategy(carrier).getIsolationScope()}function getClient(){return getCurrentScope().getClient()}var DEFAULT_BREADCRUMBS=100;function addBreadcrumb(breadcrumb,hint){let client=getClient(),isolationScope=getIsolationScope();if(!client)return;let{beforeBreadcrumb=null,maxBreadcrumbs=DEFAULT_BREADCRUMBS}=client.getOptions();if(maxBreadcrumbs<=0)return;let timestamp2=dateTimestampInSeconds(),mergedBreadcrumb=__spreadValues({timestamp:timestamp2},breadcrumb),finalBreadcrumb=beforeBreadcrumb?consoleSandbox(()=>beforeBreadcrumb(mergedBreadcrumb,hint)):mergedBreadcrumb;finalBreadcrumb!==null&&(client.emit&&client.emit("beforeAddBreadcrumb",finalBreadcrumb,hint),isolationScope.addBreadcrumb(finalBreadcrumb,maxBreadcrumbs))}function sentryNgrxMetaReducer(reducer48){return function(state,action){return addBreadcrumb({category:"ngrx",message:action.type,level:"info"}),reducer48(state,action)}}var reducers={router:routerReducer},metaReducers=environment.production?[sentryNgrxMetaReducer]:[];var AppEffects=(()=>{let _AppEffects=class _AppEffects{constructor(actions$,location2,router){this.actions$=actions$,this.location=location2,this.router=router,this.company2faRequired$=createEffect(()=>this.actions$.pipe(ofType(loadMeFailure3),mergeMap(({errors:errors2})=>errors2.some(error2=>error2.message===IxApiRequestErrorMessages.TWO_FACTOR_AUTH_REQUIRED)?of(redirectTo2faRequired()):EMPTY))),this.redirectTo2faRequired$=createEffect(()=>this.actions$.pipe(ofType(redirectTo2faRequired),tap(()=>{this.router.navigate(["/two-factor-auth-required"],{skipLocationChange:!0})})),{dispatch:!1})}};_AppEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(Location),\u0275\u0275inject(Router))},_AppEffects.\u0275prov=\u0275\u0275defineInjectable({token:_AppEffects,factory:_AppEffects.\u0275fac});let AppEffects2=_AppEffects;return AppEffects2})();var AppStateModule=(()=>{let _AppStateModule=class _AppStateModule{};_AppStateModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppStateModule)},_AppStateModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppStateModule}),_AppStateModule.\u0275inj=\u0275\u0275defineInjector({imports:[TranslateModule,StoreModule.forRoot(reducers,{metaReducers,runtimeChecks:{strictStateImmutability:!environment.production,strictActionImmutability:!environment.production,strictStateSerializability:!environment.production}}),environment.production?[]:[StoreDevtoolsModule.instrument({maxAge:50,connectInZone:!0})],EffectsModule.forRoot([AppEffects])]});let AppStateModule2=_AppStateModule;return AppStateModule2})();function generateBanner(metadata,translate){let header=document.createElement("div");return header.innerHTML=`
838
838
  <div id="appBanner" style="display: flex; top: 0; left: 0; width: 100%; height: 80px; position: absolute; justify-content: center; background-color: #f2f2f2;">
839
839
  <div style="display: flex; justify-content: flex-start; width: 100vw; color: black;">
840
840
  <div style="justify-content: flex-start; max-width: 330px; display: flex; align-items: center; flex: 1;">
@@ -896,4 +896,4 @@ ${end2.comment}`:end2.comment}this.doc.range[2]=end2.offset;break}default:this.e
896
896
  >OPEN</a>
897
897
  </div>
898
898
  </div>
899
- `,header}function insertBanner(banner,offset3){document.getElementById("appBanner")?.remove(),document.documentElement.style.setProperty("--app-banner-offset",offset3),document.body.append(banner)}var utils={generateBanner,genericBanner,insertBanner};var AppBannerService=(()=>{let _AppBannerService=class _AppBannerService{constructor(capacitorPlatform,translate,http,platform,store){this.capacitorPlatform=capacitorPlatform,this.http=http,this.platform=platform,this.store=store,this.destroy=inject(DestroyRef),environment.appName==="Portal"&&this.capacitorPlatform==="web"&&(this.platform.ANDROID||this.platform.IOS)&&this.store.select(selectSectorAndHostLoaded).pipe(distinctUntilChanged(),filter(loaded=>loaded),mergeMap(()=>this.store.select(selectActiveBranding)),takeUntilDestroyed(this.destroy)).subscribe(branding=>{if(branding?.appleAppStoreLink&&this.getAppInfo(branding.appleAppStoreLink).subscribe(appInfo=>{if(!appInfo||typeof appInfo!="object"||!(appInfo.trackName||appInfo.artworkUrl512))return;let banner=utils.generateBanner({appLink:branding.googlePlayStoreLink&&this.platform.ANDROID?branding.googlePlayStoreLink:branding.appleAppStoreLink,appName:appInfo.trackName,imageLink:appInfo.artworkUrl512},translate);utils.insertBanner(banner,"80px")}),branding?.googlePlayStoreLink&&!branding?.appleAppStoreLink){let banner=utils.genericBanner(branding.googlePlayStoreLink,translate);utils.insertBanner(banner,"50px")}})}getAppInfo(appleAppStoreLink,cacheBust=Date.now()){let matches=appleAppStoreLink.match(/.*id([0-9]+)/);if(!matches)return EMPTY;let appId=matches[1];return this.http.get(`https://itunes.apple.com/lookup?id=${appId}&cacheBust=${cacheBust}`).pipe(map(response=>response.results[0]),catchError(()=>EMPTY))}};_AppBannerService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppBannerService)(\u0275\u0275inject(CAPACITOR_PLATFORM),\u0275\u0275inject(TranslateService),\u0275\u0275inject(HttpClient),\u0275\u0275inject(Platform),\u0275\u0275inject(Store))},_AppBannerService.\u0275prov=\u0275\u0275defineInjectable({token:_AppBannerService,factory:_AppBannerService.\u0275fac,providedIn:"root"});let AppBannerService2=_AppBannerService;return AppBannerService2})();var BrandingEffects2=(()=>{let _BrandingEffects=class _BrandingEffects{constructor(actions$,store,favicon,meta,title,translate){this.actions$=actions$,this.store=store,this.favicon=favicon,this.meta=meta,this.title=title,this.translate=translate,this.companyBranding$=createEffect(()=>this.store.select(selectMyCompany).pipe(map(company=>company?.branding?omit_default(company.branding,["appleTouchIcon","name"]):null),distinctUntilChanged(isEqual_default),map(branding=>branding?setCompanyBranding({branding}):removeCompanyBranding()))),this.hostBranding$=createEffect(()=>this.actions$.pipe(ofType(loadHostSuccess),map(({data})=>data),map(branding=>setHostBranding({branding})))),this.sectorBranding$=createEffect(()=>this.actions$.pipe(ofType(loadMeSuccess),map(({data})=>data.branding||null),map(branding=>setSectorBranding({branding})))),this.logout$=createEffect(()=>this.actions$.pipe(ofType(logOutSuccess,loggedOutByApi,loggedOutByStorage),map(()=>removeCompanyBranding()))),this.favicon$=createEffect(()=>this.store.select(selectSectorAndHostLoaded).pipe(distinctUntilChanged(),mergeMap(loaded=>loaded?this.store.select(selectActiveBranding):EMPTY),tap(branding=>{branding?.favicon&&this.favicon.set("icon",branding.favicon,FEATURE_NAME10)})),{dispatch:!1}),this.appName$=createEffect(()=>this.store.select(selectSectorAndHostLoaded).pipe(distinctUntilChanged(),mergeMap(loaded=>loaded?this.store.select(selectActiveBranding):EMPTY),mergeMap(branding=>branding?.custom?.glbBrowserTitle?of(branding.custom.glbBrowserTitle):this.store.select(selectMySector).pipe(take(1),map(sector=>sector?.branding?.custom?.glbBrowserTitle?sector.branding.custom.glbBrowserTitle:sector?.name||""))),tap(appName=>{this.meta.updateTag({name:"application-name",content:appName}),this.meta.updateTag({name:"apple-mobile-web-app-title",content:appName})})),{dispatch:!1}),this.title$=createEffect(()=>this.store.select(selectSectorAndHostLoaded).pipe(distinctUntilChanged(),mergeMap(loaded=>loaded?this.store.select(selectActiveBranding):EMPTY),mergeMap(branding=>branding?.custom?.glbBrowserTitle?of(branding.custom.glbBrowserTitle):this.store.select(selectMySector).pipe(take(1),map(sector=>sector?.branding?.custom?.glbBrowserTitle?sector.branding.custom.glbBrowserTitle:sector?.name||""))),switchMap(newTitle=>this.actions$.pipe(ofType(ROUTER_NAVIGATED),tap(action=>{action.payload.routerState.url.startsWith("/login")?(this.title.setTitle(this.translate.instant("LOG_IN_TO_YOUR_SITE_ACCOUNT",{site:newTitle})),this.meta.updateTag({name:"description",content:this.translate.instant("__MESSAGE__.LOG_IN_PAGE_DESCRIPTION",{site:newTitle})})):this.title.setTitle(`${environment.appName}${newTitle?" - "+newTitle:""}`)})))),{dispatch:!1})}};_BrandingEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BrandingEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(Store),\u0275\u0275inject(Favicon),\u0275\u0275inject(Meta),\u0275\u0275inject(Title),\u0275\u0275inject(TranslateService))},_BrandingEffects.\u0275prov=\u0275\u0275defineInjectable({token:_BrandingEffects,factory:_BrandingEffects.\u0275fac});let BrandingEffects3=_BrandingEffects;return BrandingEffects3})();var BrandingInterceptor=(()=>{let _BrandingInterceptor=class _BrandingInterceptor{constructor(document2,store){this.document=document2,this.store=store}intercept(request,delegate){return request.context.get(REQUIRES_BRANDING)===!0?this.store.select(selectSectorAndHostLoaded).pipe(filter(loaded=>loaded),take(1),withLatestFrom(this.store.select(selectActiveFqdn)),mergeMap(([,fqdn])=>{let branding=fqdn||(this.document.location.hostname==="localhost"?".localhost":this.document.location.hostname);return delegate.handle(request.clone({setHeaders:{[IxApiHeaderKeys.Branding]:branding}}))})):delegate.handle(request)}};_BrandingInterceptor.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BrandingInterceptor)(\u0275\u0275inject(DOCUMENT),\u0275\u0275inject(Store))},_BrandingInterceptor.\u0275prov=\u0275\u0275defineInjectable({token:_BrandingInterceptor,factory:_BrandingInterceptor.\u0275fac,providedIn:"root"});let BrandingInterceptor2=_BrandingInterceptor;return BrandingInterceptor2})();var BrandingModule2=(()=>{let _BrandingModule=class _BrandingModule{constructor(_appBannerService){}};_BrandingModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BrandingModule)(\u0275\u0275inject(AppBannerService))},_BrandingModule.\u0275mod=\u0275\u0275defineNgModule({type:_BrandingModule}),_BrandingModule.\u0275inj=\u0275\u0275defineInjector({providers:[{provide:HTTP_INTERCEPTORS,useClass:BrandingInterceptor,multi:!0},provideHttpClient(withInterceptorsFromDi())],imports:[FaviconModule,EffectsModule.forFeature([BrandingEffects2]),StoreModule.forFeature(feature8)]});let BrandingModule3=_BrandingModule;return BrandingModule3})();function mapTranslationsToObject(translations,languageCode){return{__TRANSLATION__:translations.reduce((obj,translation)=>{if(translation.languages&&translation.key){let language=translation.languages[languageCode];if(language)return __spreadProps(__spreadValues({},obj),{[translation.key]:language})}return obj},{})}}function mergeTranslationsFactory(translate){return function(translations,languageCode){translate.setTranslation(languageCode,Object.assign(translate.translations[languageCode],mapTranslationsToObject(translations,languageCode)))}}var CustomTranslationsEffects=(()=>{let _CustomTranslationsEffects=class _CustomTranslationsEffects{constructor(actions$,store,translate){this.actions$=actions$,this.store=store,this.translate=translate,this.changes$=createEffect(()=>this.actions$.pipe(ofType(loadAllSuccess55),switchMap(()=>this.store.select(selectAll44)),distinctUntilChanged(isEqual_default),tap(translations=>this.translate.langs.forEach(lang=>this._merge(translations,lang))),mergeMap(()=>[invalidateTranslations6(),invalidateTranslations3(),invalidateTranslations(),invalidateTranslations2(),invalidateTranslations4(),invalidateTranslations5()]))),this.langChanges$=createEffect(()=>this.translate.onLangChange.pipe(skip(1),concatLatestFrom(()=>this.store.select(selectAll44)),tap(([,translations])=>this.translate.langs.forEach(lang=>this._merge(translations,lang))),mergeMap(()=>[invalidateTranslations6(),invalidateTranslations3(),invalidateTranslations(),invalidateTranslations2(),invalidateTranslations4(),invalidateTranslations5()]))),this._merge=mergeTranslationsFactory(this.translate)}};_CustomTranslationsEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(Store),\u0275\u0275inject(TranslateService))},_CustomTranslationsEffects.\u0275prov=\u0275\u0275defineInjectable({token:_CustomTranslationsEffects,factory:_CustomTranslationsEffects.\u0275fac});let CustomTranslationsEffects2=_CustomTranslationsEffects;return CustomTranslationsEffects2})(),CustomTranslationsOnLoadEffects=(()=>{let _CustomTranslationsOnLoadEffects=class _CustomTranslationsOnLoadEffects{constructor(actions$){this.actions$=actions$,this.companyLoad$=createEffect(()=>this.actions$.pipe(ofType(loadMe3),map(()=>loadAll54())))}};_CustomTranslationsOnLoadEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsOnLoadEffects)(\u0275\u0275inject(Actions))},_CustomTranslationsOnLoadEffects.\u0275prov=\u0275\u0275defineInjectable({token:_CustomTranslationsOnLoadEffects,factory:_CustomTranslationsOnLoadEffects.\u0275fac});let CustomTranslationsOnLoadEffects2=_CustomTranslationsOnLoadEffects;return CustomTranslationsOnLoadEffects2})();var CustomTranslationsGuard=(()=>{let _CustomTranslationsGuard=class _CustomTranslationsGuard{constructor(store){this.store=store}canActivate(){return this.store.select(selectAllLoaded33).pipe(filter(Boolean),take(1))}};_CustomTranslationsGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsGuard)(\u0275\u0275inject(Store))},_CustomTranslationsGuard.\u0275prov=\u0275\u0275defineInjectable({token:_CustomTranslationsGuard,factory:_CustomTranslationsGuard.\u0275fac,providedIn:"root"});let CustomTranslationsGuard2=_CustomTranslationsGuard;return CustomTranslationsGuard2})();var CustomTranslationsLoadingStrategy=function(CustomTranslationsLoadingStrategy2){return CustomTranslationsLoadingStrategy2[CustomTranslationsLoadingStrategy2.None=0]="None",CustomTranslationsLoadingStrategy2[CustomTranslationsLoadingStrategy2.Default=1]="Default",CustomTranslationsLoadingStrategy2}(CustomTranslationsLoadingStrategy||{});var CustomTranslationsDefaultModule=(()=>{let _CustomTranslationsDefaultModule=class _CustomTranslationsDefaultModule{};_CustomTranslationsDefaultModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsDefaultModule)},_CustomTranslationsDefaultModule.\u0275mod=\u0275\u0275defineNgModule({type:_CustomTranslationsDefaultModule}),_CustomTranslationsDefaultModule.\u0275inj=\u0275\u0275defineInjector({imports:[EffectsModule.forFeature([CustomTranslationsEffects,CustomTranslationsOnLoadEffects])]});let CustomTranslationsDefaultModule2=_CustomTranslationsDefaultModule;return CustomTranslationsDefaultModule2})(),CustomTranslationsMinimalModule=(()=>{let _CustomTranslationsMinimalModule=class _CustomTranslationsMinimalModule{};_CustomTranslationsMinimalModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsMinimalModule)},_CustomTranslationsMinimalModule.\u0275mod=\u0275\u0275defineNgModule({type:_CustomTranslationsMinimalModule}),_CustomTranslationsMinimalModule.\u0275inj=\u0275\u0275defineInjector({imports:[EffectsModule.forFeature([CustomTranslationsEffects])]});let CustomTranslationsMinimalModule2=_CustomTranslationsMinimalModule;return CustomTranslationsMinimalModule2})(),CustomTranslationsModule=(()=>{let _CustomTranslationsModule=class _CustomTranslationsModule{static forRoot(config3){return config3?.loadingStrategy===CustomTranslationsLoadingStrategy.None?{ngModule:CustomTranslationsMinimalModule}:{ngModule:CustomTranslationsDefaultModule,providers:[{provide:AUTH_COMPANY_GUARD_RESOLVERS,useFactory:guard=>()=>guard.canActivate(),deps:[CustomTranslationsGuard],multi:!0}]}}};_CustomTranslationsModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsModule)},_CustomTranslationsModule.\u0275mod=\u0275\u0275defineNgModule({type:_CustomTranslationsModule}),_CustomTranslationsModule.\u0275inj=\u0275\u0275defineInjector({});let CustomTranslationsModule2=_CustomTranslationsModule;return CustomTranslationsModule2})();var theming_effects_exports={};__export(theming_effects_exports,{removeCompanyTheme:()=>removeCompanyTheme,setCompanyTheme:()=>setCompanyTheme,setHostTheme:()=>setHostTheme,setSectorTheme:()=>setSectorTheme});var import_tinycolor22=__toESM(require_tinycolor());function signum(num){return num<0?-1:num===0?0:1}function lerp(start3,stop2,amount){return(1-amount)*start3+amount*stop2}function clampInt(min2,max2,input2){return input2<min2?min2:input2>max2?max2:input2}function clampDouble(min2,max2,input2){return input2<min2?min2:input2>max2?max2:input2}function sanitizeDegreesDouble(degrees){return degrees=degrees%360,degrees<0&&(degrees=degrees+360),degrees}function matrixMultiply(row,matrix){let a=row[0]*matrix[0][0]+row[1]*matrix[0][1]+row[2]*matrix[0][2],b=row[0]*matrix[1][0]+row[1]*matrix[1][1]+row[2]*matrix[1][2],c=row[0]*matrix[2][0]+row[1]*matrix[2][1]+row[2]*matrix[2][2];return[a,b,c]}var SRGB_TO_XYZ=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],XYZ_TO_SRGB=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],WHITE_POINT_D65=[95.047,100,108.883];function argbFromRgb(red,green,blue){return(255<<24|(red&255)<<16|(green&255)<<8|blue&255)>>>0}function argbFromLinrgb(linrgb){let r=delinearized(linrgb[0]),g=delinearized(linrgb[1]),b=delinearized(linrgb[2]);return argbFromRgb(r,g,b)}function redFromArgb(argb){return argb>>16&255}function greenFromArgb(argb){return argb>>8&255}function blueFromArgb(argb){return argb&255}function argbFromXyz(x,y,z){let matrix=XYZ_TO_SRGB,linearR=matrix[0][0]*x+matrix[0][1]*y+matrix[0][2]*z,linearG=matrix[1][0]*x+matrix[1][1]*y+matrix[1][2]*z,linearB=matrix[2][0]*x+matrix[2][1]*y+matrix[2][2]*z,r=delinearized(linearR),g=delinearized(linearG),b=delinearized(linearB);return argbFromRgb(r,g,b)}function xyzFromArgb(argb){let r=linearized(redFromArgb(argb)),g=linearized(greenFromArgb(argb)),b=linearized(blueFromArgb(argb));return matrixMultiply([r,g,b],SRGB_TO_XYZ)}function argbFromLstar(lstar){let y=yFromLstar(lstar),component=delinearized(y);return argbFromRgb(component,component,component)}function lstarFromArgb(argb){let y=xyzFromArgb(argb)[1];return 116*labF(y/100)-16}function yFromLstar(lstar){return 100*labInvf((lstar+16)/116)}function lstarFromY(y){return labF(y/100)*116-16}function linearized(rgbComponent){let normalized=rgbComponent/255;return normalized<=.040449936?normalized/12.92*100:Math.pow((normalized+.055)/1.055,2.4)*100}function delinearized(rgbComponent){let normalized=rgbComponent/100,delinearized2=0;return normalized<=.0031308?delinearized2=normalized*12.92:delinearized2=1.055*Math.pow(normalized,1/2.4)-.055,clampInt(0,255,Math.round(delinearized2*255))}function whitePointD65(){return WHITE_POINT_D65}function labF(t){let e=.008856451679035631,kappa=24389/27;return t>e?Math.pow(t,1/3):(kappa*t+16)/116}function labInvf(ft){let e=.008856451679035631,kappa=24389/27,ft3=ft*ft*ft;return ft3>e?ft3:(116*ft-16)/kappa}var ViewingConditions=class _ViewingConditions{static make(whitePoint=whitePointD65(),adaptingLuminance=200/Math.PI*yFromLstar(50)/100,backgroundLstar=50,surround=2,discountingIlluminant=!1){let xyz=whitePoint,rW=xyz[0]*.401288+xyz[1]*.650173+xyz[2]*-.051461,gW=xyz[0]*-.250268+xyz[1]*1.204414+xyz[2]*.045854,bW=xyz[0]*-.002079+xyz[1]*.048952+xyz[2]*.953127,f=.8+surround/10,c=f>=.9?lerp(.59,.69,(f-.9)*10):lerp(.525,.59,(f-.8)*10),d=discountingIlluminant?1:f*(1-1/3.6*Math.exp((-adaptingLuminance-42)/92));d=d>1?1:d<0?0:d;let nc=f,rgbD=[d*(100/rW)+1-d,d*(100/gW)+1-d,d*(100/bW)+1-d],k=1/(5*adaptingLuminance+1),k4=k*k*k*k,k4F=1-k4,fl=k4*adaptingLuminance+.1*k4F*k4F*Math.cbrt(5*adaptingLuminance),n2=yFromLstar(backgroundLstar)/whitePoint[1],z=1.48+Math.sqrt(n2),nbb=.725/Math.pow(n2,.2),ncb=nbb,rgbAFactors=[Math.pow(fl*rgbD[0]*rW/100,.42),Math.pow(fl*rgbD[1]*gW/100,.42),Math.pow(fl*rgbD[2]*bW/100,.42)],rgbA=[400*rgbAFactors[0]/(rgbAFactors[0]+27.13),400*rgbAFactors[1]/(rgbAFactors[1]+27.13),400*rgbAFactors[2]/(rgbAFactors[2]+27.13)],aw=(2*rgbA[0]+rgbA[1]+.05*rgbA[2])*nbb;return new _ViewingConditions(n2,aw,nbb,ncb,c,nc,rgbD,fl,Math.pow(fl,.25),z)}constructor(n2,aw,nbb,ncb,c,nc,rgbD,fl,fLRoot,z){this.n=n2,this.aw=aw,this.nbb=nbb,this.ncb=ncb,this.c=c,this.nc=nc,this.rgbD=rgbD,this.fl=fl,this.fLRoot=fLRoot,this.z=z}};ViewingConditions.DEFAULT=ViewingConditions.make();var Cam16=class _Cam16{constructor(hue,chroma,j,q,m,s2,jstar,astar,bstar){this.hue=hue,this.chroma=chroma,this.j=j,this.q=q,this.m=m,this.s=s2,this.jstar=jstar,this.astar=astar,this.bstar=bstar}distance(other){let dJ=this.jstar-other.jstar,dA=this.astar-other.astar,dB=this.bstar-other.bstar,dEPrime=Math.sqrt(dJ*dJ+dA*dA+dB*dB);return 1.41*Math.pow(dEPrime,.63)}static fromInt(argb){return _Cam16.fromIntInViewingConditions(argb,ViewingConditions.DEFAULT)}static fromIntInViewingConditions(argb,viewingConditions){let red=(argb&16711680)>>16,green=(argb&65280)>>8,blue=argb&255,redL=linearized(red),greenL=linearized(green),blueL=linearized(blue),x=.41233895*redL+.35762064*greenL+.18051042*blueL,y=.2126*redL+.7152*greenL+.0722*blueL,z=.01932141*redL+.11916382*greenL+.95034478*blueL,rC=.401288*x+.650173*y-.051461*z,gC=-.250268*x+1.204414*y+.045854*z,bC=-.002079*x+.048952*y+.953127*z,rD=viewingConditions.rgbD[0]*rC,gD=viewingConditions.rgbD[1]*gC,bD=viewingConditions.rgbD[2]*bC,rAF=Math.pow(viewingConditions.fl*Math.abs(rD)/100,.42),gAF=Math.pow(viewingConditions.fl*Math.abs(gD)/100,.42),bAF=Math.pow(viewingConditions.fl*Math.abs(bD)/100,.42),rA=signum(rD)*400*rAF/(rAF+27.13),gA=signum(gD)*400*gAF/(gAF+27.13),bA=signum(bD)*400*bAF/(bAF+27.13),a=(11*rA+-12*gA+bA)/11,b=(rA+gA-2*bA)/9,u=(20*rA+20*gA+21*bA)/20,p2=(40*rA+20*gA+bA)/20,atanDegrees=Math.atan2(b,a)*180/Math.PI,hue=atanDegrees<0?atanDegrees+360:atanDegrees>=360?atanDegrees-360:atanDegrees,hueRadians=hue*Math.PI/180,ac=p2*viewingConditions.nbb,j=100*Math.pow(ac/viewingConditions.aw,viewingConditions.c*viewingConditions.z),q=4/viewingConditions.c*Math.sqrt(j/100)*(viewingConditions.aw+4)*viewingConditions.fLRoot,huePrime=hue<20.14?hue+360:hue,eHue=.25*(Math.cos(huePrime*Math.PI/180+2)+3.8),t=5e4/13*eHue*viewingConditions.nc*viewingConditions.ncb*Math.sqrt(a*a+b*b)/(u+.305),alpha=Math.pow(t,.9)*Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),c=alpha*Math.sqrt(j/100),m=c*viewingConditions.fLRoot,s2=50*Math.sqrt(alpha*viewingConditions.c/(viewingConditions.aw+4)),jstar=(1+100*.007)*j/(1+.007*j),mstar=1/.0228*Math.log(1+.0228*m),astar=mstar*Math.cos(hueRadians),bstar=mstar*Math.sin(hueRadians);return new _Cam16(hue,c,j,q,m,s2,jstar,astar,bstar)}static fromJch(j,c,h){return _Cam16.fromJchInViewingConditions(j,c,h,ViewingConditions.DEFAULT)}static fromJchInViewingConditions(j,c,h,viewingConditions){let q=4/viewingConditions.c*Math.sqrt(j/100)*(viewingConditions.aw+4)*viewingConditions.fLRoot,m=c*viewingConditions.fLRoot,alpha=c/Math.sqrt(j/100),s2=50*Math.sqrt(alpha*viewingConditions.c/(viewingConditions.aw+4)),hueRadians=h*Math.PI/180,jstar=(1+100*.007)*j/(1+.007*j),mstar=1/.0228*Math.log(1+.0228*m),astar=mstar*Math.cos(hueRadians),bstar=mstar*Math.sin(hueRadians);return new _Cam16(h,c,j,q,m,s2,jstar,astar,bstar)}static fromUcs(jstar,astar,bstar){return _Cam16.fromUcsInViewingConditions(jstar,astar,bstar,ViewingConditions.DEFAULT)}static fromUcsInViewingConditions(jstar,astar,bstar,viewingConditions){let a=astar,b=bstar,m=Math.sqrt(a*a+b*b),c=(Math.exp(m*.0228)-1)/.0228/viewingConditions.fLRoot,h=Math.atan2(b,a)*(180/Math.PI);h<0&&(h+=360);let j=jstar/(1-(jstar-100)*.007);return _Cam16.fromJchInViewingConditions(j,c,h,viewingConditions)}toInt(){return this.viewed(ViewingConditions.DEFAULT)}viewed(viewingConditions){let alpha=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),t=Math.pow(alpha/Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),1/.9),hRad=this.hue*Math.PI/180,eHue=.25*(Math.cos(hRad+2)+3.8),ac=viewingConditions.aw*Math.pow(this.j/100,1/viewingConditions.c/viewingConditions.z),p1=eHue*(5e4/13)*viewingConditions.nc*viewingConditions.ncb,p2=ac/viewingConditions.nbb,hSin=Math.sin(hRad),hCos=Math.cos(hRad),gamma=23*(p2+.305)*t/(23*p1+11*t*hCos+108*t*hSin),a=gamma*hCos,b=gamma*hSin,rA=(460*p2+451*a+288*b)/1403,gA=(460*p2-891*a-261*b)/1403,bA=(460*p2-220*a-6300*b)/1403,rCBase=Math.max(0,27.13*Math.abs(rA)/(400-Math.abs(rA))),rC=signum(rA)*(100/viewingConditions.fl)*Math.pow(rCBase,1/.42),gCBase=Math.max(0,27.13*Math.abs(gA)/(400-Math.abs(gA))),gC=signum(gA)*(100/viewingConditions.fl)*Math.pow(gCBase,1/.42),bCBase=Math.max(0,27.13*Math.abs(bA)/(400-Math.abs(bA))),bC=signum(bA)*(100/viewingConditions.fl)*Math.pow(bCBase,1/.42),rF=rC/viewingConditions.rgbD[0],gF=gC/viewingConditions.rgbD[1],bF=bC/viewingConditions.rgbD[2],x=1.86206786*rF-1.01125463*gF+.14918677*bF,y=.38752654*rF+.62144744*gF-.00897398*bF,z=-.0158415*rF-.03412294*gF+1.04996444*bF;return argbFromXyz(x,y,z)}static fromXyzInViewingConditions(x,y,z,viewingConditions){let rC=.401288*x+.650173*y-.051461*z,gC=-.250268*x+1.204414*y+.045854*z,bC=-.002079*x+.048952*y+.953127*z,rD=viewingConditions.rgbD[0]*rC,gD=viewingConditions.rgbD[1]*gC,bD=viewingConditions.rgbD[2]*bC,rAF=Math.pow(viewingConditions.fl*Math.abs(rD)/100,.42),gAF=Math.pow(viewingConditions.fl*Math.abs(gD)/100,.42),bAF=Math.pow(viewingConditions.fl*Math.abs(bD)/100,.42),rA=signum(rD)*400*rAF/(rAF+27.13),gA=signum(gD)*400*gAF/(gAF+27.13),bA=signum(bD)*400*bAF/(bAF+27.13),a=(11*rA+-12*gA+bA)/11,b=(rA+gA-2*bA)/9,u=(20*rA+20*gA+21*bA)/20,p2=(40*rA+20*gA+bA)/20,atanDegrees=Math.atan2(b,a)*180/Math.PI,hue=atanDegrees<0?atanDegrees+360:atanDegrees>=360?atanDegrees-360:atanDegrees,hueRadians=hue*Math.PI/180,ac=p2*viewingConditions.nbb,J=100*Math.pow(ac/viewingConditions.aw,viewingConditions.c*viewingConditions.z),Q=4/viewingConditions.c*Math.sqrt(J/100)*(viewingConditions.aw+4)*viewingConditions.fLRoot,huePrime=hue<20.14?hue+360:hue,eHue=1/4*(Math.cos(huePrime*Math.PI/180+2)+3.8),t=5e4/13*eHue*viewingConditions.nc*viewingConditions.ncb*Math.sqrt(a*a+b*b)/(u+.305),alpha=Math.pow(t,.9)*Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),C=alpha*Math.sqrt(J/100),M=C*viewingConditions.fLRoot,s2=50*Math.sqrt(alpha*viewingConditions.c/(viewingConditions.aw+4)),jstar=(1+100*.007)*J/(1+.007*J),mstar=Math.log(1+.0228*M)/.0228,astar=mstar*Math.cos(hueRadians),bstar=mstar*Math.sin(hueRadians);return new _Cam16(hue,C,J,Q,M,s2,jstar,astar,bstar)}xyzInViewingConditions(viewingConditions){let alpha=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),t=Math.pow(alpha/Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),1/.9),hRad=this.hue*Math.PI/180,eHue=.25*(Math.cos(hRad+2)+3.8),ac=viewingConditions.aw*Math.pow(this.j/100,1/viewingConditions.c/viewingConditions.z),p1=eHue*(5e4/13)*viewingConditions.nc*viewingConditions.ncb,p2=ac/viewingConditions.nbb,hSin=Math.sin(hRad),hCos=Math.cos(hRad),gamma=23*(p2+.305)*t/(23*p1+11*t*hCos+108*t*hSin),a=gamma*hCos,b=gamma*hSin,rA=(460*p2+451*a+288*b)/1403,gA=(460*p2-891*a-261*b)/1403,bA=(460*p2-220*a-6300*b)/1403,rCBase=Math.max(0,27.13*Math.abs(rA)/(400-Math.abs(rA))),rC=signum(rA)*(100/viewingConditions.fl)*Math.pow(rCBase,1/.42),gCBase=Math.max(0,27.13*Math.abs(gA)/(400-Math.abs(gA))),gC=signum(gA)*(100/viewingConditions.fl)*Math.pow(gCBase,1/.42),bCBase=Math.max(0,27.13*Math.abs(bA)/(400-Math.abs(bA))),bC=signum(bA)*(100/viewingConditions.fl)*Math.pow(bCBase,1/.42),rF=rC/viewingConditions.rgbD[0],gF=gC/viewingConditions.rgbD[1],bF=bC/viewingConditions.rgbD[2],x=1.86206786*rF-1.01125463*gF+.14918677*bF,y=.38752654*rF+.62144744*gF-.00897398*bF,z=-.0158415*rF-.03412294*gF+1.04996444*bF;return[x,y,z]}};var HctSolver=(()=>{class HctSolver2{static sanitizeRadians(angle){return(angle+Math.PI*8)%(Math.PI*2)}static trueDelinearized(rgbComponent){let normalized=rgbComponent/100,delinearized2=0;return normalized<=.0031308?delinearized2=normalized*12.92:delinearized2=1.055*Math.pow(normalized,1/2.4)-.055,delinearized2*255}static chromaticAdaptation(component){let af=Math.pow(Math.abs(component),.42);return signum(component)*400*af/(af+27.13)}static hueOf(linrgb){let scaledDiscount=matrixMultiply(linrgb,HctSolver2.SCALED_DISCOUNT_FROM_LINRGB),rA=HctSolver2.chromaticAdaptation(scaledDiscount[0]),gA=HctSolver2.chromaticAdaptation(scaledDiscount[1]),bA=HctSolver2.chromaticAdaptation(scaledDiscount[2]),a=(11*rA+-12*gA+bA)/11,b=(rA+gA-2*bA)/9;return Math.atan2(b,a)}static areInCyclicOrder(a,b,c){let deltaAB=HctSolver2.sanitizeRadians(b-a),deltaAC=HctSolver2.sanitizeRadians(c-a);return deltaAB<deltaAC}static intercept(source,mid,target){return(mid-source)/(target-source)}static lerpPoint(source,t,target){return[source[0]+(target[0]-source[0])*t,source[1]+(target[1]-source[1])*t,source[2]+(target[2]-source[2])*t]}static setCoordinate(source,coordinate,target,axis){let t=HctSolver2.intercept(source[axis],coordinate,target[axis]);return HctSolver2.lerpPoint(source,t,target)}static isBounded(x){return 0<=x&&x<=100}static nthVertex(y,n2){let kR=HctSolver2.Y_FROM_LINRGB[0],kG=HctSolver2.Y_FROM_LINRGB[1],kB=HctSolver2.Y_FROM_LINRGB[2],coordA=n2%4<=1?0:100,coordB=n2%2===0?0:100;if(n2<4){let g=coordA,b=coordB,r=(y-g*kG-b*kB)/kR;return HctSolver2.isBounded(r)?[r,g,b]:[-1,-1,-1]}else if(n2<8){let b=coordA,r=coordB,g=(y-r*kR-b*kB)/kG;return HctSolver2.isBounded(g)?[r,g,b]:[-1,-1,-1]}else{let r=coordA,g=coordB,b=(y-r*kR-g*kG)/kB;return HctSolver2.isBounded(b)?[r,g,b]:[-1,-1,-1]}}static bisectToSegment(y,targetHue){let left2=[-1,-1,-1],right2=left2,leftHue=0,rightHue=0,initialized=!1,uncut=!0;for(let n2=0;n2<12;n2++){let mid=HctSolver2.nthVertex(y,n2);if(mid[0]<0)continue;let midHue=HctSolver2.hueOf(mid);if(!initialized){left2=mid,right2=mid,leftHue=midHue,rightHue=midHue,initialized=!0;continue}(uncut||HctSolver2.areInCyclicOrder(leftHue,midHue,rightHue))&&(uncut=!1,HctSolver2.areInCyclicOrder(leftHue,targetHue,midHue)?(right2=mid,rightHue=midHue):(left2=mid,leftHue=midHue))}return[left2,right2]}static midpoint(a,b){return[(a[0]+b[0])/2,(a[1]+b[1])/2,(a[2]+b[2])/2]}static criticalPlaneBelow(x){return Math.floor(x-.5)}static criticalPlaneAbove(x){return Math.ceil(x-.5)}static bisectToLimit(y,targetHue){let segment=HctSolver2.bisectToSegment(y,targetHue),left2=segment[0],leftHue=HctSolver2.hueOf(left2),right2=segment[1];for(let axis=0;axis<3;axis++)if(left2[axis]!==right2[axis]){let lPlane=-1,rPlane=255;left2[axis]<right2[axis]?(lPlane=HctSolver2.criticalPlaneBelow(HctSolver2.trueDelinearized(left2[axis])),rPlane=HctSolver2.criticalPlaneAbove(HctSolver2.trueDelinearized(right2[axis]))):(lPlane=HctSolver2.criticalPlaneAbove(HctSolver2.trueDelinearized(left2[axis])),rPlane=HctSolver2.criticalPlaneBelow(HctSolver2.trueDelinearized(right2[axis])));for(let i=0;i<8&&!(Math.abs(rPlane-lPlane)<=1);i++){let mPlane=Math.floor((lPlane+rPlane)/2),midPlaneCoordinate=HctSolver2.CRITICAL_PLANES[mPlane],mid=HctSolver2.setCoordinate(left2,midPlaneCoordinate,right2,axis),midHue=HctSolver2.hueOf(mid);HctSolver2.areInCyclicOrder(leftHue,targetHue,midHue)?(right2=mid,rPlane=mPlane):(left2=mid,leftHue=midHue,lPlane=mPlane)}}return HctSolver2.midpoint(left2,right2)}static inverseChromaticAdaptation(adapted){let adaptedAbs=Math.abs(adapted),base=Math.max(0,27.13*adaptedAbs/(400-adaptedAbs));return signum(adapted)*Math.pow(base,1/.42)}static findResultByJ(hueRadians,chroma,y){let j=Math.sqrt(y)*11,viewingConditions=ViewingConditions.DEFAULT,tInnerCoeff=1/Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),p1=.25*(Math.cos(hueRadians+2)+3.8)*(5e4/13)*viewingConditions.nc*viewingConditions.ncb,hSin=Math.sin(hueRadians),hCos=Math.cos(hueRadians);for(let iterationRound=0;iterationRound<5;iterationRound++){let jNormalized=j/100,alpha=chroma===0||j===0?0:chroma/Math.sqrt(jNormalized),t=Math.pow(alpha*tInnerCoeff,1/.9),p2=viewingConditions.aw*Math.pow(jNormalized,1/viewingConditions.c/viewingConditions.z)/viewingConditions.nbb,gamma=23*(p2+.305)*t/(23*p1+11*t*hCos+108*t*hSin),a=gamma*hCos,b=gamma*hSin,rA=(460*p2+451*a+288*b)/1403,gA=(460*p2-891*a-261*b)/1403,bA=(460*p2-220*a-6300*b)/1403,rCScaled=HctSolver2.inverseChromaticAdaptation(rA),gCScaled=HctSolver2.inverseChromaticAdaptation(gA),bCScaled=HctSolver2.inverseChromaticAdaptation(bA),linrgb=matrixMultiply([rCScaled,gCScaled,bCScaled],HctSolver2.LINRGB_FROM_SCALED_DISCOUNT);if(linrgb[0]<0||linrgb[1]<0||linrgb[2]<0)return 0;let kR=HctSolver2.Y_FROM_LINRGB[0],kG=HctSolver2.Y_FROM_LINRGB[1],kB=HctSolver2.Y_FROM_LINRGB[2],fnj=kR*linrgb[0]+kG*linrgb[1]+kB*linrgb[2];if(fnj<=0)return 0;if(iterationRound===4||Math.abs(fnj-y)<.002)return linrgb[0]>100.01||linrgb[1]>100.01||linrgb[2]>100.01?0:argbFromLinrgb(linrgb);j=j-(fnj-y)*j/(2*fnj)}return 0}static solveToInt(hueDegrees,chroma,lstar){if(chroma<1e-4||lstar<1e-4||lstar>99.9999)return argbFromLstar(lstar);hueDegrees=sanitizeDegreesDouble(hueDegrees);let hueRadians=hueDegrees/180*Math.PI,y=yFromLstar(lstar),exactAnswer=HctSolver2.findResultByJ(hueRadians,chroma,y);if(exactAnswer!==0)return exactAnswer;let linrgb=HctSolver2.bisectToLimit(y,hueRadians);return argbFromLinrgb(linrgb)}static solveToCam(hueDegrees,chroma,lstar){return Cam16.fromInt(HctSolver2.solveToInt(hueDegrees,chroma,lstar))}}return HctSolver2.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],HctSolver2.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],HctSolver2.Y_FROM_LINRGB=[.2126,.7152,.0722],HctSolver2.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776],HctSolver2})();var Hct=class _Hct{static from(hue,chroma,tone){return new _Hct(HctSolver.solveToInt(hue,chroma,tone))}static fromInt(argb){return new _Hct(argb)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(newHue){this.setInternalState(HctSolver.solveToInt(newHue,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(newChroma){this.setInternalState(HctSolver.solveToInt(this.internalHue,newChroma,this.internalTone))}get tone(){return this.internalTone}set tone(newTone){this.setInternalState(HctSolver.solveToInt(this.internalHue,this.internalChroma,newTone))}constructor(argb){this.argb=argb;let cam=Cam16.fromInt(argb);this.internalHue=cam.hue,this.internalChroma=cam.chroma,this.internalTone=lstarFromArgb(argb),this.argb=argb}setInternalState(argb){let cam=Cam16.fromInt(argb);this.internalHue=cam.hue,this.internalChroma=cam.chroma,this.internalTone=lstarFromArgb(argb),this.argb=argb}inViewingConditions(vc){let viewedInVc=Cam16.fromInt(this.toInt()).xyzInViewingConditions(vc),recastInVc=Cam16.fromXyzInViewingConditions(viewedInVc[0],viewedInVc[1],viewedInVc[2],ViewingConditions.make());return _Hct.from(recastInVc.hue,recastInVc.chroma,lstarFromY(viewedInVc[1]))}};var Contrast=class _Contrast{static ratioOfTones(toneA,toneB){return toneA=clampDouble(0,100,toneA),toneB=clampDouble(0,100,toneB),_Contrast.ratioOfYs(yFromLstar(toneA),yFromLstar(toneB))}static ratioOfYs(y1,y2){let lighter=y1>y2?y1:y2,darker=lighter===y2?y1:y2;return(lighter+5)/(darker+5)}static lighter(tone,ratio){if(tone<0||tone>100)return-1;let darkY=yFromLstar(tone),lightY=ratio*(darkY+5)-5,realContrast=_Contrast.ratioOfYs(lightY,darkY),delta=Math.abs(realContrast-ratio);if(realContrast<ratio&&delta>.04)return-1;let returnValue=lstarFromY(lightY)+.4;return returnValue<0||returnValue>100?-1:returnValue}static darker(tone,ratio){if(tone<0||tone>100)return-1;let lightY=yFromLstar(tone),darkY=(lightY+5)/ratio-5,realContrast=_Contrast.ratioOfYs(lightY,darkY),delta=Math.abs(realContrast-ratio);if(realContrast<ratio&&delta>.04)return-1;let returnValue=lstarFromY(darkY)-.4;return returnValue<0||returnValue>100?-1:returnValue}static lighterUnsafe(tone,ratio){let lighterSafe=_Contrast.lighter(tone,ratio);return lighterSafe<0?100:lighterSafe}static darkerUnsafe(tone,ratio){let darkerSafe=_Contrast.darker(tone,ratio);return darkerSafe<0?0:darkerSafe}};var DislikeAnalyzer=class _DislikeAnalyzer{static isDisliked(hct){let huePasses=Math.round(hct.hue)>=90&&Math.round(hct.hue)<=111,chromaPasses=Math.round(hct.chroma)>16,tonePasses=Math.round(hct.tone)<65;return huePasses&&chromaPasses&&tonePasses}static fixIfDisliked(hct){return _DislikeAnalyzer.isDisliked(hct)?Hct.from(hct.hue,hct.chroma,70):hct}};var DynamicColor=class _DynamicColor{static fromPalette(args){return new _DynamicColor(args.name??"",args.palette,args.tone,args.isBackground??!1,args.background,args.secondBackground,args.contrastCurve,args.toneDeltaPair)}constructor(name,palette,tone,isBackground,background,secondBackground,contrastCurve,toneDeltaPair){if(this.name=name,this.palette=palette,this.tone=tone,this.isBackground=isBackground,this.background=background,this.secondBackground=secondBackground,this.contrastCurve=contrastCurve,this.toneDeltaPair=toneDeltaPair,this.hctCache=new Map,!background&&secondBackground)throw new Error(`Color ${name} has secondBackgrounddefined, but background is not defined.`);if(!background&&contrastCurve)throw new Error(`Color ${name} has contrastCurvedefined, but background is not defined.`);if(background&&!contrastCurve)throw new Error(`Color ${name} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(scheme){return this.getHct(scheme).toInt()}getHct(scheme){let cachedAnswer=this.hctCache.get(scheme);if(cachedAnswer!=null)return cachedAnswer;let tone=this.getTone(scheme),answer=this.palette(scheme).getHct(tone);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(scheme,answer),answer}getTone(scheme){let decreasingContrast=scheme.contrastLevel<0;if(this.toneDeltaPair){let toneDeltaPair=this.toneDeltaPair(scheme),roleA=toneDeltaPair.roleA,roleB=toneDeltaPair.roleB,delta=toneDeltaPair.delta,polarity=toneDeltaPair.polarity,stayTogether=toneDeltaPair.stayTogether,bgTone=this.background(scheme).getTone(scheme),aIsNearer=polarity==="nearer"||polarity==="lighter"&&!scheme.isDark||polarity==="darker"&&scheme.isDark,nearer=aIsNearer?roleA:roleB,farther=aIsNearer?roleB:roleA,amNearer=this.name===nearer.name,expansionDir=scheme.isDark?1:-1,nContrast=nearer.contrastCurve.get(scheme.contrastLevel),fContrast=farther.contrastCurve.get(scheme.contrastLevel),nInitialTone=nearer.tone(scheme),nTone=Contrast.ratioOfTones(bgTone,nInitialTone)>=nContrast?nInitialTone:_DynamicColor.foregroundTone(bgTone,nContrast),fInitialTone=farther.tone(scheme),fTone=Contrast.ratioOfTones(bgTone,fInitialTone)>=fContrast?fInitialTone:_DynamicColor.foregroundTone(bgTone,fContrast);return decreasingContrast&&(nTone=_DynamicColor.foregroundTone(bgTone,nContrast),fTone=_DynamicColor.foregroundTone(bgTone,fContrast)),(fTone-nTone)*expansionDir>=delta||(fTone=clampDouble(0,100,nTone+delta*expansionDir),(fTone-nTone)*expansionDir>=delta||(nTone=clampDouble(0,100,fTone-delta*expansionDir))),50<=nTone&&nTone<60?expansionDir>0?(nTone=60,fTone=Math.max(fTone,nTone+delta*expansionDir)):(nTone=49,fTone=Math.min(fTone,nTone+delta*expansionDir)):50<=fTone&&fTone<60&&(stayTogether?expansionDir>0?(nTone=60,fTone=Math.max(fTone,nTone+delta*expansionDir)):(nTone=49,fTone=Math.min(fTone,nTone+delta*expansionDir)):expansionDir>0?fTone=60:fTone=49),amNearer?nTone:fTone}else{let answer=this.tone(scheme);if(this.background==null)return answer;let bgTone=this.background(scheme).getTone(scheme),desiredRatio=this.contrastCurve.get(scheme.contrastLevel);if(Contrast.ratioOfTones(bgTone,answer)>=desiredRatio||(answer=_DynamicColor.foregroundTone(bgTone,desiredRatio)),decreasingContrast&&(answer=_DynamicColor.foregroundTone(bgTone,desiredRatio)),this.isBackground&&50<=answer&&answer<60&&(Contrast.ratioOfTones(49,bgTone)>=desiredRatio?answer=49:answer=60),this.secondBackground){let[bg1,bg2]=[this.background,this.secondBackground],[bgTone1,bgTone2]=[bg1(scheme).getTone(scheme),bg2(scheme).getTone(scheme)],[upper,lower]=[Math.max(bgTone1,bgTone2),Math.min(bgTone1,bgTone2)];if(Contrast.ratioOfTones(upper,answer)>=desiredRatio&&Contrast.ratioOfTones(lower,answer)>=desiredRatio)return answer;let lightOption=Contrast.lighter(upper,desiredRatio),darkOption=Contrast.darker(lower,desiredRatio),availables=[];return lightOption!==-1&&availables.push(lightOption),darkOption!==-1&&availables.push(darkOption),_DynamicColor.tonePrefersLightForeground(bgTone1)||_DynamicColor.tonePrefersLightForeground(bgTone2)?lightOption<0?100:lightOption:availables.length===1?availables[0]:darkOption<0?0:darkOption}return answer}}static foregroundTone(bgTone,ratio){let lighterTone=Contrast.lighterUnsafe(bgTone,ratio),darkerTone=Contrast.darkerUnsafe(bgTone,ratio),lighterRatio=Contrast.ratioOfTones(lighterTone,bgTone),darkerRatio=Contrast.ratioOfTones(darkerTone,bgTone);if(_DynamicColor.tonePrefersLightForeground(bgTone)){let negligibleDifference=Math.abs(lighterRatio-darkerRatio)<.1&&lighterRatio<ratio&&darkerRatio<ratio;return lighterRatio>=ratio||lighterRatio>=darkerRatio||negligibleDifference?lighterTone:darkerTone}else return darkerRatio>=ratio||darkerRatio>=lighterRatio?darkerTone:lighterTone}static tonePrefersLightForeground(tone){return Math.round(tone)<60}static toneAllowsLightForeground(tone){return Math.round(tone)<=49}static enableLightForeground(tone){return _DynamicColor.tonePrefersLightForeground(tone)&&!_DynamicColor.toneAllowsLightForeground(tone)?49:tone}};var TonalPalette=class _TonalPalette{static fromInt(argb){let hct=Hct.fromInt(argb);return _TonalPalette.fromHct(hct)}static fromHct(hct){return new _TonalPalette(hct.hue,hct.chroma,hct)}static fromHueAndChroma(hue,chroma){let keyColor=new KeyColor(hue,chroma).create();return new _TonalPalette(hue,chroma,keyColor)}constructor(hue,chroma,keyColor){this.hue=hue,this.chroma=chroma,this.keyColor=keyColor,this.cache=new Map}tone(tone){let argb=this.cache.get(tone);return argb===void 0&&(argb=Hct.from(this.hue,this.chroma,tone).toInt(),this.cache.set(tone,argb)),argb}getHct(tone){return Hct.fromInt(this.tone(tone))}},KeyColor=class{constructor(hue,requestedChroma){this.hue=hue,this.requestedChroma=requestedChroma,this.chromaCache=new Map,this.maxChromaValue=200}create(){let lowerTone=0,upperTone=100;for(;lowerTone<upperTone;){let midTone=Math.floor((lowerTone+upperTone)/2),isAscending=this.maxChroma(midTone)<this.maxChroma(midTone+1);if(this.maxChroma(midTone)>=this.requestedChroma-.01)if(Math.abs(lowerTone-50)<Math.abs(upperTone-50))upperTone=midTone;else{if(lowerTone===midTone)return Hct.from(this.hue,this.requestedChroma,lowerTone);lowerTone=midTone}else isAscending?lowerTone=midTone+1:upperTone=midTone}return Hct.from(this.hue,this.requestedChroma,lowerTone)}maxChroma(tone){if(this.chromaCache.has(tone))return this.chromaCache.get(tone);let chroma=Hct.from(this.hue,this.maxChromaValue,tone).chroma;return this.chromaCache.set(tone,chroma),chroma}};var ContrastCurve=class{constructor(low,normal,medium,high){this.low=low,this.normal=normal,this.medium=medium,this.high=high}get(contrastLevel){return contrastLevel<=-1?this.low:contrastLevel<0?lerp(this.low,this.normal,(contrastLevel- -1)/1):contrastLevel<.5?lerp(this.normal,this.medium,(contrastLevel-0)/.5):contrastLevel<1?lerp(this.medium,this.high,(contrastLevel-.5)/.5):this.high}};var ToneDeltaPair=class{constructor(roleA,roleB,delta,polarity,stayTogether){this.roleA=roleA,this.roleB=roleB,this.delta=delta,this.polarity=polarity,this.stayTogether=stayTogether}};var Variant=function(Variant2){return Variant2[Variant2.MONOCHROME=0]="MONOCHROME",Variant2[Variant2.NEUTRAL=1]="NEUTRAL",Variant2[Variant2.TONAL_SPOT=2]="TONAL_SPOT",Variant2[Variant2.VIBRANT=3]="VIBRANT",Variant2[Variant2.EXPRESSIVE=4]="EXPRESSIVE",Variant2[Variant2.FIDELITY=5]="FIDELITY",Variant2[Variant2.CONTENT=6]="CONTENT",Variant2[Variant2.RAINBOW=7]="RAINBOW",Variant2[Variant2.FRUIT_SALAD=8]="FRUIT_SALAD",Variant2}(Variant||{});function isFidelity(scheme){return scheme.variant===Variant.FIDELITY||scheme.variant===Variant.CONTENT}function isMonochrome(scheme){return scheme.variant===Variant.MONOCHROME}function findDesiredChromaByTone(hue,chroma,tone,byDecreasingTone){let answer=tone,closestToChroma=Hct.from(hue,chroma,tone);if(closestToChroma.chroma<chroma){let chromaPeak=closestToChroma.chroma;for(;closestToChroma.chroma<chroma;){answer+=byDecreasingTone?-1:1;let potentialSolution=Hct.from(hue,chroma,answer);if(chromaPeak>potentialSolution.chroma||Math.abs(potentialSolution.chroma-chroma)<.4)break;let potentialDelta=Math.abs(potentialSolution.chroma-chroma),currentDelta=Math.abs(closestToChroma.chroma-chroma);potentialDelta<currentDelta&&(closestToChroma=potentialSolution),chromaPeak=Math.max(chromaPeak,potentialSolution.chroma)}}return answer}var MaterialDynamicColors=class _MaterialDynamicColors{static highestSurface(s2){return s2.isDark?_MaterialDynamicColors.surfaceBright:_MaterialDynamicColors.surfaceDim}};MaterialDynamicColors.contentAccentToneDelta=15;MaterialDynamicColors.primaryPaletteKeyColor=DynamicColor.fromPalette({name:"primary_palette_key_color",palette:s2=>s2.primaryPalette,tone:s2=>s2.primaryPalette.keyColor.tone});MaterialDynamicColors.secondaryPaletteKeyColor=DynamicColor.fromPalette({name:"secondary_palette_key_color",palette:s2=>s2.secondaryPalette,tone:s2=>s2.secondaryPalette.keyColor.tone});MaterialDynamicColors.tertiaryPaletteKeyColor=DynamicColor.fromPalette({name:"tertiary_palette_key_color",palette:s2=>s2.tertiaryPalette,tone:s2=>s2.tertiaryPalette.keyColor.tone});MaterialDynamicColors.neutralPaletteKeyColor=DynamicColor.fromPalette({name:"neutral_palette_key_color",palette:s2=>s2.neutralPalette,tone:s2=>s2.neutralPalette.keyColor.tone});MaterialDynamicColors.neutralVariantPaletteKeyColor=DynamicColor.fromPalette({name:"neutral_variant_palette_key_color",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.neutralVariantPalette.keyColor.tone});MaterialDynamicColors.background=DynamicColor.fromPalette({name:"background",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?6:98,isBackground:!0});MaterialDynamicColors.onBackground=DynamicColor.fromPalette({name:"on_background",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?90:10,background:s2=>MaterialDynamicColors.background,contrastCurve:new ContrastCurve(3,3,4.5,7)});MaterialDynamicColors.surface=DynamicColor.fromPalette({name:"surface",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?6:98,isBackground:!0});MaterialDynamicColors.surfaceDim=DynamicColor.fromPalette({name:"surface_dim",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?6:new ContrastCurve(87,87,80,75).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.surfaceBright=DynamicColor.fromPalette({name:"surface_bright",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(24,24,29,34).get(s2.contrastLevel):98,isBackground:!0});MaterialDynamicColors.surfaceContainerLowest=DynamicColor.fromPalette({name:"surface_container_lowest",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(4,4,2,0).get(s2.contrastLevel):100,isBackground:!0});MaterialDynamicColors.surfaceContainerLow=DynamicColor.fromPalette({name:"surface_container_low",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(10,10,11,12).get(s2.contrastLevel):new ContrastCurve(96,96,96,95).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.surfaceContainer=DynamicColor.fromPalette({name:"surface_container",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(12,12,16,20).get(s2.contrastLevel):new ContrastCurve(94,94,92,90).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.surfaceContainerHigh=DynamicColor.fromPalette({name:"surface_container_high",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(17,17,21,25).get(s2.contrastLevel):new ContrastCurve(92,92,88,85).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.surfaceContainerHighest=DynamicColor.fromPalette({name:"surface_container_highest",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(22,22,26,30).get(s2.contrastLevel):new ContrastCurve(90,90,84,80).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.onSurface=DynamicColor.fromPalette({name:"on_surface",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?90:10,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.surfaceVariant=DynamicColor.fromPalette({name:"surface_variant",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.isDark?30:90,isBackground:!0});MaterialDynamicColors.onSurfaceVariant=DynamicColor.fromPalette({name:"on_surface_variant",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.isDark?80:30,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.inverseSurface=DynamicColor.fromPalette({name:"inverse_surface",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?90:20});MaterialDynamicColors.inverseOnSurface=DynamicColor.fromPalette({name:"inverse_on_surface",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?20:95,background:s2=>MaterialDynamicColors.inverseSurface,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.outline=DynamicColor.fromPalette({name:"outline",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.isDark?60:50,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1.5,3,4.5,7)});MaterialDynamicColors.outlineVariant=DynamicColor.fromPalette({name:"outline_variant",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.isDark?30:80,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5)});MaterialDynamicColors.shadow=DynamicColor.fromPalette({name:"shadow",palette:s2=>s2.neutralPalette,tone:s2=>0});MaterialDynamicColors.scrim=DynamicColor.fromPalette({name:"scrim",palette:s2=>s2.neutralPalette,tone:s2=>0});MaterialDynamicColors.surfaceTint=DynamicColor.fromPalette({name:"surface_tint",palette:s2=>s2.primaryPalette,tone:s2=>s2.isDark?80:40,isBackground:!0});MaterialDynamicColors.primary=DynamicColor.fromPalette({name:"primary",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?100:0:s2.isDark?80:40,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,7),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.primaryContainer,MaterialDynamicColors.primary,10,"nearer",!1)});MaterialDynamicColors.onPrimary=DynamicColor.fromPalette({name:"on_primary",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?10:90:s2.isDark?20:100,background:s2=>MaterialDynamicColors.primary,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.primaryContainer=DynamicColor.fromPalette({name:"primary_container",palette:s2=>s2.primaryPalette,tone:s2=>isFidelity(s2)?s2.sourceColorHct.tone:isMonochrome(s2)?s2.isDark?85:25:s2.isDark?30:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.primaryContainer,MaterialDynamicColors.primary,10,"nearer",!1)});MaterialDynamicColors.onPrimaryContainer=DynamicColor.fromPalette({name:"on_primary_container",palette:s2=>s2.primaryPalette,tone:s2=>isFidelity(s2)?DynamicColor.foregroundTone(MaterialDynamicColors.primaryContainer.tone(s2),4.5):isMonochrome(s2)?s2.isDark?0:100:s2.isDark?90:30,background:s2=>MaterialDynamicColors.primaryContainer,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.inversePrimary=DynamicColor.fromPalette({name:"inverse_primary",palette:s2=>s2.primaryPalette,tone:s2=>s2.isDark?40:80,background:s2=>MaterialDynamicColors.inverseSurface,contrastCurve:new ContrastCurve(3,4.5,7,7)});MaterialDynamicColors.secondary=DynamicColor.fromPalette({name:"secondary",palette:s2=>s2.secondaryPalette,tone:s2=>s2.isDark?80:40,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,7),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.secondaryContainer,MaterialDynamicColors.secondary,10,"nearer",!1)});MaterialDynamicColors.onSecondary=DynamicColor.fromPalette({name:"on_secondary",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?10:100:s2.isDark?20:100,background:s2=>MaterialDynamicColors.secondary,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.secondaryContainer=DynamicColor.fromPalette({name:"secondary_container",palette:s2=>s2.secondaryPalette,tone:s2=>{let initialTone=s2.isDark?30:90;return isMonochrome(s2)?s2.isDark?30:85:isFidelity(s2)?findDesiredChromaByTone(s2.secondaryPalette.hue,s2.secondaryPalette.chroma,initialTone,!s2.isDark):initialTone},isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.secondaryContainer,MaterialDynamicColors.secondary,10,"nearer",!1)});MaterialDynamicColors.onSecondaryContainer=DynamicColor.fromPalette({name:"on_secondary_container",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?90:10:isFidelity(s2)?DynamicColor.foregroundTone(MaterialDynamicColors.secondaryContainer.tone(s2),4.5):s2.isDark?90:30,background:s2=>MaterialDynamicColors.secondaryContainer,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.tertiary=DynamicColor.fromPalette({name:"tertiary",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?90:25:s2.isDark?80:40,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,7),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer,MaterialDynamicColors.tertiary,10,"nearer",!1)});MaterialDynamicColors.onTertiary=DynamicColor.fromPalette({name:"on_tertiary",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?10:90:s2.isDark?20:100,background:s2=>MaterialDynamicColors.tertiary,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.tertiaryContainer=DynamicColor.fromPalette({name:"tertiary_container",palette:s2=>s2.tertiaryPalette,tone:s2=>{if(isMonochrome(s2))return s2.isDark?60:49;if(!isFidelity(s2))return s2.isDark?30:90;let proposedHct=s2.tertiaryPalette.getHct(s2.sourceColorHct.tone);return DislikeAnalyzer.fixIfDisliked(proposedHct).tone},isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer,MaterialDynamicColors.tertiary,10,"nearer",!1)});MaterialDynamicColors.onTertiaryContainer=DynamicColor.fromPalette({name:"on_tertiary_container",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?0:100:isFidelity(s2)?DynamicColor.foregroundTone(MaterialDynamicColors.tertiaryContainer.tone(s2),4.5):s2.isDark?90:30,background:s2=>MaterialDynamicColors.tertiaryContainer,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.error=DynamicColor.fromPalette({name:"error",palette:s2=>s2.errorPalette,tone:s2=>s2.isDark?80:40,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,7),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.errorContainer,MaterialDynamicColors.error,10,"nearer",!1)});MaterialDynamicColors.onError=DynamicColor.fromPalette({name:"on_error",palette:s2=>s2.errorPalette,tone:s2=>s2.isDark?20:100,background:s2=>MaterialDynamicColors.error,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.errorContainer=DynamicColor.fromPalette({name:"error_container",palette:s2=>s2.errorPalette,tone:s2=>s2.isDark?30:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.errorContainer,MaterialDynamicColors.error,10,"nearer",!1)});MaterialDynamicColors.onErrorContainer=DynamicColor.fromPalette({name:"on_error_container",palette:s2=>s2.errorPalette,tone:s2=>isMonochrome(s2)?s2.isDark?90:10:s2.isDark?90:30,background:s2=>MaterialDynamicColors.errorContainer,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.primaryFixed=DynamicColor.fromPalette({name:"primary_fixed",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?40:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.primaryFixed,MaterialDynamicColors.primaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.primaryFixedDim=DynamicColor.fromPalette({name:"primary_fixed_dim",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?30:80,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.primaryFixed,MaterialDynamicColors.primaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.onPrimaryFixed=DynamicColor.fromPalette({name:"on_primary_fixed",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?100:10,background:s2=>MaterialDynamicColors.primaryFixedDim,secondBackground:s2=>MaterialDynamicColors.primaryFixed,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.onPrimaryFixedVariant=DynamicColor.fromPalette({name:"on_primary_fixed_variant",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?90:30,background:s2=>MaterialDynamicColors.primaryFixedDim,secondBackground:s2=>MaterialDynamicColors.primaryFixed,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.secondaryFixed=DynamicColor.fromPalette({name:"secondary_fixed",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?80:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.secondaryFixed,MaterialDynamicColors.secondaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.secondaryFixedDim=DynamicColor.fromPalette({name:"secondary_fixed_dim",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?70:80,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.secondaryFixed,MaterialDynamicColors.secondaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.onSecondaryFixed=DynamicColor.fromPalette({name:"on_secondary_fixed",palette:s2=>s2.secondaryPalette,tone:s2=>10,background:s2=>MaterialDynamicColors.secondaryFixedDim,secondBackground:s2=>MaterialDynamicColors.secondaryFixed,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.onSecondaryFixedVariant=DynamicColor.fromPalette({name:"on_secondary_fixed_variant",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?25:30,background:s2=>MaterialDynamicColors.secondaryFixedDim,secondBackground:s2=>MaterialDynamicColors.secondaryFixed,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.tertiaryFixed=DynamicColor.fromPalette({name:"tertiary_fixed",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?40:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.tertiaryFixed,MaterialDynamicColors.tertiaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.tertiaryFixedDim=DynamicColor.fromPalette({name:"tertiary_fixed_dim",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?30:80,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.tertiaryFixed,MaterialDynamicColors.tertiaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.onTertiaryFixed=DynamicColor.fromPalette({name:"on_tertiary_fixed",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?100:10,background:s2=>MaterialDynamicColors.tertiaryFixedDim,secondBackground:s2=>MaterialDynamicColors.tertiaryFixed,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.onTertiaryFixedVariant=DynamicColor.fromPalette({name:"on_tertiary_fixed_variant",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?90:30,background:s2=>MaterialDynamicColors.tertiaryFixedDim,secondBackground:s2=>MaterialDynamicColors.tertiaryFixed,contrastCurve:new ContrastCurve(3,4.5,7,11)});var DynamicScheme=class{constructor(args){this.sourceColorArgb=args.sourceColorArgb,this.variant=args.variant,this.contrastLevel=args.contrastLevel,this.isDark=args.isDark,this.sourceColorHct=Hct.fromInt(args.sourceColorArgb),this.primaryPalette=args.primaryPalette,this.secondaryPalette=args.secondaryPalette,this.tertiaryPalette=args.tertiaryPalette,this.neutralPalette=args.neutralPalette,this.neutralVariantPalette=args.neutralVariantPalette,this.errorPalette=TonalPalette.fromHueAndChroma(25,84)}static getRotatedHue(sourceColor,hues,rotations){let sourceHue=sourceColor.hue;if(hues.length!==rotations.length)throw new Error(`mismatch between hue length ${hues.length} & rotations ${rotations.length}`);if(rotations.length===1)return sanitizeDegreesDouble(sourceColor.hue+rotations[0]);let size=hues.length;for(let i=0;i<=size-2;i++){let thisHue=hues[i],nextHue=hues[i+1];if(thisHue<sourceHue&&sourceHue<nextHue)return sanitizeDegreesDouble(sourceHue+rotations[i])}return sourceHue}getArgb(dynamicColor){return dynamicColor.getArgb(this)}getHct(dynamicColor){return dynamicColor.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.primaryPaletteKeyColor)}get secondaryPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.secondaryPaletteKeyColor)}get tertiaryPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.tertiaryPaletteKeyColor)}get neutralPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.neutralPaletteKeyColor)}get neutralVariantPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.neutralVariantPaletteKeyColor)}get background(){return this.getArgb(MaterialDynamicColors.background)}get onBackground(){return this.getArgb(MaterialDynamicColors.onBackground)}get surface(){return this.getArgb(MaterialDynamicColors.surface)}get surfaceDim(){return this.getArgb(MaterialDynamicColors.surfaceDim)}get surfaceBright(){return this.getArgb(MaterialDynamicColors.surfaceBright)}get surfaceContainerLowest(){return this.getArgb(MaterialDynamicColors.surfaceContainerLowest)}get surfaceContainerLow(){return this.getArgb(MaterialDynamicColors.surfaceContainerLow)}get surfaceContainer(){return this.getArgb(MaterialDynamicColors.surfaceContainer)}get surfaceContainerHigh(){return this.getArgb(MaterialDynamicColors.surfaceContainerHigh)}get surfaceContainerHighest(){return this.getArgb(MaterialDynamicColors.surfaceContainerHighest)}get onSurface(){return this.getArgb(MaterialDynamicColors.onSurface)}get surfaceVariant(){return this.getArgb(MaterialDynamicColors.surfaceVariant)}get onSurfaceVariant(){return this.getArgb(MaterialDynamicColors.onSurfaceVariant)}get inverseSurface(){return this.getArgb(MaterialDynamicColors.inverseSurface)}get inverseOnSurface(){return this.getArgb(MaterialDynamicColors.inverseOnSurface)}get outline(){return this.getArgb(MaterialDynamicColors.outline)}get outlineVariant(){return this.getArgb(MaterialDynamicColors.outlineVariant)}get shadow(){return this.getArgb(MaterialDynamicColors.shadow)}get scrim(){return this.getArgb(MaterialDynamicColors.scrim)}get surfaceTint(){return this.getArgb(MaterialDynamicColors.surfaceTint)}get primary(){return this.getArgb(MaterialDynamicColors.primary)}get onPrimary(){return this.getArgb(MaterialDynamicColors.onPrimary)}get primaryContainer(){return this.getArgb(MaterialDynamicColors.primaryContainer)}get onPrimaryContainer(){return this.getArgb(MaterialDynamicColors.onPrimaryContainer)}get inversePrimary(){return this.getArgb(MaterialDynamicColors.inversePrimary)}get secondary(){return this.getArgb(MaterialDynamicColors.secondary)}get onSecondary(){return this.getArgb(MaterialDynamicColors.onSecondary)}get secondaryContainer(){return this.getArgb(MaterialDynamicColors.secondaryContainer)}get onSecondaryContainer(){return this.getArgb(MaterialDynamicColors.onSecondaryContainer)}get tertiary(){return this.getArgb(MaterialDynamicColors.tertiary)}get onTertiary(){return this.getArgb(MaterialDynamicColors.onTertiary)}get tertiaryContainer(){return this.getArgb(MaterialDynamicColors.tertiaryContainer)}get onTertiaryContainer(){return this.getArgb(MaterialDynamicColors.onTertiaryContainer)}get error(){return this.getArgb(MaterialDynamicColors.error)}get onError(){return this.getArgb(MaterialDynamicColors.onError)}get errorContainer(){return this.getArgb(MaterialDynamicColors.errorContainer)}get onErrorContainer(){return this.getArgb(MaterialDynamicColors.onErrorContainer)}get primaryFixed(){return this.getArgb(MaterialDynamicColors.primaryFixed)}get primaryFixedDim(){return this.getArgb(MaterialDynamicColors.primaryFixedDim)}get onPrimaryFixed(){return this.getArgb(MaterialDynamicColors.onPrimaryFixed)}get onPrimaryFixedVariant(){return this.getArgb(MaterialDynamicColors.onPrimaryFixedVariant)}get secondaryFixed(){return this.getArgb(MaterialDynamicColors.secondaryFixed)}get secondaryFixedDim(){return this.getArgb(MaterialDynamicColors.secondaryFixedDim)}get onSecondaryFixed(){return this.getArgb(MaterialDynamicColors.onSecondaryFixed)}get onSecondaryFixedVariant(){return this.getArgb(MaterialDynamicColors.onSecondaryFixedVariant)}get tertiaryFixed(){return this.getArgb(MaterialDynamicColors.tertiaryFixed)}get tertiaryFixedDim(){return this.getArgb(MaterialDynamicColors.tertiaryFixedDim)}get onTertiaryFixed(){return this.getArgb(MaterialDynamicColors.onTertiaryFixed)}get onTertiaryFixedVariant(){return this.getArgb(MaterialDynamicColors.onTertiaryFixedVariant)}};var SchemeMonochrome=class extends DynamicScheme{constructor(sourceColorHct,isDark,contrastLevel){super({sourceColorArgb:sourceColorHct.toInt(),variant:Variant.MONOCHROME,contrastLevel,isDark,primaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0),secondaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0),tertiaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0),neutralPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0),neutralVariantPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0)})}};var SchemeNeutral=class extends DynamicScheme{constructor(sourceColorHct,isDark,contrastLevel){super({sourceColorArgb:sourceColorHct.toInt(),variant:Variant.NEUTRAL,contrastLevel,isDark,primaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,12),secondaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,8),tertiaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,16),neutralPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,2),neutralVariantPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,2)})}};var SchemeTonalSpot=class extends DynamicScheme{constructor(sourceColorHct,isDark,contrastLevel){super({sourceColorArgb:sourceColorHct.toInt(),variant:Variant.TONAL_SPOT,contrastLevel,isDark,primaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,36),secondaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,16),tertiaryPalette:TonalPalette.fromHueAndChroma(sanitizeDegreesDouble(sourceColorHct.hue+60),24),neutralPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,6),neutralVariantPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,8)})}};var SchemeVibrant=(()=>{class SchemeVibrant2 extends DynamicScheme{constructor(sourceColorHct,isDark,contrastLevel){super({sourceColorArgb:sourceColorHct.toInt(),variant:Variant.VIBRANT,contrastLevel,isDark,primaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,200),secondaryPalette:TonalPalette.fromHueAndChroma(DynamicScheme.getRotatedHue(sourceColorHct,SchemeVibrant2.hues,SchemeVibrant2.secondaryRotations),24),tertiaryPalette:TonalPalette.fromHueAndChroma(DynamicScheme.getRotatedHue(sourceColorHct,SchemeVibrant2.hues,SchemeVibrant2.tertiaryRotations),32),neutralPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,10),neutralVariantPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,12)})}}return SchemeVibrant2.hues=[0,41,61,101,131,181,251,301,360],SchemeVibrant2.secondaryRotations=[18,15,10,12,15,18,15,12,12],SchemeVibrant2.tertiaryRotations=[35,30,20,25,30,35,30,25,25],SchemeVibrant2})();function hexFromArgb(argb){let r=redFromArgb(argb),g=greenFromArgb(argb),b=blueFromArgb(argb),outParts=[r.toString(16),g.toString(16),b.toString(16)];for(let[i,part]of outParts.entries())part.length===1&&(outParts[i]="0"+part);return"#"+outParts.join("")}function argbFromHex(hex){hex=hex.replace("#","");let isThree=hex.length===3,isSix=hex.length===6,isEight=hex.length===8;if(!isThree&&!isSix&&!isEight)throw new Error("unexpected hex "+hex);let r=0,g=0,b=0;return isThree?(r=parseIntHex(hex.slice(0,1).repeat(2)),g=parseIntHex(hex.slice(1,2).repeat(2)),b=parseIntHex(hex.slice(2,3).repeat(2))):isSix?(r=parseIntHex(hex.slice(0,2)),g=parseIntHex(hex.slice(2,4)),b=parseIntHex(hex.slice(4,6))):isEight&&(r=parseIntHex(hex.slice(2,4)),g=parseIntHex(hex.slice(4,6)),b=parseIntHex(hex.slice(6,8))),(255<<24|(r&255)<<16|(g&255)<<8|b&255)>>>0}function parseIntHex(value){return parseInt(value,16)}function getCustomThemeStyles(theme,dark=!1){return getVariableStyles(theme,dark)}function getVariableStyles(theme,dark=!1){let variables=getVariables(theme,dark);return`:root{${Object.keys(variables).map(key=>`--${kebabCase_default(key)}:${variables[key]}`).join(";")}}`}function getStyleElementId(type){return`theme-${type}`}function getReferenceStyleElement(documentRef,type){let refChild=null;return type==="sector"&&(refChild=documentRef.getElementById(getStyleElementId("host")),refChild||(refChild=documentRef.getElementById(getStyleElementId("company"))),refChild&&(refChild=refChild.previousSibling)),type==="host"&&(refChild=documentRef.getElementById(getStyleElementId("sector")),refChild||(refChild=documentRef.getElementById(getStyleElementId("company")),refChild&&(refChild=refChild.previousSibling))),type==="company"&&(refChild=documentRef.getElementById(getStyleElementId("host")),refChild||(refChild=documentRef.getElementById(getStyleElementId("sector")))),refChild}var getIsDark=memoize_default(()=>{let scheme=localStorage.getItem("experimental-color-scheme")??"light";return scheme==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches:scheme==="dark"});function getVariables(theme,dark=!1){let primaryColor=(0,import_tinycolor22.default)(theme.primaryColor||"#ffffff"),variant=localStorage.getItem("experimental-theme-variant")||(_isBlueish(primaryColor)?"cool-grey":"grey"),systemVariables=_getSystemVariables(theme,variant,dark),cardBg=(0,import_tinycolor22.default)(theme.cardColor||(dark?systemVariables.matSysSurfaceContainerHighest:"#ffffff")),cardBgIsDark=cardBg.isDark(),cardTextColor=cardBgIsDark?"#ffffff":"rgba(0,0,0,.87)",pageBg=(0,import_tinycolor22.default)(theme.pageColor||(dark?"#1a1c20":"#ffffff")),pageBgIsDark=pageBg.isDark(),detailPageBg=theme.pageColor||(dark?"#1a1c20":"#f8f9fa"),menuBg=(0,import_tinycolor22.default)(theme.menuColor||pageBg),menuBgIsDark=menuBg.isDark(),menuHighlightBg=theme.menuColor?menuBg.clone()[menuBgIsDark?"brighten":"darken"](menuBgIsDark?12:8):(0,import_tinycolor22.default)(systemVariables.matSysPrimaryContainer),menuHighlightColor=theme.menuColor?menuBgIsDark?"#ffffff":"rgba(0,0,0,.67)":systemVariables.matSysOnPrimaryContainer,menuTextColor=menuBgIsDark?"#ffffff":"rgba(0,0,0,.87)",pageCardContrastRatio=import_tinycolor22.default.readability(pageBg,cardBg),pageMenuContrastRatio=import_tinycolor22.default.readability(pageBg,menuBg),pageTextColor=pageBg.isDark()?"#ffffff":"rgba(0,0,0,.87)",cardBorderColor=cardBgIsDark?cardBg.clone().brighten(16).desaturate(34).setAlpha(.87):cardBg.clone().darken(12).desaturate(34).setAlpha(.87),menuBorderColor=`color-mix(in srgb,${menuTextColor} 8%,transparent)`,cardBorderWidth=pageCardContrastRatio<1.115?"1px":"0",menuBorderWidth=pageMenuContrastRatio<1.065?"1px":"0",headerBg=(0,import_tinycolor22.default)(theme.headerColor??"#ffffff");headerBg=import_tinycolor22.default.equals(headerBg,"#ffffff")?pageBg.clone():headerBg,headerBg=dark&&import_tinycolor22.default.equals(headerBg,"#ffffff")?(0,import_tinycolor22.default)("#1a1c20"):headerBg;let headerBgIsDark=headerBg.isDark(),headerTextColor=_getTextColor(import_tinycolor22.default.equals(headerBg,primaryColor)?theme.primaryTextColor??"#ffffff":headerBgIsDark?"#ffffff":"#000000"),headerLineBorderColor=theme.headerLineColor??`color-mix(in srgb,${headerTextColor} 12%,transparent)`,headerLineBorderWidth=theme.headerLineColor?import_tinycolor22.default.equals(theme.headerLineColor,headerBg)?"0":"2px":"1px";return __spreadValues(__spreadValues({accent:"var(--mat-sys-tertiary)",accentColor:"var(--mat-sys-on-tertiary)",basic:"var(--mat-sys-surface)",blue:"var(--ix-blue)",bodyBg:"var(--mat-sys-background)",bodyColor:"var(--mat-sys-on-background)",bodyColorRgb:"0,0,0",cardBg:cardBg.toHexString(),cardBorderColor:cardBorderColor.toRgbString().replace(/\s+/g,"").replace(",0.",",."),cardBorderWidth,cardColor:cardTextColor,cardColorScheme:cardBgIsDark?"dark":"light",detailPageBg,detailPageColor:pageTextColor,fontFamily:'Montserrat, Roboto, "Helvetica Neue", sans-serif',headerBg:headerBg.toHexString(),headerColor:headerTextColor,headerColorScheme:headerBgIsDark?"dark":"light",headerLineBorderColor,headerLineBorderWidth,menuBg:menuBg.toHexString(),menuBorderColor,menuBorderWidth,menuColor:menuTextColor,menuColorRgb:(({r,g,b})=>`${r},${g},${b}`)((0,import_tinycolor22.default)(menuTextColor).toRgb()),menuHighlightBg:menuHighlightBg.toHexString(),menuHighlightBgRgb:(({r,g,b})=>`${r},${g},${b}`)(menuHighlightBg.toRgb()),menuHighlightColor,pageBg:pageBg.toHexString(),pageColor:pageTextColor,pageColorScheme:pageBgIsDark?"dark":"light",primary:"var(--mat-sys-primary)",primaryColor:"var(--mat-sys-on-primary)",primaryRgb:trimRgbString(primaryColor.toRgbString()),success:"var(--mat-sys-success)",warn:"var(--mat-sys-error)",yellow:"var(--ix-yellow)"},_getColorVariables(dark)),systemVariables)}function insertCSS(documentRef,type,input2){let id=getStyleElementId(type),styleRef=documentRef.getElementById(id);if(styleRef===null){styleRef=documentRef.createElement("style"),styleRef.id=id,styleRef.setAttribute("type","text/css"),styleRef.innerHTML="";let reference2=getReferenceStyleElement(documentRef,type);reference2?insertAfter(reference2,styleRef):documentRef.head.appendChild(styleRef)}let content=null;typeof input2=="string"&&(content=input2),content!==null&&(styleRef.innerHTML=content)}function trimRgbString(rgbString){return rgbString.slice(4,rgbString.length-1).replace(new RegExp(" ","g"),"")}function insertAfter(refChild,newChild){refChild?.parentNode&&refChild.parentNode.insertBefore(newChild,refChild.nextSibling)}function _getColorVariables(dark=!1){return{ixBlue:"#1a73e8",ixOnBlue:"#ffffff",ixBlueContainer:dark?"#8ab4f8":"#d3e3fd",ixOnBlueContainer:dark?"#202124":"#041e49",ixPurple:dark?"#ca75ff":"#8603d7",ixOnPurple:"#ffffff",ixPurpleContainer:dark?"#4f3078":"#f2deff",ixOnPurpleContainer:dark?"#ca75ff":"#8603d7",ixYellow:"#f4c211",ixOnYellow:"#1f1f1f",ixYellowContainer:dark?"#fdd663":"#fdf4d4",ixOnYellowContainer:"#000"}}function _getSystemVariables(theme,variant,dark=!1){let primaryColorHex=theme.primaryColor??"#ffffff",primaryColorHct=Hct.fromInt(argbFromHex(primaryColorHex)),secondaryColorHex=theme.accentColor??primaryColorHex,secondaryColorHct=Hct.fromInt(argbFromHex(secondaryColorHex)),primarySchemeVariant=_getSchemeVariant(primaryColorHex,variant),secondarySchemeVariant=_getSchemeVariant(secondaryColorHex,variant),schemeContrastLevel=0,schemes={SchemeMonochrome,SchemeNeutral,SchemeTonalSpot,SchemeVibrant},primaryScheme=new schemes[primarySchemeVariant](primaryColorHct,dark,schemeContrastLevel),secondaryScheme=new schemes[secondarySchemeVariant](secondaryColorHct,dark,schemeContrastLevel),variables=Object.keys(MaterialDynamicColors).filter(key=>MaterialDynamicColors[key]instanceof DynamicColor).reduce((acc,key)=>{let scheme=/^(on)?secondary/i.test(key)?secondaryScheme:primaryScheme;return __spreadProps(__spreadValues({},acc),{[camelCase_default(`mat-sys-${key}`)]:hexFromArgb(scheme[key])})},{});variant==="grey"?variables=__spreadProps(__spreadValues({},variables),{matSysBackground:dark?"#121212":"#ffffff",matSysSurface:dark?"#121212":"#ffffff",matSysSurfaceVariant:dark?"#4b4b4b":"#dedede",matSysSurfaceContainerLowest:dark?"#080808":"#ffffff",matSysSurfaceContainerLow:dark?"#1c1c1c":"#f8f8f8",matSysSurfaceContainer:dark?"#262626":"#f2f2f2",matSysSurfaceContainerHigh:dark?"#303030":"#ececec",matSysSurfaceContainerHighest:dark?"#3d3d3d":"#e2e2e2",matSysOutline:dark?"#8e8e8e":"#767676",matSysOutlineVariant:dark?"#474747":"#c7c7c7"}):variant==="cool-grey"&&(variables=__spreadProps(__spreadValues({},variables),{matSysBackground:dark?"#131314":"#ffffff",matSysSurface:dark?"#131314":"#ffffff",matSysSurfaceVariant:dark?"#444746":"#e2e7eb",matSysSurfaceContainerLowest:dark?"#1a1d24":"#ffffff",matSysSurfaceContainerLow:dark?"#1c2027":"#f8fafd",matSysSurfaceContainer:dark?"#23262d":"#f0f4f9",matSysSurfaceContainerHigh:dark?"#2a2d36":"#e9eef6",matSysSurfaceContainerHighest:dark?"#373a43":"#dde3ea",matSysSurfaceDim:dark?"#131314":"#d3dbe5",matSysSurfaceBright:dark?"#37393b":"#d3dbe5",matSysOutline:dark?"#8e918f":"#747775",matSysOutlineVariant:dark?"#444746":"#c7c7c7"})),_isMonochrome(primaryColorHex)&&(variables=__spreadProps(__spreadValues({},variables),{matSysPrimaryContainer:dark?"#333333":"#e1e1e1",matSysOnPrimaryContainer:dark?"#ffffff":"#111111"})),_isMonochrome(secondaryColorHex)&&(variables=__spreadProps(__spreadValues({},variables),{matSysSecondaryContainer:dark?"#333333":"#e1e1e1",matSysOnSecondaryContainer:dark?"#ffffff":"#111111"}));let matSysTertiary=secondaryColorHex,matSysOnTertiary=_getTextColor(theme.accentTextColor??theme.primaryTextColor);variables=__spreadProps(__spreadValues({},variables),{matSysTertiary,matSysOnTertiary,matSysTertiaryContainer:matSysTertiary,matSysOnTertiaryContainer:matSysOnTertiary});let matSysQuaternary=primaryColorHex,matSysOnQuaternary=_getTextColor(theme.primaryTextColor);return __spreadProps(__spreadValues({},variables),{matSysSuccess:"#2ecc71",matSysOnSuccess:"#ffffff",matSysWarning:dark?"#fcbd00":"#ef9800",matSysOnWarning:"#1f1f1f",matSysWarningContainer:dark?"#4d2600":"#ffe07c",matSysOnWarningContainer:dark?"#fff2b4":"#2f1400",matSysQuaternary,matSysOnQuaternary,matSysQuaternaryContainer:matSysQuaternary,matSysOnQuaternaryContainer:matSysOnQuaternary})}function _getSchemeVariant(hexColor,variant){if(_isMonochrome(hexColor))return"SchemeMonochrome";switch(variant){case"grey":case"cool-grey":case"neutral":return _isBlueish(hexColor)?"SchemeTonalSpot":"SchemeNeutral";case"vibrant":return _isBlueish(hexColor)?"SchemeVibrant":"SchemeTonalSpot"}}function _getTextColor(color){return color==="#000000"?"rgba(0,0,0,.87)":color||"#ffffff"}function _isBlueish(color){let{h,s:s2,v}=(typeof color=="string"?(0,import_tinycolor22.default)(color):color).toHsv();return s2>.1&&v>.1&&h>=200&&h<240}function _isMonochrome(hexColor){let{r,g,b}=(0,import_tinycolor22.default)(hexColor).toRgb();return r===g&&g===b}var import_tinycolor23=__toESM(require_tinycolor());function createGoogleMapStyles({backgroundColor,foregroundColor,outlineColor,textColor}){return[{stylers:[{color:foregroundColor}]},{elementType:"labels.text.fill",stylers:[{color:textColor},{visibility:"on"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{color:outlineColor},{weight:1}]},{featureType:"road",stylers:[{color:backgroundColor}]},{featureType:"road",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels.text",stylers:[{color:textColor},{visibility:"simplified"}]},{featureType:"water",stylers:[{color:backgroundColor}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"labels",stylers:[{visibility:"off"}]}]}function getPortalGoogleMapStyles(theme){let vars=getVariables(theme),backgroundColor=vars.cardBg,foregroundColor=import_tinycolor23.default.equals(vars.pageBg,backgroundColor)?(0,import_tinycolor23.default)(backgroundColor).darken(5).toHexString():vars.pageBg;return createGoogleMapStyles({backgroundColor,foregroundColor,outlineColor:vars.pageColorScheme==="dark"?(0,import_tinycolor23.default)(foregroundColor).lighten(15).toHexString():(0,import_tinycolor23.default)(foregroundColor).darken(10).toHexString(),textColor:vars.pageColorScheme==="dark"?"#eeeeee":"#555555"})}var GOOGLE_MAPS_STYLE_DARK=createGoogleMapStyles({backgroundColor:"#333537",foregroundColor:"#1f2123",outlineColor:"#202124",textColor:"#ffffff"}),GOOGLE_MAPS_STYLE_LIGHT=createGoogleMapStyles({backgroundColor:"#ffffff",foregroundColor:"#f1f3f4",outlineColor:"#ced1d1",textColor:"#000000"});var GoogleMapStyles=(()=>{let _GoogleMapStyles=class _GoogleMapStyles extends BehaviorSubject{constructor(){super(getIsDark()?GOOGLE_MAPS_STYLE_DARK:GOOGLE_MAPS_STYLE_LIGHT)}};_GoogleMapStyles.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_GoogleMapStyles)},_GoogleMapStyles.\u0275prov=\u0275\u0275defineInjectable({token:_GoogleMapStyles,factory:_GoogleMapStyles.\u0275fac,providedIn:"root"});let GoogleMapStyles2=_GoogleMapStyles;return GoogleMapStyles2})();var import_tinycolor24=__toESM(require_tinycolor());var ThemingService=(()=>{let _ThemingService=class _ThemingService{constructor(){this.doc=inject(DOCUMENT),this.platformId=inject(PLATFORM_ID),this.appName=inject(APP_NAME),this.gmStyles$=inject(GoogleMapStyles),this.themes=new BehaviorSubject(new Map)}hasTheme(type){return this.themes.asObservable().pipe(map(themeMap=>!!themeMap.has(type)))}setTheme(type,theme){if(this.themes.next(this.themes.getValue().set(type,theme)),isPlatformBrowser(this.platformId)){let dark=getIsDark();this.appName==="Portal"&&theme.pageColor&&(this.gmStyles$.next(getPortalGoogleMapStyles(theme)),(0,import_tinycolor24.default)(theme.pageColor).isDark()&&(dark=!0)),insertCSS(this.doc,type,getCustomThemeStyles(theme,dark)),this.doc.body.classList.remove(dark?"light":"dark"),this.doc.body.classList.add(dark?"dark":"light")}}destroyTheme(type){let clone3=new Map(this.themes.getValue());if(clone3.delete(type),this.themes.next(clone3),isPlatformBrowser(this.platformId)){let style2=this.doc.getElementById(getStyleElementId(type));style2?.parentElement?.removeChild(style2)}}};_ThemingService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ThemingService)},_ThemingService.\u0275prov=\u0275\u0275defineInjectable({token:_ThemingService,factory:_ThemingService.\u0275fac,providedIn:"root"});let ThemingService2=_ThemingService;return ThemingService2})();var removeCompanyTheme=createEffect((actions$=inject(Actions),service=inject(ThemingService))=>actions$.pipe(ofType(removeCompanyBranding),tap(()=>service.destroyTheme("company"))),{functional:!0,dispatch:!1}),setCompanyTheme=createEffect((actions$=inject(Actions),service=inject(ThemingService))=>actions$.pipe(ofType(setCompanyBranding),tap(({branding})=>{branding?.theme&&service.setTheme("company",branding.theme)})),{functional:!0,dispatch:!1}),setHostTheme=createEffect((actions$=inject(Actions),service=inject(ThemingService))=>actions$.pipe(ofType(setHostBranding),tap(({branding})=>{branding?.theme&&service.setTheme("host",branding.theme)})),{functional:!0,dispatch:!1}),setSectorTheme=createEffect((actions$=inject(Actions),service=inject(ThemingService))=>actions$.pipe(ofType(setSectorBranding),tap(({branding})=>{branding?.theme&&service.setTheme("sector",branding.theme)})),{functional:!0,dispatch:!1});function provideThemingSystem(){return[{provide:USER_PROVIDED_EFFECTS,multi:!0,useValue:[theming_effects_exports]}]}var AppSystemsModule=(()=>{let _AppSystemsModule=class _AppSystemsModule{};_AppSystemsModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppSystemsModule)},_AppSystemsModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppSystemsModule}),_AppSystemsModule.\u0275inj=\u0275\u0275defineInjector({providers:[provideThemingSystem()],imports:[BrandingModule2,CustomTranslationsModule.forRoot(),LocalizationModule,TranslationModule2.forRoot(),__use_api_mocks__?[PlatformFeaturesModule.forRoot([{feature:"assets",guard:AssetsMockGuard},{feature:"historical-data",guard:HistoricalDataMockGuard},{feature:"live-data",guard:LiveDataMockGuard},{feature:"object-storage",guard:ObjectStorageMockGuard}])]:[AuthModule,PlatformFeaturesModule.forRoot()]]});let AppSystemsModule2=_AppSystemsModule;return AppSystemsModule2})();function AppComponent_Conditional_1_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",1),\u0275\u0275namespaceSVG(),\u0275\u0275elementStart(1,"svg",3),\u0275\u0275element(2,"circle",4),\u0275\u0275elementEnd()())}var AppComponent=(()=>{let _AppComponent=class _AppComponent{constructor(){this.vcRef=inject(ViewContainerRef),this.loading=!0}};_AppComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppComponent)},_AppComponent.\u0275cmp=\u0275\u0275defineComponent({type:_AppComponent,selectors:[["ix-root"]],standalone:!1,decls:3,vars:1,consts:[[1,"ix-container"],[1,"ix-container","ix-spinner"],[3,"activate"],["viewBox","25 25 50 50"],["cx","50","cy","50","r","20","fill","none","stroke-width","4.5px","stroke-miterlimit","10"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275template(1,AppComponent_Conditional_1_Template,3,0,"div",1),\u0275\u0275elementStart(2,"router-outlet",2),\u0275\u0275listener("activate",function(){return ctx.loading=!1}),\u0275\u0275elementEnd()()),rf&2&&(\u0275\u0275advance(),\u0275\u0275conditional(ctx.loading?1:-1))},dependencies:[RouterOutlet],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;margin:0;padding:0;overflow:hidden}"]});let AppComponent2=_AppComponent;return AppComponent2})();var ComponentContextNavigateByUrlInterrupter=(()=>{let _ComponentContextNavigateByUrlInterrupter=class _ComponentContextNavigateByUrlInterrupter extends ComponentContextInterceptor{constructor(){super(...arguments),this.snackBar=inject(MatSnackBar)}intercept(command,args){return command==="navigate-by-url"?(this.snackBar.open(`Navigate to URL${args[0]?` (${args[0]})`:""}`,void 0,{duration:4e3}),EMPTY):of(args)}};_ComponentContextNavigateByUrlInterrupter.\u0275fac=(()=>{let \u0275ComponentContextNavigateByUrlInterrupter_BaseFactory;return function(__ngFactoryType__){return(\u0275ComponentContextNavigateByUrlInterrupter_BaseFactory||(\u0275ComponentContextNavigateByUrlInterrupter_BaseFactory=\u0275\u0275getInheritedFactory(_ComponentContextNavigateByUrlInterrupter)))(__ngFactoryType__||_ComponentContextNavigateByUrlInterrupter)}})(),_ComponentContextNavigateByUrlInterrupter.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentContextNavigateByUrlInterrupter,factory:_ComponentContextNavigateByUrlInterrupter.\u0275fac});let ComponentContextNavigateByUrlInterrupter2=_ComponentContextNavigateByUrlInterrupter;return ComponentContextNavigateByUrlInterrupter2})(),ComponentContextToggleVpnInterceptor=(()=>{let _ComponentContextToggleVpnInterceptor=class _ComponentContextToggleVpnInterceptor extends ComponentContextInterceptor{constructor(){super(...arguments),this.snackBar=inject(MatSnackBar)}intercept(command,args){return command==="toggle-vpn"?(this.snackBar.open("VPN Connection toggled",void 0,{duration:4e3}),EMPTY):of(args)}};_ComponentContextToggleVpnInterceptor.\u0275fac=(()=>{let \u0275ComponentContextToggleVpnInterceptor_BaseFactory;return function(__ngFactoryType__){return(\u0275ComponentContextToggleVpnInterceptor_BaseFactory||(\u0275ComponentContextToggleVpnInterceptor_BaseFactory=\u0275\u0275getInheritedFactory(_ComponentContextToggleVpnInterceptor)))(__ngFactoryType__||_ComponentContextToggleVpnInterceptor)}})(),_ComponentContextToggleVpnInterceptor.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentContextToggleVpnInterceptor,factory:_ComponentContextToggleVpnInterceptor.\u0275fac});let ComponentContextToggleVpnInterceptor2=_ComponentContextToggleVpnInterceptor;return ComponentContextToggleVpnInterceptor2})(),ComponentContextShowVpnStatusDetailsInterceptor=(()=>{let _ComponentContextShowVpnStatusDetailsInterceptor=class _ComponentContextShowVpnStatusDetailsInterceptor extends ComponentContextInterceptor{constructor(){super(...arguments),this.snackBar=inject(MatSnackBar)}intercept(command,args){return command==="show-vpn-status-details"?(this.snackBar.open("VPN details dialog opened",void 0,{duration:4e3}),EMPTY):of(args)}};_ComponentContextShowVpnStatusDetailsInterceptor.\u0275fac=(()=>{let \u0275ComponentContextShowVpnStatusDetailsInterceptor_BaseFactory;return function(__ngFactoryType__){return(\u0275ComponentContextShowVpnStatusDetailsInterceptor_BaseFactory||(\u0275ComponentContextShowVpnStatusDetailsInterceptor_BaseFactory=\u0275\u0275getInheritedFactory(_ComponentContextShowVpnStatusDetailsInterceptor)))(__ngFactoryType__||_ComponentContextShowVpnStatusDetailsInterceptor)}})(),_ComponentContextShowVpnStatusDetailsInterceptor.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentContextShowVpnStatusDetailsInterceptor,factory:_ComponentContextShowVpnStatusDetailsInterceptor.\u0275fac});let ComponentContextShowVpnStatusDetailsInterceptor2=_ComponentContextShowVpnStatusDetailsInterceptor;return ComponentContextShowVpnStatusDetailsInterceptor2})();var ComponentContextInterceptorModule=(()=>{let _ComponentContextInterceptorModule=class _ComponentContextInterceptorModule{};_ComponentContextInterceptorModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentContextInterceptorModule)},_ComponentContextInterceptorModule.\u0275mod=\u0275\u0275defineNgModule({type:_ComponentContextInterceptorModule}),_ComponentContextInterceptorModule.\u0275inj=\u0275\u0275defineInjector({providers:[{provide:COMPONENT_CONTEXT_INTERCEPTORS,useClass:ComponentContextNavigateByUrlInterrupter,multi:!0},{provide:COMPONENT_CONTEXT_INTERCEPTORS,useClass:ComponentContextShowVpnStatusDetailsInterceptor,multi:!0},{provide:COMPONENT_CONTEXT_INTERCEPTORS,useClass:ComponentContextToggleVpnInterceptor,multi:!0}]});let ComponentContextInterceptorModule2=_ComponentContextInterceptorModule;return ComponentContextInterceptorModule2})();var AppModule=(()=>{let _AppModule=class _AppModule{};_AppModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppModule)},_AppModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppModule,bootstrap:[AppComponent]}),_AppModule.\u0275inj=\u0275\u0275defineInjector({providers:[AppGuard2,{provide:APP_CONFIG,useFactory:appConfigFactory},{provide:IXAPI_OPTIONS,useFactory:factory,deps:[APP_CONFIG]},{provide:FQDN,useFactory:fqdnFactory,deps:[DOCUMENT]},{provide:APP_WEB_ROOT_URL,useFactory:appWebRootUrlFactory,deps:[DOCUMENT]},{provide:ComponentLoaderService,useClass:ComponentLoaderMockService},{provide:RESOURCE_DATA_PROVIDER_AVAILABILITY_STRATEGY,useValue:ResourceDataProviderAvailabilityStrategy.Always},...__use_api_mocks__?[{provide:WEB_SOCKET,useFactory:webSocketMockFactory,deps:[Injector]}]:[]],imports:[BrowserModule,BrowserAnimationsModule,FlexLayoutModule,NgxDaterangepickerMd.forRoot(),AppCoreModule,AppStateModule,AppSystemsModule,ComponentContextInterceptorModule,FaviconModule,FileSaveModule.forRoot(),IconsModule,LayoutModule2,AppRoutingModule,LoginExpiredModule,SettingsModule,TwoFactorAuthRequiredComponent,BuilderComponent]});let AppModule2=_AppModule;return AppModule2})();function factory(config3){return config3.api}environment.production&&void 0;document.addEventListener("DOMContentLoaded",()=>{Promise.all([loadAppConfig(),loadAccessToken(),features.init()]).then(()=>{platformBrowser().bootstrapModule(AppModule).catch(err=>console.error(err))})});function loadAccessToken(){return new Promise((resolve,reject2)=>{let xhr=new XMLHttpRequest;xhr.onload=()=>resolve(new Response(xhr.responseText,{status:xhr.status})),xhr.onerror=reject2,xhr.open("GET","/access-token.txt"),xhr.send(null)}).then(response=>response.status===404?"":response.text()).then(token=>_rememberToken(token))}function _rememberToken(token){let key="ix-auth";if(token){if(localStorage.getItem(key)){let json=JSON.parse(localStorage.getItem(key)),value=json.encrypted?decryptValue(json.value):json.value;if(token===value)return}let expires=Math.floor(new Date().getTime()/1e3)+24*60*60;localStorage.setItem(key,JSON.stringify({expires,value:token}))}}
899
+ `,header}function insertBanner(banner,offset3){document.getElementById("appBanner")?.remove(),document.documentElement.style.setProperty("--app-banner-offset",offset3),document.body.append(banner)}var utils={generateBanner,genericBanner,insertBanner};var AppBannerService=(()=>{let _AppBannerService=class _AppBannerService{constructor(capacitorPlatform,translate,http,platform,store){this.capacitorPlatform=capacitorPlatform,this.http=http,this.platform=platform,this.store=store,this.destroy=inject(DestroyRef),environment.appName==="Portal"&&this.capacitorPlatform==="web"&&(this.platform.ANDROID||this.platform.IOS)&&this.store.select(selectSectorAndHostLoaded).pipe(distinctUntilChanged(),filter(loaded=>loaded),mergeMap(()=>this.store.select(selectActiveBranding)),takeUntilDestroyed(this.destroy)).subscribe(branding=>{if(branding?.appleAppStoreLink&&this.getAppInfo(branding.appleAppStoreLink).subscribe(appInfo=>{if(!appInfo||typeof appInfo!="object"||!(appInfo.trackName||appInfo.artworkUrl512))return;let banner=utils.generateBanner({appLink:branding.googlePlayStoreLink&&this.platform.ANDROID?branding.googlePlayStoreLink:branding.appleAppStoreLink,appName:appInfo.trackName,imageLink:appInfo.artworkUrl512},translate);utils.insertBanner(banner,"80px")}),branding?.googlePlayStoreLink&&!branding?.appleAppStoreLink){let banner=utils.genericBanner(branding.googlePlayStoreLink,translate);utils.insertBanner(banner,"50px")}})}getAppInfo(appleAppStoreLink,cacheBust=Date.now()){let matches=appleAppStoreLink.match(/.*id([0-9]+)/);if(!matches)return EMPTY;let appId=matches[1];return this.http.get(`https://itunes.apple.com/lookup?id=${appId}&cacheBust=${cacheBust}`).pipe(map(response=>response.results[0]),catchError(()=>EMPTY))}};_AppBannerService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppBannerService)(\u0275\u0275inject(CAPACITOR_PLATFORM),\u0275\u0275inject(TranslateService),\u0275\u0275inject(HttpClient),\u0275\u0275inject(Platform),\u0275\u0275inject(Store))},_AppBannerService.\u0275prov=\u0275\u0275defineInjectable({token:_AppBannerService,factory:_AppBannerService.\u0275fac,providedIn:"root"});let AppBannerService2=_AppBannerService;return AppBannerService2})();var BrandingEffects2=(()=>{let _BrandingEffects=class _BrandingEffects{constructor(actions$,store,favicon,meta,title,translate){this.actions$=actions$,this.store=store,this.favicon=favicon,this.meta=meta,this.title=title,this.translate=translate,this.companyBranding$=createEffect(()=>this.store.select(selectMyCompany).pipe(map(company=>company?.branding?omit_default(company.branding,["appleTouchIcon","name"]):null),distinctUntilChanged(isEqual_default),map(branding=>branding?setCompanyBranding({branding}):removeCompanyBranding()))),this.hostBranding$=createEffect(()=>this.actions$.pipe(ofType(loadHostSuccess),map(({data})=>data),map(branding=>setHostBranding({branding})))),this.sectorBranding$=createEffect(()=>this.actions$.pipe(ofType(loadMeSuccess),map(({data})=>data.branding||null),map(branding=>setSectorBranding({branding})))),this.logout$=createEffect(()=>this.actions$.pipe(ofType(logOutSuccess,loggedOutByApi,loggedOutByStorage),map(()=>removeCompanyBranding()))),this.favicon$=createEffect(()=>this.store.select(selectSectorAndHostLoaded).pipe(distinctUntilChanged(),mergeMap(loaded=>loaded?this.store.select(selectActiveBranding):EMPTY),tap(branding=>{branding?.favicon&&this.favicon.set("icon",branding.favicon,FEATURE_NAME10)})),{dispatch:!1}),this.appName$=createEffect(()=>this.store.select(selectSectorAndHostLoaded).pipe(distinctUntilChanged(),mergeMap(loaded=>loaded?this.store.select(selectActiveBranding):EMPTY),mergeMap(branding=>branding?.custom?.glbBrowserTitle?of(branding.custom.glbBrowserTitle):this.store.select(selectMySector).pipe(take(1),map(sector=>sector?.branding?.custom?.glbBrowserTitle?sector.branding.custom.glbBrowserTitle:sector?.name||""))),tap(appName=>{this.meta.updateTag({name:"application-name",content:appName}),this.meta.updateTag({name:"apple-mobile-web-app-title",content:appName})})),{dispatch:!1}),this.title$=createEffect(()=>this.store.select(selectSectorAndHostLoaded).pipe(distinctUntilChanged(),mergeMap(loaded=>loaded?this.store.select(selectActiveBranding):EMPTY),mergeMap(branding=>branding?.custom?.glbBrowserTitle?of(branding.custom.glbBrowserTitle):this.store.select(selectMySector).pipe(take(1),map(sector=>sector?.branding?.custom?.glbBrowserTitle?sector.branding.custom.glbBrowserTitle:sector?.name||""))),switchMap(newTitle=>this.actions$.pipe(ofType(ROUTER_NAVIGATED),tap(action=>{action.payload.routerState.url.startsWith("/login")?(this.title.setTitle(this.translate.instant("LOG_IN_TO_YOUR_SITE_ACCOUNT",{site:newTitle})),this.meta.updateTag({name:"description",content:this.translate.instant("__MESSAGE__.LOG_IN_PAGE_DESCRIPTION",{site:newTitle})})):this.title.setTitle(`${environment.appName}${newTitle?" - "+newTitle:""}`)})))),{dispatch:!1})}};_BrandingEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BrandingEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(Store),\u0275\u0275inject(Favicon),\u0275\u0275inject(Meta),\u0275\u0275inject(Title),\u0275\u0275inject(TranslateService))},_BrandingEffects.\u0275prov=\u0275\u0275defineInjectable({token:_BrandingEffects,factory:_BrandingEffects.\u0275fac});let BrandingEffects3=_BrandingEffects;return BrandingEffects3})();var BrandingInterceptor=(()=>{let _BrandingInterceptor=class _BrandingInterceptor{constructor(document2,store){this.document=document2,this.store=store}intercept(request,delegate){return request.context.get(REQUIRES_BRANDING)===!0?this.store.select(selectSectorAndHostLoaded).pipe(filter(loaded=>loaded),take(1),withLatestFrom(this.store.select(selectActiveFqdn)),mergeMap(([,fqdn])=>{let branding=fqdn||(this.document.location.hostname==="localhost"?".localhost":this.document.location.hostname);return delegate.handle(request.clone({setHeaders:{[IxApiHeaderKeys.Branding]:branding}}))})):delegate.handle(request)}};_BrandingInterceptor.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BrandingInterceptor)(\u0275\u0275inject(DOCUMENT),\u0275\u0275inject(Store))},_BrandingInterceptor.\u0275prov=\u0275\u0275defineInjectable({token:_BrandingInterceptor,factory:_BrandingInterceptor.\u0275fac,providedIn:"root"});let BrandingInterceptor2=_BrandingInterceptor;return BrandingInterceptor2})();var BrandingModule2=(()=>{let _BrandingModule=class _BrandingModule{constructor(_appBannerService){}};_BrandingModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_BrandingModule)(\u0275\u0275inject(AppBannerService))},_BrandingModule.\u0275mod=\u0275\u0275defineNgModule({type:_BrandingModule}),_BrandingModule.\u0275inj=\u0275\u0275defineInjector({providers:[{provide:HTTP_INTERCEPTORS,useClass:BrandingInterceptor,multi:!0},provideHttpClient(withInterceptorsFromDi())],imports:[FaviconModule,EffectsModule.forFeature([BrandingEffects2]),StoreModule.forFeature(feature8)]});let BrandingModule3=_BrandingModule;return BrandingModule3})();function mapTranslationsToObject(translations,languageCode){return{__TRANSLATION__:translations.reduce((obj,translation)=>{if(translation.languages&&translation.key){let language=translation.languages[languageCode];if(language)return __spreadProps(__spreadValues({},obj),{[translation.key]:language})}return obj},{})}}function mergeTranslationsFactory(translate){return function(translations,languageCode){translate.setTranslation(languageCode,Object.assign(translate.translations[languageCode],mapTranslationsToObject(translations,languageCode)))}}var CustomTranslationsEffects=(()=>{let _CustomTranslationsEffects=class _CustomTranslationsEffects{constructor(actions$,store,translate){this.actions$=actions$,this.store=store,this.translate=translate,this.changes$=createEffect(()=>this.actions$.pipe(ofType(loadAllSuccess55),switchMap(()=>this.store.select(selectAll44)),distinctUntilChanged(isEqual_default),tap(translations=>this.translate.langs.forEach(lang=>this._merge(translations,lang))),mergeMap(()=>[invalidateTranslations6(),invalidateTranslations3(),invalidateTranslations(),invalidateTranslations2(),invalidateTranslations4(),invalidateTranslations5()]))),this.langChanges$=createEffect(()=>this.translate.onLangChange.pipe(skip(1),concatLatestFrom(()=>this.store.select(selectAll44)),tap(([,translations])=>this.translate.langs.forEach(lang=>this._merge(translations,lang))),mergeMap(()=>[invalidateTranslations6(),invalidateTranslations3(),invalidateTranslations(),invalidateTranslations2(),invalidateTranslations4(),invalidateTranslations5()]))),this._merge=mergeTranslationsFactory(this.translate)}};_CustomTranslationsEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsEffects)(\u0275\u0275inject(Actions),\u0275\u0275inject(Store),\u0275\u0275inject(TranslateService))},_CustomTranslationsEffects.\u0275prov=\u0275\u0275defineInjectable({token:_CustomTranslationsEffects,factory:_CustomTranslationsEffects.\u0275fac});let CustomTranslationsEffects2=_CustomTranslationsEffects;return CustomTranslationsEffects2})(),CustomTranslationsOnLoadEffects=(()=>{let _CustomTranslationsOnLoadEffects=class _CustomTranslationsOnLoadEffects{constructor(actions$){this.actions$=actions$,this.companyLoad$=createEffect(()=>this.actions$.pipe(ofType(loadMe3),map(()=>loadAll54())))}};_CustomTranslationsOnLoadEffects.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsOnLoadEffects)(\u0275\u0275inject(Actions))},_CustomTranslationsOnLoadEffects.\u0275prov=\u0275\u0275defineInjectable({token:_CustomTranslationsOnLoadEffects,factory:_CustomTranslationsOnLoadEffects.\u0275fac});let CustomTranslationsOnLoadEffects2=_CustomTranslationsOnLoadEffects;return CustomTranslationsOnLoadEffects2})();var CustomTranslationsGuard=(()=>{let _CustomTranslationsGuard=class _CustomTranslationsGuard{constructor(store){this.store=store}canActivate(){return this.store.select(selectAllLoaded33).pipe(filter(Boolean),take(1))}};_CustomTranslationsGuard.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsGuard)(\u0275\u0275inject(Store))},_CustomTranslationsGuard.\u0275prov=\u0275\u0275defineInjectable({token:_CustomTranslationsGuard,factory:_CustomTranslationsGuard.\u0275fac,providedIn:"root"});let CustomTranslationsGuard2=_CustomTranslationsGuard;return CustomTranslationsGuard2})();var CustomTranslationsLoadingStrategy=function(CustomTranslationsLoadingStrategy2){return CustomTranslationsLoadingStrategy2[CustomTranslationsLoadingStrategy2.None=0]="None",CustomTranslationsLoadingStrategy2[CustomTranslationsLoadingStrategy2.Default=1]="Default",CustomTranslationsLoadingStrategy2}(CustomTranslationsLoadingStrategy||{});var CustomTranslationsDefaultModule=(()=>{let _CustomTranslationsDefaultModule=class _CustomTranslationsDefaultModule{};_CustomTranslationsDefaultModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsDefaultModule)},_CustomTranslationsDefaultModule.\u0275mod=\u0275\u0275defineNgModule({type:_CustomTranslationsDefaultModule}),_CustomTranslationsDefaultModule.\u0275inj=\u0275\u0275defineInjector({imports:[EffectsModule.forFeature([CustomTranslationsEffects,CustomTranslationsOnLoadEffects])]});let CustomTranslationsDefaultModule2=_CustomTranslationsDefaultModule;return CustomTranslationsDefaultModule2})(),CustomTranslationsMinimalModule=(()=>{let _CustomTranslationsMinimalModule=class _CustomTranslationsMinimalModule{};_CustomTranslationsMinimalModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsMinimalModule)},_CustomTranslationsMinimalModule.\u0275mod=\u0275\u0275defineNgModule({type:_CustomTranslationsMinimalModule}),_CustomTranslationsMinimalModule.\u0275inj=\u0275\u0275defineInjector({imports:[EffectsModule.forFeature([CustomTranslationsEffects])]});let CustomTranslationsMinimalModule2=_CustomTranslationsMinimalModule;return CustomTranslationsMinimalModule2})(),CustomTranslationsModule=(()=>{let _CustomTranslationsModule=class _CustomTranslationsModule{static forRoot(config3){return config3?.loadingStrategy===CustomTranslationsLoadingStrategy.None?{ngModule:CustomTranslationsMinimalModule}:{ngModule:CustomTranslationsDefaultModule,providers:[{provide:AUTH_COMPANY_GUARD_RESOLVERS,useFactory:guard=>()=>guard.canActivate(),deps:[CustomTranslationsGuard],multi:!0}]}}};_CustomTranslationsModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_CustomTranslationsModule)},_CustomTranslationsModule.\u0275mod=\u0275\u0275defineNgModule({type:_CustomTranslationsModule}),_CustomTranslationsModule.\u0275inj=\u0275\u0275defineInjector({});let CustomTranslationsModule2=_CustomTranslationsModule;return CustomTranslationsModule2})();var theming_effects_exports={};__export(theming_effects_exports,{removeCompanyTheme:()=>removeCompanyTheme,setCompanyTheme:()=>setCompanyTheme,setHostTheme:()=>setHostTheme,setSectorTheme:()=>setSectorTheme});var import_tinycolor24=__toESM(require_tinycolor());var import_tinycolor23=__toESM(require_tinycolor());var import_tinycolor22=__toESM(require_tinycolor());function signum(num){return num<0?-1:num===0?0:1}function lerp(start3,stop2,amount){return(1-amount)*start3+amount*stop2}function clampInt(min2,max2,input2){return input2<min2?min2:input2>max2?max2:input2}function clampDouble(min2,max2,input2){return input2<min2?min2:input2>max2?max2:input2}function sanitizeDegreesDouble(degrees){return degrees=degrees%360,degrees<0&&(degrees=degrees+360),degrees}function matrixMultiply(row,matrix){let a=row[0]*matrix[0][0]+row[1]*matrix[0][1]+row[2]*matrix[0][2],b=row[0]*matrix[1][0]+row[1]*matrix[1][1]+row[2]*matrix[1][2],c=row[0]*matrix[2][0]+row[1]*matrix[2][1]+row[2]*matrix[2][2];return[a,b,c]}var SRGB_TO_XYZ=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],XYZ_TO_SRGB=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],WHITE_POINT_D65=[95.047,100,108.883];function argbFromRgb(red,green,blue){return(255<<24|(red&255)<<16|(green&255)<<8|blue&255)>>>0}function argbFromLinrgb(linrgb){let r=delinearized(linrgb[0]),g=delinearized(linrgb[1]),b=delinearized(linrgb[2]);return argbFromRgb(r,g,b)}function redFromArgb(argb){return argb>>16&255}function greenFromArgb(argb){return argb>>8&255}function blueFromArgb(argb){return argb&255}function argbFromXyz(x,y,z){let matrix=XYZ_TO_SRGB,linearR=matrix[0][0]*x+matrix[0][1]*y+matrix[0][2]*z,linearG=matrix[1][0]*x+matrix[1][1]*y+matrix[1][2]*z,linearB=matrix[2][0]*x+matrix[2][1]*y+matrix[2][2]*z,r=delinearized(linearR),g=delinearized(linearG),b=delinearized(linearB);return argbFromRgb(r,g,b)}function xyzFromArgb(argb){let r=linearized(redFromArgb(argb)),g=linearized(greenFromArgb(argb)),b=linearized(blueFromArgb(argb));return matrixMultiply([r,g,b],SRGB_TO_XYZ)}function argbFromLstar(lstar){let y=yFromLstar(lstar),component=delinearized(y);return argbFromRgb(component,component,component)}function lstarFromArgb(argb){let y=xyzFromArgb(argb)[1];return 116*labF(y/100)-16}function yFromLstar(lstar){return 100*labInvf((lstar+16)/116)}function lstarFromY(y){return labF(y/100)*116-16}function linearized(rgbComponent){let normalized=rgbComponent/255;return normalized<=.040449936?normalized/12.92*100:Math.pow((normalized+.055)/1.055,2.4)*100}function delinearized(rgbComponent){let normalized=rgbComponent/100,delinearized2=0;return normalized<=.0031308?delinearized2=normalized*12.92:delinearized2=1.055*Math.pow(normalized,1/2.4)-.055,clampInt(0,255,Math.round(delinearized2*255))}function whitePointD65(){return WHITE_POINT_D65}function labF(t){let e=.008856451679035631,kappa=24389/27;return t>e?Math.pow(t,1/3):(kappa*t+16)/116}function labInvf(ft){let e=.008856451679035631,kappa=24389/27,ft3=ft*ft*ft;return ft3>e?ft3:(116*ft-16)/kappa}var ViewingConditions=class _ViewingConditions{static make(whitePoint=whitePointD65(),adaptingLuminance=200/Math.PI*yFromLstar(50)/100,backgroundLstar=50,surround=2,discountingIlluminant=!1){let xyz=whitePoint,rW=xyz[0]*.401288+xyz[1]*.650173+xyz[2]*-.051461,gW=xyz[0]*-.250268+xyz[1]*1.204414+xyz[2]*.045854,bW=xyz[0]*-.002079+xyz[1]*.048952+xyz[2]*.953127,f=.8+surround/10,c=f>=.9?lerp(.59,.69,(f-.9)*10):lerp(.525,.59,(f-.8)*10),d=discountingIlluminant?1:f*(1-1/3.6*Math.exp((-adaptingLuminance-42)/92));d=d>1?1:d<0?0:d;let nc=f,rgbD=[d*(100/rW)+1-d,d*(100/gW)+1-d,d*(100/bW)+1-d],k=1/(5*adaptingLuminance+1),k4=k*k*k*k,k4F=1-k4,fl=k4*adaptingLuminance+.1*k4F*k4F*Math.cbrt(5*adaptingLuminance),n2=yFromLstar(backgroundLstar)/whitePoint[1],z=1.48+Math.sqrt(n2),nbb=.725/Math.pow(n2,.2),ncb=nbb,rgbAFactors=[Math.pow(fl*rgbD[0]*rW/100,.42),Math.pow(fl*rgbD[1]*gW/100,.42),Math.pow(fl*rgbD[2]*bW/100,.42)],rgbA=[400*rgbAFactors[0]/(rgbAFactors[0]+27.13),400*rgbAFactors[1]/(rgbAFactors[1]+27.13),400*rgbAFactors[2]/(rgbAFactors[2]+27.13)],aw=(2*rgbA[0]+rgbA[1]+.05*rgbA[2])*nbb;return new _ViewingConditions(n2,aw,nbb,ncb,c,nc,rgbD,fl,Math.pow(fl,.25),z)}constructor(n2,aw,nbb,ncb,c,nc,rgbD,fl,fLRoot,z){this.n=n2,this.aw=aw,this.nbb=nbb,this.ncb=ncb,this.c=c,this.nc=nc,this.rgbD=rgbD,this.fl=fl,this.fLRoot=fLRoot,this.z=z}};ViewingConditions.DEFAULT=ViewingConditions.make();var Cam16=class _Cam16{constructor(hue,chroma,j,q,m,s2,jstar,astar,bstar){this.hue=hue,this.chroma=chroma,this.j=j,this.q=q,this.m=m,this.s=s2,this.jstar=jstar,this.astar=astar,this.bstar=bstar}distance(other){let dJ=this.jstar-other.jstar,dA=this.astar-other.astar,dB=this.bstar-other.bstar,dEPrime=Math.sqrt(dJ*dJ+dA*dA+dB*dB);return 1.41*Math.pow(dEPrime,.63)}static fromInt(argb){return _Cam16.fromIntInViewingConditions(argb,ViewingConditions.DEFAULT)}static fromIntInViewingConditions(argb,viewingConditions){let red=(argb&16711680)>>16,green=(argb&65280)>>8,blue=argb&255,redL=linearized(red),greenL=linearized(green),blueL=linearized(blue),x=.41233895*redL+.35762064*greenL+.18051042*blueL,y=.2126*redL+.7152*greenL+.0722*blueL,z=.01932141*redL+.11916382*greenL+.95034478*blueL,rC=.401288*x+.650173*y-.051461*z,gC=-.250268*x+1.204414*y+.045854*z,bC=-.002079*x+.048952*y+.953127*z,rD=viewingConditions.rgbD[0]*rC,gD=viewingConditions.rgbD[1]*gC,bD=viewingConditions.rgbD[2]*bC,rAF=Math.pow(viewingConditions.fl*Math.abs(rD)/100,.42),gAF=Math.pow(viewingConditions.fl*Math.abs(gD)/100,.42),bAF=Math.pow(viewingConditions.fl*Math.abs(bD)/100,.42),rA=signum(rD)*400*rAF/(rAF+27.13),gA=signum(gD)*400*gAF/(gAF+27.13),bA=signum(bD)*400*bAF/(bAF+27.13),a=(11*rA+-12*gA+bA)/11,b=(rA+gA-2*bA)/9,u=(20*rA+20*gA+21*bA)/20,p2=(40*rA+20*gA+bA)/20,atanDegrees=Math.atan2(b,a)*180/Math.PI,hue=atanDegrees<0?atanDegrees+360:atanDegrees>=360?atanDegrees-360:atanDegrees,hueRadians=hue*Math.PI/180,ac=p2*viewingConditions.nbb,j=100*Math.pow(ac/viewingConditions.aw,viewingConditions.c*viewingConditions.z),q=4/viewingConditions.c*Math.sqrt(j/100)*(viewingConditions.aw+4)*viewingConditions.fLRoot,huePrime=hue<20.14?hue+360:hue,eHue=.25*(Math.cos(huePrime*Math.PI/180+2)+3.8),t=5e4/13*eHue*viewingConditions.nc*viewingConditions.ncb*Math.sqrt(a*a+b*b)/(u+.305),alpha=Math.pow(t,.9)*Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),c=alpha*Math.sqrt(j/100),m=c*viewingConditions.fLRoot,s2=50*Math.sqrt(alpha*viewingConditions.c/(viewingConditions.aw+4)),jstar=(1+100*.007)*j/(1+.007*j),mstar=1/.0228*Math.log(1+.0228*m),astar=mstar*Math.cos(hueRadians),bstar=mstar*Math.sin(hueRadians);return new _Cam16(hue,c,j,q,m,s2,jstar,astar,bstar)}static fromJch(j,c,h){return _Cam16.fromJchInViewingConditions(j,c,h,ViewingConditions.DEFAULT)}static fromJchInViewingConditions(j,c,h,viewingConditions){let q=4/viewingConditions.c*Math.sqrt(j/100)*(viewingConditions.aw+4)*viewingConditions.fLRoot,m=c*viewingConditions.fLRoot,alpha=c/Math.sqrt(j/100),s2=50*Math.sqrt(alpha*viewingConditions.c/(viewingConditions.aw+4)),hueRadians=h*Math.PI/180,jstar=(1+100*.007)*j/(1+.007*j),mstar=1/.0228*Math.log(1+.0228*m),astar=mstar*Math.cos(hueRadians),bstar=mstar*Math.sin(hueRadians);return new _Cam16(h,c,j,q,m,s2,jstar,astar,bstar)}static fromUcs(jstar,astar,bstar){return _Cam16.fromUcsInViewingConditions(jstar,astar,bstar,ViewingConditions.DEFAULT)}static fromUcsInViewingConditions(jstar,astar,bstar,viewingConditions){let a=astar,b=bstar,m=Math.sqrt(a*a+b*b),c=(Math.exp(m*.0228)-1)/.0228/viewingConditions.fLRoot,h=Math.atan2(b,a)*(180/Math.PI);h<0&&(h+=360);let j=jstar/(1-(jstar-100)*.007);return _Cam16.fromJchInViewingConditions(j,c,h,viewingConditions)}toInt(){return this.viewed(ViewingConditions.DEFAULT)}viewed(viewingConditions){let alpha=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),t=Math.pow(alpha/Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),1/.9),hRad=this.hue*Math.PI/180,eHue=.25*(Math.cos(hRad+2)+3.8),ac=viewingConditions.aw*Math.pow(this.j/100,1/viewingConditions.c/viewingConditions.z),p1=eHue*(5e4/13)*viewingConditions.nc*viewingConditions.ncb,p2=ac/viewingConditions.nbb,hSin=Math.sin(hRad),hCos=Math.cos(hRad),gamma=23*(p2+.305)*t/(23*p1+11*t*hCos+108*t*hSin),a=gamma*hCos,b=gamma*hSin,rA=(460*p2+451*a+288*b)/1403,gA=(460*p2-891*a-261*b)/1403,bA=(460*p2-220*a-6300*b)/1403,rCBase=Math.max(0,27.13*Math.abs(rA)/(400-Math.abs(rA))),rC=signum(rA)*(100/viewingConditions.fl)*Math.pow(rCBase,1/.42),gCBase=Math.max(0,27.13*Math.abs(gA)/(400-Math.abs(gA))),gC=signum(gA)*(100/viewingConditions.fl)*Math.pow(gCBase,1/.42),bCBase=Math.max(0,27.13*Math.abs(bA)/(400-Math.abs(bA))),bC=signum(bA)*(100/viewingConditions.fl)*Math.pow(bCBase,1/.42),rF=rC/viewingConditions.rgbD[0],gF=gC/viewingConditions.rgbD[1],bF=bC/viewingConditions.rgbD[2],x=1.86206786*rF-1.01125463*gF+.14918677*bF,y=.38752654*rF+.62144744*gF-.00897398*bF,z=-.0158415*rF-.03412294*gF+1.04996444*bF;return argbFromXyz(x,y,z)}static fromXyzInViewingConditions(x,y,z,viewingConditions){let rC=.401288*x+.650173*y-.051461*z,gC=-.250268*x+1.204414*y+.045854*z,bC=-.002079*x+.048952*y+.953127*z,rD=viewingConditions.rgbD[0]*rC,gD=viewingConditions.rgbD[1]*gC,bD=viewingConditions.rgbD[2]*bC,rAF=Math.pow(viewingConditions.fl*Math.abs(rD)/100,.42),gAF=Math.pow(viewingConditions.fl*Math.abs(gD)/100,.42),bAF=Math.pow(viewingConditions.fl*Math.abs(bD)/100,.42),rA=signum(rD)*400*rAF/(rAF+27.13),gA=signum(gD)*400*gAF/(gAF+27.13),bA=signum(bD)*400*bAF/(bAF+27.13),a=(11*rA+-12*gA+bA)/11,b=(rA+gA-2*bA)/9,u=(20*rA+20*gA+21*bA)/20,p2=(40*rA+20*gA+bA)/20,atanDegrees=Math.atan2(b,a)*180/Math.PI,hue=atanDegrees<0?atanDegrees+360:atanDegrees>=360?atanDegrees-360:atanDegrees,hueRadians=hue*Math.PI/180,ac=p2*viewingConditions.nbb,J=100*Math.pow(ac/viewingConditions.aw,viewingConditions.c*viewingConditions.z),Q=4/viewingConditions.c*Math.sqrt(J/100)*(viewingConditions.aw+4)*viewingConditions.fLRoot,huePrime=hue<20.14?hue+360:hue,eHue=1/4*(Math.cos(huePrime*Math.PI/180+2)+3.8),t=5e4/13*eHue*viewingConditions.nc*viewingConditions.ncb*Math.sqrt(a*a+b*b)/(u+.305),alpha=Math.pow(t,.9)*Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),C=alpha*Math.sqrt(J/100),M=C*viewingConditions.fLRoot,s2=50*Math.sqrt(alpha*viewingConditions.c/(viewingConditions.aw+4)),jstar=(1+100*.007)*J/(1+.007*J),mstar=Math.log(1+.0228*M)/.0228,astar=mstar*Math.cos(hueRadians),bstar=mstar*Math.sin(hueRadians);return new _Cam16(hue,C,J,Q,M,s2,jstar,astar,bstar)}xyzInViewingConditions(viewingConditions){let alpha=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),t=Math.pow(alpha/Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),1/.9),hRad=this.hue*Math.PI/180,eHue=.25*(Math.cos(hRad+2)+3.8),ac=viewingConditions.aw*Math.pow(this.j/100,1/viewingConditions.c/viewingConditions.z),p1=eHue*(5e4/13)*viewingConditions.nc*viewingConditions.ncb,p2=ac/viewingConditions.nbb,hSin=Math.sin(hRad),hCos=Math.cos(hRad),gamma=23*(p2+.305)*t/(23*p1+11*t*hCos+108*t*hSin),a=gamma*hCos,b=gamma*hSin,rA=(460*p2+451*a+288*b)/1403,gA=(460*p2-891*a-261*b)/1403,bA=(460*p2-220*a-6300*b)/1403,rCBase=Math.max(0,27.13*Math.abs(rA)/(400-Math.abs(rA))),rC=signum(rA)*(100/viewingConditions.fl)*Math.pow(rCBase,1/.42),gCBase=Math.max(0,27.13*Math.abs(gA)/(400-Math.abs(gA))),gC=signum(gA)*(100/viewingConditions.fl)*Math.pow(gCBase,1/.42),bCBase=Math.max(0,27.13*Math.abs(bA)/(400-Math.abs(bA))),bC=signum(bA)*(100/viewingConditions.fl)*Math.pow(bCBase,1/.42),rF=rC/viewingConditions.rgbD[0],gF=gC/viewingConditions.rgbD[1],bF=bC/viewingConditions.rgbD[2],x=1.86206786*rF-1.01125463*gF+.14918677*bF,y=.38752654*rF+.62144744*gF-.00897398*bF,z=-.0158415*rF-.03412294*gF+1.04996444*bF;return[x,y,z]}};var HctSolver=(()=>{class HctSolver2{static sanitizeRadians(angle){return(angle+Math.PI*8)%(Math.PI*2)}static trueDelinearized(rgbComponent){let normalized=rgbComponent/100,delinearized2=0;return normalized<=.0031308?delinearized2=normalized*12.92:delinearized2=1.055*Math.pow(normalized,1/2.4)-.055,delinearized2*255}static chromaticAdaptation(component){let af=Math.pow(Math.abs(component),.42);return signum(component)*400*af/(af+27.13)}static hueOf(linrgb){let scaledDiscount=matrixMultiply(linrgb,HctSolver2.SCALED_DISCOUNT_FROM_LINRGB),rA=HctSolver2.chromaticAdaptation(scaledDiscount[0]),gA=HctSolver2.chromaticAdaptation(scaledDiscount[1]),bA=HctSolver2.chromaticAdaptation(scaledDiscount[2]),a=(11*rA+-12*gA+bA)/11,b=(rA+gA-2*bA)/9;return Math.atan2(b,a)}static areInCyclicOrder(a,b,c){let deltaAB=HctSolver2.sanitizeRadians(b-a),deltaAC=HctSolver2.sanitizeRadians(c-a);return deltaAB<deltaAC}static intercept(source,mid,target){return(mid-source)/(target-source)}static lerpPoint(source,t,target){return[source[0]+(target[0]-source[0])*t,source[1]+(target[1]-source[1])*t,source[2]+(target[2]-source[2])*t]}static setCoordinate(source,coordinate,target,axis){let t=HctSolver2.intercept(source[axis],coordinate,target[axis]);return HctSolver2.lerpPoint(source,t,target)}static isBounded(x){return 0<=x&&x<=100}static nthVertex(y,n2){let kR=HctSolver2.Y_FROM_LINRGB[0],kG=HctSolver2.Y_FROM_LINRGB[1],kB=HctSolver2.Y_FROM_LINRGB[2],coordA=n2%4<=1?0:100,coordB=n2%2===0?0:100;if(n2<4){let g=coordA,b=coordB,r=(y-g*kG-b*kB)/kR;return HctSolver2.isBounded(r)?[r,g,b]:[-1,-1,-1]}else if(n2<8){let b=coordA,r=coordB,g=(y-r*kR-b*kB)/kG;return HctSolver2.isBounded(g)?[r,g,b]:[-1,-1,-1]}else{let r=coordA,g=coordB,b=(y-r*kR-g*kG)/kB;return HctSolver2.isBounded(b)?[r,g,b]:[-1,-1,-1]}}static bisectToSegment(y,targetHue){let left2=[-1,-1,-1],right2=left2,leftHue=0,rightHue=0,initialized=!1,uncut=!0;for(let n2=0;n2<12;n2++){let mid=HctSolver2.nthVertex(y,n2);if(mid[0]<0)continue;let midHue=HctSolver2.hueOf(mid);if(!initialized){left2=mid,right2=mid,leftHue=midHue,rightHue=midHue,initialized=!0;continue}(uncut||HctSolver2.areInCyclicOrder(leftHue,midHue,rightHue))&&(uncut=!1,HctSolver2.areInCyclicOrder(leftHue,targetHue,midHue)?(right2=mid,rightHue=midHue):(left2=mid,leftHue=midHue))}return[left2,right2]}static midpoint(a,b){return[(a[0]+b[0])/2,(a[1]+b[1])/2,(a[2]+b[2])/2]}static criticalPlaneBelow(x){return Math.floor(x-.5)}static criticalPlaneAbove(x){return Math.ceil(x-.5)}static bisectToLimit(y,targetHue){let segment=HctSolver2.bisectToSegment(y,targetHue),left2=segment[0],leftHue=HctSolver2.hueOf(left2),right2=segment[1];for(let axis=0;axis<3;axis++)if(left2[axis]!==right2[axis]){let lPlane=-1,rPlane=255;left2[axis]<right2[axis]?(lPlane=HctSolver2.criticalPlaneBelow(HctSolver2.trueDelinearized(left2[axis])),rPlane=HctSolver2.criticalPlaneAbove(HctSolver2.trueDelinearized(right2[axis]))):(lPlane=HctSolver2.criticalPlaneAbove(HctSolver2.trueDelinearized(left2[axis])),rPlane=HctSolver2.criticalPlaneBelow(HctSolver2.trueDelinearized(right2[axis])));for(let i=0;i<8&&!(Math.abs(rPlane-lPlane)<=1);i++){let mPlane=Math.floor((lPlane+rPlane)/2),midPlaneCoordinate=HctSolver2.CRITICAL_PLANES[mPlane],mid=HctSolver2.setCoordinate(left2,midPlaneCoordinate,right2,axis),midHue=HctSolver2.hueOf(mid);HctSolver2.areInCyclicOrder(leftHue,targetHue,midHue)?(right2=mid,rPlane=mPlane):(left2=mid,leftHue=midHue,lPlane=mPlane)}}return HctSolver2.midpoint(left2,right2)}static inverseChromaticAdaptation(adapted){let adaptedAbs=Math.abs(adapted),base=Math.max(0,27.13*adaptedAbs/(400-adaptedAbs));return signum(adapted)*Math.pow(base,1/.42)}static findResultByJ(hueRadians,chroma,y){let j=Math.sqrt(y)*11,viewingConditions=ViewingConditions.DEFAULT,tInnerCoeff=1/Math.pow(1.64-Math.pow(.29,viewingConditions.n),.73),p1=.25*(Math.cos(hueRadians+2)+3.8)*(5e4/13)*viewingConditions.nc*viewingConditions.ncb,hSin=Math.sin(hueRadians),hCos=Math.cos(hueRadians);for(let iterationRound=0;iterationRound<5;iterationRound++){let jNormalized=j/100,alpha=chroma===0||j===0?0:chroma/Math.sqrt(jNormalized),t=Math.pow(alpha*tInnerCoeff,1/.9),p2=viewingConditions.aw*Math.pow(jNormalized,1/viewingConditions.c/viewingConditions.z)/viewingConditions.nbb,gamma=23*(p2+.305)*t/(23*p1+11*t*hCos+108*t*hSin),a=gamma*hCos,b=gamma*hSin,rA=(460*p2+451*a+288*b)/1403,gA=(460*p2-891*a-261*b)/1403,bA=(460*p2-220*a-6300*b)/1403,rCScaled=HctSolver2.inverseChromaticAdaptation(rA),gCScaled=HctSolver2.inverseChromaticAdaptation(gA),bCScaled=HctSolver2.inverseChromaticAdaptation(bA),linrgb=matrixMultiply([rCScaled,gCScaled,bCScaled],HctSolver2.LINRGB_FROM_SCALED_DISCOUNT);if(linrgb[0]<0||linrgb[1]<0||linrgb[2]<0)return 0;let kR=HctSolver2.Y_FROM_LINRGB[0],kG=HctSolver2.Y_FROM_LINRGB[1],kB=HctSolver2.Y_FROM_LINRGB[2],fnj=kR*linrgb[0]+kG*linrgb[1]+kB*linrgb[2];if(fnj<=0)return 0;if(iterationRound===4||Math.abs(fnj-y)<.002)return linrgb[0]>100.01||linrgb[1]>100.01||linrgb[2]>100.01?0:argbFromLinrgb(linrgb);j=j-(fnj-y)*j/(2*fnj)}return 0}static solveToInt(hueDegrees,chroma,lstar){if(chroma<1e-4||lstar<1e-4||lstar>99.9999)return argbFromLstar(lstar);hueDegrees=sanitizeDegreesDouble(hueDegrees);let hueRadians=hueDegrees/180*Math.PI,y=yFromLstar(lstar),exactAnswer=HctSolver2.findResultByJ(hueRadians,chroma,y);if(exactAnswer!==0)return exactAnswer;let linrgb=HctSolver2.bisectToLimit(y,hueRadians);return argbFromLinrgb(linrgb)}static solveToCam(hueDegrees,chroma,lstar){return Cam16.fromInt(HctSolver2.solveToInt(hueDegrees,chroma,lstar))}}return HctSolver2.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],HctSolver2.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],HctSolver2.Y_FROM_LINRGB=[.2126,.7152,.0722],HctSolver2.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.942497089126609,1.0022825574869039,1.0642236851973577,1.1283421258858297,1.1946592148522128,1.2631959812511864,1.3339731595349034,1.407011200216447,1.4823302800086415,1.5599503113873272,1.6398909516233677,1.7221716113234105,1.8068114625156377,1.8938294463134073,1.9832442801866852,2.075074464868551,2.1693382909216234,2.2660538449872063,2.36523901573795,2.4669114995532007,2.5710888059345764,2.6777882626779785,2.7870270208169257,2.898822059350997,3.0131901897720907,3.1301480604002863,3.2497121605402226,3.3718988244681087,3.4967242352587946,3.624204428461639,3.754355295633311,3.887192587735158,4.022731918402185,4.160988767090289,4.301978482107941,4.445716283538092,4.592217266055746,4.741496401646282,4.893568542229298,5.048448422192488,5.20615066083972,5.3666897647573375,5.5300801301023865,5.696336044816294,5.865471690767354,6.037501145825082,6.212438385869475,6.390297286737924,6.571091626112461,6.7548350853498045,6.941541251256611,7.131223617812143,7.323895587840543,7.5195704746346665,7.7182615035334345,7.919981813454504,8.124744458384042,8.332562408825165,8.543448553206703,8.757415699253682,8.974476575321063,9.194643831691977,9.417930041841839,9.644347703669503,9.873909240696694,10.106627003236781,10.342513269534024,10.58158024687427,10.8238400726681,11.069304815507364,11.317986476196008,11.569896988756009,11.825048221409341,12.083451977536606,12.345119996613247,12.610063955123938,12.878295467455942,13.149826086772048,13.42466730586372,13.702830557985108,13.984327217668513,14.269168601521828,14.55736596900856,14.848930523210871,15.143873411576273,15.44220572664832,15.743938506781891,16.04908273684337,16.35764934889634,16.66964922287304,16.985093187232053,17.30399201960269,17.62635644741625,17.95219714852476,18.281524751807332,18.614349837764564,18.95068293910138,19.290534541298456,19.633915083172692,19.98083495742689,20.331304511189067,20.685334046541502,21.042933821039977,21.404114048223256,21.76888489811322,22.137256497705877,22.50923893145328,22.884842241736916,23.264076429332462,23.6469514538663,24.033477234264016,24.42366364919083,24.817520537484558,25.21505769858089,25.61628489293138,26.021211842414342,26.429848230738664,26.842203703840827,27.258287870275353,27.678110301598522,28.10168053274597,28.529008062403893,28.96010235337422,29.39497283293396,29.83362889318845,30.276079891419332,30.722335150426627,31.172403958865512,31.62629557157785,32.08401920991837,32.54558406207592,33.010999283389665,33.4802739966603,33.953417292456834,34.430438229418264,34.911345834551085,35.39614910352207,35.88485700094671,36.37747846067349,36.87402238606382,37.37449765026789,37.87891309649659,38.38727753828926,38.89959975977785,39.41588851594697,39.93615253289054,40.460400508064545,40.98864111053629,41.520882981230194,42.05713473317016,42.597404951718396,43.141702194811224,43.6900349931913,44.24241185063697,44.798841244188324,45.35933162437017,45.92389141541209,46.49252901546552,47.065252796817916,47.64207110610409,48.22299226451468,48.808024568002054,49.3971762874833,49.9904556690408,50.587870934119984,51.189430279724725,51.79514187861014,52.40501387947288,53.0190544071392,53.637271562750364,54.259673423945976,54.88626804504493,55.517063457223934,56.15206766869424,56.79128866487574,57.43473440856916,58.08241284012621,58.734331877617365,59.39049941699807,60.05092333227251,60.715611475655585,61.38457167773311,62.057811747619894,62.7353394731159,63.417162620860914,64.10328893648692,64.79372614476921,65.48848194977529,66.18756403501224,66.89098006357258,67.59873767827808,68.31084450182222,69.02730813691093,69.74813616640164,70.47333615344107,71.20291564160104,71.93688215501312,72.67524319850172,73.41800625771542,74.16517879925733,74.9167682708136,75.67278210128072,76.43322770089146,77.1981124613393,77.96744375590167,78.74122893956174,79.51947534912904,80.30219030335869,81.08938110306934,81.88105503125999,82.67721935322541,83.4778813166706,84.28304815182372,85.09272707154808,85.90692527145302,86.72564993000343,87.54890820862819,88.3767072518277,89.2090541872801,90.04595612594655,90.88742016217518,91.73345337380438,92.58406282226491,93.43925555268066,94.29903859396902,95.16341895893969,96.03240364439274,96.9059996312159,97.78421388448044,98.6670533535366,99.55452497210776],HctSolver2})();var Hct=class _Hct{static from(hue,chroma,tone){return new _Hct(HctSolver.solveToInt(hue,chroma,tone))}static fromInt(argb){return new _Hct(argb)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(newHue){this.setInternalState(HctSolver.solveToInt(newHue,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(newChroma){this.setInternalState(HctSolver.solveToInt(this.internalHue,newChroma,this.internalTone))}get tone(){return this.internalTone}set tone(newTone){this.setInternalState(HctSolver.solveToInt(this.internalHue,this.internalChroma,newTone))}constructor(argb){this.argb=argb;let cam=Cam16.fromInt(argb);this.internalHue=cam.hue,this.internalChroma=cam.chroma,this.internalTone=lstarFromArgb(argb),this.argb=argb}setInternalState(argb){let cam=Cam16.fromInt(argb);this.internalHue=cam.hue,this.internalChroma=cam.chroma,this.internalTone=lstarFromArgb(argb),this.argb=argb}inViewingConditions(vc){let viewedInVc=Cam16.fromInt(this.toInt()).xyzInViewingConditions(vc),recastInVc=Cam16.fromXyzInViewingConditions(viewedInVc[0],viewedInVc[1],viewedInVc[2],ViewingConditions.make());return _Hct.from(recastInVc.hue,recastInVc.chroma,lstarFromY(viewedInVc[1]))}};var Contrast=class _Contrast{static ratioOfTones(toneA,toneB){return toneA=clampDouble(0,100,toneA),toneB=clampDouble(0,100,toneB),_Contrast.ratioOfYs(yFromLstar(toneA),yFromLstar(toneB))}static ratioOfYs(y1,y2){let lighter=y1>y2?y1:y2,darker=lighter===y2?y1:y2;return(lighter+5)/(darker+5)}static lighter(tone,ratio){if(tone<0||tone>100)return-1;let darkY=yFromLstar(tone),lightY=ratio*(darkY+5)-5,realContrast=_Contrast.ratioOfYs(lightY,darkY),delta=Math.abs(realContrast-ratio);if(realContrast<ratio&&delta>.04)return-1;let returnValue=lstarFromY(lightY)+.4;return returnValue<0||returnValue>100?-1:returnValue}static darker(tone,ratio){if(tone<0||tone>100)return-1;let lightY=yFromLstar(tone),darkY=(lightY+5)/ratio-5,realContrast=_Contrast.ratioOfYs(lightY,darkY),delta=Math.abs(realContrast-ratio);if(realContrast<ratio&&delta>.04)return-1;let returnValue=lstarFromY(darkY)-.4;return returnValue<0||returnValue>100?-1:returnValue}static lighterUnsafe(tone,ratio){let lighterSafe=_Contrast.lighter(tone,ratio);return lighterSafe<0?100:lighterSafe}static darkerUnsafe(tone,ratio){let darkerSafe=_Contrast.darker(tone,ratio);return darkerSafe<0?0:darkerSafe}};var DislikeAnalyzer=class _DislikeAnalyzer{static isDisliked(hct){let huePasses=Math.round(hct.hue)>=90&&Math.round(hct.hue)<=111,chromaPasses=Math.round(hct.chroma)>16,tonePasses=Math.round(hct.tone)<65;return huePasses&&chromaPasses&&tonePasses}static fixIfDisliked(hct){return _DislikeAnalyzer.isDisliked(hct)?Hct.from(hct.hue,hct.chroma,70):hct}};var DynamicColor=class _DynamicColor{static fromPalette(args){return new _DynamicColor(args.name??"",args.palette,args.tone,args.isBackground??!1,args.background,args.secondBackground,args.contrastCurve,args.toneDeltaPair)}constructor(name,palette,tone,isBackground,background,secondBackground,contrastCurve,toneDeltaPair){if(this.name=name,this.palette=palette,this.tone=tone,this.isBackground=isBackground,this.background=background,this.secondBackground=secondBackground,this.contrastCurve=contrastCurve,this.toneDeltaPair=toneDeltaPair,this.hctCache=new Map,!background&&secondBackground)throw new Error(`Color ${name} has secondBackgrounddefined, but background is not defined.`);if(!background&&contrastCurve)throw new Error(`Color ${name} has contrastCurvedefined, but background is not defined.`);if(background&&!contrastCurve)throw new Error(`Color ${name} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(scheme){return this.getHct(scheme).toInt()}getHct(scheme){let cachedAnswer=this.hctCache.get(scheme);if(cachedAnswer!=null)return cachedAnswer;let tone=this.getTone(scheme),answer=this.palette(scheme).getHct(tone);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(scheme,answer),answer}getTone(scheme){let decreasingContrast=scheme.contrastLevel<0;if(this.toneDeltaPair){let toneDeltaPair=this.toneDeltaPair(scheme),roleA=toneDeltaPair.roleA,roleB=toneDeltaPair.roleB,delta=toneDeltaPair.delta,polarity=toneDeltaPair.polarity,stayTogether=toneDeltaPair.stayTogether,bgTone=this.background(scheme).getTone(scheme),aIsNearer=polarity==="nearer"||polarity==="lighter"&&!scheme.isDark||polarity==="darker"&&scheme.isDark,nearer=aIsNearer?roleA:roleB,farther=aIsNearer?roleB:roleA,amNearer=this.name===nearer.name,expansionDir=scheme.isDark?1:-1,nContrast=nearer.contrastCurve.get(scheme.contrastLevel),fContrast=farther.contrastCurve.get(scheme.contrastLevel),nInitialTone=nearer.tone(scheme),nTone=Contrast.ratioOfTones(bgTone,nInitialTone)>=nContrast?nInitialTone:_DynamicColor.foregroundTone(bgTone,nContrast),fInitialTone=farther.tone(scheme),fTone=Contrast.ratioOfTones(bgTone,fInitialTone)>=fContrast?fInitialTone:_DynamicColor.foregroundTone(bgTone,fContrast);return decreasingContrast&&(nTone=_DynamicColor.foregroundTone(bgTone,nContrast),fTone=_DynamicColor.foregroundTone(bgTone,fContrast)),(fTone-nTone)*expansionDir>=delta||(fTone=clampDouble(0,100,nTone+delta*expansionDir),(fTone-nTone)*expansionDir>=delta||(nTone=clampDouble(0,100,fTone-delta*expansionDir))),50<=nTone&&nTone<60?expansionDir>0?(nTone=60,fTone=Math.max(fTone,nTone+delta*expansionDir)):(nTone=49,fTone=Math.min(fTone,nTone+delta*expansionDir)):50<=fTone&&fTone<60&&(stayTogether?expansionDir>0?(nTone=60,fTone=Math.max(fTone,nTone+delta*expansionDir)):(nTone=49,fTone=Math.min(fTone,nTone+delta*expansionDir)):expansionDir>0?fTone=60:fTone=49),amNearer?nTone:fTone}else{let answer=this.tone(scheme);if(this.background==null)return answer;let bgTone=this.background(scheme).getTone(scheme),desiredRatio=this.contrastCurve.get(scheme.contrastLevel);if(Contrast.ratioOfTones(bgTone,answer)>=desiredRatio||(answer=_DynamicColor.foregroundTone(bgTone,desiredRatio)),decreasingContrast&&(answer=_DynamicColor.foregroundTone(bgTone,desiredRatio)),this.isBackground&&50<=answer&&answer<60&&(Contrast.ratioOfTones(49,bgTone)>=desiredRatio?answer=49:answer=60),this.secondBackground){let[bg1,bg2]=[this.background,this.secondBackground],[bgTone1,bgTone2]=[bg1(scheme).getTone(scheme),bg2(scheme).getTone(scheme)],[upper,lower]=[Math.max(bgTone1,bgTone2),Math.min(bgTone1,bgTone2)];if(Contrast.ratioOfTones(upper,answer)>=desiredRatio&&Contrast.ratioOfTones(lower,answer)>=desiredRatio)return answer;let lightOption=Contrast.lighter(upper,desiredRatio),darkOption=Contrast.darker(lower,desiredRatio),availables=[];return lightOption!==-1&&availables.push(lightOption),darkOption!==-1&&availables.push(darkOption),_DynamicColor.tonePrefersLightForeground(bgTone1)||_DynamicColor.tonePrefersLightForeground(bgTone2)?lightOption<0?100:lightOption:availables.length===1?availables[0]:darkOption<0?0:darkOption}return answer}}static foregroundTone(bgTone,ratio){let lighterTone=Contrast.lighterUnsafe(bgTone,ratio),darkerTone=Contrast.darkerUnsafe(bgTone,ratio),lighterRatio=Contrast.ratioOfTones(lighterTone,bgTone),darkerRatio=Contrast.ratioOfTones(darkerTone,bgTone);if(_DynamicColor.tonePrefersLightForeground(bgTone)){let negligibleDifference=Math.abs(lighterRatio-darkerRatio)<.1&&lighterRatio<ratio&&darkerRatio<ratio;return lighterRatio>=ratio||lighterRatio>=darkerRatio||negligibleDifference?lighterTone:darkerTone}else return darkerRatio>=ratio||darkerRatio>=lighterRatio?darkerTone:lighterTone}static tonePrefersLightForeground(tone){return Math.round(tone)<60}static toneAllowsLightForeground(tone){return Math.round(tone)<=49}static enableLightForeground(tone){return _DynamicColor.tonePrefersLightForeground(tone)&&!_DynamicColor.toneAllowsLightForeground(tone)?49:tone}};var TonalPalette=class _TonalPalette{static fromInt(argb){let hct=Hct.fromInt(argb);return _TonalPalette.fromHct(hct)}static fromHct(hct){return new _TonalPalette(hct.hue,hct.chroma,hct)}static fromHueAndChroma(hue,chroma){let keyColor=new KeyColor(hue,chroma).create();return new _TonalPalette(hue,chroma,keyColor)}constructor(hue,chroma,keyColor){this.hue=hue,this.chroma=chroma,this.keyColor=keyColor,this.cache=new Map}tone(tone){let argb=this.cache.get(tone);return argb===void 0&&(argb=Hct.from(this.hue,this.chroma,tone).toInt(),this.cache.set(tone,argb)),argb}getHct(tone){return Hct.fromInt(this.tone(tone))}},KeyColor=class{constructor(hue,requestedChroma){this.hue=hue,this.requestedChroma=requestedChroma,this.chromaCache=new Map,this.maxChromaValue=200}create(){let lowerTone=0,upperTone=100;for(;lowerTone<upperTone;){let midTone=Math.floor((lowerTone+upperTone)/2),isAscending=this.maxChroma(midTone)<this.maxChroma(midTone+1);if(this.maxChroma(midTone)>=this.requestedChroma-.01)if(Math.abs(lowerTone-50)<Math.abs(upperTone-50))upperTone=midTone;else{if(lowerTone===midTone)return Hct.from(this.hue,this.requestedChroma,lowerTone);lowerTone=midTone}else isAscending?lowerTone=midTone+1:upperTone=midTone}return Hct.from(this.hue,this.requestedChroma,lowerTone)}maxChroma(tone){if(this.chromaCache.has(tone))return this.chromaCache.get(tone);let chroma=Hct.from(this.hue,this.maxChromaValue,tone).chroma;return this.chromaCache.set(tone,chroma),chroma}};var ContrastCurve=class{constructor(low,normal,medium,high){this.low=low,this.normal=normal,this.medium=medium,this.high=high}get(contrastLevel){return contrastLevel<=-1?this.low:contrastLevel<0?lerp(this.low,this.normal,(contrastLevel- -1)/1):contrastLevel<.5?lerp(this.normal,this.medium,(contrastLevel-0)/.5):contrastLevel<1?lerp(this.medium,this.high,(contrastLevel-.5)/.5):this.high}};var ToneDeltaPair=class{constructor(roleA,roleB,delta,polarity,stayTogether){this.roleA=roleA,this.roleB=roleB,this.delta=delta,this.polarity=polarity,this.stayTogether=stayTogether}};var Variant=function(Variant2){return Variant2[Variant2.MONOCHROME=0]="MONOCHROME",Variant2[Variant2.NEUTRAL=1]="NEUTRAL",Variant2[Variant2.TONAL_SPOT=2]="TONAL_SPOT",Variant2[Variant2.VIBRANT=3]="VIBRANT",Variant2[Variant2.EXPRESSIVE=4]="EXPRESSIVE",Variant2[Variant2.FIDELITY=5]="FIDELITY",Variant2[Variant2.CONTENT=6]="CONTENT",Variant2[Variant2.RAINBOW=7]="RAINBOW",Variant2[Variant2.FRUIT_SALAD=8]="FRUIT_SALAD",Variant2}(Variant||{});function isFidelity(scheme){return scheme.variant===Variant.FIDELITY||scheme.variant===Variant.CONTENT}function isMonochrome(scheme){return scheme.variant===Variant.MONOCHROME}function findDesiredChromaByTone(hue,chroma,tone,byDecreasingTone){let answer=tone,closestToChroma=Hct.from(hue,chroma,tone);if(closestToChroma.chroma<chroma){let chromaPeak=closestToChroma.chroma;for(;closestToChroma.chroma<chroma;){answer+=byDecreasingTone?-1:1;let potentialSolution=Hct.from(hue,chroma,answer);if(chromaPeak>potentialSolution.chroma||Math.abs(potentialSolution.chroma-chroma)<.4)break;let potentialDelta=Math.abs(potentialSolution.chroma-chroma),currentDelta=Math.abs(closestToChroma.chroma-chroma);potentialDelta<currentDelta&&(closestToChroma=potentialSolution),chromaPeak=Math.max(chromaPeak,potentialSolution.chroma)}}return answer}var MaterialDynamicColors=class _MaterialDynamicColors{static highestSurface(s2){return s2.isDark?_MaterialDynamicColors.surfaceBright:_MaterialDynamicColors.surfaceDim}};MaterialDynamicColors.contentAccentToneDelta=15;MaterialDynamicColors.primaryPaletteKeyColor=DynamicColor.fromPalette({name:"primary_palette_key_color",palette:s2=>s2.primaryPalette,tone:s2=>s2.primaryPalette.keyColor.tone});MaterialDynamicColors.secondaryPaletteKeyColor=DynamicColor.fromPalette({name:"secondary_palette_key_color",palette:s2=>s2.secondaryPalette,tone:s2=>s2.secondaryPalette.keyColor.tone});MaterialDynamicColors.tertiaryPaletteKeyColor=DynamicColor.fromPalette({name:"tertiary_palette_key_color",palette:s2=>s2.tertiaryPalette,tone:s2=>s2.tertiaryPalette.keyColor.tone});MaterialDynamicColors.neutralPaletteKeyColor=DynamicColor.fromPalette({name:"neutral_palette_key_color",palette:s2=>s2.neutralPalette,tone:s2=>s2.neutralPalette.keyColor.tone});MaterialDynamicColors.neutralVariantPaletteKeyColor=DynamicColor.fromPalette({name:"neutral_variant_palette_key_color",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.neutralVariantPalette.keyColor.tone});MaterialDynamicColors.background=DynamicColor.fromPalette({name:"background",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?6:98,isBackground:!0});MaterialDynamicColors.onBackground=DynamicColor.fromPalette({name:"on_background",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?90:10,background:s2=>MaterialDynamicColors.background,contrastCurve:new ContrastCurve(3,3,4.5,7)});MaterialDynamicColors.surface=DynamicColor.fromPalette({name:"surface",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?6:98,isBackground:!0});MaterialDynamicColors.surfaceDim=DynamicColor.fromPalette({name:"surface_dim",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?6:new ContrastCurve(87,87,80,75).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.surfaceBright=DynamicColor.fromPalette({name:"surface_bright",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(24,24,29,34).get(s2.contrastLevel):98,isBackground:!0});MaterialDynamicColors.surfaceContainerLowest=DynamicColor.fromPalette({name:"surface_container_lowest",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(4,4,2,0).get(s2.contrastLevel):100,isBackground:!0});MaterialDynamicColors.surfaceContainerLow=DynamicColor.fromPalette({name:"surface_container_low",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(10,10,11,12).get(s2.contrastLevel):new ContrastCurve(96,96,96,95).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.surfaceContainer=DynamicColor.fromPalette({name:"surface_container",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(12,12,16,20).get(s2.contrastLevel):new ContrastCurve(94,94,92,90).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.surfaceContainerHigh=DynamicColor.fromPalette({name:"surface_container_high",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(17,17,21,25).get(s2.contrastLevel):new ContrastCurve(92,92,88,85).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.surfaceContainerHighest=DynamicColor.fromPalette({name:"surface_container_highest",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?new ContrastCurve(22,22,26,30).get(s2.contrastLevel):new ContrastCurve(90,90,84,80).get(s2.contrastLevel),isBackground:!0});MaterialDynamicColors.onSurface=DynamicColor.fromPalette({name:"on_surface",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?90:10,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.surfaceVariant=DynamicColor.fromPalette({name:"surface_variant",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.isDark?30:90,isBackground:!0});MaterialDynamicColors.onSurfaceVariant=DynamicColor.fromPalette({name:"on_surface_variant",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.isDark?80:30,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.inverseSurface=DynamicColor.fromPalette({name:"inverse_surface",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?90:20});MaterialDynamicColors.inverseOnSurface=DynamicColor.fromPalette({name:"inverse_on_surface",palette:s2=>s2.neutralPalette,tone:s2=>s2.isDark?20:95,background:s2=>MaterialDynamicColors.inverseSurface,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.outline=DynamicColor.fromPalette({name:"outline",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.isDark?60:50,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1.5,3,4.5,7)});MaterialDynamicColors.outlineVariant=DynamicColor.fromPalette({name:"outline_variant",palette:s2=>s2.neutralVariantPalette,tone:s2=>s2.isDark?30:80,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5)});MaterialDynamicColors.shadow=DynamicColor.fromPalette({name:"shadow",palette:s2=>s2.neutralPalette,tone:s2=>0});MaterialDynamicColors.scrim=DynamicColor.fromPalette({name:"scrim",palette:s2=>s2.neutralPalette,tone:s2=>0});MaterialDynamicColors.surfaceTint=DynamicColor.fromPalette({name:"surface_tint",palette:s2=>s2.primaryPalette,tone:s2=>s2.isDark?80:40,isBackground:!0});MaterialDynamicColors.primary=DynamicColor.fromPalette({name:"primary",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?100:0:s2.isDark?80:40,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,7),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.primaryContainer,MaterialDynamicColors.primary,10,"nearer",!1)});MaterialDynamicColors.onPrimary=DynamicColor.fromPalette({name:"on_primary",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?10:90:s2.isDark?20:100,background:s2=>MaterialDynamicColors.primary,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.primaryContainer=DynamicColor.fromPalette({name:"primary_container",palette:s2=>s2.primaryPalette,tone:s2=>isFidelity(s2)?s2.sourceColorHct.tone:isMonochrome(s2)?s2.isDark?85:25:s2.isDark?30:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.primaryContainer,MaterialDynamicColors.primary,10,"nearer",!1)});MaterialDynamicColors.onPrimaryContainer=DynamicColor.fromPalette({name:"on_primary_container",palette:s2=>s2.primaryPalette,tone:s2=>isFidelity(s2)?DynamicColor.foregroundTone(MaterialDynamicColors.primaryContainer.tone(s2),4.5):isMonochrome(s2)?s2.isDark?0:100:s2.isDark?90:30,background:s2=>MaterialDynamicColors.primaryContainer,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.inversePrimary=DynamicColor.fromPalette({name:"inverse_primary",palette:s2=>s2.primaryPalette,tone:s2=>s2.isDark?40:80,background:s2=>MaterialDynamicColors.inverseSurface,contrastCurve:new ContrastCurve(3,4.5,7,7)});MaterialDynamicColors.secondary=DynamicColor.fromPalette({name:"secondary",palette:s2=>s2.secondaryPalette,tone:s2=>s2.isDark?80:40,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,7),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.secondaryContainer,MaterialDynamicColors.secondary,10,"nearer",!1)});MaterialDynamicColors.onSecondary=DynamicColor.fromPalette({name:"on_secondary",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?10:100:s2.isDark?20:100,background:s2=>MaterialDynamicColors.secondary,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.secondaryContainer=DynamicColor.fromPalette({name:"secondary_container",palette:s2=>s2.secondaryPalette,tone:s2=>{let initialTone=s2.isDark?30:90;return isMonochrome(s2)?s2.isDark?30:85:isFidelity(s2)?findDesiredChromaByTone(s2.secondaryPalette.hue,s2.secondaryPalette.chroma,initialTone,!s2.isDark):initialTone},isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.secondaryContainer,MaterialDynamicColors.secondary,10,"nearer",!1)});MaterialDynamicColors.onSecondaryContainer=DynamicColor.fromPalette({name:"on_secondary_container",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?90:10:isFidelity(s2)?DynamicColor.foregroundTone(MaterialDynamicColors.secondaryContainer.tone(s2),4.5):s2.isDark?90:30,background:s2=>MaterialDynamicColors.secondaryContainer,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.tertiary=DynamicColor.fromPalette({name:"tertiary",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?90:25:s2.isDark?80:40,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,7),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer,MaterialDynamicColors.tertiary,10,"nearer",!1)});MaterialDynamicColors.onTertiary=DynamicColor.fromPalette({name:"on_tertiary",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?10:90:s2.isDark?20:100,background:s2=>MaterialDynamicColors.tertiary,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.tertiaryContainer=DynamicColor.fromPalette({name:"tertiary_container",palette:s2=>s2.tertiaryPalette,tone:s2=>{if(isMonochrome(s2))return s2.isDark?60:49;if(!isFidelity(s2))return s2.isDark?30:90;let proposedHct=s2.tertiaryPalette.getHct(s2.sourceColorHct.tone);return DislikeAnalyzer.fixIfDisliked(proposedHct).tone},isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.tertiaryContainer,MaterialDynamicColors.tertiary,10,"nearer",!1)});MaterialDynamicColors.onTertiaryContainer=DynamicColor.fromPalette({name:"on_tertiary_container",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?s2.isDark?0:100:isFidelity(s2)?DynamicColor.foregroundTone(MaterialDynamicColors.tertiaryContainer.tone(s2),4.5):s2.isDark?90:30,background:s2=>MaterialDynamicColors.tertiaryContainer,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.error=DynamicColor.fromPalette({name:"error",palette:s2=>s2.errorPalette,tone:s2=>s2.isDark?80:40,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(3,4.5,7,7),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.errorContainer,MaterialDynamicColors.error,10,"nearer",!1)});MaterialDynamicColors.onError=DynamicColor.fromPalette({name:"on_error",palette:s2=>s2.errorPalette,tone:s2=>s2.isDark?20:100,background:s2=>MaterialDynamicColors.error,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.errorContainer=DynamicColor.fromPalette({name:"error_container",palette:s2=>s2.errorPalette,tone:s2=>s2.isDark?30:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.errorContainer,MaterialDynamicColors.error,10,"nearer",!1)});MaterialDynamicColors.onErrorContainer=DynamicColor.fromPalette({name:"on_error_container",palette:s2=>s2.errorPalette,tone:s2=>isMonochrome(s2)?s2.isDark?90:10:s2.isDark?90:30,background:s2=>MaterialDynamicColors.errorContainer,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.primaryFixed=DynamicColor.fromPalette({name:"primary_fixed",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?40:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.primaryFixed,MaterialDynamicColors.primaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.primaryFixedDim=DynamicColor.fromPalette({name:"primary_fixed_dim",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?30:80,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.primaryFixed,MaterialDynamicColors.primaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.onPrimaryFixed=DynamicColor.fromPalette({name:"on_primary_fixed",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?100:10,background:s2=>MaterialDynamicColors.primaryFixedDim,secondBackground:s2=>MaterialDynamicColors.primaryFixed,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.onPrimaryFixedVariant=DynamicColor.fromPalette({name:"on_primary_fixed_variant",palette:s2=>s2.primaryPalette,tone:s2=>isMonochrome(s2)?90:30,background:s2=>MaterialDynamicColors.primaryFixedDim,secondBackground:s2=>MaterialDynamicColors.primaryFixed,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.secondaryFixed=DynamicColor.fromPalette({name:"secondary_fixed",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?80:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.secondaryFixed,MaterialDynamicColors.secondaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.secondaryFixedDim=DynamicColor.fromPalette({name:"secondary_fixed_dim",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?70:80,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.secondaryFixed,MaterialDynamicColors.secondaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.onSecondaryFixed=DynamicColor.fromPalette({name:"on_secondary_fixed",palette:s2=>s2.secondaryPalette,tone:s2=>10,background:s2=>MaterialDynamicColors.secondaryFixedDim,secondBackground:s2=>MaterialDynamicColors.secondaryFixed,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.onSecondaryFixedVariant=DynamicColor.fromPalette({name:"on_secondary_fixed_variant",palette:s2=>s2.secondaryPalette,tone:s2=>isMonochrome(s2)?25:30,background:s2=>MaterialDynamicColors.secondaryFixedDim,secondBackground:s2=>MaterialDynamicColors.secondaryFixed,contrastCurve:new ContrastCurve(3,4.5,7,11)});MaterialDynamicColors.tertiaryFixed=DynamicColor.fromPalette({name:"tertiary_fixed",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?40:90,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.tertiaryFixed,MaterialDynamicColors.tertiaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.tertiaryFixedDim=DynamicColor.fromPalette({name:"tertiary_fixed_dim",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?30:80,isBackground:!0,background:s2=>MaterialDynamicColors.highestSurface(s2),contrastCurve:new ContrastCurve(1,1,3,4.5),toneDeltaPair:s2=>new ToneDeltaPair(MaterialDynamicColors.tertiaryFixed,MaterialDynamicColors.tertiaryFixedDim,10,"lighter",!0)});MaterialDynamicColors.onTertiaryFixed=DynamicColor.fromPalette({name:"on_tertiary_fixed",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?100:10,background:s2=>MaterialDynamicColors.tertiaryFixedDim,secondBackground:s2=>MaterialDynamicColors.tertiaryFixed,contrastCurve:new ContrastCurve(4.5,7,11,21)});MaterialDynamicColors.onTertiaryFixedVariant=DynamicColor.fromPalette({name:"on_tertiary_fixed_variant",palette:s2=>s2.tertiaryPalette,tone:s2=>isMonochrome(s2)?90:30,background:s2=>MaterialDynamicColors.tertiaryFixedDim,secondBackground:s2=>MaterialDynamicColors.tertiaryFixed,contrastCurve:new ContrastCurve(3,4.5,7,11)});var DynamicScheme=class{constructor(args){this.sourceColorArgb=args.sourceColorArgb,this.variant=args.variant,this.contrastLevel=args.contrastLevel,this.isDark=args.isDark,this.sourceColorHct=Hct.fromInt(args.sourceColorArgb),this.primaryPalette=args.primaryPalette,this.secondaryPalette=args.secondaryPalette,this.tertiaryPalette=args.tertiaryPalette,this.neutralPalette=args.neutralPalette,this.neutralVariantPalette=args.neutralVariantPalette,this.errorPalette=TonalPalette.fromHueAndChroma(25,84)}static getRotatedHue(sourceColor,hues,rotations){let sourceHue=sourceColor.hue;if(hues.length!==rotations.length)throw new Error(`mismatch between hue length ${hues.length} & rotations ${rotations.length}`);if(rotations.length===1)return sanitizeDegreesDouble(sourceColor.hue+rotations[0]);let size=hues.length;for(let i=0;i<=size-2;i++){let thisHue=hues[i],nextHue=hues[i+1];if(thisHue<sourceHue&&sourceHue<nextHue)return sanitizeDegreesDouble(sourceHue+rotations[i])}return sourceHue}getArgb(dynamicColor){return dynamicColor.getArgb(this)}getHct(dynamicColor){return dynamicColor.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.primaryPaletteKeyColor)}get secondaryPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.secondaryPaletteKeyColor)}get tertiaryPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.tertiaryPaletteKeyColor)}get neutralPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.neutralPaletteKeyColor)}get neutralVariantPaletteKeyColor(){return this.getArgb(MaterialDynamicColors.neutralVariantPaletteKeyColor)}get background(){return this.getArgb(MaterialDynamicColors.background)}get onBackground(){return this.getArgb(MaterialDynamicColors.onBackground)}get surface(){return this.getArgb(MaterialDynamicColors.surface)}get surfaceDim(){return this.getArgb(MaterialDynamicColors.surfaceDim)}get surfaceBright(){return this.getArgb(MaterialDynamicColors.surfaceBright)}get surfaceContainerLowest(){return this.getArgb(MaterialDynamicColors.surfaceContainerLowest)}get surfaceContainerLow(){return this.getArgb(MaterialDynamicColors.surfaceContainerLow)}get surfaceContainer(){return this.getArgb(MaterialDynamicColors.surfaceContainer)}get surfaceContainerHigh(){return this.getArgb(MaterialDynamicColors.surfaceContainerHigh)}get surfaceContainerHighest(){return this.getArgb(MaterialDynamicColors.surfaceContainerHighest)}get onSurface(){return this.getArgb(MaterialDynamicColors.onSurface)}get surfaceVariant(){return this.getArgb(MaterialDynamicColors.surfaceVariant)}get onSurfaceVariant(){return this.getArgb(MaterialDynamicColors.onSurfaceVariant)}get inverseSurface(){return this.getArgb(MaterialDynamicColors.inverseSurface)}get inverseOnSurface(){return this.getArgb(MaterialDynamicColors.inverseOnSurface)}get outline(){return this.getArgb(MaterialDynamicColors.outline)}get outlineVariant(){return this.getArgb(MaterialDynamicColors.outlineVariant)}get shadow(){return this.getArgb(MaterialDynamicColors.shadow)}get scrim(){return this.getArgb(MaterialDynamicColors.scrim)}get surfaceTint(){return this.getArgb(MaterialDynamicColors.surfaceTint)}get primary(){return this.getArgb(MaterialDynamicColors.primary)}get onPrimary(){return this.getArgb(MaterialDynamicColors.onPrimary)}get primaryContainer(){return this.getArgb(MaterialDynamicColors.primaryContainer)}get onPrimaryContainer(){return this.getArgb(MaterialDynamicColors.onPrimaryContainer)}get inversePrimary(){return this.getArgb(MaterialDynamicColors.inversePrimary)}get secondary(){return this.getArgb(MaterialDynamicColors.secondary)}get onSecondary(){return this.getArgb(MaterialDynamicColors.onSecondary)}get secondaryContainer(){return this.getArgb(MaterialDynamicColors.secondaryContainer)}get onSecondaryContainer(){return this.getArgb(MaterialDynamicColors.onSecondaryContainer)}get tertiary(){return this.getArgb(MaterialDynamicColors.tertiary)}get onTertiary(){return this.getArgb(MaterialDynamicColors.onTertiary)}get tertiaryContainer(){return this.getArgb(MaterialDynamicColors.tertiaryContainer)}get onTertiaryContainer(){return this.getArgb(MaterialDynamicColors.onTertiaryContainer)}get error(){return this.getArgb(MaterialDynamicColors.error)}get onError(){return this.getArgb(MaterialDynamicColors.onError)}get errorContainer(){return this.getArgb(MaterialDynamicColors.errorContainer)}get onErrorContainer(){return this.getArgb(MaterialDynamicColors.onErrorContainer)}get primaryFixed(){return this.getArgb(MaterialDynamicColors.primaryFixed)}get primaryFixedDim(){return this.getArgb(MaterialDynamicColors.primaryFixedDim)}get onPrimaryFixed(){return this.getArgb(MaterialDynamicColors.onPrimaryFixed)}get onPrimaryFixedVariant(){return this.getArgb(MaterialDynamicColors.onPrimaryFixedVariant)}get secondaryFixed(){return this.getArgb(MaterialDynamicColors.secondaryFixed)}get secondaryFixedDim(){return this.getArgb(MaterialDynamicColors.secondaryFixedDim)}get onSecondaryFixed(){return this.getArgb(MaterialDynamicColors.onSecondaryFixed)}get onSecondaryFixedVariant(){return this.getArgb(MaterialDynamicColors.onSecondaryFixedVariant)}get tertiaryFixed(){return this.getArgb(MaterialDynamicColors.tertiaryFixed)}get tertiaryFixedDim(){return this.getArgb(MaterialDynamicColors.tertiaryFixedDim)}get onTertiaryFixed(){return this.getArgb(MaterialDynamicColors.onTertiaryFixed)}get onTertiaryFixedVariant(){return this.getArgb(MaterialDynamicColors.onTertiaryFixedVariant)}};var SchemeMonochrome=class extends DynamicScheme{constructor(sourceColorHct,isDark,contrastLevel){super({sourceColorArgb:sourceColorHct.toInt(),variant:Variant.MONOCHROME,contrastLevel,isDark,primaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0),secondaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0),tertiaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0),neutralPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0),neutralVariantPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,0)})}};var SchemeNeutral=class extends DynamicScheme{constructor(sourceColorHct,isDark,contrastLevel){super({sourceColorArgb:sourceColorHct.toInt(),variant:Variant.NEUTRAL,contrastLevel,isDark,primaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,12),secondaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,8),tertiaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,16),neutralPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,2),neutralVariantPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,2)})}};var SchemeTonalSpot=class extends DynamicScheme{constructor(sourceColorHct,isDark,contrastLevel){super({sourceColorArgb:sourceColorHct.toInt(),variant:Variant.TONAL_SPOT,contrastLevel,isDark,primaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,36),secondaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,16),tertiaryPalette:TonalPalette.fromHueAndChroma(sanitizeDegreesDouble(sourceColorHct.hue+60),24),neutralPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,6),neutralVariantPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,8)})}};var SchemeVibrant=(()=>{class SchemeVibrant2 extends DynamicScheme{constructor(sourceColorHct,isDark,contrastLevel){super({sourceColorArgb:sourceColorHct.toInt(),variant:Variant.VIBRANT,contrastLevel,isDark,primaryPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,200),secondaryPalette:TonalPalette.fromHueAndChroma(DynamicScheme.getRotatedHue(sourceColorHct,SchemeVibrant2.hues,SchemeVibrant2.secondaryRotations),24),tertiaryPalette:TonalPalette.fromHueAndChroma(DynamicScheme.getRotatedHue(sourceColorHct,SchemeVibrant2.hues,SchemeVibrant2.tertiaryRotations),32),neutralPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,10),neutralVariantPalette:TonalPalette.fromHueAndChroma(sourceColorHct.hue,12)})}}return SchemeVibrant2.hues=[0,41,61,101,131,181,251,301,360],SchemeVibrant2.secondaryRotations=[18,15,10,12,15,18,15,12,12],SchemeVibrant2.tertiaryRotations=[35,30,20,25,30,35,30,25,25],SchemeVibrant2})();function hexFromArgb(argb){let r=redFromArgb(argb),g=greenFromArgb(argb),b=blueFromArgb(argb),outParts=[r.toString(16),g.toString(16),b.toString(16)];for(let[i,part]of outParts.entries())part.length===1&&(outParts[i]="0"+part);return"#"+outParts.join("")}function argbFromHex(hex){hex=hex.replace("#","");let isThree=hex.length===3,isSix=hex.length===6,isEight=hex.length===8;if(!isThree&&!isSix&&!isEight)throw new Error("unexpected hex "+hex);let r=0,g=0,b=0;return isThree?(r=parseIntHex(hex.slice(0,1).repeat(2)),g=parseIntHex(hex.slice(1,2).repeat(2)),b=parseIntHex(hex.slice(2,3).repeat(2))):isSix?(r=parseIntHex(hex.slice(0,2)),g=parseIntHex(hex.slice(2,4)),b=parseIntHex(hex.slice(4,6))):isEight&&(r=parseIntHex(hex.slice(2,4)),g=parseIntHex(hex.slice(4,6)),b=parseIntHex(hex.slice(6,8))),(255<<24|(r&255)<<16|(g&255)<<8|b&255)>>>0}function parseIntHex(value){return parseInt(value,16)}function getCustomThemeStyles(theme,dark=!1){return getVariableStyles(theme,dark)}function getVariableStyles(theme,dark=!1){let variables=getVariables(theme,dark);return`:root{${Object.keys(variables).map(key=>`--${kebabCase_default(key)}:${variables[key]}`).join(";")}}`}function getStyleElementId(type){return`theme-${type}`}function getReferenceStyleElement(documentRef,type){let refChild=null;return type==="sector"&&(refChild=documentRef.getElementById(getStyleElementId("host")),refChild||(refChild=documentRef.getElementById(getStyleElementId("company"))),refChild&&(refChild=refChild.previousSibling)),type==="host"&&(refChild=documentRef.getElementById(getStyleElementId("sector")),refChild||(refChild=documentRef.getElementById(getStyleElementId("company")),refChild&&(refChild=refChild.previousSibling))),type==="company"&&(refChild=documentRef.getElementById(getStyleElementId("host")),refChild||(refChild=documentRef.getElementById(getStyleElementId("sector")))),refChild}var getIsDark=memoize_default(()=>{let scheme=localStorage.getItem("experimental-color-scheme")??"light";return scheme==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches:scheme==="dark"});function getVariables(theme,dark=!1){let primaryColor=(0,import_tinycolor22.default)(theme.primaryColor||"#ffffff"),variant=localStorage.getItem("experimental-theme-variant")||(_isBlueish(primaryColor)?"cool-grey":"grey"),systemVariables=_getSystemVariables(theme,variant,dark),cardBg=(0,import_tinycolor22.default)(theme.cardColor||(dark?systemVariables.matSysSurfaceContainer:"#ffffff")),cardBgIsDark=cardBg.isDark(),cardTextColor=cardBgIsDark?"#ffffff":"rgba(0,0,0,.87)",pageBg=(0,import_tinycolor22.default)(theme.pageColor||systemVariables.matSysBackground),pageBgIsDark=pageBg.isDark(),detailPageBg=theme.pageColor||(dark?systemVariables.matSysBackground:"#f8f9fa"),menuBg=(0,import_tinycolor22.default)(theme.menuColor||pageBg),menuBgIsDark=menuBg.isDark(),menuHighlightBg=theme.menuColor?menuBg.clone()[menuBgIsDark?"brighten":"darken"](menuBgIsDark?12:8):(0,import_tinycolor22.default)(systemVariables.matSysPrimaryContainer),menuHighlightColor=theme.menuColor?menuBgIsDark?"#ffffff":"rgba(0,0,0,.67)":systemVariables.matSysOnPrimaryContainer,menuTextColor=menuBgIsDark?"#ffffff":"rgba(0,0,0,.87)",pageCardContrastRatio=import_tinycolor22.default.readability(pageBg,cardBg),pageMenuContrastRatio=import_tinycolor22.default.readability(pageBg,menuBg),pageTextColor=pageBg.isDark()?"#ffffff":"rgba(0,0,0,.87)",cardBorderColor=cardBgIsDark?cardBg.clone().brighten(16).desaturate(34).setAlpha(.87):cardBg.clone().darken(12).desaturate(34).setAlpha(.87),menuBorderColor=`color-mix(in srgb,${menuTextColor} 8%,transparent)`,cardBorderWidth=pageCardContrastRatio<1.115?"1px":"0",menuBorderWidth=pageMenuContrastRatio<1.065?"1px":"0",headerBg=(0,import_tinycolor22.default)(theme.headerColor??"#ffffff");headerBg=import_tinycolor22.default.equals(headerBg,"#ffffff")?pageBg.clone():headerBg,headerBg=dark&&import_tinycolor22.default.equals(headerBg,"#ffffff")?(0,import_tinycolor22.default)("#1a1c20"):headerBg;let headerBgIsDark=headerBg.isDark(),headerTextColor=_getTextColor(import_tinycolor22.default.equals(headerBg,primaryColor)?theme.primaryTextColor??"#ffffff":headerBgIsDark?"#ffffff":"#000000"),headerLineBorderColor=theme.headerLineColor??`color-mix(in srgb,${headerTextColor} 12%,transparent)`,headerLineBorderWidth=theme.headerLineColor?import_tinycolor22.default.equals(theme.headerLineColor,headerBg)?"0":"2px":"1px";return __spreadValues(__spreadValues({accent:"var(--mat-sys-tertiary)",accentColor:"var(--mat-sys-on-tertiary)",basic:"var(--card-bg)",blue:"var(--ix-blue)",bodyBg:"var(--mat-sys-background)",bodyColor:"var(--mat-sys-on-background)",bodyColorRgb:"0,0,0",cardBg:cardBg.toHexString(),cardBorderColor:cardBorderColor.toRgbString().replace(/\s+/g,"").replace(",0.",",."),cardBorderWidth,cardColor:cardTextColor,cardColorScheme:cardBgIsDark?"dark":"light",detailPageBg,detailPageColor:pageTextColor,fontFamily:'Montserrat, Roboto, "Helvetica Neue", sans-serif',headerBg:headerBg.toHexString(),headerColor:headerTextColor,headerColorScheme:headerBgIsDark?"dark":"light",headerLineBorderColor,headerLineBorderWidth,menuBg:menuBg.toHexString(),menuBorderColor,menuBorderWidth,menuColor:menuTextColor,menuColorRgb:(({r,g,b})=>`${r},${g},${b}`)((0,import_tinycolor22.default)(menuTextColor).toRgb()),menuHighlightBg:menuHighlightBg.toHexString(),menuHighlightBgRgb:(({r,g,b})=>`${r},${g},${b}`)(menuHighlightBg.toRgb()),menuHighlightColor,pageBg:pageBg.toHexString(),pageColor:pageTextColor,pageColorScheme:pageBgIsDark?"dark":"light",primary:"var(--mat-sys-primary)",primaryColor:"var(--mat-sys-on-primary)",primaryRgb:trimRgbString(primaryColor.toRgbString()),success:"var(--mat-sys-success)",warn:"var(--mat-sys-error)",yellow:"var(--ix-yellow)"},_getColorVariables(dark)),systemVariables)}function insertCSS(documentRef,type,input2){let id=getStyleElementId(type),styleRef=documentRef.getElementById(id);if(styleRef===null){styleRef=documentRef.createElement("style"),styleRef.id=id,styleRef.setAttribute("type","text/css"),styleRef.innerHTML="";let reference2=getReferenceStyleElement(documentRef,type);reference2?insertAfter(reference2,styleRef):documentRef.head.appendChild(styleRef)}let content=null;typeof input2=="string"&&(content=input2),content!==null&&(styleRef.innerHTML=content)}function trimRgbString(rgbString){return rgbString.slice(4,rgbString.length-1).replace(new RegExp(" ","g"),"")}function insertAfter(refChild,newChild){refChild?.parentNode&&refChild.parentNode.insertBefore(newChild,refChild.nextSibling)}function _getColorVariables(dark=!1){return{ixBlue:"#1a73e8",ixOnBlue:"#ffffff",ixBlueContainer:dark?"#8ab4f8":"#d3e3fd",ixOnBlueContainer:dark?"#202124":"#041e49",ixPurple:dark?"#ca75ff":"#8603d7",ixOnPurple:"#ffffff",ixPurpleContainer:dark?"#4f3078":"#f2deff",ixOnPurpleContainer:dark?"#ca75ff":"#8603d7",ixYellow:"#f4c211",ixOnYellow:"#1f1f1f",ixYellowContainer:dark?"#fdd663":"#fdf4d4",ixOnYellowContainer:"#000"}}function _getSystemVariables(theme,variant,dark=!1){let primaryColorHex=theme.primaryColor??"#ffffff",primaryColorHct=Hct.fromInt(argbFromHex(primaryColorHex)),secondaryColorHex=theme.accentColor??primaryColorHex,secondaryColorHct=Hct.fromInt(argbFromHex(secondaryColorHex)),primarySchemeVariant=_getSchemeVariant(primaryColorHex,variant),secondarySchemeVariant=_getSchemeVariant(secondaryColorHex,variant),schemeContrastLevel=0,schemes={SchemeMonochrome,SchemeNeutral,SchemeTonalSpot,SchemeVibrant},primaryScheme=new schemes[primarySchemeVariant](primaryColorHct,dark,schemeContrastLevel),secondaryScheme=new schemes[secondarySchemeVariant](secondaryColorHct,dark,schemeContrastLevel),variables=Object.keys(MaterialDynamicColors).filter(key=>MaterialDynamicColors[key]instanceof DynamicColor).reduce((acc,key)=>{let scheme=/^(on)?secondary/i.test(key)?secondaryScheme:primaryScheme;return __spreadProps(__spreadValues({},acc),{[camelCase_default(`mat-sys-${key}`)]:hexFromArgb(scheme[key])})},{});variant==="grey"?variables=__spreadProps(__spreadValues({},variables),{matSysBackground:dark?"#121212":"#ffffff",matSysSurface:dark?"#121212":"#ffffff",matSysSurfaceVariant:dark?"#4b4b4b":"#dedede",matSysSurfaceContainerLowest:dark?"#080808":"#ffffff",matSysSurfaceContainerLow:dark?"#1c1c1c":"#f8f8f8",matSysSurfaceContainer:dark?"#262626":"#f2f2f2",matSysSurfaceContainerHigh:dark?"#303030":"#ececec",matSysSurfaceContainerHighest:dark?"#3d3d3d":"#e2e2e2",matSysOutline:dark?"#8e8e8e":"#767676",matSysOutlineVariant:dark?"#474747":"#c7c7c7"}):variant==="cool-grey"&&(variables=__spreadProps(__spreadValues({},variables),{matSysBackground:dark?"#131314":"#ffffff",matSysSurface:dark?"#131314":"#ffffff",matSysSurfaceVariant:dark?"#444746":"#e2e7eb",matSysSurfaceContainerLowest:dark?"#1a1d24":"#ffffff",matSysSurfaceContainerLow:dark?"#1c2027":"#f8fafd",matSysSurfaceContainer:dark?"#23262d":"#f0f4f9",matSysSurfaceContainerHigh:dark?"#2a2d36":"#e9eef6",matSysSurfaceContainerHighest:dark?"#373a43":"#dde3ea",matSysSurfaceDim:dark?"#131314":"#d3dbe5",matSysSurfaceBright:dark?"#37393b":"#d3dbe5",matSysOutline:dark?"#8e918f":"#747775",matSysOutlineVariant:dark?"#444746":"#c7c7c7"})),_isMonochrome(primaryColorHex)&&(variables=__spreadProps(__spreadValues({},variables),{matSysPrimaryContainer:dark?"#333333":"#e1e1e1",matSysOnPrimaryContainer:dark?"#ffffff":"#111111"})),_isMonochrome(secondaryColorHex)&&(variables=__spreadProps(__spreadValues({},variables),{matSysSecondaryContainer:dark?"#333333":"#e1e1e1",matSysOnSecondaryContainer:dark?"#ffffff":"#111111"}));let matSysTertiary=secondaryColorHex,matSysOnTertiary=_getTextColor(theme.accentTextColor??theme.primaryTextColor);variables=__spreadProps(__spreadValues({},variables),{matSysTertiary,matSysOnTertiary,matSysTertiaryContainer:matSysTertiary,matSysOnTertiaryContainer:matSysOnTertiary});let matSysQuaternary=primaryColorHex,matSysOnQuaternary=_getTextColor(theme.primaryTextColor);return __spreadProps(__spreadValues({},variables),{matSysSuccess:"#2ecc71",matSysOnSuccess:"#ffffff",matSysWarning:dark?"#fcbd00":"#ef9800",matSysOnWarning:"#1f1f1f",matSysWarningContainer:dark?"#4d2600":"#ffe07c",matSysOnWarningContainer:dark?"#fff2b4":"#2f1400",matSysQuaternary,matSysOnQuaternary,matSysQuaternaryContainer:matSysQuaternary,matSysOnQuaternaryContainer:matSysOnQuaternary})}function _getSchemeVariant(hexColor,variant){if(_isMonochrome(hexColor))return"SchemeMonochrome";switch(variant){case"grey":case"cool-grey":case"neutral":return _isBlueish(hexColor)?"SchemeTonalSpot":"SchemeNeutral";case"vibrant":return _isBlueish(hexColor)?"SchemeVibrant":"SchemeTonalSpot"}}function _getTextColor(color){return color==="#000000"?"rgba(0,0,0,.87)":color||"#ffffff"}function _isBlueish(color){let{h,s:s2,v}=(typeof color=="string"?(0,import_tinycolor22.default)(color):color).toHsv();return s2>.1&&v>.1&&h>=200&&h<240}function _isMonochrome(hexColor){let{r,g,b}=(0,import_tinycolor22.default)(hexColor).toRgb();return r===g&&g===b}function createGoogleMapStyles({backgroundColor,foregroundColor,outlineColor,textColor}){return[{stylers:[{color:foregroundColor}]},{elementType:"labels.text.fill",stylers:[{color:textColor},{visibility:"on"}]},{featureType:"administrative.country",elementType:"geometry.stroke",stylers:[{color:outlineColor},{weight:1}]},{featureType:"road",stylers:[{color:backgroundColor}]},{featureType:"road",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"labels.text",stylers:[{color:textColor},{visibility:"simplified"}]},{featureType:"water",stylers:[{color:backgroundColor}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"labels",stylers:[{visibility:"off"}]}]}function getPortalGoogleMapStyles(theme){let vars=getVariables(theme),backgroundColor=vars.pageBg,foregroundColor=import_tinycolor23.default.equals(backgroundColor,vars.cardBg)?vars.cardColorScheme==="light"?(0,import_tinycolor23.default)(vars.cardBg).darken(5).toHexString():(0,import_tinycolor23.default)(vars.cardBg).lighten(10).toHexString():vars.cardBg;vars.pageColorScheme==="light"&&(0,import_tinycolor23.default)(foregroundColor).getLuminance()>(0,import_tinycolor23.default)(backgroundColor).getLuminance()&&(backgroundColor=foregroundColor,foregroundColor=vars.pageBg);let foregroundIsDark=(0,import_tinycolor23.default)(foregroundColor).isDark();return createGoogleMapStyles({backgroundColor,foregroundColor,outlineColor:foregroundIsDark?(0,import_tinycolor23.default)(foregroundColor).lighten(15).desaturate(50).toHexString():(0,import_tinycolor23.default)(foregroundColor).darken(10).desaturate(50).toHexString(),textColor:foregroundIsDark?"#cccccc":"#444444"})}var GOOGLE_MAPS_STYLE_DARK=createGoogleMapStyles({backgroundColor:"#333537",foregroundColor:"#1f2123",outlineColor:"#202124",textColor:"#cccccc"}),GOOGLE_MAPS_STYLE_LIGHT=createGoogleMapStyles({backgroundColor:"#ffffff",foregroundColor:"#f1f3f4",outlineColor:"#ced1d1",textColor:"#444444"});var GoogleMapStyles=(()=>{let _GoogleMapStyles=class _GoogleMapStyles extends BehaviorSubject{constructor(){super(getIsDark()?GOOGLE_MAPS_STYLE_DARK:GOOGLE_MAPS_STYLE_LIGHT)}};_GoogleMapStyles.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_GoogleMapStyles)},_GoogleMapStyles.\u0275prov=\u0275\u0275defineInjectable({token:_GoogleMapStyles,factory:_GoogleMapStyles.\u0275fac,providedIn:"root"});let GoogleMapStyles2=_GoogleMapStyles;return GoogleMapStyles2})();var ThemingService=(()=>{let _ThemingService=class _ThemingService{constructor(){this.doc=inject(DOCUMENT),this.platformId=inject(PLATFORM_ID),this.appName=inject(APP_NAME),this.gmStyles$=inject(GoogleMapStyles),this.themes=new BehaviorSubject(new Map)}hasTheme(type){return this.themes.asObservable().pipe(map(themeMap=>!!themeMap.has(type)))}setTheme(type,theme){if(this.themes.next(this.themes.getValue().set(type,theme)),isPlatformBrowser(this.platformId)){let dark=getIsDark();this.appName==="Portal"&&(theme.pageColor||theme.cardColor?(this.gmStyles$.next(getPortalGoogleMapStyles(theme)),theme.pageColor&&(0,import_tinycolor24.default)(theme.pageColor).isDark()&&(dark=!0)):this.gmStyles$.next(dark?GOOGLE_MAPS_STYLE_DARK:GOOGLE_MAPS_STYLE_LIGHT)),insertCSS(this.doc,type,getCustomThemeStyles(theme,dark)),this.doc.body.classList.remove(dark?"light":"dark"),this.doc.body.classList.add(dark?"dark":"light")}}destroyTheme(type){let clone3=new Map(this.themes.getValue());if(clone3.delete(type),this.themes.next(clone3),isPlatformBrowser(this.platformId)){let style2=this.doc.getElementById(getStyleElementId(type));style2?.parentElement?.removeChild(style2)}}};_ThemingService.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ThemingService)},_ThemingService.\u0275prov=\u0275\u0275defineInjectable({token:_ThemingService,factory:_ThemingService.\u0275fac,providedIn:"root"});let ThemingService2=_ThemingService;return ThemingService2})();var removeCompanyTheme=createEffect((actions$=inject(Actions),service=inject(ThemingService))=>actions$.pipe(ofType(removeCompanyBranding),tap(()=>service.destroyTheme("company"))),{functional:!0,dispatch:!1}),setCompanyTheme=createEffect((actions$=inject(Actions),service=inject(ThemingService))=>actions$.pipe(ofType(setCompanyBranding),tap(({branding})=>{branding?.theme&&service.setTheme("company",branding.theme)})),{functional:!0,dispatch:!1}),setHostTheme=createEffect((actions$=inject(Actions),service=inject(ThemingService))=>actions$.pipe(ofType(setHostBranding),tap(({branding})=>{branding?.theme&&service.setTheme("host",branding.theme)})),{functional:!0,dispatch:!1}),setSectorTheme=createEffect((actions$=inject(Actions),service=inject(ThemingService))=>actions$.pipe(ofType(setSectorBranding),tap(({branding})=>{branding?.theme&&service.setTheme("sector",branding.theme)})),{functional:!0,dispatch:!1});function provideThemingSystem(){return[{provide:USER_PROVIDED_EFFECTS,multi:!0,useValue:[theming_effects_exports]}]}var AppSystemsModule=(()=>{let _AppSystemsModule=class _AppSystemsModule{};_AppSystemsModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppSystemsModule)},_AppSystemsModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppSystemsModule}),_AppSystemsModule.\u0275inj=\u0275\u0275defineInjector({providers:[provideThemingSystem()],imports:[BrandingModule2,CustomTranslationsModule.forRoot(),LocalizationModule,TranslationModule2.forRoot(),__use_api_mocks__?[PlatformFeaturesModule.forRoot([{feature:"assets",guard:AssetsMockGuard},{feature:"historical-data",guard:HistoricalDataMockGuard},{feature:"live-data",guard:LiveDataMockGuard},{feature:"object-storage",guard:ObjectStorageMockGuard}])]:[AuthModule,PlatformFeaturesModule.forRoot()]]});let AppSystemsModule2=_AppSystemsModule;return AppSystemsModule2})();function AppComponent_Conditional_1_Template(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",1),\u0275\u0275namespaceSVG(),\u0275\u0275elementStart(1,"svg",3),\u0275\u0275element(2,"circle",4),\u0275\u0275elementEnd()())}var AppComponent=(()=>{let _AppComponent=class _AppComponent{constructor(){this.vcRef=inject(ViewContainerRef),this.loading=!0}};_AppComponent.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppComponent)},_AppComponent.\u0275cmp=\u0275\u0275defineComponent({type:_AppComponent,selectors:[["ix-root"]],standalone:!1,decls:3,vars:1,consts:[[1,"ix-container"],[1,"ix-container","ix-spinner"],[3,"activate"],["viewBox","25 25 50 50"],["cx","50","cy","50","r","20","fill","none","stroke-width","4.5px","stroke-miterlimit","10"]],template:function(rf,ctx){rf&1&&(\u0275\u0275elementStart(0,"div",0),\u0275\u0275template(1,AppComponent_Conditional_1_Template,3,0,"div",1),\u0275\u0275elementStart(2,"router-outlet",2),\u0275\u0275listener("activate",function(){return ctx.loading=!1}),\u0275\u0275elementEnd()()),rf&2&&(\u0275\u0275advance(),\u0275\u0275conditional(ctx.loading?1:-1))},dependencies:[RouterOutlet],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;margin:0;padding:0;overflow:hidden}"]});let AppComponent2=_AppComponent;return AppComponent2})();var ComponentContextNavigateByUrlInterrupter=(()=>{let _ComponentContextNavigateByUrlInterrupter=class _ComponentContextNavigateByUrlInterrupter extends ComponentContextInterceptor{constructor(){super(...arguments),this.snackBar=inject(MatSnackBar)}intercept(command,args){return command==="navigate-by-url"?(this.snackBar.open(`Navigate to URL${args[0]?` (${args[0]})`:""}`,void 0,{duration:4e3}),EMPTY):of(args)}};_ComponentContextNavigateByUrlInterrupter.\u0275fac=(()=>{let \u0275ComponentContextNavigateByUrlInterrupter_BaseFactory;return function(__ngFactoryType__){return(\u0275ComponentContextNavigateByUrlInterrupter_BaseFactory||(\u0275ComponentContextNavigateByUrlInterrupter_BaseFactory=\u0275\u0275getInheritedFactory(_ComponentContextNavigateByUrlInterrupter)))(__ngFactoryType__||_ComponentContextNavigateByUrlInterrupter)}})(),_ComponentContextNavigateByUrlInterrupter.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentContextNavigateByUrlInterrupter,factory:_ComponentContextNavigateByUrlInterrupter.\u0275fac});let ComponentContextNavigateByUrlInterrupter2=_ComponentContextNavigateByUrlInterrupter;return ComponentContextNavigateByUrlInterrupter2})(),ComponentContextToggleVpnInterceptor=(()=>{let _ComponentContextToggleVpnInterceptor=class _ComponentContextToggleVpnInterceptor extends ComponentContextInterceptor{constructor(){super(...arguments),this.snackBar=inject(MatSnackBar)}intercept(command,args){return command==="toggle-vpn"?(this.snackBar.open("VPN Connection toggled",void 0,{duration:4e3}),EMPTY):of(args)}};_ComponentContextToggleVpnInterceptor.\u0275fac=(()=>{let \u0275ComponentContextToggleVpnInterceptor_BaseFactory;return function(__ngFactoryType__){return(\u0275ComponentContextToggleVpnInterceptor_BaseFactory||(\u0275ComponentContextToggleVpnInterceptor_BaseFactory=\u0275\u0275getInheritedFactory(_ComponentContextToggleVpnInterceptor)))(__ngFactoryType__||_ComponentContextToggleVpnInterceptor)}})(),_ComponentContextToggleVpnInterceptor.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentContextToggleVpnInterceptor,factory:_ComponentContextToggleVpnInterceptor.\u0275fac});let ComponentContextToggleVpnInterceptor2=_ComponentContextToggleVpnInterceptor;return ComponentContextToggleVpnInterceptor2})(),ComponentContextShowVpnStatusDetailsInterceptor=(()=>{let _ComponentContextShowVpnStatusDetailsInterceptor=class _ComponentContextShowVpnStatusDetailsInterceptor extends ComponentContextInterceptor{constructor(){super(...arguments),this.snackBar=inject(MatSnackBar)}intercept(command,args){return command==="show-vpn-status-details"?(this.snackBar.open("VPN details dialog opened",void 0,{duration:4e3}),EMPTY):of(args)}};_ComponentContextShowVpnStatusDetailsInterceptor.\u0275fac=(()=>{let \u0275ComponentContextShowVpnStatusDetailsInterceptor_BaseFactory;return function(__ngFactoryType__){return(\u0275ComponentContextShowVpnStatusDetailsInterceptor_BaseFactory||(\u0275ComponentContextShowVpnStatusDetailsInterceptor_BaseFactory=\u0275\u0275getInheritedFactory(_ComponentContextShowVpnStatusDetailsInterceptor)))(__ngFactoryType__||_ComponentContextShowVpnStatusDetailsInterceptor)}})(),_ComponentContextShowVpnStatusDetailsInterceptor.\u0275prov=\u0275\u0275defineInjectable({token:_ComponentContextShowVpnStatusDetailsInterceptor,factory:_ComponentContextShowVpnStatusDetailsInterceptor.\u0275fac});let ComponentContextShowVpnStatusDetailsInterceptor2=_ComponentContextShowVpnStatusDetailsInterceptor;return ComponentContextShowVpnStatusDetailsInterceptor2})();var ComponentContextInterceptorModule=(()=>{let _ComponentContextInterceptorModule=class _ComponentContextInterceptorModule{};_ComponentContextInterceptorModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_ComponentContextInterceptorModule)},_ComponentContextInterceptorModule.\u0275mod=\u0275\u0275defineNgModule({type:_ComponentContextInterceptorModule}),_ComponentContextInterceptorModule.\u0275inj=\u0275\u0275defineInjector({providers:[{provide:COMPONENT_CONTEXT_INTERCEPTORS,useClass:ComponentContextNavigateByUrlInterrupter,multi:!0},{provide:COMPONENT_CONTEXT_INTERCEPTORS,useClass:ComponentContextShowVpnStatusDetailsInterceptor,multi:!0},{provide:COMPONENT_CONTEXT_INTERCEPTORS,useClass:ComponentContextToggleVpnInterceptor,multi:!0}]});let ComponentContextInterceptorModule2=_ComponentContextInterceptorModule;return ComponentContextInterceptorModule2})();var AppModule=(()=>{let _AppModule=class _AppModule{};_AppModule.\u0275fac=function(__ngFactoryType__){return new(__ngFactoryType__||_AppModule)},_AppModule.\u0275mod=\u0275\u0275defineNgModule({type:_AppModule,bootstrap:[AppComponent]}),_AppModule.\u0275inj=\u0275\u0275defineInjector({providers:[AppGuard2,{provide:APP_CONFIG,useFactory:appConfigFactory},{provide:IXAPI_OPTIONS,useFactory:factory,deps:[APP_CONFIG]},{provide:FQDN,useFactory:fqdnFactory,deps:[DOCUMENT]},{provide:APP_WEB_ROOT_URL,useFactory:appWebRootUrlFactory,deps:[DOCUMENT]},{provide:ComponentLoaderService,useClass:ComponentLoaderMockService},{provide:RESOURCE_DATA_PROVIDER_AVAILABILITY_STRATEGY,useValue:ResourceDataProviderAvailabilityStrategy.Always},...__use_api_mocks__?[{provide:WEB_SOCKET,useFactory:webSocketMockFactory,deps:[Injector]}]:[]],imports:[BrowserModule,BrowserAnimationsModule,FlexLayoutModule,NgxDaterangepickerMd.forRoot(),AppCoreModule,AppStateModule,AppSystemsModule,ComponentContextInterceptorModule,FaviconModule,FileSaveModule.forRoot(),IconsModule,LayoutModule2,AppRoutingModule,LoginExpiredModule,SettingsModule,TwoFactorAuthRequiredComponent,BuilderComponent]});let AppModule2=_AppModule;return AppModule2})();function factory(config3){return config3.api}environment.production&&void 0;document.addEventListener("DOMContentLoaded",()=>{Promise.all([loadAppConfig(),loadAccessToken(),features.init()]).then(()=>{platformBrowser().bootstrapModule(AppModule).catch(err=>console.error(err))})});function loadAccessToken(){return new Promise((resolve,reject2)=>{let xhr=new XMLHttpRequest;xhr.onload=()=>resolve(new Response(xhr.responseText,{status:xhr.status})),xhr.onerror=reject2,xhr.open("GET","/access-token.txt"),xhr.send(null)}).then(response=>response.status===404?"":response.text()).then(token=>_rememberToken(token))}function _rememberToken(token){let key="ix-auth";if(token){if(localStorage.getItem(key)){let json=JSON.parse(localStorage.getItem(key)),value=json.encrypted?decryptValue(json.value):json.value;if(token===value)return}let expires=Math.floor(new Date().getTime()/1e3)+24*60*60;localStorage.setItem(key,JSON.stringify({expires,value:token}))}}