@veltdev/sdk-dev 6.0.0-beta.35 → 6.0.0-beta.36

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.
Files changed (59) hide show
  1. package/app/models/data/notification.model.d.ts +14 -0
  2. package/app/utils/constants.d.ts +1 -0
  3. package/{chunk-G35OSTOG.js → chunk-3LOKPHYZ.js} +1 -1
  4. package/{chunk-TH6YKCXO.js → chunk-3WV4BVWT.js} +1 -1
  5. package/{chunk-MNSD5X74.js → chunk-4CNGX45S.js} +1 -1
  6. package/{chunk-63JYOYYS.js → chunk-5EKQMV53.js} +1 -1
  7. package/{chunk-TYMRWTZD.js → chunk-63DT4H5U.js} +1 -1
  8. package/{chunk-BNMUAROH.js → chunk-6I5D7ZZS.js} +1 -1
  9. package/{chunk-7YRV6DM5.js → chunk-75PX472Z.js} +1 -1
  10. package/chunk-7T3L5UXB.js +1 -0
  11. package/{chunk-WDA4SVMN.js → chunk-BVGJQIX2.js} +1 -1
  12. package/{chunk-7KKEGN3R.js → chunk-BWOZWUHQ.js} +1 -1
  13. package/{chunk-SJ45VMIG.js → chunk-EH2S2WYW.js} +1 -1
  14. package/chunk-G4XGQEW3.js +1 -0
  15. package/{chunk-QMTQRFX7.js → chunk-GEYYOYOD.js} +1 -1
  16. package/{chunk-35J3HFXX.js → chunk-GTDGZL3S.js} +1 -1
  17. package/{chunk-LAR7HDY4.js → chunk-H3HJJAKM.js} +1 -1
  18. package/{chunk-FRBXOJ6M.js → chunk-HPPVJ3WL.js} +1 -1
  19. package/{chunk-CD4NVJ5J.js → chunk-HZF23Z7O.js} +1 -1
  20. package/{chunk-TQY2DSNB.js → chunk-IZTIJQZD.js} +1 -1
  21. package/{chunk-BYJ7FNFA.js → chunk-NLTWBKII.js} +1 -1
  22. package/{chunk-E3BLO6TE.js → chunk-PDQJGSCF.js} +1 -1
  23. package/{chunk-NTNPNLFT.js → chunk-Q5RQKEZN.js} +1 -1
  24. package/chunk-R6P3JJIA.js +93 -0
  25. package/{chunk-2XFMMSIA.js → chunk-RODUN7HK.js} +1 -1
  26. package/{chunk-XA2U66CN.js → chunk-T47OHAUS.js} +1 -1
  27. package/{chunk-CISRB4CX.js → chunk-UVIYUIDR.js} +1 -1
  28. package/{chunk-XJMPAD3A.js → chunk-V4TIHFCO.js} +1 -1
  29. package/{chunk-3H4EEWB3.js → chunk-VHEPNJ7H.js} +1 -1
  30. package/{chunk-QYETTIEZ.js → chunk-VW2F7BJA.js} +1 -1
  31. package/{chunk-OLQDOFOR.js → chunk-WWOTNJO7.js} +1 -1
  32. package/{chunk-QKAX24JC.js → chunk-YSDYSED4.js} +1 -1
  33. package/{chunk-FXUDI3M6.js → chunk-YUWFUH6R.js} +24 -24
  34. package/{chunk-XDEUB7EN.js → chunk-Z6DDJIEB.js} +1 -1
  35. package/{chunk-JAEOVOAO.js → chunk-ZK55RNPH.js} +1 -1
  36. package/package.json +1 -1
  37. package/velt-activity-log.js +1 -1
  38. package/velt-area.js +1 -1
  39. package/velt-arrow.js +1 -1
  40. package/velt-comment.js +7 -7
  41. package/velt-crdt.js +1 -1
  42. package/velt-cursor.js +1 -1
  43. package/velt-huddle.js +1 -1
  44. package/velt-live-state-sync.js +1 -1
  45. package/velt-notification.js +1 -1
  46. package/velt-presence.js +1 -1
  47. package/velt-reaction.js +1 -1
  48. package/velt-recorder.js +1 -1
  49. package/velt-rewriter.js +1 -1
  50. package/velt-selection.js +1 -1
  51. package/velt-tag.js +1 -1
  52. package/velt-user-invite.js +1 -1
  53. package/velt-user-request.js +1 -1
  54. package/velt-video-player.js +1 -1
  55. package/velt-views.js +1 -1
  56. package/velt.js +2 -2
  57. package/chunk-7LWVUQBQ.js +0 -1
  58. package/chunk-IDHKU6SV.js +0 -93
  59. package/chunk-QKLPDEZ5.js +0 -1
@@ -1,2 +1,2 @@
1
- import{a as T,c as S,d as Rt,e as Et,f as It,g as v,h as xt,i as Ct,l as Tt,o as kt}from"./chunk-TQY2DSNB.js";import{$ as H,Ac as yt,C as ct,D as F,Ga as D,Ha as C,Ia as vt,J as dt,Kb as Pt,Na as G,Ra as Dt,S as _t,T as pt,U as x,Ua as wt,Va as bt,W as gt,Wa as U,_b as W,aa as ut,ba as P,da as d,h as w,i as A,k as _,l as at,la as ft,ma as z,o as lt,qa as V,ua as mt,v as ht,wa as B,xc as St,zc as Z}from"./chunk-FXUDI3M6.js";function $(r){let t=r.cloneNode(!0),e=t.querySelectorAll("[id]"),i=r.nodeName.toLowerCase();t.removeAttribute("id");for(let s=0;s<e.length;s++)e[s].removeAttribute("id");return i==="canvas"?Nt(r,t):(i==="input"||i==="select"||i==="textarea")&&Lt(r,t),Ot("canvas",r,t,Nt),Ot("input, textarea, select",r,t,Lt),t}function Ot(r,t,e,i){let s=t.querySelectorAll(r);if(s.length){let n=e.querySelectorAll(r);for(let o=0;o<s.length;o++)i(s[o],n[o])}}var ie=0;function Lt(r,t){t.type!=="file"&&(t.value=r.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${ie++}`)}function Nt(r,t){let e=t.getContext("2d");if(e)try{e.drawImage(r,0,0)}catch{}}function et(r){let t=r.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function K(r,t,e){let{top:i,bottom:s,left:n,right:o}=r;return e>=i&&e<=s&&t>=n&&t<=o}function se(r,t){let e=t.left<r.left,i=t.left+t.width>r.right,s=t.top<r.top,n=t.top+t.height>r.bottom;return e||i||s||n}function E(r,t,e){r.top+=t,r.bottom=r.top+r.height,r.left+=e,r.right=r.left+r.width}function Mt(r,t,e,i){let{top:s,right:n,bottom:o,left:a,width:l,height:h}=r,c=l*t,g=h*t;return i>s-g&&i<o+g&&e>a-c&&e<n+c}var k=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:et(e)})})}handleScroll(t){let e=S(t),i=this.positions.get(e);if(!i)return null;let s=i.scrollPosition,n,o;if(e===this._document){let h=this.getViewportScrollPosition();n=h.top,o=h.left}else n=e.scrollTop,o=e.scrollLeft;let a=s.top-n,l=s.left-o;return this.positions.forEach((h,c)=>{h.clientRect&&e!==c&&e.contains(c)&&E(h.clientRect,a,l)}),s.top=n,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function jt(r,t){let e=r.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(s=>i.appendChild(s)),i}function it(r,t,e){for(let i in t)if(t.hasOwnProperty(i)){let s=t[i];s?r.setProperty(i,s,e?.has(i)?"important":""):r.removeProperty(i)}return r}function b(r,t){let e=t?"":"none";it(r.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function At(r,t,e){it(r.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function O(r,t){return t&&t!="none"?r+" "+t:r}function Ft(r,t){r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.style.transform=I(t.left,t.top)}function I(r,t){return`translate3d(${Math.round(r)}px, ${Math.round(t)}px, 0)`}function Ht(r){let t=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*t}function ne(r){let t=getComputedStyle(r),e=j(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=e.indexOf(i),n=j(t,"transition-duration"),o=j(t,"transition-delay");return Ht(n[s])+Ht(o[s])}function j(r,t){return r.getPropertyValue(t).split(",").map(i=>i.trim())}var re=new Set(["position"]),Y=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView;_preview;get element(){return this._preview}constructor(t,e,i,s,n,o,a,l,h,c){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=h,this._renderer=c}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),zt(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return ne(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,s;if(i&&t){let n=t.matchSize?this._initialDomRect:null,o=t.viewContainer.createEmbeddedView(i,t.context);o.detectChanges(),s=jt(o,this._document),this._previewEmbeddedView=o,t.matchSize?Ft(s,n):s.style.transform=I(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=$(this._rootElement),Ft(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return it(s.style,{"pointer-events":"none",margin:zt(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},re),b(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(n=>s.classList.add(n)):s.classList.add(e)),s}};function zt(r){return"showPopover"in r}var oe={passive:!0},Vt={passive:!1},ae={passive:!1,capture:!0},le=800,Bt="cdk-drag-placeholder",Gt=new Set(["position"]),X=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview;_previewContainer;_placeholderRef;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=V(!1);_hasMoved;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement;_rootElementTapHighlight;_pointerMoveSubscription=w.EMPTY;_pointerUpSubscription=w.EMPTY;_scrollSubscription=w.EMPTY;_resizeSubscription=w.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>b(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,s,n,o,a){this._config=e,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new k(i),o.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>v(i)),this._handles.forEach(i=>b(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=v(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Vt),i.listen(e,"touchstart",this._pointerDown,oe),i.listen(e,"dragstart",this._nativeDragStart,Vt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?v(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&se(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,s=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?s=t.top-e.top:e.bottom>t.bottom&&(s=t.bottom-e.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=I(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),b(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),b(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let s=Math.abs(e.x-this._pickupPositionOnPage.x),n=Math.abs(e.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){y(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",he,ae)}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new Y(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(n,e)),At(s,!1,Gt),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),s=y(e),n=!s&&e.button!==0,o=this._rootElement,a=S(e),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+le>Date.now(),h=s?Et(e):Rt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||n||l||h)return;if(this._handles.length){let m=o.style;this._rootElementTapHighlight=m.webkitTapHighlightColor||"",m.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(m=>this._updateOnScroll(m)),this._boundaryElement&&(this._boundaryRect=et(this._boundaryElement));let c=this._previewTemplate;this._pickupPositionInElement=c&&c.template&&!c.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let g=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:g.x,y:g.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){At(this._rootElement,!0,Gt),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),s=this._getPointerPositionOnPage(t),n=this._getDragDistance(s),o=e._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,t,e,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&S(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n))},n=setTimeout(s,e*1.5),o=this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=jt(this._placeholderRef,this._document)):i=$(this._rootElement),i.style.pointerEvents="none",i.classList.add(Bt),i}_getPointerPositionInElement(t,e,i){let s=e===this._rootElement?null:e,n=s?s.getBoundingClientRect():t,o=y(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,h=o.pageY-n.top-a.top;return{x:n.left-t.left+l,y:n.top-t.top+h}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=y(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,s=i.pageX-e.left,n=i.pageY-e.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return{x:s,y:n}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:h}=this._getPreviewRect(),c=a.top+o,g=a.bottom-(h-o),m=a.left+n,N=a.right-(l-n);i=Ut(i,m,N),s=Ut(s,c,g)}return{x:i,y:s}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(e-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=e>n.x?1:-1,n.x=e),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,b(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,s=I(t*i,e*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=O(s,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=I(t,e);this._preview.setTransform(O(s,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(t+=n),o>0&&(t-=o)):t=0,s.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:y(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=S(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&E(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=T(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let s=this._document;return e||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return v(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let s=this._anchor??=$(this._placeholder);s.classList.remove(Bt),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):v(e.element).appendChild(s)}}};function Ut(r,t,e){return Math.max(t,Math.min(e,r))}function y(r){return r.type[0]==="t"}function he(r){r.preventDefault()}function qt(r,t,e){let i=Wt(t,r.length-1),s=Wt(e,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n}function Wt(r,t){return Math.max(0,Math.min(t,r))}var L=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction;constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(t,e,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(u=>u.drag===t),h=n[o],c=n[l].clientRect,g=h.clientRect,m=l>o?1:-1,N=this._getItemOffsetPx(c,g,m),Qt=this._getSiblingOffsetPx(l,n,m),te=n.slice();return qt(n,l,o),n.forEach((u,ee)=>{if(te[ee]===u)return;let nt=u.drag===t,M=nt?N:Qt,rt=nt?t.getPlaceholderElement():u.drag.getRootElement();u.offset+=M;let ot=Math.round(u.offset*(1/u.drag.scale));a?(rt.style.transform=O(`translate3d(${ot}px, 0, 0)`,u.initialTransform),E(u.clientRect,0,M)):(rt.style.transform=O(`translate3d(0, ${ot}px, 0)`,u.initialTransform),E(u.clientRect,M,0))}),this._previousSwap.overlaps=K(g,e,i),this._previousSwap.drag=h.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(t,e,i,s){let n=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s,o=this._activeDraggables,a=o.indexOf(t),l=t.getPlaceholderElement(),h=o[n];if(h===t&&(h=o[n+1]),!h&&(n==null||n===-1||n<o.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(h=o[0]),a>-1&&o.splice(a,1),h&&!this._dragDropRegistry.isDragging(h)){let c=h.getRootElement();c.parentElement.insertBefore(l,c),o.splice(n,0,t)}else this._element.appendChild(l),o.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(s=>s.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{E(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:et(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=s?e.left-t.left:e.top-t.top;return i===-1&&(n+=s?e.width-t.width:e.height-t.height),n}_getSiblingOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=e[t].clientRect,o=e[t+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",h=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[h]:a+=n[l]-o.clientRect[h]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?t>=o.right:e>=o.bottom}else{let o=i[0].clientRect;return s?t<=o.left:e<=o.top}}_getItemIndexFromPointerPosition(t,e,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(s){let h=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&h===this._previousSwap.delta)return!1}return n?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,t)?-1:o}},J=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let s=e[i];this._relatedNodes.push([s,s.nextSibling])}this.withItems(t)}sort(t,e,i,s){let n=this._getItemIndexFromPointerPosition(t,e,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===t)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(t),h=t.getPlaceholderElement(),c=a.getRootElement();n>l?c.after(h):c.before(h),qt(this._activeItems,l,n);let g=this._getRootNode().elementFromPoint(e,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=c===g||c.contains(g),{previousIndex:l,currentIndex:n}}enter(t,e,i,s){let n=this._activeItems.indexOf(t);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===t&&s.nextSibling!==n&&(n===null?t.appendChild(s):n.parentNode===t&&t.insertBefore(s,n))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let s=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,t)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=T(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==t){let{x:l,y:h}=a.getRootElement().getBoundingClientRect(),c=Math.hypot(e-l,i-h);c<s&&(s=c,n=o)}}return n}},Zt=.05,$t=.05,f=(function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r})(f||{}),p=(function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r})(p||{}),Q=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=w.EMPTY;_verticalScrollDirection=f.NONE;_horizontalScrollDirection=p.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,s,n){this._dragDropRegistry=e,this._ngZone=s,this._viewportRuler=n;let o=this.element=v(t);this._document=i,this.withOrientation("vertical").withElementContainer(o),e.registerDropContainer(this),this._parentPositions=new k(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,s,n,o,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(s=>s.isDragging()).every(s=>t.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof L&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new J(this._document,this._dragDropRegistry);else{let e=new L(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=v(this.element),i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,s){if(this.sortingDisabled||!this._domRect||!Mt(this._domRect,Zt,e,i))return;let n=this._sortStrategy.sort(t,e,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,s=f.NONE,n=p.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||Mt(o.clientRect,Zt,t,e)&&([s,n]=ce(a,o.clientRect,this._direction,t,e),(s||n)&&(i=a))}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=Kt(l,e),n=Yt(l,t),i=window}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),ct(0,lt).pipe(x(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===f.UP?t.scrollBy(0,-e):this._verticalScrollDirection===f.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===p.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===p.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&K(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(s=>s._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!K(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let s=this._getShadowRoot().elementFromPoint(e,i);return s?s===this._container||this._container.contains(s):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=T(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Kt(r,t){let{top:e,bottom:i,height:s}=r,n=s*$t;return t>=e-n&&t<=e+n?f.UP:t>=i-n&&t<=i+n?f.DOWN:f.NONE}function Yt(r,t){let{left:e,right:i,width:s}=r,n=s*$t;return t>=e-n&&t<=e+n?p.LEFT:t>=i-n&&t<=i+n?p.RIGHT:p.NONE}function ce(r,t,e,i,s){let n=Kt(t,s),o=Yt(t,i),a=f.NONE,l=p.NONE;if(n){let h=r.scrollTop;n===f.UP?h>0&&(a=f.UP):r.scrollHeight-h>r.clientHeight&&(a=f.DOWN)}if(o){let h=r.scrollLeft;e==="rtl"?o===p.RIGHT?h<0&&(l=p.RIGHT):r.scrollWidth+h>r.clientWidth&&(l=p.LEFT):o===p.LEFT?h>0&&(l=p.LEFT):r.scrollWidth-h>r.clientWidth&&(l=p.RIGHT)}return[a,l]}var R={capture:!0},q={passive:!1,capture:!0},de=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=wt({type:r,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,s){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
1
+ import{a as T,c as S,d as Rt,e as Et,f as It,g as v,h as xt,i as Ct,l as Tt,o as kt}from"./chunk-IZTIJQZD.js";import{$ as H,Ac as yt,C as ct,D as F,Ga as D,Ha as C,Ia as vt,J as dt,Kb as Pt,Na as G,Ra as Dt,S as _t,T as pt,U as x,Ua as wt,Va as bt,W as gt,Wa as U,_b as W,aa as ut,ba as P,da as d,h as w,i as A,k as _,l as at,la as ft,ma as z,o as lt,qa as V,ua as mt,v as ht,wa as B,xc as St,zc as Z}from"./chunk-YUWFUH6R.js";function $(r){let t=r.cloneNode(!0),e=t.querySelectorAll("[id]"),i=r.nodeName.toLowerCase();t.removeAttribute("id");for(let s=0;s<e.length;s++)e[s].removeAttribute("id");return i==="canvas"?Nt(r,t):(i==="input"||i==="select"||i==="textarea")&&Lt(r,t),Ot("canvas",r,t,Nt),Ot("input, textarea, select",r,t,Lt),t}function Ot(r,t,e,i){let s=t.querySelectorAll(r);if(s.length){let n=e.querySelectorAll(r);for(let o=0;o<s.length;o++)i(s[o],n[o])}}var ie=0;function Lt(r,t){t.type!=="file"&&(t.value=r.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${ie++}`)}function Nt(r,t){let e=t.getContext("2d");if(e)try{e.drawImage(r,0,0)}catch{}}function et(r){let t=r.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function K(r,t,e){let{top:i,bottom:s,left:n,right:o}=r;return e>=i&&e<=s&&t>=n&&t<=o}function se(r,t){let e=t.left<r.left,i=t.left+t.width>r.right,s=t.top<r.top,n=t.top+t.height>r.bottom;return e||i||s||n}function E(r,t,e){r.top+=t,r.bottom=r.top+r.height,r.left+=e,r.right=r.left+r.width}function Mt(r,t,e,i){let{top:s,right:n,bottom:o,left:a,width:l,height:h}=r,c=l*t,g=h*t;return i>s-g&&i<o+g&&e>a-c&&e<n+c}var k=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:et(e)})})}handleScroll(t){let e=S(t),i=this.positions.get(e);if(!i)return null;let s=i.scrollPosition,n,o;if(e===this._document){let h=this.getViewportScrollPosition();n=h.top,o=h.left}else n=e.scrollTop,o=e.scrollLeft;let a=s.top-n,l=s.left-o;return this.positions.forEach((h,c)=>{h.clientRect&&e!==c&&e.contains(c)&&E(h.clientRect,a,l)}),s.top=n,s.left=o,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function jt(r,t){let e=r.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(s=>i.appendChild(s)),i}function it(r,t,e){for(let i in t)if(t.hasOwnProperty(i)){let s=t[i];s?r.setProperty(i,s,e?.has(i)?"important":""):r.removeProperty(i)}return r}function b(r,t){let e=t?"":"none";it(r.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function At(r,t,e){it(r.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function O(r,t){return t&&t!="none"?r+" "+t:r}function Ft(r,t){r.style.width=`${t.width}px`,r.style.height=`${t.height}px`,r.style.transform=I(t.left,t.top)}function I(r,t){return`translate3d(${Math.round(r)}px, ${Math.round(t)}px, 0)`}function Ht(r){let t=r.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(r)*t}function ne(r){let t=getComputedStyle(r),e=j(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let s=e.indexOf(i),n=j(t,"transition-duration"),o=j(t,"transition-delay");return Ht(n[s])+Ht(o[s])}function j(r,t){return r.getPropertyValue(t).split(",").map(i=>i.trim())}var re=new Set(["position"]),Y=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView;_preview;get element(){return this._preview}constructor(t,e,i,s,n,o,a,l,h,c){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=s,this._previewTemplate=n,this._previewClass=o,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=h,this._renderer=c}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),zt(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return ne(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,s;if(i&&t){let n=t.matchSize?this._initialDomRect:null,o=t.viewContainer.createEmbeddedView(i,t.context);o.detectChanges(),s=jt(o,this._document),this._previewEmbeddedView=o,t.matchSize?Ft(s,n):s.style.transform=I(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else s=$(this._rootElement),Ft(s,this._initialDomRect),this._initialTransform&&(s.style.transform=this._initialTransform);return it(s.style,{"pointer-events":"none",margin:zt(s)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},re),b(s,!1),s.classList.add("cdk-drag-preview"),s.setAttribute("popover","manual"),s.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(n=>s.classList.add(n)):s.classList.add(e)),s}};function zt(r){return"showPopover"in r}var oe={passive:!0},Vt={passive:!1},ae={passive:!1,capture:!0},le=800,Bt="cdk-drag-placeholder",Gt=new Set(["position"]),X=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview;_previewContainer;_placeholderRef;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=V(!1);_hasMoved;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement;_rootElementTapHighlight;_pointerMoveSubscription=w.EMPTY;_pointerUpSubscription=w.EMPTY;_scrollSubscription=w.EMPTY;_resizeSubscription=w.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>b(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,s,n,o,a){this._config=e,this._document=i,this._ngZone=s,this._viewportRuler=n,this._dragDropRegistry=o,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new k(i),o.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>v(i)),this._handles.forEach(i=>b(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=v(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Vt),i.listen(e,"touchstart",this._pointerDown,oe),i.listen(e,"dragstart",this._nativeDragStart,Vt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?v(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&se(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,s=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?s=t.top-e.top:e.bottom>t.bottom&&(s=t.bottom-e.bottom);let n=this._activeTransform.x,o=this._activeTransform.y,a=n+i,l=o+s;this._rootElement.style.transform=I(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),b(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),b(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let s=Math.abs(e.x-this._pickupPositionOnPage.x),n=Math.abs(e.y-this._pickupPositionOnPage.y);if(s+n>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let s=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,n=this._activeTransform;n.x=i.x-s.x+this._passiveTransform.x,n.y=i.y-s.y+this._passiveTransform.y,this._applyRootElementTransform(n.x,n.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){y(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",he,ae)}),i){let s=this._rootElement,n=s.parentNode,o=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");n.insertBefore(a,s),this._initialTransform=s.style.transform||"",this._preview=new Y(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(n,e)),At(s,!1,Gt),this._document.body.appendChild(n.replaceChild(o,s)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),s=y(e),n=!s&&e.button!==0,o=this._rootElement,a=S(e),l=!s&&this._lastTouchEventTime&&this._lastTouchEventTime+le>Date.now(),h=s?Et(e):Rt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||n||l||h)return;if(this._handles.length){let m=o.style;this._rootElementTapHighlight=m.webkitTapHighlightColor||"",m.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(m=>this._updateOnScroll(m)),this._boundaryElement&&(this._boundaryRect=et(this._boundaryElement));let c=this._previewTemplate;this._pickupPositionInElement=c&&c.template&&!c.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let g=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:g.x,y:g.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){At(this._rootElement,!0,Gt),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),s=this._getPointerPositionOnPage(t),n=this._getDragDistance(s),o=e._isOverContainer(s.x,s.y);this.ended.next({source:this,distance:n,dropPoint:s,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:o,distance:n,dropPoint:s,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,o,n,s,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:s}){let n=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!n&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(n=this._initialContainer),n&&n!==this._dropContainer&&this._ngZone.run(()=>{let o=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(o+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(n,this._dropContainer,a),this._dropContainer=n,this._dropContainer.enter(this,t,e,n===this._initialContainer&&n.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:n,currentIndex:n.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,s),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let s=a=>{(!a||this._preview&&S(a)===this._preview.element&&a.propertyName==="transform")&&(o(),i(),clearTimeout(n))},n=setTimeout(s,e*1.5),o=this._preview.addEventListener("transitionend",s)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=jt(this._placeholderRef,this._document)):i=$(this._rootElement),i.style.pointerEvents="none",i.classList.add(Bt),i}_getPointerPositionInElement(t,e,i){let s=e===this._rootElement?null:e,n=s?s.getBoundingClientRect():t,o=y(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=o.pageX-n.left-a.left,h=o.pageY-n.top-a.top;return{x:n.left-t.left+l,y:n.top-t.top+h}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=y(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,s=i.pageX-e.left,n=i.pageY-e.top;if(this._ownerSVGElement){let o=this._ownerSVGElement.getScreenCTM();if(o){let a=this._ownerSVGElement.createSVGPoint();return a.x=s,a.y=n,a.matrixTransform(o.inverse())}}return{x:s,y:n}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:s}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?s=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:n,y:o}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:h}=this._getPreviewRect(),c=a.top+o,g=a.bottom-(h-o),m=a.left+n,N=a.right-(l-n);i=Ut(i,m,N),s=Ut(s,c,g)}return{x:i,y:s}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,s=this._pointerDirectionDelta,n=this._pointerPositionAtLastDirectionChange,o=Math.abs(e-n.x),a=Math.abs(i-n.y);return o>this._config.pointerDirectionChangeThreshold&&(s.x=e>n.x?1:-1,n.x=e),a>this._config.pointerDirectionChangeThreshold&&(s.y=i>n.y?1:-1,n.y=i),s}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,b(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,s=I(t*i,e*i),n=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=n.transform&&n.transform!="none"?n.transform:""),n.transform=O(s,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,s=I(t,e);this._preview.setTransform(O(s,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),s=this._boundaryElement.getBoundingClientRect();if(s.width===0&&s.height===0||i.width===0&&i.height===0)return;let n=s.left-i.left,o=i.right-s.right,a=s.top-i.top,l=i.bottom-s.bottom;s.width>i.width?(n>0&&(t+=n),o>0&&(t-=o)):t=0,s.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:y(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=S(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&E(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=T(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let s=this._document;return e||s.fullscreenElement||s.webkitFullscreenElement||s.mozFullScreenElement||s.msFullscreenElement||s.body}return v(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let s=this._anchor??=$(this._placeholder);s.classList.remove(Bt),s.classList.add("cdk-drag-anchor"),s.style.transform="",i?i.before(s):v(e.element).appendChild(s)}}};function Ut(r,t,e){return Math.max(t,Math.min(e,r))}function y(r){return r.type[0]==="t"}function he(r){r.preventDefault()}function qt(r,t,e){let i=Wt(t,r.length-1),s=Wt(e,r.length-1);if(i===s)return;let n=r[i],o=s<i?-1:1;for(let a=i;a!==s;a+=o)r[a]=r[a+o];r[s]=n}function Wt(r,t){return Math.max(0,Math.min(t,r))}var L=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction;constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,s){let n=this._itemPositions,o=this._getItemIndexFromPointerPosition(t,e,i,s);if(o===-1&&n.length>0)return null;let a=this.orientation==="horizontal",l=n.findIndex(u=>u.drag===t),h=n[o],c=n[l].clientRect,g=h.clientRect,m=l>o?1:-1,N=this._getItemOffsetPx(c,g,m),Qt=this._getSiblingOffsetPx(l,n,m),te=n.slice();return qt(n,l,o),n.forEach((u,ee)=>{if(te[ee]===u)return;let nt=u.drag===t,M=nt?N:Qt,rt=nt?t.getPlaceholderElement():u.drag.getRootElement();u.offset+=M;let ot=Math.round(u.offset*(1/u.drag.scale));a?(rt.style.transform=O(`translate3d(${ot}px, 0, 0)`,u.initialTransform),E(u.clientRect,0,M)):(rt.style.transform=O(`translate3d(0, ${ot}px, 0)`,u.initialTransform),E(u.clientRect,M,0))}),this._previousSwap.overlaps=K(g,e,i),this._previousSwap.drag=h.drag,this._previousSwap.delta=a?s.x:s.y,{previousIndex:l,currentIndex:o}}enter(t,e,i,s){let n=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s,o=this._activeDraggables,a=o.indexOf(t),l=t.getPlaceholderElement(),h=o[n];if(h===t&&(h=o[n+1]),!h&&(n==null||n===-1||n<o.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(h=o[0]),a>-1&&o.splice(a,1),h&&!this._dragDropRegistry.isDragging(h)){let c=h.getRootElement();c.parentElement.insertBefore(l,c),o.splice(n,0,t)}else this._element.appendChild(l),o.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(s=>s.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{E(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:et(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=s?e.left-t.left:e.top-t.top;return i===-1&&(n+=s?e.width-t.width:e.height-t.height),n}_getSiblingOffsetPx(t,e,i){let s=this.orientation==="horizontal",n=e[t].clientRect,o=e[t+i*-1],a=n[s?"width":"height"]*i;if(o){let l=s?"left":"top",h=s?"right":"bottom";i===-1?a-=o.clientRect[l]-n[h]:a+=n[l]-o.clientRect[h]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,s=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let o=i[i.length-1].clientRect;return s?t>=o.right:e>=o.bottom}else{let o=i[0].clientRect;return s?t<=o.left:e<=o.top}}_getItemIndexFromPointerPosition(t,e,i,s){let n=this.orientation==="horizontal",o=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(s){let h=n?s.x:s.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&h===this._previousSwap.delta)return!1}return n?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return o===-1||!this._sortPredicate(o,t)?-1:o}},J=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let s=e[i];this._relatedNodes.push([s,s.nextSibling])}this.withItems(t)}sort(t,e,i,s){let n=this._getItemIndexFromPointerPosition(t,e,i),o=this._previousSwap;if(n===-1||this._activeItems[n]===t)return null;let a=this._activeItems[n];if(o.drag===a&&o.overlaps&&o.deltaX===s.x&&o.deltaY===s.y)return null;let l=this.getItemIndex(t),h=t.getPlaceholderElement(),c=a.getRootElement();n>l?c.after(h):c.before(h),qt(this._activeItems,l,n);let g=this._getRootNode().elementFromPoint(e,i);return o.deltaX=s.x,o.deltaY=s.y,o.drag=a,o.overlaps=c===g||c.contains(g),{previousIndex:l,currentIndex:n}}enter(t,e,i,s){let n=this._activeItems.indexOf(t);n>-1&&this._activeItems.splice(n,1);let o=s==null||s<0?this._getItemIndexFromPointerPosition(t,e,i):s;o===-1&&(o=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[o];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(o,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[s,n]=this._relatedNodes[i];s.parentNode===t&&s.nextSibling!==n&&(n===null?t.appendChild(s):n.parentNode===t&&t.insertBefore(s,n))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let s=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),n=s?this._activeItems.findIndex(o=>{let a=o.getRootElement();return s===a||a.contains(s)}):-1;return n===-1||!this._sortPredicate(n,t)?-1:n}_getRootNode(){return this._rootNode||(this._rootNode=T(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let s=1/0,n=-1;for(let o=0;o<this._activeItems.length;o++){let a=this._activeItems[o];if(a!==t){let{x:l,y:h}=a.getRootElement().getBoundingClientRect(),c=Math.hypot(e-l,i-h);c<s&&(s=c,n=o)}}return n}},Zt=.05,$t=.05,f=(function(r){return r[r.NONE=0]="NONE",r[r.UP=1]="UP",r[r.DOWN=2]="DOWN",r})(f||{}),p=(function(r){return r[r.NONE=0]="NONE",r[r.LEFT=1]="LEFT",r[r.RIGHT=2]="RIGHT",r})(p||{}),Q=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=w.EMPTY;_verticalScrollDirection=f.NONE;_horizontalScrollDirection=p.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,s,n){this._dragDropRegistry=e,this._ngZone=s,this._viewportRuler=n;let o=this.element=v(t);this._document=i,this.withOrientation("vertical").withElementContainer(o),e.registerDropContainer(this),this._parentPositions=new k(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,s){this._draggingStarted(),s==null&&this.sortingDisabled&&(s=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,s),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,s,n,o,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:s,isPointerOverContainer:n,distance:o,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(s=>s.isDragging()).every(s=>t.indexOf(s)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof L&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new J(this._document,this._dragDropRegistry);else{let e=new L(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=v(this.element),i=this._scrollableElements.indexOf(this._container),s=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),s>-1&&this._scrollableElements.splice(s,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,s){if(this.sortingDisabled||!this._domRect||!Mt(this._domRect,Zt,e,i))return;let n=this._sortStrategy.sort(t,e,i,s);n&&this.sorted.next({previousIndex:n.previousIndex,currentIndex:n.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,s=f.NONE,n=p.NONE;if(this._parentPositions.positions.forEach((o,a)=>{a===this._document||!o.clientRect||i||Mt(o.clientRect,Zt,t,e)&&([s,n]=ce(a,o.clientRect,this._direction,t,e),(s||n)&&(i=a))}),!s&&!n){let{width:o,height:a}=this._viewportRuler.getViewportSize(),l={width:o,height:a,top:0,right:o,bottom:a,left:0};s=Kt(l,e),n=Yt(l,t),i=window}i&&(s!==this._verticalScrollDirection||n!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=s,this._horizontalScrollDirection=n,this._scrollNode=i,(s||n)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),ct(0,lt).pipe(x(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===f.UP?t.scrollBy(0,-e):this._verticalScrollDirection===f.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===p.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===p.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&K(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(s=>s._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!K(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let s=this._getShadowRoot().elementFromPoint(e,i);return s?s===this._container||this._container.contains(s):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(s=>this.enterPredicate(s,this)||this._draggables.indexOf(s)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=T(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Kt(r,t){let{top:e,bottom:i,height:s}=r,n=s*$t;return t>=e-n&&t<=e+n?f.UP:t>=i-n&&t<=i+n?f.DOWN:f.NONE}function Yt(r,t){let{left:e,right:i,width:s}=r,n=s*$t;return t>=e-n&&t<=e+n?p.LEFT:t>=i-n&&t<=i+n?p.RIGHT:p.NONE}function ce(r,t,e,i,s){let n=Kt(t,s),o=Yt(t,i),a=f.NONE,l=p.NONE;if(n){let h=r.scrollTop;n===f.UP?h>0&&(a=f.UP):r.scrollHeight-h>r.clientHeight&&(a=f.DOWN)}if(o){let h=r.scrollLeft;e==="rtl"?o===p.RIGHT?h<0&&(l=p.RIGHT):r.scrollWidth+h>r.clientWidth&&(l=p.LEFT):o===p.LEFT?h>0&&(l=p.LEFT):r.scrollWidth-h>r.clientWidth&&(l=p.RIGHT)}return[a,l]}var R={capture:!0},q={passive:!1,capture:!0},de=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275cmp=wt({type:r,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,s){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
2
2
  `],encapsulation:2,changeDetection:0})}return r})(),st=(()=>{class r{_ngZone=d(C);_document=d(z);_styleLoader=d(xt);_renderer=d(G).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new _;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=V([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new _;pointerUp=new _;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,q)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(de),this._activeDragInstances.update(s=>[...s,e]),this._activeDragInstances().length===1)){let s=i.type.startsWith("touch"),n=a=>this.pointerUp.next(a),o=[["scroll",a=>this._scroll.next(a),R],["selectstart",this._preventDefaultWhileDragging,q]];s?o.push(["touchend",n,R],["touchcancel",n,R]):o.push(["mouseup",n,R]),s||o.push(["mousemove",a=>this.pointerMove.next(a),q]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=o.map(([a,l,h])=>this._renderer.listen(this._document,a,l,h))})}}stopDragging(e){this._activeDragInstances.update(i=>{let s=i.indexOf(e);return s>-1?(i.splice(s,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new A(s=>this._ngZone.runOutsideAngular(()=>{let n=this._renderer.listen(e,"scroll",o=>{this._activeDragInstances().length&&s.next(o)},R);return()=>{n()}}))),F(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||r)};static \u0275prov=H({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),_e={dragStartThreshold:5,pointerDirectionChangeThreshold:5},Xt=(()=>{class r{_document=d(z);_ngZone=d(C);_viewportRuler=d(Tt);_dragDropRegistry=d(st);_renderer=d(G).createRenderer(null,null);constructor(){}createDrag(e,i=_e){return new X(e,i,this._document,this._ngZone,this._viewportRuler,this._dragDropRegistry,this._renderer)}createDropList(e){return new Q(e,this._dragDropRegistry,this._document,this._ngZone,this._viewportRuler)}static \u0275fac=function(i){return new(i||r)};static \u0275prov=H({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})(),tt=new P("CDK_DRAG_PARENT");var Jt=new P("CdkDragHandle"),Ae=(()=>{class r{element=d(B);_parentDrag=d(tt,{optional:!0,skipSelf:!0});_dragDropRegistry=d(st);_stateChanges=new _;get disabled(){return this._disabled}set disabled(e){this._disabled=e,this._stateChanges.next(this)}_disabled=!1;constructor(){this._parentDrag?._addHandle(this)}ngAfterViewInit(){if(!this._parentDrag){let e=this.element.nativeElement.parentElement;for(;e;){let i=this._dragDropRegistry.getDragDirectiveForNode(e);if(i){this._parentDrag=i,i._addHandle(this);break}e=e.parentElement}}}ngOnDestroy(){this._parentDrag?._removeHandle(this),this._stateChanges.complete()}static \u0275fac=function(i){return new(i||r)};static \u0275dir=U({type:r,selectors:[["","cdkDragHandle",""]],hostAttrs:[1,"cdk-drag-handle"],inputs:{disabled:[2,"cdkDragHandleDisabled","disabled",Z]},features:[W([{provide:Jt,useExisting:r}])]})}return r})(),pe=new P("CDK_DRAG_CONFIG"),ge=new P("CdkDropList"),Fe=(()=>{class r{element=d(B);dropContainer=d(ge,{optional:!0,skipSelf:!0});_ngZone=d(C);_viewContainerRef=d(Dt);_dir=d(Ct,{optional:!0});_changeDetectorRef=d(St);_selfHandle=d(Jt,{optional:!0,self:!0});_parentDrag=d(tt,{optional:!0,skipSelf:!0});_dragDropRegistry=d(st);_destroyed=new _;_handles=new at([]);_previewTemplate;_placeholderTemplate;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled;constrainPosition;previewClass;previewContainer;scale=1;started=new D;released=new D;ended=new D;entered=new D;exited=new D;dropped=new D;moved=new A(e=>{let i=this._dragRef.moved.pipe(ht(s=>({source:this,pointerPosition:s.pointerPosition,event:s.event,delta:s.delta,distance:s.distance}))).subscribe(e);return()=>{i.unsubscribe()}});_injector=d(ft);constructor(){let e=this.dropContainer,i=d(pe,{optional:!0}),s=d(Xt);this._dragRef=s.createDrag(this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(x(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){vt(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,s=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,s&&!s.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(e){let i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),s=i.indexOf(e);s>-1&&(i.splice(s,1),this._handles.next(i))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):v(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,s=this.dragStartDelay,n=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,o=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof s=="object"&&s?s:It(s),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(n).withPreviewTemplate(o).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(dt(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let s=this._dragDropRegistry.getDragDirectiveForNode(i);if(s){e.withParent(s._dragRef);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(e){let{lockAxis:i,dragStartDelay:s,constrainPosition:n,previewClass:o,boundaryElement:a,draggingDisabled:l,rootElementSelector:h,previewContainer:c}=e;this.disabled=l??!1,this.dragStartDelay=s||0,this.lockAxis=i||null,n&&(this.constrainPosition=n),o&&(this.previewClass=o),a&&(this.boundaryElement=a),h&&(this.rootElementSelector=h),c&&(this.previewContainer=c)}_setupHandlesListener(){this._handles.pipe(gt(e=>{let i=e.map(s=>s.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),pt(e=>F(...e.map(i=>i._stateChanges.pipe(_t(i))))),x(this._destroyed)).subscribe(e=>{let i=this._dragRef,s=e.element.nativeElement;e.disabled?i.disableHandle(s):i.enableHandle(s)})}static \u0275fac=function(i){return new(i||r)};static \u0275dir=U({type:r,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,s){i&2&&Pt("cdk-drag-disabled",s.disabled)("cdk-drag-dragging",s._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",Z],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",yt]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[W([{provide:tt,useExisting:r}]),mt]})}return r})();var He=(()=>{class r{static \u0275fac=function(i){return new(i||r)};static \u0275mod=bt({type:r});static \u0275inj=ut({providers:[Xt],imports:[kt]})}return r})();export{Xt as a,Ae as b,Fe as c,He as d};
@@ -1 +1 @@
1
- import{b as $}from"./chunk-SJ45VMIG.js";import{$ as D,Db as Z,Eb as A,Fa as m,Fb as q,Fc as z,Ga as C,Gc as G,Ib as f,Kb as b,Ke as U,Nb as T,Ob as N,Pa as S,Pb as I,Ua as H,Xa as k,_a as v,ca as B,ci as Q,db as L,di as O,ha as l,ia as c,ja as w,kc as M,la as F,lb as p,lc as E,mb as u,nb as d,ob as y,vb as _,xb as g,zb as a}from"./chunk-FXUDI3M6.js";var W=(()=>{let r=class r{transform(t,i,...o){try{let s=t&&t?.slice?t?.slice():[];return s?.length&&new U().getBrowserName()?.toLocaleLowerCase()==="safari"&&(s=s.sort((V,x)=>V.type==="mp4"&&x.type!=="mp4"?-1:V.type!=="mp4"&&x.type==="mp4"?1:0)),s}catch{return t}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275pipe=k({name:"rearrangeMediaSource",type:r,pure:!0});let n=r;return n})();var J=(()=>{let r=class r{constructor(t,i){this.injector=t,this.loggingService=i,this.arrowPromise=null,this.commentPromise=null,this.cursorPromise=null,this.huddlePromise=null,this.notificationPromise=null,this.presencePromise=null,this.reactionPromise=null,this.recorderPromise=null,this.tagPromise=null,this.rewriterPromise=null,this.selectionPromise=null,this.areaPromise=null,this.activityLogPromise=null,this.viewPromise=null,this.userInvitePromise=null,this.userRequestPromise=null,this.videoPlayerPromise=null,this.crdtPromise=null,this.liveStateSyncPromise=null,this.loggingService.log("%c[WB] Creating CLASS: ChunkLoaderService","color: blue;")}ensureArrowChunk(){return this.arrowPromise||(this.arrowPromise=import("./velt-arrow.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading arrow chunk: ",t),this.arrowPromise=null,t})),this.arrowPromise}ensureCommentChunk(){return this.commentPromise||(this.commentPromise=import("./velt-comment.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading comment chunk: ",t),this.commentPromise=null,t})),this.commentPromise}ensureCursorChunk(){return this.cursorPromise||(this.cursorPromise=import("./velt-cursor.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading cursor chunk: ",t),this.cursorPromise=null,t})),this.cursorPromise}ensureHuddleChunk(){return this.huddlePromise||(this.huddlePromise=import("./velt-huddle.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading huddle chunk: ",t),this.huddlePromise=null,t})),this.huddlePromise}ensureNotificationChunk(){return this.notificationPromise||(this.notificationPromise=import("./velt-notification.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading notification chunk: ",t),this.notificationPromise=null,t})),this.notificationPromise}ensurePresenceChunk(){return this.presencePromise||(this.presencePromise=import("./velt-presence.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading presence chunk: ",t),this.presencePromise=null,t})),this.presencePromise}ensureReactionChunk(){return this.reactionPromise||(this.reactionPromise=import("./velt-reaction.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading reaction chunk: ",t),this.reactionPromise=null,t})),this.reactionPromise}ensureRecorderChunk(){return this.recorderPromise||(this.recorderPromise=import("./velt-recorder.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading recorder chunk: ",t),this.recorderPromise=null,t})),this.recorderPromise}ensureTagChunk(){return this.tagPromise||(this.tagPromise=import("./velt-tag.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading tag chunk: ",t),this.tagPromise=null,t})),this.tagPromise}ensureRewriterChunk(){return this.rewriterPromise||(this.rewriterPromise=import("./velt-rewriter.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading rewriter chunk: ",t),this.rewriterPromise=null,t})),this.rewriterPromise}ensureSelectionChunk(){return this.selectionPromise||(this.selectionPromise=import("./velt-selection.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading selection chunk: ",t),this.selectionPromise=null,t})),this.selectionPromise}ensureAreaChunk(){return this.areaPromise||(this.areaPromise=import("./velt-area.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading area chunk: ",t),this.areaPromise=null,t})),this.areaPromise}ensureActivityLogChunk(){return this.activityLogPromise||(this.activityLogPromise=import("./velt-activity-log.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading activity-log chunk: ",t),this.activityLogPromise=null,t})),this.activityLogPromise}ensureViewChunk(){return this.viewPromise||(this.viewPromise=import("./velt-views.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading view chunk: ",t),this.viewPromise=null,t})),this.viewPromise}ensureUserInviteChunk(){return this.userInvitePromise||(this.userInvitePromise=import("./velt-user-invite.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading user-invite chunk: ",t),this.userInvitePromise=null,t})),this.userInvitePromise}ensureUserRequestChunk(){return this.userRequestPromise||(this.userRequestPromise=import("./velt-user-request.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading user-request chunk: ",t),this.userRequestPromise=null,t})),this.userRequestPromise}ensureVideoPlayerChunk(){return this.videoPlayerPromise||(this.videoPlayerPromise=import("./velt-video-player.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading video-player chunk: ",t),this.videoPlayerPromise=null,t})),this.videoPlayerPromise}ensureCrdtChunk(){return this.crdtPromise||(this.crdtPromise=import("./velt-crdt.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading crdt chunk: ",t),this.crdtPromise=null,t})),this.crdtPromise}ensureLiveStateSyncChunk(){return this.liveStateSyncPromise||(this.liveStateSyncPromise=import("./velt-live-state-sync.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading live-state-sync chunk: ",t),this.liveStateSyncPromise=null,t})),this.liveStateSyncPromise}};r.\u0275fac=function(i){return new(i||r)(B(F),B(O))},r.\u0275prov=D({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var et=["videoRef"];function it(n,r){if(n&1&&y(0,"source",10),n&2){let e=a();p("src",!(e.annotation==null||e.annotation.attachment==null)&&e.annotation.attachment.thumbnail?e.annotation==null||e.annotation.attachment==null?null:e.annotation.attachment.url:(e.annotation==null||e.annotation.attachment==null?null:e.annotation.attachment.url)+"#t=0.001")}}function nt(n,r){if(n&1&&y(0,"source",12),n&2){let e=r.$implicit;p("src",e==null?null:e.url)("type",(e==null?null:e.mimeType)||"video/mp4")}}function ot(n,r){if(n&1&&(v(0,nt,1,2,"source",11),M(1,"rearrangeMediaSource")),n&2){let e=a();p("ngForOf",E(1,2,e.annotation==null?null:e.annotation.attachments))("ngForTrackBy",e.trackByAttachmentId)}}function rt(n,r){if(n&1){let e=_();u(0,"div",13)(1,"div",14)(2,"snippyly-subtitles-embed",15,1),g("subtitlesButtonClick",function(){l(e);let i=a();return c(i.onSubtitlesButtonClick())}),d()()()}if(n&2){let e,t=f(3),i=a(),o=f(3);b("hide",(t==null?null:t.componentConfigSignal)&&(t==null||(e=t.componentConfigSignal())==null?null:e.highlightedTextIndex)<0),m(2),p("transcription",i.annotation==null?null:i.annotation.transcription)("timeToRead",(o==null?null:o.currentTime)||0)("mode","embed")}}function at(n,r){if(n&1){let e=_();u(0,"input",28),g("input",function(i){l(e);let o=a(2);return c(o.onDurationChange(i))}),d()}if(n&2){let e=a(2),t=f(3);p("value",(t==null?null:t.currentTime)*1e3/((e.annotation==null||e.annotation.recordedTime==null?null:e.annotation.recordedTime.duration)||0))}}function st(n,r){if(n&1){let e=_();w(),u(0,"svg",29),g("click",function(){l(e);let i=a(2);return c(i.toggleVideo())}),y(1,"path",30),d()}}function lt(n,r){if(n&1){let e=_();w(),u(0,"svg",31),g("click",function(){l(e);let i=a(2);return c(i.toggleVideo())}),y(1,"path",32)(2,"path",33),d()}}function ct(n,r){n&1&&(u(0,"span",38),T(1),M(2,"translate"),d()),n&2&&(m(),I(" ",E(2,1,"Subtitles not available")," "))}function pt(n,r){if(n&1){let e=_();u(0,"div",34),v(1,ct,3,3,"span",35),w(),u(2,"svg",36),g("click",function(){l(e);let i=a(2);return c(!(i.annotation==null||i.annotation.transcription==null)&&i.annotation.transcription.transcriptedText?i.onSubtitlesButtonClick(!0):null)}),y(3,"path",37),d()()}if(n&2){let e=a(2);b("disabled",!(!(e.annotation==null||e.annotation.transcription==null)&&e.annotation.transcription.transcriptedText)),m(),p("ngIf",!(!(e.annotation==null||e.annotation.transcription==null)&&e.annotation.transcription.transcriptedText))}}function mt(n,r){n&1&&(u(0,"span",38),T(1),M(2,"translate"),d()),n&2&&(m(),I(" ",E(2,1,"Transcription not available")))}function ut(n,r){if(n&1){let e=_();u(0,"div",39),g("click",function(){l(e);let i=a(2);return c(!(i.annotation==null||i.annotation.transcription==null)&&i.annotation.transcription.transcriptedText?i.onTranscriptionButtonClick(!0):null)}),v(1,mt,3,3,"span",35),w(),u(2,"svg",40),y(3,"path",41),d()()}if(n&2){let e=a(2);b("disabled",!(!(e.annotation==null||e.annotation.transcription==null)&&e.annotation.transcription.transcriptedText)),m(),p("ngIf",!(!(e.annotation==null||e.annotation.transcription==null)&&e.annotation.transcription.transcriptedText))}}function dt(n,r){if(n&1){let e=_();u(0,"snippyly-transcription-embed",42),g("transcriptionButtonClick",function(){l(e);let i=a(2);return c(i.onTranscriptionButtonClick())})("transcriptionSummaryCopy",function(){l(e);let i=a(2);return c(i.onTranscriptionSummaryCopy())})("seekTo",function(i){l(e);let o=a(2),s=f(3);return c(o.onSeekToVideo(i,s))})("transcriptionPanelDragged",function(){l(e);let i=a(2);return c(i.onTranscriptionPanelDragged())}),d()}if(n&2){let e=a(2),t=f(3);p("transcription",e.annotation==null?null:e.annotation.transcription)("timeToRead",(t==null?null:t.currentTime)||0)}}function ht(n,r){if(n&1){let e=_();w(),u(0,"svg",43),g("click",function(){l(e);let i=a(2);return c(i.onDelete())}),y(1,"path",44)(2,"path",45)(3,"path",46)(4,"path",47),d()}}function gt(n,r){if(n&1&&(u(0,"div",16)(1,"div",17),v(2,at,1,1,"input",18),d(),u(3,"div",19)(4,"div",20),v(5,st,2,0,"svg",21)(6,lt,3,0,"svg",22),u(7,"span"),T(8),d()(),u(9,"div",23),v(10,pt,4,3,"div",24)(11,ut,4,3,"div",25)(12,dt,1,2,"snippyly-transcription-embed",26)(13,ht,5,0,"svg",27),d()()()),n&2){let e=a();m(2),p("ngIf",e.annotation==null||e.annotation.recordedTime==null?null:e.annotation.recordedTime.duration),m(3),p("ngIf",!e.playing),m(),p("ngIf",e.playing),m(2),N(e.currentTime||(e.annotation==null||e.annotation.recordedTime==null?null:e.annotation.recordedTime.display)||"00:00"),m(2),p("ngIf",(e.annotation==null?null:e.annotation.transcription)&&e.showSubtitlesButton),m(),p("ngIf",(e.annotation==null?null:e.annotation.transcription)&&e.transcriptionMode==="embed"),m(),p("ngIf",(e.annotation==null?null:e.annotation.transcription)&&e.transcriptionMode==="floating"&&e.showTranscriptionButton),m(),p("ngIf",e.showDeleteButton)}}function _t(n,r){if(n&1){let e=_();u(0,"snippyly-transcription-embed",50),g("seekTo",function(i){l(e);let o=a(2),s=f(3);return c(o.onSeekToVideo(i,s))})("close",function(){l(e);let i=a(2);return c(i.toggleTranscription())})("transcriptionSummaryCopy",function(){l(e);let i=a(2);return c(i.onTranscriptionSummaryCopy())})("transcriptionPanelDragged",function(){l(e);let i=a(2);return c(i.onTranscriptionPanelDragged())}),d()}if(n&2){let e=a(2),t=f(3);p("transcription",e.annotation==null?null:e.annotation.transcription)("timeToRead",(t==null?null:t.currentTime)||0)("mode",e.transcriptionMode)("visible",!0)}}function vt(n,r){if(n&1){let e=_();u(0,"div",48),g("click",function(i){return l(e),c(i.stopPropagation())})("pointerdown",function(i){return l(e),c(i.stopPropagation())})("pointerup",function(i){return l(e),c(i.stopPropagation())}),v(1,_t,1,4,"snippyly-transcription-embed",49),d()}if(n&2){let e=a();m(),p("ngIf",(e.annotation==null?null:e.annotation.transcription)&&e.showTranscriptionButton)}}var Ot=(()=>{let r=class r{constructor(t,i,o){this.analyticsService=t,this.loggingService=i,this.chunkLoaderService=o,this.showControls=!0,this.showSubtitlesButton=!0,this.showTranscriptionButton=!0,this.transcriptionMode="floating",this.play=new C,this.pause=new C,this.delete=new C,this.transcriptionButtonClick=new C,this.transcriptionSummaryCopy=new C,this.subtitlesButtonClick=new C,this.transcriptionTimestampClick=new C,this.transcriptionPanelDragged=new C,this.playing=!1,this.currentTime="",this.showSubtitles=!1,this.transcriptionVisible=!1,this.veltElement=!0}ngOnInit(){this.annotation?.transcription&&this.ensureRecorderChunkForEmbeds()}ensureRecorderChunkForEmbeds(){this.chunkLoaderService.ensureRecorderChunk().catch(t=>{this.loggingService.catch("Error in VideoPlayerComponent ensureRecorderChunkForEmbeds: ",t)})}trackByAttachmentId(t,i){return i?.attachmentId}toggleVideo(){try{if(this.videoRef?.nativeElement){let t=this.videoRef?.nativeElement;t&&(t.duration>0&&!t.paused?(t.pause(),this.playing=!1,this.pause.emit()):(t.play(),this.playing=!0,this.play.emit()))}}catch(t){this.loggingService.catch("Error in VideoPlayerComponent toggleVideo: ",t)}}toggleSubtitles(){try{this.ensureRecorderChunkForEmbeds(),this.showSubtitles=!this.showSubtitles}catch(t){this.loggingService.catch("Error in VideoPlayerComponent toggleSubtitles: ",t)}}toggleTranscription(){try{this.ensureRecorderChunkForEmbeds(),this.transcriptionVisible=!this.transcriptionVisible}catch(t){this.loggingService.catch("Error in VideoPlayerComponent toggleTranscription: ",t)}}onTranscriptionButtonClick(t){try{this.transcriptionButtonClick.emit(),t&&this.toggleTranscription()}catch(i){this.loggingService.catch("Error in VideoPlayerComponent onTranscriptionButtonClick: ",i)}}onTranscriptionSummaryCopy(){try{this.transcriptionSummaryCopy.emit()}catch(t){this.loggingService.catch("Error in VideoPlayerComponent onTranscriptionSummaryCopy: ",t)}}onSubtitlesButtonClick(t){try{this.subtitlesButtonClick.emit(),t&&this.toggleSubtitles()}catch(i){this.loggingService.catch("Error in VideoPlayerComponent onSubtitlesButtonClick: ",i)}}onDurationChange(t){try{t?.target?.value>=0&&this.videoRef&&(this.videoRef.nativeElement.currentTime=t.target.value*(this.annotation?.recordedTime?.duration||0)/1e3),this.playing||this.toggleVideo()}catch(i){this.loggingService.catch("Error in VideoPlayerComponent onDurationChange: ",i)}}timeUpdate(t){try{this.currentTime=this.formatSecondsAsTime(t)}catch(i){this.loggingService.catch("Error in VideoPlayerComponent timeUpdate: ",i)}}formatSecondsAsTime(t){try{let i=Math.floor(t/3600),o=Math.floor((t-i*3600)/60),s=Math.floor(t-i*3600-o*60);return i&&i<10&&(i="0"+i),o<10&&(o="0"+o),s<10&&(s="0"+s),(i?i+":":"")+o+":"+s}catch(i){return this.loggingService.catch("Error in VideoPlayerComponent formatSecondsAsTime: ",i),""}}onSeekToVideo(t,i){try{i&&(i.currentTime=t),this.playing||this.toggleVideo(),this.onTranscriptionTimestampClick(t)}catch(o){this.loggingService.catch("Error in VideoPlayerComponent onSeekToVideo: ",o)}}onTranscriptionTimestampClick(t){try{this.transcriptionTimestampClick.emit(t)}catch(i){this.loggingService.catch("Error in VideoPlayerComponent onTranscriptionTimestampClick: ",i)}}onTranscriptionPanelDragged(){try{this.transcriptionPanelDragged.emit()}catch(t){this.loggingService.catch("Error in VideoPlayerComponent onTranscriptionPanelDragged: ",t)}}onDelete(){try{this.delete?.emit()}catch(t){this.loggingService.catch("Error in VideoPlayerComponent onDelete: ",t)}}};r.\u0275fac=function(i){return new(i||r)(S(Q),S(O),S(J))},r.\u0275cmp=H({type:r,selectors:[["snippyly-video-player"]],viewQuery:function(i,o){if(i&1&&Z(et,5),i&2){let s;A(s=q())&&(o.videoRef=s.first)}},hostVars:1,hostBindings:function(i,o){i&2&&L("data-velt-element",o.veltElement)},inputs:{annotation:"annotation",showControls:"showControls",showSubtitlesButton:"showSubtitlesButton",showTranscriptionButton:"showTranscriptionButton",showDeleteButton:"showDeleteButton",transcriptionMode:"transcriptionMode"},outputs:{play:"play",pause:"pause",delete:"delete",transcriptionButtonClick:"transcriptionButtonClick",transcriptionSummaryCopy:"transcriptionSummaryCopy",subtitlesButtonClick:"subtitlesButtonClick",transcriptionTimestampClick:"transcriptionTimestampClick",transcriptionPanelDragged:"transcriptionPanelDragged"},standalone:!1,decls:9,vars:8,consts:[["videoRef",""],["subtitlesRef",""],[1,"s-video-player-container"],[1,"s-video-player",3,"click","pointerdown","pointerup"],["playsinline","",3,"timeupdate","pointerdown","poster"],["type","video/mp4",3,"src",4,"ngIf"],[3,"ngIf"],["class","s-video-subtitles-wrap",3,"hide",4,"ngIf"],["class","s-video-controls-wrap",4,"ngIf"],["class","s-video-transcription",3,"click","pointerdown","pointerup",4,"ngIf"],["type","video/mp4",3,"src"],[3,"src","type",4,"ngFor","ngForOf","ngForTrackBy"],[3,"src","type"],[1,"s-video-subtitles-wrap"],[1,"subtitles"],[3,"subtitlesButtonClick","transcription","timeToRead","mode"],[1,"s-video-controls-wrap"],[1,"s-video-progress-bar"],["type","range","min","0","max","1","step","0.01",3,"value","input",4,"ngIf"],[1,"s-video-controls"],[1,"s-video-controls-left"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click",4,"ngIf"],["width","20","height","20","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click",4,"ngIf"],[1,"s-video-controls-right"],["class","s-video-subtitles-btn s-tooltip",3,"disabled",4,"ngIf"],["class","s-video-transcription-btn s-tooltip",3,"disabled","click",4,"ngIf"],[3,"transcription","timeToRead","transcriptionButtonClick","transcriptionSummaryCopy","seekTo","transcriptionPanelDragged",4,"ngIf"],["width","20","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg","class","delete-btn",3,"click",4,"ngIf"],["type","range","min","0","max","1","step","0.01",3,"input","value"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click"],["d","M3.08337 3.65485C3.08337 1.69607 5.23378 0.498172 6.89926 1.52918L17.1496 7.87464C18.7284 8.852 18.7284 11.1486 17.1496 12.126L6.89926 18.4714C5.23378 19.5024 3.08337 18.3045 3.08337 16.3458V3.65485Z","fill","white"],["width","20","height","20","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click"],["d","M1.33203 2.66536C1.33203 1.92899 1.92898 1.33203 2.66536 1.33203H5.33203C6.06841 1.33203 6.66536 1.92898 6.66536 2.66536V13.332C6.66536 14.0684 6.06841 14.6654 5.33203 14.6654H2.66536C1.92898 14.6654 1.33203 14.0684 1.33203 13.332V2.66536Z","fill","white"],["d","M9.33203 2.66536C9.33203 1.92899 9.92899 1.33203 10.6654 1.33203H13.332C14.0684 1.33203 14.6654 1.92898 14.6654 2.66536V13.332C14.6654 14.0684 14.0684 14.6654 13.332 14.6654H10.6654C9.92899 14.6654 9.33203 14.0684 9.33203 13.332V2.66536Z","fill","white"],[1,"s-video-subtitles-btn","s-tooltip"],["class","s-tooltiptext top",4,"ngIf"],["width","20","height","21","viewBox","0 0 20 21","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click"],["d","M11.47 7.62875C11.893 7.41764 12.3718 7.34543 12.8382 7.42242C13.3046 7.49941 13.7348 7.72166 14.0675 8.0575C14.1849 8.17486 14.2508 8.33403 14.2508 8.5C14.2508 8.66597 14.1849 8.82514 14.0675 8.9425C13.9501 9.05986 13.791 9.12579 13.625 9.12579C13.459 9.12579 13.2999 9.05986 13.1825 8.9425C13.0358 8.79219 12.8452 8.69223 12.6382 8.65697C12.4311 8.62171 12.2182 8.65297 12.03 8.74625C11.6712 8.92625 11.25 9.41875 11.25 10.5C11.25 11.5813 11.6712 12.075 12.03 12.2537C12.2182 12.347 12.4311 12.3783 12.6382 12.343C12.8452 12.3078 13.0358 12.2078 13.1825 12.0575C13.2999 11.9401 13.459 11.8742 13.625 11.8742C13.791 11.8742 13.9501 11.9401 14.0675 12.0575C14.1849 12.1749 14.2508 12.334 14.2508 12.5C14.2508 12.666 14.1849 12.8251 14.0675 12.9425C13.38 13.63 12.34 13.8062 11.47 13.3713C10.5787 12.9262 10 11.9187 10 10.5C10 9.08125 10.5787 8.075 11.47 7.62875ZM9.0675 8.0575C8.73492 7.72149 8.3047 7.49913 7.83824 7.42213C7.37178 7.34514 6.89292 7.41745 6.47 7.62875C5.57875 8.07375 5 9.08125 5 10.5C5 11.9187 5.57875 12.925 6.47 13.3713C6.89292 13.5826 7.37178 13.6549 7.83824 13.5779C8.3047 13.5009 8.73492 13.2785 9.0675 12.9425C9.12561 12.8844 9.1717 12.8154 9.20315 12.7395C9.2346 12.6636 9.25079 12.5822 9.25079 12.5C9.25079 12.4178 9.2346 12.3364 9.20315 12.2605C9.1717 12.1846 9.12561 12.1156 9.0675 12.0575C9.00939 11.9994 8.9404 11.9533 8.86448 11.9218C8.78855 11.8904 8.70718 11.8742 8.625 11.8742C8.54282 11.8742 8.46144 11.8904 8.38552 11.9218C8.3096 11.9533 8.24061 11.9994 8.1825 12.0575C8.03568 12.2076 7.84513 12.3075 7.63811 12.3427C7.4311 12.378 7.21823 12.3468 7.03 12.2537C6.67125 12.0738 6.25 11.5813 6.25 10.5C6.25 9.41875 6.67125 8.925 7.03 8.74625C7.21823 8.65316 7.4311 8.62201 7.63811 8.65726C7.84513 8.69251 8.03568 8.79236 8.1825 8.9425C8.29986 9.05986 8.45903 9.12579 8.625 9.12579C8.79097 9.12579 8.95014 9.05986 9.0675 8.9425C9.18486 8.82514 9.25079 8.66597 9.25079 8.5C9.25079 8.33403 9.18486 8.17486 9.0675 8.0575ZM1.25 7.375C1.25 6.5462 1.57924 5.75134 2.16529 5.16529C2.75134 4.57924 3.5462 4.25 4.375 4.25H15.625C16.4538 4.25 17.2487 4.57924 17.8347 5.16529C18.4208 5.75134 18.75 6.5462 18.75 7.375V13.625C18.75 14.4538 18.4208 15.2487 17.8347 15.8347C17.2487 16.4208 16.4538 16.75 15.625 16.75H4.375C3.5462 16.75 2.75134 16.4208 2.16529 15.8347C1.57924 15.2487 1.25 14.4538 1.25 13.625V7.375ZM4.375 5.5C3.87772 5.5 3.40081 5.69754 3.04917 6.04917C2.69754 6.40081 2.5 6.87772 2.5 7.375V13.625C2.5 14.1223 2.69754 14.5992 3.04917 14.9508C3.40081 15.3025 3.87772 15.5 4.375 15.5H15.625C16.1223 15.5 16.5992 15.3025 16.9508 14.9508C17.3025 14.5992 17.5 14.1223 17.5 13.625V7.375C17.5 6.87772 17.3025 6.40081 16.9508 6.04917C16.5992 5.69754 16.1223 5.5 15.625 5.5H4.375Z","fill","white"],[1,"s-tooltiptext","top"],[1,"s-video-transcription-btn","s-tooltip",3,"click"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M7.49997 10.8332C9.34164 10.8332 10.8333 9.3415 10.8333 7.49984C10.8333 5.65817 9.34164 4.1665 7.49997 4.1665C5.65831 4.1665 4.16664 5.65817 4.16664 7.49984C4.16664 9.3415 5.65831 10.8332 7.49997 10.8332ZM7.49997 5.83317C8.41664 5.83317 9.16664 6.58317 9.16664 7.49984C9.16664 8.4165 8.41664 9.1665 7.49997 9.1665C6.58331 9.1665 5.83331 8.4165 5.83331 7.49984C5.83331 6.58317 6.58331 5.83317 7.49997 5.83317ZM12.825 12.9665C11.425 12.2498 9.60831 11.6665 7.49997 11.6665C5.39164 11.6665 3.57497 12.2498 2.17497 12.9665C1.76835 13.1759 1.42772 13.4939 1.19089 13.8852C0.954055 14.2765 0.830281 14.7258 0.833306 15.1832V17.4998H14.1666V15.1832C14.1666 14.2498 13.6583 13.3915 12.825 12.9665ZM12.5 15.8332H2.49997V15.1832C2.49997 14.8665 2.66664 14.5832 2.93331 14.4498C3.92497 13.9415 5.52497 13.3332 7.49997 13.3332C9.47497 13.3332 11.075 13.9415 12.0666 14.4498C12.3333 14.5832 12.5 14.8665 12.5 15.1832V15.8332ZM14.9416 13.3332L16.3 11.9748C13.9916 9.45817 13.9916 5.67484 16.3 3.02484L14.9416 1.6665C11.6916 4.90817 11.6833 9.95817 14.9416 13.3332ZM19.1 9.12484C18.7587 8.65332 18.5749 8.08609 18.5749 7.504C18.5749 6.92192 18.7587 6.35469 19.1 5.88317L17.7 4.47484C16.0166 6.15817 16.0166 8.69984 17.7 10.5332L19.1 9.12484Z","fill","white"],[3,"transcriptionButtonClick","transcriptionSummaryCopy","seekTo","transcriptionPanelDragged","transcription","timeToRead"],["width","20","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg",1,"delete-btn",3,"click"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.28702 4.66602V12.2851C4.28702 13.1266 5.01189 13.8089 5.90606 13.8089H10.7632C11.6574 13.8089 12.3823 13.1266 12.3823 12.2851V4.66602H14.0013V12.2851C14.0013 13.9682 12.5516 15.3327 10.7632 15.3327H5.90606C4.11771 15.3327 2.66797 13.9682 2.66797 12.2851V4.66602H4.28702Z","fill","#FF7162"],["d","M6.77778 6.66602C6.34822 6.66602 6 7.06398 6 7.5549V11.1105C6 11.6014 6.34822 11.9993 6.77778 11.9993C7.20733 11.9993 7.55556 11.6014 7.55556 11.1105V7.5549C7.55556 7.06398 7.20733 6.66602 6.77778 6.66602Z","fill","#FF7162"],["d","M9.88889 6.66602C9.45933 6.66602 9.11111 7.06398 9.11111 7.5549V11.1105C9.11111 11.6014 9.45933 11.9993 9.88889 11.9993C10.3184 11.9993 10.6667 11.6014 10.6667 11.1105V7.5549C10.6667 7.06398 10.3184 6.66602 9.88889 6.66602Z","fill","#FF7162"],["fill-rule","evenodd","clip-rule","evenodd","d","M5.16667 3.11111V2.33333C5.16667 1.04467 6.22999 0 7.54167 0H9.125C10.4367 0 11.5 1.04467 11.5 2.33333V3.11111H13.875C14.3122 3.11111 14.6667 3.45933 14.6667 3.88889C14.6667 4.31844 14.3122 4.66667 13.875 4.66667H2.79167C2.35444 4.66667 2 4.31844 2 3.88889C2 3.45933 2.35444 3.11111 2.79167 3.11111H5.16667ZM6.75 2.33333C6.75 1.90378 7.10444 1.55556 7.54167 1.55556H9.125C9.56223 1.55556 9.91667 1.90378 9.91667 2.33333V3.11111H6.75V2.33333Z","fill","#FF7162"],[1,"s-video-transcription",3,"click","pointerdown","pointerup"],[3,"transcription","timeToRead","mode","visible","seekTo","close","transcriptionSummaryCopy","transcriptionPanelDragged",4,"ngIf"],[3,"seekTo","close","transcriptionSummaryCopy","transcriptionPanelDragged","transcription","timeToRead","mode","visible"]],template:function(i,o){if(i&1){let s=_();u(0,"div",2)(1,"div",3),g("click",function(h){return l(s),c(h.stopPropagation())})("pointerdown",function(h){return l(s),c(h.stopPropagation())})("pointerup",function(h){return l(s),c(h.stopPropagation())}),u(2,"video",4,0),g("timeupdate",function(){l(s);let h=f(3);return c(o.timeUpdate(h==null?null:h.currentTime))})("pointerdown",function(){return l(s),c(o.toggleVideo())}),v(4,it,1,1,"source",5)(5,ot,2,4,"ng-template",6),d(),v(6,rt,4,5,"div",7)(7,gt,14,8,"div",8),d(),v(8,vt,2,1,"div",9),d()}i&2&&(m(2),b("flip",(o.annotation==null?null:o.annotation.recordingType)==="video"),p("poster",(o.annotation==null||o.annotation.attachment==null?null:o.annotation.attachment.thumbnail)||(!(o.annotation==null||o.annotation.attachments==null)&&o.annotation.attachments.length?o.annotation==null||o.annotation.attachments[0]==null?null:o.annotation.attachments[0].thumbnail:"")),m(2),p("ngIf",!(!(o.annotation==null||o.annotation.attachments==null)&&o.annotation.attachments.length)&&(o.annotation==null?null:o.annotation.attachment)),m(),p("ngIf",o.annotation==null||o.annotation.attachments==null?null:o.annotation.attachments.length),m(),p("ngIf",o.showSubtitles),m(),p("ngIf",o.showControls),m(),p("ngIf",o.transcriptionVisible))},dependencies:[z,G,$,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;line-height:1.5!important;color:#fff!important;font-size:calc((.9rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){height:unset;width:unset}*[_ngcontent-%COMP%]:empty:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){display:revert!important}.s-video-player[_ngcontent-%COMP%]{position:relative!important;display:flex!important;justify-content:center!important;align-items:center!important;border-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;background-color:#d3d3d3!important}.s-video-player[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important;height:100%!important;border-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important}.controls-wrap[_ngcontent-%COMP%]{position:absolute!important;bottom:0!important;display:flex!important;justify-content:space-between!important;align-items:center!important;width:80%!important;padding:1em!important;font-style:normal!important;font-weight:400!important;font-size:1em!important;line-height:1em!important;color:#fff!important}.controls[_ngcontent-%COMP%]{display:flex!important;justify-content:center!important;align-items:center!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.line[_ngcontent-%COMP%]{position:absolute!important;bottom:100%!important;width:90%!important;display:flex!important;align-items:center!important}.line[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%!important}.s-video-subtitles-wrap[_ngcontent-%COMP%]{position:absolute;width:calc((25rem + 0px) * var(--velt-base-rem-unit))!important;max-width:90%!important;bottom:10%!important;left:50%!important;transform:translate(-50%)!important;transition:bottom .3s!important}.s-video-subtitles-wrap[_ngcontent-%COMP%] .subtitles[_ngcontent-%COMP%]{background:#141416!important;border-radius:calc((.6rem + 0px) * var(--velt-base-rem-unit))!important;line-height:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;text-align:center!important}.s-video-subtitles-wrap.hide[_ngcontent-%COMP%]{display:none!important}svg[_ngcontent-%COMP%]{cursor:pointer!important}.s-video-player[_ngcontent-%COMP%]:hover .s-video-subtitles-wrap[_ngcontent-%COMP%]{bottom:calc(10% + 80px)!important}.s-video-player[_ngcontent-%COMP%]:hover .s-video-controls-wrap[_ngcontent-%COMP%]{opacity:1!important}.s-video-controls-wrap[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;position:absolute!important;z-index:10!important;bottom:0!important;width:100%!important;border-bottom-left-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;border-bottom-right-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;overflow:hidden!important;padding:calc((1rem + 0px) * var(--velt-base-rem-unit)) calc((2rem + 0px) * var(--velt-base-rem-unit))!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;opacity:0!important;transition:opacity .3s!important;background:#141416!important;background:linear-gradient(0deg,#141416,#37373700)!important;padding-top:calc((5rem + 0px) * var(--velt-base-rem-unit))!important}.s-video-controls-wrap[_ngcontent-%COMP%] .s-video-progress-bar[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%!important;accent-color:#625DF5!important}.s-video-controls-wrap[_ngcontent-%COMP%] .s-video-controls[_ngcontent-%COMP%]{display:flex!important;justify-content:space-between!important;align-items:center!important}.s-video-controls-wrap[_ngcontent-%COMP%] .s-video-controls[_ngcontent-%COMP%] .s-video-controls-left[_ngcontent-%COMP%]{display:flex!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;align-items:center!important}.s-video-controls-wrap[_ngcontent-%COMP%] .s-video-controls[_ngcontent-%COMP%] .s-video-controls-right[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.s-video-player-container[_ngcontent-%COMP%]{width:100%!important;height:100%!important;box-sizing:border-box!important;display:flex!important;gap:2rem!important}.s-video-player-container[_ngcontent-%COMP%] .s-video-player[_ngcontent-%COMP%]{flex:1 1 100%!important;height:100%!important;background-color:#141416!important;border-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;display:flex!important}.s-video-player-container[_ngcontent-%COMP%] .s-video-player[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%!important}.s-video-player-container[_ngcontent-%COMP%] .s-video-transcription[_ngcontent-%COMP%]{flex:0 0 auto!important;width:calc((25rem + 0px) * var(--velt-base-rem-unit))!important;border-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;height:100%!important;overflow:hidden!important}.s-video-subtitles-btn[_ngcontent-%COMP%], .s-video-transcription-btn[_ngcontent-%COMP%]{display:flex!important}.s-video-subtitles-btn.disabled[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .s-video-transcription-btn.disabled[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{cursor:not-allowed!important}.s-video-subtitles-btn.disabled[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] path[_ngcontent-%COMP%], .s-video-transcription-btn.disabled[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:#80808a!important}"],changeDetection:0});let n=r;return n})();var It=(()=>{let r=class r{transform(t){try{if(!t||t<0||!isFinite(t))return"00:00:00";let i=Math.floor(t/1e3),o=Math.floor(i/3600),s=Math.floor(i%3600/60),P=i%60,h=j=>isNaN(j)?"00":j.toString().padStart(2,"0"),V=h(o),x=h(s),K=h(P);return`${V}:${x}:${K}`}catch(i){return console.error("Error in hourMinSecTimeDisplay pipe:",i),null}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275pipe=k({name:"hourMinSecTimeDisplay",type:r,pure:!0});let n=r;return n})();export{W as a,Ot as b,It as c,J as d};
1
+ import{b as $}from"./chunk-EH2S2WYW.js";import{$ as D,Db as Z,Eb as A,Fa as m,Fb as q,Fc as z,Ga as C,Gc as G,Ib as f,Kb as b,Ke as U,Nb as T,Ob as N,Pa as S,Pb as I,Ua as H,Xa as k,_a as v,ca as B,db as L,ha as l,ia as c,ja as w,ji as Q,kc as M,ki as O,la as F,lb as p,lc as E,mb as u,nb as d,ob as y,vb as _,xb as g,zb as a}from"./chunk-YUWFUH6R.js";var W=(()=>{let r=class r{transform(t,i,...o){try{let s=t&&t?.slice?t?.slice():[];return s?.length&&new U().getBrowserName()?.toLocaleLowerCase()==="safari"&&(s=s.sort((V,x)=>V.type==="mp4"&&x.type!=="mp4"?-1:V.type!=="mp4"&&x.type==="mp4"?1:0)),s}catch{return t}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275pipe=k({name:"rearrangeMediaSource",type:r,pure:!0});let n=r;return n})();var J=(()=>{let r=class r{constructor(t,i){this.injector=t,this.loggingService=i,this.arrowPromise=null,this.commentPromise=null,this.cursorPromise=null,this.huddlePromise=null,this.notificationPromise=null,this.presencePromise=null,this.reactionPromise=null,this.recorderPromise=null,this.tagPromise=null,this.rewriterPromise=null,this.selectionPromise=null,this.areaPromise=null,this.activityLogPromise=null,this.viewPromise=null,this.userInvitePromise=null,this.userRequestPromise=null,this.videoPlayerPromise=null,this.crdtPromise=null,this.liveStateSyncPromise=null,this.loggingService.log("%c[WB] Creating CLASS: ChunkLoaderService","color: blue;")}ensureArrowChunk(){return this.arrowPromise||(this.arrowPromise=import("./velt-arrow.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading arrow chunk: ",t),this.arrowPromise=null,t})),this.arrowPromise}ensureCommentChunk(){return this.commentPromise||(this.commentPromise=import("./velt-comment.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading comment chunk: ",t),this.commentPromise=null,t})),this.commentPromise}ensureCursorChunk(){return this.cursorPromise||(this.cursorPromise=import("./velt-cursor.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading cursor chunk: ",t),this.cursorPromise=null,t})),this.cursorPromise}ensureHuddleChunk(){return this.huddlePromise||(this.huddlePromise=import("./velt-huddle.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading huddle chunk: ",t),this.huddlePromise=null,t})),this.huddlePromise}ensureNotificationChunk(){return this.notificationPromise||(this.notificationPromise=import("./velt-notification.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading notification chunk: ",t),this.notificationPromise=null,t})),this.notificationPromise}ensurePresenceChunk(){return this.presencePromise||(this.presencePromise=import("./velt-presence.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading presence chunk: ",t),this.presencePromise=null,t})),this.presencePromise}ensureReactionChunk(){return this.reactionPromise||(this.reactionPromise=import("./velt-reaction.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading reaction chunk: ",t),this.reactionPromise=null,t})),this.reactionPromise}ensureRecorderChunk(){return this.recorderPromise||(this.recorderPromise=import("./velt-recorder.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading recorder chunk: ",t),this.recorderPromise=null,t})),this.recorderPromise}ensureTagChunk(){return this.tagPromise||(this.tagPromise=import("./velt-tag.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading tag chunk: ",t),this.tagPromise=null,t})),this.tagPromise}ensureRewriterChunk(){return this.rewriterPromise||(this.rewriterPromise=import("./velt-rewriter.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading rewriter chunk: ",t),this.rewriterPromise=null,t})),this.rewriterPromise}ensureSelectionChunk(){return this.selectionPromise||(this.selectionPromise=import("./velt-selection.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading selection chunk: ",t),this.selectionPromise=null,t})),this.selectionPromise}ensureAreaChunk(){return this.areaPromise||(this.areaPromise=import("./velt-area.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading area chunk: ",t),this.areaPromise=null,t})),this.areaPromise}ensureActivityLogChunk(){return this.activityLogPromise||(this.activityLogPromise=import("./velt-activity-log.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading activity-log chunk: ",t),this.activityLogPromise=null,t})),this.activityLogPromise}ensureViewChunk(){return this.viewPromise||(this.viewPromise=import("./velt-views.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading view chunk: ",t),this.viewPromise=null,t})),this.viewPromise}ensureUserInviteChunk(){return this.userInvitePromise||(this.userInvitePromise=import("./velt-user-invite.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading user-invite chunk: ",t),this.userInvitePromise=null,t})),this.userInvitePromise}ensureUserRequestChunk(){return this.userRequestPromise||(this.userRequestPromise=import("./velt-user-request.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading user-request chunk: ",t),this.userRequestPromise=null,t})),this.userRequestPromise}ensureVideoPlayerChunk(){return this.videoPlayerPromise||(this.videoPlayerPromise=import("./velt-video-player.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading video-player chunk: ",t),this.videoPlayerPromise=null,t})),this.videoPlayerPromise}ensureCrdtChunk(){return this.crdtPromise||(this.crdtPromise=import("./velt-crdt.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading crdt chunk: ",t),this.crdtPromise=null,t})),this.crdtPromise}ensureLiveStateSyncChunk(){return this.liveStateSyncPromise||(this.liveStateSyncPromise=import("./velt-live-state-sync.js").then(t=>t.default(this.injector)).catch(t=>{throw this.loggingService.catch("Error loading live-state-sync chunk: ",t),this.liveStateSyncPromise=null,t})),this.liveStateSyncPromise}};r.\u0275fac=function(i){return new(i||r)(B(F),B(O))},r.\u0275prov=D({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var et=["videoRef"];function it(n,r){if(n&1&&y(0,"source",10),n&2){let e=a();p("src",!(e.annotation==null||e.annotation.attachment==null)&&e.annotation.attachment.thumbnail?e.annotation==null||e.annotation.attachment==null?null:e.annotation.attachment.url:(e.annotation==null||e.annotation.attachment==null?null:e.annotation.attachment.url)+"#t=0.001")}}function nt(n,r){if(n&1&&y(0,"source",12),n&2){let e=r.$implicit;p("src",e==null?null:e.url)("type",(e==null?null:e.mimeType)||"video/mp4")}}function ot(n,r){if(n&1&&(v(0,nt,1,2,"source",11),M(1,"rearrangeMediaSource")),n&2){let e=a();p("ngForOf",E(1,2,e.annotation==null?null:e.annotation.attachments))("ngForTrackBy",e.trackByAttachmentId)}}function rt(n,r){if(n&1){let e=_();u(0,"div",13)(1,"div",14)(2,"snippyly-subtitles-embed",15,1),g("subtitlesButtonClick",function(){l(e);let i=a();return c(i.onSubtitlesButtonClick())}),d()()()}if(n&2){let e,t=f(3),i=a(),o=f(3);b("hide",(t==null?null:t.componentConfigSignal)&&(t==null||(e=t.componentConfigSignal())==null?null:e.highlightedTextIndex)<0),m(2),p("transcription",i.annotation==null?null:i.annotation.transcription)("timeToRead",(o==null?null:o.currentTime)||0)("mode","embed")}}function at(n,r){if(n&1){let e=_();u(0,"input",28),g("input",function(i){l(e);let o=a(2);return c(o.onDurationChange(i))}),d()}if(n&2){let e=a(2),t=f(3);p("value",(t==null?null:t.currentTime)*1e3/((e.annotation==null||e.annotation.recordedTime==null?null:e.annotation.recordedTime.duration)||0))}}function st(n,r){if(n&1){let e=_();w(),u(0,"svg",29),g("click",function(){l(e);let i=a(2);return c(i.toggleVideo())}),y(1,"path",30),d()}}function lt(n,r){if(n&1){let e=_();w(),u(0,"svg",31),g("click",function(){l(e);let i=a(2);return c(i.toggleVideo())}),y(1,"path",32)(2,"path",33),d()}}function ct(n,r){n&1&&(u(0,"span",38),T(1),M(2,"translate"),d()),n&2&&(m(),I(" ",E(2,1,"Subtitles not available")," "))}function pt(n,r){if(n&1){let e=_();u(0,"div",34),v(1,ct,3,3,"span",35),w(),u(2,"svg",36),g("click",function(){l(e);let i=a(2);return c(!(i.annotation==null||i.annotation.transcription==null)&&i.annotation.transcription.transcriptedText?i.onSubtitlesButtonClick(!0):null)}),y(3,"path",37),d()()}if(n&2){let e=a(2);b("disabled",!(!(e.annotation==null||e.annotation.transcription==null)&&e.annotation.transcription.transcriptedText)),m(),p("ngIf",!(!(e.annotation==null||e.annotation.transcription==null)&&e.annotation.transcription.transcriptedText))}}function mt(n,r){n&1&&(u(0,"span",38),T(1),M(2,"translate"),d()),n&2&&(m(),I(" ",E(2,1,"Transcription not available")))}function ut(n,r){if(n&1){let e=_();u(0,"div",39),g("click",function(){l(e);let i=a(2);return c(!(i.annotation==null||i.annotation.transcription==null)&&i.annotation.transcription.transcriptedText?i.onTranscriptionButtonClick(!0):null)}),v(1,mt,3,3,"span",35),w(),u(2,"svg",40),y(3,"path",41),d()()}if(n&2){let e=a(2);b("disabled",!(!(e.annotation==null||e.annotation.transcription==null)&&e.annotation.transcription.transcriptedText)),m(),p("ngIf",!(!(e.annotation==null||e.annotation.transcription==null)&&e.annotation.transcription.transcriptedText))}}function dt(n,r){if(n&1){let e=_();u(0,"snippyly-transcription-embed",42),g("transcriptionButtonClick",function(){l(e);let i=a(2);return c(i.onTranscriptionButtonClick())})("transcriptionSummaryCopy",function(){l(e);let i=a(2);return c(i.onTranscriptionSummaryCopy())})("seekTo",function(i){l(e);let o=a(2),s=f(3);return c(o.onSeekToVideo(i,s))})("transcriptionPanelDragged",function(){l(e);let i=a(2);return c(i.onTranscriptionPanelDragged())}),d()}if(n&2){let e=a(2),t=f(3);p("transcription",e.annotation==null?null:e.annotation.transcription)("timeToRead",(t==null?null:t.currentTime)||0)}}function ht(n,r){if(n&1){let e=_();w(),u(0,"svg",43),g("click",function(){l(e);let i=a(2);return c(i.onDelete())}),y(1,"path",44)(2,"path",45)(3,"path",46)(4,"path",47),d()}}function gt(n,r){if(n&1&&(u(0,"div",16)(1,"div",17),v(2,at,1,1,"input",18),d(),u(3,"div",19)(4,"div",20),v(5,st,2,0,"svg",21)(6,lt,3,0,"svg",22),u(7,"span"),T(8),d()(),u(9,"div",23),v(10,pt,4,3,"div",24)(11,ut,4,3,"div",25)(12,dt,1,2,"snippyly-transcription-embed",26)(13,ht,5,0,"svg",27),d()()()),n&2){let e=a();m(2),p("ngIf",e.annotation==null||e.annotation.recordedTime==null?null:e.annotation.recordedTime.duration),m(3),p("ngIf",!e.playing),m(),p("ngIf",e.playing),m(2),N(e.currentTime||(e.annotation==null||e.annotation.recordedTime==null?null:e.annotation.recordedTime.display)||"00:00"),m(2),p("ngIf",(e.annotation==null?null:e.annotation.transcription)&&e.showSubtitlesButton),m(),p("ngIf",(e.annotation==null?null:e.annotation.transcription)&&e.transcriptionMode==="embed"),m(),p("ngIf",(e.annotation==null?null:e.annotation.transcription)&&e.transcriptionMode==="floating"&&e.showTranscriptionButton),m(),p("ngIf",e.showDeleteButton)}}function _t(n,r){if(n&1){let e=_();u(0,"snippyly-transcription-embed",50),g("seekTo",function(i){l(e);let o=a(2),s=f(3);return c(o.onSeekToVideo(i,s))})("close",function(){l(e);let i=a(2);return c(i.toggleTranscription())})("transcriptionSummaryCopy",function(){l(e);let i=a(2);return c(i.onTranscriptionSummaryCopy())})("transcriptionPanelDragged",function(){l(e);let i=a(2);return c(i.onTranscriptionPanelDragged())}),d()}if(n&2){let e=a(2),t=f(3);p("transcription",e.annotation==null?null:e.annotation.transcription)("timeToRead",(t==null?null:t.currentTime)||0)("mode",e.transcriptionMode)("visible",!0)}}function vt(n,r){if(n&1){let e=_();u(0,"div",48),g("click",function(i){return l(e),c(i.stopPropagation())})("pointerdown",function(i){return l(e),c(i.stopPropagation())})("pointerup",function(i){return l(e),c(i.stopPropagation())}),v(1,_t,1,4,"snippyly-transcription-embed",49),d()}if(n&2){let e=a();m(),p("ngIf",(e.annotation==null?null:e.annotation.transcription)&&e.showTranscriptionButton)}}var Ot=(()=>{let r=class r{constructor(t,i,o){this.analyticsService=t,this.loggingService=i,this.chunkLoaderService=o,this.showControls=!0,this.showSubtitlesButton=!0,this.showTranscriptionButton=!0,this.transcriptionMode="floating",this.play=new C,this.pause=new C,this.delete=new C,this.transcriptionButtonClick=new C,this.transcriptionSummaryCopy=new C,this.subtitlesButtonClick=new C,this.transcriptionTimestampClick=new C,this.transcriptionPanelDragged=new C,this.playing=!1,this.currentTime="",this.showSubtitles=!1,this.transcriptionVisible=!1,this.veltElement=!0}ngOnInit(){this.annotation?.transcription&&this.ensureRecorderChunkForEmbeds()}ensureRecorderChunkForEmbeds(){this.chunkLoaderService.ensureRecorderChunk().catch(t=>{this.loggingService.catch("Error in VideoPlayerComponent ensureRecorderChunkForEmbeds: ",t)})}trackByAttachmentId(t,i){return i?.attachmentId}toggleVideo(){try{if(this.videoRef?.nativeElement){let t=this.videoRef?.nativeElement;t&&(t.duration>0&&!t.paused?(t.pause(),this.playing=!1,this.pause.emit()):(t.play(),this.playing=!0,this.play.emit()))}}catch(t){this.loggingService.catch("Error in VideoPlayerComponent toggleVideo: ",t)}}toggleSubtitles(){try{this.ensureRecorderChunkForEmbeds(),this.showSubtitles=!this.showSubtitles}catch(t){this.loggingService.catch("Error in VideoPlayerComponent toggleSubtitles: ",t)}}toggleTranscription(){try{this.ensureRecorderChunkForEmbeds(),this.transcriptionVisible=!this.transcriptionVisible}catch(t){this.loggingService.catch("Error in VideoPlayerComponent toggleTranscription: ",t)}}onTranscriptionButtonClick(t){try{this.transcriptionButtonClick.emit(),t&&this.toggleTranscription()}catch(i){this.loggingService.catch("Error in VideoPlayerComponent onTranscriptionButtonClick: ",i)}}onTranscriptionSummaryCopy(){try{this.transcriptionSummaryCopy.emit()}catch(t){this.loggingService.catch("Error in VideoPlayerComponent onTranscriptionSummaryCopy: ",t)}}onSubtitlesButtonClick(t){try{this.subtitlesButtonClick.emit(),t&&this.toggleSubtitles()}catch(i){this.loggingService.catch("Error in VideoPlayerComponent onSubtitlesButtonClick: ",i)}}onDurationChange(t){try{t?.target?.value>=0&&this.videoRef&&(this.videoRef.nativeElement.currentTime=t.target.value*(this.annotation?.recordedTime?.duration||0)/1e3),this.playing||this.toggleVideo()}catch(i){this.loggingService.catch("Error in VideoPlayerComponent onDurationChange: ",i)}}timeUpdate(t){try{this.currentTime=this.formatSecondsAsTime(t)}catch(i){this.loggingService.catch("Error in VideoPlayerComponent timeUpdate: ",i)}}formatSecondsAsTime(t){try{let i=Math.floor(t/3600),o=Math.floor((t-i*3600)/60),s=Math.floor(t-i*3600-o*60);return i&&i<10&&(i="0"+i),o<10&&(o="0"+o),s<10&&(s="0"+s),(i?i+":":"")+o+":"+s}catch(i){return this.loggingService.catch("Error in VideoPlayerComponent formatSecondsAsTime: ",i),""}}onSeekToVideo(t,i){try{i&&(i.currentTime=t),this.playing||this.toggleVideo(),this.onTranscriptionTimestampClick(t)}catch(o){this.loggingService.catch("Error in VideoPlayerComponent onSeekToVideo: ",o)}}onTranscriptionTimestampClick(t){try{this.transcriptionTimestampClick.emit(t)}catch(i){this.loggingService.catch("Error in VideoPlayerComponent onTranscriptionTimestampClick: ",i)}}onTranscriptionPanelDragged(){try{this.transcriptionPanelDragged.emit()}catch(t){this.loggingService.catch("Error in VideoPlayerComponent onTranscriptionPanelDragged: ",t)}}onDelete(){try{this.delete?.emit()}catch(t){this.loggingService.catch("Error in VideoPlayerComponent onDelete: ",t)}}};r.\u0275fac=function(i){return new(i||r)(S(Q),S(O),S(J))},r.\u0275cmp=H({type:r,selectors:[["snippyly-video-player"]],viewQuery:function(i,o){if(i&1&&Z(et,5),i&2){let s;A(s=q())&&(o.videoRef=s.first)}},hostVars:1,hostBindings:function(i,o){i&2&&L("data-velt-element",o.veltElement)},inputs:{annotation:"annotation",showControls:"showControls",showSubtitlesButton:"showSubtitlesButton",showTranscriptionButton:"showTranscriptionButton",showDeleteButton:"showDeleteButton",transcriptionMode:"transcriptionMode"},outputs:{play:"play",pause:"pause",delete:"delete",transcriptionButtonClick:"transcriptionButtonClick",transcriptionSummaryCopy:"transcriptionSummaryCopy",subtitlesButtonClick:"subtitlesButtonClick",transcriptionTimestampClick:"transcriptionTimestampClick",transcriptionPanelDragged:"transcriptionPanelDragged"},standalone:!1,decls:9,vars:8,consts:[["videoRef",""],["subtitlesRef",""],[1,"s-video-player-container"],[1,"s-video-player",3,"click","pointerdown","pointerup"],["playsinline","",3,"timeupdate","pointerdown","poster"],["type","video/mp4",3,"src",4,"ngIf"],[3,"ngIf"],["class","s-video-subtitles-wrap",3,"hide",4,"ngIf"],["class","s-video-controls-wrap",4,"ngIf"],["class","s-video-transcription",3,"click","pointerdown","pointerup",4,"ngIf"],["type","video/mp4",3,"src"],[3,"src","type",4,"ngFor","ngForOf","ngForTrackBy"],[3,"src","type"],[1,"s-video-subtitles-wrap"],[1,"subtitles"],[3,"subtitlesButtonClick","transcription","timeToRead","mode"],[1,"s-video-controls-wrap"],[1,"s-video-progress-bar"],["type","range","min","0","max","1","step","0.01",3,"value","input",4,"ngIf"],[1,"s-video-controls"],[1,"s-video-controls-left"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click",4,"ngIf"],["width","20","height","20","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click",4,"ngIf"],[1,"s-video-controls-right"],["class","s-video-subtitles-btn s-tooltip",3,"disabled",4,"ngIf"],["class","s-video-transcription-btn s-tooltip",3,"disabled","click",4,"ngIf"],[3,"transcription","timeToRead","transcriptionButtonClick","transcriptionSummaryCopy","seekTo","transcriptionPanelDragged",4,"ngIf"],["width","20","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg","class","delete-btn",3,"click",4,"ngIf"],["type","range","min","0","max","1","step","0.01",3,"input","value"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click"],["d","M3.08337 3.65485C3.08337 1.69607 5.23378 0.498172 6.89926 1.52918L17.1496 7.87464C18.7284 8.852 18.7284 11.1486 17.1496 12.126L6.89926 18.4714C5.23378 19.5024 3.08337 18.3045 3.08337 16.3458V3.65485Z","fill","white"],["width","20","height","20","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click"],["d","M1.33203 2.66536C1.33203 1.92899 1.92898 1.33203 2.66536 1.33203H5.33203C6.06841 1.33203 6.66536 1.92898 6.66536 2.66536V13.332C6.66536 14.0684 6.06841 14.6654 5.33203 14.6654H2.66536C1.92898 14.6654 1.33203 14.0684 1.33203 13.332V2.66536Z","fill","white"],["d","M9.33203 2.66536C9.33203 1.92899 9.92899 1.33203 10.6654 1.33203H13.332C14.0684 1.33203 14.6654 1.92898 14.6654 2.66536V13.332C14.6654 14.0684 14.0684 14.6654 13.332 14.6654H10.6654C9.92899 14.6654 9.33203 14.0684 9.33203 13.332V2.66536Z","fill","white"],[1,"s-video-subtitles-btn","s-tooltip"],["class","s-tooltiptext top",4,"ngIf"],["width","20","height","21","viewBox","0 0 20 21","fill","none","xmlns","http://www.w3.org/2000/svg",3,"click"],["d","M11.47 7.62875C11.893 7.41764 12.3718 7.34543 12.8382 7.42242C13.3046 7.49941 13.7348 7.72166 14.0675 8.0575C14.1849 8.17486 14.2508 8.33403 14.2508 8.5C14.2508 8.66597 14.1849 8.82514 14.0675 8.9425C13.9501 9.05986 13.791 9.12579 13.625 9.12579C13.459 9.12579 13.2999 9.05986 13.1825 8.9425C13.0358 8.79219 12.8452 8.69223 12.6382 8.65697C12.4311 8.62171 12.2182 8.65297 12.03 8.74625C11.6712 8.92625 11.25 9.41875 11.25 10.5C11.25 11.5813 11.6712 12.075 12.03 12.2537C12.2182 12.347 12.4311 12.3783 12.6382 12.343C12.8452 12.3078 13.0358 12.2078 13.1825 12.0575C13.2999 11.9401 13.459 11.8742 13.625 11.8742C13.791 11.8742 13.9501 11.9401 14.0675 12.0575C14.1849 12.1749 14.2508 12.334 14.2508 12.5C14.2508 12.666 14.1849 12.8251 14.0675 12.9425C13.38 13.63 12.34 13.8062 11.47 13.3713C10.5787 12.9262 10 11.9187 10 10.5C10 9.08125 10.5787 8.075 11.47 7.62875ZM9.0675 8.0575C8.73492 7.72149 8.3047 7.49913 7.83824 7.42213C7.37178 7.34514 6.89292 7.41745 6.47 7.62875C5.57875 8.07375 5 9.08125 5 10.5C5 11.9187 5.57875 12.925 6.47 13.3713C6.89292 13.5826 7.37178 13.6549 7.83824 13.5779C8.3047 13.5009 8.73492 13.2785 9.0675 12.9425C9.12561 12.8844 9.1717 12.8154 9.20315 12.7395C9.2346 12.6636 9.25079 12.5822 9.25079 12.5C9.25079 12.4178 9.2346 12.3364 9.20315 12.2605C9.1717 12.1846 9.12561 12.1156 9.0675 12.0575C9.00939 11.9994 8.9404 11.9533 8.86448 11.9218C8.78855 11.8904 8.70718 11.8742 8.625 11.8742C8.54282 11.8742 8.46144 11.8904 8.38552 11.9218C8.3096 11.9533 8.24061 11.9994 8.1825 12.0575C8.03568 12.2076 7.84513 12.3075 7.63811 12.3427C7.4311 12.378 7.21823 12.3468 7.03 12.2537C6.67125 12.0738 6.25 11.5813 6.25 10.5C6.25 9.41875 6.67125 8.925 7.03 8.74625C7.21823 8.65316 7.4311 8.62201 7.63811 8.65726C7.84513 8.69251 8.03568 8.79236 8.1825 8.9425C8.29986 9.05986 8.45903 9.12579 8.625 9.12579C8.79097 9.12579 8.95014 9.05986 9.0675 8.9425C9.18486 8.82514 9.25079 8.66597 9.25079 8.5C9.25079 8.33403 9.18486 8.17486 9.0675 8.0575ZM1.25 7.375C1.25 6.5462 1.57924 5.75134 2.16529 5.16529C2.75134 4.57924 3.5462 4.25 4.375 4.25H15.625C16.4538 4.25 17.2487 4.57924 17.8347 5.16529C18.4208 5.75134 18.75 6.5462 18.75 7.375V13.625C18.75 14.4538 18.4208 15.2487 17.8347 15.8347C17.2487 16.4208 16.4538 16.75 15.625 16.75H4.375C3.5462 16.75 2.75134 16.4208 2.16529 15.8347C1.57924 15.2487 1.25 14.4538 1.25 13.625V7.375ZM4.375 5.5C3.87772 5.5 3.40081 5.69754 3.04917 6.04917C2.69754 6.40081 2.5 6.87772 2.5 7.375V13.625C2.5 14.1223 2.69754 14.5992 3.04917 14.9508C3.40081 15.3025 3.87772 15.5 4.375 15.5H15.625C16.1223 15.5 16.5992 15.3025 16.9508 14.9508C17.3025 14.5992 17.5 14.1223 17.5 13.625V7.375C17.5 6.87772 17.3025 6.40081 16.9508 6.04917C16.5992 5.69754 16.1223 5.5 15.625 5.5H4.375Z","fill","white"],[1,"s-tooltiptext","top"],[1,"s-video-transcription-btn","s-tooltip",3,"click"],["width","20","height","20","viewBox","0 0 20 20","fill","none","xmlns","http://www.w3.org/2000/svg"],["d","M7.49997 10.8332C9.34164 10.8332 10.8333 9.3415 10.8333 7.49984C10.8333 5.65817 9.34164 4.1665 7.49997 4.1665C5.65831 4.1665 4.16664 5.65817 4.16664 7.49984C4.16664 9.3415 5.65831 10.8332 7.49997 10.8332ZM7.49997 5.83317C8.41664 5.83317 9.16664 6.58317 9.16664 7.49984C9.16664 8.4165 8.41664 9.1665 7.49997 9.1665C6.58331 9.1665 5.83331 8.4165 5.83331 7.49984C5.83331 6.58317 6.58331 5.83317 7.49997 5.83317ZM12.825 12.9665C11.425 12.2498 9.60831 11.6665 7.49997 11.6665C5.39164 11.6665 3.57497 12.2498 2.17497 12.9665C1.76835 13.1759 1.42772 13.4939 1.19089 13.8852C0.954055 14.2765 0.830281 14.7258 0.833306 15.1832V17.4998H14.1666V15.1832C14.1666 14.2498 13.6583 13.3915 12.825 12.9665ZM12.5 15.8332H2.49997V15.1832C2.49997 14.8665 2.66664 14.5832 2.93331 14.4498C3.92497 13.9415 5.52497 13.3332 7.49997 13.3332C9.47497 13.3332 11.075 13.9415 12.0666 14.4498C12.3333 14.5832 12.5 14.8665 12.5 15.1832V15.8332ZM14.9416 13.3332L16.3 11.9748C13.9916 9.45817 13.9916 5.67484 16.3 3.02484L14.9416 1.6665C11.6916 4.90817 11.6833 9.95817 14.9416 13.3332ZM19.1 9.12484C18.7587 8.65332 18.5749 8.08609 18.5749 7.504C18.5749 6.92192 18.7587 6.35469 19.1 5.88317L17.7 4.47484C16.0166 6.15817 16.0166 8.69984 17.7 10.5332L19.1 9.12484Z","fill","white"],[3,"transcriptionButtonClick","transcriptionSummaryCopy","seekTo","transcriptionPanelDragged","transcription","timeToRead"],["width","20","height","16","viewBox","0 0 16 16","fill","none","xmlns","http://www.w3.org/2000/svg",1,"delete-btn",3,"click"],["fill-rule","evenodd","clip-rule","evenodd","d","M4.28702 4.66602V12.2851C4.28702 13.1266 5.01189 13.8089 5.90606 13.8089H10.7632C11.6574 13.8089 12.3823 13.1266 12.3823 12.2851V4.66602H14.0013V12.2851C14.0013 13.9682 12.5516 15.3327 10.7632 15.3327H5.90606C4.11771 15.3327 2.66797 13.9682 2.66797 12.2851V4.66602H4.28702Z","fill","#FF7162"],["d","M6.77778 6.66602C6.34822 6.66602 6 7.06398 6 7.5549V11.1105C6 11.6014 6.34822 11.9993 6.77778 11.9993C7.20733 11.9993 7.55556 11.6014 7.55556 11.1105V7.5549C7.55556 7.06398 7.20733 6.66602 6.77778 6.66602Z","fill","#FF7162"],["d","M9.88889 6.66602C9.45933 6.66602 9.11111 7.06398 9.11111 7.5549V11.1105C9.11111 11.6014 9.45933 11.9993 9.88889 11.9993C10.3184 11.9993 10.6667 11.6014 10.6667 11.1105V7.5549C10.6667 7.06398 10.3184 6.66602 9.88889 6.66602Z","fill","#FF7162"],["fill-rule","evenodd","clip-rule","evenodd","d","M5.16667 3.11111V2.33333C5.16667 1.04467 6.22999 0 7.54167 0H9.125C10.4367 0 11.5 1.04467 11.5 2.33333V3.11111H13.875C14.3122 3.11111 14.6667 3.45933 14.6667 3.88889C14.6667 4.31844 14.3122 4.66667 13.875 4.66667H2.79167C2.35444 4.66667 2 4.31844 2 3.88889C2 3.45933 2.35444 3.11111 2.79167 3.11111H5.16667ZM6.75 2.33333C6.75 1.90378 7.10444 1.55556 7.54167 1.55556H9.125C9.56223 1.55556 9.91667 1.90378 9.91667 2.33333V3.11111H6.75V2.33333Z","fill","#FF7162"],[1,"s-video-transcription",3,"click","pointerdown","pointerup"],[3,"transcription","timeToRead","mode","visible","seekTo","close","transcriptionSummaryCopy","transcriptionPanelDragged",4,"ngIf"],[3,"seekTo","close","transcriptionSummaryCopy","transcriptionPanelDragged","transcription","timeToRead","mode","visible"]],template:function(i,o){if(i&1){let s=_();u(0,"div",2)(1,"div",3),g("click",function(h){return l(s),c(h.stopPropagation())})("pointerdown",function(h){return l(s),c(h.stopPropagation())})("pointerup",function(h){return l(s),c(h.stopPropagation())}),u(2,"video",4,0),g("timeupdate",function(){l(s);let h=f(3);return c(o.timeUpdate(h==null?null:h.currentTime))})("pointerdown",function(){return l(s),c(o.toggleVideo())}),v(4,it,1,1,"source",5)(5,ot,2,4,"ng-template",6),d(),v(6,rt,4,5,"div",7)(7,gt,14,8,"div",8),d(),v(8,vt,2,1,"div",9),d()}i&2&&(m(2),b("flip",(o.annotation==null?null:o.annotation.recordingType)==="video"),p("poster",(o.annotation==null||o.annotation.attachment==null?null:o.annotation.attachment.thumbnail)||(!(o.annotation==null||o.annotation.attachments==null)&&o.annotation.attachments.length?o.annotation==null||o.annotation.attachments[0]==null?null:o.annotation.attachments[0].thumbnail:"")),m(2),p("ngIf",!(!(o.annotation==null||o.annotation.attachments==null)&&o.annotation.attachments.length)&&(o.annotation==null?null:o.annotation.attachment)),m(),p("ngIf",o.annotation==null||o.annotation.attachments==null?null:o.annotation.attachments.length),m(),p("ngIf",o.showSubtitles),m(),p("ngIf",o.showControls),m(),p("ngIf",o.transcriptionVisible))},dependencies:[z,G,$,W],styles:["html[_ngcontent-%COMP%]{--velt-base-rem-unit: 1}*[data-snippyly-element=true][_ngcontent-%COMP%], *[data-velt-element=true][_ngcontent-%COMP%]{font-family:var(--velt-default-font-family)}velt-wireframe[_ngcontent-%COMP%]{display:none!important}body.velt-pin-dragging[_ngcontent-%COMP%] iframe[_ngcontent-%COMP%]{pointer-events:none!important}*[_ngcontent-%COMP%]{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255,255,255,0)!important;outline:none!important;margin:0!important;padding:0!important;line-height:1.5!important;color:#fff!important;font-size:calc((.9rem + 0px) * var(--velt-base-rem-unit))}*[_ngcontent-%COMP%]:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){height:unset;width:unset}*[_ngcontent-%COMP%]:empty:not(svg,rect,circle,ellipse,line,polyline,polygon,path,text,g,use,image,defs,hr){display:revert!important}.s-video-player[_ngcontent-%COMP%]{position:relative!important;display:flex!important;justify-content:center!important;align-items:center!important;border-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;background-color:#d3d3d3!important}.s-video-player[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{display:flex!important;justify-content:center!important;align-items:center!important;width:100%!important;height:100%!important;border-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important}.controls-wrap[_ngcontent-%COMP%]{position:absolute!important;bottom:0!important;display:flex!important;justify-content:space-between!important;align-items:center!important;width:80%!important;padding:1em!important;font-style:normal!important;font-weight:400!important;font-size:1em!important;line-height:1em!important;color:#fff!important}.controls[_ngcontent-%COMP%]{display:flex!important;justify-content:center!important;align-items:center!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.line[_ngcontent-%COMP%]{position:absolute!important;bottom:100%!important;width:90%!important;display:flex!important;align-items:center!important}.line[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%!important}.s-video-subtitles-wrap[_ngcontent-%COMP%]{position:absolute;width:calc((25rem + 0px) * var(--velt-base-rem-unit))!important;max-width:90%!important;bottom:10%!important;left:50%!important;transform:translate(-50%)!important;transition:bottom .3s!important}.s-video-subtitles-wrap[_ngcontent-%COMP%] .subtitles[_ngcontent-%COMP%]{background:#141416!important;border-radius:calc((.6rem + 0px) * var(--velt-base-rem-unit))!important;line-height:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;padding:calc((.5rem + 0px) * var(--velt-base-rem-unit)) calc((1rem + 0px) * var(--velt-base-rem-unit))!important;text-align:center!important}.s-video-subtitles-wrap.hide[_ngcontent-%COMP%]{display:none!important}svg[_ngcontent-%COMP%]{cursor:pointer!important}.s-video-player[_ngcontent-%COMP%]:hover .s-video-subtitles-wrap[_ngcontent-%COMP%]{bottom:calc(10% + 80px)!important}.s-video-player[_ngcontent-%COMP%]:hover .s-video-controls-wrap[_ngcontent-%COMP%]{opacity:1!important}.s-video-controls-wrap[_ngcontent-%COMP%]{display:flex!important;flex-direction:column!important;position:absolute!important;z-index:10!important;bottom:0!important;width:100%!important;border-bottom-left-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;border-bottom-right-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;overflow:hidden!important;padding:calc((1rem + 0px) * var(--velt-base-rem-unit)) calc((2rem + 0px) * var(--velt-base-rem-unit))!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;opacity:0!important;transition:opacity .3s!important;background:#141416!important;background:linear-gradient(0deg,#141416,#37373700)!important;padding-top:calc((5rem + 0px) * var(--velt-base-rem-unit))!important}.s-video-controls-wrap[_ngcontent-%COMP%] .s-video-progress-bar[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{width:100%!important;accent-color:#625DF5!important}.s-video-controls-wrap[_ngcontent-%COMP%] .s-video-controls[_ngcontent-%COMP%]{display:flex!important;justify-content:space-between!important;align-items:center!important}.s-video-controls-wrap[_ngcontent-%COMP%] .s-video-controls[_ngcontent-%COMP%] .s-video-controls-left[_ngcontent-%COMP%]{display:flex!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important;align-items:center!important}.s-video-controls-wrap[_ngcontent-%COMP%] .s-video-controls[_ngcontent-%COMP%] .s-video-controls-right[_ngcontent-%COMP%]{display:flex!important;align-items:center!important;gap:calc((1rem + 0px) * var(--velt-base-rem-unit))!important}.s-video-player-container[_ngcontent-%COMP%]{width:100%!important;height:100%!important;box-sizing:border-box!important;display:flex!important;gap:2rem!important}.s-video-player-container[_ngcontent-%COMP%] .s-video-player[_ngcontent-%COMP%]{flex:1 1 100%!important;height:100%!important;background-color:#141416!important;border-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;display:flex!important}.s-video-player-container[_ngcontent-%COMP%] .s-video-player[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%!important}.s-video-player-container[_ngcontent-%COMP%] .s-video-transcription[_ngcontent-%COMP%]{flex:0 0 auto!important;width:calc((25rem + 0px) * var(--velt-base-rem-unit))!important;border-radius:calc((1.5rem + 0px) * var(--velt-base-rem-unit))!important;height:100%!important;overflow:hidden!important}.s-video-subtitles-btn[_ngcontent-%COMP%], .s-video-transcription-btn[_ngcontent-%COMP%]{display:flex!important}.s-video-subtitles-btn.disabled[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .s-video-transcription-btn.disabled[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{cursor:not-allowed!important}.s-video-subtitles-btn.disabled[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] path[_ngcontent-%COMP%], .s-video-transcription-btn.disabled[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:#80808a!important}"],changeDetection:0});let n=r;return n})();var It=(()=>{let r=class r{transform(t){try{if(!t||t<0||!isFinite(t))return"00:00:00";let i=Math.floor(t/1e3),o=Math.floor(i/3600),s=Math.floor(i%3600/60),P=i%60,h=j=>isNaN(j)?"00":j.toString().padStart(2,"0"),V=h(o),x=h(s),K=h(P);return`${V}:${x}:${K}`}catch(i){return console.error("Error in hourMinSecTimeDisplay pipe:",i),null}}};r.\u0275fac=function(i){return new(i||r)},r.\u0275pipe=k({name:"hourMinSecTimeDisplay",type:r,pure:!0});let n=r;return n})();export{W as a,Ot as b,It as c,J as d};
@@ -0,0 +1 @@
1
+ import{ca as ie}from"./chunk-IZTIJQZD.js";import{$ as K,$e as R,Cf as $,Ch as E,Df as _,Dh as V,Ee as N,Ef as A,Ff as T,Fi as Q,Gi as ee,Hi as re,L as w,Mf as L,Od as W,Pi as se,Vf as M,_e as U,a as f,af as I,b as y,be as v,ca as P,da as x,g,ki as X,l as D,li as q,oi as H,qh as b,qi as Y,tf as S,th as j,ti as Z,uf as l,uh as B,v as G,wh as J,xh as z,zh as F}from"./chunk-YUWFUH6R.js";var p="public",ye=(()=>{let O=class O{constructor(e,r,s,i,t,o,c,a,n,d){this.authService=e,this.docService=r,this.loggingService=s,this.commonDbService=i,this.usersService=t,this.commentUtilsService=o,this.coreActionsService=c,this.functions=a,this.configService=n,this.contactService=d,this.endpointsService=x(H),this.currentUserPermissions$=new D(null),this.permissionsCache$=new D(null),this.permissionProvider$=new D(null),this.clientResolverProdWarned=!1,this.clientResolverNoResolverWarned=!1,this.requestKeyedPermissionsCache=new Map,this.inFlightPermissionsRequests=new Map,this.permissionsCacheGeneration=0,this.REVOKE_DELAY_MS=3e3,this.pendingRevokeRequests=new Map,this.pendingRevokeTimeoutId=null,this.pendingRevokeUniqueId="",this.pendingRevokeUserId="";try{this.docService.setUserPermissionService(this),this.authService.setUserPermissionService(this),this.commentUtilsService.setUserPermissionService(this),this.contactService.setUserPermissionService(this)}catch(h){this.loggingService.catch("Error in UserPermissionService constructor:",h)}}ngOnDestroy(){try{this.pendingRevokeTimeoutId&&(clearTimeout(this.pendingRevokeTimeoutId),this.pendingRevokeTimeoutId=null)}catch(e){this.loggingService.catch("Error in UserPermissionService ngOnDestroy:",e)}}collectRevokeRequest(e,r,s,i,t,o){try{return e.find(a=>a.resourceId===s&&a.type===i&&a.organizationId===t&&a.userId===o)?(r.push({userId:o,resourceId:s,organizationId:t,type:i,hasAccess:!1}),e.filter(a=>!(a.resourceId===s&&a.type===i&&a.organizationId===t&&a.userId===o))):e}catch(c){return this.loggingService.catch("Error in UsersPermissionService collectRevokeRequest:",c),e}}hasUserContextAccess({userId:e,accessFields:r}){try{if(!this.getIsContextEnabled()||r.includes(N.DEFAULT_VELT_CONTEXT))return!0;let s=r.filter(t=>!L(t));if(!s.length){if(r.some(c=>c.startsWith(N.VISIBILITY_ORG_PREFIX)))return!0;let o=`${N.VISIBILITY_SELF_PREFIX}${$(e).toString()}`;return r.includes(o)}let i=this.contactService.getUserAccessFieldsByUserId(e);return i?s.every(t=>i.includes(t)):!0}catch(s){return this.loggingService.catch("Error in UserPermissionService hasUserContextAccess:",s),!1}}organizationDetails(e){return g(this,null,function*(){try{let r=yield this.commonDbService?.getData({feature:"organizationMetadata",properties:{organizationId:e,suppressError:!0}});return r&&r?.errorCode?{errorCode:l.PERMISSION_DENIED,error:!0}:r&&!r?.metadata?{errorCode:l.DOES_NOT_EXIST,error:!0}:{error:!1}}catch(r){return this.loggingService.catch("Error in UserPermissionService organizationDetails:",r),{errorCode:l.SOMETHING_WENT_WRONG,error:!0}}})}documentDetails(s){return g(this,arguments,function*({documentId:e,organizationId:r}){try{let i=yield this.commonDbService?.getData({feature:"documentMetadata",properties:{documentId:e,organizationId:r,suppressError:!0}});if(i&&i?.errorCode)return{errorCode:l.PERMISSION_DENIED,error:!0};if(i&&!i?.metadata)return{errorCode:l.DOES_NOT_EXIST,error:!0};let t=this.docService.getDocumentMetadata(e)??{};this.docService.setDocumentMetadata(e,f(f({},t),i?.metadata??{}));let o,c=i?.metadata?.veltFolderId;if(c)try{o=(yield this.commonDbService?.getData({feature:"folderMetadata",properties:{folderId:c,organizationId:r}}))?.folderIamConfig?.accessType}catch(a){this.loggingService.catch("Error fetching folder accessType for document:",a)}return o||(o=i?.docIamConfig?.accessType),{error:!1,accessType:o}}catch(i){return this.loggingService.catch("Error in UserPermissionService documentDetails:",i),{errorCode:l.SOMETHING_WENT_WRONG,error:!0}}})}folderDetails(s){return g(this,arguments,function*({folderId:e,organizationId:r}){try{let i=yield this.commonDbService?.getData({feature:"folderMetadata",properties:{folderId:e,organizationId:r,suppressError:!0}});return i&&i?.errorCode?{errorCode:l.PERMISSION_DENIED,error:!0}:i&&!i?.metadata?{errorCode:l.DOES_NOT_EXIST,error:!0}:{error:!1,accessType:i?.folderIamConfig?.accessType}}catch(i){return this.loggingService.catch("Error in UserPermissionService folderDetails:",i),{errorCode:l.SOMETHING_WENT_WRONG,error:!0}}})}getUserPermissions(e){return g(this,null,function*(){let r=this.permissionsCacheGeneration;try{if(!this.authService.getUser())return this.loggingService.catch("User not set. [source: getUserPermissions]",void 0,void 0,!0),{};let s=this.authService.getUser()?.userId,i=this.extractResourceIds(e);if(!i.clientOrganizationId||!i.organizationId)return this.loggingService.catch("Client organization id or organization id not set during getUserPermissions",void 0,void 0,!0),{};let t=yield this.validateResources(i),[o,c]=yield this.fetchUserPermissionsFromDB(i),a=this.authService.getUser()?.userId;if(s!==a)return{};let n=this.buildPermissionsResponse(i,t,o,c);if(Object.keys(n).length>0){if(!e)this.setCurrentUserPermissions(n);else if(this.permissionsCacheGeneration===r){let d=this.buildPermissionsCacheKey(e);d!==null&&this.requestKeyedPermissionsCache.set(d,JSON.parse(JSON.stringify(n)))}}return n}catch(s){return this.loggingService.catch("Error in UserPermissionService getUserPermissions:",s),{}}})}getUserPermissionsFromCacheOrFetch(e){return g(this,null,function*(){try{if(!e)return yield this.getUserPermissions(e);let r=this.buildPermissionsCacheKey(e);if(r===null)return yield this.getUserPermissions(e);let s=this.permissionsCacheGeneration,i=this.requestKeyedPermissionsCache.get(r);if(i)return JSON.parse(JSON.stringify(i));let t=this.inFlightPermissionsRequests.get(r);if(t){let a=yield t;return this.permissionsCacheGeneration!==s?yield this.getUserPermissions(e):JSON.parse(JSON.stringify(a))}let o=this.getUserPermissions(e);this.inFlightPermissionsRequests.set(r,o),o.finally(()=>{this.inFlightPermissionsRequests.get(r)===o&&this.inFlightPermissionsRequests.delete(r)}).catch(()=>{});let c=yield o;return this.permissionsCacheGeneration!==s?yield this.getUserPermissions(e):JSON.parse(JSON.stringify(c))}catch(r){return this.loggingService.catch("Error in UserPermissionService getUserPermissionsFromCacheOrFetch:",r),{}}})}clearRequestKeyedPermissionsCache(){try{this.requestKeyedPermissionsCache.clear(),this.inFlightPermissionsRequests.clear(),this.permissionsCacheGeneration++}catch(e){this.loggingService.catch("Error in UserPermissionService clearRequestKeyedPermissionsCache:",e)}}invalidateAllPermissionsState(){try{this.requestKeyedPermissionsCache.clear(),this.inFlightPermissionsRequests.clear(),this.permissionsCacheGeneration++}catch(e){this.loggingService.catch("Error in UserPermissionService invalidateAllPermissionsState:",e)}}buildPermissionsCacheKey(e){try{let r={};return Object.keys(e).sort().forEach(s=>{let i=e[s];i!==void 0&&(r[s]=Array.isArray(i)?[...i].sort():i)}),r.__userId=this.authService.getUser()?.userId??null,JSON.stringify(r)}catch(r){return this.loggingService.catch("Error in UserPermissionService buildPermissionsCacheKey:",r),null}}extractResourceIds(e){let r=this.docService.getDocumentPaths(),s=this.docService.getDocumentIds();if(e){let o=e.organizationId??r?.clientOrganizationId;return{folderIds:e.folderIds??[],documentIds:e.documentIds??[],clientOrganizationId:o,organizationId:o?A(o):void 0}}let i=r?.clientOrganizationId;return{folderIds:r?.folderId?[r.folderId]:[],documentIds:s.map(o=>o.clientDocumentId),clientOrganizationId:i,organizationId:i?A(i):void 0}}validateResources(e){return g(this,null,function*(){let{folderIds:r,documentIds:s,organizationId:i,clientOrganizationId:t}=e,o=[],c=[],a=r.length>0||s.length>0;i&&!a&&(o.push(this.organizationDetails(i)),c.push({id:t??"",type:"organization"})),r.forEach(u=>{o.push(this.folderDetails({folderId:T(u),organizationId:i??""})),c.push({id:u,type:"folder"})}),s.forEach(u=>{o.push(this.documentDetails({documentId:_(u),organizationId:i??""})),c.push({id:u,type:"document"})});let[n,d]=yield Promise.all([Promise.allSettled(o),this.getDefaultDocumentAccessType()]),h=this.processValidationResults(n,c);return y(f({},this.suppressResolverGrantedFailures(h,t)),{defaultDocumentAccessType:d})})}suppressResolverGrantedFailures(e,r){try{let s=this.authService.getUser()?.userId;if(!s)return e;let i=this.getPermissionsCache()??[];if(i.length===0)return e;let t=(n,d,h)=>i.some(u=>u?.userId===s&&u?.resourceId===n&&u?.type===d&&(!h||u?.organizationId===h)&&u?.hasAccess===!0),o=e.failedDocumentIds.filter(n=>!(n.errorCode===l.PERMISSION_DENIED&&t(n.id,I.DOCUMENT,r))),c=e.failedFolderIds.filter(n=>!(n.errorCode===l.PERMISSION_DENIED&&t(n.id,I.FOLDER,r))),a=e.failedOrganizationId;return a&&a.errorCode===l.PERMISSION_DENIED&&r&&t(r,I.ORGANIZATION,r)&&(a=void 0),{failedFolderIds:c,failedDocumentIds:o,failedOrganizationId:a,folderAccessTypes:e.folderAccessTypes,documentAccessTypes:e.documentAccessTypes}}catch(s){return this.loggingService.catch("Error in UserPermissionService suppressResolverGrantedFailures:",s),e}}getDefaultDocumentAccessType(){return g(this,null,function*(){try{return(yield this.commonDbService?.getData({feature:"apiKeyMetadata",properties:{}}))?.defaultDocumentAccessType}catch(e){this.loggingService.catch("Error fetching defaultDocumentAccessType:",e);return}})}processValidationResults(e,r){let s=[],i=[],t,o={},c={};for(let a=0;a<e.length;a++){let n=e[a],d=r[a];if(n.status==="rejected"||n.status==="fulfilled"&&n.value.error){let u=n.status==="fulfilled"?n.value.errorCode??l.SOMETHING_WENT_WRONG:l.SOMETHING_WENT_WRONG,m={id:d.id,errorCode:u};switch(d.type){case"organization":if(t=m,u===l.DOES_NOT_EXIST)throw new Error(`Organization with id '${d.id}' does not exist`);break;case"folder":s.push(m);break;case"document":i.push(m);break}}else if(n.status==="fulfilled")switch(d.type){case"folder":n.value.accessType&&(o[d.id]=n.value.accessType);break;case"document":n.value.accessType&&(c[d.id]=n.value.accessType);break}}return{failedFolderIds:s,failedDocumentIds:i,failedOrganizationId:t,folderAccessTypes:o,documentAccessTypes:c}}fetchUserPermissionsFromDB(e){return g(this,null,function*(){let{folderIds:r,documentIds:s,organizationId:i}=e,t=[this.authService.getUser()?.userId??""],o=[...r.map(n=>T(n)),...s.map(n=>_(n)),i??""],[c,a]=yield Promise.allSettled([this.usersService.getUsersFromDBWithBatching({userIds:t,organizationId:i}),this.usersService.getTemporaryUsersFromDBWithBatching({userIds:t,organizationId:i,resourceIds:o})]);return[c.status==="fulfilled"?c.value:[],a.status==="fulfilled"?a.value:[]]})}buildPermissionsResponse(e,r,s,i){let{folderIds:t,documentIds:o,clientOrganizationId:c,organizationId:a}=e,{failedFolderIds:n,failedDocumentIds:d,failedOrganizationId:h}=r,u={};return this.processRegularUserPermissions(u,s,t,o,c??"",a??"",n,d,h,r.folderAccessTypes,r.documentAccessTypes,r.defaultDocumentAccessType),this.ensureCurrentUserFailuresRecorded(u,c??"",n,d,h,r.folderAccessTypes,r.documentAccessTypes,r.defaultDocumentAccessType),this.processTemporaryUserPermissions(u,i),this.processContextPermissions(u),u}processContextPermissions(e){try{let r=this.authService.getUser()?.userId;if(r){let s=this.contactService.getUserAccessFieldsByUserId(r);s?.length&&(e[r]||(e[r]={}),e[r].context={accessFields:s})}}catch(r){this.loggingService.catch("Error in UserPermissionService processContextPermissions:",r);return}}processRegularUserPermissions(e,r,s,i,t,o,c,a,n,d,h,u){for(let m of r)for(let C of m)C?.user?.userId&&(e[C.user.userId]=y(f({},s.length&&{folders:this.buildFolderPermissions(s,C,c,d,u)}),{documents:this.buildDocumentPermissions(i,C,a,h,u),organization:{[t]:this.buildOrganizationPermission(o,C,n)}}))}ensureCurrentUserFailuresRecorded(e,r,s,i,t,o,c,a){try{let n=this.authService.getUser()?.userId;if(!n)return;let d=!!t&&!!r,h=(s?.length??0)>0,u=(i?.length??0)>0;if(!d&&!h&&!u)return;if(e[n]||(e[n]={}),d&&(e[n].organization||(e[n].organization={}),e[n].organization[r]||(e[n].organization[r]={error:this.getErrorMessage(t.errorCode,"organization"),errorCode:t.errorCode})),h){e[n].folders||(e[n].folders={});for(let m of s)e[n].folders[m.id]||(e[n].folders[m.id]=f({error:this.getErrorMessage(m.errorCode,"folder"),errorCode:m.errorCode},m.errorCode===l.PERMISSION_DENIED&&{accessType:o[m.id]??a??p}))}if(u){e[n].documents||(e[n].documents={});for(let m of i)e[n].documents[m.id]||(e[n].documents[m.id]=f({error:this.getErrorMessage(m.errorCode,"document"),errorCode:m.errorCode},m.errorCode===l.PERMISSION_DENIED&&{accessType:c[m.id]??a??p}))}}catch(n){this.loggingService.catch("Error in UserPermissionService ensureCurrentUserFailuresRecorded:",n)}}getErrorMessage(e,r){try{switch(this.loggingService.log(`Error in UserPermissionService getErrorMessage: ${e} ${r}`),e){case l.DOES_NOT_EXIST:return`${r} does not exist`;case l.PERMISSION_DENIED:return`User does not have access to ${r}`;case l.SOMETHING_WENT_WRONG:return"Something went wrong";default:return"Something went wrong"}}catch(s){return this.loggingService.catch("Error in UserPermissionService getErrorMessage:",s),"Something went wrong"}}buildFolderPermissions(e,r,s,i,t){return e.reduce((o,c)=>{let a=s.find(n=>n.id===c);return a?o[c]=f({error:this.getErrorMessage(a.errorCode,"folder"),errorCode:a.errorCode},a.errorCode===l.PERMISSION_DENIED&&{accessType:i[c]??t??p}):o[c]={accessRole:r.viewerFolderIds?.includes(T(c))?S.VIEWER:S.EDITOR,accessType:i[c]??t??p},o},{})}buildDocumentPermissions(e,r,s,i,t){return e.reduce((o,c)=>{let a=s.find(n=>n.id===c);return a?o[c]=f({error:this.getErrorMessage(a.errorCode,"document"),errorCode:a.errorCode},a.errorCode===l.PERMISSION_DENIED&&{accessType:i[c]??t??p}):o[c]={accessRole:r.viewerDocumentIds?.includes(_(c))?S.VIEWER:S.EDITOR,accessType:i[c]??t??p},o},{})}buildOrganizationPermission(e,r,s){return s?{error:this.getErrorMessage(s.errorCode,"organization"),errorCode:s.errorCode}:{accessRole:r.viewerOrganizationIds?.includes(e)?S.VIEWER:S.EDITOR}}processTemporaryUserPermissions(e,r){for(let s of r)if(s?.userId)switch(this.ensureUserPermissionStructure(e,s.userId),s.type){case"folder":this.addTemporaryFolderPermission(e,s);break;case"document":this.addTemporaryDocumentPermission(e,s);break;case"organization":this.addTemporaryOrganizationPermission(e,s);break}}ensureUserPermissionStructure(e,r){e[r]||(e[r]={})}addTemporaryFolderPermission(e,r){let{userId:s,resourceId:i,role:t,expiresAt:o}=r;e[s].folders||(e[s].folders={}),e[s].folders[i]={accessRole:t??S.EDITOR,expiresAt:o}}addTemporaryDocumentPermission(e,r){let{userId:s,resourceId:i,role:t,expiresAt:o}=r;e[s].documents||(e[s].documents={}),e[s].documents[i]={accessRole:t??S.EDITOR,expiresAt:o}}addTemporaryOrganizationPermission(e,r){let{userId:s,resourceId:i,role:t,expiresAt:o}=r;e[s].organization||(e[s].organization={}),e[s].organization[i]={accessRole:t??S.EDITOR,expiresAt:o}}hasEditAccess({organizationId:e,folderId:r,documentId:s}){try{let i=!0,t=this.getCurrentUserPermissionsWithServerIds(),o=this.authService.getUser()?.userId??"";return t&&(e&&typeof e=="string"&&t?.[o]?.organization?.[e]&&(t?.[o]?.organization?.[e]?.accessRole===S.VIEWER||t?.[o]?.organization?.[e]?.errorCode===l.PERMISSION_DENIED)&&(i=!1),r&&typeof r=="string"&&t?.[o]?.folders?.[r]&&(t?.[o]?.folders?.[r]?.accessRole===S.VIEWER||t?.[o]?.folders?.[r]?.errorCode===l.PERMISSION_DENIED)&&(i=!1),s&&typeof s=="string"&&t?.[o]?.documents?.[s]&&(t?.[o]?.documents?.[s]?.accessRole===S.VIEWER||t?.[o]?.documents?.[s]?.errorCode===l.PERMISSION_DENIED)&&(i=!1)),i}catch{return!0}}getCurrentUserPermissions$(){return this.currentUserPermissions$.asObservable().pipe(w(b))}getCurrentUserPermissions(){return this.currentUserPermissions$.value}refactorPermissionsWithServerIds(e){try{let r=JSON.parse(JSON.stringify(e??{})),s=this.authService.getUser()?.userId??"";if(r?.[s]){let i=this.docService.getDocumentPaths()?.clientOrganizationId??"";if(r?.[s]?.organization?.[i]){let t=A(i);r[s].organization&&(r[s].organization[t]=r[s].organization[i],delete r[s].organization[i])}r?.[s]?.folders&&(r[s].folders=Object.fromEntries(Object.entries(r?.[s]?.folders??{}).map(([t,o])=>[T(t),o]))),r?.[s]?.documents&&(r[s].documents=Object.fromEntries(Object.entries(r?.[s]?.documents??{}).map(([t,o])=>[_(t),o])))}return r}catch(r){return this.loggingService.catch("Error in UsersPermissionService refactorPermissionsWithServerIds:",r),e}}getCurrentUserPermissionsWithServerIds$(){return this.currentUserPermissions$.asObservable().pipe(G(e=>this.refactorPermissionsWithServerIds(e)),w(b))}getCurrentUserPermissionsWithServerIds(){return this.refactorPermissionsWithServerIds(this.currentUserPermissions$.value)}setCurrentUserPermissions(e){try{this.loggingService.log("%c[WB] Calling UsersService FUNCTION: setCurrentUserPermissions","color: green;");let r=null;e&&(r=JSON.parse(JSON.stringify(e))),this.currentUserPermissions$.next(r)}catch(r){this.loggingService.catch("Error in UsersPermissionService setCurrentUserPermissions:",r)}}getIsContextEnabled(){return this.loggingService.log("%c[WB] Calling FUNCTION: getIsContextEnabled","color: green;"),this.permissionProvider$.value?.isContextEnabled??!1}setPermissionProvider(e){try{this.loggingService.log("%c[WB] Calling UsersService FUNCTION: setPermissionProvider","color: green;"),this.clientResolverProdWarned=!1,this.clientResolverNoResolverWarned=!1,this.permissionProvider$.next(e)}catch(r){this.loggingService.catch("Error in UsersPermissionService setPermissionProvider:",r)}}get isRevokeAccessOnDocumentUnsetEnabled(){return this.permissionProvider$.value?.revokeAccessOn?.some(e=>e.type===U.DOCUMENT_UNSET)??!1}get isRevokeAccessOnUserLogoutEnabled(){return this.permissionProvider$.value?.revokeAccessOn?.some(e=>e.type===U.USER_LOGOUT)??!1}get isRevokeOrganizationAccessOnUserLogoutEnabled(){return this.permissionProvider$.value?.revokeAccessOn?.some(e=>e.type===U.USER_LOGOUT&&e.revokeOrganizationAccess)??!1}get isRevokeOrganizationAccessOnDocumentUnsetEnabled(){return this.permissionProvider$.value?.revokeAccessOn?.some(e=>e.type===U.DOCUMENT_UNSET&&e.revokeOrganizationAccess)??!1}getPermissionProviderRetryConfig(){return this.permissionProvider$.value?.retryConfig??{retryCount:0,retryDelay:0}}revokeAccessOnUserLogout(){return g(this,null,function*(){let e=M();try{if(this.isRevokeAccessOnUserLogoutEnabled){let r=[],s=this.authService.getUser()?.userId??"";if((this.getPermissionsCache()??[]).forEach(t=>{t.userId===s&&t.hasAccess&&(t.type===I.ORGANIZATION?this.isRevokeOrganizationAccessOnUserLogoutEnabled&&r.push(y(f({},t),{hasAccess:!1})):r.push(y(f({},t),{hasAccess:!1})))}),r.length>0){this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_USER_LOGOUT_FORMED,timestamp:new Date().getTime(),uniqueId:e,methodName:R.REVOKE_ACCESS_ON_USER_LOGOUT,source:"internal",payload:{requests:r}}),this.setPermissionsCache([]),this.clearRequestKeyedPermissionsCache(),this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_USER_LOGOUT_TRIGGERED,timestamp:new Date().getTime(),uniqueId:e,methodName:R.REVOKE_ACCESS_ON_USER_LOGOUT,source:"internal",payload:{requests:r}});let t=yield this.revokeAccess({requests:r,userId:this.authService.getUser()?.userId??""});t.success?this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_USER_LOGOUT_RESULT,timestamp:new Date().getTime(),uniqueId:e,methodName:R.REVOKE_ACCESS_ON_USER_LOGOUT,source:"internal",payload:{result:{data:t,success:!0,statusCode:200}}}):this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_USER_LOGOUT_ERROR,timestamp:new Date().getTime(),uniqueId:e,methodName:R.REVOKE_ACCESS_ON_USER_LOGOUT,source:"internal",payload:{result:{data:t,success:!1,statusCode:500}}})}}}catch(r){this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_USER_LOGOUT_ERROR,timestamp:new Date().getTime(),uniqueId:e,methodName:R.REVOKE_ACCESS_ON_USER_LOGOUT,source:"internal",payload:{error:r}}),this.loggingService.catch("Error in UsersPermissionService revokeAccessOnUserLogout:",r)}})}getRevokeKey(e){try{return`${e.userId}_${e.resourceId}_${e.type}_${e.organizationId}`}catch(r){return this.loggingService.catch("Error in UsersPermissionService getRevokeKey:",r),""}}cancelPendingRevokes(e){try{e.forEach(r=>{let s=this.getRevokeKey({userId:r.userId,resourceId:r.resource.id,type:r.resource.type,organizationId:r.resource.organizationId});this.pendingRevokeRequests.has(s)&&this.pendingRevokeRequests.delete(s)}),this.pendingRevokeRequests.size===0&&this.pendingRevokeTimeoutId&&(clearTimeout(this.pendingRevokeTimeoutId),this.pendingRevokeTimeoutId=null)}catch(r){this.loggingService.catch("Error in UsersPermissionService cancelPendingRevokes:",r)}}flushPendingRevokes(){return g(this,null,function*(){let e=this.pendingRevokeUniqueId,r=this.pendingRevokeUserId;try{let s=Array.from(this.pendingRevokeRequests.values());if(this.pendingRevokeRequests.clear(),this.pendingRevokeTimeoutId=null,this.pendingRevokeUniqueId="",this.pendingRevokeUserId="",s.length===0)return;let i=this.getPermissionsCache()??[];s.forEach(c=>{i=i.filter(a=>!(a.resourceId===c.resourceId&&a.type===c.type&&a.organizationId===c.organizationId&&a.userId===c.userId))}),this.setPermissionsCache(i);let t=this.docService.getDocContext(),o=yield this.revokeAccess({requests:s,userId:r,currentContext:t});o.success?this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_DOCUMENT_UNSET_RESULT,timestamp:new Date().getTime(),uniqueId:e,methodName:R.REVOKE_ACCESS_ON_DOCUMENT_UNSET,source:"internal",payload:{result:{data:o,success:!0,statusCode:200}}}):this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_DOCUMENT_UNSET_ERROR,timestamp:new Date().getTime(),uniqueId:e,methodName:R.REVOKE_ACCESS_ON_DOCUMENT_UNSET,source:"internal",payload:{result:{data:o,success:!1,statusCode:500}}})}catch(s){this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_DOCUMENT_UNSET_ERROR,timestamp:new Date().getTime(),uniqueId:e,methodName:R.REVOKE_ACCESS_ON_DOCUMENT_UNSET,source:"internal",payload:{error:s}}),this.loggingService.catch("Error in UsersPermissionService flushPendingRevokes:",s)}})}revokeAccessOnDocumentUnset(i){return g(this,arguments,function*({documentIds:e,folderId:r,context:s}){let t=M();try{if(this.isRevokeAccessOnDocumentUnsetEnabled){let o=[],c=this.docService.getOrganizationConfig()?.clientOrganizationId??"",a=this.authService.getUser()?.userId??"",n=this.getPermissionsCache()??[];e.forEach(d=>{n=this.collectRevokeRequest(n,o,d.clientDocumentId,I.DOCUMENT,c,a)}),r&&(n=this.collectRevokeRequest(n,o,r,I.FOLDER,c,a)),c&&this.isRevokeOrganizationAccessOnDocumentUnsetEnabled&&(n=this.collectRevokeRequest(n,o,c,I.ORGANIZATION,c,a)),s&&this.getIsContextEnabled()&&J({input:s}).forEach(h=>{let u=JSON.stringify(h.access);n=this.collectRevokeRequest(n,o,u,I.CONTEXT,c,a)}),this.setPermissionsCache(n),o.length>0&&(this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_DOCUMENT_UNSET_FORMED,timestamp:new Date().getTime(),uniqueId:t,methodName:R.REVOKE_ACCESS_ON_DOCUMENT_UNSET,source:"internal",payload:{requests:o}}),this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_DOCUMENT_UNSET_TRIGGERED,timestamp:new Date().getTime(),uniqueId:t,methodName:R.REVOKE_ACCESS_ON_DOCUMENT_UNSET,source:"internal",payload:{requests:o}}),o.forEach(d=>{this.pendingRevokeRequests.set(this.getRevokeKey(d),d)}),this.pendingRevokeUniqueId=t,this.pendingRevokeUserId=a,this.pendingRevokeTimeoutId&&clearTimeout(this.pendingRevokeTimeoutId),this.pendingRevokeTimeoutId=setTimeout(()=>this.flushPendingRevokes(),this.REVOKE_DELAY_MS))}}catch(o){this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.REVOKE_ACCESS_ON_DOCUMENT_UNSET_ERROR,timestamp:new Date().getTime(),uniqueId:t,methodName:R.REVOKE_ACCESS_ON_DOCUMENT_UNSET,source:"internal",payload:{error:o}}),this.loggingService.catch("Error in UsersPermissionService revokeAccessOnDocumentUnset:",o)}})}getAccess(s){return g(this,arguments,function*({requests:e,userId:r}){let i={retryConfig:this.getPermissionProviderRetryConfig()};return this.isClientDevResolverActive()?i.clientResolvedResults=yield this.resolveClientSide(e):this.getPermissionProvider()?.dev&&this.warnNoResolverOnce(),this.sendGetAccessToProxy({requests:e,userId:r,metadata:i})})}sendGetAccessToProxy(i){return g(this,arguments,function*({requests:e,userId:r,metadata:s}){let t=V(this.functions,F({url:this.endpointsService.getCloudFunctionUrl("sdkProxy"),apiProxyDomain:this.configService?.getApiProxyDomain()}));return yield z({methodName:"getAccess",data:{type:"getAccess",data:e,metadata:s},getSdkProxy:t,userId:r})})}isClientDevResolverActive(){return!!this.getPermissionProvider()?.dev&&this.isClientDevResolverConfigured()}resolveClientSidePermissions(e){return g(this,null,function*(){if(!this.isClientDevResolverActive())throw new Error("Client-side dev permission resolver is not active");return this.resolveClientSide(e)})}isClientDevResolverConfigured(){let e=this.getPermissionProvider();return e?!!e.endpointConfig?.url?.trim()||typeof e.resolvePermissions=="function":!1}resolveClientSide(e){return g(this,null,function*(){this.warnClientResolverEnabledOnce();let r=this.getPermissionProvider(),s=this.getPermissionProviderRetryConfig(),i=r?.resolveTimeout??6e4,t=yield j(()=>this.withResolverTimeout(()=>this.invokeResolver(e,r),i),"clientPermissionResolver",{retryCount:s?.retryCount??0,retryDelay:s?.retryDelay??0});if(!t||!t.success||t.statusCode!==200)throw new Error(t?.message??"Client permission resolver failed");let o=t.data;if(!Array.isArray(o))throw new Error("Client permission resolver returned a malformed payload");return o})}invokeResolver(e,r){return g(this,null,function*(){let s={data:{requests:e}},i=r.endpointConfig?.url?.trim();if(i)return B(i,r.endpointConfig?.headers,s,!0,r.endpointConfig?.credentials);let t=yield r.resolvePermissions(s);if(Array.isArray(t))return{data:t,success:!0,statusCode:200};let o=t,c=o?.statusCode??(o?.success===!1?500:200),a=o?.success!==!1&&c===200;return{data:Array.isArray(o?.data)?o.data:void 0,success:a,statusCode:a?200:c===200?500:c,message:o?.message}})}withResolverTimeout(e,r){return g(this,null,function*(){if(!r||r<=0)return e();let s,i=new Promise((t,o)=>{s=setTimeout(()=>o(new Error("Client permission resolver timed out")),r)});try{return yield Promise.race([e(),i])}finally{s&&clearTimeout(s)}})}warnClientResolverEnabledOnce(){this.clientResolverProdWarned||(this.clientResolverProdWarned=!0,console.warn("[Velt] Client-side dev permission resolver is enabled (dev: true). Permissions are resolved in the browser for local development only \u2014 DO NOT use this in production. Production API keys ignore browser-resolved results and fall back to the server-side permission provider."))}warnNoResolverOnce(){this.clientResolverNoResolverWarned||(this.clientResolverNoResolverWarned=!0,console.warn("[Velt] setPermissionProvider was called with dev: true but no endpointConfig.url or resolvePermissions callback was provided. Falling back to the server-side permission provider."))}revokeAccess(i){return g(this,arguments,function*({requests:e,userId:r,currentContext:s}){let t=V(this.functions,F({url:this.endpointsService.getCloudFunctionUrl("sdkProxy"),apiProxyDomain:this.configService?.getApiProxyDomain()}));return yield z({methodName:"revokeAccess",data:{type:"revokeAccess",data:e,metadata:f({retryConfig:this.getPermissionProviderRetryConfig()},s?.access&&{currentContext:s})},getSdkProxy:t,userId:r})})}onResourceAccessRequired(o){return g(this,arguments,function*({requests:e,uniqueId:r,methodName:s,userId:i,fromCache:t=!0}){try{if(!e?.length)return;let c=[],a=this.getPermissionsCache()??[];if(!this.forceRefreshPermissions()&&t&&(e.forEach(n=>{let d=a?.find(h=>h.resourceId===n.resource.id&&h.type===n.resource.type&&h.userId===n.userId&&h.organizationId===n.resource.organizationId);d&&c.push(d)}),c.length>0&&(e=e.filter(n=>!c.find(d=>d.resourceId===n.resource.id&&d.type===n.resource.type&&d.userId===n.userId&&d.organizationId===n.resource.organizationId)))),e.length>0){this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.RESOURCE_ACCESS_REQUEST_TRIGGERED,timestamp:new Date().getTime(),uniqueId:r,methodName:s,source:"internal",payload:{requests:e,fromCache:t,clientResolved:this.isClientDevResolverActive()}});let n=yield this.getAccess({requests:e,userId:this.authService.getUser()?.userId??i??""});return this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.RESOURCE_ACCESS_RESULT,timestamp:new Date().getTime(),uniqueId:r,methodName:s,source:"internal",payload:{result:n,clientResolved:this.isClientDevResolverActive()}}),n?.success&&n?.data?.length&&(this.setPermissionsCache([...a,...n.data]),n.data=[...c,...n.data]),n}else if(c.length>0)return this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.RESOURCE_ACCESS_RESULT_FROM_CACHE,timestamp:new Date().getTime(),methodName:s,source:"internal",uniqueId:r,payload:{results:{data:c,success:!0,statusCode:200}}}),{data:c,success:!0,statusCode:200};return}catch(c){this.loggingService.catch("Error in UsersPermissionService onResourceAccessRequired:",c),this.coreActionsService.triggerAction(v.PERMISSION_PROVIDER,{event:E.Events.PermissionProvider.RESOURCE_ACCESS_ERROR,timestamp:new Date().getTime(),methodName:s,source:"internal",uniqueId:r,payload:{error:c,requests:e,fromCache:t}});return}})}getPermissionsCache(){return this.forceRefreshPermissions()?[]:this.permissionsCache$.getValue()}forceRefreshPermissions(){return this.getPermissionProvider()?.forceRefresh??!1}setPermissionsCache(e){try{let r=new Map;e.forEach(i=>{let t=`${i.userId}_${i.resourceId}_${i.organizationId}_${i.type}`;r.set(t,i)});let s=JSON.parse(JSON.stringify(Array.from(r.values())));this.permissionsCache$.next(s)}catch(r){this.loggingService.catch("Error in UsersPermissionService setPermissionsCache:",r)}}isPermissionProviderAvailable(){try{return!!this.permissionProvider$.getValue()}catch(e){return this.loggingService.catch("Error in UsersPermissionService isPermissionProviderAvailable:",e),!1}}getPermissionProvider(){try{return this.permissionProvider$.getValue()}catch(e){return this.loggingService.catch("Error in UsersPermissionService getPermissionProvider:",e),null}}getPermissionProvider$(){return this.permissionProvider$.asObservable()}};O.\u0275fac=function(r){return new(r||O)(P(Z),P(Q),P(X),P(se),P(ee),P(re),P(Y),P(W),P(q),P(ie))},O.\u0275prov=K({token:O,factory:O.\u0275fac,providedIn:"root"});let k=O;return k})();export{ye as a};
@@ -1 +1 @@
1
- import{Pa as s,Xa as a,Xc as c,li as n}from"./chunk-FXUDI3M6.js";var f=(()=>{let i=class i{constructor(t,r){this.domService=t,this.sanitizer=r}transform(t,r=!0){try{let o=r?this.domService.sanitizeHtml(t):t;return this.sanitizer.bypassSecurityTrustHtml(o)}catch{return t}}};i.\u0275fac=function(r){return new(r||i)(s(n,16),s(c,16))},i.\u0275pipe=a({name:"safeHtml",type:i,pure:!0});let e=i;return e})();export{f as a};
1
+ import{Pa as s,Xa as a,Xc as c,si as n}from"./chunk-YUWFUH6R.js";var f=(()=>{let i=class i{constructor(t,r){this.domService=t,this.sanitizer=r}transform(t,r=!0){try{let o=r?this.domService.sanitizeHtml(t):t;return this.sanitizer.bypassSecurityTrustHtml(o)}catch{return t}}};i.\u0275fac=function(r){return new(r||i)(s(n,16),s(c,16))},i.\u0275pipe=a({name:"safeHtml",type:i,pure:!0});let e=i;return e})();export{f as a};
@@ -1 +1 @@
1
- import{$ as c,B as s,J as a,ca as n,di as h,l as o}from"./chunk-FXUDI3M6.js";var u=(()=>{let r=class r{constructor(t){this.loggingService=t,this.toasts$=new o([])}setToast(t){try{t.id||(t.id=Math.random()),this.toasts$.next([...this.toasts$.value,t]),t.duration&&t.duration>0&&s(t.duration).pipe(a(1)).subscribe(()=>{this.removeToast(t)},i=>{this.loggingService.catch("Error in ToastService setToast timer subscription: ",i)})}catch(i){this.loggingService.catch("Error in ToastService setToast: ",i)}}removeToast(t){try{this.toasts$.next(this.toasts$.value.filter(i=>i.id!==t.id))}catch(i){this.loggingService.catch("Error in ToastService removeToast: ",i)}}getToasts$(){return this.toasts$.asObservable()}};r.\u0275fac=function(i){return new(i||r)(n(h))},r.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"});let e=r;return e})();export{u as a};
1
+ import{$ as c,B as s,J as a,ca as n,ki as h,l as o}from"./chunk-YUWFUH6R.js";var u=(()=>{let r=class r{constructor(t){this.loggingService=t,this.toasts$=new o([])}setToast(t){try{t.id||(t.id=Math.random()),this.toasts$.next([...this.toasts$.value,t]),t.duration&&t.duration>0&&s(t.duration).pipe(a(1)).subscribe(()=>{this.removeToast(t)},i=>{this.loggingService.catch("Error in ToastService setToast timer subscription: ",i)})}catch(i){this.loggingService.catch("Error in ToastService setToast: ",i)}}removeToast(t){try{this.toasts$.next(this.toasts$.value.filter(i=>i.id!==t.id))}catch(i){this.loggingService.catch("Error in ToastService removeToast: ",i)}}getToasts$(){return this.toasts$.asObservable()}};r.\u0275fac=function(i){return new(i||r)(n(h))},r.\u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"});let e=r;return e})();export{u as a};