-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsrc_app_custom-elements_toc_toc_module_ts-es5.7d72dda4db5aeb6de915.js
2 lines (2 loc) · 8.13 KB
/
src_app_custom-elements_toc_toc_module_ts-es5.7d72dda4db5aeb6de915.js
1
2
!function(){function e(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var o,i,r=[],c=!0,a=!1;try{for(n=n.call(e);!(c=(o=n.next()).done)&&(r.push(o.value),!t||r.length!==t);c=!0);}catch(l){a=!0,i=l}finally{try{c||null==n.return||n.return()}finally{if(a)throw i}}return r}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var o=Object.prototype.toString.call(e).slice(8,-1);"Object"===o&&e.constructor&&(o=e.constructor.name);if("Map"===o||"Set"===o)return Array.from(e);if("Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return t(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function r(e,t){return(r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var n,o=l(e);if(t){var i=l(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return a(this,n)}}function a(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}(self.webpackChunkangular_cn=self.webpackChunkangular_cn||[]).push([["src_app_custom-elements_toc_toc_module_ts"],{7707:function(t,o,a){"use strict";a.r(o),a.d(o,{TocModule:function(){return Z}});var l=a(1116),s=a(4431),u=a(5959),d=a(1305),f=a(2709),p=a(5416),h=a(8318),y=a(2293),b=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}(o,e);var t=c(o);function o(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f.e;return n(this,o),(i=t.call(this)).source=e,i.delayTime=r,i.scheduler=c,(!(0,y.k)(r)||r<0)&&(i.delayTime=0),c&&"function"==typeof c.schedule||(i.scheduler=f.e),i}return i(o,[{key:"_subscribe",value:function(e){return this.scheduler.schedule(o.dispatch,this.delayTime,{source:this.source,subscriber:e})}}],[{key:"create",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f.e;return new o(e,t,n)}},{key:"dispatch",value:function(e){var t=e.source,n=e.subscriber;return this.add(t.subscribe(n))}}]),o}(h.y);function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(n){return n.lift(new m(e,t))}}var m=function(){function e(t,o){n(this,e),this.scheduler=t,this.delay=o}return i(e,[{key:"call",value:function(e,t){return new b(t,this.delay,this.scheduler).subscribe(e)}}]),e}(),g=a(6238),x=a(5366),w=a(2250),E=a(3387),k=["tocItem"];function I(e,t){1&e&&(x.TgZ(0,"div",7),x._uU(1," \u76ee\u5f55 "),x.qZA())}function _(e,t){if(1&e){var n=x.EpF();x.TgZ(0,"button",8),x.NdJ("click",function(){return x.CHM(n),x.oxw(2).toggle(!1)}),x._uU(1," \u76ee\u5f55 "),x._UZ(2,"mat-icon",9),x.qZA()}if(2&e){var o=x.oxw(2);x.uIk("aria-pressed",!o.isCollapsed),x.xp6(2),x.ekj("collapsed",o.isCollapsed)}}function T(e,t){if(1&e&&(x.TgZ(0,"li",11,12),x._UZ(2,"a",13),x.qZA()),2&e){var n=x.oxw(),o=n.$implicit,i=n.index,r=x.oxw(2);x.Tol(o.level),x.ekj("secondary","EmbeddedExpandable"===r.type&&i>=r.primaryMax)("active",i===r.activeIndex),x.s9C("title",o.title),x.xp6(2),x.Q6J("href",o.href,x.LSH)("innerHTML",o.content,x.oJD)}}function C(e,t){if(1&e&&(x.ynx(0),x.YNc(1,T,3,10,"li",10),x.BQk()),2&e){var n=t.$implicit,o=x.oxw(2);x.xp6(1),x.Q6J("ngIf","Floating"===o.type||"h1"!==n.level)}}function O(e,t){if(1&e){var n=x.EpF();x.TgZ(0,"button",14),x.NdJ("click",function(){return x.CHM(n),x.oxw(2).toggle()}),x.qZA()}if(2&e){var o=x.oxw(2);x.ekj("collapsed",o.isCollapsed),x.uIk("aria-pressed",!o.isCollapsed)}}function j(e,t){if(1&e&&(x.TgZ(0,"div",1),x.YNc(1,I,2,0,"div",2),x.YNc(2,_,3,3,"button",3),x.TgZ(3,"ul",4),x.YNc(4,C,2,1,"ng-container",5),x.qZA(),x.YNc(5,O,1,3,"button",6),x.qZA()),2&e){var n=x.oxw();x.ekj("collapsed",n.isCollapsed),x.xp6(1),x.Q6J("ngIf","EmbeddedSimple"===n.type),x.xp6(1),x.Q6J("ngIf","EmbeddedExpandable"===n.type),x.xp6(1),x.ekj("embedded","Floating"!==n.type),x.xp6(1),x.Q6J("ngForOf",n.tocList),x.xp6(1),x.Q6J("ngIf","EmbeddedExpandable"===n.type)}}var S,A=function(){var t=function(){function t(e,o,i){n(this,t),this.scrollService=e,this.tocService=i,this.activeIndex=null,this.type="None",this.isCollapsed=!0,this.isEmbedded=!1,this.onDestroy=new u.xQ,this.primaryMax=4,this.isEmbedded=-1!==o.nativeElement.className.indexOf("embedded")}return i(t,[{key:"ngOnInit",value:function(){var e=this;this.tocService.tocList.pipe((0,p.R)(this.onDestroy)).subscribe(function(t){e.tocList=t;var n,o=(n=function(e){return"h1"!==e.level},e.tocList.reduce(function(e,t){return n(t)?e+1:e},0));e.type=o>0?e.isEmbedded?o>e.primaryMax?"EmbeddedExpandable":"EmbeddedSimple":"Floating":"None"})}},{key:"ngAfterViewInit",value:function(){var t=this;this.isEmbedded||(0,d.aj)([this.tocService.activeItemIndex.pipe(v(f.E)),this.items.changes.pipe((0,g.O)(this.items))]).pipe((0,p.R)(this.onDestroy)).subscribe(function(n){var o=e(n,2),i=o[0],r=o[1];if(t.activeIndex=i,!(null===i||i>=r.length)){var c=r.toArray()[i].nativeElement,a=c.offsetParent,l=c.getBoundingClientRect(),s=a.getBoundingClientRect();l.top>=s.top&&l.bottom<=s.bottom||(a.scrollTop+=l.top-s.top-a.clientHeight/2)}})}},{key:"ngOnDestroy",value:function(){this.onDestroy.next()}},{key:"toggle",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.isCollapsed=!this.isCollapsed,e&&this.isCollapsed&&this.toTop()}},{key:"toTop",value:function(){this.scrollService.scrollToTop()}}]),t}();return t.\u0275fac=function(e){return new(e||t)(x.Y36(w.a),x.Y36(x.SBq),x.Y36(E.I))},t.\u0275cmp=x.Xpm({type:t,selectors:[["aio-toc"]],viewQuery:function(e,t){var n;(1&e&&x.Gf(k,5),2&e)&&(x.iGM(n=x.CRH())&&(t.items=n))},decls:1,vars:1,consts:[["class","toc-inner no-print",3,"collapsed",4,"ngIf"],[1,"toc-inner","no-print"],["class","toc-heading embedded",4,"ngIf"],["type","button","class","toc-heading embedded secondary","title","Expand/collapse contents","aria-label","Expand/collapse contents",3,"click",4,"ngIf"],[1,"toc-list"],[4,"ngFor","ngForOf"],["type","button","class","toc-more-items embedded material-icons","title","Expand/collapse contents","aria-label","Expand/collapse contents",3,"collapsed","click",4,"ngIf"],[1,"toc-heading","embedded"],["type","button","title","Expand/collapse contents","aria-label","Expand/collapse contents",1,"toc-heading","embedded","secondary",3,"click"],["svgIcon","keyboard_arrow_right",1,"rotating-icon"],[3,"title","class","secondary","active",4,"ngIf"],[3,"title"],["tocItem",""],[3,"href","innerHTML"],["type","button","title","Expand/collapse contents","aria-label","Expand/collapse contents",1,"toc-more-items","embedded","material-icons",3,"click"]],template:function(e,t){1&e&&x.YNc(0,j,6,8,"div",0),2&e&&x.Q6J("ngIf","None"!==t.type)},directives:[l.O5,l.sg,s.Hw],encapsulation:2}),t}(),Z=((S=function e(){n(this,e),this.customElementComponent=A}).\u0275fac=function(e){return new(e||S)},S.\u0275mod=x.oAB({type:S}),S.\u0275inj=x.cJS({imports:[[l.ez,s.Ps]]}),S)}}])}();
//# sourceMappingURL=src_app_custom-elements_toc_toc_module_ts-es5.7d72dda4db5aeb6de915.js.map