/*!
 * 
 * [Dojo](https://dojo.io/)
 * Copyright [JS Foundation](https://js.foundation/) & contributors
 * [New BSD license](https://github.com/dojo/meta/blob/master/LICENSE)
 * All rights reserved
 * 
 */
(window.dojoWebpackJsonpdojo_widgets_custom_elements=window.dojoWebpackJsonpdojo_widgets_custom_elements||[]).push([[58,33],{104:function(e,t,o){e.exports={" _key":"@dojo/widgets/trigger-popup",root:"trigger-popup-m__root__2S7Kv",trigger:"trigger-popup-m__trigger__2isxr"}},25:function(e,t,o){"use strict";o.r(t),o.d(t,"Popup",function(){return l});var n=o(88),r=o(106),s=o(80),i=o(92),c=o(5),a=o(93),p=o(94);const l=Object(c.a)({dimensions:n.b,theme:s.a,bodyScroll:i.a,resize:r.b}).properties().children()(function({properties:e,children:t,middleware:{dimensions:o,theme:n,bodyScroll:r,resize:s}}){const{underlayVisible:i=!1,yBottom:l,yTop:d,xRight:u,xLeft:m,onClose:h,open:g}=e();let{position:y="below"}=e();s.get("wrapper");const f=o.get("wrapper"),b=document.documentElement.scrollTop+document.documentElement.clientHeight,v=document.documentElement.scrollTop,_=document.documentElement.clientWidth,j=d+f.size.height<=b,w=l-f.size.height>=v,O=m-f.size.width>=0,$=u+f.size.width<=_;let x={opacity:"0"};if(f.size.height){if(x={left:`${m}px`,opacity:"1"},"below"===y?x.top=j?`${d}px`:`${l-f.size.height}px`:"above"===y&&(x.top=w?`${l-f.size.height}px`:`${d}px`),"left"===y||"right"===y){const e=d-l;x.top=`${Math.max(l+e/2-f.size.height/2,v)}px`}"left"===y?x.left=O?`${m-f.size.width}px`:`${u}px`:"right"===y&&(x.left=$?`${u}px`:`${m-f.size.width}px`)}const k=n.classes(a),[z]=t(),C="function"==typeof z?z(y):z;return r(!g),g&&Object(c.m)("body",null,Object(c.m)("div",{key:"underlay",classes:[n.variant(),p.underlay,i&&k.underlayVisible],onclick:h}),Object(c.m)("div",{key:"wrapper",classes:[n.variant(),p.root],styles:x},C))});t.default=l},27:function(e,t,o){"use strict";o.r(t),o.d(t,"TriggerPopup",function(){return d});var n=o(91),r=o(88),s=o(5),i=o(25),c=o(104),a=o(80),p=o(82);const l=Object(p.a)(),d=Object(s.a)({dimensions:r.b,icache:l,theme:a.a}).properties().children()(function({properties:e,children:t,middleware:{dimensions:o,icache:r,theme:a}}){const p=e(),{matchWidth:l=!0,onOpen:d,classes:u}=p,m=n.d(p,["matchWidth","onOpen","classes"]),{position:h,size:g}=o.get("trigger"),y=h.top+document.documentElement.scrollTop,f=y+g.height,b=a.classes(c),v={width:l?`${g.width}px`:"auto"},{trigger:_,content:j}=t()[0],w=()=>{const{onClose:t}=e();r.set("open",!1),t&&t()};return Object(s.m)("virtual",{classes:[b.root]},Object(s.m)("span",{key:"trigger",classes:c.trigger},_(()=>{const{onOpen:t}=e();r.set("open",!r.get("open")),t&&t()})),Object(s.m)(i.default,Object.assign({key:"popup"},m,{classes:u,yTop:f,yBottom:y,xLeft:h.left,xRight:h.right,onClose:w,open:r.get("open")}),e=>Object(s.m)("div",{key:"trigger-wrapper",styles:v},j(w,e))))});t.default=d},80:function(e,t,o){"use strict";o.d(t,"b",function(){return p});var n=o(5),r=o(83),s=o(12);const i=Object(n.a)({coreTheme:r.a}).properties();function c(e){return`${e.charAt(0).toUpperCase()}${e.slice(1)}`}function a(e){return e&&e.hasOwnProperty("variant")}const p=i(function({middleware:{coreTheme:e},properties:t}){const{variant:o,get:n,set:r,classes:i}=e;return{compose:(o,n,r)=>{const i=function(){const{theme:o}=t();if(o)return o;const n=e.get();return Object(s.c)(n)?{theme:n.theme,variant:n.variant}:n?n.theme:void 0}(),p=o[" _key"],l=n[" _key"],d=Object.keys(o).reduce((e,t)=>" _key"===t?e:(r&&!e[`${r}${c(t)}`]&&(e[`${r}${c(t)}`]=" "),n[t]||(e[t]=" "),e),{" _key":l}),u=e.classes(d),m=e.classes(n);let h=e.classes(o);if(r){const e=Object.keys(Object.assign({},u,m)).reduce((e,t)=>{if(0===t.indexOf(r)&&t!==r){const o=function(e){return`${e.charAt(0).toLowerCase()}${e.slice(1)}`}(t.replace(r,"")),n="string"==typeof m[t]&&m[t].trim(),s="string"==typeof u[t]&&u[t].trim();!n&&s&&(e[o]=`${h[o]} ${s}`),n&&(e[o]=m[t])}return e},{});return h=Object.assign({},h,e),a(i)?{theme:{theme:Object.assign({},i.theme.theme,{[p]:h}),variants:i.theme.variants},variant:i.variant}:Object.assign({},i,{[p]:h})}const g=Object.keys(h).reduce((e,t)=>{if(" _key"===t)return e;const o="string"==typeof m[t]&&m[t].trim(),n="string"==typeof u[t]&&u[t].trim();return o?e[t]=o:n&&(e[t]=`${e[t]} ${n}`),e},Object.assign({},h));return a(i)?{theme:{theme:Object.assign({},i.theme.theme,{[p]:g}),variants:i.theme.variants},variant:i.variant}:Object.assign({},i,{[p]:g})},variant:()=>"inherit"===t().variant?void 0:o(),get:n,set:r,classes:i}});t.a=p},92:function(e,t,o){"use strict";o.d(t,"a",function(){return c});var n=o(5),r=o(0);const s=Object(n.a)({destroy:n.c}),i=r.a.document.body.style,c=s(function({middleware:{destroy:e}}){let t=!1,o=void 0;const n=()=>{t&&(o?i.setProperty("overflow",o):i.removeProperty("overflow"),t=!1,o=void 0)};return e(()=>{t&&n()}),e=>{e?n():t||(t=!0,o=i.getPropertyValue("overflow"),i.setProperty("overflow","hidden"))}});t.b=c},93:function(e,t,o){e.exports={" _key":"@dojo/widgets/popup",underlayVisible:"popup-m__underlayVisible__1Cxv3"}},94:function(e,t,o){e.exports={" _key":"@dojo/widgets/popup",root:"popup-m__root__3WJlO",underlay:"popup-m__underlay__2CC_p"}}}]);
//# sourceMappingURL=trigger-popup-8.0.0-beta.12.js.map