1import{$b as Y,$c as te,Aa as H,Ab as O,Ca as z,Cb as J,Da as S,Fa as l,Gc as T,Lb as C,Mb as f,Na as Q,Nb as u,Nc as ee,Ob as L,Qa as q,Ta as F,Vb as I,Xb as w,Zb as E,_b as X,ab as K,bc as Z,cb as R,cc as y,dc as b,fb as G,ic as B,id as ie,jb as U,kb as m,kd as ne,mb as M,mc as j,ob as W,pb as $,qa as v,ra as N,sd as se,ta as h,tb as D,ua as P,ud as A,ya as k,za as x}from"./chunk-PMSJWPYZ.js";var oe=["dynamicContent"],re=["nsmContent"],le=["nsmDialog"],de=["nsmOverlay"],ce=["*"],he=(n,g)=>({transparent:n,overlay:!0,"nsm-overlay-open":g}),fe=(n,g)=>["nsm-dialog",n,g];function me(n,g){}function ue(n,g){if(n&1){let e=I();f(0,"button",10),w("click",function(){k(e);let s=E(2);return x(s.close())}),H(),f(1,"svg",11)(2,"title",12),j(3,"Close Icon"),u(),f(4,"desc",13),j(5,"A light-gray close icon used to close the modal"),u(),f(6,"g"),L(7,"path",14),u(),f(8,"g"),L(9,"path",15),u()()()}}function ge(n,g){if(n&1){let e=I();f(0,"div",5,0),w("click",function(s){k(e);let i=E();return x(i.dismiss(s))}),f(2,"div",6,1)(4,"div",7,2)(6,"div",8),D(7,me,0,0,"ng-template",null,3,ee),Y(9),u(),D(10,ue,10,0,"button",9),u()()()}if(n&2){let e=E();B("z-index",e.visible?e.layerPosition-1:-1),C("ngClass",T(11,he,!e.backdrop,e.openedClass)),R(2),B("z-index",e.visible?e.layerPosition:-1),C("ngClass",T(14,fe,e.customClass,e.openedClass?"nsm-dialog-open":"nsm-dialog-close")),J("aria-hidden",!e.openedClass)("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledBy)("aria-describedby",e.ariaDescribedBy),R(8),C("ngIf",e.closable)}}var d={bodyClassOpen:"dialog-open",prefixEvent:"ngx-smart-modal."},pe=(()=>{class n{constructor(e,t,s,i,r,c){this._renderer=e,this._changeDetectorRef=t,this._viewContainerRef=s,this.elementRef=i,this._document=r,this._platformId=c,this.closable=!0,this.escapable=!0,this.dismissable=!0,this.identifier="",this.customClass="nsm-dialog-animation-fade",this.visible=!1,this.backdrop=!0,this.force=!0,this.hideDelay=500,this.autostart=!1,this.target="",this.ariaLabel=null,this.ariaLabelledBy=null,this.ariaDescribedBy=null,this.refocus=!0,this.visibleChange=new l,this.onClose=new l,this.onCloseFinished=new l,this.onDismiss=new l,this.onDismissFinished=new l,this.onAnyCloseEvent=new l,this.onAnyCloseEventFinished=new l,this.onOpen=new l,this.onOpenFinished=new l,this.onEscape=new l,this.onDataAdded=new l,this.onDataRemoved=new l,this.layerPosition=1041,this.overlayVisible=!1,this.openedClass=!1,this.createFrom="html"}ngOnInit(){if(!this.identifier||!this.identifier.length)throw new Error("identifier field isn\u2019t set. Please set one before calling <ngx-smart-modal> in a template.");this._sendEvent("create")}ngAfterViewChecked(){this.overlayVisible&&this.contentComponent&&this.dynamicContentContainer&&this.dynamicContentContainer.length===0&&this.createDynamicContent()}ngOnDestroy(){this._sendEvent("delete")}open(e){return this._sendEvent("open",{top:e}),this}close(){return this._sendEvent("close"),this}dismiss(e){return!this.dismissable||!e?.target?.classList.contains("overlay")?this:(this._sendEvent("dismiss"),this)}toggle(e){return this._sendEvent("toggle",{top:e}),this}addCustomClass(e){return this.customClass.length?this.customClass+=" "+e:this.customClass=e,this}removeCustomClass(e){return e?this.customClass=this.customClass.replace(e,"").trim():this.customClass="",this}isVisible(){return this.visible}hasData(){return this._data!==void 0}setData(e,t){return(!this.hasData()||this.hasData()&&t)&&(this._data=e,this.assignModalDataToComponentData(this._componentRef),this.onDataAdded.emit(this._data),this.markForCheck()),this}getData(){return this.assignComponentDataToModalData(this._componentRef),this._data}removeData(){return this._data=void 0,this.onDataRemoved.emit(!0),this.markForCheck(),this}addBodyClass(){return this._renderer.addClass(this._document.body,d.bodyClassOpen),this}removeBodyClass(){return this._renderer.removeClass(this._document.body,d.bodyClassOpen),this}markForCheck(){try{this._changeDetectorRef.detectChanges()}catch(e){}this._changeDetectorRef.markForCheck()}targetPlacement(){if(!this.isBrowser||!this.nsmDialog.length||!this.nsmContent.length||!this.nsmOverlay.length||!this.target)return!1;let e=this._document.querySelector(this.target);if(!e)return!1;let t=e.getBoundingClientRect(),s=this.nsmOverlay.first.nativeElement.getBoundingClientRect(),i=this.nsmContent.first.nativeElement.getBoundingClientRect(),r=this.nsmDialog.first.nativeElement.getBoundingClientRect(),c=parseInt(getComputedStyle(this.nsmContent.first.nativeElement).marginLeft,10),a=parseInt(getComputedStyle(this.nsmContent.first.nativeElement).marginTop,10),o=t.top-r.top-(i.height-t.height)/2,p=t.left-r.left-(i.width-t.width)/2;p+r.left+i.width+c*2>s.width?p=s.width-(r.left+i.width)-c*2:p+r.left<0&&(p=-r.left),o+r.top+i.height+a>s.height&&(o=s.height-(r.top+i.height)-a),this._renderer.setStyle(this.nsmContent.first.nativeElement,"top",(o<0?0:o)+"px"),this._renderer.setStyle(this.nsmContent.first.nativeElement,"left",p+"px")}_sendEvent(e,t){if(!this.isBrowser)return!1;let s={extraData:t,instance:{id:this.identifier,modal:this}},i=new CustomEvent(d.prefixEvent+e,{detail:s});return window.dispatchEvent(i)}get isBrowser(){return A(this._platformId)}createDynamicContent(){this.dynamicContentContainer.clear(),this._componentRef=this.dynamicContentContainer.createComponent(this.contentComponent),this.assignModalDataToComponentData(this._componentRef),this.markForCheck()}assignModalDataToComponentData(e){e&&Object.assign(e.instance,this._data)}assignComponentDataToModalData(e){e&&Object.assign(this._data,e.instance)}static{this.\u0275fac=function(t){return new(t||n)(m(U),m(te),m(M),m(q),m(S),m(F))}}static{this.\u0275cmp=W({type:n,selectors:[["ngx-smart-modal"]],viewQuery:function(t,s){if(t&1&&Z(oe,5,M)(re,5)(le,5)(de,5),t&2){let i;y(i=b())&&(s.dynamicContentContainer=i.first),y(i=b())&&(s.nsmContent=i),y(i=b())&&(s.nsmDialog=i),y(i=b())&&(s.nsmOverlay=i)}},hostBindings:function(t,s){t&1&&w("resize",function(){return s.targetPlacement()},K)},inputs:{closable:"closable",escapable:"escapable",dismissable:"dismissable",identifier:"identifier",customClass:"customClass",visible:"visible",backdrop:"backdrop",force:"force",hideDelay:"hideDelay",autostart:"autostart",target:"target",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",ariaDescribedBy:"ariaDescribedBy",refocus:"refocus"},outputs:{visibleChange:"visibleChange",onClose:"onClose",onCloseFinished:"onCloseFinished",onDismiss:"onDismiss",onDismissFinished:"onDismissFinished",onAnyCloseEvent:"onAnyCloseEvent",onAnyCloseEventFinished:"onAnyCloseEventFinished",onOpen:"onOpen",onOpenFinished:"onOpenFinished",onEscape:"onEscape",onDataAdded:"onDataAdded",onDataRemoved:"onDataRemoved"},standalone:!1,ngContentSelectors:ce,decls:1,vars:1,consts:[["nsmOverlay",""],["nsmDialog",""],["nsmContent",""],["dynamicContent",""],[3,"z-index","
1ngClass","click",4,"ngIf"],[3,"click","ngClass"],[3,"ngClass"],[1,"nsm-content"],[1,"nsm-body"],["type","button","aria-label","Close","class","nsm-dialog-btn-close",3,"click",4,"ngIf"],["type","button","aria-label","Close",1,"nsm-dialog-btn-close",3,"click"],["xmlns","http://www.w3.org/2000/svg","version","1.1","id","Layer_1","x","0px","y","0px","viewBox","0 0 512 512",0,"xml","space","preserve","width","16px","height","16px","role","img","aria-labelledby","closeIconTitle closeIconDesc"],["id","closeIconTitle"],["id","closeIconDesc"],["d","M505.943,6.058c-8.077-8.077-21.172-8.077-29.249,0L6.058,476.693c-8.077,8.077-8.077,21.172,0,29.249 C10.096,509.982,15.39,512,20.683,512c5.293,0,10.586-2.019,14.625-6.059L505.943,35.306 C514.019,27.23,514.019,14.135,505.943,6.058z","fill","currentColor"],["d","M505.942,476.694L35.306,6.059c-8.076-8.077-21.172-8.077-29.248,0c-8.077,8.076-8.077,21.171,0,29.248l470.636,470.636 c4.038,4.039,9.332,6.058,14.625,6.058c5.293,0,10.587-2.019,14.624-6.057C514.018,497.866,514.018,484.771,505.942,476.694z","fill","currentColor"]],template:function(t,s){t&1&&(X(),D(0,ge,11,17,"div",4)),t&2&&C("ngIf",s.overlayVisible)},dependencies:[ie,ne],encapsulation:2})}}return n})(),V=(()=>{class n{constructor(){this._modalStack=[]}addModal(e,t){if(t){let s=this._modalStack.findIndex(i=>i.id===e.id);s>-1?this._modalStack[s].modal=e.modal:this._modalStack.push(e);return}this._modalStack.push(e)}getModal(e){let t=this._modalStack.find(s=>s.id===e);if(t!==void 0)return t.modal;throw new Error(`Cannot find modal with identifier ${e}`)}getModalStack(){return this._modalStack}getOpenedModals(){return this._modalStack.filter(e=>e.modal.visible)}getTopOpenedModal(){if(!this.getOpenedModals().length)throw new Error("No modal is opened");return this.getOpenedModals().map(e=>e.modal).reduce((e,t)=>t.layerPosition>e.layerPosition?t:e,this.getOpenedModals()[0].modal)}getHigherIndex(){return Math.max(...this._modalStack.map(e=>e.modal.layerPosition),1041)+1}getModalStackCount(){return this._modalStack.length}removeModal(e){let t=this._modalStack.findIndex(i=>i.id===e);return t<0?void 0:this._modalStack.splice(t,1)[0]}static{this.\u0275fac=function(t){return new(t||n)}}static{this.\u0275prov=v({token:n,factory:n.\u0275fac})}}return n})(),_=(()=>{class n{constructor(e,t,s,i,r,c){this._appRef=e,this._injector=t,this._modalStack=s,this.applicationRef=i,this._document=r,this._platformId=c,this._escapeKeyboardEvent=a=>{if(a.key==="Escape")try{let o=this.getTopOpenedModal();return o.escapable?(o.onEscape.emit(o),this.closeLatestModal(),!0):!1}catch(o){return!1}return!1},this._trapFocusModal=a=>{if(a.key==="Tab")try{let o=this.getTopOpenedModal();return o.nsmDialog.first.nativeElement.contains(document.activeElement)||(a.preventDefault(),a.stopPropagation(),o.nsmDialog.first.nativeElement.focus()),!0}catch(o){return!1}return!1},this._addEvents()}addModal(e,t){this._modalStack.addModal(e,t)}getModal(e){return this._modalStack.getModal(e)}get(e){return this.getModal(e)}open(e,t=!1){return this._openModal(this.get(e),t)}close(e){return this._closeModal(this.get(e))}closeAll(){this.getOpenedModals().forEach(e=>{this._closeModal(e.modal)})}toggle(e,t=!1){return this._toggleModal(this.get(e),t)}getModalStack(){return this._modalStack.getModalStack()}getOpenedModals(){return this._modalStack.getOpenedModals()}getTopOpenedModal(){return this._modalStack.getTopOpenedModal()}getHigherIndex(){return this._modalStack.getHigherIndex()}getModalStackCount(){return this._modalStack.getModalStackCount()}removeModal(e){let t=this._modalStack.removeModal(e);t&&this._destroyModal(t.modal)}setModalData(e,t,s){let i=this.get(t);return i?(i.setData(e,s),!0):!1}getModalData(e){let t=this.get(e);return t?t.getData():null}resetModalData(e){if(this._modalStack.getModalStack().find(t=>t.id===e)){let t=this.getModal(e).getData();return this.getModal(e).removeData(),t}else return!1}closeLatestModal(){this.getTopOpenedModal().close()}create(e,t,s,i={}){try{return this.getModal(e)}catch(r){let c=this._resolveNgContent(t),a=s.createComponent(pe,{injector:this._injector,projectableNodes:c});t instanceof Q&&(a.instance.contentComponent=t),a.instance.identifier=e,a.instance.createFrom="service",typeof i.closable=="boolean"&&(a.instance.closable=i.closable),typeof i.escapable=="boolean"&&(a.instance.escapable=i.escapable),typeof i.dismissable=="boolean"&&(a.instance.dismissable=i.dismissable),typeof i.customClass=="string"&&(a.instance.customClass=i.customClass),typeof i.backdrop=="boolean"&&(a.instance.backdrop=i.backdrop),typeof i.force=="boolean"&&(a.instance.force=i.force),typeof i.hideDelay=="number"&&(a.instance.hideDelay=i.hideDelay),typeof i.autostart=="boolean"&&(a.instance.autostart=i.autostart),typeof i.target=="string"&&(a.instance.target=i.target),typeof i.ariaLabel=="string"&&(a.instance.ariaLabel=i.ariaLabel),typeof i.ariaLabelledBy=="str
1ing"&&(a.instance.ariaLabelledBy=i.ariaLabelledBy),typeof i.ariaDescribedBy=="string"&&(a.instance.ariaDescribedBy=i.ariaDescribedBy),typeof i.refocus=="boolean"&&(a.instance.refocus=i.refocus);let o=a.hostView.rootNodes[0];return this._document.body.appendChild(o),a.instance}}_addEvents(){return this.isBrowser?(window.addEventListener(d.prefixEvent+"create",e=>{this._initModal(e.detail.instance)}),window.addEventListener(d.prefixEvent+"delete",e=>{this._deleteModal(e.detail.instance)}),window.addEventListener(d.prefixEvent+"open",e=>{this._openModal(e.detail.instance.modal,e.detail.extraData.top)}),window.addEventListener(d.prefixEvent+"toggle",e=>{this._toggleModal(e.detail.instance.modal,e.detail.extraData.top)}),window.addEventListener(d.prefixEvent+"close",e=>{this._closeModal(e.detail.instance.modal)}),window.addEventListener(d.prefixEvent+"dismiss",e=>{this._dismissModal(e.detail.instance.modal)}),window.addEventListener("keyup",this._escapeKeyboardEvent),!0):!1}_initModal(e){e.modal.layerPosition+=this.getModalStackCount(),this.addModal(e,e.modal.force),e.modal.autostart&&this.open(e.id)}_openModal(e,t){return e.visible?!1:(this.lastElementFocused=document.activeElement,e.escapable&&window.addEventListener("keyup",this._escapeKeyboardEvent),e.backdrop&&window.addEventListener("keydown",this._trapFocusModal),t&&(e.layerPosition=this.getHigherIndex()),e.addBodyClass(),e.overlayVisible=!0,e.visible=!0,e.onOpen.emit(e),e.markForCheck(),setTimeout(()=>{e.openedClass=!0,e.target&&e.targetPlacement(),e.nsmDialog.first.nativeElement.setAttribute("role","dialog"),e.nsmDialog.first.nativeElement.setAttribute("tabIndex","-1"),e.nsmDialog.first.nativeElement.setAttribute("aria-modal","true"),e.nsmDialog.first.nativeElement.focus(),e.markForCheck(),e.onOpenFinished.emit(e)}),!0)}_toggleModal(e,t){return e.visible?this._closeModal(e):this._openModal(e,t)}_closeModal(e){return e.openedClass?(e.openedClass=!1,e.onClose.emit(e),e.onAnyCloseEvent.emit(e),this.getOpenedModals().length<2&&(e.removeBodyClass(),window.removeEventListener("keyup",this._escapeKeyboardEvent),window.removeEventListener("keydown",this._trapFocusModal)),setTimeout(()=>{e.visibleChange.emit(e.visible),e.visible=!1,e.overlayVisible=!1,e.nsmDialog.first.nativeElement.removeAttribute("tabIndex"),e.markForCheck(),e.onCloseFinished.emit(e),e.onAnyCloseEventFinished.emit(e),e.refocus&&this.lastElementFocused.focus()},e.hideDelay),!0):!1}_dismissModal(e){return e.openedClass?(e.openedClass=!1,e.onDismiss.emit(e),e.onAnyCloseEvent.emit(e),this.getOpenedModals().length<2&&e.removeBodyClass(),setTimeout(()=>{e.visible=!1,e.visibleChange.emit(e.visible),e.overlayVisible=!1,e.markForCheck(),e.onDismissFinished.emit(e),e.onAnyCloseEventFinished.emit(e)},e.hideDelay),!0):!1}_deleteModal(e){this.removeModal(e.id),this.getModalStack().length||e.modal.removeBodyClass()}_resolveNgContent(e){if(typeof e=="string")return[[this._document.createTextNode(e)]];if(e instanceof G){let t=e.createEmbeddedView(null);return this.applicationRef.attachView(t),[t.rootNodes]}return[]}get isBrowser(){return A(this._platformId)}_destroyModal(e){e.createFrom==="service"&&this._document.body.removeChild(e.elementRef.nativeElement)}static{this.\u0275fac=function(t){return new(t||n)(h(O),h(z),h(V),h(O),h(S),h(F))}}static{this.\u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})(),Fe=(()=>{class n{static forRoot(){return{ngModule:n,providers:[_,V]}}static forChild(){return{ngModule:n,providers:[_,V]}}constructor(e){this.service=e}static{this.\u0275fac=function(t){return new(t||n)(h(_))}}static{this.\u0275mod=$({type:n})}static{this.\u0275inj=N({imports:[se]})}}return n})();var Be=(()=>{class n{ngxSmartModalService=P(_);open(e,t){let s=this.getModal(e);s?.open(),t&&Object.keys(t).length!==0&&s&&s.setData(t)}getData(e){return this.getModal(e)?.getData()}close(e){this.getModal(e)?.close()}getModal(e){return typeof e=="string"?this.ngxSmartModalService.getModal(e):this.ngxSmartModalService.getModalStack().find(t=>e.test(t.id))?.modal}static \u0275fac=function(t){return new(t||n)};static \u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();export{pe as a,_ as b,Fe as c,Be as d};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.