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AAI,kEAAmE8B,EAAUjB,IAAYe,IAAUI,EAC7G,CAEAC,SACFlC,QAAQC,IAAI,6BACNJ,KAAKD,cAAcuC,SAAQC,GAAgBA,EAAaC,WAC5D,CAEAC,iBACItC,QAAQC,IAAI,uCACNJ,KAAKmC,gBACXnC,KAAKQ,WAAW,WAAWR,KAAKL,aACpC,CAEA8C,iCACFtC,QAAQC,IAAI,+CACNJ,KAAKH,gBAAiB,EACtBG,KAAKF,mBAAqBE,KAAKF,iBACnC,CAEA2C,sBACFtC,QAAQC,IAAI,oCAEwC,MAA1CS,SAASC,eAAe,gBAAqE,MAA3CD,SAASC,eAAe,kBAEpFd,KAAKqB,OAAQ,OAAM,CAAC,eAAe,iBAAkB,CACpDqB,QAAS,EACTC,WAAY,GACZC,UAAW,WACXC,OAAQ,SAAUC,GACjBrB,OAAOC,cAAc,IAAIC,MAAM,UAChC,EACAmB,MAAM,CAAC,GAAG,MAGT,GAnJH,GAAC,EAAAC,S,wDADWvD,EAAkB,GAD9B,EAAAwD,W,uBAiB8B,OAhBlBxD,E","sources":["webpack://client-app/./src/app/components/base-viewer-combined/base-viewer-combined.scss","webpack://client-app/./src/app/components/base-viewer-combined/base-viewer-combined.html","webpack://client-app/./src/app/components/base-viewer-combined/base-viewer-combined.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".base-viewer-container{height:100%;width:100%;overflow:hidden}.base-viewer-container .viewer3d-top{height:100%;position:relative;overflow:hidden;z-index:0}.base-viewer-container .viewer3d-top .base-small-2d-view{position:absolute;visibility:hidden;width:30%;height:300px;right:0;bottom:0;margin-right:5px;margin-bottom:5px;z-index:0}.base-viewer-container .viewer3d-top .base-small-2d-view .viewerContainer2d{border-radius:10px}.base-viewer-container .gutter.gutter-vertical{cursor:row-resize}.base-viewer-container .gutter.gutter-vertical::before{position:relative;display:flex;flex-direction:column;align-items:center;top:50%;transform:translateY(-50%);font-size:30px !important;content:\\\"\\\";font:var(--fa-font-solid)}.base-viewer-container .viewer2d-bottom{height:0%;position:relative;overflow:hidden}.base-viewer-container .takeoff-viewer-settings{background-color:#fff;z-index:11;position:absolute;height:calc(100% - 50px);border-top-left-radius:10px;border-bottom-left-radius:10px;padding:10px 20px;overflow:auto;width:350px;right:0%;z-index:10}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/components/base-viewer-combined/base-viewer-combined.scss\"],\"names\":[],\"mappings\":\"AAAA,uBAAA,WACI,CAAA,UACA,CAAA,eACA,CAAA,qCACA,WACI,CAAA,iBACA,CAAA,eACA,CAAA,SACA,CAAA,yDACA,iBACI,CAAA,iBACA,CAAA,SACA,CAAA,YACA,CAAA,OACA,CAAA,QACA,CAAA,gBACA,CAAA,iBACA,CAAA,SACA,CAAA,4EACA,kBACI,CAAA,+CAIZ,iBACI,CAAA,uDAEJ,iBACI,CAAA,YACA,CAAA,qBACA,CAAA,kBACA,CAAA,OACA,CAAA,0BACA,CAAA,yBACA,CAAA,WACA,CAAA,yBACA,CAAA,wCAEJ,SACI,CAAA,iBACA,CAAA,eACA,CAAA,gDAEJ,qBACI,CAAA,UACA,CAAA,iBACA,CAAA,wBACA,CAAA,2BACA,CAAA,8BACA,CAAA,iBACA,CAAA,aACA,CAAA,WACA,CAAA,QACA,CAAA,UACA\",\"sourcesContent\":[\".base-viewer-container {\\r\\n height: 100%;\\r\\n width: 100%;\\r\\n overflow: hidden;\\r\\n .viewer3d-top {\\r\\n height: 100%;\\r\\n position: relative;\\r\\n overflow: hidden;\\r\\n z-index:0;\\r\\n .base-small-2d-view {\\r\\n position:absolute;\\r\\n visibility: hidden;\\r\\n width: 30%;\\r\\n height: 300px;\\r\\n right: 0;\\r\\n bottom: 0;\\r\\n margin-right: 5px;\\r\\n margin-bottom: 5px;\\r\\n z-index: 0;\\r\\n .viewerContainer2d {\\r\\n border-radius: 10px;\\r\\n }\\r\\n }\\r\\n }\\r\\n .gutter.gutter-vertical {\\r\\n cursor: row-resize;\\r\\n }\\r\\n .gutter.gutter-vertical::before {\\r\\n position: relative;\\r\\n display: flex;\\r\\n flex-direction: column;\\r\\n align-items: center;\\r\\n top:50%;\\r\\n transform: translateY(-50%);\\r\\n font-size: 30px!important; //Needs to stay.\\r\\n content: \\\"\\\\f86c\\\";\\r\\n font: var(--fa-font-solid);\\r\\n }\\r\\n .viewer2d-bottom {\\r\\n height: 0%;\\r\\n position: relative;\\r\\n overflow: hidden;\\r\\n }\\r\\n .takeoff-viewer-settings {\\r\\n background-color: white;\\r\\n z-index: 11;\\r\\n position: absolute;\\r\\n height: calc(100% - 50px);\\r\\n border-top-left-radius: 10px;\\r\\n border-bottom-left-radius: 10px;\\r\\n padding: 10px 20px;\\r\\n overflow: auto;\\r\\n width: 350px;\\r\\n right:0%;\\r\\n z-index: 10;\\r\\n }\\r\\n}\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","module.exports = \"\\r\\n\";","import Split from \"split.js\";\r\nimport { autoinject,bindable } from 'aurelia-framework';\r\n\r\nimport {EventAggregator, Subscription} from \"aurelia-event-aggregator\";\r\nimport { Three_Sel } from \"../base-viewer-three-d/Three_Sel\";\r\n//import { Three_Sel } from \"app/project/quantity-takeoff/takeoff-viewer/takeoff-viewer\";\r\n\r\n@autoinject\r\nexport class BaseViewerCombined {\r\n\t@bindable threeSel:Three_Sel|undefined;\r\n\r\n\ttwoD_enabled:boolean = true;\r\n\r\n\t// (Note that we are NOT setting the @bindable decorator on this one.)\r\n\tBVC_openBimMode:boolean = true; // This is ONLY used in viewer-menu.html (we might even move it there.)\r\n\r\n private isViewerLoaded:boolean = false;\r\n private isSettingsVisible:boolean = false;\r\n\r\n private split: Split.Instance | undefined;\r\n private subscriptions: Subscription[] = [];\r\n\r\n\tprivate self:BaseViewerCombined;\r\n\r\n constructor(public events: EventAggregator) { this.self = this; }\r\n\r\n bind() {\r\n\t\tconsole.log('BaseViewerCombined.bind');\r\n this.subscriptions = [\r\n this.events.subscribe('WorkAreaContainer:ViewerSettingsPressed', () => { this.switchSettingsVisibility()}),\r\n this.events.subscribe('WorkAreaContainer:Move2d', () => { this.move2dViewDown()}),\r\n this.events.subscribe('base-viewer-combined:move2dView', () => { this.move2dView('event:_base-viewer-combined:move2dView',this.twoD_enabled)}),\r\n this.events.subscribe('base-viewer-combined:hide2d', () => { this.hide2dView()}),\r\n\r\n this.events.subscribe('base-viewer-combined:openBimModeToggled', (openBim:boolean) => { this.openBimModeToggled(openBim)}),\r\n ]\r\n }\r\n\topenBimModeToggled(openBim: boolean) { // (the subscribed event base-viewer-combined:openBimModeToggled)\r\n\t\tconsole.log('BVC.openBimModeToggled, event claims:', openBim, ', state BVC_openBimMode claims:', this.BVC_openBimMode);\r\n\t}\r\n\r\n hide2dView() { // a misguided? experiment.\r\n\t\tconsole.log('BaseViewerCombined.hide2dView, will now try to hide the 2d view. - twoD_enabled');\r\n\t\tthis.twoD_enabled = false;\r\n\r\n\t\t// Ser ikke ud til at virke.. is tied to concrete splitter IDs.\r\n\t\t//this.splitViewerResizeService.hide2dView();\t\t\r\n\r\n let smalldiv_2d: HTMLElement | null = document.getElementById('small-2d-view');\r\n let viewer_2d: HTMLElement | null = document.getElementById('viewer2d');\r\n if (!smalldiv_2d || !viewer_2d) { \r\n\t\t\tconsole.log('(nothing to hide)'); //'missing either', smalldiv_2d, viewer_2d)\r\n\t\t\treturn; \r\n\t\t} // can this work?\r\n\r\n\t\tconst is_viewerInSmallDiv:boolean = (smalldiv_2d.contains(viewer_2d));\r\n\t\tconsole.warn('was 2dviewer in smallDiv?', is_viewerInSmallDiv);\r\n\r\n if (!is_viewerInSmallDiv) { // ONLY do this, IFF viewer is NOT ALREADY a child of smallDiv!\r\n smalldiv_2d.style.visibility = \"none\"; // why not collapse?\r\n this.split?.setSizes([100,0]); \r\n console.log(`does split exist? [${this.split}]`,this.split );\r\n this.split?.destroy(); // her doer den for thomas. den bliver sur over, at den gutter den vil removeChild for ikke er i den forventede parent, eller omvendt.\r\n smalldiv_2d.appendChild(viewer_2d); // jeg har byttet om her, for at se om det hjaelper.\r\n // function destroy(preserveStyles, preserveGutter) \r\n }\r\n\r\n\t\t// both of these cause damage now - it refuses to resize..\r\n\t\t//this.move2dView('at end of hide2dView', true); //this.twoD_enabled);\r\n\t\t//this.move2dViewDown();//'at end of hide2dView'); // gav problemer\r\n\t\twindow.dispatchEvent(new Event('resize')); // THIS hack seems to work\r\n\t\tconsole.log('end of hide2dView');\r\n\t}\r\n\r\n move2dView(who:string, twoD_enabled:boolean) {\r\n let viewer_2d: HTMLElement | null = document.getElementById('viewer2d');\r\n let topView_3d: HTMLElement | null = document.getElementById('three-d-top');\r\n let bigDiv_2d: HTMLElement | null = document.getElementById('two-d-bottom');\r\n let smalldiv_2d: HTMLElement | null = document.getElementById('small-2d-view');\r\n\r\n\t\tconsole.log('BaseViewerCombined.move2dView, who:', who, 'twoD_enabled?', this.twoD_enabled, !!viewer_2d, !!topView_3d, !!bigDiv_2d, !!smalldiv_2d);\r\n\t\t//if (!this.twoD_enabled) { return; }\r\n\t\tif (!twoD_enabled) { return; }\r\n\r\n if (!smalldiv_2d || !viewer_2d || !bigDiv_2d) { return; } // (bah, forget about the resize-event below then.)\r\n\r\n\t\tif (smalldiv_2d.contains(viewer_2d)) {\r\n\t\t\tconsole.log('move2dView triggers handleDockTooBigDiv');\r\n\t\t\tthis.handleDockTooBigDiv(bigDiv_2d,viewer_2d,smalldiv_2d);\r\n\t\t} else { // (viewer_2d NOT currently in the smalldiv_2d)\r\n\t\t\tconsole.log('move2dView triggers destroySplit');\r\n\t\t\t// Make viewer_2d an inset overlayed on viewer3d, and let viewer3d take over all:\r\n\t\t\tsmalldiv_2d.style.visibility = \"visible\";\r\n\t\t\tsmalldiv_2d.appendChild(viewer_2d);\r\n\t\t\tthis.split?.setSizes([100,0]); \r\n\t\t\tthis.split?.destroy();\r\n\t\t} \r\n\r\n window.dispatchEvent(new Event('resize')); // hmm, why does that make sense, what does it do?\r\n }\r\n\r\n handleDockTooBigDiv(bigDiv: HTMLElement,viewer: HTMLElement,smalldiv: HTMLElement) {\r\n\t\tconsole.log('BaseViewerCombined.handleDockTooBigDiv');\r\n this.setupSplitter();\r\n bigDiv.appendChild(viewer);\r\n smalldiv.style.visibility = \"hidden\";\r\n this.split?.setSizes([50,50]); \r\n }\r\n\r\n move2dViewDown() {\r\n let viewer2d: HTMLElement | null = document.getElementById('viewer2d');\r\n let bigDiv: HTMLElement | null = document.getElementById('two-d-bottom');\r\n let smalldiv: HTMLElement | null = document.getElementById('small-2d-view');\r\n\r\n\t\tconst contains:boolean = !!(smalldiv && smalldiv.contains(viewer2d));\r\n if (smalldiv) {\r\n if (contains && bigDiv && viewer2d) {\r\n this.handleDockTooBigDiv(bigDiv,viewer2d,smalldiv);\r\n window.dispatchEvent(new Event('resize'));\r\n }\r\n }\r\n\t\tconsole.log('BaseViewerCombined.move2dViewDown, (smalldiv,contain,big,2d):', !!smalldiv, contains, !!bigDiv, !!viewer2d);\r\n }\r\n\r\n unbind() {\r\n\t\tconsole.log('BaseViewerCombined.unbind');\r\n this.subscriptions.forEach(subscription => subscription.dispose());\r\n }\r\n\r\n async attached() {\r\n console.log('base-viewer-combined:attached');\r\n await this.setupSplitter();\r\n this.move2dView('attached',this.twoD_enabled); //In quantity-takeoff it was wanted to start with the 2d-view docked to the 3d-view.\r\n }\r\n\r\n async switchSettingsVisibility() {\r\n\t\tconsole.log('BaseViewerCombined.switchSettingsVisibility');\r\n this.isViewerLoaded = true;\r\n this.isSettingsVisible = !this.isSettingsVisible;\r\n }\r\n\r\n async setupSplitter(): Promise {\r\n\t\tconsole.log('BaseViewerCombined.setupSplitter');\r\n\r\n if (document.getElementById('three-d-top') == null || document.getElementById('two-d-bottom') == null) { return; }\r\n\r\n\t\tthis.split = Split(['#three-d-top','#two-d-bottom'], {\r\n\t\t\tminSize: 0,\r\n\t\t\tgutterSize: 13,\r\n\t\t\tdirection: 'vertical',\r\n\t\t\tonDrag: function (sizes: any) {\r\n\t\t\t\twindow.dispatchEvent(new Event('resize'));\r\n\t\t\t},\r\n\t\t\tsizes:[50,50]\r\n\t\t});\r\n \r\n }\r\n \r\n}\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","BaseViewerCombined","constructor","events","twoD_enabled","BVC_openBimMode","isViewerLoaded","isSettingsVisible","subscriptions","this","self","bind","console","log","subscribe","switchSettingsVisibility","move2dViewDown","move2dView","hide2dView","openBim","openBimModeToggled","smalldiv_2d","document","getElementById","viewer_2d","is_viewerInSmallDiv","contains","warn","style","visibility","split","setSizes","destroy","appendChild","window","dispatchEvent","Event","who","topView_3d","bigDiv_2d","handleDockTooBigDiv","bigDiv","viewer","smalldiv","setupSplitter","viewer2d","unbind","forEach","subscription","dispose","async","minSize","gutterSize","direction","onDrag","sizes","bindable","autoinject"],"sourceRoot":""}