@dnncommunity/dnn-elements 0.15.1 → 0.15.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/dnn-button_17.cjs.entry.js +3 -3
- package/dist/cjs/dnn-button_17.cjs.entry.js.map +1 -1
- package/dist/cjs/dnn.cjs.js +2 -2
- package/dist/cjs/dnn.cjs.js.map +1 -1
- package/dist/cjs/{index-514ef6dd.js → index-81382452.js} +404 -239
- package/dist/cjs/index-81382452.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/dnn-button/dnn-button.js +195 -192
- package/dist/collection/components/dnn-button/dnn-button.stories.js +1 -1
- package/dist/collection/components/dnn-checkbox/dnn-checkbox.js +85 -99
- package/dist/collection/components/dnn-checkbox/dnn-checkbox.stories.js +1 -1
- package/dist/collection/components/dnn-chevron/dnn-chevron.js +92 -87
- package/dist/collection/components/dnn-chevron/dnn-chevron.stories.js +1 -1
- package/dist/collection/components/dnn-collapsible/dnn-collapsible.js +102 -90
- package/dist/collection/components/dnn-collapsible/dnn-collapsible.stories.js +1 -1
- package/dist/collection/components/dnn-color-picker/dnn-color-picker.js +105 -141
- package/dist/collection/components/dnn-color-picker/dnn-color-picker.stories.js +1 -1
- package/dist/collection/components/dnn-dropzone/dnn-dropzone.js +122 -137
- package/dist/collection/components/dnn-dropzone/dnn-dropzone.stories.js +1 -1
- package/dist/collection/components/dnn-image-cropper/CornerType.js +1 -1
- package/dist/collection/components/dnn-image-cropper/dnn-image-cropper.js +129 -133
- package/dist/collection/components/dnn-image-cropper/dnn-image-cropper.stories.js +1 -1
- package/dist/collection/components/dnn-modal/dnn-modal.css +5 -0
- package/dist/collection/components/dnn-modal/dnn-modal.js +136 -133
- package/dist/collection/components/dnn-modal/dnn-modal.js.map +1 -1
- package/dist/collection/components/dnn-modal/dnn-modal.stories.js +1 -1
- package/dist/collection/components/dnn-permissions-grid/dnn-permissions-grid.js +164 -223
- package/dist/collection/components/dnn-permissions-grid/dnn-permissions-grid.stories.js +1 -1
- package/dist/collection/components/dnn-permissions-grid/localization-interface.js +1 -1
- package/dist/collection/components/dnn-permissions-grid/permissions-interface.js +1 -1
- package/dist/collection/components/dnn-permissions-grid/role-group-interface.js +1 -1
- package/dist/collection/components/dnn-permissions-grid/role-interface.js +1 -1
- package/dist/collection/components/dnn-permissions-grid/searched-user-interface.js +1 -1
- package/dist/collection/components/dnn-searchbox/dnn-searchbox.js +101 -94
- package/dist/collection/components/dnn-searchbox/dnn-searchbox.stories.js +1 -1
- package/dist/collection/components/dnn-sort-icon/dnn-sort-icon.js +55 -54
- package/dist/collection/components/dnn-sort-icon/dnn-sort-icon.stories.js +1 -1
- package/dist/collection/components/dnn-tab/dnn-tab.js +69 -59
- package/dist/collection/components/dnn-tab/dnn-tab.stories.js +1 -1
- package/dist/collection/components/dnn-tabs/dnn-tabs.js +19 -16
- package/dist/collection/components/dnn-tabs/dnn-tabs.stories.js +1 -1
- package/dist/collection/components/dnn-toggle/dnn-toggle.js +83 -75
- package/dist/collection/components/dnn-toggle/dnn-toggle.stories.js +1 -1
- package/dist/collection/components/dnn-toggle/toggle-interface.js +1 -1
- package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.js +79 -77
- package/dist/collection/components/dnn-treeview-item/dnn-treeview-item.stories.js +1 -1
- package/dist/collection/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.js +20 -24
- package/dist/collection/components/dnn-vertical-overflow-menu/dnn-vertical-overflow-menu.stories.js +1 -1
- package/dist/collection/components/dnn-vertical-splitview/dnn-vertical-splitview.js +117 -111
- package/dist/collection/components/dnn-vertical-splitview/dnn-vertical-splitview.stories.js +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/collection/utilities/colorInfo.js +1 -1
- package/dist/collection/utilities/debounce.js +1 -1
- package/dist/collection/utilities/dnnServicesFramework.js +1 -1
- package/dist/collection/utilities/mouseUtilities.js +1 -1
- package/dist/dnn/dnn.esm.js +1 -1
- package/dist/dnn/dnn.esm.js.map +1 -1
- package/dist/dnn/dnn.js +2 -1
- package/dist/dnn/p-21f18e37.system.js +3 -0
- package/dist/dnn/p-21f18e37.system.js.map +1 -0
- package/dist/dnn/p-2a79ad5b.system.entry.js +11 -0
- package/dist/dnn/p-2a79ad5b.system.entry.js.map +1 -0
- package/dist/dnn/{p-5bcf3629.system.js → p-52139080.system.js} +2 -2
- package/dist/dnn/{p-5bcf3629.system.js.map → p-52139080.system.js.map} +1 -1
- package/dist/dnn/{p-909f2db9.entry.js → p-6cc227ab.entry.js} +3 -3
- package/dist/dnn/p-6cc227ab.entry.js.map +1 -0
- package/dist/dnn/p-97d752ed.js +3 -0
- package/dist/dnn/p-97d752ed.js.map +1 -0
- package/dist/esm/dnn-button_17.entry.js +3 -3
- package/dist/esm/dnn-button_17.entry.js.map +1 -1
- package/dist/esm/dnn.js +2 -2
- package/dist/esm/dnn.js.map +1 -1
- package/dist/esm/{index-59e0950f.js → index-e9a3fcad.js} +404 -239
- package/dist/esm/index-e9a3fcad.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm-es5/dnn-button_17.entry.js +2 -2
- package/dist/esm-es5/dnn-button_17.entry.js.map +1 -1
- package/dist/esm-es5/dnn.js +1 -1
- package/dist/esm-es5/dnn.js.map +1 -1
- package/dist/esm-es5/index-e9a3fcad.js +3 -0
- package/dist/esm-es5/index-e9a3fcad.js.map +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/types/components.d.ts +73 -17
- package/dist/types/stencil-public-runtime.d.ts +15 -4
- package/loader/package.json +1 -0
- package/package.json +14 -14
- package/dist/cjs/index-514ef6dd.js.map +0 -1
- package/dist/dnn/p-3155c8a8.system.entry.js +0 -11
- package/dist/dnn/p-3155c8a8.system.entry.js.map +0 -1
- package/dist/dnn/p-7ffdbed1.js +0 -2
- package/dist/dnn/p-7ffdbed1.js.map +0 -1
- package/dist/dnn/p-909f2db9.entry.js.map +0 -1
- package/dist/dnn/p-b8064287.system.js +0 -2
- package/dist/dnn/p-b8064287.system.js.map +0 -1
- package/dist/esm/index-59e0950f.js.map +0 -1
- package/dist/esm-es5/index-59e0950f.js +0 -2
- package/dist/esm-es5/index-59e0950f.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,n,o){function r(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,i){function s(e){try{l(o.next(e))}catch(e){i(e)}}function a(e){try{l(o["throw"](e))}catch(e){i(e)}}function l(e){e.done?n(e.value):r(e.value).then(s,a)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(e){return function(t){return l([e,t])}}function l(s){if(o)throw new TypeError("Generator is already executing.");while(n)try{if(o=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;r=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(i=n.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){n.label=s[1];break}if(s[0]===6&&n.label<i[1]){n.label=i[1];i=s;break}if(i&&n.label<i[2]){n.label=i[2];n.ops.push(s);break}if(i[2])n.ops.pop();n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e];r=0}finally{o=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++){if(i||!(o in t)){if(!i)i=Array.prototype.slice.call(t,0,o);i[o]=t[o]}}return e.concat(i||Array.prototype.slice.call(t))};System.register(["./p-21f18e37.system.js","./p-1e26a4e1.system.js"],(function(e){"use strict";var t,n,o,r,i,s;return{setters:[function(e){t=e.r;n=e.c;o=e.h;r=e.H;i=e.g},function(e){s=e.D}],execute:function(){var a=":host{--background-color:transparent;--color:#333;--border-size:1px;--border-color:var(--backround-color);--border-radius:var(--dnn-controls-radius, 5px);--padding:var(--dnn-controls-padding, 5px);display:inline-block;width:auto}:host(.disabled){pointer-events:none}:host(.primary){--background-color:var(--dnn-color-primary, blue);--color:var(--dnn-color-primary-contrast, white);--focus-color:var(--background-color)}:host(.primary.reversed){--background-color:var(--dnn-color-primary-contrast, white);--color:var(--dnn-color-primary, blue);--border-color:var(--dnn-color-primary, blue);--focus-color:var(--color)}:host(.secondary){--background-color:var(--dnn-color-secondary, green);--color:var(--dnn-color-secondary-contrast, white);--focus-color:var(--background-color)}:host(.secondary.reversed){--background-color:var(--dnn-color-secondary-contrast, white);--color:var(--dnn-color-secondary, blue);--border-color:var(--dnn-color-secondary, blue);--focus-color:var(--color)}:host(.tertiary){--background-color:var(--dnn-color-tertiary, yellow);--color:var(--dnn-color-tertiary-contrast, black);--focus-color:var(--background-color)}:host(.tertiary.reversed){--background-color:var(--dnn-color-tertiary-contrast, white);--color:var(--dnn-color-tertiary, blue);--border-color:var(--dnn-color-tertiary, blue);--focus-color:var(--color)}:host(.hydrated) button{border:var(--border-size) solid var(--border-color);border-radius:var(--border-radius);padding:var(--padding) calc(var(--padding) * 2);background-color:transparent;background-color:var(--background-color);color:var(--color);outline:none}:host(.hydrated) button:focus,:host(.hydrated) button:hover{-webkit-box-shadow:0 0 2px 2px var(--focus-color);box-shadow:0 0 2px 2px var(--focus-color)}:host(:disabled,[disabled]) button{pointer-events:none;opacity:0.5}:host(.small) button{padding:calc(var(--padding) / 2) var(--padding);font-size:0.7em}:host(.large) button{padding:calc(var(--padding) * 1.5) calc(var(--padding) * 3);font-size:1.2em}button{height:100%;width:100%;cursor:pointer}";var l=e("dnn_button",function(){function e(e){t(this,e);this.confirmed=n(this,"confirmed",7);this.canceled=n(this,"canceled",7);this.type="primary";this.reversed=false;this.size="normal";this.confirm=false;this.confirmYesText="Yes";this.confirmNoText="No";this.confirmMessage="Are you sure ?";this.disabled=false;this.modalVisible=false}e.prototype.componentDidLoad=function(){this.modal=this.el.shadowRoot.querySelector("dnn-modal")};e.prototype.handleConfirm=function(){this.modal.hide();this.modalVisible=false;this.confirmed.emit()};e.prototype.handleCancel=function(){this.modal.hide();this.modalVisible=false;this.canceled.emit()};e.prototype.handleClick=function(){if(this.confirm&&!this.modalVisible){this.modal.show();this.modalVisible=true}};e.prototype.getElementClasses=function(){var e=[];e.push(this.type);if(this.reversed){e.push("reversed")}if(this.size!=="normal"){e.push(this.size)}return e.join(" ")};e.prototype.render=function(){var e=this;return o(r,{class:this.getElementClasses(),disabled:this.disabled,style:{"pointer-events":this.disabled?"none":"all"}},o("button",{class:"button",onClick:function(){return e.handleClick()},disabled:this.disabled},o("slot",null)),this.confirm&&o("dnn-modal",{showCloseButton:false,backdropDismiss:false},o("p",null,this.confirmMessage),o("div",{style:{display:"flex",justifyContent:"flex-end"}},o("dnn-button",{type:"primary",style:{margin:"5px"},onClick:function(){return e.handleConfirm()}},this.confirmYesText),o("dnn-button",{type:"secondary",style:{margin:"5px"},onClick:function(){return e.handleCancel()}},this.confirmNoText))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());l.style=a;var d=":host{--focus-color:var(--dnn-color-primary, #3792ED);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:0.25rem;margin:3px}button{background-color:transparent;border:0;padding:0;margin:0;outline:none;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}button .unchecked,button .checked,button .intermediate{display:none}button.checked .checked,button.unchecked .unchecked,button.intermediate .intermediate{display:block}button svg.undefined{opacity:0.45}button:focus{-webkit-box-shadow:0 0 2px 2px var(--focus-color);box-shadow:0 0 2px 2px var(--focus-color)}";var c=e("dnn_checkbox",function(){function e(e){t(this,e);this.checkedchange=n(this,"checkedchange",7);this.checked="unchecked";this.useIntermediate=false}e.prototype.changeState=function(){if(!this.useIntermediate){switch(this.checked){case"checked":this.checked="unchecked";break;case"unchecked":case"intermediate":this.checked="checked";break}this.checkedchange.emit(this.checked);return}switch(this.checked){case"checked":this.checked="intermediate";break;case"intermediate":this.checked="unchecked";break;case"unchecked":this.checked="checked";break}this.checkedchange.emit(this.checked)};e.prototype.render=function(){var e=this;return o(r,null,o("button",{class:"icon ".concat(this.checked),onClick:function(){return e.changeState()}},o("div",{class:"unchecked"},o("slot",{name:"uncheckedicon"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))),o("div",{class:"checked"},o("slot",{name:"checkedicon"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})))),o("div",{class:"intermediate"},o("slot",{name:"intermediateicon"},o("svg",{class:"undefined",xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("g",null,o("rect",{fill:"none",height:"24",width:"24"})),o("g",null,o("g",null,o("g",null,o("path",{d:"M19,3H5C3.9,3,3,3.9,3,5v14c0,1.1,0.9,2,2,2h14c1.1,0,2-0.9,2-2V5C21,3.9,20.1,3,19,3z M17,13H7v-2h10V13z"})))))))),o("label",{htmlFor:this.el.id,onClick:function(){return e.changeState()}},o("slot",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());c.style=d;var h=":host{display:inline-block}button{border:none;padding:0px;margin:0px;min-width:15px;min-height:15px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;background-color:transparent;outline:none}svg{height:2em;width:2em;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}button:focus svg,button:hover svg{color:var(--dnn-color-primary)}:host([expanded]) svg{-webkit-transform:rotate(90deg);transform:rotate(90deg)}";var u=e("dnn_chevron",function(){function e(e){t(this,e);this.changed=n(this,"changed",7);this.expandText="expand";this.collapseText="collapse";this.expanded=false}e.prototype.handleExpandedChanged=function(e){this.changed.emit(e)};e.prototype.render=function(){var e=this;return o(r,null,o("button",{"aria-label":this.expanded?this.collapseText:this.expandText,onClick:function(){return e.expanded=!e.expanded}},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}))))};Object.defineProperty(e,"watchers",{get:function(){return{expanded:["handleExpandedChanged"]}},enumerable:false,configurable:true});return e}());u.style=h;var p=":host{display:block}#container{max-height:0;overflow:hidden;-webkit-transition:max-height 300ms ease-in-out;transition:max-height 300ms ease-in-out}";var f=e("dnn_collapsible",function(){function e(e){t(this,e);this.dnnCollapsibleHeightChanged=n(this,"dnnCollapsibleHeightChanged",7);this.expanded=false;this.transitionDuration=150}e.prototype.handleHeightChanged=function(){var e=this;requestAnimationFrame((function(){e.updateSize()}))};e.prototype.updateSize=function(){return __awaiter(this,void 0,void 0,(function(){var e=this;return __generator(this,(function(t){if(this.expanded){requestAnimationFrame((function(){e.container.style.maxHeight="".concat(e.container.scrollHeight,"px")}));setTimeout((function(){e.container.style.maxHeight="none"}),this.transitionDuration)}return[2]}))}))};e.prototype.handledExpandedChanged=function(e){var t=this;if(e){this.updateSize()}else{requestAnimationFrame((function(){t.container.style.maxHeight="".concat(t.container.scrollHeight,"px");requestAnimationFrame((function(){t.container.style.maxHeight="0px"}))}))}setTimeout((function(){requestAnimationFrame((function(){t.dnnCollapsibleHeightChanged.emit()}))}),this.transitionDuration)};e.prototype.componentDidLoad=function(){this.container.style.transition="max-height ".concat(this.transitionDuration,"ms ease-in-out")};e.prototype.render=function(){var e=this;return o(r,null,o("div",{id:"container",class:this.expanded&&"expanded",ref:function(t){return e.container=t},style:{transition:"max-height ".concat(this.transitionDuration,"ms ease-in-out")}},o("slot",null)))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["handledExpandedChanged"]}},enumerable:false,configurable:true});return e}());f.style=p;
|
|
2
|
+
/** Color utility class with hsl and rgb converters
|
|
3
|
+
* based on math at https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
4
|
+
* @copyright Copyright (c) .NET Foundation. All rights reserved.
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/var g=function(){function e(){this._hue=0;this._saturation=0;this._lightness=0}Object.defineProperty(e.prototype,"hue",{get:function(){return this._hue},set:function(e){if(e<0){e=0}if(e>359){e=359}this._hue=e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"saturation",{get:function(){return this._saturation},set:function(e){if(e<0){e=0}if(e>1){e=1}this._saturation=e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"lightness",{get:function(){return this._lightness},set:function(e){if(e<0){e=0}if(e>1){e=1}this._lightness=e},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"red",{get:function(){return this.getRGB().red},set:function(e){this.setHSL(e,this.green,this.blue)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"green",{get:function(){return this.getRGB().green},set:function(e){this.setHSL(this.red,e,this.blue)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"blue",{get:function(){return this.getRGB().blue},set:function(e){this.setHSL(this.red,this.green,e)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"hex",{get:function(){var e=this.getHex(this.red);var t=this.getHex(this.green);var n=this.getHex(this.blue);return e+t+n},set:function(e){this.red=parseInt(e.substr(0,2));this.green=parseInt(e.substr(2,2));this.blue=parseInt(e.substr(4,2))},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"contrastColor",{get:function(){var e=(this.red*299+this.green*587+this.blue*114)/1e3;if(e>127){return"000000"}return"FFFFFF"},enumerable:false,configurable:true});e.prototype.getRGB=function(){var e=(1-Math.abs(2*this._lightness-1))*this.saturation;var t=this._hue/60;var n=e*(1-Math.abs(t%2-1));var o=0,r=0,i=0;if(0<=t&&t<=1){o=e;r=n}else if(1<=t&&t<=2){r=e;o=n}else if(2<=t&&t<=3){r=e;i=n}else if(3<=t&&t<=4){i=e;r=n}else if(4<=t&&t<=5){i=e;o=n}else if(5<=t&&t<=6){o=e;i=n}var s=this._lightness-e/2;return{red:Math.round((o+s)*255),green:Math.round((r+s)*255),blue:Math.round((i+s)*255)}};e.prototype.setHSL=function(e,t,n){var o=e/255,r=t/255,i=n/255;var s=Math.min(o,r,i);var a=Math.max(o,r,i);var l=a-s;var d=0,c=0,h=0;if(l===0){d=0}else if(a===o){d=60*((r-i)/l)}else if(a===r){d=60*(2+(i-o)/l)}else if(a===i){d=60*(4+(o-r)/l)}if(d<0){d=d+360}if(d>359){d=359}h=(a+s)/2;if(a===0||s===1){c=0}else{c=(a-h)/Math.min(h,1-h)}this._hue=d;this._saturation=c;this._lightness=h};e.prototype.getHex=function(e){var t=e.toString(16);if(t.length<2){t="0"+t}return t};return e}();var m='.dnn-color-picker{padding:15px;max-width:400px}.dnn-color-picker .dnn-color-sliders{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;min-width:200px}.dnn-color-picker .dnn-color-sliders .dnn-color-s-b{border:1px solid #ccc;padding-bottom:var(--color-box-height, 50%);position:relative;background-color:red}.dnn-color-picker .dnn-color-sliders .dnn-color-s-b:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:1;background:-webkit-gradient(linear, left top, right top, from(white), to(red));background:linear-gradient(to right, white, red);mix-blend-mode:saturation}.dnn-color-picker .dnn-color-sliders .dnn-color-s-b:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;z-index:2;background:-webkit-gradient(linear, left top, left bottom, from(white), to(black));background:linear-gradient(to bottom, white, black);mix-blend-mode:luminosity}.dnn-color-picker .dnn-color-sliders .dnn-color-s-b button{position:absolute;bottom:calc(50% - 4px);left:calc(50% - 4px);width:8px;height:8px;z-index:3;display:block;background:none;border:none;margin-left:-4px;margin-bottom:-4px;padding:7px;background-color:#fff;border-radius:50%}.dnn-color-picker .dnn-color-sliders .dnn-color-s-b button:before{content:"";position:absolute;top:-1px;left:-1px;border-radius:50%}.dnn-color-picker .dnn-color-sliders .dnn-color-s-b button:after{content:"";position:absolute;top:0px;left:0px;border-radius:50%;width:10px;height:10px;border:2px solid #ccc}.dnn-color-picker .dnn-color-sliders .dnn-color-bar{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-top:15px}.dnn-color-picker .dnn-color-sliders .dnn-color-bar .dnn-color-result{-ms-flex-direction:column;flex-direction:column;width:50px;height:50px;border-radius:50%;background:red}.dnn-color-picker .dnn-color-sliders .dnn-color-bar .dnn-color-hue{-ms-flex:auto;flex:auto;margin-left:10px;height:16px;border:1px solid #ccc;position:relative;background:-webkit-gradient(linear, left top, right top, color-stop(0, #f00), color-stop(17%, #ff0), color-stop(33%, #0f0), color-stop(50%, #0ff), color-stop(67%, #00f), color-stop(84%, #f0f), to(#f00));background:linear-gradient(to right, #f00 0, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 84%, #f00 100%)}.dnn-color-picker .dnn-color-sliders .dnn-color-bar .dnn-color-hue button{width:10px;height:20px;position:absolute;top:-2px;left:calc(50% - 4px);border:0;padding:0;background-color:transparent;padding-left:-8px}.dnn-color-picker .dnn-color-sliders .dnn-color-bar .dnn-color-hue button:before{content:"";position:absolute;top:-2px;left:0px;border-radius:3px;width:100%;height:100%;border:1px solid #ccc;background-color:#fff}.dnn-color-picker .dnn-color-fields{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:justify;justify-content:space-between}.dnn-color-picker .dnn-color-fields .dnn-color-mode-switch{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;padding:0.5em}.dnn-color-picker .dnn-color-fields .dnn-color-mode-switch button{background-color:transparent;border:none}.dnn-color-picker .dnn-color-fields .dnn-color-mode-switch button svg{width:3em;height:3em;pointer-events:none;outline:none}.dnn-color-picker .dnn-color-fields .dnn-rgb-color-fields{display:-ms-flexbox;display:flex;-ms-flex-pack:space-evenly;justify-content:space-evenly}.dnn-color-picker .dnn-color-fields .dnn-rgb-color-fields .dnn-rgb-color-field{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:auto;flex:auto;text-align:center;padding:0.5em}.dnn-color-picker .dnn-color-fields .dnn-rgb-color-fields .dnn-rgb-color-field label{padding-bottom:0.25em}.dnn-color-picker .dnn-color-fields .dnn-rgb-color-fields .dnn-rgb-color-field input{border-radius:var(--dnn-button-radius, 3px);border:1px solid #ccc;padding:0.5em;padding-left:1.3em;text-align:center}.dnn-color-picker .dnn-color-fields .dnn-rgb-color-fields .dnn-rgb-color-field input.red{border-color:red}.dnn-color-picker .dnn-color-fields .dnn-rgb-color-fields .dnn-rgb-color-field input.green{border-color:green}.dnn-color-picker .dnn-color-fields .dnn-rgb-color-fields .dnn-rgb-color-field input.blue{border-color:blue}.dnn-color-picker .dnn-color-fields .dnn-hsl-color-fields{display:-ms-flexbox;display:flex;-ms-flex-pack:space-evenly;justify-content:space-evenly}.dnn-color-picker .dnn-color-fields .dnn-hsl-color-fields .dnn-hsl-color-field{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:auto;flex:auto;text-align:center;padding:0.5em}.dnn-color-picker .dnn-color-fields .dnn-hsl-color-fields .dnn-hsl-color-field label{padding-bottom:0.25em}.dnn-color-picker .dnn-color-fields .dnn-hsl-color-fields .dnn-hsl-color-field input{border-radius:var(--dnn-button-radius, 3px);border:1px solid #ccc;padding:0.5em;padding-left:1.3em;text-align:center}.dnn-color-picker .dnn-color-fields .dnn-hex-color-fields{display:-ms-flexbox;display:flex;-ms-flex-pack:space-evenly;justify-content:space-evenly}.dnn-color-picker .dnn-color-fields .dnn-hex-color-fields .dnn-hex-color-field{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:auto;flex:auto;text-align:center;padding:0.5em}.dnn-color-picker .dnn-color-fields .dnn-hex-color-fields .dnn-hex-color-field label{padding-bottom:0.25em}.dnn-color-picker .dnn-color-fields .dnn-hex-color-fields .dnn-hex-color-field .hex-input{position:relative;border-radius:var(--dnn-button-radius, 3px);border:1px solid #ccc;padding:0.323em;text-align:center}.dnn-color-picker .dnn-color-fields .dnn-hex-color-fields .dnn-hex-color-field .hex-input input{border:0;padding:0;margin:0;width:100%;height:100%;text-align:center}.dnn-color-picker .dnn-color-fields .dnn-hex-color-fields .dnn-hex-color-field .hex-input button{position:absolute;height:100%;top:0;right:1em;background-color:transparent;border:0;padding:0;margin:0}.dnn-color-picker .dnn-color-fields .dnn-hex-color-fields .dnn-hex-color-field .hex-input button svg{min-width:1em}';
|
|
7
|
+
/** Reusable DNN UI component to pick a color
|
|
8
|
+
* @copyright Copyright (c) .NET Foundation. All rights reserved.
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/var v=undefined&&undefined.__decorate||function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)if(s=e[a])i=(r<3?s(i):r>3?s(t,n,i):s(t,n))||i;return r>3&&i&&Object.defineProperty(t,n,i),i};var b=e("dnn_color_picker",function(){function e(e){var o=this;t(this,e);this.colorChanged=n(this,"colorChanged",7);this.color="FFFFFF";this.colorBoxHeight="50%";this.rgbDisplay="flex";this.hslDisplay="none";this.hexDisplay="none";this.handleSaturationLightnessMouseDown=function(e){e.preventDefault();o.handleDragLightnessSaturation(e);window.addEventListener("mousemove",o.handleDragLightnessSaturation);window.addEventListener("mouseup",o.handleSaturationLightnessMouseUp)};this.handleDragLightnessSaturation=function(e){var t=o.saturationLightnessBox.getBoundingClientRect();var n=e.clientX-t.left;if(n<0){n=0}if(n>t.width){n=t.width}n=n/t.width;var r=e.clientY-t.top;if(r<0){r=0}if(r>t.height){r=t.height}r=1-r/t.height;var i=new g;i.hue=o.currentColor.hue;i.saturation=n;i.lightness=r;o.currentColor=i};this.handleSaturationLightnessMouseUp=function(){window.removeEventListener("mousemove",o.handleDragLightnessSaturation);window.removeEventListener("mouseup",o.handleSaturationLightnessMouseUp)};this.handleHueMouseDown=function(e){e.preventDefault();o.handleDragHue(e);window.addEventListener("mousemove",o.handleDragHue);window.addEventListener("mouseup",o.handleHueMouseUp)};this.handleHueMouseUp=function(){window.removeEventListener("mousemove",o.handleDragHue);window.removeEventListener("mouseup",o.handleHueMouseUp)};this.handleDragHue=function(e){var t=o.hueRange.getBoundingClientRect();var n=e.clientX-t.left;if(n<0){n=0}if(n>t.width){n=t.width}n=n/t.width*360;var r=new g;r.hue=n;r.saturation=o.currentColor.saturation;r.lightness=o.currentColor.lightness;o.currentColor=r};this.handleComponentValueChange=function(e,t){var n=parseInt(e.target.value);if(isNaN(n)){return}var r=new g;if(n<0){n=0}if(n>255){n=255}var i=o.currentColor.red;var s=o.currentColor.green;var a=o.currentColor.blue;switch(t){case"red":i=n;break;case"green":s=n;break;case"blue":a=n;break}r.green=s;r.red=i;r.blue=a;o.currentColor=r};this.handleHSLChange=function(e,t){var n=parseInt(e.target.value);if(isNaN(n)){return}var r=new g;if(n!=null){var i=o.currentColor.hue;var s=o.currentColor.saturation;var a=o.currentColor.lightness;switch(t){case"hue":if(n<0){n=0}if(n>359){n=0}i=n;break;case"saturation":if(n<0){n=0}if(n>100){n=100}s=n/100;break;case"lightness":if(n<0){n=0}if(n>100){n=100}a=n/100;break}r.hue=i;r.saturation=s;r.lightness=a;o.currentColor=r}};this.handleSaturationLightnessKeyDown=function(e){var t=new g;t.hue=o.currentColor.hue;t.saturation=o.currentColor.saturation;t.lightness=o.currentColor.lightness;var n=.01;if(e.shiftKey){n=.1}switch(e.key){case"ArrowUp":t.lightness+=n;break;case"ArrowDown":t.lightness-=n;break;case"ArrowLeft":t.saturation-=n;break;case"ArrowRight":t.saturation+=n}o.currentColor=t};this.handleHueKeyDown=function(e){var t=new g;t.hue=o.currentColor.hue;t.saturation=o.currentColor.saturation;t.lightness=o.currentColor.lightness;var n=1;if(e.shiftKey){n=10}switch(e.key){case"ArrowLeft":t.hue-=n;break;case"ArrowRight":t.hue+=n}o.currentColor=t}}e.prototype.colorChangedHandler=function(e){this.colorChanged.emit(e)};e.prototype.handeCurrentColorChanged=function(e){this.colorChangedHandler(e)};e.prototype.componentWillLoad=function(){this.handleHexChange(this.color)};e.prototype.componentDidLoad=function(){this.el.style.setProperty("--color-box-height",this.colorBoxHeight.toString())};e.prototype.getHex=function(){return this.getDoublet(this.currentColor.red)+this.getDoublet(this.currentColor.green)+this.getDoublet(this.currentColor.blue)};e.prototype.getContrast=function(){return this.currentColor.contrastColor};e.prototype.getDoublet=function(e){var t=e.toString(16).toUpperCase();if(t.length===1){return"0"+t}return t};e.prototype.handleHexChange=function(e){var t=new g;if(e.match(/^(?:[\da-f]{3}|[\da-f]{6})$/i).length>0){if(e.length===3){var n=e[0]+e[0]+e[1]+e[1]+e[2]+e[2];e=n}t.red=parseInt(e.substr(0,2),16);t.green=parseInt(e.substr(2,2),16);t.blue=parseInt(e.substr(4,2),16)}else{t.red=this.currentColor.red;t.green=this.currentColor.green;t.blue=this.currentColor.blue}this.currentColor=t};e.prototype.switchColorMode=function(e){switch(e.target.id){case"rgb-switch":this.rgbDisplay="none";this.hslDisplay="none";this.hexDisplay="flex";break;case"hex-switch":this.rgbDisplay="none";this.hslDisplay="flex";this.hexDisplay="none";break;case"hsl-switch":this.rgbDisplay="flex";this.hslDisplay="none";this.hexDisplay="none";break;default:this.rgbDisplay="flex";this.hslDisplay="none";this.hexDisplay="none"}};e.prototype.render=function(){var e=this;var t=this.currentColor.hue;var n=this.currentColor.saturation;var r=this.currentColor.lightness;var i=this.currentColor.red;var s=this.currentColor.green;var a=this.currentColor.blue;return o("div",{class:"dnn-color-picker"},o("div",{class:"dnn-color-sliders"},o("div",{class:"dnn-color-s-b",ref:function(t){return e.saturationLightnessBox=t},style:{backgroundColor:"hsl(".concat(t,",100%,50%)")},onMouseDown:this.handleSaturationLightnessMouseDown.bind(this)},o("button",{class:"dnn-s-b-picker","aria-label":"Press up or down to adjust lightness, left or right to adjust saturation, hold shift to move by 10%",role:"slider","aria-valuemin":"0","aria-valuemax":"100","aria-valuetext":"Saturation: ".concat(Math.round(this.currentColor.saturation*100),"%, Lightness: ").concat(Math.round(this.currentColor.lightness*100),"%"),style:{left:Math.round(n*100)+"%",bottom:Math.round(r*100)+"%"},onKeyDown:function(t){return e.handleSaturationLightnessKeyDown(t)}})),o("div",{class:"dnn-color-bar"},o("div",{class:"dnn-color-result",style:{backgroundColor:"#"+this.getHex(),boxShadow:"0 0 2px 1px "+"#"+this.getContrast()}}),o("div",{class:"dnn-color-hue",ref:function(t){return e.hueRange=t},onMouseDown:this.handleHueMouseDown.bind(this)},o("button",{class:"dnn-hue-picker","aria-label":"Press left or right to adjust hue, hold shift to move by 10 degrees",role:"slider","aria-valuemin":"0","aria-valuemax":"359","aria-valuenow":Math.round(t),style:{left:(t/359*100).toString()+"%"},onKeyDown:function(t){return e.handleHueKeyDown(t)}})))),o("div",{class:"dnn-color-fields"},o("div",{class:"dnn-rgb-color-fields",style:{display:this.rgbDisplay}},o("div",{class:"dnn-rgb-color-field"},o("label",null,"R"),o("input",{type:"number",min:"0",max:"255",step:"1",class:"red",value:i,"aria-label":"red value",onChange:function(t){return e.handleComponentValueChange(t,"red")}})),o("div",{class:"dnn-rgb-color-field"},o("label",null,"G"),o("input",{type:"number",min:"0",max:"255",class:"green",value:s,"aria-label":"green value",onChange:function(t){return e.handleComponentValueChange(t,"green")}})),o("div",{class:"dnn-rgb-color-field"},o("label",null,"B"),o("input",{type:"number",min:"0",max:"255",class:"blue",value:a,"aria-label":"blue value",onChange:function(t){return e.handleComponentValueChange(t,"blue")}})),o("div",{class:"dnn-color-mode-switch"},o("button",{id:"rgb-switch",onClick:this.switchColorMode.bind(this),"aria-label":"switch to hexadecimal value entry"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"}))))),o("div",{class:"dnn-hsl-color-fields",style:{display:this.hslDisplay}},o("div",{class:"dnn-hsl-color-field"},o("label",null,"H"),o("input",{type:"number",min:"0",max:"359",step:1,value:Math.round(t),"aria-label":"Hue",onChange:function(t){return e.handleHSLChange(t,"hue")}})),o("div",{class:"dnn-hsl-color-field"},o("label",null,"S"),o("input",{type:"number",min:"0",max:"100",step:1,value:Math.round(n*100),"aria-label":"Saturation",onChange:function(t){return e.handleHSLChange(t,"saturation")}})),o("div",{class:"dnn-hsl-color-field"},o("label",null,"L"),o("input",{type:"number",min:"0",max:"100",step:1,value:Math.round(r*100),"aria-label":"Lightness",onChange:function(t){return e.handleHSLChange(t,"lightness")}})),o("div",{class:"dnn-color-mode-switch"},o("button",{id:"hsl-switch",onClick:this.switchColorMode.bind(this),"aria-label":"Switch to red, green, blue entry mode"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"}))))),o("div",{class:"dnn-hex-color-fields",style:{display:this.hexDisplay}},o("div",{class:"dnn-hex-color-field"},o("label",null,"HEX"),o("div",{class:"hex-input"},o("input",{type:"text","aria-label":"Hexadecimal value",value:this.getHex(),onChange:function(t){return e.handleHexChange(t.target.value)}}),o("button",{class:"copy","aria-label":"copy value"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"}))))),o("div",{class:"dnn-color-mode-switch"},o("button",{id:"hex-switch",onClick:this.switchColorMode.bind(this),"aria-label":"Switch to hue saturation lightness values"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M7 7h10v3l4-4-4-4v3H5v6h2V7zm10 10H7v-3l-4 4 4 4v-3h12v-6h-2v4z"})))))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{currentColor:["handeCurrentColorChanged"]}},enumerable:false,configurable:true});return e}());v([s(100)],b.prototype,"colorChangedHandler",null);b.style=m;var x=":host{--border-color:var(--dnn-color-tertiary-contrast, lightgray);--border-radius:var(--dnn-controls-radius, 5px);--drop-background-color:var(--dnn-color-tertiary, lightblue);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:1rem;text-align:center;border:2px dashed var(--border-color);border-radius:var(--border-radius);padding:1rem;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}:host(.dropping){background-color:var(--drop-background-color)}p{margin:0;padding:0}button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;border:0px;margin:0;padding:0;background-color:transparent}button:hover{cursor:pointer}button svg{margin-right:0.5rem}label.upload-file{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer}label.upload-file input{display:none}.video-preview{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center}.video-preview button{margin:1rem}";var w=e("dnn_dropzone",function(){function e(e){var o=this;t(this,e);this.filesSelected=n(this,"filesSelected",7);this.resx={dragAndDropFile:"Drag and drop a file",capture:"Capture",or:"or",takePicture:"Take a picture",uploadFile:"Upload a file"};this.allowCameraMode=false;this.captureQuality=.8;this.canTakeSnapshots=false;this.takingPicture=false;this.handleDragOver=function(e){e.stopPropagation();e.preventDefault();e.dataTransfer.dropEffect="copy";o.dropzone.classList.add("dropping")};this.handleDrop=function(e){e.stopPropagation();e.preventDefault();var t=e.dataTransfer.files;if(o.hasInvalidExtensions(t)){return}var n=o.getFilesFromFileList(t);o.filesSelected.emit(n)}}e.prototype.componentDidLoad=function(){var e=this;if(this.allowCameraMode){this.checkIfBrowserCanTakeSnapshots().then((function(t){return e.canTakeSnapshots=t}))}if(this.allowedExtensions!=undefined&&this.allowedExtensions.length>0){var t=this.allowedExtensions.map((function(e){return".".concat(e)}));var n=t.join(",");this.fileInput.accept=n}};e.prototype.checkIfBrowserCanTakeSnapshots=function(){return new Promise((function(e){var t=navigator.mediaDevices;if(t==undefined||t.enumerateDevices==undefined){e(false)}t.enumerateDevices().then((function(t){var n=t.some((function(e){return e.kind=="videoinput"}));e(n)}))}))};e.prototype.getFilesFromFileList=function(e){var t=[];for(var n=0;n<e.length;n++){var o=e[n];t.push(o)}return t};e.prototype.handleUploadButton=function(e){var t=this.getFilesFromFileList(e.files);this.filesSelected.emit(t)};e.prototype.hasInvalidExtensions=function(e){var t=false;for(var n=0;n<e.length;n++){var o=e[n];var r=/(?:\.([^.]+))?$/;var i=r.exec(o.name)[1];if(i==undefined){t=true}if(this.allowedExtensions!=undefined&&!this.allowedExtensions.includes(i)){t=true}return t}};e.prototype.takeSnapshot=function(){var e=this;this.takingPicture=true;navigator.mediaDevices.getUserMedia({video:true,audio:false}).then((function(t){e.videoPreview.srcObject=t;e.videoPreview.play().then((function(){e.videoSettings=t.getVideoTracks()[0].getSettings()}))})).catch((function(e){return alert(e)}))};e.prototype.applySnapshot=function(){var e=this;var t=document.createElement("canvas");var n=t.getContext("2d");t.width=this.videoSettings.width;t.height=this.videoSettings.height;n.drawImage(this.videoPreview,0,0);t.toBlob((function(t){var n=new File([t],"image.jpeg",{type:"image/jpeg"});e.takingPicture=false;var o=[n];e.filesSelected.emit(o)}),"image/jpeg",this.captureQuality)};e.prototype.render=function(){var e=this;var t,n,i,s,a,l;return o(r,{ref:function(t){return e.dropzone=t},class:"dropzone",onDragOver:this.handleDragOver,onDrop:this.handleDrop,onDragLeave:function(){return e.dropzone.classList.remove("dropping")}},!this.takingPicture&&[o("p",null,(t=this.resx)===null||t===void 0?void 0:t.dragAndDropFile),o("p",null,"- ",(n=this.resx)===null||n===void 0?void 0:n.or," -"),o("label",{class:"upload-file"},o("input",{type:"file",ref:function(t){return e.fileInput=t},onChange:function(t){return e.handleUploadButton(t.target)}}),o("span",null,o("svg",{xmlns:"http://www.w3.org/2000/svg","enable-background":"new 0 0 24 24",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("g",null,o("rect",{fill:"none",height:"24",width:"24"})),o("g",null,o("path",{d:"M5,20h14v-2H5V20z M5,10h4v6h6v-6h4l-7-7L5,10z"}))))," ",(i=this.resx)===null||i===void 0?void 0:i.uploadFile),this.canTakeSnapshots&&[o("p",null,"- ",(s=this.resx)===null||s===void 0?void 0:s.or," -"),o("button",{onClick:function(){return e.takeSnapshot()}},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("circle",{cx:"12",cy:"12",r:"3.2"}),o("path",{d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"})),(a=this.resx)===null||a===void 0?void 0:a.takePicture)]],this.takingPicture&&o("div",{class:"video-preview"},o("video",{ref:function(t){return e.videoPreview=t}}),o("button",{onClick:function(){return e.applySnapshot()}},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("circle",{cx:"12",cy:"12",r:"3.2"}),o("path",{d:"M9 2L7.17 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2h-3.17L15 2H9zm3 15c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5z"}))," ",(l=this.resx)===null||l===void 0?void 0:l.capture)))};return e}());w.style=x;var y;(function(e){e[e["nw"]=0]="nw";e[e["ne"]=1]="ne";e[e["se"]=2]="se";e[e["sw"]=3]="sw"})(y||(y={}));function k(e,t){var n=0;var o=0;if(e instanceof MouseEvent){n=e.movementX;o=e.movementY}if(typeof TouchEvent!=="undefined"){if(e instanceof TouchEvent){var r=e.touches[0];if(t!=undefined){n=r.pageX-this.previousTouch.pageX;o=r.pageY-this.previousTouch.pageY}t=r}}return{movementX:n,movementY:o}}var C=":host{display:block}canvas{display:none}.view{visibility:hidden;opacity:0;height:0;overflow:hidden;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.view.visible{visibility:visible;opacity:1;height:initial;overflow:visible}.view .cropper{position:relative;width:100%}.view .cropper img{width:100%;display:block;margin:0 auto}.view .cropper .backdrop{-webkit-backdrop-filter:saturate(0.5);backdrop-filter:saturate(0.5);-webkit-backdrop-filter:brightness(0.5);backdrop-filter:brightness(0.5);position:absolute;left:0;top:0;width:100%;height:100%}.view .cropper .crop{position:absolute;top:0;left:0;width:100%;height:100%;outline:2px dashed white;-webkit-box-shadow:black 0 0 0px 2px;box-shadow:black 0 0 0px 2px;-webkit-backdrop-filter:saturate(2);backdrop-filter:saturate(2);-webkit-backdrop-filter:brightness(2);backdrop-filter:brightness(2);cursor:move}.view .cropper .crop>div{width:20px;height:20px;background-color:white;border:2px solid rgba(0, 0, 0, 0.5);position:absolute}.view .cropper .crop>div.nw,.view .cropper .crop>div.ne{top:-17px}.view .cropper .crop>div.ne,.view .cropper .crop>div.se{right:-17px}.view .cropper .crop>div.se,.view .cropper .crop>div.sw{bottom:-17px}.view .cropper .crop>div.sw,.view .cropper .crop>div.nw{left:-17px}.view .cropper .crop>div.nw,.view .cropper .crop>div.se{cursor:nwse-resize}.view .cropper .crop>div.ne,.view .cropper .crop>div.sw{cursor:nesw-resize}dnn-modal{--max-width:512px}";var M=e("dnn_image_cropper",function(){function e(e){var o=this;t(this,e);this.imageCropChanged=n(this,"imageCropChanged",7);this.width=600;this.height=600;this.resx={capture:"Capture",dragAndDropFile:"Drag and drop an image",or:"or",takePicture:"Take a picture",uploadFile:"Upload an image",imageTooSmall:"The image you are attempting to upload does not meet the minimum size requirement of {width} pixels by {height} pixels. Please upload a larger image.",modalCloseText:"Close"};this.quality=.8;this.preventUndersized=false;this.handleCropMouseDown=function(e){e.stopPropagation();e.preventDefault();var t=e.target;var n=t.classList[0];document.addEventListener("mouseup",o.handleImageCropFinished,false);document.addEventListener("touchend",o.handleImageCropFinished,false);switch(n){case"crop":document.addEventListener("mousemove",o.handleCropDrag,false);document.addEventListener("touchmove",o.handleCropDrag,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",o.handleCropDrag)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",o.handleCropDrag)}));break;case"nw":document.addEventListener("mousemove",o.handleNwMouseMove,false);document.addEventListener("touchmove",o.handleNwMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",o.handleNwMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",o.handleNwMouseMove)}));break;case"ne":document.addEventListener("mousemove",o.handleNeMouseMove,false);document.addEventListener("touchmove",o.handleNeMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",o.handleNeMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",o.handleNeMouseMove)}));break;case"se":document.addEventListener("mousemove",o.handleSeMouseMove,false);document.addEventListener("touchmove",o.handleSeMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",o.handleSeMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",o.handleSeMouseMove)}));break;case"sw":document.addEventListener("mousemove",o.handleSwMouseMove,false);document.addEventListener("touchmove",o.handleSwMouseMove,false);document.addEventListener("mouseup",(function(){return document.removeEventListener("mousemove",o.handleSwMouseMove)}));document.addEventListener("touchend",(function(){return document.removeEventListener("touchmove",o.handleSwMouseMove)}));break}};this.handleImageCropFinished=function(e){o.emitImage();document.removeEventListener("mouseup",o.handleImageCropFinished);o.previousTouch=undefined};this.handleNwMouseMove=function(e){o.handleCornerDrag(e,y.nw)};this.handleNeMouseMove=function(e){o.handleCornerDrag(e,y.ne)};this.handleSeMouseMove=function(e){o.handleCornerDrag(e,y.se)};this.handleSwMouseMove=function(e){o.handleCornerDrag(e,y.sw)};this.handleCornerDrag=function(e,t){if(!o.isMouseStillInTarget(e)){return}var n=o.getCornerLeftTop(t),r=n.left,i=n.top;var s=0;var a=0;var l="horizontal";var d=o.width/o.height;var c=o.crop.getBoundingClientRect();var h=o.image.getBoundingClientRect();var u=k(e,o.previousTouch),p=u.movementX,f=u.movementY;if(Math.abs(p)<Math.abs(f)){l="vertical"}if(l=="horizontal"){switch(t){case y.nw:case y.sw:s=c.width-p;a=s/d;break;case y.ne:case y.se:s=c.width+p;a=s/d;break}}else{switch(t){case y.nw:case y.ne:a=c.height-f;s=a*d;break;case y.se:case y.sw:a=c.height+f;s=a*d;break}}switch(t){case y.ne:case y.nw:var g=c.height-a;i=o.crop.offsetTop+g}switch(t){case y.nw:case y.sw:var m=c.width-s;r=o.crop.offsetLeft+m;if(r<0)r=0;if(r>h.width)r=h.width;if(i<0)i=0;if(i>h.height)i=h.height;if(r+s>h.width)s=h.width-r;if(i+a>h.height)a=h.height-i;break;case y.ne:case y.se:if(i<0)i=0;if(i>h.height)i=h.height;if(r+s>h.width)s=h.width-r;if(i+a>h.height)a=h.height-i;break}if(s/a!=d){return}if(o.preventUndersized){var v=o.image.width/o.image.naturalWidth;if(s/v<o.width||a/v<o.height){return}}switch(t){case y.ne:o.crop.style.top="".concat(i,"px");o.crop.style.width="".concat(s,"px");o.crop.style.height="".concat(a,"px");break;case y.nw:o.crop.style.left="".concat(r,"px");o.crop.style.top="".concat(i,"px");o.crop.style.width="".concat(s,"px");o.crop.style.height="".concat(a,"px");break;case y.se:o.crop.style.width="".concat(s,"px");o.crop.style.height="".concat(a,"px");break;case y.sw:o.crop.style.left="".concat(r,"px");o.crop.style.width="".concat(s,"px");o.crop.style.height="".concat(a,"px");break}};this.handleCropDrag=function(e){if(!o.isMouseStillInTarget(e)){return}var t=k(e,o.previousTouch),n=t.movementX,r=t.movementY;var i=o.crop.offsetLeft+n;var s=o.crop.offsetTop+r;var a=o.image.getBoundingClientRect();var l=o.crop.getBoundingClientRect();if(i<0){i=0}if(s<0){s=0}if(i+l.width>a.width){i=o.crop.offsetLeft}if(s+l.height>a.height){s=o.crop.offsetTop}o.crop.style.left=i+"px";o.crop.style.top=s+"px"}}e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){e.setView("noPictureView")}))};e.prototype.setView=function(e){var t=this.host.shadowRoot.querySelectorAll(".view");t.forEach((function(e){return e.classList.remove("visible")}));switch(e){case"noPictureView":this.noPictureView.classList.add("visible");break;case"hasPictureView":this.hasPictureView.classList.add("visible");break}this.view=e};e.prototype.initCrop=function(){var e=this.width/this.height;var t=this.image.getBoundingClientRect();var n=t.width/t.height;if(e>n){var o=t.width/e;var r=t.height-o;this.crop.style.top=Math.round(r/2).toString()+"px";this.crop.style.height=Math.round(o).toString()+"px"}else{var i=t.height*e;var r=t.width-i;this.crop.style.left=Math.round(r/2).toString()+"px";this.crop.style.width=Math.round(i).toString()+"px"}};e.prototype.setImage=function(){var e=this;this.image.addEventListener("load",(function(){e.initCrop();e.emitImage()}));this.image.src=this.canvas.toDataURL()};e.prototype.handleNewFile=function(e){var t=this;if(e.type.split("/")[0]!="image"){return}var n=new FileReader;n.onload=function(e){var n=new Image;n.onload=function(){t.canvas.width=n.width;t.canvas.height=n.height;if(t.preventUndersized&&(n.width<t.width||n.height<t.height)){t.imageTooSmallModal.show();return}var e=t.canvas.getContext("2d");e.drawImage(n,0,0);t.setView("hasPictureView");t.setImage()};n.src=e.target.result.toString()};n.readAsDataURL(e)};e.prototype.emitImage=function(){var e=this.crop.offsetLeft/this.image.width*this.image.naturalWidth;var t=this.crop.offsetTop/this.image.height*this.image.naturalHeight;var n=this.crop.getBoundingClientRect();var o=n.width/this.image.width*this.image.naturalWidth;var r=n.height/this.image.height*this.image.naturalHeight;if(e<0)e=0;if(e>this.image.naturalWidth)e=this.image.naturalWidth;if(t<0)t=0;if(t>this.image.naturalWidth)t=this.image.naturalWidth;if(o>this.image.naturalWidth)o=this.image.naturalWidth;if(r>this.image.naturalHeight)r=this.image.naturalHeight;var i=this.generateCroppedImage(e,t,o,r,this.width,this.height);this.imageCropChanged.emit(i)};e.prototype.generateCroppedImage=function(e,t,n,o,r,i){this.canvas.width=r;this.canvas.height=i;var s=this.canvas.getContext("2d");s.clearRect(0,0,r,i);s.drawImage(this.image,e,t,n,o,0,0,r,i);return this.canvas.toDataURL("image/jpeg",this.quality)};e.prototype.getCornerLeftTop=function(e){var t=0;var n=0;switch(e){case y.se:t=this.crop.offsetLeft;n=this.crop.offsetTop;break;case y.sw:n=this.crop.offsetTop;break}return{top:n,left:t}};e.prototype.isMouseStillInTarget=function(e){var t=false;var n;var o;var r=this.image.getBoundingClientRect();if(e instanceof MouseEvent){n=e.clientX;o=e.clientY}if(typeof TouchEvent!=="undefined"){if(e instanceof TouchEvent){var i=e.touches[0];n=i.clientX;o=i.clientY}}if(n>=r.x&&o>=r.y&&n<=r.left+r.width&&o<=r.top+r.height){t=true}var s=this.crop.querySelectorAll("div");s.forEach((function(e){var r=e.getBoundingClientRect();if(n>=r.x&&o>=r.y&&n<=r.left+r.width&&o<=r.top+r.height){t=true}}));return t};e.prototype.render=function(){var e=this;return o(r,{ref:function(t){return e.host=t}},o("canvas",{ref:function(t){return e.canvas=t}}),o("div",{class:"view",ref:function(t){return e.hasPictureView=t}},o("div",{class:"cropper"},o("img",{ref:function(t){return e.image=t}}),o("div",{class:"backdrop"}),o("div",{class:"crop",ref:function(t){return e.crop=t},onMouseDown:this.handleCropMouseDown,onTouchStart:this.handleCropMouseDown},o("div",{class:"nw"}),o("div",{class:"ne"}),o("div",{class:"se"}),o("div",{class:"sw"})))),o("div",{class:"view",ref:function(t){return e.noPictureView=t}},o("dnn-dropzone",{allowCameraMode:true,onFilesSelected:function(t){return e.handleNewFile(t.detail[0])},resx:{capture:this.resx.capture,dragAndDropFile:this.resx.dragAndDropFile,or:this.resx.or,takePicture:this.resx.takePicture,uploadFile:this.resx.uploadFile}})),o("dnn-modal",{ref:function(t){return e.imageTooSmallModal=t},"close-text":this.resx.modalCloseText},o("p",null,this.resx.imageTooSmall.replace("{width}",this.width.toString()).replace("{height}",this.height.toString()))))};return e}());M.style=C;var D=":host{display:block}:host .overlay{background-color:rgba(0, 0, 0, 0.5);position:fixed;top:0;left:0;width:100%;height:100%;z-index:1002;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;visibility:hidden;opacity:0}:host .overlay .modal{max-width:var(--max-width, 1200px);background-color:white;padding:30px;-webkit-transform:scale(2);transform:scale(2);-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;z-index:2;position:relative;margin:10%;max-height:80%;border-radius:var(--dnn-controls-radius, 5px);-webkit-box-shadow:10px 10px 20px 0 rgba(0, 0, 0, 0.5);box-shadow:10px 10px 20px 0 rgba(0, 0, 0, 0.5);display:block}:host .overlay .modal .content{max-width:80vw;max-height:80vh;overflow:auto}:host .overlay .modal .close{position:absolute;background-color:white;border:2px solid white;border-radius:50%;padding:0;margin:0;top:-12px;right:-12px;outline:none;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .overlay .modal .close:focus,:host .overlay .modal .close:hover{-webkit-box-shadow:0 0 2px 2px var(--dnn-color-primary, blue);box-shadow:0 0 2px 2px var(--dnn-color-primary, blue)}:host .overlay .modal .close svg{width:24px;height:24px;color:grey}:host .overlay.visible{visibility:visible;opacity:1}:host .overlay.visible .modal{-webkit-transform:scale(1);transform:scale(1);-webkit-box-shadow:4px 4px 10px 0px rgba(0, 0, 0, 0.5);box-shadow:4px 4px 10px 0px rgba(0, 0, 0, 0.5);display:block}";var L=e("dnn_modal",function(){function e(e){t(this,e);this.dismissed=n(this,"dismissed",7);this.backdropDismiss=true;this.closeText="Close modal";this.showCloseButton=true;this.visible=false}e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=true;return[2]}))}))};e.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=false;return[2]}))}))};e.prototype.handleDismiss=function(){this.visible=false;this.dismissed.emit()};e.prototype.handleBackdropClick=function(e){var t=e.target;if(t.id==="backdrop"&&this.backdropDismiss){this.handleDismiss()}};e.prototype.render=function(){var e=this;return o(r,null,o("div",{id:"backdrop",class:this.visible?"overlay visible":"overlay",onClick:function(t){return e.handleBackdropClick(t)}},o("div",{class:"modal"},this.showCloseButton&&o("button",{class:"close","aria-label":this.closeText,onClick:function(){return e.handleDismiss()}},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}))),o("div",{class:"content"},o("slot",null)))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());L.style=D;var _=":host{display:block}.add-role-row{display:-ms-flexbox;display:flex;gap:1em;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap}.add-role-row label{margin-right:0.5em}.search-user{display:-ms-flexbox;display:flex;gap:1em;margin-top:1em}.search-user .search-control{position:relative}.search-user .search-control dnn-collapsible{position:absolute;left:0;top:calc(100% - 2px);width:100%;-webkit-box-shadow:0px 4px 4px;box-shadow:0px 4px 4px}.search-user .search-control dnn-collapsible .dropdown{background-color:white;border:1px solid lightgray;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.search-user .search-control dnn-collapsible .dropdown button{background-color:transparent;border:none;border-bottom:1px solid lightgray;padding:0.25em;margin:0;text-align:left}table{border:1px solid lightgray;border-collapse:collapse;margin-top:1em}table thead{text-align:center}table thead tr{border-bottom:1px solid lightgray}table thead th{background-color:lightgray;padding:0.25em 0.5em}table thead th:first-child{border-right:1px solid lightgray}table tbody tr{border-bottom:1px dotted lightgray}table tbody tr th{text-align:left;border-right:1px solid lightgray;padding:0 0.5em}table tbody tr td{text-align:center}table tbody tr td dnn-checkbox span{display:none}table tbody tr td button{background-color:transparent;border:0;padding:0;margin:0;margin-right:1em}";var S=e("dnn_permissions_grid",function(){function e(e){t(this,e);this.userSearchQueryChanged=n(this,"userSearchQueryChanged",7);this.permissionsChanged=n(this,"permissionsChanged",7);this.resx={Add:"Add",AllRoles:"All Roles",FilterByGroup:"Filter By Group",GlobalRoles:"Global Roles",Role:"Role",RolePermissions:"Role Permissions",SelectRole:"Select Role",User:"User",UserPermissions:"User Permissions"};this.foundUsers=[];this.selectedRoleGroupId=-1}e.prototype.handleFoundUsersChanged=function(e){var t=this;if((e===null||e===void 0?void 0:e.length)>0){setTimeout((function(){t.userCollapsible.expanded=true}),100)}};e.prototype.componentWillLoad=function(){document.addEventListener("click",this.dismissUserResults.bind(this))};e.prototype.disconnectedCallback=function(){document.removeEventListener("click",this.disconnectedCallback.bind(this))};e.prototype.dismissUserResults=function(e){var t=this.roleDropDown.getBoundingClientRect();if(e.pageX>t.right||e.pageX<t.left||e.pageY>t.bottom||e.pageY<t.top){this.userCollapsible.expanded=false}};e.prototype.handleRoleGroupChanged=function(e){var t=e.selectedIndex;var n=Number.parseInt(e.options[t].value);this.selectedRoleGroupId=n};e.prototype.addRole=function(){var e=Number.parseInt(this.roleDropDown.options[this.roleDropDown.selectedIndex].value);var t=this.roles.filter((function(t){return t.RoleId==e}))[0];this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray(__spreadArray([],this.permissions.rolePermissions,true),[{default:false,locked:false,permissions:[],roleId:t.RoleId,roleName:t.RoleName}],false)});this.permissionsChanged.emit(this.permissions)};e.prototype.addUser=function(){if(this.pickedUser!=undefined){this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray(__spreadArray([],this.permissions.userPermissions,true),[{displayName:this.pickedUser.displayName,permissions:[],userId:this.pickedUser.userId}],false)});this.pickedUser=undefined;this.userQuery="";this.permissionsChanged.emit(this.permissions)}};e.prototype.getRoles=function(){var e=this;var t=this.roles.filter((function(t){return!e.permissions.rolePermissions.some((function(e){return e.roleId==t.RoleId}))}));if(this.selectedRoleGroupId==-2){return t}if(this.selectedRoleGroupId==-1){return t.filter((function(e){return e.IsSystemRole}))}return t.filter((function(t){return t.RoleGroupId==e.selectedRoleGroupId}))};e.prototype.renderRoleCheckBox=function(e,t){var n=this;var r=e.permissions.filter((function(e){return e.permissionId==t.permissionId}))[0];if(e.locked){return o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("g",{fill:"none"},o("path",{d:"M0 0h24v24H0V0z"}),o("path",{d:"M0 0h24v24H0V0z",opacity:".87"})),o("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"}))}var i=r==undefined?"intermediate":r.allowAccess?"checked":"unchecked";return o("dnn-checkbox",{"use-intermediate":true,checked:i,onCheckedchange:function(o){return n.handleRoleChanged(o.detail,e,t)}},o("div",{slot:"intermediateicon"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))),o("div",{slot:"uncheckedicon"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"}))),o("span",null,t.permissionName))};e.prototype.renderUserCheckBox=function(e,t){var n=this;var r=e.permissions.filter((function(e){return e.permissionId==t.permissionId}))[0];var i=r==undefined?"intermediate":r.allowAccess?"checked":"unchecked";return o("dnn-checkbox",{"use-intermediate":true,checked:i,onCheckedchange:function(o){return n.handleUserChanged(o.detail,e,t)}},o("div",{slot:"intermediateicon"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))),o("div",{slot:"uncheckedicon"},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"}))),o("span",null,t.permissionName))};e.prototype.handleRoleChanged=function(e,t,n){switch(e){case"unchecked":this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.map((function(e){if(e.roleId!=t.roleId){return e}var o=Object.assign({},e);o.permissions=__spreadArray(__spreadArray([],o.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:false,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return o})),true)});break;case"checked":this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.map((function(e){if(e.roleId!=t.roleId){return e}var o=Object.assign({},e);o.permissions=__spreadArray(__spreadArray([],o.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:true,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return o})),true)});break;case"intermediate":this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.map((function(e){if(e.roleId!=t.roleId){return e}var o=Object.assign({},e);o.permissions=__spreadArray([],o.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true);return o})),true)});break}this.permissionsChanged.emit(this.permissions)};e.prototype.handleUserChanged=function(e,t,n){switch(e){case"unchecked":this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.map((function(e){if(e.userId!=t.userId){return e}var o=Object.assign({},e);o.permissions=__spreadArray(__spreadArray([],o.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:false,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return o})),true)});break;case"checked":this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.map((function(e){if(e.userId!=t.userId){return e}var o=Object.assign({},e);o.permissions=__spreadArray(__spreadArray([],o.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true),[{allowAccess:true,fullControl:false,permissionCode:n.permissionCode,permissionId:n.permissionId,permissionKey:n.permissionKey,permissionName:n.permissionName,view:false}],false);return o})),true)});break;case"intermediate":this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.map((function(e){if(e.userId!=t.userId){return e}var o=Object.assign({},e);o.permissions=__spreadArray([],o.permissions.filter((function(e){return e.permissionId!=n.permissionId})),true);return o})),true)});break}this.permissionsChanged.emit(this.permissions)};e.prototype.removeRole=function(e){this.permissions=Object.assign(Object.assign({},this.permissions),{rolePermissions:__spreadArray([],this.permissions.rolePermissions.filter((function(t){return t.roleId!=e.roleId})),true)});this.permissionsChanged.emit()};e.prototype.removeUser=function(e){this.permissions=Object.assign(Object.assign({},this.permissions),{userPermissions:__spreadArray([],this.permissions.userPermissions.filter((function(t){return t.userId!=e.userId})),true)});this.permissionsChanged.emit(this.permissions)};e.prototype.handleQueryChanged=function(e){this.userQuery=e;if(e==undefined||e.length==0){this.userCollapsible.expanded=false;this.pickedUser=undefined;this.foundUsers=[];return}this.userSearchQueryChanged.emit(e)};e.prototype.handleSearchUserFieldKeyDown=function(e){if(e.key!="ArrowDown"){return}e.preventDefault();var t=this.userCollapsible.querySelector("button");if(t!=undefined){t.focus()}};e.prototype.handleSearchedUserKeyDown=function(e){var t=e.target;switch(e.key){case"ArrowDown":e.preventDefault();var n=t.nextElementSibling;n===null||n===void 0?void 0:n.focus();break;case"ArrowUp":e.preventDefault();var o=t.previousElementSibling;o===null||o===void 0?void 0:o.focus();break}};e.prototype.handleUserPicked=function(e){this.userQuery=e.displayName;this.pickedUser=e};e.prototype.getFilteredUsers=function(){var e=this;return this.foundUsers.filter((function(t){return!e.permissions.userPermissions.some((function(e){return e.userId==t.userId}))}))};e.prototype.render=function(){var e=this;var t=this.getRoles();return o(r,null,o("div",{class:"add-role-row"},o("div",{class:"dropdown"},o("label",null,this.resx.FilterByGroup," :"),o("select",{onChange:function(t){return e.handleRoleGroupChanged(t.target)}},o("option",{value:-2,selected:this.selectedRoleGroupId==-2},this.resx.AllRoles),o("option",{value:-1,selected:this.selectedRoleGroupId==-1},this.resx.GlobalRoles),this.roleGroups.map((function(t){return o("option",{value:t.id,selected:e.selectedRoleGroupId==t.id},t.name)})))),t&&t.length>0&&[o("div",{class:"dropdown"},o("label",null,this.resx.SelectRole," :"),o("select",{ref:function(t){return e.roleDropDown=t}},this.getRoles().map((function(e){return o("option",{value:e.RoleId},e.RoleName)})))),o("dnn-button",{type:"primary",onClick:function(){return e.addRole()}},this.resx.Add)]),o("table",{class:"roles-table"},o("caption",null,this.resx.RolePermissions),o("thead",null,o("tr",null,o("th",null,this.resx.Role),this.permissions.permissionDefinitions.map((function(e){return o("th",null,e.permissionName)})),o("th",null," "))),o("tbody",null,this.permissions.rolePermissions.map((function(t){return o("tr",null,o("th",null,t.roleName),e.permissions.permissionDefinitions.map((function(n){return o("td",null,e.renderRoleCheckBox(t,n))})),o("td",null,!t.default&&o("button",{onClick:function(){return e.removeRole(t)}},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})))))})))),o("div",{class:"search-user"},o("div",{class:"search-control"},o("dnn-searchbox",{placeholder:this.resx.User,debounced:true,onQueryChanged:function(t){return e.handleQueryChanged(t.detail)},onKeyDown:function(t){return e.handleSearchUserFieldKeyDown(t)},query:this.userQuery}),o("dnn-collapsible",{ref:function(t){return e.userCollapsible=t}},o("div",{class:"dropdown"},this.getFilteredUsers().map((function(t){return o("button",{onKeyDown:function(t){return e.handleSearchedUserKeyDown(t)},onClick:function(){return e.handleUserPicked(t)}},t.displayName)}))))),this.pickedUser&&o("dnn-button",{onClick:function(){return e.addUser()}},this.resx.Add)),this.permissions.userPermissions&&this.permissions.userPermissions.length>0&&o("table",{class:"users-table"},o("caption",null,this.resx.UserPermissions),o("thead",null,o("tr",null,o("th",null,this.resx.User),this.permissions.permissionDefinitions.map((function(e){return o("th",null,e.permissionName)})),o("th",null," "))),o("tbody",null,this.permissions.userPermissions.map((function(t){return o("tr",null,o("th",null,t.displayName),e.permissions.permissionDefinitions.map((function(n){return o("td",null,e.renderUserCheckBox(t,n))})),o("td",null,o("button",{onClick:function(){return e.removeUser(t)}},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0V0z",fill:"none"}),o("path",{d:"M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})))))})))))};Object.defineProperty(e,"watchers",{get:function(){return{foundUsers:["handleFoundUsersChanged"]}},enumerable:false,configurable:true});return e}());S.style=_;var z=":host{position:relative;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;--background-color:transparent;--color:#333;--border-size:1px;--border-color:grey;--border-active-color:black;--border-radius:var(--dnn-controls-radius, 5px);--padding:var(--dnn-controls-padding, 5px);--focus-color:var(--dnn-color-primary, blue)}:host input{width:100%;border:var(--border-size) solid var(--border-color);outline:none;border-radius:var(--border-radius);padding:var(--padding);padding-right:32px;-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}:host input:focus,:host input:hover{outline:none;-webkit-box-shadow:0 0 2px 2px var(--focus-color);box-shadow:0 0 2px 2px var(--focus-color)}:host svg{position:absolute;top:0;right:0;height:100%;-webkit-transform:scale(0.7);transform:scale(0.7);fill:var(--color);outline:var(--color);color:var(--color);-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}:host button{background:transparent;border:0;margin:0;padding:0}:host button:focus svg,:host button:hover svg{fill:var(--focus-color);outline:var(--focus-color);color:var(--focus-color)}";var I=undefined&&undefined.__decorate||function(e,t,n,o){var r=arguments.length,i=r<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect==="object"&&typeof Reflect.decorate==="function")i=Reflect.decorate(e,t,n,o);else for(var a=e.length-1;a>=0;a--)if(s=e[a])i=(r<3?s(i):r>3?s(t,n,i):s(t,n))||i;return r>3&&i&&Object.defineProperty(t,n,i),i};var H=e("dnn_searchbox",function(){function e(e){t(this,e);this.queryChanged=n(this,"queryChanged",7);this.placeholder="";this.debounced=true;this.query=""}e.prototype.fireQueryChanged=function(){if(this.debounced){this.debouncedHandleQueryChanged()}else{this.handleQueryChanged()}};e.prototype.handleQueryChanged=function(){this.queryChanged.emit(this.query)};e.prototype.debouncedHandleQueryChanged=function(){this.handleQueryChanged()};e.prototype.render=function(){var e=this;return o(r,null,o("input",{type:"text",value:this.query,placeholder:this.placeholder,onInput:function(t){return e.query=t.target.value}}),this.query!==""?o("button",{class:"svg clear",onClick:function(){return e.query=""}},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}))):o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})))};Object.defineProperty(e,"watchers",{get:function(){return{query:["fireQueryChanged"]}},enumerable:false,configurable:true});return e}());I([s(500)],H.prototype,"debouncedHandleQueryChanged",null);H.style=z;var E=":host{--color:#888;--color-sorted:var(--dnn-color-primary, rgb(2,139,255));--color-hover:var(--dnn-color-primary-light, #36a1ff);display:inline-block}button{outline:none;border:none;margin:0;padding:0;background-color:transparent;outline:none;display:inline-block;line-height:1em;position:relative;top:0.25em}button svg{height:1.5em;width:auto;fill:var(--color)}button.active svg{fill:var(--color-sorted)}button:hover svg,button:focus svg{fill:var(--color-hover)}";var P=e("dnn_sort_icon",function(){function e(e){t(this,e);this.sortChanged=n(this,"sortChanged",7);this.sortDirection="none"}e.prototype.changeSort=function(){switch(this.sortDirection){case"asc":this.sortDirection="desc";break;case"desc":this.sortDirection="asc";break;case"none":this.sortDirection="asc";break}this.sortChanged.emit(this.sortDirection)};e.prototype.render=function(){var e=this;return o(r,null,o("button",{class:{active:this.sortDirection!="none"},onClick:function(){return e.changeSort()}},this.sortDirection=="none"&&o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},o("path",{d:"M 0 7 H 12 L 6 0 Z M 0 9 H 12 L 6 16 Z"})),this.sortDirection=="asc"&&o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},o("path",{d:"M 0 7 H 12 L 6 0 Z"})),this.sortDirection=="desc"&&o("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 16"},o("path",{d:"M 0 9 H 12 L 6 16 Z"}))))};return e}());P.style=E;var R="";var T=e("dnn_tab",function(){function e(e){t(this,e);this.visible=false}e.prototype.show=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=true;return[2]}))}))};e.prototype.hide=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.visible=false;return[2]}))}))};e.prototype.render=function(){return o(r,null,this.visible&&o("slot",null))};return e}());T.style=R;var j=":host{display:block;--color-background:var(--dnn-color-secondary-dark, lightgray);--color-text:var(--dnn-color-secondary-contrast, #333);--color-visible:var(--dnn-color-primary, #3792ED);--color-visible-text:var(--dnn-color-primary-contrast, #FFF);--color-focus:var(--dnn-color-primary, #3792ed)}.tabTitles{display:-ms-flexbox;display:flex;background-color:var(--color-background);color:var(--color-text)}.tabTitles button{padding:0.5rem 1rem;border:0;margin:0;background-color:transparent}.tabTitles button.visible{background-color:var(--color-visible);color:var(--color-bisible-text)}.tabTitles button:focus,.tabTitles button:hover{outline:none;-webkit-box-shadow:0 0 2px 2px var(--color-focus);box-shadow:0 0 2px 2px var(--color-focus)}.currentTab{border:1px solid var(--color-background)}";var F=e("dnn_tabs",function(){function e(e){t(this,e);this.tabTitles=[];this.selectedTabTitle=""}e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){e.updateTitles();e.showFirstTab()}))};e.prototype.getTabs=function(){return this.component.shadowRoot.querySelector("slot").assignedElements()};e.prototype.updateTitles=function(){var e=this;var t=this.getTabs();t.forEach((function(t){return e.tabTitles=__spreadArray(__spreadArray([],e.tabTitles,true),[t.tabTitle],false)}))};e.prototype.showFirstTab=function(){var e=this.getTabs()[0];e.show();this.selectedTabTitle=e.tabTitle};e.prototype.showTab=function(e){var t=this.getTabs();t.forEach((function(t){if(t.tabTitle==e){t.show();return}t.hide()}));this.selectedTabTitle=e};e.prototype.render=function(){var e=this;return o(r,{ref:function(t){return e.component=t}},o("div",{class:"tabTitles"},this.tabTitles.map((function(t){return o("button",{class:e.selectedTabTitle==t?"visible":"",onClick:function(){return e.showTab(t)}},t)}))),o("div",{class:"currentTab"},o("slot",null)))};return e}());F.style=j;var A=":host{display:inline-block;outline:none;cursor:pointer}button{height:1.5em;width:2.5em;outline:none;background-color:var(--background, #888);border:0;border-radius:var(--border-radius, var(--dnn-controls-radius, 0.75em));padding:0.1em;position:relative;margin:0;-webkit-transition:background-color 300ms ease-in-out;transition:background-color 300ms ease-in-out;position:relative;cursor:pointer}button:hover,button:focus{-webkit-box-shadow:0 0 2px 2px var(--dnn-color-primary);box-shadow:0 0 2px 2px var(--dnn-color-primary)}button.checked{background-color:var(--background-checked, var(--dnn-color-primary, blue))}button.checked .handle{left:calc(1em + 4px)}button:disabled{opacity:0.5;cursor:not-allowed;-webkit-box-shadow:none;box-shadow:none}button .handle{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out;background-color:white;width:1em;height:1em;border-radius:var(--handle-border-radius, var(--dnn-controls-radius, 50%));position:absolute;top:calc(50% - 0.5em);left:2px}";var B=e("dnn_toggle",function(){function e(e){t(this,e);this.checkChanged=n(this,"checkChanged",7);this.checked=false;this.disabled=false}e.prototype.checkedChanged=function(e){this.checkChanged.emit({checked:e})};e.prototype.render=function(){var e=this;return o(r,null,o("button",{disabled:this.disabled,class:{checked:this.checked},onClick:function(){if(!e.disabled){e.checked=!e.checked}}},o("div",{class:"handle"})))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{checked:["checkedChanged"]}},enumerable:false,configurable:true});return e}());B.style=A;var O=":host{display:-ms-flexbox;display:flex;overflow:visible}.expander{width:24px;height:24px}.expander button{-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out;background-color:transparent;border:none;padding:0;margin:0;height:1em;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;position:relative;top:2px}.expander button svg :first-child{-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out;fill:white;stroke:black}.expander.expanded button{-webkit-transform:rotate(45deg);transform:rotate(45deg)}.expander.expanded button svg :first-child{fill:black;stroke:black}div.item .item-slot{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:0.25em;min-height:24px}div.item div.children{overflow:hidden;height:0;-webkit-transition:all 150ms ease-in-out;transition:all 150ms ease-in-out}";var U=e("dnn_treeview_item",function(){function e(e){t(this,e);this.userExpanded=n(this,"userExpanded",3);this.userCollapsed=n(this,"userCollapsed",3);this.expanded=false;this.hasChildren=false}e.prototype.watchExpanded=function(e){if(e){this.expander.classList.add("expanded");this.collapsible.expanded=true;return}this.expander.classList.remove("expanded");this.collapsible.expanded=false};e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){var t=e.childElement.children[0];var n=t.assignedElements().length;if(n>0){e.hasChildren=true}if(e.expanded){e.expander.classList.add("expanded");e.collapsible.expanded=false;setTimeout((function(){e.collapsible.expanded=true}),300)}}))};e.prototype.toggleCollapse=function(){this.expanded=!this.expanded;if(this.expanded){this.expander.classList.add("expanded");this.userExpanded.emit();return}this.expander.classList.remove("expanded");this.userCollapsed.emit()};e.prototype.render=function(){var e=this;return o(r,null,o("div",{class:"expander",ref:function(t){return e.expander=t}},this.hasChildren&&o("button",{onClick:function(){return e.toggleCollapse()}},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M10 17l5-5-5-5v10z"}),o("path",{d:"M0 24V0h24v24H0z",fill:"none"})))),o("div",{class:"item"},o("div",{class:"item-slot"},o("slot",null)),o("dnn-collapsible",{ref:function(t){return e.collapsible=t},expanded:this.expanded},o("div",{ref:function(t){return e.childElement=t}},o("slot",{name:"children"})))))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{expanded:["watchExpanded"]}},enumerable:false,configurable:true});return e}());U.style=O;var V=":host{--background-color:var(--dnn-color-primary-contrast, white);--foreground-color:var(--dnn-color-primary, #3792ED);display:block}.menu-container{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;background-color:var(--background-color)}.menu-container .menu{margin:0.5em;display:-ms-flexbox;display:flex;gap:1em;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-align:center;align-items:center;white-space:nowrap;width:100%}.menu-container .overflow{margin-left:auto;position:relative}.menu-container .overflow button{cursor:pointer;padding:0;margin:0;background-color:transparent;border:none}.menu-container .overflow button svg{fill:var(--foreground-color)}.menu-container .overflow .dropdown{position:absolute;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;white-space:nowrap;right:0;-webkit-transition:100ms ease-in-out;transition:100ms ease-in-out;height:0;overflow:hidden}.menu-container .overflow .dropdown.visible{padding:1em;gap:0.5em;background-color:var(--background-color);-webkit-box-shadow:2px 2px 4px rgba(0, 0, 0, 0.7);box-shadow:2px 2px 4px rgba(0, 0, 0, 0.7)}";var W=e("dnn_vertical_overflow_menu",function(){function e(e){t(this,e);this.showDropdownButton=false;this.showDropdownMenu=false;this.previousMenuWidth=0}e.prototype.componentDidRender=function(){var e=this;requestAnimationFrame((function(){e.moveItemsToDropDownIfNecessery();e.resizeObserver=new ResizeObserver((function(t){for(var n=0,o=t;n<o.length;n++){var r=o[n];if(r.contentRect.width<e.previousMenuWidth){e.moveItemsToDropDownIfNecessery()}if(e.previousMenuWidth>0&&r.contentRect.width>e.previousMenuWidth){e.moveItemsToMenuIfPossible()}e.previousMenuWidth=r.contentRect.width}}));e.resizeObserver.observe(e.element)}))};e.prototype.moveItemsToDropDownIfNecessery=function(){var e=this;var t=Array.from(this.menu.querySelector("slot").assignedElements());var n=this.menu.getBoundingClientRect().width;var o=parseFloat(getComputedStyle(this.element).fontSize)*2;t.forEach((function(t){return o+=e.getFullWidth(t)}));o+=(t.length-1)*parseFloat(getComputedStyle(this.element).fontSize);if(o>n){this.showDropdownButton=true;var r=t[t.length-1];if(this.dropdown==undefined){return}r.slot="dropdown";this.moveItemsToDropDownIfNecessery()}};e.prototype.moveItemsToMenuIfPossible=function(){var e=this;if(this.dropdown==undefined||!this.dropdown.hasChildNodes()){return}var t=Array.from(this.menu.querySelector("slot").assignedElements());var n=this.menu.getBoundingClientRect().width;var o=parseFloat(getComputedStyle(this.element).fontSize)*2;o+=(t.length-1)*parseFloat(getComputedStyle(this.element).fontSize);t.forEach((function(t){return o+=e.getFullWidth(t)}));var r=this.dropdown.querySelector("slot").assignedElements()[0];if(r!=undefined){o+=this.getFullWidth(r)}if(o<n){if(r!=undefined){r.slot=""}if(r==undefined){this.dropdown.classList.remove("visible");this.showDropdownMenu=false;this.showDropdownButton=false}}};e.prototype.getFullWidth=function(e){var t=e.getBoundingClientRect().width;var n=getComputedStyle(e);t+=parseFloat(n.marginLeft);t+=parseFloat(n.marginRight);t+=parseFloat(n.paddingLeft);t+=parseFloat(n.paddingRight);return t};e.prototype.toggleOverflowMenu=function(){var e=this;this.showDropdownMenu=!this.showDropdownMenu;if(this.showDropdownMenu){this.dropdown.classList.add("visible");var t=0;var n=Array.from(this.dropdown.querySelector("slot").assignedElements());n.forEach((function(e){return t+=e.getBoundingClientRect().height}));var o=parseFloat(getComputedStyle(this.dropdown).fontSize);var r=o*(this.dropdown.children.length-1)/2;t+=r;var i=o*2;t+=i;this.dropdown.style.height="".concat(t,"px");var s=function(t){var n=e.button.getBoundingClientRect();if(t.clientX<n.left||t.clientX>n.right||t.clientY<n.top||t.clientY>n.bottom){e.toggleOverflowMenu()}document.removeEventListener("click",s)};setTimeout((function(){document.addEventListener("click",s,false)}),100)}else{this.dropdown.classList.remove("visible");this.dropdown.style.height="0px"}};e.prototype.render=function(){var e=this;return o(r,null,o("div",{class:"menu-container"},o("div",{class:"menu",ref:function(t){return e.menu=t}},o("slot",null)),this.showDropdownButton&&o("div",{class:"overflow"},o("button",{ref:function(t){return e.button=t},class:"icon",onClick:function(){return e.toggleOverflowMenu()}},o("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#000000"},o("path",{d:"M0 0h24v24H0z",fill:"none"}),o("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}))),o("div",{class:"dropdown",ref:function(t){return e.dropdown=t}},o("slot",{name:"dropdown"})))))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());W.style=V;var N=":host{display:-ms-flexbox;display:flex;-ms-flex-align:stretch;align-items:stretch;margin:0 auto;position:relative;--left-pane-background-color:transparent;--right-pane-background-color:transparent}button{border:none;margin:0;padding:0;cursor:ew-resize;position:absolute;height:100%;background-color:transparent}button.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane{overflow-y:auto}.pane.transition{-webkit-transition:all 300ms ease-in-out;transition:all 300ms ease-in-out}.pane.left{background-color:var(--left-pane-background-color)}.pane.right{background-color:var(--right-pane-background-color);-ms-flex-positive:1;flex-grow:1}";var q=e("dnn_vertical_splitview",function(){function e(e){t(this,e);this.widthChanged=n(this,"widthChanged",7);this.splitterWidth=16;this.splitWidthPercentage=30;this.leftWidth=0;this.rightWidth=0}e.prototype.setSplitWidthPercentage=function(e){return __awaiter(this,void 0,void 0,(function(){var t;var n=this;return __generator(this,(function(o){t=this.element.shadowRoot.querySelectorAll(".pane");requestAnimationFrame((function(){t.forEach((function(e){return e.classList.add("transition")}));n.splitter.classList.add("transition");requestAnimationFrame((function(){var o=n.element.getBoundingClientRect().width;var r=o*e/100;if(r<0){r=0}if(r>o){r=o}n.leftWidth=r;n.rightWidth=o-r;setTimeout((function(){t.forEach((function(e){return e.classList.remove("transition")}));n.splitter.classList.remove("transition")}),300)}))}));return[2]}))}))};e.prototype.getSplitWidthPercentage=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=this.element.getBoundingClientRect().width;return[2,this.leftWidth/e]}))}))};e.prototype.componentDidLoad=function(){var e=this;requestAnimationFrame((function(){e.resizeObserver=new ResizeObserver((function(){var t=e.element.getBoundingClientRect().width;e.leftWidth=t*e.splitWidthPercentage/100;e.rightWidth=t-e.leftWidth;e.widthChanged.emit(e.splitWidthPercentage)}));e.resizeObserver.observe(e.element)}))};e.prototype.handleMouseDown=function(e){var t=this;e.preventDefault();var n=function(e){requestAnimationFrame((function(){var n=t.element.getBoundingClientRect().width;var o=k(e,t.previousTouch).movementX;var r=t.leftWidth+o;if(r<0){r=0}if(r>n){r=n}t.leftWidth=r;t.rightWidth=n-r;t.splitWidthPercentage=t.leftWidth/n*100}))};var o=function(){document.removeEventListener("mousemove",n);document.removeEventListener("touchmove",n);var e=t.element.getBoundingClientRect().width;var o=t.leftWidth/e*100;t.widthChanged.emit(o)};document.addEventListener("mouseup",o);document.addEventListener("touchend",o);document.addEventListener("mousemove",n);document.addEventListener("touchmove",n)};e.prototype.handleKeyDown=function(e){var t=0;switch(e.key){case"ArrowLeft":t=-10;break;case"ArrowRight":t=10;break;default:return}if(e.shiftKey){t=t*10}var n=this.element.getBoundingClientRect().width;var o=this.leftWidth+t;if(o<0){o=0}if(o>n){o=n}this.leftWidth=o;this.rightWidth=n-this.leftWidth};e.prototype.render=function(){var e=this;return o(r,null,o("div",{class:"left pane",style:{width:"".concat(this.leftWidth,"px")}},o("slot",{name:"left"})),o("button",{onMouseDown:function(t){return e.handleMouseDown(t)},onTouchStart:function(t){return e.handleMouseDown(t)},onKeyDown:function(t){return e.handleKeyDown(t)},ref:function(t){return e.splitter=t},style:{minWidth:"".concat(this.splitterWidth.toString(),"px"),left:"".concat(this.leftWidth-2,"px")}},o("slot",null)),o("div",{class:"right pane",style:{width:"".concat(this.rightWidth,"px")}},o("slot",{name:"right"})))};Object.defineProperty(e.prototype,"element",{get:function(){return i(this)},enumerable:false,configurable:true});return e}());q.style=N}}}));
|
|
11
|
+
//# sourceMappingURL=p-2a79ad5b.system.entry.js.map
|