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,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACtE,CAAC;QAED,SAAS;YACL,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACvE,CAAC;KAOJ,CAAA;IA9BG;QADC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC;6DACc;IAHzB,oBAAoB;QAFhC,OAAO;QACP,gCAAO,CAAC,uCAAoB,EAAE,oCAAoC,CAAC;OACvD,oBAAoB,CAiChC;IAAD,2BAAC;KAAA;AAjCY,oDAAoB","file":"","sourceRoot":"/","sourcesContent":["import { CCPureView } from \"../../../../../common/classbase/CCViewBase\";\nimport { ImagePreviewViewProps, ImagePreviewView, ImagePreviewViewType } from \"../../type/ImagePreviewView\";\nimport { DummySprite } from \"../../../../../common/CCDummyObjects\";\nimport { ResUtils } from \"simba-cc-resutils\";\nimport { RegView } from \"../../../PresenterCCViewFactory\";\n\nconst { ccclass, property } = cc._decorator;\n\n@ccclass\n@RegView(ImagePreviewViewType, \"prefab/ui/message/ImagePreviewView\")\nexport class ImagePreviewViewImpl extends CCPureView<ImagePreviewViewProps> implements ImagePreviewView {\n //#region editor bindgins\n @property(cc.Sprite)\n private imageSprite = DummySprite;\n //#endregion\n\n private defaultImage: cc.SpriteFrame;\n\n onLoad() {\n super.onLoad();\n this.defaultImage = this.imageSprite.spriteFrame;\n this.bindProp(\"image\", async (value) => {\n if (!value) return;\n let sp = await ResUtils.loadRes(value, cc.SpriteFrame);\n if (this.node.parent && this._props.image === value) {\n this.imageSprite.spriteFrame = sp;\n }\n });\n }\n\n onEnable() {\n this.node.on(cc.Node.EventType.TOUCH_END, this.closeAction, this);\n }\n\n onDisable() {\n this.node.off(cc.Node.EventType.TOUCH_END, this.closeAction, this);\n }\n\n closeAction = () => {\n this.imageSprite.spriteFrame = this.defaultImage;\n delete this._props;\n this.close();\n }\n}"]}