@digital-realty/ix-notifications 1.1.71 → 1.2.2-alpha.0

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 +1 @@
1
- import{__decorate}from"tslib";import{svg,css,html,nothing}from"lit";import{property,customElement,state,query}from"lit/decorators.js";import{MobxLitElement}from"@adobe/lit-mobx";import{differenceInDays}from"date-fns/differenceInDays.js";import{differenceInHours}from"date-fns/differenceInHours.js";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-drawer/ix-drawer.js";import"@digital-realty/ix-icon";import"@material/web/icon/icon.js";import{makeAutoObservable}from"mobx";import{makePersistable,isHydrated,hydrateStore,clearPersistedStore,getPersistedStore}from"mobx-persist-store";import{parse}from"date-fns/parse.js";import{subDays}from"date-fns/subDays.js";import{format}from"date-fns/format.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"@digital-realty/ix-icon/ix-icon.js";import{formatDistance}from"date-fns/formatDistance.js";import"@digital-realty/ix-toast/ix-message-toast.js";import{unsafeSVG}from"lit/directives/unsafe-svg.js";import"@digital-realty/ix-switch/ix-switch.js";import"@digital-realty/ix-date/ix-date.js";import"@digital-realty/ix-divider/ix-divider.js";import{computePosition}from"@floating-ui/dom";import{classMap}from"lit/directives/class-map.js";let viewList=svg`<svg viewBox="0 0 24 24"><path d="M3 9H7V5H3V9ZM7 14H3V10H7V14ZM7 19H3V15H7V19ZM20 14H8V10H20V14ZM8 19H20V15H8V19ZM8 9V5H20V9H8Z"/></svg>`,dcim=svg`<svg viewBox="0 0 24 24"><path d="M20 0C17.791 0 16 1.791 16 4C16 6.857 20 11 20 11C20 11 24 6.857 24 4C24 1.791 22.209 0 20 0ZM12 2C6.486 2 2 6.486 2 12C2 17.514 6.486 22 12 22C17.514 22 22 17.514 22 12C22 11.93 21.9912 11.862 21.9902 11.793C21.7532 12.059 21.5575 12.2677 21.4395 12.3887L19.6504 14.3047C19.4484 14.9657 19.1695 15.5919 18.8145 16.1699C18.4985 15.4819 17.806 15 17 15H16V13C16 12.447 15.552 12 15 12H9V10H10C10.552 10 11 9.553 11 9V7.02344L13.0156 7.00781C13.5986 7.00381 14.1175 6.74289 14.4805 6.33789C14.3145 5.89389 14.1875 5.445 14.1035 5L9.99219 5.03125C9.44319 5.03525 9 5.48225 9 6.03125V8H8C7.448 8 7 8.447 7 9V10.1855L4.98047 8.16797C6.34047 5.68697 8.977 4 12 4H14C14 3.397 14.0908 2.81658 14.2578 2.26758C13.5308 2.09858 12.777 2 12 2ZM20 2.57031C20.789 2.57031 21.4297 3.211 21.4297 4C21.4297 4.789 20.789 5.42969 20 5.42969C19.211 5.42969 18.5703 4.789 18.5703 4C18.5703 3.211 19.211 2.57031 20 2.57031ZM4.20703 10.2207L9 15.0137V16C9 17.103 9.897 18 11 18V19.9316C7.06 19.4366 4 16.072 4 12C4 11.388 4.07603 10.7947 4.20703 10.2207ZM10.7793 14H14V16C14 16.553 14.448 17 15 17H17V18.2344C15.875 19.1384 14.502 19.7417 13 19.9297V17C13 16.447 12.552 16 12 16H11V14.5996C11 14.3776 10.9123 14.174 10.7793 14Z"/></svg>`,plannedMaintenance=svg`<svg viewBox="0 0 24 24"><path d="M6 2C4.90575 2 4 2.90575 4 4V20C4 21.0943 4.90575 22 6 22H11V20H6V4H13V9H18V13H20V8L14 2H6ZM12 11V14H15C15 12.343 13.641 11.031 12 11ZM11 12C9.343 12 8 13.343 8 15C8 16.657 9.343 18 11 18C12.657 18 13.969 16.641 14 15H11V12ZM16 15V21H13C13 22.654 14.346 24 16 24H21C22.645 24 24 22.645 24 21V15H16ZM18 17H22V21C22 21.565 21.565 22 21 22C20.449 22 20 21.552 20 21H18V17Z"/></svg>`,trash=svg`<svg viewBox="0 0 24 24"><path d="M15.5 4H19V6H5V4H8.5L9.5 3H14.5L15.5 4ZM8 21C6.9 21 6 20.1 6 19V7H18V19C18 20.1 17.1 21 16 21H8Z"/></svg>`,sortCheck=(svg`<svg viewBox="0 0 24 24"><path d="M11 12C13.21 12 15 10.21 15 8C15 5.79 13.21 4 11 4C8.79 4 7 5.79 7 8C7 10.21 8.79 12 11 12ZM9 17L12 14.06C11.61 14.02 11.32 14 11 14C8.33 14 3 15.34 3 18V20H12L9 17ZM12 17L15.47 20.5L22 13.91L20.6 12.5L15.47 17.67L13.4 15.59L12 17Z"/></svg>`,svg`<svg viewbox="0 0 24 24"><path d="M 3,6 V 8 H 21 V 6 Z M 3,18 H 9 V 16 H 3 Z M 15,13 H 3 v -2 h 12 z"/><rect x="8" y="0.5" width="16" height="16" rx="8"/><path d="M 14.5,10.585 12.415,8.50001 11.705,9.20501 14.5,12 l 6,-5.99999 -0.705,-0.705 z" style="fill:#fff"/></svg>`),TWStyles=css`*,::after,::before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}*,::after,::before{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}::after,::before{--tw-content:''}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.dlr-text-default,:host,:host :root,:root,html{font-family:var(--root-primary-font);font-size:var(--text-default-size);line-height:var(--text-default-line-height);letter-spacing:var(--text-default-letter-spacing);font-weight:var(--text-default-weight);-webkit-text-decoration:var(--text-default-decoration);text-decoration:var(--text-default-decoration);text-transform:var(--text-default-transform)}.dlr-text-heading{font-family:var(--root-secondary-font);font-size:var(--text-heading-size);line-height:var(--text-heading-line-height);letter-spacing:var(--text-heading-letter-spacing);font-weight:var(--text-heading-weight);-webkit-text-decoration:var(--text-heading-decoration);text-decoration:var(--text-heading-decoration);text-transform:var(--text-heading-transform)}.dlr-text-caption{font-family:var(--root-primary-font);font-size:var(--text-caption-size);line-height:var(--text-caption-line-height);letter-spacing:var(--text-caption-letter-spacing);font-weight:var(--text-caption-weight);-webkit-text-decoration:var(--text-caption-decoration);text-decoration:var(--text-caption-decoration);text-transform:var(--text-caption-transform)}.static{position:static}.absolute{position:absolute}.relative{position:relative}.-start-0{inset-inline-start:0}.z-50{z-index:50}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.m-4{margin:1rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-2{margin-top:-.5rem}.mb-4{margin-bottom:1rem}.ml-14{margin-left:3.5rem}.mr-4{margin-right:1rem}.flex{display:flex}.hidden{display:none}.w-\\[560px\\]{width:560px}.w-\\[580px\\]{width:580px}.grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.whitespace-nowrap{white-space:nowrap}.text-wrap{text-wrap:wrap}.text-balance{text-wrap:balance}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border-b{border-bottom-width:1px}.border-l-3{border-left-width:3px}.border-outline{border-color:var(--cp-neutral-blue-12p)}.border-success{border-color:var(--cp-success-50)}.border-transparent{border-color:transparent}.fill-primary{fill:var(--cp-dlr-blue-50)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pl-1{padding-left:.25rem}.pl-3\\.5{padding-left:.875rem}.pl-4{padding-left:1rem}.pr-1{padding-right:.25rem}.pt-4{padding-top:1rem}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.text-on-surface-disabled{color:var(--cp-neutral-blue-50p)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity,1))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms}.hover\\:bg-\\[rgba\\(0\\2c 0\\2c 0\\2c 0\\.04\\)\\]:hover{background-color:rgba(0,0,0,.04)}.hover\\:bg-primary-subtle:hover{background-color:var(--cp-dlr-blue-10p)}@media (min-width:600px){.sm\\:flex-col{flex-direction:column}.md\\:flex-col{flex-direction:column}}@media (min-width:1200px){.lg\\:flex-col{flex-direction:column}.xl\\:flex-row{flex-direction:row}}`;var NotificationStatus,NotificationGroups,SubGroups,ApiCallState;(t=>{t.READ="read",t.UNREAD="unread"})(NotificationStatus=NotificationStatus||{}),(t=>{t.PLANNED_MAINTENANCE="Planned Maintenance",t.INCIDENTS="Incidents",t.DCIM_ALERTS="DCIM Alerts",t.SERVICE_TICKETS="Service Tickets"})(NotificationGroups=NotificationGroups||{}),(t=>{t.Remote_Hands="Remote Hands",t.Deliveries="Deliveries",t.Removals="Removals",t.Facility_Access="Facility Access",t.Trouble_Ticket="Trouble Ticket",t.Customer_Care="Customer Care",t.FacilityAccessVisitorAccess="FacilityAccessVisitorAccess",t.FacilityAccessPermanentBadge="FacilityAccessPermanentBadge",t.FacilityAccessOspAccess="FacilityAccessOspAccess",t.FacilityAccessPopPoeAccess="FacilityAccessPopPoeAccess"})(SubGroups=SubGroups||{}),(t=>{t.LOADING="Loading",t.ERROR="Error",t.SUCCESS="Success"})(ApiCallState=ApiCallState||{});let DefaultDateFormat="yyyy-MM-dd",DefaultDisplayDays=30,DefaultDateTimeFormat="yyyy-MM-dd HH:mm:ss",BASE_PATH="http://api.digitalrealty.com/notifications".replace(/\/+$/,"");class Configuration{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:BASE_PATH}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||querystring}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let t=this.configuration.apiKey;if(t)return"function"==typeof t?t:()=>t}get accessToken(){let t=this.configuration.accessToken;if(t)return"function"==typeof t?t:async()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}let DefaultConfig=new Configuration;class BaseAPI{constructor(t=DefaultConfig){this.configuration=t,this.fetchApi=async(t,e)=>{let i={url:t,init:e};for(var o of this.middleware)o.pre&&(i=await o.pre({fetch:this.fetchApi,...i})||i);let a=void 0;try{a=await(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(t){for(var r of this.middleware)r.onError&&(a=await r.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:t,response:a?a.clone():void 0})||a);if(void 0===a)throw t instanceof Error?new FetchError(t,"The request failed and the interceptors did not return an alternative response"):t}for(var n of this.middleware)n.post&&(a=await n.post({fetch:this.fetchApi,url:i.url,init:i.init,response:a.clone()})||a);return a},this.middleware=t.middleware}withMiddleware(...t){var e=this.clone();return e.middleware=e.middleware.concat(...t),e}withPreMiddleware(...t){t=t.map(t=>({pre:t}));return this.withMiddleware(...t)}withPostMiddleware(...t){t=t.map(t=>({post:t}));return this.withMiddleware(...t)}isJsonMime(t){return!!t&&BaseAPI.jsonRegex.test(t)}async request(t,e){var{url:t,init:e}=await this.createFetchParams(t,e),t=await this.fetchApi(t,e);if(t&&200<=t.status&&t.status<300)return t;throw new ResponseError(t,"Response returned an error code")}async createFetchParams(t,e){let i=this.configuration.basePath+t.path,o=(void 0!==t.query&&0!==Object.keys(t.query).length&&(i+="?"+this.configuration.queryParamsStringify(t.query)),Object.assign({},this.configuration.headers,t.headers));Object.keys(o).forEach(t=>void 0===o[t]?delete o[t]:{});var a="function"==typeof e?e:async()=>e,r={method:t.method,headers:o,body:t.body,credentials:this.configuration.credentials},a={...r,...await a({init:r,context:t})};let n;n=!(isFormData(a.body)||a.body instanceof URLSearchParams||isBlob(a.body))&&this.isJsonMime(o["Content-Type"])?JSON.stringify(a.body):a.body;r={...a,body:n};return{url:i,init:r}}clone(){var t=new this.constructor(this.configuration);return t.middleware=this.middleware.slice(),t}}function isBlob(t){return"undefined"!=typeof Blob&&t instanceof Blob}function isFormData(t){return"undefined"!=typeof FormData&&t instanceof FormData}BaseAPI.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class ResponseError extends Error{constructor(t,e){super(e),this.response=t,this.name="ResponseError"}}class FetchError extends Error{constructor(t,e){super(e),this.cause=t,this.name="FetchError"}}class RequiredError extends Error{constructor(t,e){super(e),this.field=t,this.name="RequiredError"}}let COLLECTION_FORMATS={csv:","};function exists(t,e){t=t[e];return null!=t}function querystring(e,i=""){return Object.keys(e).map(t=>querystringSingleKey(t,e[t],i)).filter(t=>0<t.length).join("&")}function querystringSingleKey(t,e,i=""){var o,a=i+(i.length?`[${t}]`:t);return e instanceof Array?(o=e.map(t=>encodeURIComponent(String(t))).join(`&${encodeURIComponent(a)}=`),encodeURIComponent(a)+"="+o):e instanceof Set?querystringSingleKey(t,Array.from(e),i):e instanceof Date?encodeURIComponent(a)+"="+encodeURIComponent(e.toISOString()):e instanceof Object?querystring(e,a):encodeURIComponent(a)+"="+encodeURIComponent(String(e))}class JSONApiResponse{constructor(t,e=t=>t){this.raw=t,this.transformer=e}async value(){return this.transformer(await this.raw.json())}}class VoidApiResponse{constructor(t){this.raw=t}async value(){}}function StatusFromJSON(t){return StatusFromJSONTyped(t)}function StatusFromJSONTyped(t,e){return t}function StatusToJSON(t){return t}function NotificationFromJSON(t){return NotificationFromJSONTyped(t)}function NotificationFromJSONTyped(t,e){return null==t?t:{id:exists(t,"id")?t.id:void 0,resourceType:exists(t,"resource_type")?t.resource_type:void 0,subGroup:exists(t,"sub_group")?t.sub_group:void 0,createdAt:exists(t,"created_at")?null===t.created_at?null:new Date(t.created_at):void 0,createdBy:exists(t,"created_by")?t.created_by:void 0,subject:exists(t,"subject")?t.subject:void 0,locations:exists(t,"locations")?t.locations:void 0,resourceId:exists(t,"resource_id")?t.resource_id:void 0,status:exists(t,"status")?StatusFromJSON(t.status):void 0,accountNumber:exists(t,"account_number")?t.account_number:void 0}}function GetNotifications200ResponseFromJSON(t){return GetNotifications200ResponseFromJSONTyped(t)}function GetNotifications200ResponseFromJSONTyped(t,e){return null==t?t:{self:exists(t,"self")?t.self:void 0,first:exists(t,"first")?t.first:void 0,prev:exists(t,"prev")?t.prev:void 0,next:exists(t,"next")?t.next:void 0,last:exists(t,"last")?t.last:void 0,items:t.items.map(NotificationFromJSON)}}function NotificationPatchFromJSON(t){return NotificationPatchFromJSONTyped(t)}function NotificationPatchFromJSONTyped(t,e){return null==t?t:{status:StatusFromJSON(t.status)}}function NotificationPatchToJSON(t){if(void 0!==t)return null===t?null:{status:StatusToJSON(t.status)}}function NotificationRequestToJSON(t){if(void 0!==t)return null===t?null:{resource_type:t.resourceType,sub_group:t.subGroup,recipients:t.recipients,account_number:t.accountNumber,locations:t.locations,resource_id:t.resourceId,subject:t.subject,created_at:void 0===t.createdAt?void 0:null===t.createdAt?null:t.createdAt.toISOString()}}class NotificationsApi extends BaseAPI{async createNotificationRaw(t,e){var i={"Content-Type":"application/json"},o=(this.configuration&&this.configuration.accessToken&&(o=await(0,this.configuration.accessToken)("bearerToken",[]))&&(i.Authorization="Bearer "+o),await this.request({path:"/notifications",method:"POST",headers:i,query:{},body:NotificationRequestToJSON(t.notificationRequest)},e));return new JSONApiResponse(o,t=>NotificationFromJSON(t))}async createNotification(t={},e){return(await this.createNotificationRaw(t,e)).value()}async deleteNotificationsByIdRaw(t,e){if(null==t.id)throw new RequiredError("id","Required parameter requestParameters.id was null or undefined when calling deleteNotificationsById.");var i={},o=(this.configuration&&this.configuration.accessToken&&(o=await(0,this.configuration.accessToken)("bearerToken",[]))&&(i.Authorization="Bearer "+o),await this.request({path:"/notifications/{id}".replace("{id}",encodeURIComponent(String(t.id))),method:"DELETE",headers:i,query:{}},e));return new VoidApiResponse(o)}async deleteNotificationsById(t,e){await this.deleteNotificationsByIdRaw(t,e)}async getNotificationsRaw(t,e){var i={},o=(void 0!==t.sort&&(i.sort=t.sort),void 0!==t.cursor&&(i.cursor=t.cursor),void 0!==t.resourceType&&(i.resource_type=t.resourceType),void 0!==t.accountNumber&&(i.account_number=t.accountNumber),void 0!==t.createdAfter&&(i.created_after=t.createdAfter.toISOString()),void 0!==t.createdBefore&&(i.created_before=t.createdBefore.toISOString()),void 0!==t.locationId&&(i.location_id=t.locationId),void 0!==t.subGroup&&(i.sub_group=t.subGroup),void 0!==t.status&&(i.status=t.status),{}),t=(t.prefer&&(o.Prefer=t.prefer.join(COLLECTION_FORMATS.csv)),this.configuration&&this.configuration.accessToken&&(t=await(0,this.configuration.accessToken)("bearerToken",[]))&&(o.Authorization="Bearer "+t),await this.request({path:"/notifications",method:"GET",headers:o,query:i},e));return new JSONApiResponse(t,t=>GetNotifications200ResponseFromJSON(t))}async getNotifications(t={},e){return(await this.getNotificationsRaw(t,e)).value()}async getNotificationsByIdRaw(t,e){if(null==t.id)throw new RequiredError("id","Required parameter requestParameters.id was null or undefined when calling getNotificationsById.");var i={},o=(this.configuration&&this.configuration.accessToken&&(o=await(0,this.configuration.accessToken)("bearerToken",[]))&&(i.Authorization="Bearer "+o),await this.request({path:"/notifications/{id}".replace("{id}",encodeURIComponent(String(t.id))),method:"GET",headers:i,query:{}},e));return new JSONApiResponse(o,t=>NotificationFromJSON(t))}async getNotificationsById(t,e){return(await this.getNotificationsByIdRaw(t,e)).value()}async patchNotificationsByIdRaw(t,e){if(null==t.id)throw new RequiredError("id","Required parameter requestParameters.id was null or undefined when calling patchNotificationsById.");var i={"Content-Type":"application/json"},o=(this.configuration&&this.configuration.accessToken&&(o=await(0,this.configuration.accessToken)("bearerToken",[]))&&(i.Authorization="Bearer "+o),await this.request({path:"/notifications/{id}".replace("{id}",encodeURIComponent(String(t.id))),method:"PATCH",headers:i,query:{},body:NotificationPatchToJSON(t.notificationPatch)},e));return new JSONApiResponse(o,t=>NotificationPatchFromJSON(t))}async patchNotificationsById(t,e){return(await this.patchNotificationsByIdRaw(t,e)).value()}}let APIEndpointPrefixes={Notifications:"notifications"};class ApiClient{constructor(t){this.noInit=!1,this.configuration=t}get notificationsApi(){return new NotificationsApi(new Configuration({basePath:this.configuration.NotificationApiUrl+"/"+APIEndpointPrefixes.Notifications,headers:{Authorization:this.getAuthorization()}}))}getAuthorization(){return this.configuration.getAuthorizationFn?this.configuration.getAuthorizationFn():""}}let isNullOrUndefinedOrEmpty=t=>null==t||""===t,mapResourceTypeToNotificationGroups=t=>{switch(t.toLowerCase()){case"planned maintenance":return NotificationGroups.PLANNED_MAINTENANCE;case"incidents":return NotificationGroups.INCIDENTS;case"dcim alerts":return NotificationGroups.DCIM_ALERTS;case"service tickets":return NotificationGroups.SERVICE_TICKETS;default:return NotificationGroups.PLANNED_MAINTENANCE}},mapStringToNotificationStatus=t=>{switch(t.toLowerCase()){case"unread":return NotificationStatus.UNREAD;case"read":return NotificationStatus.READ;default:return NotificationStatus.UNREAD}},mapParametersToNotificationRequest=t=>({sort:"-created_at",cursor:t,prefer:[""]}),mapParametersToPatchNotificationRequest=(t,e)=>({id:t,notificationPatch:{status:e}}),mapParametersToDeleteNotificationRequest=t=>({id:t}),mapNotificationDataToNotification=t=>{var e;return{subject:null!=(e=t.subject)?e:"",id:t.id,accountNumber:null!=(e=t.accountNumber)?e:"",resourceType:mapResourceTypeToNotificationGroups(null!=(e=t.resourceType)?e:""),subGroup:null!=(e=t.subGroup)?e:"",resourceId:null!=(e=t.resourceId)?e:"",status:mapStringToNotificationStatus(null!=(e=t.status)?e:""),createdAt:isNullOrUndefinedOrEmpty(t.createdAt)?format(new Date,DefaultDateTimeFormat):format(t.createdAt,DefaultDateTimeFormat),createdBy:null!=(e=t.createdBy)?e:"",locations:null!=(e=t.locations)?e:[]}},mapNotificationResponseToNotifications=t=>t.map(t=>mapNotificationDataToNotification(t)),getNextPageCursorfromQueryParam=t=>{t=new URLSearchParams(t),t=t.has("cursor")?t.get("cursor"):"";return null!==t?t:""},handleError=async(e,t=!0)=>{if(e instanceof ResponseError&&400===e.response.status)try{var i=(await e.response.json()).detail;t&&console.error(i)}catch(t){console.error(e)}else console.error(e)},getLocalStorageUser=t=>{t=localStorage.getItem(t);return t?JSON.parse(t):null},getUserAuthorization=t=>"Bearer "+(null==(t=getLocalStorageUser(t))?void 0:t.access_token);class NotificationState{constructor(){this.showDrawer=!1,this.apiClient={noInit:!0},this.baseApiUrl="",this.localStorageKey="",this.NewApiClient=()=>{this.apiClient=new ApiClient({NotificationApiUrl:this.baseApiUrl,getAuthorizationFn:()=>getUserAuthorization(this.localStorageKey)}),this.getNotifications()},this.nextPageCursor="",this.notifications=[],this.unreadNotificationCount=0,this.notificationFilters={SHOW_PLANNED_MAINTENANCE:!0,SHOW_SERVICE_TICKETS:!0,SHOW_DCIM_ALERTS:!0},this.selectedNotification={id:"",resourceType:NotificationGroups.PLANNED_MAINTENANCE,subGroup:"",subject:"",resourceId:"",locations:[],createdAt:"",accountNumber:"",createdBy:"",status:NotificationStatus.READ},this.dateFilters={FROM_DATE:subDays(new Date,DefaultDisplayDays),TO_DATE:new Date},makeAutoObservable(this),makePersistable(this,{name:"notification-state",properties:["notificationFilters","nextPageCursor"],storage:window.localStorage})}get isHydrated(){return isHydrated(this)}async hydrateStore(){await hydrateStore(this)}async clearStoredData(){await clearPersistedStore(this)}async getStoredData(){return getPersistedStore(this)}ConstructApiClient(){return this.apiClient.noInit?this.NewApiClient():this.apiClient}async clearStoredNotificationsData(){this.notifications=[],this.unreadNotificationCount=0,this.nextPageCursor="",this.apiClient={noInit:!0}}async setNotificationReadStatus(e){var t,i=await this.setNotificationAsRead(e.toString());return!0===await i&&(this.ReduceUnreadNotificationCount(),t=this.notifications.findIndex(t=>t.id===e),this.notifications[t].status=NotificationStatus.READ,this.selectedNotification=this.notifications[t]),i}async setNotificationDeleted(e){var t,i=await this.DeleteNotification(e.toString());return!0===i&&("unread"===(null==(t=this.notifications.find(t=>t.id===e))?void 0:t.status)&&this.ReduceUnreadNotificationCount(),t=this.notifications.findIndex(t=>t.id===e),this.notifications.splice(t,1)),{State:!0===i?ApiCallState.SUCCESS:ApiCallState.ERROR,Message:!0===i?"Successfully deleted the notification":"Error while deleting the notification"}}setNotificationDateFilter(t,e){this.dateFilters.FROM_DATE=void 0!==t?parse(t,DefaultDateFormat,new Date):void 0,this.dateFilters.TO_DATE=void 0!==e?parse(e,DefaultDateFormat,new Date):void 0}setNotificationFilter(t,e){switch(t){case NotificationGroups.PLANNED_MAINTENANCE:this.notificationFilters.SHOW_PLANNED_MAINTENANCE=e;break;case NotificationGroups.SERVICE_TICKETS:this.notificationFilters.SHOW_SERVICE_TICKETS=e;break;case NotificationGroups.DCIM_ALERTS:this.notificationFilters.SHOW_DCIM_ALERTS=e}}async getNotifications(){var t,e;void 0!==this.nextPageCursor&&(e=await(null==(e=this.apiClient)?void 0:e.notificationsApi.getNotificationsRaw(mapParametersToNotificationRequest(getNextPageCursorfromQueryParam(this.nextPageCursor))).catch(t=>{handleError(t,!1)})))&&(t=await(null==e?void 0:e.value()),this.notifications=""===this.nextPageCursor?mapNotificationResponseToNotifications(null==t?void 0:t.items):this.notifications.concat(mapNotificationResponseToNotifications(null==t?void 0:t.items)),this.nextPageCursor=void 0===(null==t?void 0:t.next)||null==t?void 0:t.next,this.unreadNotificationCount=null!==e.raw.headers.get("x-total-unread-count")&&void 0!==e.raw.headers.get("x-total-unread-count")?e.raw.headers.get("x-total-unread-count"):0)}async getNotificationsById(t){let e,i;(i=t?await(null==(e=this.apiClient)?void 0:e.notificationsApi.getNotificationsById({id:t}).catch(t=>{handleError(t,!1)})):i)&&(this.selectedNotification=mapNotificationDataToNotification(i))}async setNotificationAsRead(t){var e;return!!t&&(await(null==(e=this.apiClient)?void 0:e.notificationsApi.patchNotificationsById(mapParametersToPatchNotificationRequest(t,"read")).catch(t=>(handleError(t,!1),!1))),!0)}async DeleteNotification(t){let e,i=!1;return t&&await(null==(e=this.apiClient)?void 0:e.notificationsApi.deleteNotificationsById(mapParametersToDeleteNotificationRequest(t)).catch(t=>{handleError(t,!1),i=!1}).then(()=>{i=!0})),i}ReduceUnreadNotificationCount(){0<this.unreadNotificationCount&&--this.unreadNotificationCount}}let NotificationsState=new NotificationState,NotificationsStyle=css`:host{--ix-drawer-border-radius:0;--ix-drawer-padding:0;--ix-drawer-width-sm:320px;--ix-drawer-width-md:320px;--ix-drawer-width-lg:400px}.destructive-icon{color:var(--clr-critical,#db0028);--md-icon-button-icon-color:var(--clr-critical, #DB0028);--md-sys-color-on-surface-variant:var(--clr-critical, #DB0028)}.destructive-icon path{fill:var(--clr-critical,#db0028)}.active-icon{color:var(--clr-primary,#1456e0);--md-icon-button-icon-color:var(--clr-primary, #1456E0);--md-sys-color-on-surface-variant:var(--clr-primary, #1456E0)}.active-icon path{fill:var(--clr-primary,#1456e0)}.inactive-icon{color:var(--clr-on-surface,#092241);--md-icon-button-icon-color:var(--clr-on-surface, #092241);--md-sys-color-on-surface-variant:var(--clr-on-surface, #092241);cursor:default;opacity:.6}.inactive-icon path{fill:var(--clr-on-surface,#092241);opacity:.6}ix-icon-button.sharp{--md-icon-font:'Material Symbols Sharp'!important}.ix-icon-groups{--ix-icon-font-size:32px;--ix-icon-line-height:32px}.ix-icon-groups ix-icon{color:var(--clr-on-surface,#092241);opacity:.6}.ix-icon-groups ix-icon path{fill:var(--clr-on-surface,#092241)}.datefilter-dropdown-content,.filter-dropdown-content{position:absolute;right:5%;top:3rem;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);z-index:3;transition:box-shadow .3s cubic-bezier(.4,0,.2,1) 0s;border-radius:3px;box-shadow:rgba(0,0,0,.2) 0 5px 5px -3px,rgba(0,0,0,.14) 0 8px 10px 1px,rgba(0,0,0,.12) 0 3px 14px 2px;background-color:var(--clr-surface-container-lowest,#fff)}.unread{font-family:var(--root-primary-font, 'sans-serif');padding:0 5px;font-size:var(--text-caption-size,.75rem);line-height:var(--text-caption-line-height,1.33333333em);left:22px;top:0;background:var(--clr-critical,#db0028);letter-spacing:var(--text-caption-letter-spacing,.03333333em)}.notification-tooltip{background-color:var(--cp-neutral-blue-4,#040d19);white-space:nowrap;font-size:var(--text-caption-size,.75rem);z-index:9999;color:var(--clr-on-secondary,#fff)}.notification-modal-subtitle,.notification-modal-title{color:var(--clr-on-surface,#092241);font-family:var(--root-secondary-font, 'sans-serif')}.notification-modal-subtitle{font-size:var(--text-heading-size,1.25rem);line-height:var(--text-heading-line-height,1.2em)}.notification-modal-content{display:inline-grid;grid-template-columns:fit-content(183px) 1fr;grid-template-rows:auto auto;grid-column-gap:24px;grid-row-gap:8px;font-family:var(--root-primary-font, 'sans-serif');font-size:var(--text-default-size,16px);line-height:28px;width:560px;padding-bottom:16px;color:var(--clr-on-surface,#092241)}.notification-modal-content-title{width:183px;color:var(--clr-on-surface-variant,#092241B3)}.notification-modal-subject-title{grid-area:1/1/2/2}.notification-modal-subject-text{grid-area:1/2/2/3}.notification-modal-created-date-title{grid-area:2/1/3/2}.notification-modal-created-date-text{grid-area:2/2/3/3}.notification-modal-site-title{grid-area:3/1/4/2}.notification-modal-site-text{grid-area:3/2/4/3}`,ConfirmationDialog=class extends MobxLitElement{constructor(){super(...arguments),this.textMessage="Are you sure?",this.open=!1,this.dialogClosed=()=>{this.dispatchEvent(new CustomEvent("confirm-dialog-closed")),this.onClick(!1)}}static get styles(){return[TWStyles,NotificationsStyle]}onClick(t){t=new CustomEvent("on-confirm-selection",{detail:{returnValue:t},bubbles:!0,composed:!0});this.dispatchEvent(t)}render(){return html`<ix-dialog ?open="${this.open}" class="w-[580px]" @closed="${this.dialogClosed}"><div slot="headline">${this.textMessage}</div><div slot="actions"><div class="flex flex-row justify-end p-1"><ix-button name="cancel" appearance="text" @click="${()=>this.onClick(!1)}">DISMISS</ix-button><ix-button name="confirm" appearance="text" @click="${()=>this.onClick(!0)}">YES</ix-button></div></div></ix-dialog>`}},ViewItemDialog=(__decorate([property({type:String,attribute:!0})],ConfirmationDialog.prototype,"textMessage",void 0),__decorate([property({type:Boolean,attribute:!0})],ConfirmationDialog.prototype,"open",void 0),ConfirmationDialog=__decorate([customElement("confirmation-dialog")],ConfirmationDialog),class extends MobxLitElement{constructor(){super(...arguments),this.notification={},this.open=!1,this.dialogClosed=()=>{this.dispatchEvent(new CustomEvent("view-item-dialog-closed"))},this.viewRecord=()=>{this.dialogClosed(),NotificationsState.showDrawer=!1}}static get styles(){return[TWStyles,NotificationsStyle]}getUrl(){var t=this.notification.resourceId;switch(this.notification.resourceType){case NotificationGroups.PLANNED_MAINTENANCE:return"/service-management/reports?ticketId="+t;case NotificationGroups.SERVICE_TICKETS:switch(this.notification.subGroup){case SubGroups.Remote_Hands:return"/service-management/service-tickets/remote-hands/"+t;case SubGroups.Customer_Care:return"/service-management/service-tickets/customer-care/"+t;case SubGroups.Deliveries:return`/service-management/service-tickets/${SubGroups.Deliveries}/`+t;case SubGroups.Facility_Access:return"/service-management/service-tickets/facility-access/"+t;case SubGroups.Removals:return"/service-management/service-tickets/removals/"+t;case SubGroups.Trouble_Ticket:return"/service-management/service-tickets/trouble-tickets/"+t;case SubGroups.FacilityAccessVisitorAccess:return"/service-management/service-tickets/facility-access/visitor-access/"+t;case SubGroups.FacilityAccessPermanentBadge:return"/service-management/service-tickets/facility-access/permanent-badge/"+t;case SubGroups.FacilityAccessOspAccess:return"/service-management/service-tickets/facility-access/osp-access/"+t;case SubGroups.FacilityAccessPopPoeAccess:return"/service-management/service-tickets/facility-access/pop-poe-access/"+t;default:return""}case NotificationGroups.INCIDENTS:return"/service-management/reports?ticketId="+t;case NotificationGroups.DCIM_ALERTS:return"/dcim/"+t;default:return""}}getLocation(){return void 0===this.notification.locations||this.notification.locations.length<1?"":1<this.notification.locations.length?"Multiple Sites":this.notification.locations[0]}getSubGroupDisplayName(){switch(this.notification.subGroup){case SubGroups.FacilityAccessVisitorAccess:case SubGroups.FacilityAccessPermanentBadge:case SubGroups.FacilityAccessOspAccess:case SubGroups.FacilityAccessPopPoeAccess:return"Facility Access";case"Incidents (GSN)":return"Incidents";case"Emergency Repairs (InSite 1.0)":return"Emergency Repairs";default:return this.notification.subGroup}}render(){return html`<ix-dialog ?open="${this.open}" @closed="${this.dialogClosed}" class="notification-modal" data-testclass="notification-modal"><div slot="headline" class="w-[560px]"><div class="flex flex-col flex-start"><div class="notification-modal-title text-2xl font-bold text-balance">${this.notification.resourceType}</div><div class="notification-modal-subtitle pt-4 pb-0 font-bold text-balance">${this.getSubGroupDisplayName()}</div></div></div><form class="notification-modal-content" slot="content" id="form-id" method="dialog"><div class="notification-modal-content-title notification-modal-subject-title">Subject</div><div class="notification-modal-subject-text font-normal text-wrap">${this.notification.subject}</div><div class="notification-modal-content-title notification-modal-created-date-title">Create Date</div><div class="notification-modal-created-date-text font-normal text-wrap">${format(new Date(this.notification.createdAt),"dd/MM/yyyy HH:mm:ss")}</div><div class="notification-modal-content-title notification-modal-site-title">Site</div><div class="notification-modal-site-text font-normal text-wrap">${this.getLocation()}</div></form><div slot="actions" class="flex flex-row flex-end"><ix-button data-testclass="close-item-modal" form="form-id" appearance="text">Close</ix-button><ix-button data-testclass="view-record" href="${this.getUrl()}" @click="${this.viewRecord}" appearance="text">View Record</ix-button></div></ix-dialog>`}}),NotificationItem=(__decorate([property({type:Object,attribute:!1})],ViewItemDialog.prototype,"notification",void 0),__decorate([property({type:Boolean,attribute:!0})],ViewItemDialog.prototype,"open",void 0),ViewItemDialog=__decorate([customElement("view-item-dialog")],ViewItemDialog),class extends MobxLitElement{constructor(){super(...arguments),this.disabled=!1,this.read=!1,this.notification={},this.showModal=!1,this.showDeleteConfirmation=!1}static get styles(){return[TWStyles,NotificationsStyle]}displayItem(){this.notification.status===NotificationStatus.UNREAD&&(NotificationsState.setNotificationReadStatus(this.notification.id),this.read=!0),this.showModal=!0}deleteItem(){this.disabled||(this.showDeleteConfirmation=!0)}confirmedDelete(t){t.detail.returnValue&&NotificationsState.setNotificationDeleted(this.notification.id).then(t=>{this.showDeleteResultMessage(t,this.notification.id)}),this.showDeleteConfirmation=!1}showDeleteResultMessage(t,e){window.dispatchEvent(new CustomEvent("add-toast",{detail:{id:e,content:html`<ix-message-toast data-testid="notification-delete-toast" toastId="${e}" .TMessageToast="${t.State.toLowerCase()}" forceClose>${t.Message}</ix-message-toast>`,autoClose:2e3,durationOut:2e3,vertical:"bottom",horizontal:"center",animated:!0,above:!1}}))}calculateDuration(){return void 0!==this.notification.createdAt?differenceInHours(new Date,new Date(this.notification.createdAt))<24?formatDistance(new Date(this.notification.createdAt),new Date,{addSuffix:!0}):html`<ix-date type="static" variant="date-time" .value="${this.notification.createdAt}"></ix-date>`:"N/A"}getNotificationIcon(){switch(this.notification.resourceType){case NotificationGroups.PLANNED_MAINTENANCE:return plannedMaintenance;case NotificationGroups.SERVICE_TICKETS:return"sync_saved_locally";case NotificationGroups.INCIDENTS:return"report";case NotificationGroups.DCIM_ALERTS:return dcim;default:return"sync_saved_locally"}}getNotificationTitle(){switch(this.notification.resourceType){case NotificationGroups.PLANNED_MAINTENANCE:return"Planned Maintenance";case NotificationGroups.SERVICE_TICKETS:return this.getServiceTicketSubGroup()+" Service Ticket Update";case NotificationGroups.INCIDENTS:return"Emergency Repair";case NotificationGroups.DCIM_ALERTS:return"DCIM Alert";default:return"sync_saved_locally"}}getServiceTicketSubGroup(){var t,e;switch(null==(t=this.notification)?void 0:t.subGroup){case SubGroups.FacilityAccessVisitorAccess:case SubGroups.FacilityAccessPermanentBadge:case SubGroups.FacilityAccessOspAccess:case SubGroups.FacilityAccessPopPoeAccess:return"Facility Access";default:return null==(e=this.notification)?void 0:e.subGroup}}render(){return html`<div data-testid="notification-item" class="relative notification-item"><div class="hover:bg-[rgba(0,0,0,0.04)] p-2 pl-3.5 flex gap-3 relative cursor-pointer items-center font-bold ${this.read?"notification-item-read border-l-3 border-transparent":"notification-item-unread border-l-3 border-success"}"><ix-icon style="--ix-icon-font-size:24px;--ix-icon-line-height:24px" icon="${this.getNotificationIcon()}" class="${this.read?"inactive-icon":"active-icon"}" @click="${this.displayItem}">${this.getNotificationIcon()}</ix-icon><div class="flex flex-col grow" @click="${this.displayItem}"><div class="grow text-base"><h2 class="dlr-text-caption">${this.getNotificationTitle()}</h2></div><div class="grow text-xs"><h3 class="dlr-text-caption text-on-surface-disabled">${this.calculateDuration()}</h3></div></div><div><view-item-dialog ?open="${this.showModal}" .notification="${this.notification}" @view-item-dialog-closed="${()=>{this.showModal=!1}}"></view-item-dialog><confirmation-dialog ?open="${this.showDeleteConfirmation}" @on-confirm-selection="${this.confirmedDelete}" @confirm-dialog-closed="${()=>{this.showModal=!1}}" textMessage="Are you sure you want to delete this notification?" data-testclass="notification-delete-confirmation"></confirmation-dialog></div><ix-icon-button style="--md-icon-button-icon-size:24px" data-testclass="delete-notification" @click="${this.deleteItem}" @mouseover="${t=>{this.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:this.disabled?"Emergency Repair Notification cannot be removed":"Remove Notification",target:t.target}}))}}" @mouseout="${()=>this.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" ?disabled="${this.disabled}"><ix-icon slot="default" class="${this.disabled?"inactive-icon":"destructive-icon"}">${trash}</ix-icon></ix-icon-button></div></div>`}}),GroupedItem=(__decorate([property({type:Boolean})],NotificationItem.prototype,"disabled",void 0),__decorate([property({type:Boolean})],NotificationItem.prototype,"read",void 0),__decorate([property({type:Object,attribute:!1})],NotificationItem.prototype,"notification",void 0),__decorate([state()],NotificationItem.prototype,"showModal",void 0),__decorate([state()],NotificationItem.prototype,"showDeleteConfirmation",void 0),NotificationItem=__decorate([customElement("notification-item")],NotificationItem),class extends MobxLitElement{constructor(){super(...arguments),this.groupTitle="Group 1",this.groupIcon="public",this.childItems=NotificationsState.notifications,this.isOpen=!1,this.onClick=()=>{this.isOpen=!this.isOpen}}static get styles(){return[TWStyles,NotificationsStyle]}renderNotificationItems(){var t;return this.isOpen?void 0!==(null==(t=this.childItems)?void 0:t.length)&&0<(null==(t=this.childItems)?void 0:t.length)?html`<div>${null==(t=this.childItems)?void 0:t.map(t=>html`<notification-item .notification="${t}" ?disabled="${t.resourceType===NotificationGroups.INCIDENTS}"></notification-item>`)}</div>`:html`<p class="dlr-text-caption ml-14 font-bold mr-4">No notifications yet.</p>`:html`${nothing}`}render(){var t;return html`<div class="group-container-row border-b border-outline py-3"><div class="flex items-center justify-between"><div class="flex items-center align-middle"><ix-icon-button icon="${this.isOpen?"arrow_drop_down":"arrow_right"}" @click="${this.onClick}" data-testclass="grouped-item-toggle-expand"></ix-icon-button><ix-icon slot="default" class="ix-icon-groups">${unsafeSVG(this.groupIcon)}</ix-icon><p class="m-0 group-name font-bold pl-1">${this.groupTitle}</p><p class="m-0 pl-4">${null==(t=this.childItems)?void 0:t.length.toString().padStart(2,"0")}</p></div></div>${this.renderNotificationItems()}</div>`}}),GroupFilters=(__decorate([property({type:String,attribute:!0})],GroupedItem.prototype,"groupTitle",void 0),__decorate([property({type:String,attribute:!0})],GroupedItem.prototype,"groupIcon",void 0),__decorate([property({type:Array,attribute:!0})],GroupedItem.prototype,"childItems",void 0),__decorate([state()],GroupedItem.prototype,"isOpen",void 0),GroupedItem=__decorate([customElement("grouped-item")],GroupedItem),class extends MobxLitElement{static get styles(){return[TWStyles,NotificationsStyle]}onSwitchChange(t){var t=t.target,e=null==(e=t.attributes.getNamedItem("name"))?void 0:e.value;NotificationsState.setNotificationFilter(e,t.selected),this.requestUpdate()}render(){return html`<div class="flex flex-col"><label class="whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle"><ix-switch data-testid="planned-maintenance-switch" class="flex" name="${NotificationGroups.PLANNED_MAINTENANCE}" selected="${NotificationsState.notificationFilters.SHOW_PLANNED_MAINTENANCE}" @change="${this.onSwitchChange}"></ix-switch><span>Planned Maintenance</span></label> <label class="whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle"><ix-switch data-testid="service-tickets-switch" class="flex" name="${NotificationGroups.SERVICE_TICKETS}" selected="${NotificationsState.notificationFilters.SHOW_SERVICE_TICKETS}" @change="${this.onSwitchChange}"></ix-switch><span>Service Ticket Updates</span></label> <label class="whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle"><ix-switch data-testid="dcim-alerts-switch" class="flex" name="${NotificationGroups.DCIM_ALERTS}" selected="${NotificationsState.notificationFilters.SHOW_DCIM_ALERTS}" @change="${this.onSwitchChange}"></ix-switch><span>${NotificationGroups.DCIM_ALERTS}</span></label></div>`}}),DateFilters=(GroupFilters=__decorate([customElement("group-filters")],GroupFilters),class extends MobxLitElement{constructor(){super(...arguments),this.fromDate=isNullOrUndefinedOrEmpty(NotificationsState.dateFilters.FROM_DATE)?void 0:format(NotificationsState.dateFilters.FROM_DATE,DefaultDateFormat),this.toDate=isNullOrUndefinedOrEmpty(NotificationsState.dateFilters.TO_DATE)?void 0:format(NotificationsState.dateFilters.TO_DATE,DefaultDateFormat),this.maxDate=format(new Date,DefaultDateFormat),this.fromDateErrorText="",this.toDateErrorText=""}static get styles(){return[TWStyles,NotificationsStyle]}onFromDateChange(t){null===t||""===t?this.fromDate=void 0:(this.fromDate=t,void 0!==this.fromDate&&(this.fromDateErrorText=void 0))}onToDateChange(t){null===t||""===t?this.toDate=void 0:(this.toDate=t,void 0!==this.toDate&&(this.toDateErrorText=void 0))}onApplyDateFilter(t){if(t){if(void 0===this.toDate&&void 0!==this.fromDate)return void(this.toDateErrorText="Please select to date");if(void 0===this.fromDate&&void 0!==this.toDate)return void(this.fromDateErrorText="Please select from date");if(this.fromDate>this.toDate)return this.fromDateErrorText="From date cannot be later than To date.",void(this.fromDate=void 0);if(this.fromDateErrorText=void 0,this.toDate<this.fromDate)return this.toDateErrorText="To date cannot be earlier than From date.",void(this.toDate=void 0);this.toDateErrorText=void 0}t=t&&void 0===this.toDateErrorText&&void 0===this.fromDateErrorText,t&&(NotificationsState.setNotificationDateFilter(this.fromDate,this.toDate),this.requestUpdate()),t=new CustomEvent("on-selection",{detail:{returnValue:t},bubbles:!0,composed:!0});this.dispatchEvent(t)}clearDateFilters(){this.fromDate=void 0,this.toDate=void 0,this.fromDateErrorText=void 0,this.toDateErrorText=void 0}render(){return html`<div class="flex flex-col p-4"><div class="flex flex-row items-center"><div class="grow items-center text-xl font-bold">Filter by Date</div><div class="flex flex-row items-center" @click="${this.clearDateFilters}"><label class="grow text-sm text-right pr-1 cursor-pointer">Clear Filter</label><ix-icon-button data-testid="notifications-clear-date-filter" small appearance="default" icon="domain_verification_off" class="active-icon"></ix-icon-button></div></div><ix-divider class="my-2"></ix-divider><div class="flex xl:flex-row lg:flex-col md:flex-col sm:flex-col justify-between item-center my-4"><div class="flex gap-2"><ix-date data-testid="notifications-from-date" .value="${this.fromDate}" max="${this.maxDate}" label="From" name="FromDate" .errorText="${this.fromDateErrorText}" .onChanged="${t=>this.onFromDateChange(t)}"></ix-date><ix-date data-testid="notifications-to-date" .value="${this.toDate}" max="${this.maxDate}" label="To" name="ToDate" .errorText="${this.toDateErrorText}" .onChanged="${t=>this.onToDateChange(t)}"></ix-date></div></div><div class="flex flex-row justify-between"><ix-button data-testid="notifications-cancel-date-filter" type="" target="" appearance="text" @click="${()=>this.onApplyDateFilter(!1)}">Cancel</ix-button><ix-button data-testid="notifications-activate-date-filter" type="" target="" appearance="text" @click="${()=>this.onApplyDateFilter(!0)}">Filter List</ix-button></div></div>`}}),NotificationTooltip=(__decorate([state()],DateFilters.prototype,"fromDate",void 0),__decorate([state()],DateFilters.prototype,"toDate",void 0),__decorate([state()],DateFilters.prototype,"maxDate",void 0),__decorate([state()],DateFilters.prototype,"fromDateErrorText",void 0),__decorate([state()],DateFilters.prototype,"toDateErrorText",void 0),DateFilters=__decorate([customElement("date-filters")],DateFilters),class extends MobxLitElement{constructor(){super(...arguments),this.isVisible=!1,this.label="",this.hoveredElement=void 0,this.configureNotificationTooltip=t=>{var{label:t,target:e}=t.detail;this.hoveredElement=e,this.label=t,this.isVisible=!0},this.hideNotificationTooltip=()=>{this.isVisible=!1,this.hoveredElement=void 0,this.label=""}}static get styles(){return[TWStyles,NotificationsStyle]}connectedCallback(){super.connectedCallback(),window.addEventListener("show-notification-tooltip",this.configureNotificationTooltip),window.addEventListener("hide-notification-tooltip",this.hideNotificationTooltip)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("show-notification-tooltip",this.configureNotificationTooltip),window.removeEventListener("hide-notification-tooltip",this.hideNotificationTooltip)}updated(t){t.has("hoveredElement")&&this.isVisible&&this.hoveredElement&&computePosition(this.hoveredElement,this.notificationTooltip,{placement:"bottom-end"}).then(({x:t,y:e})=>{this.notificationTooltip.style.left=t+"px",this.notificationTooltip.style.top=e+12+"px"})}render(){var t={hidden:!this.isVisible};return html`<div class="notification-tooltip z-[9999] rounded absolute p-2 white-text ${classMap(t)}">${this.label}</div><slot></slot>`}});__decorate([query(".notification-tooltip")],NotificationTooltip.prototype,"notificationTooltip",void 0),__decorate([property({type:Boolean,reflect:!0})],NotificationTooltip.prototype,"isVisible",void 0),__decorate([property({type:String,reflect:!0})],NotificationTooltip.prototype,"label",void 0),__decorate([state()],NotificationTooltip.prototype,"hoveredElement",void 0),NotificationTooltip=__decorate([customElement("notification-tooltip")],NotificationTooltip);class IxNotifications extends MobxLitElement{constructor(){super(...arguments),this.showGroupedView=!1,this.showFilters=!1,this.showDateFilters=!1,this.showMarkAllReadConfirmation=!1,this.baseApiUrl="",this.localStorageKey=""}async firstUpdated(){NotificationsState.baseApiUrl=this.baseApiUrl,NotificationsState.localStorageKey=this.localStorageKey,NotificationsState.ConstructApiClient()}connectedCallback(){super.connectedCallback(),window.addEventListener("account-switched",NotificationsState.NewApiClient),window.addEventListener("ix-notifications-toggle-drawer",this.toggleDrawer),window.addEventListener("beforeunload",this.handleOnbeforeunload)}disconnectedCallback(){super.disconnectedCallback(),this.handleOnbeforeunload(),window.removeEventListener("account-switched",NotificationsState.NewApiClient),window.removeEventListener("ix-notifications-toggle-drawer",this.toggleDrawer),window.removeEventListener("beforeunload",this.handleOnbeforeunload)}handleOnbeforeunload(){NotificationsState.clearStoredNotificationsData()}toggleDrawer(){NotificationsState.showDrawer=!NotificationsState.showDrawer,NotificationsState.showDrawer||(this.showFilters=!1,this.showDateFilters=!1)}markAllread(){0<NotificationsState.unreadNotificationCount&&(this.showMarkAllReadConfirmation=!0)}confirmedMarkAllRead(t){if(t.detail.returnValue){var t=this.applyNotificationFilters(),i=null==t?void 0:t.filter(t=>t.status===NotificationStatus.UNREAD);if(0<i.length){let e=!0;null!=t&&t.forEach(t=>{NotificationsState.setNotificationReadStatus(t.id).then(t=>{e=e&&t})});t={State:!0===e?ApiCallState.SUCCESS:ApiCallState.ERROR,Message:!0===e?"Successfully marked all the notifications as read":"Error while marking the notifications read, Please try again"};this.showResultMessage(t,i[0].id),this.requestUpdate()}}this.showMarkAllReadConfirmation=!1}showResultMessage(t,e){window.dispatchEvent(new CustomEvent("add-toast",{detail:{id:e,content:html`<ix-message-toast data-testid="notification-read-all-toast" toastId="${e}" .TMessageToast="${t.State.toLowerCase()}" forceClose>${t.Message}</ix-message-toast>`,autoClose:3e3,durationOut:3e3,vertical:"bottom",horizontal:"center",animated:!0,above:!1}}))}toggleGroupView(){this.showGroupedView=!this.showGroupedView}displayFilters(){this.showFilters=!this.showFilters}applyNotificationFilters(){var t=null==(t=NotificationsState.notifications)?void 0:t.filter(t=>t.resourceType===NotificationGroups.PLANNED_MAINTENANCE&&!0===NotificationsState.notificationFilters.SHOW_PLANNED_MAINTENANCE||t.resourceType===NotificationGroups.SERVICE_TICKETS&&!0===NotificationsState.notificationFilters.SHOW_SERVICE_TICKETS||t.resourceType===NotificationGroups.DCIM_ALERTS&&!0===NotificationsState.notificationFilters.SHOW_DCIM_ALERTS||t.resourceType===NotificationGroups.INCIDENTS);return void 0!==NotificationsState.dateFilters.FROM_DATE&&void 0!==NotificationsState.dateFilters.TO_DATE?t.filter(t=>0<=differenceInHours(new Date(t.createdAt),NotificationsState.dateFilters.FROM_DATE)&&differenceInDays(new Date(t.createdAt),NotificationsState.dateFilters.TO_DATE)<=0):void 0!==NotificationsState.dateFilters.FROM_DATE&&void 0===NotificationsState.dateFilters.TO_DATE?t.filter(t=>0<=differenceInHours(new Date(t.createdAt),NotificationsState.dateFilters.FROM_DATE)):void 0===NotificationsState.dateFilters.FROM_DATE&&void 0!==NotificationsState.dateFilters.TO_DATE?t.filter(t=>differenceInDays(new Date(t.createdAt),NotificationsState.dateFilters.TO_DATE)<=0):t}displayDateFilters(){this.showDateFilters=!this.showDateFilters}renderGroupedView(){var t=this.applyNotificationFilters();return html`<div class="-mx-4 -mt-2"><grouped-item data-testid="planned-maintenance-group" groupTitle="Planned Maintenance" groupIcon="${plannedMaintenance.strings[0]}" .childItems="${null==t?void 0:t.filter(t=>t.resourceType===NotificationGroups.PLANNED_MAINTENANCE)}"></grouped-item><grouped-item data-testid="emergency-repairs-group" groupTitle="Emergency Repairs" groupIcon="report" .childItems="${null==t?void 0:t.filter(t=>t.resourceType===NotificationGroups.INCIDENTS)}"></grouped-item><grouped-item data-testid="service-ticket-updates-group" groupTitle="Service Ticket Updates" groupIcon="sync_saved_locally" .childItems="${null==t?void 0:t.filter(t=>t.resourceType===NotificationGroups.SERVICE_TICKETS)}"></grouped-item><grouped-item data-testid="dcim-alerts-group" groupTitle="${NotificationGroups.DCIM_ALERTS}" groupIcon="${dcim.strings[0]}" .childItems="${null==t?void 0:t.filter(t=>t.resourceType===NotificationGroups.DCIM_ALERTS)}"></grouped-item></div>`}renderDefaultView(){var t=this.applyNotificationFilters(),e=t.filter(t=>0===differenceInDays(new Date(t.createdAt),new Date)),i=t.filter(t=>0!==differenceInDays(new Date(t.createdAt),new Date));return 0<(null==t?void 0:t.length)?html`<h3>Today</h3>${0<e.length?html`<div class="-mx-4">${null==e?void 0:e.map(t=>html`<notification-item ?read="${t.status!==NotificationStatus.UNREAD}" data-testclass="today-notification" .notification="${t}" ?disabled="${t.resourceType===NotificationGroups.INCIDENTS}"></notification-item>`)}</div>`:this.renderNoResult()}<h3>Earlier</h3>${0<i.length?html`<div class="-mx-4">${null==i?void 0:i.map(t=>html`<notification-item ?read="${t.status!==NotificationStatus.UNREAD}" data-testclass="earlier-notification" .notification="${t}" ?disabled="${t.resourceType===NotificationGroups.INCIDENTS}"></notification-item>`)}</div>`:this.renderNoResult()}`:html`<h3>Today</h3>${this.renderNoResult()}`}renderNoResult(){return html`<p class="dlr-text-caption my-4"><strong>No notifications yet.</strong></p>`}handleCloseClick(t){this.showDateFilters=!1,this.showFilters=!1}handleContentScroll(t){null!==t&&t.detail.scrollTop+t.detail.clientHeight>=t.detail.scrollHeight-2&&NotificationsState.getNotifications()}manageFilterVisibility(t){t=t.composedPath();!this.showFilters||t.includes(this.groupFilters)||t.includes(this.groupFiltersButton)||(this.showFilters=!1),!this.showDateFilters||t.includes(this.dateFilters)||t.includes(this.dateFiltersButton)||(this.showDateFilters=!1)}render(){return html`<notification-tooltip data-testid="notifications-tooltip"></notification-tooltip><confirmation-dialog data-testid="notifications-confirm-read-dialog" ?open="${this.showMarkAllReadConfirmation}" @confirm-dialog-closed="${()=>{this.showMarkAllReadConfirmation=!1}}" @on-confirm-selection="${this.confirmedMarkAllRead}" textMessage="Are you sure you want to mark all notifications as read?"></confirmation-dialog><ix-drawer data-testid="notifications-drawer" ?isVisible="${NotificationsState.showDrawer}" .onClosed="${()=>this.toggleDrawer()}" animate-vertical hide-close @on-content-scroll="${this.handleContentScroll}" @click="${this.manageFilterVisibility}" compact="compact"><div slot="content" class="m-4"><div class="flex flex-row justify-between grow items-center notification-header-container mb-4"><h2 data-testid="notifications-heading" class="grow items-center dlr-text-heading">Notifications</h2><div class="flex flex-row justify-end grow items-center options" style="--md-icon-button-icon-size:24px"><ix-icon-button data-testid="notifications-cta-all-read" data-testclass="notifications-cta" @click="${this.markAllread}" @mouseover="${t=>{0<NotificationsState.unreadNotificationCount&&window.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:"Mark All Read",target:t.target}}))}}" @mouseout="${()=>window.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" icon="markunread_mailbox" class="${NotificationsState.unreadNotificationCount<=0?"inactive-icon":"active-icon"}" .disabled="${NotificationsState.unreadNotificationCount<=0}" filledIcon="true"></ix-icon-button><ix-icon-button data-testid="notifications-cta-sort-type" data-testclass="notifications-cta" @click="${this.toggleGroupView}" @mouseover="${t=>{window.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:"Sort by Type",target:t.target}}))}}" @mouseout="${()=>window.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" class="active-icon" label="Sort by Type"><ix-icon slot="default">${this.showGroupedView?sortCheck:"sort"}</ix-icon></ix-icon-button><ix-icon-button data-testid="notifications-cta-filter-type" data-testclass="notifications-cta" @click="${this.displayFilters}" @mouseover="${t=>{window.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:"Filter by Type",target:t.target}}))}}" @mouseout="${()=>window.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" class="active-icon" id="group-filter-button" label="Filter by Type"><ix-icon slot="default">${viewList}</ix-icon></ix-icon-button><div data-testid="notifications-filter-dropdown" class="filter-dropdown-content ${this.showFilters?"active z-50":"hidden"}"><group-filters></group-filters></div><ix-icon-button data-testid="notifications-cta-filter-date" data-testclass="notifications-cta" @click="${this.displayDateFilters}" @mouseover="${t=>{window.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:"Filter by Date",target:t.target}}))}}" @mouseout="${()=>window.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" icon="date_range" class="active-icon" filledIcon="true" id="date-filters-button" label="Filter by Date"></ix-icon-button><div data-testid="notifications-date-filter-dropdown" class="datefilter-dropdown-content ${this.showDateFilters?"active z-50":"hidden"}" @on-selection="${this.handleCloseClick}"><date-filters></date-filters></div></div></div>${this.showGroupedView?this.renderGroupedView():this.renderDefaultView()}</div></ix-drawer>`}}IxNotifications.styles=[TWStyles,NotificationsStyle],__decorate([query("group-filters")],IxNotifications.prototype,"groupFilters",void 0),__decorate([query("ix-icon-button#group-filter-button")],IxNotifications.prototype,"groupFiltersButton",void 0),__decorate([query("date-filters")],IxNotifications.prototype,"dateFilters",void 0),__decorate([query("ix-icon-button#date-filters-button")],IxNotifications.prototype,"dateFiltersButton",void 0),__decorate([state()],IxNotifications.prototype,"showGroupedView",void 0),__decorate([state()],IxNotifications.prototype,"showFilters",void 0),__decorate([state()],IxNotifications.prototype,"showDateFilters",void 0),__decorate([state()],IxNotifications.prototype,"showMarkAllReadConfirmation",void 0),__decorate([property({type:String})],IxNotifications.prototype,"baseApiUrl",void 0),__decorate([property({type:String})],IxNotifications.prototype,"localStorageKey",void 0),window.customElements.define("ix-notifications",IxNotifications);
1
+ import{__decorate}from"tslib";import{svg,css,html,nothing}from"lit";import{property,customElement,state,query}from"lit/decorators.js";import{MobxLitElement}from"@adobe/lit-mobx";import{differenceInDays}from"date-fns/differenceInDays.js";import{differenceInHours}from"date-fns/differenceInHours.js";import"@digital-realty/ix-button/ix-button.js";import"@digital-realty/ix-drawer/ix-drawer.js";import"@digital-realty/ix-icon";import"@material/web/icon/icon.js";import{makeAutoObservable}from"mobx";import{makePersistable,isHydrated,hydrateStore,clearPersistedStore,getPersistedStore}from"mobx-persist-store";import{parse}from"date-fns/parse.js";import{subDays}from"date-fns/subDays.js";import{format}from"date-fns/format.js";import"@digital-realty/ix-icon-button/ix-icon-button.js";import"@digital-realty/ix-icon/ix-icon.js";import{formatDistance}from"date-fns/formatDistance.js";import"@digital-realty/ix-toast/ix-message-toast.js";import{unsafeSVG}from"lit/directives/unsafe-svg.js";import"@digital-realty/ix-switch/ix-switch.js";import"@digital-realty/ix-date/ix-date.js";import"@digital-realty/ix-divider/ix-divider.js";import{computePosition}from"@floating-ui/dom";import{classMap}from"lit/directives/class-map.js";let viewList=svg`<svg viewBox="0 0 24 24"><path d="M3 9H7V5H3V9ZM7 14H3V10H7V14ZM7 19H3V15H7V19ZM20 14H8V10H20V14ZM8 19H20V15H8V19ZM8 9V5H20V9H8Z"/></svg>`,dcim=svg`<svg viewBox="0 0 24 24"><path d="M20 0C17.791 0 16 1.791 16 4C16 6.857 20 11 20 11C20 11 24 6.857 24 4C24 1.791 22.209 0 20 0ZM12 2C6.486 2 2 6.486 2 12C2 17.514 6.486 22 12 22C17.514 22 22 17.514 22 12C22 11.93 21.9912 11.862 21.9902 11.793C21.7532 12.059 21.5575 12.2677 21.4395 12.3887L19.6504 14.3047C19.4484 14.9657 19.1695 15.5919 18.8145 16.1699C18.4985 15.4819 17.806 15 17 15H16V13C16 12.447 15.552 12 15 12H9V10H10C10.552 10 11 9.553 11 9V7.02344L13.0156 7.00781C13.5986 7.00381 14.1175 6.74289 14.4805 6.33789C14.3145 5.89389 14.1875 5.445 14.1035 5L9.99219 5.03125C9.44319 5.03525 9 5.48225 9 6.03125V8H8C7.448 8 7 8.447 7 9V10.1855L4.98047 8.16797C6.34047 5.68697 8.977 4 12 4H14C14 3.397 14.0908 2.81658 14.2578 2.26758C13.5308 2.09858 12.777 2 12 2ZM20 2.57031C20.789 2.57031 21.4297 3.211 21.4297 4C21.4297 4.789 20.789 5.42969 20 5.42969C19.211 5.42969 18.5703 4.789 18.5703 4C18.5703 3.211 19.211 2.57031 20 2.57031ZM4.20703 10.2207L9 15.0137V16C9 17.103 9.897 18 11 18V19.9316C7.06 19.4366 4 16.072 4 12C4 11.388 4.07603 10.7947 4.20703 10.2207ZM10.7793 14H14V16C14 16.553 14.448 17 15 17H17V18.2344C15.875 19.1384 14.502 19.7417 13 19.9297V17C13 16.447 12.552 16 12 16H11V14.5996C11 14.3776 10.9123 14.174 10.7793 14Z"/></svg>`,plannedMaintenance=svg`<svg viewBox="0 0 24 24"><path d="M6 2C4.90575 2 4 2.90575 4 4V20C4 21.0943 4.90575 22 6 22H11V20H6V4H13V9H18V13H20V8L14 2H6ZM12 11V14H15C15 12.343 13.641 11.031 12 11ZM11 12C9.343 12 8 13.343 8 15C8 16.657 9.343 18 11 18C12.657 18 13.969 16.641 14 15H11V12ZM16 15V21H13C13 22.654 14.346 24 16 24H21C22.645 24 24 22.645 24 21V15H16ZM18 17H22V21C22 21.565 21.565 22 21 22C20.449 22 20 21.552 20 21H18V17Z"/></svg>`,trash=svg`<svg viewBox="0 0 24 24"><path d="M15.5 4H19V6H5V4H8.5L9.5 3H14.5L15.5 4ZM8 21C6.9 21 6 20.1 6 19V7H18V19C18 20.1 17.1 21 16 21H8Z"/></svg>`,sortCheck=(svg`<svg viewBox="0 0 24 24"><path d="M11 12C13.21 12 15 10.21 15 8C15 5.79 13.21 4 11 4C8.79 4 7 5.79 7 8C7 10.21 8.79 12 11 12ZM9 17L12 14.06C11.61 14.02 11.32 14 11 14C8.33 14 3 15.34 3 18V20H12L9 17ZM12 17L15.47 20.5L22 13.91L20.6 12.5L15.47 17.67L13.4 15.59L12 17Z"/></svg>`,svg`<svg viewbox="0 0 24 24"><path d="M 3,6 V 8 H 21 V 6 Z M 3,18 H 9 V 16 H 3 Z M 15,13 H 3 v -2 h 12 z"/><rect x="8" y="0.5" width="16" height="16" rx="8"/><path d="M 14.5,10.585 12.415,8.50001 11.705,9.20501 14.5,12 l 6,-5.99999 -0.705,-0.705 z" style="fill:#fff"/></svg>`),TWStyles=css`*,::after,::before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000}*,::after,::before{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}::after,::before{--tw-content:''}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.dlr-text-default,:host,:host :root,:root,html{font-family:var(--root-primary-font);font-size:var(--text-default-size);line-height:var(--text-default-line-height);letter-spacing:var(--text-default-letter-spacing);font-weight:var(--text-default-weight);-webkit-text-decoration:var(--text-default-decoration);text-decoration:var(--text-default-decoration);text-transform:var(--text-default-transform)}.dlr-text-heading{font-family:var(--root-secondary-font);font-size:var(--text-heading-size);line-height:var(--text-heading-line-height);letter-spacing:var(--text-heading-letter-spacing);font-weight:var(--text-heading-weight);-webkit-text-decoration:var(--text-heading-decoration);text-decoration:var(--text-heading-decoration);text-transform:var(--text-heading-transform)}.dlr-text-caption{font-family:var(--root-primary-font);font-size:var(--text-caption-size);line-height:var(--text-caption-line-height);letter-spacing:var(--text-caption-letter-spacing);font-weight:var(--text-caption-weight);-webkit-text-decoration:var(--text-caption-decoration);text-decoration:var(--text-caption-decoration);text-transform:var(--text-caption-transform)}.visible{visibility:visible}.collapse{visibility:collapse}.static{position:static}.absolute{position:absolute}.relative{position:relative}.-start-0{inset-inline-start:0}.z-50{z-index:50}.z-\\[9999\\]{z-index:9999}.m-0{margin:0}.m-4{margin:1rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.-mt-2{margin-top:-.5rem}.mb-4{margin-bottom:1rem}.ml-14{margin-left:3.5rem}.mr-4{margin-right:1rem}.block{display:block}.flex{display:flex}.table{display:table}.contents{display:contents}.hidden{display:none}.w-\\[560px\\]{width:560px}.w-\\[580px\\]{width:580px}.flex-grow{flex-grow:1}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.whitespace-nowrap{white-space:nowrap}.text-wrap{text-wrap:wrap}.text-balance{text-wrap:balance}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l-3{border-left-width:3px}.border-outline{border-color:var(--cp-neutral-blue-12p)}.border-success{border-color:var(--cp-success-50)}.border-transparent{border-color:transparent}.fill-primary{fill:var(--cp-dlr-blue-50)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pb-0{padding-bottom:0}.pl-1{padding-left:.25rem}.pl-3{padding-left:.75rem}.pl-3\\.5{padding-left:.875rem}.pl-4{padding-left:1rem}.pr-1{padding-right:.25rem}.pt-4{padding-top:1rem}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-normal{font-weight:400}.text-on-surface-disabled{color:var(--cp-neutral-blue-50p)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.outline{outline-style:solid}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:150ms}.hover\\:bg-\\[rgba\\(0\\2c 0\\2c 0\\2c 0\\.04\\)\\]:hover{background-color:rgba(0,0,0,.04)}.hover\\:bg-primary-subtle:hover{background-color:var(--cp-dlr-blue-10p)}@media (min-width:600px){.sm\\:flex-col{flex-direction:column}.md\\:flex-col{flex-direction:column}}@media (min-width:1200px){.lg\\:flex-col{flex-direction:column}.xl\\:flex-row{flex-direction:row}}`;var NotificationStatus,NotificationGroups,SubGroups,ApiCallState;(t=>{t.READ="read",t.UNREAD="unread"})(NotificationStatus=NotificationStatus||{}),(t=>{t.PLANNED_MAINTENANCE="Planned Maintenance",t.INCIDENTS="Incidents",t.DCIM_ALERTS="DCIM Alerts",t.SERVICE_TICKETS="Service Tickets"})(NotificationGroups=NotificationGroups||{}),(t=>{t.Remote_Hands="Remote Hands",t.Deliveries="Deliveries",t.Removals="Removals",t.Facility_Access="Facility Access",t.Trouble_Ticket="Trouble Ticket",t.Customer_Care="Customer Care",t.FacilityAccessVisitorAccess="FacilityAccessVisitorAccess",t.FacilityAccessPermanentBadge="FacilityAccessPermanentBadge",t.FacilityAccessOspAccess="FacilityAccessOspAccess",t.FacilityAccessPopPoeAccess="FacilityAccessPopPoeAccess"})(SubGroups=SubGroups||{}),(t=>{t.LOADING="Loading",t.ERROR="Error",t.SUCCESS="Success"})(ApiCallState=ApiCallState||{});let DefaultDateFormat="yyyy-MM-dd",DefaultDisplayDays=30,DefaultDateTimeFormat="yyyy-MM-dd HH:mm:ss",BASE_PATH="http://api.digitalrealty.com/notifications".replace(/\/+$/,"");class Configuration{constructor(t={}){this.configuration=t}set config(t){this.configuration=t}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:BASE_PATH}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||querystring}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let t=this.configuration.apiKey;if(t)return"function"==typeof t?t:()=>t}get accessToken(){let t=this.configuration.accessToken;if(t)return"function"==typeof t?t:async()=>t}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}let DefaultConfig=new Configuration;class BaseAPI{constructor(t=DefaultConfig){this.configuration=t,this.fetchApi=async(t,e)=>{let i={url:t,init:e};for(var o of this.middleware)o.pre&&(i=await o.pre({fetch:this.fetchApi,...i})||i);let a=void 0;try{a=await(this.configuration.fetchApi||fetch)(i.url,i.init)}catch(t){for(var r of this.middleware)r.onError&&(a=await r.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:t,response:a?a.clone():void 0})||a);if(void 0===a)throw t instanceof Error?new FetchError(t,"The request failed and the interceptors did not return an alternative response"):t}for(var n of this.middleware)n.post&&(a=await n.post({fetch:this.fetchApi,url:i.url,init:i.init,response:a.clone()})||a);return a},this.middleware=t.middleware}withMiddleware(...t){var e=this.clone();return e.middleware=e.middleware.concat(...t),e}withPreMiddleware(...t){t=t.map(t=>({pre:t}));return this.withMiddleware(...t)}withPostMiddleware(...t){t=t.map(t=>({post:t}));return this.withMiddleware(...t)}isJsonMime(t){return!!t&&BaseAPI.jsonRegex.test(t)}async request(t,e){var{url:t,init:e}=await this.createFetchParams(t,e),t=await this.fetchApi(t,e);if(t&&200<=t.status&&t.status<300)return t;throw new ResponseError(t,"Response returned an error code")}async createFetchParams(t,e){let i=this.configuration.basePath+t.path,o=(void 0!==t.query&&0!==Object.keys(t.query).length&&(i+="?"+this.configuration.queryParamsStringify(t.query)),Object.assign({},this.configuration.headers,t.headers));Object.keys(o).forEach(t=>void 0===o[t]?delete o[t]:{});var a="function"==typeof e?e:async()=>e,r={method:t.method,headers:o,body:t.body,credentials:this.configuration.credentials},a={...r,...await a({init:r,context:t})};let n;n=!(isFormData(a.body)||a.body instanceof URLSearchParams||isBlob(a.body))&&this.isJsonMime(o["Content-Type"])?JSON.stringify(a.body):a.body;r={...a,body:n};return{url:i,init:r}}clone(){var t=new this.constructor(this.configuration);return t.middleware=this.middleware.slice(),t}}function isBlob(t){return"undefined"!=typeof Blob&&t instanceof Blob}function isFormData(t){return"undefined"!=typeof FormData&&t instanceof FormData}BaseAPI.jsonRegex=new RegExp("^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$","i");class ResponseError extends Error{constructor(t,e){super(e),this.response=t,this.name="ResponseError"}}class FetchError extends Error{constructor(t,e){super(e),this.cause=t,this.name="FetchError"}}class RequiredError extends Error{constructor(t,e){super(e),this.field=t,this.name="RequiredError"}}let COLLECTION_FORMATS={csv:","};function exists(t,e){t=t[e];return null!=t}function querystring(e,i=""){return Object.keys(e).map(t=>querystringSingleKey(t,e[t],i)).filter(t=>0<t.length).join("&")}function querystringSingleKey(t,e,i=""){var o,a=i+(i.length?`[${t}]`:t);return e instanceof Array?(o=e.map(t=>encodeURIComponent(String(t))).join(`&${encodeURIComponent(a)}=`),encodeURIComponent(a)+"="+o):e instanceof Set?querystringSingleKey(t,Array.from(e),i):e instanceof Date?encodeURIComponent(a)+"="+encodeURIComponent(e.toISOString()):e instanceof Object?querystring(e,a):encodeURIComponent(a)+"="+encodeURIComponent(String(e))}class JSONApiResponse{constructor(t,e=t=>t){this.raw=t,this.transformer=e}async value(){return this.transformer(await this.raw.json())}}class VoidApiResponse{constructor(t){this.raw=t}async value(){}}function StatusFromJSON(t){return StatusFromJSONTyped(t)}function StatusFromJSONTyped(t,e){return t}function StatusToJSON(t){return t}function NotificationFromJSON(t){return NotificationFromJSONTyped(t)}function NotificationFromJSONTyped(t,e){return null==t?t:{id:exists(t,"id")?t.id:void 0,resourceType:exists(t,"resource_type")?t.resource_type:void 0,subGroup:exists(t,"sub_group")?t.sub_group:void 0,createdAt:exists(t,"created_at")?null===t.created_at?null:new Date(t.created_at):void 0,createdBy:exists(t,"created_by")?t.created_by:void 0,subject:exists(t,"subject")?t.subject:void 0,locations:exists(t,"locations")?t.locations:void 0,resourceId:exists(t,"resource_id")?t.resource_id:void 0,status:exists(t,"status")?StatusFromJSON(t.status):void 0,accountNumber:exists(t,"account_number")?t.account_number:void 0}}function GetNotifications200ResponseFromJSON(t){return GetNotifications200ResponseFromJSONTyped(t)}function GetNotifications200ResponseFromJSONTyped(t,e){return null==t?t:{self:exists(t,"self")?t.self:void 0,first:exists(t,"first")?t.first:void 0,prev:exists(t,"prev")?t.prev:void 0,next:exists(t,"next")?t.next:void 0,last:exists(t,"last")?t.last:void 0,items:t.items.map(NotificationFromJSON)}}function NotificationPatchFromJSON(t){return NotificationPatchFromJSONTyped(t)}function NotificationPatchFromJSONTyped(t,e){return null==t?t:{status:StatusFromJSON(t.status)}}function NotificationPatchToJSON(t){if(void 0!==t)return null===t?null:{status:StatusToJSON(t.status)}}function NotificationRequestToJSON(t){if(void 0!==t)return null===t?null:{resource_type:t.resourceType,sub_group:t.subGroup,recipients:t.recipients,account_number:t.accountNumber,locations:t.locations,resource_id:t.resourceId,subject:t.subject,created_at:void 0===t.createdAt?void 0:null===t.createdAt?null:t.createdAt.toISOString()}}class NotificationsApi extends BaseAPI{async createNotificationRaw(t,e){var i={"Content-Type":"application/json"},o=(this.configuration&&this.configuration.accessToken&&(o=await(0,this.configuration.accessToken)("bearerToken",[]))&&(i.Authorization="Bearer "+o),await this.request({path:"/notifications",method:"POST",headers:i,query:{},body:NotificationRequestToJSON(t.notificationRequest)},e));return new JSONApiResponse(o,t=>NotificationFromJSON(t))}async createNotification(t={},e){return(await this.createNotificationRaw(t,e)).value()}async deleteNotificationsByIdRaw(t,e){if(null==t.id)throw new RequiredError("id","Required parameter requestParameters.id was null or undefined when calling deleteNotificationsById.");var i={},o=(this.configuration&&this.configuration.accessToken&&(o=await(0,this.configuration.accessToken)("bearerToken",[]))&&(i.Authorization="Bearer "+o),await this.request({path:"/notifications/{id}".replace("{id}",encodeURIComponent(String(t.id))),method:"DELETE",headers:i,query:{}},e));return new VoidApiResponse(o)}async deleteNotificationsById(t,e){await this.deleteNotificationsByIdRaw(t,e)}async getNotificationsRaw(t,e){var i={},o=(void 0!==t.sort&&(i.sort=t.sort),void 0!==t.cursor&&(i.cursor=t.cursor),void 0!==t.resourceType&&(i.resource_type=t.resourceType),void 0!==t.accountNumber&&(i.account_number=t.accountNumber),void 0!==t.createdAfter&&(i.created_after=t.createdAfter.toISOString()),void 0!==t.createdBefore&&(i.created_before=t.createdBefore.toISOString()),void 0!==t.locationId&&(i.location_id=t.locationId),void 0!==t.subGroup&&(i.sub_group=t.subGroup),void 0!==t.status&&(i.status=t.status),{}),t=(t.prefer&&(o.Prefer=t.prefer.join(COLLECTION_FORMATS.csv)),this.configuration&&this.configuration.accessToken&&(t=await(0,this.configuration.accessToken)("bearerToken",[]))&&(o.Authorization="Bearer "+t),await this.request({path:"/notifications",method:"GET",headers:o,query:i},e));return new JSONApiResponse(t,t=>GetNotifications200ResponseFromJSON(t))}async getNotifications(t={},e){return(await this.getNotificationsRaw(t,e)).value()}async getNotificationsByIdRaw(t,e){if(null==t.id)throw new RequiredError("id","Required parameter requestParameters.id was null or undefined when calling getNotificationsById.");var i={},o=(this.configuration&&this.configuration.accessToken&&(o=await(0,this.configuration.accessToken)("bearerToken",[]))&&(i.Authorization="Bearer "+o),await this.request({path:"/notifications/{id}".replace("{id}",encodeURIComponent(String(t.id))),method:"GET",headers:i,query:{}},e));return new JSONApiResponse(o,t=>NotificationFromJSON(t))}async getNotificationsById(t,e){return(await this.getNotificationsByIdRaw(t,e)).value()}async patchNotificationsByIdRaw(t,e){if(null==t.id)throw new RequiredError("id","Required parameter requestParameters.id was null or undefined when calling patchNotificationsById.");var i={"Content-Type":"application/json"},o=(this.configuration&&this.configuration.accessToken&&(o=await(0,this.configuration.accessToken)("bearerToken",[]))&&(i.Authorization="Bearer "+o),await this.request({path:"/notifications/{id}".replace("{id}",encodeURIComponent(String(t.id))),method:"PATCH",headers:i,query:{},body:NotificationPatchToJSON(t.notificationPatch)},e));return new JSONApiResponse(o,t=>NotificationPatchFromJSON(t))}async patchNotificationsById(t,e){return(await this.patchNotificationsByIdRaw(t,e)).value()}}let APIEndpointPrefixes={Notifications:"notifications"};class ApiClient{constructor(t){this.noInit=!1,this.configuration=t}get notificationsApi(){return new NotificationsApi(new Configuration({basePath:this.configuration.NotificationApiUrl+"/"+APIEndpointPrefixes.Notifications,headers:{Authorization:this.getAuthorization()}}))}getAuthorization(){return this.configuration.getAuthorizationFn?this.configuration.getAuthorizationFn():""}}let isNullOrUndefinedOrEmpty=t=>null==t||""===t,mapResourceTypeToNotificationGroups=t=>{switch(t.toLowerCase()){case"planned maintenance":return NotificationGroups.PLANNED_MAINTENANCE;case"incidents":return NotificationGroups.INCIDENTS;case"dcim alerts":return NotificationGroups.DCIM_ALERTS;case"service tickets":return NotificationGroups.SERVICE_TICKETS;default:return NotificationGroups.PLANNED_MAINTENANCE}},mapStringToNotificationStatus=t=>{switch(t.toLowerCase()){case"unread":return NotificationStatus.UNREAD;case"read":return NotificationStatus.READ;default:return NotificationStatus.UNREAD}},mapParametersToNotificationRequest=t=>({sort:"-created_at",cursor:t,prefer:[""]}),mapParametersToPatchNotificationRequest=(t,e)=>({id:t,notificationPatch:{status:e}}),mapParametersToDeleteNotificationRequest=t=>({id:t}),mapNotificationDataToNotification=t=>{var e;return{subject:null!=(e=t.subject)?e:"",id:t.id,accountNumber:null!=(e=t.accountNumber)?e:"",resourceType:mapResourceTypeToNotificationGroups(null!=(e=t.resourceType)?e:""),subGroup:null!=(e=t.subGroup)?e:"",resourceId:null!=(e=t.resourceId)?e:"",status:mapStringToNotificationStatus(null!=(e=t.status)?e:""),createdAt:isNullOrUndefinedOrEmpty(t.createdAt)?format(new Date,DefaultDateTimeFormat):format(t.createdAt,DefaultDateTimeFormat),createdBy:null!=(e=t.createdBy)?e:"",locations:null!=(e=t.locations)?e:[]}},mapNotificationResponseToNotifications=t=>t.map(t=>mapNotificationDataToNotification(t)),getNextPageCursorfromQueryParam=t=>{t=new URLSearchParams(t),t=t.has("cursor")?t.get("cursor"):"";return null!==t?t:""},handleError=async(e,t=!0)=>{if(e instanceof ResponseError&&400===e.response.status)try{var i=(await e.response.json()).detail;t&&console.error(i)}catch(t){console.error(e)}else console.error(e)},getLocalStorageUser=t=>{t=localStorage.getItem(t);return t?JSON.parse(t):null},getUserAuthorization=t=>"Bearer "+(null==(t=getLocalStorageUser(t))?void 0:t.access_token);class NotificationState{constructor(){this.showDrawer=!1,this.apiClient={noInit:!0},this.baseApiUrl="",this.localStorageKey="",this.NewApiClient=()=>{this.apiClient=new ApiClient({NotificationApiUrl:this.baseApiUrl,getAuthorizationFn:()=>getUserAuthorization(this.localStorageKey)}),this.getNotifications()},this.nextPageCursor="",this.notifications=[],this.unreadNotificationCount=0,this.notificationFilters={SHOW_PLANNED_MAINTENANCE:!0,SHOW_SERVICE_TICKETS:!0,SHOW_DCIM_ALERTS:!0},this.selectedNotification={id:"",resourceType:NotificationGroups.PLANNED_MAINTENANCE,subGroup:"",subject:"",resourceId:"",locations:[],createdAt:"",accountNumber:"",createdBy:"",status:NotificationStatus.READ},this.dateFilters={FROM_DATE:subDays(new Date,DefaultDisplayDays),TO_DATE:new Date},makeAutoObservable(this),makePersistable(this,{name:"notification-state",properties:["notificationFilters","nextPageCursor"],storage:window.localStorage})}get isHydrated(){return isHydrated(this)}async hydrateStore(){await hydrateStore(this)}async clearStoredData(){await clearPersistedStore(this)}async getStoredData(){return getPersistedStore(this)}ConstructApiClient(){return this.apiClient.noInit?this.NewApiClient():this.apiClient}async clearStoredNotificationsData(){this.notifications=[],this.unreadNotificationCount=0,this.nextPageCursor="",this.apiClient={noInit:!0}}async setNotificationReadStatus(e){var t,i=await this.setNotificationAsRead(e.toString());return!0===await i&&(this.ReduceUnreadNotificationCount(),t=this.notifications.findIndex(t=>t.id===e),this.notifications[t].status=NotificationStatus.READ,this.selectedNotification=this.notifications[t]),i}async setNotificationDeleted(e){var t,i=await this.DeleteNotification(e.toString());return!0===i&&("unread"===(null==(t=this.notifications.find(t=>t.id===e))?void 0:t.status)&&this.ReduceUnreadNotificationCount(),t=this.notifications.findIndex(t=>t.id===e),this.notifications.splice(t,1)),{State:!0===i?ApiCallState.SUCCESS:ApiCallState.ERROR,Message:!0===i?"Successfully deleted the notification":"Error while deleting the notification"}}setNotificationDateFilter(t,e){this.dateFilters.FROM_DATE=void 0!==t?parse(t,DefaultDateFormat,new Date):void 0,this.dateFilters.TO_DATE=void 0!==e?parse(e,DefaultDateFormat,new Date):void 0}setNotificationFilter(t,e){switch(t){case NotificationGroups.PLANNED_MAINTENANCE:this.notificationFilters.SHOW_PLANNED_MAINTENANCE=e;break;case NotificationGroups.SERVICE_TICKETS:this.notificationFilters.SHOW_SERVICE_TICKETS=e;break;case NotificationGroups.DCIM_ALERTS:this.notificationFilters.SHOW_DCIM_ALERTS=e}}async getNotifications(){var t,e;void 0!==this.nextPageCursor&&(e=await(null==(e=this.apiClient)?void 0:e.notificationsApi.getNotificationsRaw(mapParametersToNotificationRequest(getNextPageCursorfromQueryParam(this.nextPageCursor))).catch(t=>{handleError(t,!1)})))&&(t=await(null==e?void 0:e.value()),this.notifications=""===this.nextPageCursor?mapNotificationResponseToNotifications(null==t?void 0:t.items):this.notifications.concat(mapNotificationResponseToNotifications(null==t?void 0:t.items)),this.nextPageCursor=void 0===(null==t?void 0:t.next)||null==t?void 0:t.next,this.unreadNotificationCount=null!==e.raw.headers.get("x-total-unread-count")&&void 0!==e.raw.headers.get("x-total-unread-count")?e.raw.headers.get("x-total-unread-count"):0)}async getNotificationsById(t){let e,i;(i=t?await(null==(e=this.apiClient)?void 0:e.notificationsApi.getNotificationsById({id:t}).catch(t=>{handleError(t,!1)})):i)&&(this.selectedNotification=mapNotificationDataToNotification(i))}async setNotificationAsRead(t){var e;return!!t&&(await(null==(e=this.apiClient)?void 0:e.notificationsApi.patchNotificationsById(mapParametersToPatchNotificationRequest(t,"read")).catch(t=>(handleError(t,!1),!1))),!0)}async DeleteNotification(t){let e,i=!1;return t&&await(null==(e=this.apiClient)?void 0:e.notificationsApi.deleteNotificationsById(mapParametersToDeleteNotificationRequest(t)).catch(t=>{handleError(t,!1),i=!1}).then(()=>{i=!0})),i}ReduceUnreadNotificationCount(){0<this.unreadNotificationCount&&--this.unreadNotificationCount}}let NotificationsState=new NotificationState,NotificationsStyle=css`:host{--ix-drawer-border-radius:0;--ix-drawer-padding:0;--ix-drawer-width-sm:320px;--ix-drawer-width-md:320px;--ix-drawer-width-lg:400px}.destructive-icon{color:var(--clr-critical,#db0028);--md-icon-button-icon-color:var(--clr-critical, #DB0028);--md-sys-color-on-surface-variant:var(--clr-critical, #DB0028)}.destructive-icon path{fill:var(--clr-critical,#db0028)}.active-icon{color:var(--clr-primary,#1456e0);--md-icon-button-icon-color:var(--clr-primary, #1456E0);--md-sys-color-on-surface-variant:var(--clr-primary, #1456E0)}.active-icon path{fill:var(--clr-primary,#1456e0)}.inactive-icon{color:var(--clr-on-surface,#092241);--md-icon-button-icon-color:var(--clr-on-surface, #092241);--md-sys-color-on-surface-variant:var(--clr-on-surface, #092241);cursor:default;opacity:.6}.inactive-icon path{fill:var(--clr-on-surface,#092241);opacity:.6}ix-icon-button.sharp{--md-icon-font:'Material Symbols Sharp'!important}.ix-icon-groups{--ix-icon-font-size:32px;--ix-icon-line-height:32px}.ix-icon-groups ix-icon{color:var(--clr-on-surface,#092241);opacity:.6}.ix-icon-groups ix-icon path{fill:var(--clr-on-surface,#092241)}.datefilter-dropdown-content,.filter-dropdown-content{position:absolute;right:5%;top:3rem;box-shadow:0 8px 16px 0 rgba(0,0,0,.2);z-index:3;transition:box-shadow .3s cubic-bezier(.4,0,.2,1) 0s;border-radius:3px;box-shadow:rgba(0,0,0,.2) 0 5px 5px -3px,rgba(0,0,0,.14) 0 8px 10px 1px,rgba(0,0,0,.12) 0 3px 14px 2px;background-color:var(--clr-surface-container-lowest,#fff)}.unread{font-family:var(--root-primary-font, 'sans-serif');padding:0 5px;font-size:var(--text-caption-size,.75rem);line-height:var(--text-caption-line-height,1.33333333em);left:22px;top:0;background:var(--clr-critical,#db0028);letter-spacing:var(--text-caption-letter-spacing,.03333333em)}.notification-tooltip{background-color:var(--cp-neutral-blue-4,#040d19);white-space:nowrap;font-size:var(--text-caption-size,.75rem);z-index:9999;color:var(--clr-on-secondary,#fff)}.notification-modal-subtitle,.notification-modal-title{color:var(--clr-on-surface,#092241);font-family:var(--root-secondary-font, 'sans-serif')}.notification-modal-subtitle{font-size:var(--text-heading-size,1.25rem);line-height:var(--text-heading-line-height,1.2em)}.notification-modal-content{display:inline-grid;grid-template-columns:fit-content(183px) 1fr;grid-template-rows:auto auto;grid-column-gap:24px;grid-row-gap:8px;font-family:var(--root-primary-font, 'sans-serif');font-size:var(--text-default-size,16px);line-height:28px;width:560px;padding-bottom:16px;color:var(--clr-on-surface,#092241)}.notification-modal-content-title{width:183px;color:var(--clr-on-surface-variant,#092241B3)}.notification-modal-subject-title{grid-area:1/1/2/2}.notification-modal-subject-text{grid-area:1/2/2/3}.notification-modal-created-date-title{grid-area:2/1/3/2}.notification-modal-created-date-text{grid-area:2/2/3/3}.notification-modal-site-title{grid-area:3/1/4/2}.notification-modal-site-text{grid-area:3/2/4/3}`,ConfirmationDialog=class extends MobxLitElement{constructor(){super(...arguments),this.textMessage="Are you sure?",this.open=!1,this.dialogClosed=()=>{this.dispatchEvent(new CustomEvent("confirm-dialog-closed")),this.onClick(!1)}}static get styles(){return[TWStyles,NotificationsStyle]}onClick(t){t=new CustomEvent("on-confirm-selection",{detail:{returnValue:t},bubbles:!0,composed:!0});this.dispatchEvent(t)}render(){return html`<ix-dialog ?open="${this.open}" class="w-[580px]" @closed="${this.dialogClosed}"><div slot="headline">${this.textMessage}</div><div slot="actions"><div class="flex flex-row justify-end p-1"><ix-button name="cancel" appearance="text" @click="${()=>this.onClick(!1)}">DISMISS</ix-button><ix-button name="confirm" appearance="text" @click="${()=>this.onClick(!0)}">YES</ix-button></div></div></ix-dialog>`}},ViewItemDialog=(__decorate([property({type:String,attribute:!0})],ConfirmationDialog.prototype,"textMessage",void 0),__decorate([property({type:Boolean,attribute:!0})],ConfirmationDialog.prototype,"open",void 0),ConfirmationDialog=__decorate([customElement("confirmation-dialog")],ConfirmationDialog),class extends MobxLitElement{constructor(){super(...arguments),this.notification={},this.open=!1,this.dialogClosed=()=>{this.dispatchEvent(new CustomEvent("view-item-dialog-closed"))},this.viewRecord=()=>{this.dialogClosed(),NotificationsState.showDrawer=!1}}static get styles(){return[TWStyles,NotificationsStyle]}getUrl(){var t=this.notification.resourceId;switch(this.notification.resourceType){case NotificationGroups.PLANNED_MAINTENANCE:return"/service-management/reports?ticketId="+t;case NotificationGroups.SERVICE_TICKETS:switch(this.notification.subGroup){case SubGroups.Remote_Hands:return"/service-management/service-tickets/remote-hands/"+t;case SubGroups.Customer_Care:return"/service-management/service-tickets/customer-care/"+t;case SubGroups.Deliveries:return`/service-management/service-tickets/${SubGroups.Deliveries}/`+t;case SubGroups.Facility_Access:return"/service-management/service-tickets/facility-access/"+t;case SubGroups.Removals:return"/service-management/service-tickets/removals/"+t;case SubGroups.Trouble_Ticket:return"/service-management/service-tickets/trouble-tickets/"+t;case SubGroups.FacilityAccessVisitorAccess:return"/service-management/service-tickets/facility-access/visitor-access/"+t;case SubGroups.FacilityAccessPermanentBadge:return"/service-management/service-tickets/facility-access/permanent-badge/"+t;case SubGroups.FacilityAccessOspAccess:return"/service-management/service-tickets/facility-access/osp-access/"+t;case SubGroups.FacilityAccessPopPoeAccess:return"/service-management/service-tickets/facility-access/pop-poe-access/"+t;default:return""}case NotificationGroups.INCIDENTS:return"/service-management/reports?ticketId="+t;case NotificationGroups.DCIM_ALERTS:return"/dcim/"+t;default:return""}}getLocation(){return void 0===this.notification.locations||this.notification.locations.length<1?"":1<this.notification.locations.length?"Multiple Sites":this.notification.locations[0]}getSubGroupDisplayName(){switch(this.notification.subGroup){case SubGroups.FacilityAccessVisitorAccess:case SubGroups.FacilityAccessPermanentBadge:case SubGroups.FacilityAccessOspAccess:case SubGroups.FacilityAccessPopPoeAccess:return"Facility Access";case"Incidents (GSN)":return"Incidents";case"Emergency Repairs (InSite 1.0)":return"Emergency Repairs";default:return this.notification.subGroup}}render(){return html`<ix-dialog ?open="${this.open}" @closed="${this.dialogClosed}" class="notification-modal" data-testclass="notification-modal"><div slot="headline" class="w-[560px]"><div class="flex flex-col flex-start"><div class="notification-modal-title text-2xl font-bold text-balance">${this.notification.resourceType}</div><div class="notification-modal-subtitle pt-4 pb-0 font-bold text-balance">${this.getSubGroupDisplayName()}</div></div></div><form class="notification-modal-content" slot="content" id="form-id" method="dialog"><div class="notification-modal-content-title notification-modal-subject-title">Subject</div><div class="notification-modal-subject-text font-normal text-wrap">${this.notification.subject}</div><div class="notification-modal-content-title notification-modal-created-date-title">Create Date</div><div class="notification-modal-created-date-text font-normal text-wrap">${format(new Date(this.notification.createdAt),"dd/MM/yyyy HH:mm:ss")}</div><div class="notification-modal-content-title notification-modal-site-title">Site</div><div class="notification-modal-site-text font-normal text-wrap">${this.getLocation()}</div></form><div slot="actions" class="flex flex-row flex-end"><ix-button data-testclass="close-item-modal" form="form-id" appearance="text">Close</ix-button><ix-button data-testclass="view-record" href="${this.getUrl()}" @click="${this.viewRecord}" appearance="text">View Record</ix-button></div></ix-dialog>`}}),NotificationItem=(__decorate([property({type:Object,attribute:!1})],ViewItemDialog.prototype,"notification",void 0),__decorate([property({type:Boolean,attribute:!0})],ViewItemDialog.prototype,"open",void 0),ViewItemDialog=__decorate([customElement("view-item-dialog")],ViewItemDialog),class extends MobxLitElement{constructor(){super(...arguments),this.disabled=!1,this.read=!1,this.notification={},this.showModal=!1,this.showDeleteConfirmation=!1}static get styles(){return[TWStyles,NotificationsStyle]}displayItem(){this.notification.status===NotificationStatus.UNREAD&&(NotificationsState.setNotificationReadStatus(this.notification.id),this.read=!0),this.showModal=!0}deleteItem(){this.disabled||(this.showDeleteConfirmation=!0)}confirmedDelete(t){t.detail.returnValue&&NotificationsState.setNotificationDeleted(this.notification.id).then(t=>{this.showDeleteResultMessage(t,this.notification.id)}),this.showDeleteConfirmation=!1}showDeleteResultMessage(t,e){window.dispatchEvent(new CustomEvent("add-toast",{detail:{id:e,content:html`<ix-message-toast data-testid="notification-delete-toast" toastId="${e}" .TMessageToast="${t.State.toLowerCase()}" forceClose>${t.Message}</ix-message-toast>`,autoClose:2e3,durationOut:2e3,vertical:"bottom",horizontal:"center",animated:!0,above:!1}}))}calculateDuration(){return void 0!==this.notification.createdAt?differenceInHours(new Date,new Date(this.notification.createdAt))<24?formatDistance(new Date(this.notification.createdAt),new Date,{addSuffix:!0}):html`<ix-date type="static" variant="date-time" .value="${this.notification.createdAt}"></ix-date>`:"N/A"}getNotificationIcon(){switch(this.notification.resourceType){case NotificationGroups.PLANNED_MAINTENANCE:return plannedMaintenance;case NotificationGroups.SERVICE_TICKETS:return"sync_saved_locally";case NotificationGroups.INCIDENTS:return"report";case NotificationGroups.DCIM_ALERTS:return dcim;default:return"sync_saved_locally"}}getNotificationTitle(){switch(this.notification.resourceType){case NotificationGroups.PLANNED_MAINTENANCE:return"Planned Maintenance";case NotificationGroups.SERVICE_TICKETS:return this.getServiceTicketSubGroup()+" Service Ticket Update";case NotificationGroups.INCIDENTS:return"Emergency Repair";case NotificationGroups.DCIM_ALERTS:return"DCIM Alert";default:return"sync_saved_locally"}}getServiceTicketSubGroup(){var t,e;switch(null==(t=this.notification)?void 0:t.subGroup){case SubGroups.FacilityAccessVisitorAccess:case SubGroups.FacilityAccessPermanentBadge:case SubGroups.FacilityAccessOspAccess:case SubGroups.FacilityAccessPopPoeAccess:return"Facility Access";default:return null==(e=this.notification)?void 0:e.subGroup}}render(){return html`<div data-testid="notification-item" class="relative notification-item"><div class="hover:bg-[rgba(0,0,0,0.04)] p-2 pl-3.5 flex gap-3 relative cursor-pointer items-center font-bold ${this.read?"notification-item-read border-l-3 border-transparent":"notification-item-unread border-l-3 border-success"}"><ix-icon style="--ix-icon-font-size:24px;--ix-icon-line-height:24px" icon="${this.getNotificationIcon()}" class="${this.read?"inactive-icon":"active-icon"}" @click="${this.displayItem}">${this.getNotificationIcon()}</ix-icon><div class="flex flex-col grow" @click="${this.displayItem}"><div class="grow text-base"><h2 class="dlr-text-caption">${this.getNotificationTitle()}</h2></div><div class="grow text-xs"><h3 class="dlr-text-caption text-on-surface-disabled">${this.calculateDuration()}</h3></div></div><div><view-item-dialog ?open="${this.showModal}" .notification="${this.notification}" @view-item-dialog-closed="${()=>{this.showModal=!1}}"></view-item-dialog><confirmation-dialog ?open="${this.showDeleteConfirmation}" @on-confirm-selection="${this.confirmedDelete}" @confirm-dialog-closed="${()=>{this.showModal=!1}}" textMessage="Are you sure you want to delete this notification?" data-testclass="notification-delete-confirmation"></confirmation-dialog></div><ix-icon-button style="--md-icon-button-icon-size:24px" data-testclass="delete-notification" @click="${this.deleteItem}" @mouseover="${t=>{this.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:this.disabled?"Emergency Repair Notification cannot be removed":"Remove Notification",target:t.target}}))}}" @mouseout="${()=>this.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" ?disabled="${this.disabled}"><ix-icon slot="default" class="${this.disabled?"inactive-icon":"destructive-icon"}">${trash}</ix-icon></ix-icon-button></div></div>`}}),GroupedItem=(__decorate([property({type:Boolean})],NotificationItem.prototype,"disabled",void 0),__decorate([property({type:Boolean})],NotificationItem.prototype,"read",void 0),__decorate([property({type:Object,attribute:!1})],NotificationItem.prototype,"notification",void 0),__decorate([state()],NotificationItem.prototype,"showModal",void 0),__decorate([state()],NotificationItem.prototype,"showDeleteConfirmation",void 0),NotificationItem=__decorate([customElement("notification-item")],NotificationItem),class extends MobxLitElement{constructor(){super(...arguments),this.groupTitle="Group 1",this.groupIcon="public",this.childItems=NotificationsState.notifications,this.isOpen=!1,this.onClick=()=>{this.isOpen=!this.isOpen}}static get styles(){return[TWStyles,NotificationsStyle]}renderNotificationItems(){var t;return this.isOpen?void 0!==(null==(t=this.childItems)?void 0:t.length)&&0<(null==(t=this.childItems)?void 0:t.length)?html`<div>${null==(t=this.childItems)?void 0:t.map(t=>html`<notification-item .notification="${t}" ?disabled="${t.resourceType===NotificationGroups.INCIDENTS}"></notification-item>`)}</div>`:html`<p class="dlr-text-caption ml-14 font-bold mr-4">No notifications yet.</p>`:html`${nothing}`}render(){var t;return html`<div class="group-container-row border-b border-outline py-3"><div class="flex items-center justify-between"><div class="flex items-center align-middle"><ix-icon-button icon="${this.isOpen?"arrow_drop_down":"arrow_right"}" @click="${this.onClick}" data-testclass="grouped-item-toggle-expand"></ix-icon-button><ix-icon slot="default" class="ix-icon-groups">${unsafeSVG(this.groupIcon)}</ix-icon><p class="m-0 group-name font-bold pl-1">${this.groupTitle}</p><p class="m-0 pl-4">${null==(t=this.childItems)?void 0:t.length.toString().padStart(2,"0")}</p></div></div>${this.renderNotificationItems()}</div>`}}),GroupFilters=(__decorate([property({type:String,attribute:!0})],GroupedItem.prototype,"groupTitle",void 0),__decorate([property({type:String,attribute:!0})],GroupedItem.prototype,"groupIcon",void 0),__decorate([property({type:Array,attribute:!0})],GroupedItem.prototype,"childItems",void 0),__decorate([state()],GroupedItem.prototype,"isOpen",void 0),GroupedItem=__decorate([customElement("grouped-item")],GroupedItem),class extends MobxLitElement{static get styles(){return[TWStyles,NotificationsStyle]}onSwitchChange(t){var t=t.target,e=null==(e=t.attributes.getNamedItem("name"))?void 0:e.value;NotificationsState.setNotificationFilter(e,t.selected),this.requestUpdate()}render(){return html`<div class="flex flex-col"><label class="whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle"><ix-switch data-testid="planned-maintenance-switch" class="flex" name="${NotificationGroups.PLANNED_MAINTENANCE}" selected="${NotificationsState.notificationFilters.SHOW_PLANNED_MAINTENANCE}" @change="${this.onSwitchChange}"></ix-switch><span>Planned Maintenance</span></label> <label class="whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle"><ix-switch data-testid="service-tickets-switch" class="flex" name="${NotificationGroups.SERVICE_TICKETS}" selected="${NotificationsState.notificationFilters.SHOW_SERVICE_TICKETS}" @change="${this.onSwitchChange}"></ix-switch><span>Service Ticket Updates</span></label> <label class="whitespace-nowrap p-2 flex gap-3 items-center hover:bg-primary-subtle"><ix-switch data-testid="dcim-alerts-switch" class="flex" name="${NotificationGroups.DCIM_ALERTS}" selected="${NotificationsState.notificationFilters.SHOW_DCIM_ALERTS}" @change="${this.onSwitchChange}"></ix-switch><span>${NotificationGroups.DCIM_ALERTS}</span></label></div>`}}),DateFilters=(GroupFilters=__decorate([customElement("group-filters")],GroupFilters),class extends MobxLitElement{constructor(){super(...arguments),this.fromDate=isNullOrUndefinedOrEmpty(NotificationsState.dateFilters.FROM_DATE)?void 0:format(NotificationsState.dateFilters.FROM_DATE,DefaultDateFormat),this.toDate=isNullOrUndefinedOrEmpty(NotificationsState.dateFilters.TO_DATE)?void 0:format(NotificationsState.dateFilters.TO_DATE,DefaultDateFormat),this.maxDate=format(new Date,DefaultDateFormat),this.fromDateErrorText="",this.toDateErrorText=""}static get styles(){return[TWStyles,NotificationsStyle]}onFromDateChange(t){null===t||""===t?this.fromDate=void 0:(this.fromDate=t,void 0!==this.fromDate&&(this.fromDateErrorText=void 0))}onToDateChange(t){null===t||""===t?this.toDate=void 0:(this.toDate=t,void 0!==this.toDate&&(this.toDateErrorText=void 0))}onApplyDateFilter(t){if(t){if(void 0===this.toDate&&void 0!==this.fromDate)return void(this.toDateErrorText="Please select to date");if(void 0===this.fromDate&&void 0!==this.toDate)return void(this.fromDateErrorText="Please select from date");if(this.fromDate>this.toDate)return this.fromDateErrorText="From date cannot be later than To date.",void(this.fromDate=void 0);if(this.fromDateErrorText=void 0,this.toDate<this.fromDate)return this.toDateErrorText="To date cannot be earlier than From date.",void(this.toDate=void 0);this.toDateErrorText=void 0}t=t&&void 0===this.toDateErrorText&&void 0===this.fromDateErrorText,t&&(NotificationsState.setNotificationDateFilter(this.fromDate,this.toDate),this.requestUpdate()),t=new CustomEvent("on-selection",{detail:{returnValue:t},bubbles:!0,composed:!0});this.dispatchEvent(t)}clearDateFilters(){this.fromDate=void 0,this.toDate=void 0,this.fromDateErrorText=void 0,this.toDateErrorText=void 0}render(){return html`<div class="flex flex-col p-4"><div class="flex flex-row items-center"><div class="grow items-center text-xl font-bold">Filter by Date</div><div class="flex flex-row items-center" @click="${this.clearDateFilters}"><label class="grow text-sm text-right pr-1 cursor-pointer">Clear Filter</label><ix-icon-button data-testid="notifications-clear-date-filter" small appearance="default" icon="domain_verification_off" class="active-icon"></ix-icon-button></div></div><ix-divider class="my-2"></ix-divider><div class="flex xl:flex-row lg:flex-col md:flex-col sm:flex-col justify-between item-center my-4"><div class="flex gap-2"><ix-date data-testid="notifications-from-date" .value="${this.fromDate}" max="${this.maxDate}" label="From" name="FromDate" .errorText="${this.fromDateErrorText}" .onChanged="${t=>this.onFromDateChange(t)}"></ix-date><ix-date data-testid="notifications-to-date" .value="${this.toDate}" max="${this.maxDate}" label="To" name="ToDate" .errorText="${this.toDateErrorText}" .onChanged="${t=>this.onToDateChange(t)}"></ix-date></div></div><div class="flex flex-row justify-between"><ix-button data-testid="notifications-cancel-date-filter" type="" target="" appearance="text" @click="${()=>this.onApplyDateFilter(!1)}">Cancel</ix-button><ix-button data-testid="notifications-activate-date-filter" type="" target="" appearance="text" @click="${()=>this.onApplyDateFilter(!0)}">Filter List</ix-button></div></div>`}}),NotificationTooltip=(__decorate([state()],DateFilters.prototype,"fromDate",void 0),__decorate([state()],DateFilters.prototype,"toDate",void 0),__decorate([state()],DateFilters.prototype,"maxDate",void 0),__decorate([state()],DateFilters.prototype,"fromDateErrorText",void 0),__decorate([state()],DateFilters.prototype,"toDateErrorText",void 0),DateFilters=__decorate([customElement("date-filters")],DateFilters),class extends MobxLitElement{constructor(){super(...arguments),this.isVisible=!1,this.label="",this.hoveredElement=void 0,this.configureNotificationTooltip=t=>{var{label:t,target:e}=t.detail;this.hoveredElement=e,this.label=t,this.isVisible=!0},this.hideNotificationTooltip=()=>{this.isVisible=!1,this.hoveredElement=void 0,this.label=""}}static get styles(){return[TWStyles,NotificationsStyle]}connectedCallback(){super.connectedCallback(),window.addEventListener("show-notification-tooltip",this.configureNotificationTooltip),window.addEventListener("hide-notification-tooltip",this.hideNotificationTooltip)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("show-notification-tooltip",this.configureNotificationTooltip),window.removeEventListener("hide-notification-tooltip",this.hideNotificationTooltip)}updated(t){t.has("hoveredElement")&&this.isVisible&&this.hoveredElement&&computePosition(this.hoveredElement,this.notificationTooltip,{placement:"bottom-end"}).then(({x:t,y:e})=>{this.notificationTooltip.style.left=t+"px",this.notificationTooltip.style.top=e+12+"px"})}render(){var t={hidden:!this.isVisible};return html`<div class="notification-tooltip z-[9999] rounded absolute p-2 white-text ${classMap(t)}">${this.label}</div><slot></slot>`}});__decorate([query(".notification-tooltip")],NotificationTooltip.prototype,"notificationTooltip",void 0),__decorate([property({type:Boolean,reflect:!0})],NotificationTooltip.prototype,"isVisible",void 0),__decorate([property({type:String,reflect:!0})],NotificationTooltip.prototype,"label",void 0),__decorate([state()],NotificationTooltip.prototype,"hoveredElement",void 0),NotificationTooltip=__decorate([customElement("notification-tooltip")],NotificationTooltip);class IxNotifications extends MobxLitElement{constructor(){super(...arguments),this.showGroupedView=!1,this.showFilters=!1,this.showDateFilters=!1,this.showMarkAllReadConfirmation=!1,this.baseApiUrl="",this.localStorageKey=""}async firstUpdated(){NotificationsState.baseApiUrl=this.baseApiUrl,NotificationsState.localStorageKey=this.localStorageKey,NotificationsState.ConstructApiClient()}connectedCallback(){super.connectedCallback(),window.addEventListener("account-switched",NotificationsState.NewApiClient),window.addEventListener("ix-notifications-toggle-drawer",this.toggleDrawer),window.addEventListener("beforeunload",this.handleOnbeforeunload)}disconnectedCallback(){super.disconnectedCallback(),this.handleOnbeforeunload(),window.removeEventListener("account-switched",NotificationsState.NewApiClient),window.removeEventListener("ix-notifications-toggle-drawer",this.toggleDrawer),window.removeEventListener("beforeunload",this.handleOnbeforeunload)}handleOnbeforeunload(){NotificationsState.clearStoredNotificationsData()}toggleDrawer(){NotificationsState.showDrawer=!NotificationsState.showDrawer,NotificationsState.showDrawer||(this.showFilters=!1,this.showDateFilters=!1)}markAllread(){0<NotificationsState.unreadNotificationCount&&(this.showMarkAllReadConfirmation=!0)}confirmedMarkAllRead(t){if(t.detail.returnValue){var t=this.applyNotificationFilters(),i=null==t?void 0:t.filter(t=>t.status===NotificationStatus.UNREAD);if(0<i.length){let e=!0;null!=t&&t.forEach(t=>{NotificationsState.setNotificationReadStatus(t.id).then(t=>{e=e&&t})});t={State:!0===e?ApiCallState.SUCCESS:ApiCallState.ERROR,Message:!0===e?"Successfully marked all the notifications as read":"Error while marking the notifications read, Please try again"};this.showResultMessage(t,i[0].id),this.requestUpdate()}}this.showMarkAllReadConfirmation=!1}showResultMessage(t,e){window.dispatchEvent(new CustomEvent("add-toast",{detail:{id:e,content:html`<ix-message-toast data-testid="notification-read-all-toast" toastId="${e}" .TMessageToast="${t.State.toLowerCase()}" forceClose>${t.Message}</ix-message-toast>`,autoClose:3e3,durationOut:3e3,vertical:"bottom",horizontal:"center",animated:!0,above:!1}}))}toggleGroupView(){this.showGroupedView=!this.showGroupedView}displayFilters(){this.showFilters=!this.showFilters}applyNotificationFilters(){var t=null==(t=NotificationsState.notifications)?void 0:t.filter(t=>t.resourceType===NotificationGroups.PLANNED_MAINTENANCE&&!0===NotificationsState.notificationFilters.SHOW_PLANNED_MAINTENANCE||t.resourceType===NotificationGroups.SERVICE_TICKETS&&!0===NotificationsState.notificationFilters.SHOW_SERVICE_TICKETS||t.resourceType===NotificationGroups.DCIM_ALERTS&&!0===NotificationsState.notificationFilters.SHOW_DCIM_ALERTS||t.resourceType===NotificationGroups.INCIDENTS);return void 0!==NotificationsState.dateFilters.FROM_DATE&&void 0!==NotificationsState.dateFilters.TO_DATE?t.filter(t=>0<=differenceInHours(new Date(t.createdAt),NotificationsState.dateFilters.FROM_DATE)&&differenceInDays(new Date(t.createdAt),NotificationsState.dateFilters.TO_DATE)<=0):void 0!==NotificationsState.dateFilters.FROM_DATE&&void 0===NotificationsState.dateFilters.TO_DATE?t.filter(t=>0<=differenceInHours(new Date(t.createdAt),NotificationsState.dateFilters.FROM_DATE)):void 0===NotificationsState.dateFilters.FROM_DATE&&void 0!==NotificationsState.dateFilters.TO_DATE?t.filter(t=>differenceInDays(new Date(t.createdAt),NotificationsState.dateFilters.TO_DATE)<=0):t}displayDateFilters(){this.showDateFilters=!this.showDateFilters}renderGroupedView(){var t=this.applyNotificationFilters();return html`<div class="-mx-4 -mt-2"><grouped-item data-testid="planned-maintenance-group" groupTitle="Planned Maintenance" groupIcon="${plannedMaintenance.strings[0]}" .childItems="${null==t?void 0:t.filter(t=>t.resourceType===NotificationGroups.PLANNED_MAINTENANCE)}"></grouped-item><grouped-item data-testid="emergency-repairs-group" groupTitle="Emergency Repairs" groupIcon="report" .childItems="${null==t?void 0:t.filter(t=>t.resourceType===NotificationGroups.INCIDENTS)}"></grouped-item><grouped-item data-testid="service-ticket-updates-group" groupTitle="Service Ticket Updates" groupIcon="sync_saved_locally" .childItems="${null==t?void 0:t.filter(t=>t.resourceType===NotificationGroups.SERVICE_TICKETS)}"></grouped-item><grouped-item data-testid="dcim-alerts-group" groupTitle="${NotificationGroups.DCIM_ALERTS}" groupIcon="${dcim.strings[0]}" .childItems="${null==t?void 0:t.filter(t=>t.resourceType===NotificationGroups.DCIM_ALERTS)}"></grouped-item></div>`}renderDefaultView(){var t=this.applyNotificationFilters(),e=t.filter(t=>0===differenceInDays(new Date(t.createdAt),new Date)),i=t.filter(t=>0!==differenceInDays(new Date(t.createdAt),new Date));return 0<(null==t?void 0:t.length)?html`<h3>Today</h3>${0<e.length?html`<div class="-mx-4">${null==e?void 0:e.map(t=>html`<notification-item ?read="${t.status!==NotificationStatus.UNREAD}" data-testclass="today-notification" .notification="${t}" ?disabled="${t.resourceType===NotificationGroups.INCIDENTS}"></notification-item>`)}</div>`:this.renderNoResult()}<h3>Earlier</h3>${0<i.length?html`<div class="-mx-4">${null==i?void 0:i.map(t=>html`<notification-item ?read="${t.status!==NotificationStatus.UNREAD}" data-testclass="earlier-notification" .notification="${t}" ?disabled="${t.resourceType===NotificationGroups.INCIDENTS}"></notification-item>`)}</div>`:this.renderNoResult()}`:html`<h3>Today</h3>${this.renderNoResult()}`}renderNoResult(){return html`<p class="dlr-text-caption my-4"><strong>No notifications yet.</strong></p>`}handleCloseClick(t){this.showDateFilters=!1,this.showFilters=!1}handleContentScroll(t){null!==t&&t.detail.scrollTop+t.detail.clientHeight>=t.detail.scrollHeight-2&&NotificationsState.getNotifications()}manageFilterVisibility(t){t=t.composedPath();!this.showFilters||t.includes(this.groupFilters)||t.includes(this.groupFiltersButton)||(this.showFilters=!1),!this.showDateFilters||t.includes(this.dateFilters)||t.includes(this.dateFiltersButton)||(this.showDateFilters=!1)}render(){return html`<notification-tooltip data-testid="notifications-tooltip"></notification-tooltip><confirmation-dialog data-testid="notifications-confirm-read-dialog" ?open="${this.showMarkAllReadConfirmation}" @confirm-dialog-closed="${()=>{this.showMarkAllReadConfirmation=!1}}" @on-confirm-selection="${this.confirmedMarkAllRead}" textMessage="Are you sure you want to mark all notifications as read?"></confirmation-dialog><ix-drawer data-testid="notifications-drawer" ?isVisible="${NotificationsState.showDrawer}" .onClosed="${()=>this.toggleDrawer()}" animate-vertical hide-close @on-content-scroll="${this.handleContentScroll}" @click="${this.manageFilterVisibility}" compact="compact"><div slot="content" class="m-4"><div class="flex flex-row justify-between grow items-center notification-header-container mb-4"><h2 data-testid="notifications-heading" class="grow items-center dlr-text-heading">Notifications</h2><div class="flex flex-row justify-end grow items-center options" style="--md-icon-button-icon-size:24px"><ix-icon-button data-testid="notifications-cta-all-read" data-testclass="notifications-cta" @click="${this.markAllread}" @mouseover="${t=>{0<NotificationsState.unreadNotificationCount&&window.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:"Mark All Read",target:t.target}}))}}" @mouseout="${()=>window.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" icon="markunread_mailbox" class="${NotificationsState.unreadNotificationCount<=0?"inactive-icon":"active-icon"}" .disabled="${NotificationsState.unreadNotificationCount<=0}" filledIcon="true"></ix-icon-button><ix-icon-button data-testid="notifications-cta-sort-type" data-testclass="notifications-cta" @click="${this.toggleGroupView}" @mouseover="${t=>{window.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:"Sort by Type",target:t.target}}))}}" @mouseout="${()=>window.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" class="active-icon" label="Sort by Type"><ix-icon slot="default">${this.showGroupedView?sortCheck:"sort"}</ix-icon></ix-icon-button><ix-icon-button data-testid="notifications-cta-filter-type" data-testclass="notifications-cta" @click="${this.displayFilters}" @mouseover="${t=>{window.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:"Filter by Type",target:t.target}}))}}" @mouseout="${()=>window.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" class="active-icon" id="group-filter-button" label="Filter by Type"><ix-icon slot="default">${viewList}</ix-icon></ix-icon-button><div data-testid="notifications-filter-dropdown" class="filter-dropdown-content ${this.showFilters?"active z-50":"hidden"}"><group-filters></group-filters></div><ix-icon-button data-testid="notifications-cta-filter-date" data-testclass="notifications-cta" @click="${this.displayDateFilters}" @mouseover="${t=>{window.dispatchEvent(new CustomEvent("show-notification-tooltip",{detail:{label:"Filter by Date",target:t.target}}))}}" @mouseout="${()=>window.dispatchEvent(new CustomEvent("hide-notification-tooltip"))}" icon="date_range" class="active-icon" filledIcon="true" id="date-filters-button" label="Filter by Date"></ix-icon-button><div data-testid="notifications-date-filter-dropdown" class="datefilter-dropdown-content ${this.showDateFilters?"active z-50":"hidden"}" @on-selection="${this.handleCloseClick}"><date-filters></date-filters></div></div></div>${this.showGroupedView?this.renderGroupedView():this.renderDefaultView()}</div></ix-drawer>`}}IxNotifications.styles=[TWStyles,NotificationsStyle],__decorate([query("group-filters")],IxNotifications.prototype,"groupFilters",void 0),__decorate([query("ix-icon-button#group-filter-button")],IxNotifications.prototype,"groupFiltersButton",void 0),__decorate([query("date-filters")],IxNotifications.prototype,"dateFilters",void 0),__decorate([query("ix-icon-button#date-filters-button")],IxNotifications.prototype,"dateFiltersButton",void 0),__decorate([state()],IxNotifications.prototype,"showGroupedView",void 0),__decorate([state()],IxNotifications.prototype,"showFilters",void 0),__decorate([state()],IxNotifications.prototype,"showDateFilters",void 0),__decorate([state()],IxNotifications.prototype,"showMarkAllReadConfirmation",void 0),__decorate([property({type:String})],IxNotifications.prototype,"baseApiUrl",void 0),__decorate([property({type:String})],IxNotifications.prototype,"localStorageKey",void 0),window.customElements.define("ix-notifications",IxNotifications);
package/dist/src/tw.js CHANGED
@@ -588,6 +588,14 @@ video {
588
588
  text-transform:var(--text-caption-transform);
589
589
  }
590
590
 
591
+ .visible {
592
+ visibility: visible;
593
+ }
594
+
595
+ .collapse {
596
+ visibility: collapse;
597
+ }
598
+
591
599
  .static {
592
600
  position: static;
593
601
  }
@@ -651,10 +659,22 @@ video {
651
659
  margin-right: 1rem;
652
660
  }
653
661
 
662
+ .block {
663
+ display: block;
664
+ }
665
+
654
666
  .flex {
655
667
  display: flex;
656
668
  }
657
669
 
670
+ .table {
671
+ display: table;
672
+ }
673
+
674
+ .contents {
675
+ display: contents;
676
+ }
677
+
658
678
  .hidden {
659
679
  display: none;
660
680
  }
@@ -667,14 +687,30 @@ video {
667
687
  width: 580px;
668
688
  }
669
689
 
690
+ .flex-grow {
691
+ flex-grow: 1;
692
+ }
693
+
670
694
  .grow {
671
695
  flex-grow: 1;
672
696
  }
673
697
 
698
+ .border-collapse {
699
+ border-collapse: collapse;
700
+ }
701
+
702
+ .transform {
703
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
704
+ }
705
+
674
706
  .cursor-pointer {
675
707
  cursor: pointer;
676
708
  }
677
709
 
710
+ .resize {
711
+ resize: both;
712
+ }
713
+
678
714
  .flex-row {
679
715
  flex-direction: row;
680
716
  }
@@ -723,6 +759,10 @@ video {
723
759
  border-radius: 9999px;
724
760
  }
725
761
 
762
+ .border {
763
+ border-width: 1px;
764
+ }
765
+
726
766
  .border-b {
727
767
  border-bottom-width: 1px;
728
768
  }
@@ -772,6 +812,10 @@ video {
772
812
  padding-left: 0.25rem;
773
813
  }
774
814
 
815
+ .pl-3 {
816
+ padding-left: 0.75rem;
817
+ }
818
+
775
819
  .pl-3\\.5 {
776
820
  padding-left: 0.875rem;
777
821
  }
@@ -842,6 +886,14 @@ video {
842
886
  color: rgb(255 255 255 / var(--tw-text-opacity, 1));
843
887
  }
844
888
 
889
+ .underline {
890
+ text-decoration-line: underline;
891
+ }
892
+
893
+ .outline {
894
+ outline-style: solid;
895
+ }
896
+
845
897
  .filter {
846
898
  filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
847
899
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tw.js","sourceRoot":"","sources":["../../src/tw.ts"],"names":[],"mappings":"AACI,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAi3B5B,CAAA","sourcesContent":["\n import { css } from \"lit\";\n export const TWStyles = css` *, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n/*\n! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com\n*/\n\n/*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box;\n /* 1 */\n border-width: 0;\n /* 2 */\n border-style: solid;\n /* 2 */\n border-color: #e5e7eb;\n /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured sans font-family by default.\n5. Use the user's configured sans font-feature-settings by default.\n6. Use the user's configured sans font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5;\n /* 1 */\n -webkit-text-size-adjust: 100%;\n /* 2 */\n -moz-tab-size: 4;\n /* 3 */\n -o-tab-size: 4;\n tab-size: 4;\n /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n /* 4 */\n font-feature-settings: normal;\n /* 5 */\n font-variation-settings: normal;\n /* 6 */\n -webkit-tap-highlight-color: transparent;\n /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from html so users can set them as a class directly on the html element.\n*/\n\nbody {\n margin: 0;\n /* 1 */\n line-height: inherit;\n /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0;\n /* 1 */\n color: inherit;\n /* 2 */\n border-top-width: 1px;\n /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured mono font-family by default.\n2. Use the user's configured mono font-feature-settings by default.\n3. Use the user's configured mono font-variation-settings by default.\n4. Correct the odd em font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n /* 1 */\n font-feature-settings: normal;\n /* 2 */\n font-variation-settings: normal;\n /* 3 */\n font-size: 1em;\n /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent sub and sup elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0;\n /* 1 */\n border-color: inherit;\n /* 2 */\n border-collapse: collapse;\n /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit;\n /* 1 */\n font-feature-settings: inherit;\n /* 1 */\n font-variation-settings: inherit;\n /* 1 */\n font-size: 100%;\n /* 1 */\n font-weight: inherit;\n /* 1 */\n line-height: inherit;\n /* 1 */\n letter-spacing: inherit;\n /* 1 */\n color: inherit;\n /* 1 */\n margin: 0;\n /* 2 */\n padding: 0;\n /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type='button']),\ninput:where([type='reset']),\ninput:where([type='submit']) {\n -webkit-appearance: button;\n /* 1 */\n background-color: transparent;\n /* 2 */\n background-image: none;\n /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional :invalid styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield;\n /* 1 */\n outline-offset: -2px;\n /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to inherit in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button;\n /* 1 */\n font: inherit;\n /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\n\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1;\n /* 1 */\n color: #9ca3af;\n /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1;\n /* 1 */\n color: #9ca3af;\n /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements display: block by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add vertical-align: middle to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block;\n /* 1 */\n vertical-align: middle;\n /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n\n[hidden]:where(:not([hidden=\"until-found\"])) {\n display: none;\n}\n\n.dlr-text-default,:host,:host :root,:root,html {\n font-family: var(--root-primary-font);\n font-size: var(--text-default-size);\n line-height: var(--text-default-line-height);\n letter-spacing: var(--text-default-letter-spacing);\n font-weight: var(--text-default-weight);\n -webkit-text-decoration:var(--text-default-decoration);\n text-decoration:var(--text-default-decoration);\n text-transform:var(--text-default-transform);\n}\n\n.dlr-text-heading {\n font-family: var(--root-secondary-font);\n font-size: var(--text-heading-size);\n line-height: var(--text-heading-line-height);\n letter-spacing: var(--text-heading-letter-spacing);\n font-weight: var(--text-heading-weight);\n -webkit-text-decoration:var(--text-heading-decoration);\n text-decoration:var(--text-heading-decoration);\n text-transform:var(--text-heading-transform);\n}\n\n.dlr-text-caption {\n font-family: var(--root-primary-font);\n font-size: var(--text-caption-size);\n line-height: var(--text-caption-line-height);\n letter-spacing: var(--text-caption-letter-spacing);\n font-weight: var(--text-caption-weight);\n -webkit-text-decoration:var(--text-caption-decoration);\n text-decoration:var(--text-caption-decoration);\n text-transform:var(--text-caption-transform);\n}\n\n.static {\n position: static;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.-start-0 {\n inset-inline-start: -0px;\n}\n\n.z-50 {\n z-index: 50;\n}\n\n.z-\\\\[9999\\\\] {\n z-index: 9999;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-4 {\n margin: 1rem;\n}\n\n.-mx-4 {\n margin-left: -1rem;\n margin-right: -1rem;\n}\n\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.mb-4 {\n margin-bottom: 1rem;\n}\n\n.ml-14 {\n margin-left: 3.5rem;\n}\n\n.mr-4 {\n margin-right: 1rem;\n}\n\n.flex {\n display: flex;\n}\n\n.hidden {\n display: none;\n}\n\n.w-\\\\[560px\\\\] {\n width: 560px;\n}\n\n.w-\\\\[580px\\\\] {\n width: 580px;\n}\n\n.grow {\n flex-grow: 1;\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.flex-row {\n flex-direction: row;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-3 {\n gap: 0.75rem;\n}\n\n.whitespace-nowrap {\n white-space: nowrap;\n}\n\n.text-wrap {\n text-wrap: wrap;\n}\n\n.text-balance {\n text-wrap: balance;\n}\n\n.rounded {\n border-radius: 0.25rem;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border-b {\n border-bottom-width: 1px;\n}\n\n.border-l-3 {\n border-left-width: 3px;\n}\n\n.border-outline {\n border-color: var(--cp-neutral-blue-12p);\n}\n\n.border-success {\n border-color: var(--cp-success-50);\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.fill-primary {\n fill: var(--cp-dlr-blue-50);\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n\n.pb-0 {\n padding-bottom: 0px;\n}\n\n.pl-1 {\n padding-left: 0.25rem;\n}\n\n.pl-3\\\\.5 {\n padding-left: 0.875rem;\n}\n\n.pl-4 {\n padding-left: 1rem;\n}\n\n.pr-1 {\n padding-right: 0.25rem;\n}\n\n.pt-4 {\n padding-top: 1rem;\n}\n\n.text-center {\n text-align: center;\n}\n\n.text-right {\n text-align: right;\n}\n\n.align-middle {\n vertical-align: middle;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-normal {\n font-weight: 400;\n}\n\n.text-on-surface-disabled {\n color: var(--cp-neutral-blue-50p);\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.hover\\\\:bg-\\\\[rgba\\\\(0\\\\2c 0\\\\2c 0\\\\2c 0\\\\.04\\\\)\\\\]:hover {\n background-color: rgba(0,0,0,0.04);\n}\n\n.hover\\\\:bg-primary-subtle:hover {\n background-color: var(--cp-dlr-blue-10p);\n}\n\n@media (min-width: 600px) {\n .sm\\\\:flex-col {\n flex-direction: column;\n }\n\n .md\\\\:flex-col {\n flex-direction: column;\n }\n}\n\n@media (min-width: 1200px) {\n .lg\\\\:flex-col {\n flex-direction: column;\n }\n\n .xl\\\\:flex-row {\n flex-direction: row;\n }\n} `\n "]}
1
+ {"version":3,"file":"tw.js","sourceRoot":"","sources":["../../src/tw.ts"],"names":[],"mappings":"AACI,OAAO,EAAE,GAAG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"lit\";\n export const TWStyles = css` *, ::before, ::after {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n::backdrop {\n --tw-border-spacing-x: 0;\n --tw-border-spacing-y: 0;\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-gradient-from-position: ;\n --tw-gradient-via-position: ;\n --tw-gradient-to-position: ;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n --tw-contain-size: ;\n --tw-contain-layout: ;\n --tw-contain-paint: ;\n --tw-contain-style: ;\n}\n\n/*\n! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com\n*/\n\n/*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box;\n /* 1 */\n border-width: 0;\n /* 2 */\n border-style: solid;\n /* 2 */\n border-color: #e5e7eb;\n /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured sans font-family by default.\n5. Use the user's configured sans font-feature-settings by default.\n6. Use the user's configured sans font-variation-settings by default.\n7. Disable tap highlights on iOS\n*/\n\nhtml,\n:host {\n line-height: 1.5;\n /* 1 */\n -webkit-text-size-adjust: 100%;\n /* 2 */\n -moz-tab-size: 4;\n /* 3 */\n -o-tab-size: 4;\n tab-size: 4;\n /* 3 */\n font-family: ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n /* 4 */\n font-feature-settings: normal;\n /* 5 */\n font-variation-settings: normal;\n /* 6 */\n -webkit-tap-highlight-color: transparent;\n /* 7 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from html so users can set them as a class directly on the html element.\n*/\n\nbody {\n margin: 0;\n /* 1 */\n line-height: inherit;\n /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0;\n /* 1 */\n color: inherit;\n /* 2 */\n border-top-width: 1px;\n /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured mono font-family by default.\n2. Use the user's configured mono font-feature-settings by default.\n3. Use the user's configured mono font-variation-settings by default.\n4. Correct the odd em font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n /* 1 */\n font-feature-settings: normal;\n /* 2 */\n font-variation-settings: normal;\n /* 3 */\n font-size: 1em;\n /* 4 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent sub and sup elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0;\n /* 1 */\n border-color: inherit;\n /* 2 */\n border-collapse: collapse;\n /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit;\n /* 1 */\n font-feature-settings: inherit;\n /* 1 */\n font-variation-settings: inherit;\n /* 1 */\n font-size: 100%;\n /* 1 */\n font-weight: inherit;\n /* 1 */\n line-height: inherit;\n /* 1 */\n letter-spacing: inherit;\n /* 1 */\n color: inherit;\n /* 1 */\n margin: 0;\n /* 2 */\n padding: 0;\n /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\ninput:where([type='button']),\ninput:where([type='reset']),\ninput:where([type='submit']) {\n -webkit-appearance: button;\n /* 1 */\n background-color: transparent;\n /* 2 */\n background-image: none;\n /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional :invalid styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield;\n /* 1 */\n outline-offset: -2px;\n /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to inherit in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button;\n /* 1 */\n font: inherit;\n /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nReset default styling for dialogs.\n*/\n\ndialog {\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1;\n /* 1 */\n color: #9ca3af;\n /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1;\n /* 1 */\n color: #9ca3af;\n /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements display: block by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add vertical-align: middle to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block;\n /* 1 */\n vertical-align: middle;\n /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/* Make elements with the HTML hidden attribute stay hidden by default */\n\n[hidden]:where(:not([hidden=\"until-found\"])) {\n display: none;\n}\n\n.dlr-text-default,:host,:host :root,:root,html {\n font-family: var(--root-primary-font);\n font-size: var(--text-default-size);\n line-height: var(--text-default-line-height);\n letter-spacing: var(--text-default-letter-spacing);\n font-weight: var(--text-default-weight);\n -webkit-text-decoration:var(--text-default-decoration);\n text-decoration:var(--text-default-decoration);\n text-transform:var(--text-default-transform);\n}\n\n.dlr-text-heading {\n font-family: var(--root-secondary-font);\n font-size: var(--text-heading-size);\n line-height: var(--text-heading-line-height);\n letter-spacing: var(--text-heading-letter-spacing);\n font-weight: var(--text-heading-weight);\n -webkit-text-decoration:var(--text-heading-decoration);\n text-decoration:var(--text-heading-decoration);\n text-transform:var(--text-heading-transform);\n}\n\n.dlr-text-caption {\n font-family: var(--root-primary-font);\n font-size: var(--text-caption-size);\n line-height: var(--text-caption-line-height);\n letter-spacing: var(--text-caption-letter-spacing);\n font-weight: var(--text-caption-weight);\n -webkit-text-decoration:var(--text-caption-decoration);\n text-decoration:var(--text-caption-decoration);\n text-transform:var(--text-caption-transform);\n}\n\n.visible {\n visibility: visible;\n}\n\n.collapse {\n visibility: collapse;\n}\n\n.static {\n position: static;\n}\n\n.absolute {\n position: absolute;\n}\n\n.relative {\n position: relative;\n}\n\n.-start-0 {\n inset-inline-start: -0px;\n}\n\n.z-50 {\n z-index: 50;\n}\n\n.z-\\\\[9999\\\\] {\n z-index: 9999;\n}\n\n.m-0 {\n margin: 0px;\n}\n\n.m-4 {\n margin: 1rem;\n}\n\n.-mx-4 {\n margin-left: -1rem;\n margin-right: -1rem;\n}\n\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n\n.-mt-2 {\n margin-top: -0.5rem;\n}\n\n.mb-4 {\n margin-bottom: 1rem;\n}\n\n.ml-14 {\n margin-left: 3.5rem;\n}\n\n.mr-4 {\n margin-right: 1rem;\n}\n\n.block {\n display: block;\n}\n\n.flex {\n display: flex;\n}\n\n.table {\n display: table;\n}\n\n.contents {\n display: contents;\n}\n\n.hidden {\n display: none;\n}\n\n.w-\\\\[560px\\\\] {\n width: 560px;\n}\n\n.w-\\\\[580px\\\\] {\n width: 580px;\n}\n\n.flex-grow {\n flex-grow: 1;\n}\n\n.grow {\n flex-grow: 1;\n}\n\n.border-collapse {\n border-collapse: collapse;\n}\n\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n\n.cursor-pointer {\n cursor: pointer;\n}\n\n.resize {\n resize: both;\n}\n\n.flex-row {\n flex-direction: row;\n}\n\n.flex-col {\n flex-direction: column;\n}\n\n.items-center {\n align-items: center;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.gap-2 {\n gap: 0.5rem;\n}\n\n.gap-3 {\n gap: 0.75rem;\n}\n\n.whitespace-nowrap {\n white-space: nowrap;\n}\n\n.text-wrap {\n text-wrap: wrap;\n}\n\n.text-balance {\n text-wrap: balance;\n}\n\n.rounded {\n border-radius: 0.25rem;\n}\n\n.rounded-full {\n border-radius: 9999px;\n}\n\n.border {\n border-width: 1px;\n}\n\n.border-b {\n border-bottom-width: 1px;\n}\n\n.border-l-3 {\n border-left-width: 3px;\n}\n\n.border-outline {\n border-color: var(--cp-neutral-blue-12p);\n}\n\n.border-success {\n border-color: var(--cp-success-50);\n}\n\n.border-transparent {\n border-color: transparent;\n}\n\n.fill-primary {\n fill: var(--cp-dlr-blue-50);\n}\n\n.p-1 {\n padding: 0.25rem;\n}\n\n.p-2 {\n padding: 0.5rem;\n}\n\n.p-4 {\n padding: 1rem;\n}\n\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n\n.pb-0 {\n padding-bottom: 0px;\n}\n\n.pl-1 {\n padding-left: 0.25rem;\n}\n\n.pl-3 {\n padding-left: 0.75rem;\n}\n\n.pl-3\\\\.5 {\n padding-left: 0.875rem;\n}\n\n.pl-4 {\n padding-left: 1rem;\n}\n\n.pr-1 {\n padding-right: 0.25rem;\n}\n\n.pt-4 {\n padding-top: 1rem;\n}\n\n.text-center {\n text-align: center;\n}\n\n.text-right {\n text-align: right;\n}\n\n.align-middle {\n vertical-align: middle;\n}\n\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n\n.font-bold {\n font-weight: 700;\n}\n\n.font-normal {\n font-weight: 400;\n}\n\n.text-on-surface-disabled {\n color: var(--cp-neutral-blue-50p);\n}\n\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n\n.underline {\n text-decoration-line: underline;\n}\n\n.outline {\n outline-style: solid;\n}\n\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);\n}\n\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n\n.hover\\\\:bg-\\\\[rgba\\\\(0\\\\2c 0\\\\2c 0\\\\2c 0\\\\.04\\\\)\\\\]:hover {\n background-color: rgba(0,0,0,0.04);\n}\n\n.hover\\\\:bg-primary-subtle:hover {\n background-color: var(--cp-dlr-blue-10p);\n}\n\n@media (min-width: 600px) {\n .sm\\\\:flex-col {\n flex-direction: column;\n }\n\n .md\\\\:flex-col {\n flex-direction: column;\n }\n}\n\n@media (min-width: 1200px) {\n .lg\\\\:flex-col {\n flex-direction: column;\n }\n\n .xl\\\\:flex-row {\n flex-direction: row;\n }\n} `\n "]}
@@ -1 +1 @@
1
- import '../src/testHarness.js';
1
+ export {};
@@ -1,17 +1,17 @@
1
1
  /* eslint-disable no-await-in-loop */
2
2
  import { expect } from '@open-wc/testing';
3
3
  import { executeServerCommand, sendKeys, sendMouse, } from '@web/test-runner-commands';
4
- import '../src/testHarness.js';
5
4
  import { fixtureBeforeEach, fixtureBefore, fixtureAfterEach, screenshotAndCompare,
6
5
  // mockDataMeta
7
6
  } from './utils/helpers.js';
8
7
  describe('date filter', () => {
9
8
  let dateFilterDropDownInfo = [];
9
+ let testHarness;
10
10
  before(async () => {
11
11
  await fixtureBefore();
12
12
  });
13
13
  beforeEach(async () => {
14
- await fixtureBeforeEach();
14
+ testHarness = await fixtureBeforeEach();
15
15
  await executeServerCommand('mouseFocusInfo', {
16
16
  selector: '[data-testid="notifications-cta-filter-date"] md-icon-button',
17
17
  });
@@ -121,70 +121,14 @@ describe('date filter', () => {
121
121
  // Format all dates
122
122
  const now = formatDate(today);
123
123
  const prev = formatDate(yesterday);
124
- await executeServerCommand('mouseFocusInfo', {
125
- selector: '[data-testid="notifications-from-date"]',
126
- });
127
- // TODO: these key strokes are in the wrong order because the date picker is not formatted correctly
128
- // I also have problems in general with typing in the date picker, it might be the max attribute
129
- // or it might be just trying to validate too much as I type, if you start typing a month and press just
130
- // '3', it will move you into the next field because there is no 30th month so you must start with '1' or '0'.
131
- await sendKeys({
132
- press: 'Backspace',
133
- });
134
- await sendKeys({
135
- press: 'ArrowRight',
136
- });
137
- await sendKeys({
138
- press: 'ArrowRight',
139
- });
140
- await sendKeys({
141
- type: prev.year,
142
- });
143
- await sendKeys({
144
- press: 'ArrowLeft',
145
- });
146
- await sendKeys({
147
- type: prev.day,
148
- });
149
- await sendKeys({
150
- press: 'ArrowLeft',
151
- });
152
- await sendKeys({
153
- press: 'ArrowLeft',
154
- });
155
- await sendKeys({
156
- type: prev.month,
157
- });
158
- await executeServerCommand('mouseFocusInfo', {
159
- selector: '[data-testid="notifications-to-date"]',
160
- });
161
- await sendKeys({
162
- press: 'Backspace',
163
- });
164
- await sendKeys({
165
- press: 'ArrowRight',
166
- });
167
- await sendKeys({
168
- press: 'ArrowRight',
169
- });
170
- await sendKeys({
171
- type: now.year,
172
- });
173
- await sendKeys({
174
- press: 'ArrowLeft',
175
- });
176
- await sendKeys({
177
- type: now.day,
178
- });
179
- await sendKeys({
180
- press: 'ArrowLeft',
181
- });
182
- await sendKeys({
183
- press: 'ArrowLeft',
184
- });
185
- await sendKeys({
186
- type: now.month,
187
- });
124
+ const ixDates = testHarness
125
+ .shadowRoot.querySelector('ix-notifications')
126
+ .shadowRoot.querySelector('ix-drawer div[slot="content"] date-filters')
127
+ .shadowRoot.querySelectorAll('ix-date');
128
+ ixDates[0].shadowRoot.querySelector('ix-field input').value = `${prev.year}-${prev.month}-${prev.day}`;
129
+ ixDates[0].onChanged(`${prev.year}-${prev.month}-${prev.day}`);
130
+ ixDates[1].shadowRoot.querySelector('ix-field input').value = `${now.year}-${now.month}-${now.day}`;
131
+ ixDates[1].onChanged(`${now.year}-${now.month}-${now.day}`);
188
132
  await screenshotAndCompare('filter-data-dropdown-populated');
189
133
  await executeServerCommand('mouseFocusInfo', {
190
134
  selector: '[data-testid="notifications-activate-date-filter"]',
@@ -1 +1 @@
1
- {"version":3,"file":"date-filter.test.js","sourceRoot":"","sources":["../../test/date-filter.test.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,SAAS,GACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAEhB,oBAAoB;AACpB,gBAAgB;EACjB,MAAM,oBAAoB,CAAC;AAE5B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,sBAAsB,GAAgB,EAAE,CAAC;IAE7C,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,aAAa,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,MAAM,iBAAiB,EAAE,CAAC;QAE1B,MAAM,oBAAoB,CAAC,gBAAgB,EAAE;YAC3C,QAAQ,EAAE,8DAA8D;SACzE,CAAC,CAAC;QAEH,MAAM,QAAQ,CAAC;YACb,KAAK,EAAE,O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EH,oBAAoB,GAAG,MAAM,oBAAoB,CAAC,gBAAgB,EAAE;YAClE,QAAQ,EAAE,mBAAmB;YAC7B,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QAEH,+BAA+B;QAC/B,yEAAyE;QAEzE,MAAM,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable no-await-in-loop */\nimport { expect } from '@open-wc/testing';\n\nimport {\n executeServerCommand,\n sendKeys,\n sendMouse,\n} from '@web/test-runner-commands';\nimport '../src/testHarness.js';\nimport {\n fixtureBeforeEach,\n fixtureBefore,\n fixtureAfterEach,\n TelemInfo,\n screenshotAndCompare,\n // mockDataMeta\n} from './utils/helpers.js';\n\ndescribe('date filter', () => {\n let dateFilterDropDownInfo: TelemInfo[] = [];\n\n before(async () => {\n await fixtureBefore();\n });\n\n beforeEach(async () => {\n await fixtureBeforeEach();\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-cta-filter-date\"] md-icon-button',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n dateFilterDropDownInfo = await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-date-filter-dropdown\"]',\n action: 'info',\n });\n });\n\n afterEach(async () => {\n fixtureAfterEach();\n });\n\n it('should be open and toggle visibility when clicking the button', async () => {\n expect(dateFilterDropDownInfo[0].isVisible).to.be.true;\n\n await screenshotAndCompare('filter-date-dropdown-open');\n\n await sendKeys({\n press: 'Space',\n });\n\n dateFilterDropDownInfo = await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-date-filter-dropdown\"]',\n action: 'info',\n });\n\n expect(dateFilterDropDownInfo[0].isVisible).to.be.false;\n\n await screenshotAndCompare('filter-date-dropdown-closed');\n });\n\n it('should close when clicking outside the dropdown', async () => {\n const headingPosition: [number, number] = await executeServerCommand(\n 'mouseFocusInfo',\n {\n selector: '[data-testid=\"notifications-heading\"]',\n action: 'mouse',\n }\n );\n\n await sendMouse({\n type: 'click',\n position: headingPosition,\n });\n\n dateFilterDropDownInfo = await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-date-filter-dropdown\"]',\n action: 'info',\n });\n\n expect(dateFilterDropDownInfo[0].isVisible).to.be.false;\n });\n\n it('should close when clicking cancel', async () => {\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-cancel-date-filter\"]',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n dateFilterDropDownInfo = await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-date-filter-dropdown\"]',\n action: 'info',\n });\n\n expect(dateFilterDropDownInfo[0].isVisible).to.be.false;\n });\n\n it('should trigger validation on the from date field', async () => {\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-from-date\"]',\n });\n\n await sendKeys({\n press: 'Backspace',\n });\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-activate-date-filter\"]',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n const fromValidationError: TelemInfo[] = await executeServerCommand(\n 'mouseFocusInfo',\n {\n selector: '[data-testid=\"notifications-from-date\"] ix-field.error',\n action: 'info',\n }\n );\n\n expect(fromValidationError.length).to.equal(1);\n\n await screenshotAndCompare('filter-date-dropdown-from-error');\n });\n\n it('should trigger validation on the to date field', async () => {\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-to-date\"]',\n });\n\n await sendKeys({\n press: 'Backspace',\n });\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-activate-date-filter\"]',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n const fromValidationError: TelemInfo[] = await executeServerCommand(\n 'mouseFocusInfo',\n {\n selector: '[data-testid=\"notifications-to-date\"] ix-field.error',\n action: 'info',\n }\n );\n\n expect(fromValidationError.length).to.equal(1);\n\n await screenshotAndCompare('filter-date-dropdown-to-error');\n });\n\n it('should filter out items which do not match the date range and clearing the filter should restore them', async () => {\n const formatDate = (date: Date) => ({\n day: date.getDate().toString().padStart(2, '0'),\n month: (date.getMonth() + 1).toString().padStart(2, '0'),\n year: date.getFullYear().toString(),\n });\n\n // Get today's date\n const today = new Date();\n\n // Get yesterday's date\n const yesterday = new Date(today);\n yesterday.setDate(today.getDate() - 1);\n\n // Format all dates\n const now = formatDate(today);\n const prev = formatDate(yesterday);\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-from-date\"]',\n });\n\n // TODO: these key strokes are in the wrong order because the date picker is not formatted correctly\n // I also have problems in general with typing in the date picker, it might be the max attribute\n // or it might be just trying to validate too much as I type, if you start typing a month and press just\n // '3', it will move you into the next field because there is no 30th month so you must start with '1' or '0'.\n await sendKeys({\n press: 'Backspace',\n });\n\n await sendKeys({\n press: 'ArrowRight',\n });\n\n await sendKeys({\n press: 'ArrowRight',\n });\n\n await sendKeys({\n type: prev.year,\n });\n\n await sendKeys({\n press: 'ArrowLeft',\n });\n\n await sendKeys({\n type: prev.day,\n });\n\n await sendKeys({\n press: 'ArrowLeft',\n });\n\n await sendKeys({\n press: 'ArrowLeft',\n });\n\n await sendKeys({\n type: prev.month,\n });\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-to-date\"]',\n });\n\n await sendKeys({\n press: 'Backspace',\n });\n\n await sendKeys({\n press: 'ArrowRight',\n });\n\n await sendKeys({\n press: 'ArrowRight',\n });\n\n await sendKeys({\n type: now.year,\n });\n\n await sendKeys({\n press: 'ArrowLeft',\n });\n\n await sendKeys({\n type: now.day,\n });\n\n await sendKeys({\n press: 'ArrowLeft',\n });\n\n await sendKeys({\n press: 'ArrowLeft',\n });\n await sendKeys({\n type: now.month,\n });\n\n await screenshotAndCompare('filter-data-dropdown-populated');\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-activate-date-filter\"]',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n let notificationItemInfo: TelemInfo[] = await executeServerCommand(\n 'mouseFocusInfo',\n {\n selector: 'notification-item',\n action: 'info',\n }\n );\n\n expect(notificationItemInfo.length).to.equal(1);\n\n await screenshotAndCompare('filter-date-applied');\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-cta-filter-date\"] md-icon-button',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n await executeServerCommand('mouseFocusInfo', {\n selector:\n '[data-testid=\"notifications-clear-date-filter\"] md-icon-button',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n notificationItemInfo = await executeServerCommand('mouseFocusInfo', {\n selector: 'notification-item',\n action: 'info',\n });\n\n // TODO: Fix this functionality\n // expect(notificationItemInfo.length).to.equal(mockDataMeta.itemsCount);\n\n await screenshotAndCompare('filter-date-cleared');\n });\n});\n"]}
1
+ {"version":3,"file":"date-filter.test.js","sourceRoot":"","sources":["../../test/date-filter.test.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,SAAS,GACV,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,gBAAgB,EAEhB,oBAAoB;AACpB,gBAAgB;EACjB,MAAM,oBAAoB,CAAC;AAG5B,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,IAAI,sBAAsB,GAAgB,EAAE,CAAC;IAC7C,IAAI,WAAqC,CAAC;IAE1C,MAAM,CAAC,KAAK,IAAI,EAAE;QAChB,MAAM,aAAa,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;IAEH,UAAU,CAAC,KAAK,IAAI,EAAE;QACpB,WAAW,GAAG,MAAM,iBAAiB,EAAE,CAAC;QAExC,MAAM,oBAAoB,CAAC,gBAAgB,EAAE;YAC3C,QAAQ,EAAE,8DAA8D;SACzE,CAAC,CAAC;QAEH,MAAM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;QAEH,IAAI,oBAAoB,GAAgB,MAAM,oBAAoB,CAChE,gBAAgB,EAChB;YACE,QAAQ,EAAE,mBAAmB;YAC7B,MAAM,EAAE,MAAM;SACf,CACF,CAAC;QAEF,MAAM,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEhD,MAAM,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;QAElD,MAAM,oBAAoB,CAAC,gBAAgB,EAAE;YAC3C,QAAQ,EAAE,8DAA8D;SACzE,CAAC,CAAC;QAEH,MAAM,QAAQ,CAAC;YACb,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;QAEH,MAAM,oBAAoB,CAAC,gBAAgB,EAAE;YAC3C,QAAQ,EACN,gEAAgE;SACnE,CAAC,CAAC;QAEH,MAAM,QAAQ,CAAC;YACb,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;QAEH,oBAAoB,GAAG,MAAM,oBAAoB,CAAC,gBAAgB,EAAE;YAClE,QAAQ,EAAE,mBAAmB;YAC7B,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QAEH,+BAA+B;QAC/B,yEAAyE;QAEzE,MAAM,oBAAoB,CAAC,qBAAqB,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable no-await-in-loop */\nimport { expect } from '@open-wc/testing';\n\nimport {\n executeServerCommand,\n sendKeys,\n sendMouse,\n} from '@web/test-runner-commands';\nimport {\n fixtureBeforeEach,\n fixtureBefore,\n fixtureAfterEach,\n TelemInfo,\n screenshotAndCompare,\n // mockDataMeta\n} from './utils/helpers.js';\nimport { NotificationsTestHarness } from '../src/testHarness.js';\n\ndescribe('date filter', () => {\n let dateFilterDropDownInfo: TelemInfo[] = [];\n let testHarness: NotificationsTestHarness;\n\n before(async () => {\n await fixtureBefore();\n });\n\n beforeEach(async () => {\n testHarness = await fixtureBeforeEach();\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-cta-filter-date\"] md-icon-button',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n dateFilterDropDownInfo = await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-date-filter-dropdown\"]',\n action: 'info',\n });\n });\n\n afterEach(async () => {\n fixtureAfterEach();\n });\n\n it('should be open and toggle visibility when clicking the button', async () => {\n expect(dateFilterDropDownInfo[0].isVisible).to.be.true;\n\n await screenshotAndCompare('filter-date-dropdown-open');\n\n await sendKeys({\n press: 'Space',\n });\n\n dateFilterDropDownInfo = await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-date-filter-dropdown\"]',\n action: 'info',\n });\n\n expect(dateFilterDropDownInfo[0].isVisible).to.be.false;\n\n await screenshotAndCompare('filter-date-dropdown-closed');\n });\n\n it('should close when clicking outside the dropdown', async () => {\n const headingPosition: [number, number] = await executeServerCommand(\n 'mouseFocusInfo',\n {\n selector: '[data-testid=\"notifications-heading\"]',\n action: 'mouse',\n }\n );\n\n await sendMouse({\n type: 'click',\n position: headingPosition,\n });\n\n dateFilterDropDownInfo = await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-date-filter-dropdown\"]',\n action: 'info',\n });\n\n expect(dateFilterDropDownInfo[0].isVisible).to.be.false;\n });\n\n it('should close when clicking cancel', async () => {\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-cancel-date-filter\"]',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n dateFilterDropDownInfo = await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-date-filter-dropdown\"]',\n action: 'info',\n });\n\n expect(dateFilterDropDownInfo[0].isVisible).to.be.false;\n });\n\n it('should trigger validation on the from date field', async () => {\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-from-date\"]',\n });\n\n await sendKeys({\n press: 'Backspace',\n });\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-activate-date-filter\"]',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n const fromValidationError: TelemInfo[] = await executeServerCommand(\n 'mouseFocusInfo',\n {\n selector: '[data-testid=\"notifications-from-date\"] ix-field.error',\n action: 'info',\n }\n );\n\n expect(fromValidationError.length).to.equal(1);\n\n await screenshotAndCompare('filter-date-dropdown-from-error');\n });\n\n it('should trigger validation on the to date field', async () => {\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-to-date\"]',\n });\n\n await sendKeys({\n press: 'Backspace',\n });\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-activate-date-filter\"]',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n const fromValidationError: TelemInfo[] = await executeServerCommand(\n 'mouseFocusInfo',\n {\n selector: '[data-testid=\"notifications-to-date\"] ix-field.error',\n action: 'info',\n }\n );\n\n expect(fromValidationError.length).to.equal(1);\n\n await screenshotAndCompare('filter-date-dropdown-to-error');\n });\n\n it('should filter out items which do not match the date range and clearing the filter should restore them', async () => {\n const formatDate = (date: Date) => ({\n day: date.getDate().toString().padStart(2, '0'),\n month: (date.getMonth() + 1).toString().padStart(2, '0'),\n year: date.getFullYear().toString(),\n });\n\n // Get today's date\n const today = new Date();\n\n // Get yesterday's date\n const yesterday = new Date(today);\n yesterday.setDate(today.getDate() - 1);\n\n // Format all dates\n const now = formatDate(today);\n const prev = formatDate(yesterday);\n\n const ixDates: any = testHarness\n .shadowRoot!.querySelector('ix-notifications')!\n .shadowRoot!.querySelector('ix-drawer div[slot=\"content\"] date-filters')!\n .shadowRoot!.querySelectorAll('ix-date');\n\n ixDates[0].shadowRoot!.querySelector(\n 'ix-field input'\n ).value = `${prev.year}-${prev.month}-${prev.day}`;\n ixDates[0].onChanged(`${prev.year}-${prev.month}-${prev.day}`);\n ixDates[1].shadowRoot!.querySelector(\n 'ix-field input'\n ).value = `${now.year}-${now.month}-${now.day}`;\n ixDates[1].onChanged(`${now.year}-${now.month}-${now.day}`);\n\n await screenshotAndCompare('filter-data-dropdown-populated');\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-activate-date-filter\"]',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n let notificationItemInfo: TelemInfo[] = await executeServerCommand(\n 'mouseFocusInfo',\n {\n selector: 'notification-item',\n action: 'info',\n }\n );\n\n expect(notificationItemInfo.length).to.equal(1);\n\n await screenshotAndCompare('filter-date-applied');\n\n await executeServerCommand('mouseFocusInfo', {\n selector: '[data-testid=\"notifications-cta-filter-date\"] md-icon-button',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n await executeServerCommand('mouseFocusInfo', {\n selector:\n '[data-testid=\"notifications-clear-date-filter\"] md-icon-button',\n });\n\n await sendKeys({\n press: 'Space',\n });\n\n notificationItemInfo = await executeServerCommand('mouseFocusInfo', {\n selector: 'notification-item',\n action: 'info',\n });\n\n // TODO: Fix this functionality\n // expect(notificationItemInfo.length).to.equal(mockDataMeta.itemsCount);\n\n await screenshotAndCompare('filter-date-cleared');\n });\n});\n"]}
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent ix-notifications following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "Digital Realty",
6
- "version": "1.1.71",
6
+ "version": "1.2.2-alpha.0",
7
7
  "type": "module",
8
8
  "main": "dist/src/index.js",
9
9
  "module": "dist/src/index.js",
@@ -41,16 +41,15 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "@adobe/lit-mobx": "^2.2.2",
44
- "@digital-realty/ix-app-logic": "^1.1.17",
45
- "@digital-realty/ix-button": "^3.3.8",
46
- "@digital-realty/ix-date": "^1.1.27",
47
- "@digital-realty/ix-dialog": "^1.1.21",
48
- "@digital-realty/ix-divider": "^1.1.8",
49
- "@digital-realty/ix-drawer": "^1.1.31",
50
- "@digital-realty/ix-icon": "^1.1.8",
51
- "@digital-realty/ix-icon-button": "^1.1.8",
52
- "@digital-realty/ix-switch": "^2.2.7",
53
- "@digital-realty/ix-toast": "^1.1.8",
44
+ "@digital-realty/ix-button": "^3.4.1",
45
+ "@digital-realty/ix-date": "^1.2.1",
46
+ "@digital-realty/ix-dialog": "^1.2.1",
47
+ "@digital-realty/ix-divider": "^1.2.1",
48
+ "@digital-realty/ix-drawer": "^1.2.1",
49
+ "@digital-realty/ix-icon": "^1.2.1",
50
+ "@digital-realty/ix-icon-button": "^1.2.1",
51
+ "@digital-realty/ix-switch": "^2.3.1",
52
+ "@digital-realty/ix-toast": "^1.2.1",
54
53
  "@digital-realty/ix-twlit": "1.0.1",
55
54
  "@floating-ui/dom": "^1.6.8",
56
55
  "@material/web": "1.2.0",
@@ -70,6 +69,7 @@
70
69
  },
71
70
  "devDependencies": {
72
71
  "@babel/preset-env": "^7.16.4",
72
+ "@digital-realty/ix-app-logic":"1.2.2-alpha.0",
73
73
  "@custom-elements-manifest/analyzer": "^0.4.17",
74
74
  "@open-wc/eslint-config": "^9.2.1",
75
75
  "@openapitools/openapi-generator-cli": "^2.18.3",
@@ -150,6 +150,5 @@
150
150
  "package.json",
151
151
  "README.md",
152
152
  "LICENSE"
153
- ],
154
- "gitHead": "96eee928b7cd382f3b632a8cb2e7e94be6a4bbc8"
153
+ ]
155
154
  }