@watermarkinsights/ripple 5.4.0-1 → 5.5.0-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.
- package/dist/cjs/{global-2fa8e5c2.js → global-5c18b1c4.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/priv-calendar.cjs.entry.js +13 -9
- package/dist/cjs/priv-navigator-item.cjs.entry.js +1 -1
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-date-range.cjs.entry.js +5 -1
- package/dist/cjs/wm-datepicker.cjs.entry.js +5 -1
- package/dist/cjs/wm-navigator.cjs.entry.js +12 -16
- package/dist/collection/components/datepickers/priv-calendar/priv-calendar.js +17 -9
- package/dist/collection/components/datepickers/wm-date-range.js +5 -1
- package/dist/collection/components/datepickers/wm-datepicker.js +5 -1
- package/dist/collection/components/wm-navigator/priv-navigator-item/priv-navigator-item.css +3 -3
- package/dist/collection/components/wm-navigator/wm-navigator.css +1 -0
- package/dist/collection/components/wm-navigator/wm-navigator.js +13 -17
- package/dist/esm/{global-00f6ca22.js → global-931ac675.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/priv-calendar.entry.js +13 -9
- package/dist/esm/priv-navigator-item.entry.js +1 -1
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-date-range.entry.js +5 -1
- package/dist/esm/wm-datepicker.entry.js +5 -1
- package/dist/esm/wm-navigator.entry.js +12 -16
- package/dist/esm-es5/{global-00f6ca22.js → global-931ac675.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-navigator-item.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-date-range.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/ripple/p-021ff5fa.system.entry.js +1 -0
- package/dist/ripple/{p-0e31e785.system.js → p-18290ca6.system.js} +1 -1
- package/dist/ripple/p-204bdd73.entry.js +1 -0
- package/dist/ripple/{p-e7a64841.system.entry.js → p-28b70082.system.entry.js} +1 -1
- package/dist/ripple/{p-0c792ae9.js → p-2cdd81c2.js} +1 -1
- package/dist/ripple/p-3b8b1b44.system.entry.js +1 -0
- package/dist/ripple/{p-f67fd802.system.entry.js → p-4a6854d3.system.entry.js} +1 -1
- package/dist/ripple/{p-e3de5bbd.system.entry.js → p-4c8db09c.system.entry.js} +1 -1
- package/dist/ripple/{p-0aa17cac.entry.js → p-4d0b1890.entry.js} +1 -1
- package/dist/ripple/p-825bd63b.entry.js +1 -0
- package/dist/ripple/p-a27d2177.entry.js +1 -0
- package/dist/ripple/{p-591918a4.entry.js → p-ade3d9a9.entry.js} +1 -1
- package/dist/ripple/{p-bbce0675.system.js → p-d48b5a85.system.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/package.json +1 -1
- package/dist/ripple/p-3183bba8.entry.js +0 -1
- package/dist/ripple/p-75ba63ba.entry.js +0 -1
- package/dist/ripple/p-c91b10f3.system.entry.js +0 -1
- package/dist/ripple/p-cc4a429b.entry.js +0 -1
- package/dist/ripple/p-fe8d02c3.system.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,e,r,i){function a(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function s(t){try{l(i["throw"](t))}catch(t){n(t)}}function l(t){t.done?r(t.value):a(t.value).then(o,s)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,a,n,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return l([t,e])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(i=1,a&&(n=s[0]&2?a["return"]:s[0]?a["throw"]||((n=a["return"])&&n.call(a),0):a.next)&&!(n=n.call(a,s[1])).done)return n;if(a=0,n)s=[s[0]&2,n.value];switch(s[0]){case 0:case 1:n=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!n||s[1]>n[0]&&s[1]<n[3])){r.label=s[1];break}if(s[0]===6&&r.label<n[1]){r.label=n[1];n=s;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(s);break}if(n[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];a=0}finally{i=n=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,A as getContextMeasurements,B as dateFind,C as calendar_months,D as findParentWithHiddenOverflow,i as intl}from"./functions-46843ea0.js";var datepickerCss=':host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:"start-label-wrapper . end-label-wrapper" "start-date-input hyphen end-date-input"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:"start-label-wrapper . end-label-wrapper ." "start-date-input hyphen end-date-input toggle-wrapper"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var DateRange=function(){function t(t){registerInstance(this,t);this.wmRangeSelection=createEvent(this,"wmRangeSelection",7);this.wmStartInputBlur=createEvent(this,"wmStartInputBlur",7);this.wmEndInputBlur=createEvent(this,"wmEndInputBlur",7);this.openUp=false;this.calWidth=681;this.popupClicked=false;this.toggleButtonClicked=false;this.formats={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};this.dateFormat="mm/dd/yyyy";this.disabled=false;this.errorMessage=undefined;this.invalidStart=false;this.invalidEnd=false;this.labelStart="";this.labelEnd="";this.preselected=undefined;this.requiredField=false;this.valueStart="";this.valueEnd="";this.availSpace=0;this.isExpanded=false}Object.defineProperty(t.prototype,"_disabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focusDates",{get:function(){var t=this.toISO(this.valueStart);var e=dateToISO(new Date);if(this._isValidISO(t)){e=t}else if(this.preselected&&this._isValidISO(this.preselected)){e=this.preselected}var r=this.toJSDate(e);if(r.getUTCMonth()==11){r.setYear(r.getUTCFullYear()+1)}r.setMonth((r.getUTCMonth()+1)%12,1);var i=dateToISO(r);var a=this.toISO(this.valueEnd);if(this._isValidISO(a)){var n=this.isSameMonth(e,a);if(!n){i=a;if(!t){var o=this.toJSDate(i);var s=o.getUTCMonth()-1;if(s==-1){s=11;o.setYear(o.getUTCFullYear()-1)}o.setMonth(s,1);e=dateToISO(o)}}}return[e,i]},enumerable:false,configurable:true});t.prototype.isSameMonth=function(t,e){if(t&&e){return t.slice(0,-3)===e.slice(0,-3)}else{return false}};t.prototype.toJSDate=function(t){if(t&&this._isValidISO(t)){var e=new Date;e.setUTCFullYear(parseInt(t.split("-")[0]),parseInt(t.split("-")[1])-1,parseInt(t.split("-")[2]));return e}else{return undefined}};t.prototype.toISO=function(t){return this._reformatDate(this.formats[this.dateFormat],"ISO",t)};t.prototype.handleDisabled=function(){handleDisabledAttribute(this.el,this._disabled)};t.prototype.updateValueStart=function(){this.startInputEl.value=this.valueStart?this.valueStart:""};t.prototype.updateValueEnd=function(){this.endInputEl.value=this.valueEnd?this.valueEnd:""};t.prototype.handleErrorMessage=function(){var t=this;if(this.errorMessage){setTimeout((function(){return t.announce(t.errorMessage)}),100)}};t.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};t.prototype.closePopup=function(t){var e=this;if(t===void 0){t=false}this.date1=undefined;this.date2=undefined;this.startCalEl.startDate=undefined;this.startCalEl.endDate=undefined;this.startCalEl.hoverDate=undefined;this.endCalEl.startDate=undefined;this.endCalEl.endDate=undefined;this.endCalEl.hoverDate=undefined;this.isExpanded=false;this.startCalEl.view="day";this.endCalEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){e.popupEl.style.visibility="hidden"}),250);if(t){this.toggleEl.focus()}};t.prototype.openPopup=function(){var t=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelEl.clientHeight);var e=getContextMeasurements(this.el),r=e.spaceLeft,i=e.spaceRight;if(i>=this.calWidth-this.el.clientWidth){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else if(r>=this.calWidth-this.el.clientWidth){this.popupEl.style.right="0";this.popupEl.style.left="auto"}else{var a=(this.availSpace-this.calWidth)/2-r;this.popupEl.style.left="".concat(a,"px");this.popupEl.style.right="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){t.popupEl.classList.add("open")}));this.isExpanded=true;this.startCalEl.focusDate=this.focusDates[0];this.endCalEl.focusDate=this.focusDates[1];this.startCalEl.focusCell();if(this.valueStart){var n=this.toISO(this.valueStart);if(this._isValidISO(n)){this.startCalEl.startDate=n}if(this.valueEnd){var o=this.toISO(this.valueEnd);if(this._isValidISO(o)){if(this.isSameMonth(n,o)){this.startCalEl.endDate=o}else{this.endCalEl.endDate=o}}}}};t.prototype.handleFocus=function(){this.wrapperEl.classList.add("focus")};t.prototype.handleBlur=function(){this.wrapperEl.classList.remove("focus")};t.prototype.handleStartInputBlur=function(){this.wmStartInputBlur.emit()};t.prototype.handleEndInputBlur=function(){this.wmEndInputBlur.emit()};t.prototype.handleStartInput=function(t){this.valueStart=t.target.value};t.prototype.handleEndInput=function(t){this.valueEnd=t.target.value};t.prototype.handleKey=function(t){switch(t.key){case"Escape":t.preventDefault();t.stopPropagation();this.closePopup(true);break}};t.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};t.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};t.prototype.handleDateFocus=function(t){var e=t.target;var r=e.focusDate;var i=this.startCalEl.focusDate.slice(0,-3);var a=this.endCalEl.focusDate.slice(0,-3);if(e==this.startCalEl){if(i>=a){this.endCalEl.focusDate=dateFind.month.increase(this.startCalEl.focusDate,1)}}else if(e==this.endCalEl){if(a<=i){this.startCalEl.focusDate=dateFind.month.decrease(this.endCalEl.focusDate,1)}}if(this.oldFocusVal){var n=dateFind.year.asInt(r);var o=dateFind.year.asInt(this.oldFocusVal);var s=dateFind.month.asInt(r);var l=dateFind.month.asInt(this.oldFocusVal);if(e.view==="day"){if(n!=o||s!=l){this.liveRegionEl.innerHTML="Viewing ".concat(calendar_months[s-1],", ").concat(n)}}else{if(n!=o){this.liveRegionEl.innerHTML="".concat(n," selected.")}else if(s!=l){this.liveRegionEl.innerHTML="".concat(calendar_months[s-1],", ").concat(n)}}}this.oldFocusVal=e.focusDate};t.prototype.handlePopupBlurred=function(t){if(t.detail.relatedTarget!==this.el){var e=new CustomEvent("blur");e.relatedTarget=t.detail.relatedTarget;this.el.dispatchEvent(e)}};t.prototype.handleCellTriggered=function(t){var e=t.detail.cal;var r=t.detail.cell;var i=r.getAttribute("data-year")+"-"+r.getAttribute("data-month")+"-"+r.textContent.padStart(2,"0");if(this.startCalEl.endDate||this.endCalEl.endDate){this.startCalEl.startDate=undefined;this.startCalEl.endDate=undefined;this.endCalEl.startDate=undefined;this.endCalEl.endDate=undefined;e.startDate=i;this.date1=i;this.date2=undefined}else if(this.date1&&i!==this.date1){if(this.date1>i){this.date2=this.date1;this.date1=i}else{this.date2=i}var a={startDate:{iso:this.date1,us:this._reformatDate("ISO","US",this.date1),int:this._reformatDate("ISO","INT",this.date1)},endDate:{iso:this.date2,us:this._reformatDate("ISO","US",this.date2),int:this._reformatDate("ISO","INT",this.date2)}};this.wmRangeSelection.emit(a);this.closePopup(true);this.date1=undefined;this.date2=undefined}else{e.startDate=i;this.date1=i}var n=new CustomEvent("input");this.el.dispatchEvent(n);var o=new CustomEvent("change");this.el.dispatchEvent(o)};t.prototype.handleOutOfCal=function(){this.startCalEl.hoverDate=undefined;this.endCalEl.hoverDate=undefined};t.prototype.handleCellHovered=function(t){this.startCalEl.hoverDate=this.startCalEl.startDate===t.detail?undefined:t.detail;this.endCalEl.hoverDate=this.endCalEl.startDate===t.detail?undefined:t.detail};t.prototype.reformatDate=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this._reformatDate(t,e,r)]}))}))};t.prototype._reformatDate=function(t,e,r){if(t!=="ISO"&&e!=="ISO")return"";if(!t||!e||!r)return"";var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(e){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(t==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(t==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(t==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};t.prototype.isValidISO=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this._isValidISO(t)]}))}))};t.prototype._isValidISO=function(t){var e=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!t||!e.test(t)){return false}else{var r=t.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var n=parseInt(r[0],10);if(n<1e3||n>3e3||a==0||a>12)return false;var o=[31,28,31,30,31,30,31,31,30,31,30,31];if(n%400==0||n%100!=0&&n%4==0)o[1]=29;return i>0&&i<=o[a-1]}};t.prototype.setAvailSpace=function(){this.availSpace=(this.hiddenOverflowParent||document.body).clientWidth};t.prototype.componentWillLoad=function(){var t=this;if(this.labelStart===""||this.labelEnd===""){console.error("For accessibility reasons you must specify labels for the date range inputs.")}handleDisabledAttribute(this.el,this._disabled);this.hiddenOverflowParent=findParentWithHiddenOverflow(this.el);if(this.hiddenOverflowParent){var e=new ResizeObserver((function(){t.availSpace=t.hiddenOverflowParent.clientWidth}));e.observe(this.hiddenOverflowParent)}this.setAvailSpace()};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.liveRegionEl.textContent=t};t.prototype.renderCalendars=function(){var t=this;if(this.calWidth<=this.availSpace){return h(Fragment,null,h("div",{class:"popup-wrapper ".concat(this.startCalEl&&this.startCalEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(e){return t.popupEl=e},onClick:function(){return t.popupClicked=true},style:{display:"flex"}},h("div",{class:"trapfocus",tabIndex:this.isExpanded?0:undefined,onFocus:function(){return t.endCalEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(e){return t.startCalEl=e},onClick:function(){return t.popupClicked=true},onDateFocus:function(e){return t.handleDateFocus(e)}}),h("priv-calendar",{ref:function(e){return t.endCalEl=e},onClick:function(){return t.popupClicked=true},onDateFocus:function(e){return t.handleDateFocus(e)}}),h("div",{class:"trapfocus",tabIndex:this.isExpanded?0:undefined,onFocus:function(){return t.startCalEl.focusFirstFocusable()}})))}};t.prototype.render=function(){var t=this;return h(Host,{"aria-busy":"false"},h("div",{ref:function(e){return t.wrapperEl=e},class:"wrapper"},h("div",{class:"range-wrapper ".concat(this.calWidth<=this.availSpace?"cal":"")},h("div",{class:"label-wrapper",id:"start-label-wrapper"},h("label",{ref:function(e){return t.labelEl=e},id:"startlabel",htmlFor:"start-date-input",class:"label",title:"".concat(this.labelStart," (").concat(this.dateFormat,")")},this.labelStart,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",{class:"label-wrapper",id:"end-label-wrapper"},h("label",{id:"endlabel",htmlFor:"end-date-input",class:"label",title:"".concat(this.labelEnd," (").concat(this.dateFormat,")")},this.labelEnd,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("input",{disabled:this._disabled,type:"text",id:"start-date-input",class:"date-input input ".concat(this.invalidStart?"invalid":""),name:"start-date",placeholder:this.dateFormat,value:this.valueStart,onFocus:function(){return t.handleFocus()},onInput:function(e){return t.handleStartInput(e)},onBlur:function(){return t.handleStartInputBlur()},ref:function(e){return t.startInputEl=e},"aria-describedby":"error","aria-label":this.labelStart,"aria-required":this.requiredField?"true":null}),h("div",{id:"hyphen"}," - "),h("input",{disabled:this._disabled,type:"text",id:"end-date-input",class:"date-input input ".concat(this.invalidEnd?"invalid":""),name:"end-date",placeholder:this.dateFormat,value:this.valueEnd,onFocus:function(){return t.handleFocus()},onInput:function(e){return t.handleEndInput(e)},onBlur:function(){return t.handleEndInputBlur()},ref:function(e){return t.endInputEl=e},"aria-describedby":"error","aria-label":this.labelEnd,"aria-required":this.requiredField?"true":null}),h("div",{class:"toggle-wrapper",id:"toggle-wrapper"},this.calWidth<=this.availSpace&&h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-describedby":"date-input",ref:function(e){return t.toggleEl=e},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})}))),this.renderCalendars()),h("div",null,h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"}))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(e){return t.liveRegionEl=e},class:"sr-only","aria-live":"polite","aria-atomic":"true"})))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["handleDisabled"],valueStart:["updateValueStart"],valueEnd:["updateValueEnd"],errorMessage:["handleErrorMessage"]}},enumerable:false,configurable:true});return t}();DateRange.style=datepickerCss;export{DateRange as wm_date_range};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,e,r,i){function a(t){return t instanceof r?t:new r((function(e){e(t)}))}return new(r||(r=Promise))((function(r,n){function o(t){try{l(i.next(t))}catch(t){n(t)}}function s(t){try{l(i["throw"](t))}catch(t){n(t)}}function l(t){t.done?r(t.value):a(t.value).then(o,s)}l((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},i,a,n,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return l([t,e])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(r=0)),r)try{if(i=1,a&&(n=s[0]&2?a["return"]:s[0]?a["throw"]||((n=a["return"])&&n.call(a),0):a.next)&&!(n=n.call(a,s[1])).done)return n;if(a=0,n)s=[s[0]&2,n.value];switch(s[0]){case 0:case 1:n=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(n=r.trys,n=n.length>0&&n[n.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!n||s[1]>n[0]&&s[1]<n[3])){r.label=s[1];break}if(s[0]===6&&r.label<n[1]){r.label=n[1];n=s;break}if(n&&r.label<n[2]){r.label=n[2];r.ops.push(s);break}if(n[2])r.ops.pop();r.trys.pop();continue}s=e.call(t,r)}catch(t){s=[6,t];a=0}finally{i=n=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,F as Fragment,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,A as getContextMeasurements,B as dateFind,C as calendar_months,D as findParentWithHiddenOverflow,i as intl}from"./functions-46843ea0.js";var datepickerCss=':host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:"start-label-wrapper . end-label-wrapper" "start-date-input hyphen end-date-input"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:"start-label-wrapper . end-label-wrapper ." "start-date-input hyphen end-date-input toggle-wrapper"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var DateRange=function(){function t(t){registerInstance(this,t);this.wmRangeSelection=createEvent(this,"wmRangeSelection",7);this.wmStartInputBlur=createEvent(this,"wmStartInputBlur",7);this.wmEndInputBlur=createEvent(this,"wmEndInputBlur",7);this.openUp=false;this.calWidth=681;this.popupClicked=false;this.toggleButtonClicked=false;this.formats={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};this.dateFormat="mm/dd/yyyy";this.disabled=false;this.errorMessage=undefined;this.invalidStart=false;this.invalidEnd=false;this.labelStart="";this.labelEnd="";this.preselected=undefined;this.requiredField=false;this.valueStart="";this.valueEnd="";this.availSpace=0;this.isExpanded=false}Object.defineProperty(t.prototype,"_disabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focusDates",{get:function(){var t=this.toISO(this.valueStart);var e=dateToISO(new Date);if(this._isValidISO(t)){e=t}else if(this.preselected&&this._isValidISO(this.preselected)){e=this.preselected}var r=this.toJSDate(e);if(r.getUTCMonth()==11){r.setYear(r.getUTCFullYear()+1)}r.setMonth((r.getUTCMonth()+1)%12,1);var i=dateToISO(r);var a=this.toISO(this.valueEnd);if(this._isValidISO(a)){var n=this.isSameMonth(e,a);if(!n){i=a;if(!t){var o=this.toJSDate(i);var s=o.getUTCMonth()-1;if(s==-1){s=11;o.setYear(o.getUTCFullYear()-1)}o.setMonth(s,1);e=dateToISO(o)}}}return[e,i]},enumerable:false,configurable:true});t.prototype.isSameMonth=function(t,e){if(t&&e){return t.slice(0,-3)===e.slice(0,-3)}else{return false}};t.prototype.toJSDate=function(t){if(t&&this._isValidISO(t)){var e=new Date;e.setUTCFullYear(parseInt(t.split("-")[0]),parseInt(t.split("-")[1])-1,parseInt(t.split("-")[2]));return e}else{return undefined}};t.prototype.toISO=function(t){return this._reformatDate(this.formats[this.dateFormat],"ISO",t)};t.prototype.handleDisabled=function(){handleDisabledAttribute(this.el,this._disabled)};t.prototype.updateValueStart=function(){this.startInputEl.value=this.valueStart?this.valueStart:""};t.prototype.updateValueEnd=function(){this.endInputEl.value=this.valueEnd?this.valueEnd:""};t.prototype.handleErrorMessage=function(){var t=this;if(this.errorMessage){setTimeout((function(){return t.announce(t.errorMessage)}),100)}};t.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};t.prototype.closePopup=function(t){var e=this;if(t===void 0){t=false}this.date1=undefined;this.date2=undefined;this.startCalEl.startDate=undefined;this.startCalEl.endDate=undefined;this.startCalEl.hoverDate=undefined;this.endCalEl.startDate=undefined;this.endCalEl.endDate=undefined;this.endCalEl.hoverDate=undefined;this.isExpanded=false;this.startCalEl.view="day";this.endCalEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){e.popupEl.style.visibility="hidden"}),250);if(t){this.toggleEl.focus()}};t.prototype.openPopup=function(){var t=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelEl.clientHeight);var e=getContextMeasurements(this.el),r=e.spaceLeft,i=e.spaceRight;if(i>=this.calWidth-this.el.clientWidth){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else if(r>=this.calWidth-this.el.clientWidth){this.popupEl.style.right="0";this.popupEl.style.left="auto"}else{var a=(this.availSpace-this.calWidth)/2-r;this.popupEl.style.left="".concat(a,"px");this.popupEl.style.right="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){t.popupEl.classList.add("open")}));this.isExpanded=true;this.startCalEl.focusDate=this.focusDates[0];this.endCalEl.focusDate=this.focusDates[1];this.startCalEl.focusCell();if(this.valueStart){var n=this.toISO(this.valueStart);if(this._isValidISO(n)){this.startCalEl.startDate=n}if(this.valueEnd){var o=this.toISO(this.valueEnd);if(this._isValidISO(o)){if(this.isSameMonth(n,o)){this.startCalEl.endDate=o}else{this.endCalEl.endDate=o}}}}};t.prototype.handleFocus=function(){this.wrapperEl.classList.add("focus")};t.prototype.handleBlur=function(){this.wrapperEl.classList.remove("focus")};t.prototype.handleStartInputBlur=function(){this.wmStartInputBlur.emit()};t.prototype.handleEndInputBlur=function(){this.wmEndInputBlur.emit()};t.prototype.handleStartInput=function(t){this.valueStart=t.target.value};t.prototype.handleEndInput=function(t){this.valueEnd=t.target.value};t.prototype.handleKey=function(t){switch(t.key){case"Escape":t.preventDefault();t.stopPropagation();this.closePopup(true);break}};t.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};t.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};t.prototype.handleDateFocus=function(t){var e=t.target;var r=e.focusDate;var i=this.startCalEl.focusDate.slice(0,-3);var a=this.endCalEl.focusDate.slice(0,-3);if(e==this.startCalEl){if(i>=a){this.endCalEl.focusDate=dateFind.month.increase(this.startCalEl.focusDate,1)}}else if(e==this.endCalEl){if(a<=i){this.startCalEl.focusDate=dateFind.month.decrease(this.endCalEl.focusDate,1)}}if(this.oldFocusVal){var n=dateFind.year.asInt(r);var o=dateFind.year.asInt(this.oldFocusVal);var s=dateFind.month.asInt(r);var l=dateFind.month.asInt(this.oldFocusVal);if(e.view==="day"){if(n!=o||s!=l){this.liveRegionEl.innerHTML="Viewing ".concat(calendar_months[s-1],", ").concat(n)}}else{if(n!=o){this.liveRegionEl.innerHTML="".concat(n," selected.")}else if(s!=l){this.liveRegionEl.innerHTML="".concat(calendar_months[s-1],", ").concat(n)}}}this.oldFocusVal=e.focusDate};t.prototype.handlePopupBlurred=function(t){if(t.detail.relatedTarget!==this.el){var e=new CustomEvent("blur");e.relatedTarget=t.detail.relatedTarget;this.el.dispatchEvent(e)}};t.prototype.handleCellTriggered=function(t){var e=t.detail.cal;var r=t.detail.cell;var i=r.getAttribute("data-year")+"-"+r.getAttribute("data-month")+"-"+r.textContent.padStart(2,"0");if(this.startCalEl.endDate||this.endCalEl.endDate){this.startCalEl.startDate=undefined;this.startCalEl.endDate=undefined;this.endCalEl.startDate=undefined;this.endCalEl.endDate=undefined;e.startDate=i;this.date1=i;this.date2=undefined}else if(this.date1&&i!==this.date1){if(this.date1>i){this.date2=this.date1;this.date1=i}else{this.date2=i}var a={startDate:{iso:this.date1,us:this._reformatDate("ISO","US",this.date1),int:this._reformatDate("ISO","INT",this.date1)},endDate:{iso:this.date2,us:this._reformatDate("ISO","US",this.date2),int:this._reformatDate("ISO","INT",this.date2)}};this.wmRangeSelection.emit(a);this.closePopup(true);this.date1=undefined;this.date2=undefined}else{e.startDate=i;this.date1=i}var n=new CustomEvent("input");this.el.dispatchEvent(n);var o=new CustomEvent("change");this.el.dispatchEvent(o)};t.prototype.handleOutOfCal=function(){this.startCalEl.hoverDate=undefined;this.endCalEl.hoverDate=undefined};t.prototype.handleCellHovered=function(t){this.startCalEl.hoverDate=this.startCalEl.startDate===t.detail?undefined:t.detail;this.endCalEl.hoverDate=this.endCalEl.startDate===t.detail?undefined:t.detail};t.prototype.reformatDate=function(t,e,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this._reformatDate(t,e,r)]}))}))};t.prototype._reformatDate=function(t,e,r){if(t!=="ISO"&&e!=="ISO")return"";if(!t||!e||!r)return"";var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(e){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(t==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(t==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(t==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};t.prototype.isValidISO=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,this._isValidISO(t)]}))}))};t.prototype._isValidISO=function(t){var e=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!t||!e.test(t)){return false}else{var r=t.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var n=parseInt(r[0],10);if(n<1e3||n>3e3||a==0||a>12)return false;var o=[31,28,31,30,31,30,31,31,30,31,30,31];if(n%400==0||n%100!=0&&n%4==0)o[1]=29;return i>0&&i<=o[a-1]}};t.prototype.setAvailSpace=function(){this.availSpace=(this.hiddenOverflowParent||document.body).clientWidth};t.prototype.componentWillLoad=function(){var t=this;if(this.labelStart===""||this.labelEnd===""){console.error("For accessibility reasons you must specify labels for the date range inputs.")}handleDisabledAttribute(this.el,this._disabled);this.hiddenOverflowParent=findParentWithHiddenOverflow(this.el);if(this.hiddenOverflowParent){var e=new ResizeObserver((function(){t.availSpace=t.hiddenOverflowParent.clientWidth}));e.observe(this.hiddenOverflowParent)}this.setAvailSpace()};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.liveRegionEl.textContent=t};t.prototype.renderCalendars=function(){var t=this;if(this.calWidth<=this.availSpace){return h(Fragment,null,h("div",{class:"popup-wrapper ".concat(this.startCalEl&&this.startCalEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(e){return t.popupEl=e},onClick:function(){return t.popupClicked=true},style:{display:"flex"}},h("div",{class:"trapfocus",tabIndex:this.isExpanded?0:undefined,onFocus:function(){return t.endCalEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(e){return t.startCalEl=e},onClick:function(){return t.popupClicked=true},onDateFocus:function(e){return t.handleDateFocus(e)}}),h("priv-calendar",{ref:function(e){return t.endCalEl=e},onClick:function(){return t.popupClicked=true},onDateFocus:function(e){return t.handleDateFocus(e)}}),h("div",{class:"trapfocus",tabIndex:this.isExpanded?0:undefined,onFocus:function(){return t.startCalEl.focusFirstFocusable()}})))}};t.prototype.render=function(){var t=this;return h(Host,{"aria-busy":"false"},h("div",{ref:function(e){return t.wrapperEl=e},class:"wrapper"},h("div",{class:"range-wrapper ".concat(this.calWidth<=this.availSpace?"cal":"")},h("div",{class:"label-wrapper",id:"start-label-wrapper"},h("label",{ref:function(e){return t.labelEl=e},id:"startlabel",htmlFor:"start-date-input",class:"label",title:"".concat(this.labelStart," (").concat(this.dateFormat,")")},this.labelStart,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",{class:"label-wrapper",id:"end-label-wrapper"},h("label",{id:"endlabel",htmlFor:"end-date-input",class:"label",title:"".concat(this.labelEnd," (").concat(this.dateFormat,")")},this.labelEnd,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("input",{disabled:this._disabled,type:"text",id:"start-date-input",class:"date-input input ".concat(this.invalidStart?"invalid":""),name:"start-date",placeholder:this.dateFormat,value:this.valueStart,onFocus:function(){return t.handleFocus()},onInput:function(e){return t.handleStartInput(e)},onBlur:function(){return t.handleStartInputBlur()},ref:function(e){return t.startInputEl=e},"aria-describedby":"error","aria-label":this.labelStart,"aria-required":this.requiredField?"true":null}),h("div",{id:"hyphen"}," - "),h("input",{disabled:this._disabled,type:"text",id:"end-date-input",class:"date-input input ".concat(this.invalidEnd?"invalid":""),name:"end-date",placeholder:this.dateFormat,value:this.valueEnd,onFocus:function(){return t.handleFocus()},onInput:function(e){return t.handleEndInput(e)},onBlur:function(){return t.handleEndInputBlur()},ref:function(e){return t.endInputEl=e},"aria-describedby":"error","aria-label":this.labelEnd,"aria-required":this.requiredField?"true":null}),h("div",{class:"toggle-wrapper",id:"toggle-wrapper"},this.calWidth<=this.availSpace&&h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-describedby":"start-date-input end-date-input","aria-label":intl.formatMessage({id:"date.selectRange",defaultMessage:"Select range",description:"Button text for screen readers."}),ref:function(e){return t.toggleEl=e},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})}))),this.renderCalendars()),h("div",null,h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"}))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(e){return t.liveRegionEl=e},class:"sr-only","aria-live":"polite","aria-atomic":"true"})))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["handleDisabled"],valueStart:["updateValueStart"],valueEnd:["updateValueEnd"],errorMessage:["handleErrorMessage"]}},enumerable:false,configurable:true});return t}();DateRange.style=datepickerCss;export{DateRange as wm_date_range};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,a,o,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(r=0)),r)try{if(i=1,a&&(o=s[0]&2?a["return"]:s[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;if(a=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,l as hasRoomRight,i as intl}from"./functions-46843ea0.js";var datepickerCss=':host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:"start-label-wrapper . end-label-wrapper" "start-date-input hyphen end-date-input"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:"start-label-wrapper . end-label-wrapper ." "start-date-input hyphen end-date-input toggle-wrapper"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var DatePicker=function(){function e(e){registerInstance(this,e);this.wmDatepickerDateSelected=createEvent(this,"wmDatepickerDateSelected",7);this.wmDatepickerInputBlurred=createEvent(this,"wmDatepickerInputBlurred",7);this.openUp=false;this.popupClicked=false;this.toggleButtonClicked=false;this.value="";this.disabled=false;this.dateFormat="mm/dd/yyyy";this.errorMessage=undefined;this.labelPosition="top";this.label="";this.requiredField=false;this.preselected=undefined;this.isExpanded=false}Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"calendarDate",{get:function(){var e=dateToISO(new Date);var t={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};if(this.value&&t[this.dateFormat]&&this.isValidIsoInternal(this.reformatDateInternal(t[this.dateFormat],"ISO",this.value))){e=this.reformatDateInternal(t[this.dateFormat],"ISO",this.value)}else if(this.preselected){e=this.preselected}return e},enumerable:false,configurable:true});e.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.updateValue=function(){this.inputEl.value=this.value?this.value:""};e.prototype.announceError=function(){var e=this;if(this.errorMessage){setTimeout((function(){return e.announce(e.errorMessage)}),100)}};e.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};e.prototype.closePopup=function(e){var t=this;if(e===void 0){e=false}this.isExpanded=false;this.calEl.view="day";this.calEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){t.popupEl.style.visibility="hidden"}),250);if(e){this.toggleEl.focus()}};e.prototype.openPopup=function(){var e=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelWrapperEl.clientHeight);if(hasRoomRight(this.el,336)){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else{this.popupEl.style.right="0";this.popupEl.style.left="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){e.popupEl.classList.add("open")}));this.isExpanded=true;this.calEl.focusDate=this.calendarDate;this.calEl.startDate=this.calendarDate;this.calEl.focusCell()};e.prototype.handleInput=function(e){this.value=e.target.value};e.prototype.handleInputBlur=function(){this.dpWrapperEl.classList.remove("focus");this.wmDatepickerInputBlurred.emit()};e.prototype.handleInputFocus=function(){this.dpWrapperEl.classList.add("focus")};e.prototype.handleInputChange=function(){var e=new CustomEvent("change");this.el.dispatchEvent(e)};e.prototype.handleKey=function(e){switch(e.key){case"Escape":e.preventDefault();e.stopPropagation();this.closePopup(true);break}};e.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};e.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};e.prototype.handleCellTriggered=function(e){var t=e.detail.cell;var r=t.getAttribute("data-year")+"-"+t.getAttribute("data-month")+"-"+t.textContent.padStart(2,"0");this.wmDatepickerDateSelected.emit({date:r});var i=new CustomEvent("input");this.el.dispatchEvent(i);var a=new CustomEvent("change");this.el.dispatchEvent(a);this.closePopup(true)};e.prototype.reformatDate=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.reformatDateInternal(e,t,r)]}))}))};e.prototype.reformatDateInternal=function(e,t,r){var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!r){return""}else if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(t){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(e==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(e==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(e==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};e.prototype.isValidIso=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.isValidIsoInternal(e)]}))}))};e.prototype.isValidIsoInternal=function(e){var t=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!e||!t.test(e)){return false}else{var r=e.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var o=parseInt(r[0],10);if(o<1e3||o>3e3||a==0||a>12)return false;var n=[31,28,31,30,31,30,31,31,30,31,30,31];if(o%400==0||o%100!=0&&o%4==0)n[1]=29;return i>0&&i<=n[a-1]}};e.prototype.componentWillLoad=function(){if(this.label===""){console.error("You must include a label prop for the datepicker input (for accessibility reasons), even if the label position is none.")}handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.componentDidLoad=function(){var e=this;this.calEl.addEventListener("click",(function(){e.popupClicked=true}))};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.liveRegionEl.textContent=e};e.prototype.render=function(){var e=this;return h(Host,{"aria-busy":"false",class:"".concat(this.errorMessage?"invalid":"")},h("div",{ref:function(t){return e.dpWrapperEl=t},class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{class:"label-wrapper",ref:function(t){return e.labelWrapperEl=t}},this.labelPosition!=="none"&&h("label",{id:"datepickerLabel",htmlFor:"date-input",class:"label",title:"".concat(this.label," (").concat(this.dateFormat,")")},this.label,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",null,h("div",{class:"single-wrapper input"},h("input",{disabled:this.isDisabled,type:"text",id:"single-date-input",class:"date-input",name:"date",placeholder:this.dateFormat,value:this.value,onFocus:function(){return e.handleInputFocus()},onInput:function(t){return e.handleInput(t)},onBlur:function(){return e.handleInputBlur()},onChange:function(){return e.handleInputChange()},ref:function(t){return e.inputEl=t},"aria-describedby":"error","aria-label":this.label,"aria-required":this.requiredField?"true":null}),h("div",{class:"container",id:"wm-container"},h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-describedby":"date-input",ref:function(t){return e.toggleEl=t},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})})),h("div",{class:"popup-wrapper ".concat(this.calEl&&this.calEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(t){return e.popupEl=t},onClick:function(){return e.popupClicked=true}},h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(t){return e.calEl=t},startDate:this.calendarDate,focusDate:this.calendarDate,class:"inside"}),h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusFirstFocusable()}})),h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"})))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(t){return e.liveRegionEl=t},class:"sr-only","aria-live":"polite","aria-atomic":"true"}))))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["handleDisabledChange"],value:["updateValue"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return e}();DatePicker.style=datepickerCss;export{DatePicker as wm_datepicker};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,r,i){function a(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,o){function n(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i["throw"](e))}catch(e){o(e)}}function l(e){e.done?r(e.value):a(e.value).then(n,s)}l((i=i.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,a,o,n;return n={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(n[Symbol.iterator]=function(){return this}),n;function s(e){return function(t){return l([e,t])}}function l(s){if(i)throw new TypeError("Generator is already executing.");while(n&&(n=0,s[0]&&(r=0)),r)try{if(i=1,a&&(o=s[0]&2?a["return"]:s[0]?a["throw"]||((o=a["return"])&&o.call(a),0):a.next)&&!(o=o.call(a,s[1])).done)return o;if(a=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:r.label++;return{value:s[1],done:false};case 5:r.label++;a=s[1];s=[0];continue;case 7:s=r.ops.pop();r.trys.pop();continue;default:if(!(o=r.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){r=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){r.label=s[1];break}if(s[0]===6&&r.label<o[1]){r.label=o[1];o=s;break}if(o&&r.label<o[2]){r.label=o[2];r.ops.push(s);break}if(o[2])r.ops.pop();r.trys.pop();continue}s=t.call(e,r)}catch(e){s=[6,e];a=0}finally{i=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{t as toBool,j as dateToISO,a as handleDisabledAttribute,k as shouldOpenUp,l as hasRoomRight,i as intl}from"./functions-46843ea0.js";var datepickerCss=':host{--wmcolor-datepicker-background:var(--wmcolor-background);--wmcolor-datepicker-day-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-day-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-day-text-outside:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-day-text-selected:var(--wmcolor-interactive-text-selected);--wmcolor-datepicker-day-text:var(--wmcolor-text);--wmcolor-datepicker-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-input-background:var(--wmcolor-input-background);--wmcolor-datepicker-input-border:var(--wmcolor-input-border);--wmcolor-datepicker-input-text-disabled:var(--wmcolor-input-text-disabled);--wmcolor-datepicker-input-text:var(--wmcolor-input-text);--wmcolor-datepicker-month-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-month-background-selected:var(--wmcolor-interactive);--wmcolor-datepicker-month-background:var(--wmcolor-text);--wmcolor-datepicker-month-border:var(--wmcolor-border-light);--wmcolor-datepicker-month-text-selected:var(--wmcolor-text-ondark);--wmcolor-datepicker-month-text:var(--wmcolor-interactive);--wmcolor-datepicker-navigation-background-hover:var(--wmcolor-button-background-navigational-hover);--wmcolor-datepicker-navigation-background:var(--wmcolor-button-background-navigational);--wmcolor-datepicker-navigation-text:var(--wmcolor-button-icon-navigational);--wmcolor-datepicker-selector-background:var(--wmcolor-button-background-secondary);--wmcolor-datepicker-selector-border:var(--wmcolor-button-border-secondary);--wmcolor-datepicker-selector-text:var(--wmcolor-button-text-secondary);--wmcolor-datepicker-toggle-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-datepicker-toggle-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-toggle-background:var(--wmcolor-input-background);--wmcolor-datepicker-toggle-icon-disabled:var(--wmcolor-interactive-disabled);--wmcolor-datepicker-toggle-icon:var(--wmcolor-interactive);--wmcolor-datepicker-weekdays-background:var(--wmcolor-table-header-background);--wmcolor-datepicker-weekdays-text:var(--wmcolor-text);font-family:inherit}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{position:relative}:host .wrapper .single-wrapper,:host .wrapper .range-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;position:relative}:host .wrapper .date-input{border-radius:3px;color:var(--wmcolor-datepicker-input-text);font-size:0.875rem;padding:0.625rem 0.9375rem 0.5rem;min-width:0;-ms-flex:1;flex:1;margin:0;background-color:var(--wmcolor-datepicker-input-background)}:host .wrapper .date-input:disabled{background-color:var(--wmcolor-datepicker-input-background-disabled);color:var(--wmcolor-datepicker-input-text-disabled)}:host .wrapper .date-input:focus{outline:none}:host .wrapper .input{height:2.5rem;border:1px solid var(--wmcolor-datepicker-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;max-width:236px;}:host .wrapper #single-date-input{height:100%;border:none;border-radius:3px;-webkit-margin-end:3px;margin-inline-end:3px}:host .wrapper .range-wrapper{max-width:257px;display:grid;grid-template-rows:minmax(21px, 1fr) 38px;grid-template-columns:120px 17px 120px;grid-template-areas:"start-label-wrapper . end-label-wrapper" "start-date-input hyphen end-date-input"}:host .wrapper .range-wrapper #start-label-wrapper{grid-area:start-label-wrapper}:host .wrapper .range-wrapper #end-label-wrapper{grid-area:end-label-wrapper}:host .wrapper .range-wrapper #start-date-input{grid-area:start-date-input}:host .wrapper .range-wrapper #hyphen{grid-area:hyphen}:host .wrapper .range-wrapper #end-date-input{grid-area:end-date-input}:host .wrapper .range-wrapper .label{text-wrap:wrap}:host .wrapper .range-wrapper.cal{max-width:305px;-webkit-column-gap:4px;-moz-column-gap:4px;column-gap:4px;grid-template-columns:120px 17px 120px 36px;grid-template-areas:"start-label-wrapper . end-label-wrapper ." "start-date-input hyphen end-date-input toggle-wrapper"}:host .wrapper .range-wrapper.cal #toggle-wrapper{grid-area:toggle-wrapper}:host .wrapper #start-date-input,:host .wrapper #end-date-input{max-width:120px}:host .wrapper #start-date-input:focus,:host .wrapper #end-date-input:focus{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper.invalid .input,:host .wrapper .date-input.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;margin-bottom:4px;top:100%;left:0}:host .wrapper .error:not(:empty){margin-top:0.25rem}:host .wrapper.focus #single-date-input{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var DatePicker=function(){function e(e){registerInstance(this,e);this.wmDatepickerDateSelected=createEvent(this,"wmDatepickerDateSelected",7);this.wmDatepickerInputBlurred=createEvent(this,"wmDatepickerInputBlurred",7);this.openUp=false;this.popupClicked=false;this.toggleButtonClicked=false;this.value="";this.disabled=false;this.dateFormat="mm/dd/yyyy";this.errorMessage=undefined;this.labelPosition="top";this.label="";this.requiredField=false;this.preselected=undefined;this.isExpanded=false}Object.defineProperty(e.prototype,"isDisabled",{get:function(){return toBool(this.disabled)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"calendarDate",{get:function(){var e=dateToISO(new Date);var t={"mm/dd/yyyy":"US","dd/mm/yyyy":"INT","yyyy/mm/dd":"ISO"};if(this.value&&t[this.dateFormat]&&this.isValidIsoInternal(this.reformatDateInternal(t[this.dateFormat],"ISO",this.value))){e=this.reformatDateInternal(t[this.dateFormat],"ISO",this.value)}else if(this.preselected){e=this.preselected}return e},enumerable:false,configurable:true});e.prototype.handleDisabledChange=function(){handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.updateValue=function(){this.inputEl.value=this.value?this.value:""};e.prototype.announceError=function(){var e=this;if(this.errorMessage){setTimeout((function(){return e.announce(e.errorMessage)}),100)}};e.prototype.togglePopup=function(){this.isExpanded?this.closePopup():this.openPopup();this.toggleButtonClicked=true};e.prototype.closePopup=function(e){var t=this;if(e===void 0){e=false}this.isExpanded=false;this.calEl.view="day";this.calEl.view="day";this.popupEl.classList.remove("open");window.setTimeout((function(){t.popupEl.style.visibility="hidden"}),250);if(e){this.toggleEl.focus()}};e.prototype.openPopup=function(){var e=this;this.openUp=shouldOpenUp(this.el,this.popupEl.clientHeight,this.labelWrapperEl.clientHeight);if(hasRoomRight(this.el,336)){this.popupEl.style.left="0";this.popupEl.style.right="auto"}else{this.popupEl.style.right="0";this.popupEl.style.left="auto"}this.popupEl.style.visibility="visible";window.requestAnimationFrame((function(){e.popupEl.classList.add("open")}));this.isExpanded=true;this.calEl.focusDate=this.calendarDate;this.calEl.startDate=this.calendarDate;this.calEl.focusCell()};e.prototype.handleInput=function(e){this.value=e.target.value};e.prototype.handleInputBlur=function(){this.dpWrapperEl.classList.remove("focus");this.wmDatepickerInputBlurred.emit()};e.prototype.handleInputFocus=function(){this.dpWrapperEl.classList.add("focus")};e.prototype.handleInputChange=function(){var e=new CustomEvent("change");this.el.dispatchEvent(e)};e.prototype.handleKey=function(e){switch(e.key){case"Escape":e.preventDefault();e.stopPropagation();this.closePopup(true);break}};e.prototype.blurHandler=function(){if(!this.popupClicked&&!this.toggleButtonClicked&&this.isExpanded){this.closePopup()}this.popupClicked=false;this.toggleButtonClicked=false};e.prototype.handleBlurOnWindow=function(){if(this.isExpanded){this.closePopup()}};e.prototype.handleCellTriggered=function(e){var t=e.detail.cell;var r=t.getAttribute("data-year")+"-"+t.getAttribute("data-month")+"-"+t.textContent.padStart(2,"0");this.wmDatepickerDateSelected.emit({date:r});var i=new CustomEvent("input");this.el.dispatchEvent(i);var a=new CustomEvent("change");this.el.dispatchEvent(a);this.closePopup(true)};e.prototype.reformatDate=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(i){return[2,this.reformatDateInternal(e,t,r)]}))}))};e.prototype.reformatDateInternal=function(e,t,r){var i=/^(\d{1}|\d{2}|\d{4})[\-\.\/]\d{1,2}[\-\.\/](\d{1}|\d{2}|\d{4})$/;if(!r){return""}else if(!i.test(r)){return r}else{var a=r.replace(/[\-\.]/gi,"/").split("/");switch(t){case"US":return a[1].padStart(2,"0")+"/"+a[2].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"INT":return a[2].padStart(2,"0")+"/"+a[1].padStart(2,"0")+"/"+a[0].padStart(4,"20");case"ISO":if(e==="US"){return a[2].padStart(4,"20")+"-"+a[0].padStart(2,"0")+"-"+a[1].padStart(2,"0")}else if(e==="INT"){return a[2].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[0].padStart(2,"0")}else if(e==="ISO"){return a[0].padStart(4,"20")+"-"+a[1].padStart(2,"0")+"-"+a[2].padStart(2,"0")}default:return a.join("/")}}};e.prototype.isValidIso=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.isValidIsoInternal(e)]}))}))};e.prototype.isValidIsoInternal=function(e){var t=/^\d\d\d\d[-]\d\d[-]\d\d$/;if(!e||!t.test(e)){return false}else{var r=e.split("-");var i=parseInt(r[2],10);var a=parseInt(r[1],10);var o=parseInt(r[0],10);if(o<1e3||o>3e3||a==0||a>12)return false;var n=[31,28,31,30,31,30,31,31,30,31,30,31];if(o%400==0||o%100!=0&&o%4==0)n[1]=29;return i>0&&i<=n[a-1]}};e.prototype.componentWillLoad=function(){if(this.label===""){console.error("You must include a label prop for the datepicker input (for accessibility reasons), even if the label position is none.")}handleDisabledAttribute(this.el,this.isDisabled)};e.prototype.componentDidLoad=function(){var e=this;this.calEl.addEventListener("click",(function(){e.popupClicked=true}))};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.liveRegionEl.textContent=e};e.prototype.render=function(){var e=this;return h(Host,{"aria-busy":"false",class:"".concat(this.errorMessage?"invalid":"")},h("div",{ref:function(t){return e.dpWrapperEl=t},class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},h("div",{class:"label-wrapper",ref:function(t){return e.labelWrapperEl=t}},this.labelPosition!=="none"&&h("label",{id:"datepickerLabel",htmlFor:"date-input",class:"label",title:"".concat(this.label," (").concat(this.dateFormat,")")},this.label,this.requiredField&&h("span",{"aria-hidden":"true",class:"required"},"*"))),h("div",null,h("div",{class:"single-wrapper input"},h("input",{disabled:this.isDisabled,type:"text",id:"single-date-input",class:"date-input",name:"date",placeholder:this.dateFormat,value:this.value,onFocus:function(){return e.handleInputFocus()},onInput:function(t){return e.handleInput(t)},onBlur:function(){return e.handleInputBlur()},onChange:function(){return e.handleInputChange()},ref:function(t){return e.inputEl=t},"aria-describedby":"error","aria-label":this.label,"aria-required":this.requiredField?"true":null}),h("div",{class:"container",id:"wm-container"},h("button",{disabled:this.disabled,onClick:this.togglePopup.bind(this),"aria-label":intl.formatMessage({id:"date.selectDate",defaultMessage:"Select date",description:"Button text for screen readers."}),"aria-describedby":"single-date-input",ref:function(t){return e.toggleEl=t},"aria-expanded":"".concat(this.isExpanded),class:"toggle",id:"toggle"},h("span",{class:"calendar",title:intl.formatMessage({id:"date.calendarView",defaultMessage:"Calendar View",description:"Calendar button"})})),h("div",{class:"popup-wrapper ".concat(this.calEl&&this.calEl.view,"-view ").concat(this.openUp?"expand-upwards":""),id:"popup-wrapper",ref:function(t){return e.popupEl=t},onClick:function(){return e.popupClicked=true}},h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusLastFocusable()}}),h("priv-calendar",{ref:function(t){return e.calEl=t},startDate:this.calendarDate,focusDate:this.calendarDate,class:"inside"}),h("div",{tabIndex:0,onFocus:function(){return e.calEl.focusFirstFocusable()}})),h("div",{id:"live-region","aria-live":"polite","aria-relevant":"text",class:"sr-only"}),h("div",{id:"month-title",class:"sr-only"},intl.formatMessage({id:"date.selectMonth",defaultMessage:"Activate to select a month.",description:"Calendar button"})),h("div",{id:"year-title",class:"sr-only"},intl.formatMessage({id:"date.selectYear",defaultMessage:"Activate to select a year.",description:"Calendar button"})))),h("div",{id:"error",class:"error"},this.errorMessage),h("div",{ref:function(t){return e.liveRegionEl=t},class:"sr-only","aria-live":"polite","aria-atomic":"true"}))))};Object.defineProperty(e,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["handleDisabledChange"],value:["updateValue"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return e}();DatePicker.style=datepickerCss;export{DatePicker as wm_datepicker};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,r,e,i){function n(t){return t instanceof e?t:new e((function(r){r(t)}))}return new(e||(e=Promise))((function(e,a){function o(t){try{c(i.next(t))}catch(t){a(t)}}function s(t){try{c(i["throw"](t))}catch(t){a(t)}}function c(t){t.done?e(t.value):n(t.value).then(o,s)}c((i=i.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(r){return c([t,r])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(e=0)),e)try{if(i=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){e.label=s[1];break}if(s[0]===6&&e.label<a[1]){e.label=a[1];a=s;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(s);break}if(a[2])e.ops.pop();e.trys.pop();continue}s=r.call(t,e)}catch(t){s=[6,t];n=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{a as getWmMode}from"./interfaces-cc5b177f.js";import{n as snakeCaseToCamelCase,o as getNewIndexToFocus,i as intl}from"./functions-46843ea0.js";var getRequest=function(t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:r=e.sent();if(!(!!r&&!!r.ok))return[3,3];return[4,r.json()];case 2:return[2,e.sent()];case 3:throw new Error(r.statusText)}}))}))};var wmNavigatorCss=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var Navigator=function(){function t(t){registerInstance(this,t);this.wmNavigatorLogout=createEvent(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.itemIndexToFocus=0}t.prototype.isSafeUrl=function(t){var r=false;var e=["digitalmeasures\\.com","evalkit\\.info","evaluationkit\\.com","evaluationkit\\.info","lat_ams\\.com","livetext\\.com","smartcatalogiq\\.com","smartcatalogiq\\.net","smartcatalogiq\\.us","taskstream\\.com","vialivetext\\.com","watermarkinsights\\.com"];e.forEach((function(e){var i="^https://(.*.)?".concat(e,"(/.*)?$");if(!!t&&t.match(i)){r=true}}));return r};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,getRequest("/platform/navigator/userinfo").then((function(r){t.email=r.email;t.currentProductId=r.current_product_id;t.parsedProducts=t.productKeysToCamelCase(r.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:r.logout_url;t.connectionName=t.connectionName?t.connectionName:r.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:r.sent();return[3,3];case 2:this.currentProductId=getWmMode(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}r.label=3;case 3:this.parsedProducts.sort((function(t,r){return t.name<r.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var r=Object.keys(t);var e={};r.forEach((function(r){e[snakeCaseToCamelCase(r)]=t[r]}));return e}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var r=t.detail.key;var e=t.detail.navItem;switch(r){case"Tab":this.closeMenu(false);break;case"Enter":case" ":e.click();break;case"ArrowDown":case"ArrowUp":var i=this.itemIndexToFocus;this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,r,this.navigatorItems.length);this.focusItem();this.unfocusItem(i);break}};t.prototype.handleClick=function(t){var r=t.target===this.el||this.el.contains(t.target);if(!r&&this.isOpen){this.closeMenu(false)}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var r=this.el.getBoundingClientRect().left;var e=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&e>r}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(t){var r=this;if(t===void 0){t=true}this.isOpen=false;window.requestAnimationFrame((function(){r.unfocusItem(r.itemIndexToFocus);r.setFocusIndex();if(t){r.buttonFocusHandler()}}))};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.requestAnimationFrame((function(){return t.focus()}))};t.prototype.unfocusItem=function(t){var r=this.navigatorItems[t];r.tabIndex=-1;r.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var r=t.shadowRoot.querySelector("button");r.focus()};t.prototype.renderUserInfo=function(){return h("div",{class:"user",id:"wm-nav-user","aria-label":intl.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},h("p",null,this.userName),h("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return intl.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return intl.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return h("h2",null,intl.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return h("ul",{role:"listbox","aria-label":"".concat(intl.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(r){var e,i,n,a;e=r.name;i=r.iconUrl;a=t.setProductOnClick(r.id);if(!!e&&!!i){n=t.currentProductId===r.id;return h("priv-navigator-item",{selected:n,id:r.id,onClick:a,role:"option","aria-label":e},h("img",{src:i,alt:e}))}}))};t.prototype.setProductOnClick=function(t){var r=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(r){if(!!this.loadFromUserinfo||this.authType===2){var e=r.linkUrl;if(this.isSafeUrl(e)){return function(){return window.location.href=e}}else{console.error('"'.concat(e,'" is not a safe url'));return}}else if(this.authType===3){var i=this.connectionName?"/?connection_name=".concat(this.connectionName):"";var n=r.samlLinkUrl;if(this.isSafeUrl(n)){return function(){return window.location.href=n+i}}else{console.error('"'.concat(n,'" is not a safe url'));return}}}};t.prototype.renderLogoutOption=function(){return h("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option"},h("span",{class:"logout"},intl.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();var r=t.logoutUrl;if(t.isSafeUrl(r)){window.location.href=r}else{console.error('"'.concat(r,'" is not a safe url'))}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(r){return r.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?h(Host,null,h("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText()}),h("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(r){return t.wrapperEl=r}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}();Navigator.style=wmNavigatorCss;export{Navigator as wm_navigator};
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,r,e,i){function n(t){return t instanceof e?t:new e((function(r){r(t)}))}return new(e||(e=Promise))((function(e,a){function o(t){try{c(i.next(t))}catch(t){a(t)}}function s(t){try{c(i["throw"](t))}catch(t){a(t)}}function c(t){t.done?e(t.value):n(t.value).then(o,s)}c((i=i.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var e={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(r){return c([t,r])}}function c(s){if(i)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(e=0)),e)try{if(i=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;n=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(a=e.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){e.label=s[1];break}if(s[0]===6&&e.label<a[1]){e.label=a[1];a=s;break}if(a&&e.label<a[2]){e.label=a[2];e.ops.push(s);break}if(a[2])e.ops.pop();e.trys.pop();continue}s=r.call(t,e)}catch(t){s=[6,t];n=0}finally{i=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-558b5a82.js";import{a as getWmMode}from"./interfaces-cc5b177f.js";import{n as snakeCaseToCamelCase,o as getNewIndexToFocus,i as intl}from"./functions-46843ea0.js";var getRequest=function(t){return __awaiter(void 0,void 0,void 0,(function(){var r;return __generator(this,(function(e){switch(e.label){case 0:return[4,fetch(t)];case 1:r=e.sent();if(!(!!r&&!!r.ok))return[3,3];return[4,r.json()];case 2:return[2,e.sent()];case 3:throw new Error(r.statusText)}}))}))};var wmNavigatorCss=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-selected:var(--wmcolor-interactive-background-selected);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var Navigator=function(){function t(t){registerInstance(this,t);this.wmNavigatorLogout=createEvent(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.itemIndexToFocus=0}t.prototype.isSafeUrl=function(t){var r=false;var e=["digitalmeasures\\.com","evalkit\\.info","evaluationkit\\.com","evaluationkit\\.info","lat_ams\\.com","livetext\\.com","smartcatalogiq\\.com","smartcatalogiq\\.net","smartcatalogiq\\.us","taskstream\\.com","vialivetext\\.com","watermarkinsights\\.com"];e.forEach((function(e){var i="^https://(.*.)?".concat(e,"(/.*)?$");if(!!t&&t.match(i)){r=true}}));return r};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,getRequest("/platform/navigator/userinfo").then((function(r){t.email=r.email;t.currentProductId=r.current_product_id;t.parsedProducts=t.productKeysToCamelCase(r.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:r.logout_url;t.connectionName=t.connectionName?t.connectionName:r.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:r.sent();return[3,3];case 2:this.currentProductId=getWmMode(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}r.label=3;case 3:this.parsedProducts.sort((function(t,r){return t.name<r.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var r=Object.keys(t);var e={};r.forEach((function(r){e[snakeCaseToCamelCase(r)]=t[r]}));return e}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var r=t.detail.key;var e=t.detail.navItem;switch(r){case"Tab":this.closeMenu(false);break;case"Enter":case" ":e.click();break;case"ArrowDown":case"ArrowUp":var i=this.itemIndexToFocus;this.itemIndexToFocus=getNewIndexToFocus(this.itemIndexToFocus,r,this.navigatorItems.length);this.focusItem();this.unfocusItem(i);break}};t.prototype.handleClick=function(t){var r=t.target===this.el||this.el.contains(t.target);if(!r&&this.isOpen){this.closeMenu(false)}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var r=this.el.getBoundingClientRect().left;var e=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&e>r}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(t){var r=this;if(t===void 0){t=true}this.isOpen=false;window.requestAnimationFrame((function(){r.unfocusItem(r.itemIndexToFocus);r.setFocusIndex();if(t){r.buttonFocusHandler()}}))};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.setTimeout((function(){return t.focus()}),250)};t.prototype.unfocusItem=function(t){var r=this.navigatorItems[t];r.tabIndex=-1;r.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var r=t.shadowRoot.querySelector("button");r.focus()};t.prototype.renderUserInfo=function(){return h("div",{class:"user",id:"wm-nav-user","aria-label":intl.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},h("p",null,this.userName),h("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return intl.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return intl.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return h("h2",null,intl.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return h("ul",{role:"listbox","aria-label":"".concat(intl.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(r){var e,i,n,a;e=r.name;i=r.iconUrl;a=t.setProductOnClick(r.id);if(!!e&&!!i){n=t.currentProductId===r.id;return h("priv-navigator-item",{selected:n,id:r.id,onClick:function(){n?t.closeMenu():a()},role:"option","aria-label":e,"aria-selected":n?"true":"false"},h("img",{src:i,alt:e}))}}))};t.prototype.setProductOnClick=function(t){var r=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(r){if(!!this.loadFromUserinfo||this.authType===2){var e=r.linkUrl;if(this.isSafeUrl(e)){return function(){return window.location.href=e}}else{console.error('"'.concat(e,'" is not a safe url'));return}}else if(this.authType===3){var i=this.connectionName?"/?connection_name=".concat(this.connectionName):"";var n=r.samlLinkUrl;if(this.isSafeUrl(n)){return function(){return window.location.href=n+i}}else{console.error('"'.concat(n,'" is not a safe url'));return}}}};t.prototype.renderLogoutOption=function(){return h("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option","aria-selected":"false"},h("span",{class:"logout"},intl.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();var r=t.logoutUrl;if(t.isSafeUrl(r)){window.location.href=r}else{console.error('"'.concat(r,'" is not a safe url'))}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(r){return r.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?h(Host,null,h("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText()}),h("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(r){return t.wrapperEl=r}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}();Navigator.style=wmNavigatorCss;export{Navigator as wm_navigator};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./p-ab8d78cc.system.js"],(function(t){"use strict";var o,e,r,n;return{setters:[function(t){o=t.r;e=t.c;r=t.h;n=t.g}],execute:function(){var i=":host{list-style:none;border-bottom:1px solid var(--wmcolor-navigator-item-border);width:100%;display:block;cursor:pointer}:host .navoption{color:var(--wmcolor-navigator-item-text);padding:0.9375rem 1.25rem;background:var(--wmcolor-navigator-item-background);font-size:0.875rem}:host .navoption.selected{background:var(--wmcolor-navigator-item-background-selected)}:host .navoption.focused,:host .navoption:hover{background:var(--wmcolor-navigator-item-background-focus);opacity:1}";var a=t("priv_navigator_item",function(){function t(t){o(this,t);this.keydownOnNavItem=e(this,"keydownOnNavItem",7);this.selected=false;this.focused=false;this.link=""}t.prototype.handleKeyDown=function(t){var o=t.key;var e=this.el;if(o!=="Tab"){t.preventDefault()}this.keydownOnNavItem.emit({navItem:e,key:o})};t.prototype.render=function(){var t=this.selected?"selected":"";var o=this.focused?"focused":"";return r("div",{class:"navoption ".concat(t," ").concat(o)},r("slot",null))};Object.defineProperty(t.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});return t}());a.style=i}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register([],(function(){"use strict";return{execute:function(){var n="5.
|
|
1
|
+
System.register([],(function(){"use strict";return{execute:function(){var n="5.5.0-0";if(window.navigator.plugins.length>0){console.log("Ripple component library",n)}function o(n){if(n.key=="Tab"){var o=new Event("wmUserIsTabbing");window.dispatchEvent(o);document.querySelector("body").classList.add("wmcl-user-is-tabbing")}if(n.key=="ArrowLeft"||n.key=="ArrowUp"||n.key=="ArrowRight"||n.key=="ArrowDown"){var o=new Event("wmUserIsKeying");window.dispatchEvent(o);document.querySelector("body").classList.add("wmcl-user-is-keying")}}function t(){var n=new Event("wmUserIsNotTabbing");window.dispatchEvent(n);document.querySelector("body").classList.remove("wmcl-user-is-tabbing");document.querySelector("body").classList.remove("wmcl-user-is-keying")}window.addEventListener("keydown",o);window.addEventListener("mousedown",t);var e=document.createElement("div");e.id="wm-tooltip-container";var i=document.createElement("div");i.id="wm-tooltip";i.classList.add("wm-tooltip");i.setAttribute("popover","manual");i.setAttribute("aria-hidden","true");var r=document.createElement("style");r.textContent="\n.wm-tooltip {\n position: fixed;\n overflow: hidden;\n pointer-events: none;\n line-height: normal;\n font-family: inherit;\n font-size: 0.875rem;\n text-transform: none;\n font-weight: normal;\n background: var(--wmcolor-tooltip-background);\n color: var(--wmcolor-tooltip-text);\n z-index: 999999;\n max-width: var(--wmTooltipMaxWidth, 13.75rem);\n margin-right: 1.5rem;\n padding: 0.375rem;\n transition-property: opacity;\n transition-delay: 0s;\n opacity: 0;\n inset: unset;\n top: 0;\n left: 0;\n transform: translateZ(0);\n will-change: transform;\n transform: translate(var(--wmTooltipLeft), var(--wmTooltipTop));\n border: none;\n}\n\n.wm-tooltip:popover-open {\n opacity: 0;\n}\n\n.wm-tooltip.show {\n transition-delay: 500ms;\n opacity: 1;\n}\n";document.head.appendChild(r);e.appendChild(i);document.querySelector("body").appendChild(e)}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as r,h as i,H as s,g as a}from"./p-568c595f.js";import{a as o}from"./p-2732bddd.js";import{n as e,o as n,i as h}from"./p-e995f7f0.js";const c=class{constructor(i){t(this,i),this.wmNavigatorLogout=r(this,"wmNavigatorLogout",7),this.retrievedInfo=!this.loadFromUserinfo,this.parsedProducts=[],this.openRight=!1,this.userName=void 0,this.email=void 0,this.authType=1,this.connectionName=void 0,this.logoutUrl=void 0,this.products=void 0,this.loadFromUserinfo=!1,this.isOpen=!1,this.itemIndexToFocus=0}isSafeUrl(t){let r=!1;return["digitalmeasures\\.com","evalkit\\.info","evaluationkit\\.com","evaluationkit\\.info","lat_ams\\.com","livetext\\.com","smartcatalogiq\\.com","smartcatalogiq\\.net","smartcatalogiq\\.us","taskstream\\.com","vialivetext\\.com","watermarkinsights\\.com"].forEach((i=>{t&&t.match(`^https://(.*.)?${i}(/.*)?$`)&&(r=!0)})),r}async componentWillLoad(){this.userName||console.error("wm-navigator: user-name is a required property."),await this.parseData(),this.setFocusIndex()}async parseData(){this.loadFromUserinfo?await(async()=>{const t=await fetch("/platform/navigator/userinfo");if(t&&t.ok)return await t.json();throw new Error(t.statusText)})().then((t=>{this.email=t.email,this.currentProductId=t.current_product_id,this.parsedProducts=this.productKeysToCamelCase(t.products),this.logoutUrl=this.logoutUrl?this.logoutUrl:t.logout_url,this.connectionName=this.connectionName?this.connectionName:t.connection_name,this.email&&this.currentProductId&&(this.retrievedInfo=!0)})).catch((t=>{console.error(t)})):(this.currentProductId=o(this.el),this.products&&(this.parsedProducts="string"==typeof this.products?JSON.parse(this.products):this.products,this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts))),this.parsedProducts.sort(((t,r)=>t.name<r.name?-1:1))}productKeysToCamelCase(t){return t.map((t=>{const r=Object.keys(t);let i={};return r.forEach((r=>{i[e(r)]=t[r]})),i}))}setFocusIndex(){if(this.parsedProducts.length>1){const t=this.getProduct(this.currentProductId);t&&(this.itemIndexToFocus=this.parsedProducts.indexOf(t))}}handleKeys(t){switch(t.key){case"Escape":t.preventDefault(),this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault(),this.isOpen||(this.itemIndexToFocus=n(this.itemIndexToFocus,t.key,this.navigatorItems.length),this.openMenu())}}handleKeydown(t){const r=t.detail.key,i=t.detail.navItem;switch(r){case"Tab":this.closeMenu(!1);break;case"Enter":case" ":i.click();break;case"ArrowDown":case"ArrowUp":const t=this.itemIndexToFocus;this.itemIndexToFocus=n(this.itemIndexToFocus,r,this.navigatorItems.length),this.focusItem(),this.unfocusItem(t)}}handleClick(t){t.target!==this.el&&!this.el.contains(t.target)&&this.isOpen&&this.closeMenu(!1)}handleButtonClick(){this.isOpen?this.closeMenu():this.openMenu()}openMenu(){if(this.wrapperEl){const t=this.wrapperEl.clientWidth,r=this.el.getBoundingClientRect().left,i=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&i>r}this.isOpen=!0,this.focusItem()}closeMenu(t=!0){this.isOpen=!1,window.requestAnimationFrame((()=>{this.unfocusItem(this.itemIndexToFocus),this.setFocusIndex(),t&&this.buttonFocusHandler()}))}focusItem(){const t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0,t.focused=!0,window.setTimeout((()=>t.focus()),250)}unfocusItem(t){const r=this.navigatorItems[t];r.tabIndex=-1,r.focused=!1}buttonFocusHandler(){this.el.shadowRoot.querySelector("priv-navigator-button").shadowRoot.querySelector("button").focus()}renderUserInfo(){return i("div",{class:"user",id:"wm-nav-user","aria-label":h.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},i("p",null,this.userName),i("p",null,this.email))}setAltText(){return h.formatMessage(this.parsedProducts.length>1?{id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"}:{id:"navigator.userinfo",defaultMessage:"User information"})}renderHeading(){return i("h2",null,h.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))}renderList(){return i("ul",{role:"listbox","aria-label":`${h.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})}`,"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())}renderProductOptions(){return this.parsedProducts.map((t=>{let r,s,a,o;if(r=t.name,s=t.iconUrl,o=this.setProductOnClick(t.id),r&&s)return a=this.currentProductId===t.id,i("priv-navigator-item",{selected:a,id:t.id,onClick:()=>{a?this.closeMenu():o()},role:"option","aria-label":r,"aria-selected":a?"true":"false"},i("img",{src:s,alt:r}))}))}setProductOnClick(t){const r=this.getProduct(t);if(this.currentProductId===t)return()=>{};if(r){if(this.loadFromUserinfo||2===this.authType){const t=r.linkUrl;return this.isSafeUrl(t)?()=>window.location.href=t:void console.error(`"${t}" is not a safe url`)}if(3===this.authType){const t=this.connectionName?`/?connection_name=${this.connectionName}`:"",i=r.samlLinkUrl;return this.isSafeUrl(i)?()=>window.location.href=i+t:void console.error(`"${i}" is not a safe url`)}}}renderLogoutOption(){return i("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option","aria-selected":"false"},i("span",{class:"logout"},h.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))}setLogoutOnclick(){return()=>{this.wmNavigatorLogout.emit();const t=this.logoutUrl;this.isSafeUrl(t)?window.location.href=t:console.error(`"${t}" is not a safe url`)}}get navigatorItems(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))}getProduct(t){return this.parsedProducts.find((r=>r.id===t))}render(){return this.retrievedInfo?i(s,null,i("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText()}),i("div",{class:`wrapper ${this.isOpen?"":"hide"} ${this.openRight?"right":""}`,ref:t=>this.wrapperEl=t},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{products:["parseData"]}}};c.style=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-selected:var(--wmcolor-interactive-background-selected);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";export{c as wm_navigator}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,r,a,t){function n(e){return e instanceof a?e:new a((function(r){r(e)}))}return new(a||(a=Promise))((function(a,i){function o(e){try{p(t.next(e))}catch(e){i(e)}}function d(e){try{p(t["throw"](e))}catch(e){i(e)}}function p(e){e.done?a(e.value):n(e.value).then(o,d)}p((t=t.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,n,i,o;return o={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function d(e){return function(r){return p([e,r])}}function p(d){if(t)throw new TypeError("Generator is already executing.");while(o&&(o=0,d[0]&&(a=0)),a)try{if(t=1,n&&(i=d[0]&2?n["return"]:d[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,d[1])).done)return i;if(n=0,i)d=[d[0]&2,i.value];switch(d[0]){case 0:case 1:i=d;break;case 4:a.label++;return{value:d[1],done:false};case 5:a.label++;n=d[1];d=[0];continue;case 7:d=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){a=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){a.label=d[1];break}if(d[0]===6&&a.label<i[1]){a.label=i[1];i=d;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(d);break}if(i[2])a.ops.pop();a.trys.pop();continue}d=r.call(e,a)}catch(e){d=[6,e];n=0}finally{t=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,r,a){if(a||arguments.length===2)for(var t=0,n=r.length,i;t<n;t++){if(i||!(t in r)){if(!i)i=Array.prototype.slice.call(r,0,t);i[t]=r[t]}}return e.concat(i||Array.prototype.slice.call(r))};System.register(["./p-ab8d78cc.system.js","./p-34b5830f.system.js"],(function(e){"use strict";var r,a,t,n,i,o,d,p,s,l,c;return{setters:[function(e){r=e.r;a=e.c;t=e.h;n=e.H;i=e.g},function(e){o=e.i;d=e.B;p=e.I;s=e.J;l=e.C;c=e.K}],execute:function(){var u=':host{--wmcolor-calendar-border:var(--wmcolor-border);--wmcolor-calendar-day-border-hover:var(--wmcolor-border-focus);--wmcolor-calendar-range-background:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-range-background-hover:var(--wmcolor-datepicker-day-background-hover);--wmcolor-datepicker-range-background-selected:var(--wmcolor-background-selected);--range-start-svg:url(\'data:image/svg+xml,<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 6C0 2.68629 2.68629 0 6 0H28.8457C31.0777 0 33.1251 1.23886 34.1607 3.21596L42.5417 19.216C43.455 20.9596 43.455 23.0404 42.5417 24.784L34.1607 40.784C33.1251 42.7611 31.0777 44 28.8458 44H6C2.68629 44 0 41.3137 0 38V6Z" fill="%23575195"/></svg>\');--range-end-svg:url(\'data:image/svg+xml,<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M44 6C44 2.68629 41.3137 0 38 0H15.1543C12.9223 0 10.8749 1.23886 9.83926 3.21596L1.45831 19.216C0.544956 20.9596 0.54496 23.0404 1.45831 24.784L9.83926 40.784C10.8749 42.7611 12.9223 44 15.1542 44H38C41.3137 44 44 41.3137 44 38V6Z" fill="%23575195"/></svg>\');--range-background-selected:linear-gradient(\n transparent,\n transparent 5px,\n var(--wmcolor-datepicker-range-background-selected) 5px,\n var(--wmcolor-datepicker-range-background-selected) 39px,\n transparent 39px\n );--range-background-hover:linear-gradient(\n transparent,\n transparent 5px,\n var(--wmcolor-datepicker-range-background-hover) 5px,\n var(--wmcolor-datepicker-range-background-hover) 39px,\n transparent 39px\n )}:host priv-calendar+priv-calendar{-webkit-border-start:1px solid var(--wmcolor-calendar-border);border-inline-start:1px solid var(--wmcolor-calendar-border)}.toggle{all:unset;cursor:pointer;padding:0 0.375rem;height:2.375rem;background-color:var(--wmcolor-datepicker-toggle-background);border:none;border-radius:3px}.toggle span::after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f0ed";font-size:1.5rem;color:var(--wmcolor-datepicker-toggle-icon);padding:0;line-height:2.5rem}.toggle:hover{-webkit-box-shadow:none;box-shadow:none;background:var(--wmcolor-datepicker-toggle-background-hover)}.toggle:disabled{pointer-events:none;-webkit-box-shadow:none;box-shadow:none;background-color:var(--wmcolor-datepicker-toggle-background-disabled)}.toggle:disabled .calendar::after{color:var(--wmcolor-datepicker-toggle-icon-disabled)}[dir=RTL] .toggle{right:auto;left:0}.toggle::-moz-focus-inner{border:0}.toggle:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0}.toggle:focus-visible:not(:active){border:none;z-index:11}.inside .toggle{border-top-left-radius:0;border-bottom-left-radius:0;border-start-start-radius:0;border-end-start-radius:0}.popup-wrapper{visibility:hidden;font-family:inherit;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:0px 4px 15px 0px rgba(0, 0, 0, 0.2);box-shadow:0px 4px 15px 0px rgba(0, 0, 0, 0.2);z-index:10;position:absolute;left:0;top:calc(100% + 2px);min-height:21.0625rem;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-webkit-transform-origin:center top;transform-origin:center top;-webkit-transform:scale(1, 0);transform:scale(1, 0);background-color:var(--wmcolor-datepicker-background)}.popup-wrapper.start{border:2px solid cyan}.popup-wrapper.end{left:247px !important;border:2px solid teal}.popup-wrapper.open{-webkit-transform:scale(1, 1);transform:scale(1, 1)}.popup-wrapper.expand-upwards{top:auto;bottom:2.375rem;-webkit-transform-origin:center bottom;transform-origin:center bottom}.popup-wrapper .calendar-header{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;position:relative;padding:0.9375rem 0.25rem}.popup-wrapper .calendar-header .title-box{height:2.625rem;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:1px solid;font-weight:500;font-size:0.875rem;background:var(--wmcolor-datepicker-selector-background);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;padding:0 0.375rem 0 0.75rem;border-color:var(--wmcolor-datepicker-selector-border);color:var(--wmcolor-datepicker-selector-text)}.popup-wrapper .calendar-header .title-box:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f140";padding-left:0.75rem;font-size:1.12rem}.popup-wrapper .calendar-header .title-box.year:after{content:"\\f143"}.popup-wrapper .calendar-header .title-box::-moz-focus-inner{border:0}.popup-wrapper .calendar-header .arw-btn{cursor:pointer;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;width:2.75rem;height:2.75rem;border:none;color:var(--wmcolor-datepicker-navigation-text);background:var(--wmcolor-datepicker-navigation-background);padding:0;-webkit-box-shadow:none;box-shadow:none;line-height:2.75rem}.popup-wrapper .calendar-header .arw-btn .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:1.5rem;font-weight:normal;line-height:2.75rem}.popup-wrapper .calendar-header .arw-btn:hover{background-color:var(--wmcolor-datepicker-navigation-background-hover)}.popup-wrapper .calendar-header .arw-btn:active{-ms-transform:scale(0.9, 0.9);-webkit-transform:scale(0.9, 0.9);-moz-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}.popup-wrapper .separator{min-width:1px;background:var(--wm-color-border)}.popup-wrapper .day-view{min-width:21rem}.popup-wrapper .day-view .date-grid{width:100%;text-align:center;border-collapse:collapse;margin-bottom:0.4375rem;color:var(--wmcolor-datepicker-day-text)}.popup-wrapper .day-view .date-grid div[role=row]{display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around;padding-inline:0.875rem}.popup-wrapper .day-view .date-grid div[role=row]:not(.header-row){height:2.75rem}.popup-wrapper .day-view .date-grid .date-header{background-color:var(--wmcolor-datepicker-weekdays-background)}.popup-wrapper .day-view .date-grid .header-cell{height:2.0625rem;line-height:2.0625rem;width:2.75rem;margin:0 calc((14.28% - 44px) / 2);padding:0;display:inline-block;font-size:0.8125rem;font-weight:bold;color:var(--wmcolor-datepicker-weekdays-text);border:none}.popup-wrapper .day-view .date-grid [role=gridcell]{padding:0;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;aspect-ratio:1;font-size:0.875rem;font-weight:500;position:relative;display:-ms-flexbox;display:flex;-ms-flex:1 0 2.75rem;flex:1 0 2.75rem;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.popup-wrapper .day-view .date-grid .date-cell{cursor:pointer}.popup-wrapper .day-view .date-grid .date-cell:hover{background-color:var(--wmcolor-datepicker-day-background-hover)}.popup-wrapper .day-view .date-grid .date-cell[aria-selected=true]{background-color:var(--wmcolor-datepicker-day-background-selected);color:var(--wmcolor-datepicker-day-text-selected)}.popup-wrapper .day-view .date-grid .date-cell.in-range{background:var(--range-background-selected);border-radius:0}.popup-wrapper .day-view .date-grid .date-cell.in-range.range-start:not(.preview):hover{background-repeat:no-repeat;background-position:center, center left 17px}.popup-wrapper .day-view .date-grid .date-cell.in-range.range-end:not(.preview):hover{background-position:center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range:not(.preview):hover{background-image:radial-gradient(#dbd9ef 20px, transparent 21px), var(--range-background-selected);color:var(--wmcolor-datepicker-day-text)}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview{position:relative;background-image:var(--range-background-hover)}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:last-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:last-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:first-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:first-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.last-of-month:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.first-of-month:not(.preview-start,.preview-end,.range-start,.range-end){background-image:radial-gradient(var(--wmcolor-datepicker-range-background-hover) 16px, transparent 17px), var(--range-background-hover);background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:first-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:first-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.first-of-month:not(.preview-start,.preview-end,.range-start,.range-end){background-position:center left -5px, center left 17px}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:last-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:last-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.last-of-month:not(.preview-start,.preview-end,.range-start,.range-end){background-position:center right -5px, center right 17px}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.last-of-month:first-child:not(.preview-start,.preview-end){background-image:radial-gradient(var(--wmcolor-datepicker-range-background-hover) 16px, transparent 17px), radial-gradient(var(--wmcolor-datepicker-range-background-hover) 16px, transparent 17px), linear-gradient(transparent, transparent 15px, var(--wmcolor-datepicker-range-background-hover) 15px, var(--wmcolor-datepicker-range-background-hover) 29px, transparent 29px);background-position:center left -5px, center right -5px, center;background-size:auto, auto, 9px}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start:last-child,.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end:first-child{background-image:radial-gradient(var(--wmcolor-datepicker-range-background-hover) 17px, var(--wmcolor-calendar-day-border-hover) 18px, var(--wmcolor-calendar-day-border-hover) 20px, transparent 21px)}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start{background-position:center, center left 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start:first-child{background-position:center, center left 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end{background-position:center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end:last-child{background-position:center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end,.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start{background-image:radial-gradient(var(--wmcolor-datepicker-range-background-hover) 17px, var(--wmcolor-calendar-day-border-hover) 18px, var(--wmcolor-calendar-day-border-hover) 20px, transparent 21px), var(--range-background-hover)}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end:focus-visible,.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start:focus-visible{outline:none;border:none}.popup-wrapper .day-view .date-grid .date-cell.in-range:first-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range:first-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.first-of-month:not(.preview-start,.preview-end,.range-start,.range-end){background-image:radial-gradient(var(--wmcolor-datepicker-range-background-selected) 16px, transparent 17px), var(--range-background-selected);background-position:-5px center, center left 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range:first-of-type:not(.preview-start,.preview-end,.range-start,.range-end):hover,.popup-wrapper .day-view .date-grid .date-cell.in-range:first-child:not(.preview-start,.preview-end,.range-start,.range-end):hover,.popup-wrapper .day-view .date-grid .date-cell.in-range.first-of-month:not(.preview-start,.preview-end,.range-start,.range-end):hover{background-image:radial-gradient(#dbd9ef 20px, transparent 21px), radial-gradient(var(--wmcolor-datepicker-range-background-selected) 16px, transparent 17px), var(--range-background-selected);background-position:center, -5px center, center left 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.range-start:last-child:hover,.popup-wrapper .day-view .date-grid .date-cell.in-range.range-end:first-child:hover{background:radial-gradient(#dbd9ef 20px, transparent 21px);background-position:center}.popup-wrapper .day-view .date-grid .date-cell.in-range:last-of-type:not(.range-start,.range-end,.preview),.popup-wrapper .day-view .date-grid .date-cell.in-range:last-child:not(.range-start,.range-end,.preview),.popup-wrapper .day-view .date-grid .date-cell.in-range.last-of-month:not(.range-start,.range-end,.preview){background:radial-gradient(var(--wmcolor-datepicker-range-background-selected) 16px, transparent 17px), var(--range-background-selected);background-position:5px center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range:last-of-type:not(.range-start,.range-end,.preview-start,.preview-end):hover,.popup-wrapper .day-view .date-grid .date-cell.in-range:last-child:not(.range-start,.range-end,.preview-start,.preview-end):hover,.popup-wrapper .day-view .date-grid .date-cell.in-range.last-of-month:not(.range-start,.range-end,.preview-start,.preview-end):hover{background-image:radial-gradient(#dbd9ef 20px, transparent 21px), radial-gradient(var(--wmcolor-datepicker-range-background-selected) 16px, transparent 17px), var(--range-background-selected);background-position:center, 5px center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.today:after{content:"";display:block;position:absolute;inset:auto 0 6px 0;width:6px;aspect-ratio:1;border-radius:50%;justify-self:center;background-color:var(--wmcolor-datepicker-day-background-selected);margin:auto}.popup-wrapper .day-view .date-grid .date-cell.range-start,.popup-wrapper .day-view .date-grid .date-cell.range-end{border-radius:0;margin:0;outline:none;font-weight:600;color:var(--wmcolor-datepicker-day-text-selected)}.popup-wrapper .day-view .date-grid .date-cell.range-start:focus-visible,.popup-wrapper .day-view .date-grid .date-cell.range-end:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-2px;border:none;z-index:11}.popup-wrapper .day-view .date-grid .date-cell.range-start:focus-visible[aria-selected=true],.popup-wrapper .day-view .date-grid .date-cell.range-end:focus-visible[aria-selected=true]{outline-offset:2px}.popup-wrapper .day-view .date-grid .date-cell.range-start{background-image:var(--range-start-svg);-webkit-padding-end:2px;padding-inline-end:2px;background-color:transparent}.popup-wrapper .day-view .date-grid .date-cell.range-start.in-range:not(:hover,:last-of-type,:last-child){background-image:var(--range-start-svg), var(--range-background-selected);border-radius:0}.popup-wrapper .day-view .date-grid .date-cell.range-start.in-range.preview:not(:last-of-type,:last-child){background-image:var(--range-start-svg), var(--range-background-hover)}.popup-wrapper .day-view .date-grid .date-cell.range-end{background-image:var(--range-end-svg);-webkit-padding-start:2px;padding-inline-start:2px;background-color:transparent}.popup-wrapper .day-view .date-grid .date-cell.range-end.in-range:not(:hover,:first-of-type,:first-child){background-image:var(--range-end-svg), var(--range-background-selected);border-radius:0}.popup-wrapper .day-view .date-grid .date-cell.range-end.in-range.preview:not(:first-of-type,:first-child){background-image:var(--range-end-svg), var(--range-background-hover)}.popup-wrapper .day-view .date-grid .date-cell.range-start.range-end{background:var(--wmcolor-datepicker-day-background-selected);border-radius:50%;padding-inline:0;margin:1px;-ms-flex-preferred-size:42px;flex-basis:42px}.popup-wrapper .month-view .months{border-top:2px solid;border-top-color:var(--wmcolor-datepicker-month-border);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.popup-wrapper .month-view .month-row{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;width:100%;border-bottom:2px solid;border-bottom-color:var(--wmcolor-datepicker-month-border)}.popup-wrapper .month-view .month{border:none;background:white;cursor:pointer;width:7rem;height:4rem;line-height:4rem;font-family:inherit;font-weight:500;color:var(--wmcolor-datepicker-month-text)}.popup-wrapper .month-view .month:not(:last-child){border-right:2px solid;border-right-color:var(--wmcolor-datepicker-month-border)}.popup-wrapper .month-view .month:hover{border-right-color:transparent;background-color:var(--wmcolor-datepicker-month-background-hover)}.popup-wrapper .month-view .month:active,.popup-wrapper .month-view .month.selected{background-color:var(--wmcolor-datepicker-month-background-selected);color:var(--wmcolor-datepicker-month-text-selected)}.popup-wrapper button:focus-visible:not(.preview-start,.preview-end),.popup-wrapper .title-box:focus-visible:not(.preview-start,.preview-end),.popup-wrapper .month.focused:focus-visible:not(.preview-start,.preview-end),.popup-wrapper .date-cell:focus-visible:not(.preview-start,.preview-end){outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-2px;border:none;z-index:11}.popup-wrapper button:focus-visible:not(.preview-start,.preview-end)[aria-selected=true],.popup-wrapper .title-box:focus-visible:not(.preview-start,.preview-end)[aria-selected=true],.popup-wrapper .month.focused:focus-visible:not(.preview-start,.preview-end)[aria-selected=true],.popup-wrapper .date-cell:focus-visible:not(.preview-start,.preview-end)[aria-selected=true]{outline-offset:2px}.popup-range{display:-ms-flexbox;display:flex}.popup{width:21rem}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var g=e("priv_calendar",function(){function e(e){var n=this;r(this,e);this.cellTriggered=a(this,"cellTriggered",7);this.cellHovered=a(this,"cellHovered",7);this.outOfCal=a(this,"outOfCal",7);this.popupBlurred=a(this,"popupBlurred",7);this.dateFocus=a(this,"dateFocus",7);this.today=this.dateToISO(new Date);this.calType="single";this.calName="";this.calInstructions=o.formatMessage({id:"date.instructions",defaultMessage:"Use arrows to select a date in the table. Tab left or right to buttons for selecting previous month, next month, or the month selection table."});this._focus={year:{asString:function(){return d.year.asString(n.focusDate)},asInt:function(){return d.year.asInt(n.focusDate)},set:function(e){var r=n._focus.month.asInt();var a=n._focus.day.asInt();n.focusDate=p(e,r,a)},increase:function(e){var r=d.year.increase(n.focusDate,e);n.focusDate=r},decrease:function(e){var r=d.year.decrease(n.focusDate,e);n.focusDate=r}},month:{asString:function(){return d.month.asString(n.focusDate)},asInt:function(){return d.month.asInt(n.focusDate)},set:function(e){var r=n._focus.year.asInt();var a=n._focus.day.asInt();n.focusDate=p(r,e,a)},increase:function(e){var r=d.month.increase(n.focusDate,e);n.focusDate=r},decrease:function(e){var r=d.month.decrease(n.focusDate,e);n.focusDate=r}},day:{asString:function(){return d.day.asString(n.focusDate)},asInt:function(){return d.day.asInt(n.focusDate)},set:function(e){var r=n._focus.year.asInt();var a=n._focus.month.asInt();e=e===-1?c(a,r):e;n.focusDate=p(r,a,e)},increase:function(e){var r=d.day.increase(n.focusDate,e);n.focusDate=r},decrease:function(e){var r=d.day.decrease(n.focusDate,e);n.focusDate=r}}};this.monthButtonFocus={set:function(e){var r=Array.from(n.el.querySelectorAll(".month"));var a=r.filter((function(e){return e.classList.contains("focused")}))[0];a.classList.remove("selected");a.tabIndex=-1;r[e-1].classList.add("selected");r[e-1].tabIndex=0;r[e-1].focus()},increase:function(e){var r=Array.from(n.el.querySelectorAll(".month"));var a=r.filter((function(e){return e.classList.contains("focused")}))[0];var t=r.indexOf(a);var i=(t+e)%12;if(i<t){n._focus.year.increase(1)}a.classList.remove("focused");a.tabIndex=-1;r[i].classList.add("focused");r[i].tabIndex=0;r[i].focus()},decrease:function(e){var r=Array.from(n.el.querySelectorAll(".month"));var a=r.filter((function(e){return e.classList.contains("focused")}))[0];var t=r.indexOf(a);var i=t+24;i=(i-e)%12;if(i>t){n._focus.year.decrease(1)}a.classList.remove("focused");a.tabIndex=-1;r[i].classList.add("focused");r[i].tabIndex=0;r[i].focus()}};this.renderCalendarDate=function(e,r,a,i){if(e==="placeholder"){return t("div",{role:"gridcell"})}var p=d.month.asInt(e);var u=d.day.asInt(e);var g=d.year.asInt(e);var v=a&&a===e;var w=v?"true":"false";var h=["date-cell"];var f=e===n.focusDate;var b=e===n.today;if(b)h.push("today");if(n.calType==="range"){var m=a&&i&&i===e&&a<i;w=m?"true":w;var k=u===1;var y=u===c(p,g);var x=n.isInRange(e);var C=n.isInRangePreview(e);var M=!i&&a&&n.hoverDate&&e===n.hoverDate;var _=M&&n.hoverDate<a;var A=M&&n.hoverDate>a;if(k)h.push("first-of-month");if(y)h.push("last-of-month");if(v){if(C&&!m&&n.hoverDate&&n.hoverDate<a){h.push("range-end")}else{h.push("range-start")}}if(m)h.push("range-end");if(x)h.push("in-range");if(C)h.push("in-range preview");if(_)h.push("preview-start");if(A)h.push("preview-end")}var z=h.join(" ");return t("div",{role:"gridcell",id:"cell-".concat(e),class:z,"aria-selected":w,"aria-label":"".concat(b?"".concat(o.formatMessage({id:"date.today",defaultMessage:"today",description:"calendar button"}),", "):"").concat(s[r],", ").concat(l[p-1]," ").concat(u,", ").concat(g),onClick:function(e){n.handleDateClick(e.target)},onMouseOver:function(){return n.cellHovered.emit(e)},"data-month":d.month.asString(e),"data-year":d.year.asString(e),onBlur:function(e){return e.stopPropagation()},tabIndex:f?0:-1},u)};this.disabled=false;this.view="day";this.focusDate=this.today;this.startDate=undefined;this.endDate=undefined;this.hoverDate=undefined}e.prototype.setCalName=function(){var e=this.el.parentElement.querySelectorAll("priv-calendar");var r;if(e.length===1){r=o.formatMessage({id:"date.calName",defaultMessage:"Calendar. "})}else if(e[0]===this.el){r=o.formatMessage({id:"date.firstCalName",defaultMessage:"First calendar. "})}else{r=o.formatMessage({id:"date.secondCalName",defaultMessage:"Second calendar. "})}this.calName=r};e.prototype.setCalType=function(){var e=this.el.parentElement.querySelectorAll("priv-calendar");this.calType=e.length===1?"single":"range"};e.prototype.componentWillLoad=function(){this.setCalName();this.setCalType()};e.prototype.handleFocusDate=function(e,r){if(this.view==="day"){var a=this.getCell(r);if(a)a.tabIndex=-1;var t=this.getCell(e);if(t)t.tabIndex=0}else{var n=this.el.querySelector("#month-".concat(d.month.asInt(r)));if(n)n.tabIndex=-1;var i=this.el.querySelector("#month-".concat(d.month.asInt(e)));if(i)i.tabIndex=0}this.dateFocus.emit()};Object.defineProperty(e.prototype,"otherCalEl",{get:function(){var e=this.el.parentElement.querySelectorAll("priv-calendar");var r;if(e.length===2){r=e[0]===this.el?e[1]:e[0]}return r},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"headerButtonEls",{get:function(){return Array.from(this.el.querySelectorAll(".header-btn"))},enumerable:false,configurable:true});e.prototype.handleKey=function(e){switch(e.key){case" ":case"Enter":e.preventDefault();!e.target.id.includes("popup-title")&&e.target.click();break;case"PageUp":e.preventDefault();if(this.view==="day"){this._focus.month.decrease(1);this.focusCell()}else{this._focus.year.decrease(1)}break;case"PageDown":e.preventDefault();if(this.view==="day"){this._focus.month.increase(1);this.focusCell()}else{this._focus.year.increase(1)}break;case"Home":e.preventDefault();if(this.view==="day"){this._focus.day.set(1);this.focusCell()}else{this.monthButtonFocus.set(1)}break;case"End":e.preventDefault();if(this.view==="day"){this._focus.day.set(-1);this.focusCell()}else{this.monthButtonFocus.set(12)}break;case"ArrowLeft":e.preventDefault();if(this.view==="day"){this._focus.day.decrease(1);this.focusCell()}else{this.monthButtonFocus.decrease(1)}break;case"ArrowRight":e.preventDefault();if(this.view==="day"){this._focus.day.increase(1);this.focusCell()}else{this.monthButtonFocus.increase(1)}break;case"ArrowUp":e.preventDefault();if(this.view==="day"){this._focus.day.decrease(7);this.focusCell()}else{this.monthButtonFocus.decrease(3)}break;case"ArrowDown":e.preventDefault();if(this.view==="day"){if(!(document.activeElement.shadowRoot||document).activeElement.classList.contains("date-cell")){this.focusCell();break}this._focus.day.increase(7);this.focusCell()}else{var r=(document.activeElement.shadowRoot||document).activeElement;if(r.classList.contains("header-btn")){var a="#month-".concat(this._focus.month.asInt());var t=this.el.querySelector(a);t.tabIndex=0;t.focus();break}this.monthButtonFocus.increase(3)}break}};e.prototype.handleDateClick=function(e){var r={cal:this.el,cell:e};this.cellTriggered.emit(r)};e.prototype.removeZeroes=function(e){return+e<10?+e.slice(1):+e};e.prototype.dateToISO=function(e){var r=[e.getUTCFullYear().toString().padStart(4,"0"),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0")];return r.join("-")};e.prototype.isInRange=function(e){if(this.otherCalEl){var r=this.startDate||this.otherCalEl.startDate;var a=this.endDate||this.otherCalEl.endDate;if(r&&a){return r<=e&&e<=a}}return false};e.prototype.isInRangePreview=function(e){if(this.otherCalEl){var r=this.startDate||this.otherCalEl.startDate;var a=this.endDate||this.otherCalEl.endDate;if(r&&a)return false;if(r&&this.hoverDate){if(this.hoverDate>r){return r<=e&&e<=this.hoverDate}else if(this.hoverDate<r){return this.hoverDate<=e&&e<=r}}else if(a&&this.hoverDate){if(this.hoverDate<a){return this.hoverDate<=e&&e<=a}else if(this.hoverDate>a){return a<=e&&e<=this.hoverDate}}}return false};e.prototype.getMonthFirstDay=function(e,r){return+new Date(r,e-1,1,12,0,0).getDay()+1};e.prototype.getCalendarDates=function(e){var r=d.month.asInt(e);var a=d.year.asInt(e);var t=c(r,a);var n=__spreadArray([],new Array(t).fill(undefined),true).map((function(e,t){var n=t+1;return p(a,r,n)}));var i=this.getMonthFirstDay(r,a);var o=i-1;var s=o>0?new Array(o).fill("placeholder"):[];var l=42-(o+t);l=l>6?l-7:l;var u=l>0?new Array(l).fill("placeholder"):[];return __spreadArray(__spreadArray(__spreadArray([],s,true),n,true),u,true)};e.prototype.getCell=function(e){return this.el.querySelector("#cell-".concat(e))};e.prototype.focusFirstFocusable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.prevBtnEl.focus();return[2]}))}))};e.prototype.focusLastFocusable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.focusCell();return[2]}))}))};e.prototype.focusCell=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){requestAnimationFrame((function(){var r=c(e._focus.month.asInt(),e._focus.year.asInt());var a=e._focus.day.asInt();if(a>r){e._focus.day.set(r)}var t=e.getCell(e.focusDate);if(t){t.tabIndex=0;t.focus()}if(e.view=="day"){e.cellHovered.emit(e.focusDate)}}));return[2]}))}))};e.prototype.toggleBusyAttribute=function(e){this.el.querySelector("#wm-container").setAttribute("aria-busy",e)};e.prototype.renderMonth=function(e,r){var a=this;return t("button",{id:"month-".concat(r+1),class:"month ".concat(this._focus.month.asInt()===r+1?"selected focused":""),role:"gridcell",tabindex:r+1===this._focus.month.asInt()?0:-1,onBlur:function(e){return e.stopPropagation()},onClick:function(){a._focus.month.set(r+1);a.view="day";a.focusCell()}},e)};e.prototype.renderDayView=function(){var e=this;var r=this.getCalendarDates(this.focusDate);var a=this.startDate||this.otherCalEl&&this.otherCalEl.startDate;var n=this.endDate||this.otherCalEl&&this.otherCalEl.endDate;return t("div",{class:"popup day-view"},t("div",{class:"calendar-header"},t("button",{onClick:function(){e._focus.month.decrease(1)},class:"header-btn arw-btn",ref:function(r){return e.prevBtnEl=r},"aria-label":o.formatMessage({id:"date.selectPreviousMonth",defaultMessage:"Select previous month",description:"Calendar button"})},t("span",{class:"mdi"},"")),t("div",{id:"popup-title-month",class:"header-btn title-box",tabindex:"0",role:"button",onKeyDown:function(r){if(r.key==="Enter"||r.key===" "){r.preventDefault();e.view="month"}},onClick:function(){return e.view="month"},"aria-label":"".concat(o.formatMessage({id:"date.currentMonth",defaultMessage:"current month",description:"Calendar button"}),": ").concat(l[this._focus.month.asInt()-1],"\n ").concat(this._focus.year.asString(),"."),"aria-describedby":"month-title"},t("span",{class:"title","aria-hidden":"true"},l[this._focus.month.asInt()-1]," ",this._focus.year.asString())),t("button",{onClick:function(){e._focus.month.increase(1)},"aria-label":o.formatMessage({id:"date.selectNextMonth",defaultMessage:"Select next month",description:"Calendar button"}),class:"header-btn arw-btn"},t("span",{class:"mdi"},""))),t("div",{"aria-labelledby":"popup-title-month",role:"grid",class:"date-grid"},t("div",{role:"rowgroup",class:"date-header"},t("div",{role:"row",class:"header-row"},t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.su",defaultMessage:"Su",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.mo",defaultMessage:"Mo",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.tu",defaultMessage:"Tu",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.we",defaultMessage:"We",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.th",defaultMessage:"Th",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.fr",defaultMessage:"Fr",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.sa",defaultMessage:"Sa",description:"Abbreviated day of the week"}))))),t("div",{role:"rowgroup"},t("div",{role:"row",class:"date-row"},r.slice(0,7).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),t("div",{role:"row"},r.slice(7,14).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),t("div",{role:"row"},r.slice(14,21).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),t("div",{role:"row"},r.slice(21,28).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),t("div",{role:"row"},r.slice(28,35).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),r.length>35?t("div",{role:"row"},r.slice(35).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))):"")))};e.prototype.renderMonthView=function(){var e=this;return t("div",{class:"month-view"},t("div",{class:"calendar-header"},t("button",{onClick:function(){e._focus.year.decrease(1)},"aria-label":o.formatMessage({id:"date.selectPreviousYear",defaultMessage:"Select previous year",description:"Calendar button"}),class:"header-btn arw-btn",ref:function(r){return e.prevBtnEl=r}},t("span",{class:"mdi"},"")),t("div",{id:"popup-title-year",tabindex:"0",class:"header-btn title-box year",role:"button",onClick:function(){return e.view="day"},onKeyDown:function(r){if(r.key==="Enter"||r.key===" "){r.preventDefault();e.view="day"}},"aria-labelledby":"year-title"},t("span",{class:"title"},this._focus.year.asString())),t("button",{onClick:function(){e._focus.year.increase(1)},"aria-label":o.formatMessage({id:"date.selectNextYear",defaultMessage:"Select next year",description:"Calendar button"}),class:"header-btn arw-btn"},t("span",{class:"mdi"},""))),t("div",{"aria-labelledby":"popup-title-year",role:"grid",class:"months"},t("div",{role:"row",class:"month-row"},l.slice(0,3).map((function(r,a){return e.renderMonth(r,a)}))),t("div",{role:"row",class:"month-row"},l.slice(3,6).map((function(r,a){return e.renderMonth(r,a+3)}))),t("div",{role:"row",class:"month-row"},l.slice(6,9).map((function(r,a){return e.renderMonth(r,a+6)}))),t("div",{role:"row",class:"month-row"},l.slice(9).map((function(r,a){return e.renderMonth(r,a+9)})))))};e.prototype.render=function(){var e=this;return t(n,{onMouseOut:function(r){if(!e.el.parentElement.contains(r.toElement))e.outOfCal.emit()},role:"application","aria-describedby":"application"},this.view==="day"?this.renderDayView():this.renderMonthView(),t("div",{id:"application",class:"sr-only"},this.calName,this.calInstructions))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{focusDate:["handleFocusDate"]}},enumerable:false,configurable:true});return e}());g.style=u}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,r,a,t){function n(e){return e instanceof a?e:new a((function(r){r(e)}))}return new(a||(a=Promise))((function(a,i){function o(e){try{p(t.next(e))}catch(e){i(e)}}function d(e){try{p(t["throw"](e))}catch(e){i(e)}}function p(e){e.done?a(e.value):n(e.value).then(o,d)}p((t=t.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,n,i,o;return o={next:d(0),throw:d(1),return:d(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function d(e){return function(r){return p([e,r])}}function p(d){if(t)throw new TypeError("Generator is already executing.");while(o&&(o=0,d[0]&&(a=0)),a)try{if(t=1,n&&(i=d[0]&2?n["return"]:d[0]?n["throw"]||((i=n["return"])&&i.call(n),0):n.next)&&!(i=i.call(n,d[1])).done)return i;if(n=0,i)d=[d[0]&2,i.value];switch(d[0]){case 0:case 1:i=d;break;case 4:a.label++;return{value:d[1],done:false};case 5:a.label++;n=d[1];d=[0];continue;case 7:d=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){a=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){a.label=d[1];break}if(d[0]===6&&a.label<i[1]){a.label=i[1];i=d;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(d);break}if(i[2])a.ops.pop();a.trys.pop();continue}d=r.call(e,a)}catch(e){d=[6,e];n=0}finally{t=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,r,a){if(a||arguments.length===2)for(var t=0,n=r.length,i;t<n;t++){if(i||!(t in r)){if(!i)i=Array.prototype.slice.call(r,0,t);i[t]=r[t]}}return e.concat(i||Array.prototype.slice.call(r))};System.register(["./p-ab8d78cc.system.js","./p-34b5830f.system.js"],(function(e){"use strict";var r,a,t,n,i,o,d,p,s,l,c;return{setters:[function(e){r=e.r;a=e.c;t=e.h;n=e.H;i=e.g},function(e){o=e.i;d=e.B;p=e.I;s=e.J;l=e.C;c=e.K}],execute:function(){var u=':host{--wmcolor-calendar-border:var(--wmcolor-border);--wmcolor-calendar-day-border-hover:var(--wmcolor-border-focus);--wmcolor-calendar-range-background:var(--wmcolor-interactive-background-hover);--wmcolor-datepicker-range-background-hover:var(--wmcolor-datepicker-day-background-hover);--wmcolor-datepicker-range-background-selected:var(--wmcolor-background-selected);--range-start-svg:url(\'data:image/svg+xml,<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 6C0 2.68629 2.68629 0 6 0H28.8457C31.0777 0 33.1251 1.23886 34.1607 3.21596L42.5417 19.216C43.455 20.9596 43.455 23.0404 42.5417 24.784L34.1607 40.784C33.1251 42.7611 31.0777 44 28.8458 44H6C2.68629 44 0 41.3137 0 38V6Z" fill="%23575195"/></svg>\');--range-end-svg:url(\'data:image/svg+xml,<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M44 6C44 2.68629 41.3137 0 38 0H15.1543C12.9223 0 10.8749 1.23886 9.83926 3.21596L1.45831 19.216C0.544956 20.9596 0.54496 23.0404 1.45831 24.784L9.83926 40.784C10.8749 42.7611 12.9223 44 15.1542 44H38C41.3137 44 44 41.3137 44 38V6Z" fill="%23575195"/></svg>\');--range-background-selected:linear-gradient(\n transparent,\n transparent 5px,\n var(--wmcolor-datepicker-range-background-selected) 5px,\n var(--wmcolor-datepicker-range-background-selected) 39px,\n transparent 39px\n );--range-background-hover:linear-gradient(\n transparent,\n transparent 5px,\n var(--wmcolor-datepicker-range-background-hover) 5px,\n var(--wmcolor-datepicker-range-background-hover) 39px,\n transparent 39px\n )}:host priv-calendar+priv-calendar{-webkit-border-start:1px solid var(--wmcolor-calendar-border);border-inline-start:1px solid var(--wmcolor-calendar-border)}.toggle{all:unset;cursor:pointer;padding:0 0.375rem;height:2.375rem;background-color:var(--wmcolor-datepicker-toggle-background);border:none;border-radius:3px}.toggle span::after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f0ed";font-size:1.5rem;color:var(--wmcolor-datepicker-toggle-icon);padding:0;line-height:2.5rem}.toggle:hover{-webkit-box-shadow:none;box-shadow:none;background:var(--wmcolor-datepicker-toggle-background-hover)}.toggle:disabled{pointer-events:none;-webkit-box-shadow:none;box-shadow:none;background-color:var(--wmcolor-datepicker-toggle-background-disabled)}.toggle:disabled .calendar::after{color:var(--wmcolor-datepicker-toggle-icon-disabled)}[dir=RTL] .toggle{right:auto;left:0}.toggle::-moz-focus-inner{border:0}.toggle:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:0}.toggle:focus-visible:not(:active){border:none;z-index:11}.inside .toggle{border-top-left-radius:0;border-bottom-left-radius:0;border-start-start-radius:0;border-end-start-radius:0}.popup-wrapper{visibility:hidden;font-family:inherit;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;-webkit-box-shadow:0px 4px 15px 0px rgba(0, 0, 0, 0.2);box-shadow:0px 4px 15px 0px rgba(0, 0, 0, 0.2);z-index:10;position:absolute;left:0;top:calc(100% + 2px);min-height:21.0625rem;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-webkit-transform-origin:center top;transform-origin:center top;-webkit-transform:scale(1, 0);transform:scale(1, 0);background-color:var(--wmcolor-datepicker-background)}.popup-wrapper.start{border:2px solid cyan}.popup-wrapper.end{left:247px !important;border:2px solid teal}.popup-wrapper.open{-webkit-transform:scale(1, 1);transform:scale(1, 1)}.popup-wrapper.expand-upwards{top:auto;bottom:2.375rem;-webkit-transform-origin:center bottom;transform-origin:center bottom}.popup-wrapper .calendar-header{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;position:relative;padding:0.9375rem 0.25rem}.popup-wrapper .calendar-header .title-box{height:2.625rem;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:1px solid;font-weight:500;font-size:0.875rem;background:var(--wmcolor-datepicker-selector-background);cursor:pointer;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;padding:0 0.375rem 0 0.75rem;border-color:var(--wmcolor-datepicker-selector-border);color:var(--wmcolor-datepicker-selector-text)}.popup-wrapper .calendar-header .title-box:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f140";padding-left:0.75rem;font-size:1.12rem}.popup-wrapper .calendar-header .title-box.year:after{content:"\\f143"}.popup-wrapper .calendar-header .title-box::-moz-focus-inner{border:0}.popup-wrapper .calendar-header .arw-btn{cursor:pointer;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;width:2.75rem;height:2.75rem;border:none;color:var(--wmcolor-datepicker-navigation-text);background:var(--wmcolor-datepicker-navigation-background);padding:0;-webkit-box-shadow:none;box-shadow:none;line-height:2.75rem}.popup-wrapper .calendar-header .arw-btn .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:1.5rem;font-weight:normal;line-height:2.75rem}.popup-wrapper .calendar-header .arw-btn:hover{background-color:var(--wmcolor-datepicker-navigation-background-hover)}.popup-wrapper .calendar-header .arw-btn:active{-ms-transform:scale(0.9, 0.9);-webkit-transform:scale(0.9, 0.9);-moz-transform:scale(0.9, 0.9);transform:scale(0.9, 0.9)}.popup-wrapper .separator{min-width:1px;background:var(--wm-color-border)}.popup-wrapper .day-view{min-width:21rem}.popup-wrapper .day-view .date-grid{width:100%;text-align:center;border-collapse:collapse;margin-bottom:0.4375rem;color:var(--wmcolor-datepicker-day-text)}.popup-wrapper .day-view .date-grid div[role=row]{display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around;padding-inline:0.875rem}.popup-wrapper .day-view .date-grid div[role=row]:not(.header-row){height:2.75rem}.popup-wrapper .day-view .date-grid .date-header{background-color:var(--wmcolor-datepicker-weekdays-background)}.popup-wrapper .day-view .date-grid .header-cell{height:2.0625rem;line-height:2.0625rem;width:2.75rem;margin:0 calc((14.28% - 44px) / 2);padding:0;display:inline-block;font-size:0.8125rem;font-weight:bold;color:var(--wmcolor-datepicker-weekdays-text);border:none}.popup-wrapper .day-view .date-grid [role=gridcell]{padding:0;-webkit-border-radius:50%;-moz-border-radius:50%;-ms-border-radius:50%;border-radius:50%;aspect-ratio:1;font-size:0.875rem;font-weight:500;position:relative;display:-ms-flexbox;display:flex;-ms-flex:1 0 2.75rem;flex:1 0 2.75rem;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.popup-wrapper .day-view .date-grid .date-cell{cursor:pointer}.popup-wrapper .day-view .date-grid .date-cell:hover{background-color:var(--wmcolor-datepicker-day-background-hover)}.popup-wrapper .day-view .date-grid .date-cell[aria-selected=true]{background-color:var(--wmcolor-datepicker-day-background-selected);color:var(--wmcolor-datepicker-day-text-selected)}.popup-wrapper .day-view .date-grid .date-cell.in-range{background:var(--range-background-selected);border-radius:0}.popup-wrapper .day-view .date-grid .date-cell.in-range.range-start:not(.preview):hover{background-repeat:no-repeat;background-position:center, center left 17px}.popup-wrapper .day-view .date-grid .date-cell.in-range.range-end:not(.preview):hover{background-position:center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range:not(.preview):hover{background-image:radial-gradient(#dbd9ef 20px, transparent 21px), var(--range-background-selected);color:var(--wmcolor-datepicker-day-text)}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview{position:relative;background-image:var(--range-background-hover)}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:last-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:last-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:first-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:first-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.last-of-month:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.first-of-month:not(.preview-start,.preview-end,.range-start,.range-end){background-image:radial-gradient(var(--wmcolor-datepicker-range-background-hover) 16px, transparent 17px), var(--range-background-hover);background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:first-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:first-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.first-of-month:not(.preview-start,.preview-end,.range-start,.range-end){background-position:center left -5px, center left 17px}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:last-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview:last-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.last-of-month:not(.preview-start,.preview-end,.range-start,.range-end){background-position:center right -5px, center right 17px}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview.last-of-month:first-child:not(.preview-start,.preview-end){background-image:radial-gradient(var(--wmcolor-datepicker-range-background-hover) 16px, transparent 17px), radial-gradient(var(--wmcolor-datepicker-range-background-hover) 16px, transparent 17px), linear-gradient(transparent, transparent 15px, var(--wmcolor-datepicker-range-background-hover) 15px, var(--wmcolor-datepicker-range-background-hover) 29px, transparent 29px);background-position:center left -5px, center right -5px, center;background-size:auto, auto, 9px}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start:last-child,.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end:first-child{background-image:radial-gradient(var(--wmcolor-datepicker-range-background-hover) 17px, var(--wmcolor-calendar-day-border-hover) 18px, var(--wmcolor-calendar-day-border-hover) 20px, transparent 21px)}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start{background-position:center, center left 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start:first-child{background-position:center, center left 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end{background-position:center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end:last-child{background-position:center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end,.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start{background-image:radial-gradient(var(--wmcolor-datepicker-range-background-hover) 17px, var(--wmcolor-calendar-day-border-hover) 18px, var(--wmcolor-calendar-day-border-hover) 20px, transparent 21px), var(--range-background-hover)}.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-end:focus-visible,.popup-wrapper .day-view .date-grid .date-cell.in-range.preview-start:focus-visible{outline:none;border:none}.popup-wrapper .day-view .date-grid .date-cell.in-range:first-of-type:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range:first-child:not(.preview-start,.preview-end,.range-start,.range-end),.popup-wrapper .day-view .date-grid .date-cell.in-range.first-of-month:not(.preview-start,.preview-end,.range-start,.range-end){background-image:radial-gradient(var(--wmcolor-datepicker-range-background-selected) 16px, transparent 17px), var(--range-background-selected);background-position:-5px center, center left 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range:first-of-type:not(.preview-start,.preview-end,.range-start,.range-end):hover,.popup-wrapper .day-view .date-grid .date-cell.in-range:first-child:not(.preview-start,.preview-end,.range-start,.range-end):hover,.popup-wrapper .day-view .date-grid .date-cell.in-range.first-of-month:not(.preview-start,.preview-end,.range-start,.range-end):hover{background-image:radial-gradient(#dbd9ef 20px, transparent 21px), radial-gradient(var(--wmcolor-datepicker-range-background-selected) 16px, transparent 17px), var(--range-background-selected);background-position:center, -5px center, center left 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range.range-start:last-child:hover,.popup-wrapper .day-view .date-grid .date-cell.in-range.range-end:first-child:hover{background:radial-gradient(#dbd9ef 20px, transparent 21px);background-position:center}.popup-wrapper .day-view .date-grid .date-cell.in-range:last-of-type:not(.range-start,.range-end,.preview),.popup-wrapper .day-view .date-grid .date-cell.in-range:last-child:not(.range-start,.range-end,.preview),.popup-wrapper .day-view .date-grid .date-cell.in-range.last-of-month:not(.range-start,.range-end,.preview){background:radial-gradient(var(--wmcolor-datepicker-range-background-selected) 16px, transparent 17px), var(--range-background-selected);background-position:5px center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.in-range:last-of-type:not(.range-start,.range-end,.preview-start,.preview-end):hover,.popup-wrapper .day-view .date-grid .date-cell.in-range:last-child:not(.range-start,.range-end,.preview-start,.preview-end):hover,.popup-wrapper .day-view .date-grid .date-cell.in-range.last-of-month:not(.range-start,.range-end,.preview-start,.preview-end):hover{background-image:radial-gradient(#dbd9ef 20px, transparent 21px), radial-gradient(var(--wmcolor-datepicker-range-background-selected) 16px, transparent 17px), var(--range-background-selected);background-position:center, 5px center, center right 17px;background-repeat:no-repeat}.popup-wrapper .day-view .date-grid .date-cell.today:after{content:"";display:block;position:absolute;inset:auto 0 6px 0;width:6px;aspect-ratio:1;border-radius:50%;justify-self:center;background-color:var(--wmcolor-datepicker-day-background-selected);margin:auto}.popup-wrapper .day-view .date-grid .date-cell.range-start,.popup-wrapper .day-view .date-grid .date-cell.range-end{border-radius:0;margin:0;outline:none;font-weight:600;color:var(--wmcolor-datepicker-day-text-selected)}.popup-wrapper .day-view .date-grid .date-cell.range-start:focus-visible,.popup-wrapper .day-view .date-grid .date-cell.range-end:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-2px;border:none;z-index:11}.popup-wrapper .day-view .date-grid .date-cell.range-start:focus-visible[aria-selected=true],.popup-wrapper .day-view .date-grid .date-cell.range-end:focus-visible[aria-selected=true]{outline-offset:2px}.popup-wrapper .day-view .date-grid .date-cell.range-start{background-image:var(--range-start-svg);-webkit-padding-end:2px;padding-inline-end:2px;background-color:transparent}.popup-wrapper .day-view .date-grid .date-cell.range-start.in-range:not(:hover,:last-of-type,:last-child){background-image:var(--range-start-svg), var(--range-background-selected);border-radius:0}.popup-wrapper .day-view .date-grid .date-cell.range-start.in-range.preview:not(:last-of-type,:last-child){background-image:var(--range-start-svg), var(--range-background-hover)}.popup-wrapper .day-view .date-grid .date-cell.range-end{background-image:var(--range-end-svg);-webkit-padding-start:2px;padding-inline-start:2px;background-color:transparent}.popup-wrapper .day-view .date-grid .date-cell.range-end.in-range:not(:hover,:first-of-type,:first-child){background-image:var(--range-end-svg), var(--range-background-selected);border-radius:0}.popup-wrapper .day-view .date-grid .date-cell.range-end.in-range.preview:not(:first-of-type,:first-child){background-image:var(--range-end-svg), var(--range-background-hover)}.popup-wrapper .day-view .date-grid .date-cell.range-start.range-end{background:var(--wmcolor-datepicker-day-background-selected);border-radius:50%;padding-inline:0;margin:1px;-ms-flex-preferred-size:42px;flex-basis:42px}.popup-wrapper .month-view .months{border-top:2px solid;border-top-color:var(--wmcolor-datepicker-month-border);display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap}.popup-wrapper .month-view .month-row{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;width:100%;border-bottom:2px solid;border-bottom-color:var(--wmcolor-datepicker-month-border)}.popup-wrapper .month-view .month{border:none;background:white;cursor:pointer;width:7rem;height:4rem;line-height:4rem;font-family:inherit;font-weight:500;color:var(--wmcolor-datepicker-month-text)}.popup-wrapper .month-view .month:not(:last-child){border-right:2px solid;border-right-color:var(--wmcolor-datepicker-month-border)}.popup-wrapper .month-view .month:hover{border-right-color:transparent;background-color:var(--wmcolor-datepicker-month-background-hover)}.popup-wrapper .month-view .month:active,.popup-wrapper .month-view .month.selected{background-color:var(--wmcolor-datepicker-month-background-selected);color:var(--wmcolor-datepicker-month-text-selected)}.popup-wrapper button:focus-visible:not(.preview-start,.preview-end),.popup-wrapper .title-box:focus-visible:not(.preview-start,.preview-end),.popup-wrapper .month.focused:focus-visible:not(.preview-start,.preview-end),.popup-wrapper .date-cell:focus-visible:not(.preview-start,.preview-end){outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-2px;border:none;z-index:11}.popup-wrapper button:focus-visible:not(.preview-start,.preview-end)[aria-selected=true],.popup-wrapper .title-box:focus-visible:not(.preview-start,.preview-end)[aria-selected=true],.popup-wrapper .month.focused:focus-visible:not(.preview-start,.preview-end)[aria-selected=true],.popup-wrapper .date-cell:focus-visible:not(.preview-start,.preview-end)[aria-selected=true]{outline-offset:2px}.popup-range{display:-ms-flexbox;display:flex}.popup{width:21rem}.sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var g=e("priv_calendar",function(){function e(e){var n=this;r(this,e);this.cellTriggered=a(this,"cellTriggered",7);this.cellHovered=a(this,"cellHovered",7);this.outOfCal=a(this,"outOfCal",7);this.popupBlurred=a(this,"popupBlurred",7);this.dateFocus=a(this,"dateFocus",7);this.today=this.dateToISO(new Date);this.calType="single";this.calName="";this.calInstructions=o.formatMessage({id:"date.instructions",defaultMessage:"Use arrows to select a date in the table. Tab left or right to buttons for selecting previous month, next month, or the month selection table."});this._focus={year:{asString:function(){return d.year.asString(n.focusDate)},asInt:function(){return d.year.asInt(n.focusDate)},set:function(e){var r=n._focus.month.asInt();var a=n._focus.day.asInt();n.focusDate=p(e,r,a)},increase:function(e){var r=d.year.increase(n.focusDate,e);n.focusDate=r},decrease:function(e){var r=d.year.decrease(n.focusDate,e);n.focusDate=r}},month:{asString:function(){return d.month.asString(n.focusDate)},asInt:function(){return d.month.asInt(n.focusDate)},set:function(e){var r=n._focus.year.asInt();var a=n._focus.day.asInt();n.focusDate=p(r,e,a)},increase:function(e){var r=d.month.increase(n.focusDate,e);n.focusDate=r},decrease:function(e){var r=d.month.decrease(n.focusDate,e);n.focusDate=r}},day:{asString:function(){return d.day.asString(n.focusDate)},asInt:function(){return d.day.asInt(n.focusDate)},set:function(e){var r=n._focus.year.asInt();var a=n._focus.month.asInt();e=e===-1?c(a,r):e;n.focusDate=p(r,a,e)},increase:function(e){var r=d.day.increase(n.focusDate,e);n.focusDate=r},decrease:function(e){var r=d.day.decrease(n.focusDate,e);n.focusDate=r}}};this.monthButtonFocus={set:function(e){var r=Array.from(n.el.querySelectorAll(".month"));var a=r.filter((function(e){return e.classList.contains("focused")}))[0];a.classList.remove("selected");a.tabIndex=-1;r[e-1].classList.add("selected");r[e-1].tabIndex=0;r[e-1].focus()},increase:function(e){var r=Array.from(n.el.querySelectorAll(".month"));var a=r.filter((function(e){return e.classList.contains("focused")}))[0];var t=r.indexOf(a);var i=(t+e)%12;if(i<t){n._focus.year.increase(1)}a.classList.remove("focused");a.tabIndex=-1;r[i].classList.add("focused");r[i].tabIndex=0;r[i].focus()},decrease:function(e){var r=Array.from(n.el.querySelectorAll(".month"));var a=r.filter((function(e){return e.classList.contains("focused")}))[0];var t=r.indexOf(a);var i=t+24;i=(i-e)%12;if(i>t){n._focus.year.decrease(1)}a.classList.remove("focused");a.tabIndex=-1;r[i].classList.add("focused");r[i].tabIndex=0;r[i].focus()}};this.renderCalendarDate=function(e,r,a,i){if(e==="placeholder"){return t("div",{role:"gridcell"})}var p=d.month.asInt(e);var u=d.day.asInt(e);var g=d.year.asInt(e);var v=a&&a===e;var w=v?"true":"false";var h=["date-cell"];var f=e===n.focusDate;var b=e===n.today;if(b)h.push("today");if(n.calType==="range"){var m=a&&i&&i===e&&a<i;w=m?"true":w;var k=u===1;var y=u===c(p,g);var x=n.isInRange(e);var C=n.isInRangePreview(e);var M=!i&&a&&n.hoverDate&&e===n.hoverDate;var _=M&&n.hoverDate<a;var A=M&&n.hoverDate>a;if(k)h.push("first-of-month");if(y)h.push("last-of-month");if(v){if(C&&!m&&n.hoverDate&&n.hoverDate<a){h.push("range-end")}else{h.push("range-start")}}if(m)h.push("range-end");if(x)h.push("in-range");if(C)h.push("in-range preview");if(_)h.push("preview-start");if(A)h.push("preview-end")}var z=h.join(" ");return t("div",{role:"gridcell",id:"cell-".concat(e),class:z,"aria-selected":w,"aria-label":"".concat(b?"".concat(o.formatMessage({id:"date.today",defaultMessage:"today",description:"calendar button"}),", "):"").concat(s[r],", ").concat(l[p-1]," ").concat(u,", ").concat(g),onClick:function(e){n.handleDateClick(e.target)},onMouseOver:function(){return n.cellHovered.emit(e)},"data-month":d.month.asString(e),"data-year":d.year.asString(e),onBlur:function(e){return e.stopPropagation()},tabIndex:f?0:-1},u)};this.disabled=false;this.view="day";this.focusDate=this.today;this.startDate=undefined;this.endDate=undefined;this.hoverDate=undefined}e.prototype.setCalName=function(){var e=this.el.parentElement.querySelectorAll("priv-calendar");var r;if(e.length===1){r=o.formatMessage({id:"date.calName",defaultMessage:"Calendar. "})}else if(e[0]===this.el){r=o.formatMessage({id:"date.firstCalName",defaultMessage:"First calendar. "})}else{r=o.formatMessage({id:"date.secondCalName",defaultMessage:"Second calendar. "})}this.calName=r};e.prototype.setCalType=function(){var e=this.el.parentElement.querySelectorAll("priv-calendar");this.calType=e.length===1?"single":"range"};e.prototype.componentWillLoad=function(){this.setCalName();this.setCalType()};e.prototype.handleFocusDate=function(e,r){if(this.view==="day"){var a=this.getCell(r);if(a)a.tabIndex=-1;var t=this.getCell(e);if(t)t.tabIndex=0}else{var n=this.el.querySelector("#month-".concat(d.month.asInt(r)));if(n)n.tabIndex=-1;var i=this.el.querySelector("#month-".concat(d.month.asInt(e)));if(i)i.tabIndex=0}this.dateFocus.emit()};Object.defineProperty(e.prototype,"otherCalEl",{get:function(){var e=this.el.parentElement.querySelectorAll("priv-calendar");var r;if(e.length===2){r=e[0]===this.el?e[1]:e[0]}return r},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"headerButtonEls",{get:function(){return Array.from(this.el.querySelectorAll(".header-btn"))},enumerable:false,configurable:true});e.prototype.handleKey=function(e){switch(e.key){case" ":case"Enter":e.preventDefault();!e.target.id.includes("popup-title")&&e.target.click();break;case"PageUp":e.preventDefault();if(this.view==="day"){this._focus.month.decrease(1);this.focusCell()}else{this._focus.year.decrease(1)}break;case"PageDown":e.preventDefault();if(this.view==="day"){this._focus.month.increase(1);this.focusCell()}else{this._focus.year.increase(1)}break;case"Home":e.preventDefault();if(this.view==="day"){this._focus.day.set(1);this.focusCell()}else{this.monthButtonFocus.set(1)}break;case"End":e.preventDefault();if(this.view==="day"){this._focus.day.set(-1);this.focusCell()}else{this.monthButtonFocus.set(12)}break;case"ArrowLeft":e.preventDefault();if(this.view==="day"){this._focus.day.decrease(1);this.focusCell()}else{this.monthButtonFocus.decrease(1)}break;case"ArrowRight":e.preventDefault();if(this.view==="day"){this._focus.day.increase(1);this.focusCell()}else{this.monthButtonFocus.increase(1)}break;case"ArrowUp":e.preventDefault();if(this.view==="day"){this._focus.day.decrease(7);this.focusCell()}else{this.monthButtonFocus.decrease(3)}break;case"ArrowDown":e.preventDefault();if(this.view==="day"){if(!(document.activeElement.shadowRoot||document).activeElement.classList.contains("date-cell")){this.focusCell();break}this._focus.day.increase(7);this.focusCell()}else{var r=(document.activeElement.shadowRoot||document).activeElement;if(r.classList.contains("header-btn")){this.focusCell();break}this.monthButtonFocus.increase(3)}break}};e.prototype.handleDateClick=function(e){var r={cal:this.el,cell:e};this.cellTriggered.emit(r)};e.prototype.removeZeroes=function(e){return+e<10?+e.slice(1):+e};e.prototype.dateToISO=function(e){var r=[e.getUTCFullYear().toString().padStart(4,"0"),(e.getUTCMonth()+1).toString().padStart(2,"0"),e.getUTCDate().toString().padStart(2,"0")];return r.join("-")};e.prototype.isInRange=function(e){if(this.otherCalEl){var r=this.startDate||this.otherCalEl.startDate;var a=this.endDate||this.otherCalEl.endDate;if(r&&a){return r<=e&&e<=a}}return false};e.prototype.isInRangePreview=function(e){if(this.otherCalEl){var r=this.startDate||this.otherCalEl.startDate;var a=this.endDate||this.otherCalEl.endDate;if(r&&a)return false;if(r&&this.hoverDate){if(this.hoverDate>r){return r<=e&&e<=this.hoverDate}else if(this.hoverDate<r){return this.hoverDate<=e&&e<=r}}else if(a&&this.hoverDate){if(this.hoverDate<a){return this.hoverDate<=e&&e<=a}else if(this.hoverDate>a){return a<=e&&e<=this.hoverDate}}}return false};e.prototype.getMonthFirstDay=function(e,r){return+new Date(r,e-1,1,12,0,0).getDay()+1};e.prototype.getCalendarDates=function(e){var r=d.month.asInt(e);var a=d.year.asInt(e);var t=c(r,a);var n=__spreadArray([],new Array(t).fill(undefined),true).map((function(e,t){var n=t+1;return p(a,r,n)}));var i=this.getMonthFirstDay(r,a);var o=i-1;var s=o>0?new Array(o).fill("placeholder"):[];var l=42-(o+t);l=l>6?l-7:l;var u=l>0?new Array(l).fill("placeholder"):[];return __spreadArray(__spreadArray(__spreadArray([],s,true),n,true),u,true)};e.prototype.getCell=function(e){return this.el.querySelector("#cell-".concat(e))};e.prototype.focusFirstFocusable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.prevBtnEl.focus();return[2]}))}))};e.prototype.focusLastFocusable=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.focusCell();return[2]}))}))};e.prototype.focusCell=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(r){requestAnimationFrame((function(){var r=c(e._focus.month.asInt(),e._focus.year.asInt());var a=e._focus.day.asInt();if(a>r){e._focus.day.set(r)}if(e.view=="day"){var t=e.getCell(e.focusDate);if(t){t.tabIndex=0;t.focus()}e.cellHovered.emit(e.focusDate)}else{var n=e.el.querySelector("#month-".concat(e._focus.month.asInt()));if(n){n.tabIndex=0;n.focus()}}}));return[2]}))}))};e.prototype.toggleBusyAttribute=function(e){this.el.querySelector("#wm-container").setAttribute("aria-busy",e)};e.prototype.renderMonth=function(e,r){var a=this;return t("button",{id:"month-".concat(r+1),class:"month ".concat(this._focus.month.asInt()===r+1?"selected focused":""),role:"gridcell",tabindex:r+1===this._focus.month.asInt()?0:-1,onBlur:function(e){return e.stopPropagation()},onClick:function(){a._focus.month.set(r+1);a.view="day";a.focusCell()}},e)};e.prototype.renderDayView=function(){var e=this;var r=this.getCalendarDates(this.focusDate);var a=this.startDate||this.otherCalEl&&this.otherCalEl.startDate;var n=this.endDate||this.otherCalEl&&this.otherCalEl.endDate;return t("div",{class:"popup day-view"},t("div",{class:"calendar-header"},t("button",{onClick:function(){e._focus.month.decrease(1)},class:"header-btn arw-btn",ref:function(r){return e.prevBtnEl=r},"aria-label":o.formatMessage({id:"date.selectPreviousMonth",defaultMessage:"Select previous month",description:"Calendar button"})},t("span",{class:"mdi"},"")),t("div",{id:"popup-title-month",class:"header-btn title-box",tabindex:"0",role:"button",onKeyDown:function(r){if(r.key==="Enter"||r.key===" "){r.preventDefault();e.view="month"}},onClick:function(){return e.view="month"},"aria-label":"".concat(o.formatMessage({id:"date.currentMonth",defaultMessage:"current month",description:"Calendar button"}),": ").concat(l[this._focus.month.asInt()-1],"\n ").concat(this._focus.year.asString(),"."),"aria-describedby":"month-title"},t("span",{class:"title","aria-hidden":"true"},l[this._focus.month.asInt()-1]," ",this._focus.year.asString())),t("button",{onClick:function(){e._focus.month.increase(1)},"aria-label":o.formatMessage({id:"date.selectNextMonth",defaultMessage:"Select next month",description:"Calendar button"}),class:"header-btn arw-btn"},t("span",{class:"mdi"},""))),t("div",{"aria-labelledby":"popup-title-month",role:"grid",class:"date-grid"},t("div",{role:"rowgroup",class:"date-header"},t("div",{role:"row",class:"header-row"},t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.su",defaultMessage:"Su",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.mo",defaultMessage:"Mo",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.tu",defaultMessage:"Tu",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.we",defaultMessage:"We",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.th",defaultMessage:"Th",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.fr",defaultMessage:"Fr",description:"Abbreviated day of the week"}))),t("div",{role:"columnheader",class:"header-cell"},t("span",null,o.formatMessage({id:"date.sa",defaultMessage:"Sa",description:"Abbreviated day of the week"}))))),t("div",{role:"rowgroup"},t("div",{role:"row",class:"date-row"},r.slice(0,7).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),t("div",{role:"row"},r.slice(7,14).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),t("div",{role:"row"},r.slice(14,21).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),t("div",{role:"row"},r.slice(21,28).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),t("div",{role:"row"},r.slice(28,35).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))),r.length>35?t("div",{role:"row"},r.slice(35).map((function(r,t){return e.renderCalendarDate(r,t,a,n)}))):"")))};e.prototype.renderMonthView=function(){var e=this;return t("div",{class:"month-view"},t("div",{class:"calendar-header"},t("button",{onClick:function(){e._focus.year.decrease(1)},"aria-label":o.formatMessage({id:"date.selectPreviousYear",defaultMessage:"Select previous year",description:"Calendar button"}),class:"header-btn arw-btn",ref:function(r){return e.prevBtnEl=r}},t("span",{class:"mdi"},"")),t("div",{id:"popup-title-year",tabindex:"0",class:"header-btn title-box year",role:"button",onClick:function(){return e.view="day"},onKeyDown:function(r){if(r.key==="Enter"||r.key===" "){r.preventDefault();e.view="day"}},"aria-labelledby":"year-title"},t("span",{class:"title"},this._focus.year.asString())),t("button",{onClick:function(){e._focus.year.increase(1)},"aria-label":o.formatMessage({id:"date.selectNextYear",defaultMessage:"Select next year",description:"Calendar button"}),class:"header-btn arw-btn"},t("span",{class:"mdi"},""))),t("div",{"aria-labelledby":"popup-title-year",role:"grid",class:"months"},t("div",{role:"row",class:"month-row"},l.slice(0,3).map((function(r,a){return e.renderMonth(r,a)}))),t("div",{role:"row",class:"month-row"},l.slice(3,6).map((function(r,a){return e.renderMonth(r,a+3)}))),t("div",{role:"row",class:"month-row"},l.slice(6,9).map((function(r,a){return e.renderMonth(r,a+6)}))),t("div",{role:"row",class:"month-row"},l.slice(9).map((function(r,a){return e.renderMonth(r,a+9)})))))};e.prototype.render=function(){var e=this;return t(n,{onMouseOut:function(r){if(!e.el.parentElement.contains(r.toElement))e.outOfCal.emit()},role:"application","aria-describedby":"application"},this.view==="day"?this.renderDayView():this.renderMonthView(),t("div",{id:"application",class:"sr-only"},this.calName,this.calInstructions))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{focusDate:["handleFocusDate"]}},enumerable:false,configurable:true});return e}());g.style=u}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.navigator.plugins.length>0&&console.log("Ripple component library","5.
|
|
1
|
+
window.navigator.plugins.length>0&&console.log("Ripple component library","5.5.0-0"),window.addEventListener("keydown",(function(n){if("Tab"==n.key){var o=new Event("wmUserIsTabbing");window.dispatchEvent(o),document.querySelector("body").classList.add("wmcl-user-is-tabbing")}"ArrowLeft"!=n.key&&"ArrowUp"!=n.key&&"ArrowRight"!=n.key&&"ArrowDown"!=n.key||(o=new Event("wmUserIsKeying"),window.dispatchEvent(o),document.querySelector("body").classList.add("wmcl-user-is-keying"))})),window.addEventListener("mousedown",(function(){var n=new Event("wmUserIsNotTabbing");window.dispatchEvent(n),document.querySelector("body").classList.remove("wmcl-user-is-tabbing"),document.querySelector("body").classList.remove("wmcl-user-is-keying")}));const n=document.createElement("div");n.id="wm-tooltip-container";const o=document.createElement("div");o.id="wm-tooltip",o.classList.add("wm-tooltip"),o.setAttribute("popover","manual"),o.setAttribute("aria-hidden","true");const t=document.createElement("style");t.textContent="\n.wm-tooltip {\n position: fixed;\n overflow: hidden;\n pointer-events: none;\n line-height: normal;\n font-family: inherit;\n font-size: 0.875rem;\n text-transform: none;\n font-weight: normal;\n background: var(--wmcolor-tooltip-background);\n color: var(--wmcolor-tooltip-text);\n z-index: 999999;\n max-width: var(--wmTooltipMaxWidth, 13.75rem);\n margin-right: 1.5rem;\n padding: 0.375rem;\n transition-property: opacity;\n transition-delay: 0s;\n opacity: 0;\n inset: unset;\n top: 0;\n left: 0;\n transform: translateZ(0);\n will-change: transform;\n transform: translate(var(--wmTooltipLeft), var(--wmTooltipTop));\n border: none;\n}\n\n.wm-tooltip:popover-open {\n opacity: 0;\n}\n\n.wm-tooltip.show {\n transition-delay: 500ms;\n opacity: 1;\n}\n",document.head.appendChild(t),n.appendChild(o),document.querySelector("body").appendChild(n);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,r,i,e){function n(t){return t instanceof i?t:new i((function(r){r(t)}))}return new(i||(i=Promise))((function(i,a){function o(t){try{c(e.next(t))}catch(t){a(t)}}function s(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?i(t.value):n(t.value).then(o,s)}c((e=e.apply(t,r||[])).next())}))};var __generator=this&&this.__generator||function(t,r){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,n,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(r){return c([t,r])}}function c(s){if(e)throw new TypeError("Generator is already executing.");while(o&&(o=0,s[0]&&(i=0)),i)try{if(e=1,n&&(a=s[0]&2?n["return"]:s[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;if(n=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;n=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){i.label=s[1];break}if(s[0]===6&&i.label<a[1]){i.label=a[1];a=s;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(s);break}if(a[2])i.ops.pop();i.trys.pop();continue}s=r.call(t,i)}catch(t){s=[6,t];n=0}finally{e=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-ab8d78cc.system.js","./p-42fa7a77.system.js","./p-34b5830f.system.js"],(function(t){"use strict";var r,i,e,n,a,o,s,c,u;return{setters:[function(t){r=t.r;i=t.c;e=t.h;n=t.H;a=t.g},function(t){o=t.a},function(t){s=t.n;c=t.o;u=t.i}],execute:function(){var f=this;var h=function(t){return __awaiter(f,void 0,void 0,(function(){var r;return __generator(this,(function(i){switch(i.label){case 0:return[4,fetch(t)];case 1:r=i.sent();if(!(!!r&&!!r.ok))return[3,3];return[4,r.json()];case 2:return[2,i.sent()];case 3:throw new Error(r.statusText)}}))}))};var l=":host{--wmcolor-navigator-background:var(--wmcolor-background);--wmcolor-navigator-header-background:var(--wmcolor-brand-dark);--wmcolor-navigator-header-text:var(--wmcolor-text-ondark);--wmcolor-navigator-item-background-selected:var(--wmcolor-interactive-background-selected);--wmcolor-navigator-item-background-focus:var(--wmcolor-interactive-background-focus);--wmcolor-navigator-item-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-navigator-item-background:var(--wmcolor-background);--wmcolor-navigator-item-border:var(--wmcolor-border);--wmcolor-navigator-item-text:var(--wmcolor-text);--wmcolor-navigator-user-background:var(--wmcolor-background-readonly);min-width:0;position:relative;display:inline-block}:host .wrapper{overflow:auto;font-size:1.125rem;min-width:13.125rem;width:auto;max-height:80vh;text-align:left;position:absolute;z-index:50;top:100%;right:20px;left:auto;background:var(--wmcolor-navigator-background);letter-spacing:normal;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .wrapper .user{background:var(--wmcolor-navigator-user-background);padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper .user p{margin:0}:host .wrapper .user p:first-child{font-weight:700;text-transform:capitalize}:host .wrapper h2{background:var(--wmcolor-navigator-header-background);color:var(--wmcolor-navigator-header-text);font-weight:700;margin:0;padding:0.625rem 1.25rem;font-size:0.875rem}:host .wrapper [role=listbox]{list-style:none;margin:0;padding-left:0}:host .wrapper.hide{-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0)}:host .wrapper.right{right:auto;left:20px}:host img{-webkit-transform:scale(0.8);transform:scale(0.8);-webkit-transform-origin:left center;transform-origin:left center;display:block}:host .logout{text-align:center;text-transform:capitalize}priv-navigator-item:focus{outline:none}";var m=t("wm_navigator",function(){function t(t){r(this,t);this.wmNavigatorLogout=i(this,"wmNavigatorLogout",7);this.retrievedInfo=!this.loadFromUserinfo;this.parsedProducts=[];this.openRight=false;this.userName=undefined;this.email=undefined;this.authType=1;this.connectionName=undefined;this.logoutUrl=undefined;this.products=undefined;this.loadFromUserinfo=false;this.isOpen=false;this.itemIndexToFocus=0}t.prototype.isSafeUrl=function(t){var r=false;var i=["digitalmeasures\\.com","evalkit\\.info","evaluationkit\\.com","evaluationkit\\.info","lat_ams\\.com","livetext\\.com","smartcatalogiq\\.com","smartcatalogiq\\.net","smartcatalogiq\\.us","taskstream\\.com","vialivetext\\.com","watermarkinsights\\.com"];i.forEach((function(i){var e="^https://(.*.)?".concat(i,"(/.*)?$");if(!!t&&t.match(e)){r=true}}));return r};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.userName){console.error("wm-navigator: user-name is a required property.")}return[4,this.parseData()];case 1:t.sent();this.setFocusIndex();return[2]}}))}))};t.prototype.parseData=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){switch(r.label){case 0:if(!!!this.loadFromUserinfo)return[3,2];return[4,h("/platform/navigator/userinfo").then((function(r){t.email=r.email;t.currentProductId=r.current_product_id;t.parsedProducts=t.productKeysToCamelCase(r.products);t.logoutUrl=t.logoutUrl?t.logoutUrl:r.logout_url;t.connectionName=t.connectionName?t.connectionName:r.connection_name;if(!!t.email&&!!t.currentProductId){t.retrievedInfo=true}})).catch((function(t){console.error(t)}))];case 1:r.sent();return[3,3];case 2:this.currentProductId=o(this.el);if(!!this.products){if(typeof this.products==="string"){this.parsedProducts=JSON.parse(this.products)}else{this.parsedProducts=this.products}this.parsedProducts=this.productKeysToCamelCase(this.parsedProducts)}r.label=3;case 3:this.parsedProducts.sort((function(t,r){return t.name<r.name?-1:1}));return[2]}}))}))};t.prototype.productKeysToCamelCase=function(t){t=t.map((function(t){var r=Object.keys(t);var i={};r.forEach((function(r){i[s(r)]=t[r]}));return i}));return t};t.prototype.setFocusIndex=function(){if(this.parsedProducts.length>1){var t=this.getProduct(this.currentProductId);if(t){this.itemIndexToFocus=this.parsedProducts.indexOf(t)}}};t.prototype.handleKeys=function(t){switch(t.key){case"Escape":t.preventDefault();this.closeMenu();break;case"ArrowDown":case"ArrowUp":t.preventDefault();if(!this.isOpen){this.itemIndexToFocus=c(this.itemIndexToFocus,t.key,this.navigatorItems.length);this.openMenu()}break}};t.prototype.handleKeydown=function(t){var r=t.detail.key;var i=t.detail.navItem;switch(r){case"Tab":this.closeMenu(false);break;case"Enter":case" ":i.click();break;case"ArrowDown":case"ArrowUp":var e=this.itemIndexToFocus;this.itemIndexToFocus=c(this.itemIndexToFocus,r,this.navigatorItems.length);this.focusItem();this.unfocusItem(e);break}};t.prototype.handleClick=function(t){var r=t.target===this.el||this.el.contains(t.target);if(!r&&this.isOpen){this.closeMenu(false)}};t.prototype.handleButtonClick=function(){this.isOpen?this.closeMenu():this.openMenu()};t.prototype.openMenu=function(){if(this.wrapperEl){var t=this.wrapperEl.clientWidth;var r=this.el.getBoundingClientRect().left;var i=document.documentElement.clientWidth-this.el.getBoundingClientRect().right;this.openRight=t>r&&i>r}this.isOpen=true;this.focusItem()};t.prototype.closeMenu=function(t){var r=this;if(t===void 0){t=true}this.isOpen=false;window.requestAnimationFrame((function(){r.unfocusItem(r.itemIndexToFocus);r.setFocusIndex();if(t){r.buttonFocusHandler()}}))};t.prototype.focusItem=function(){var t=this.navigatorItems[this.itemIndexToFocus];t.tabIndex=0;t.focused=true;window.setTimeout((function(){return t.focus()}),250)};t.prototype.unfocusItem=function(t){var r=this.navigatorItems[t];r.tabIndex=-1;r.focused=false};t.prototype.buttonFocusHandler=function(){var t=this.el.shadowRoot.querySelector("priv-navigator-button");var r=t.shadowRoot.querySelector("button");r.focus()};t.prototype.renderUserInfo=function(){return e("div",{class:"user",id:"wm-nav-user","aria-label":u.formatMessage({id:"navigator.userinfoLabel",defaultMessage:"for {name}, email {email}"},{name:this.userName,email:this.email})},e("p",null,this.userName),e("p",null,this.email))};t.prototype.setAltText=function(){if(this.parsedProducts.length>1){return u.formatMessage({id:"navigator.userinfoAndProductNavigator",defaultMessage:"User information and product navigator"})}else{return u.formatMessage({id:"navigator.userinfo",defaultMessage:"User information"})}};t.prototype.renderHeading=function(){return e("h2",null,u.formatMessage({id:"navigator.watermarkApps",defaultMessage:"Watermark Apps",description:"Applications made by Watermark Insights"}))};t.prototype.renderList=function(){return e("ul",{role:"listbox","aria-label":"".concat(u.formatMessage({id:"navigator.WatermarkAppNavigation",defaultMessage:"Watermark App Navigation",description:"list of applications by Watermark Insights"})),"aria-describedby":"wm-nav-user"},this.parsedProducts.length>1&&this.renderProductOptions(),this.renderLogoutOption())};t.prototype.renderProductOptions=function(){var t=this;return this.parsedProducts.map((function(r){var i,n,a,o;i=r.name;n=r.iconUrl;o=t.setProductOnClick(r.id);if(!!i&&!!n){a=t.currentProductId===r.id;return e("priv-navigator-item",{selected:a,id:r.id,onClick:function(){a?t.closeMenu():o()},role:"option","aria-label":i,"aria-selected":a?"true":"false"},e("img",{src:n,alt:i}))}}))};t.prototype.setProductOnClick=function(t){var r=this.getProduct(t);if(this.currentProductId===t){return function(){}}else if(r){if(!!this.loadFromUserinfo||this.authType===2){var i=r.linkUrl;if(this.isSafeUrl(i)){return function(){return window.location.href=i}}else{console.error('"'.concat(i,'" is not a safe url'));return}}else if(this.authType===3){var e=this.connectionName?"/?connection_name=".concat(this.connectionName):"";var n=r.samlLinkUrl;if(this.isSafeUrl(n)){return function(){return window.location.href=n+e}}else{console.error('"'.concat(n,'" is not a safe url'));return}}}};t.prototype.renderLogoutOption=function(){return e("priv-navigator-item",{class:"logout",selected:!(this.parsedProducts.length>1),id:"nav-logout",onClick:this.setLogoutOnclick(),role:"option","aria-selected":"false"},e("span",{class:"logout"},u.formatMessage({id:"navigator.logout",defaultMessage:"Log Out"})))};t.prototype.setLogoutOnclick=function(){var t=this;return function(){t.wmNavigatorLogout.emit();var r=t.logoutUrl;if(t.isSafeUrl(r)){window.location.href=r}else{console.error('"'.concat(r,'" is not a safe url'))}}};Object.defineProperty(t.prototype,"navigatorItems",{get:function(){return Array.from(this.el.shadowRoot.querySelectorAll("priv-navigator-item"))},enumerable:false,configurable:true});t.prototype.getProduct=function(t){return this.parsedProducts.find((function(r){return r.id===t}))};t.prototype.render=function(){var t=this;return this.retrievedInfo?e(n,null,e("priv-navigator-button",{expanded:this.isOpen,altText:this.setAltText()}),e("div",{class:"wrapper ".concat(this.isOpen?"":"hide"," ").concat(this.openRight?"right":""),ref:function(r){return t.wrapperEl=r}},this.renderUserInfo(),this.parsedProducts.length>1&&this.renderHeading(),this.renderList())):""};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{products:["parseData"]}},enumerable:false,configurable:true});return t}());m.style=l}}}));
|